kaOS project is real-time, multithreaded, preemptive operating system for the Atmel Mega32 microcontroller. It can loads and executes programs from a Secure Digital or MMC card. The system waits for a card to be inserted and a reset button to be pressed, at which point a program is loaded from the card and executed. At any time, a new card with a new program can be inserted and run. Executing a new program doesn’t require reprogramming the Atmel processor. The Operating System supports multiple threads, cross-thread messaging, dynamic memory allocation, dynamic thread creation, semaphores and much more.
The project consists of two main part: the operating system itself and the card reader and program loader. The card reader is accessed via the Atmel’s SPI interface by the program loader, which places the program into flash memory.
For more detail: AVR Based Operating System using ATMega32 microcontroller