I've actually been writing a small OS-like system for the PIC24 line of 16bit microcontrollers to make my own life a little easier. Its written in a mix of C and PIC24 assembly. I'm trying to write as much as possible in assembly (without making the task too difficult), so that I know exactly how many cycles a given function takes (which will be useful for RTOS features; but I'm doing MIDI/audio stuff, so low (or at least, deterministic) latency is important to me). Its still lacking most important features, but so far it can do premptive multitasking and contains a few handy utilities (cycle accurate microsecond and millisecond delays, stuff for configuring peripherals, task management (create, start, suspend tasks) and the start of a driver interface).
At the moment, IPC is very simple: since there is no memory protection, tasks can access each others memory. I have a very simple mutex implementation (basically, a spinlock where tasks yield if the mutex is locked) to protect shared memory, but so far thats it. I plan on supporting a maibox/messaging system sometime soon. I still have not got a memory management system though, so tasks need to know ahead of time what memory they may use. Currently, tasks are all within the one program binary (ie, no runtime program loading yet), so the C compiler can handle most of this, butI cannot use malloc unless I temporarily turn off premptive multitasking. I cant just turn off interrupts because PIC24's only allow you to turn off interrupts for a known number of cycles and I don't know how many cycles malloc may take.
I have already got some UART code to interface with a bluetooth module, and I plan on writing a little shell for it soon, so that I can connect to it from a laptop/desktop over bluetooth.
I also want to expand the scheduler/multitasking to have more RTOS-like features: task priorities, higher priority tasks pre-empt lower priority tasks, deadlines (and an error system for when deadlines are not met) etc
Another thing I would like to add reasonably soon is an SD Card interface and FAT driver, so that I can load files/programs/configuration from SD cards.
Finally, I need to finish the driver interface and write some drivers for my most commonly used peripherals (planned devices I plan to support for my own use: various types of buttons, analog input devices (sliders, pots), seven segment displays, LCDs, SRAM modules, USB devices (some of the devices I am developing for have USB OTG), an RF module I have, a way for two devices running my OS to talk to each other over SPI, eventually ethernet).
Not terribly large. Not more than 2 or 3 KB of program memory right now (and probably half the amount of data memory). I expect it to grow to maybe 10 KB of program memory (not including user programs, and later when I have loads of drivers, I expect to only include the ones actually used - or dynamically load them off an SD Card).
The PIC24's are fairly beefy devices. 16bit, 40MIPS (for the HJ's, 16 MIPS for the F's and 32 for the dsPIC), a few different I/O pin options in case you need lots of pins... The PIC24H range of microcontrollers I'm currently using have from 12 KB up to 256 KB of program memory and from 1 KB to about 16 KB of data RAM. The PIC24F range have the same range of flash and up to 96 KB of RAM. The newly released PIC24E has 256 KB and 512 KB program memory versions and come in 28 KB and 52 KB data variants (and run at 60 MIPS).
So, currently, they have more than enough space available to comfortably fit anything I throw at it, but if I start to run out, I will 1) add additional external SRAM and/or flash, 2) add the ability to dynamically load programs from SD Cards and 3) have a way of stripping out features that aren't used (since its a microcontroller, its unlikely that a driver will ever be needed if its not needed from the start, unless its a driver for, eg, a USB (or some other hot-pluggable or easily replaceable) device, since most devices would be permenantly connected.)
At the moment, IPC is very simple: since there is no memory protection, tasks can access each others memory. I have a very simple mutex implementation (basically, a spinlock where tasks yield if the mutex is locked) to protect shared memory, but so far thats it. I plan on supporting a maibox/messaging system sometime soon. I still have not got a memory management system though, so tasks need to know ahead of time what memory they may use. Currently, tasks are all within the one program binary (ie, no runtime program loading yet), so the C compiler can handle most of this, butI cannot use malloc unless I temporarily turn off premptive multitasking. I cant just turn off interrupts because PIC24's only allow you to turn off interrupts for a known number of cycles and I don't know how many cycles malloc may take.
I have already got some UART code to interface with a bluetooth module, and I plan on writing a little shell for it soon, so that I can connect to it from a laptop/desktop over bluetooth.
I also want to expand the scheduler/multitasking to have more RTOS-like features: task priorities, higher priority tasks pre-empt lower priority tasks, deadlines (and an error system for when deadlines are not met) etc
Another thing I would like to add reasonably soon is an SD Card interface and FAT driver, so that I can load files/programs/configuration from SD cards.
Finally, I need to finish the driver interface and write some drivers for my most commonly used peripherals (planned devices I plan to support for my own use: various types of buttons, analog input devices (sliders, pots), seven segment displays, LCDs, SRAM modules, USB devices (some of the devices I am developing for have USB OTG), an RF module I have, a way for two devices running my OS to talk to each other over SPI, eventually ethernet).