There are many reasons why you don't want a general purpose OS for a microcontroller:<p>- Embedded systems are <i>very</i> price sensitive. if you're making it general purpose, you're wasting money.<p>- Embedded systems generally have some form of real-time requirements. General Purpose OSes are not suitable here.<p>- Time-Efficiency; don't waste cycles.<p>- Space-efficiency; don't waste memory.<p>- power-efficiency; be asleep as much as possible.<p>Simple schedulers such as FreeRTOS/RTX/ChibiOS/etc/etc/etc are much more suitable, but better just to implement a nice simple super-loop. Primitive but efficient.
Not really for "microcontrollers" in general, more for top end chips.<p>I often wonder if there is a nice super portable OS for your more "average" microcontroller, something in the ballpark of 16bit, 32k program space, and 2k of RAM. Also an alternative to C for something in that ballpark would be fantastic.