Looks like this is an old thread being responded to.
Just in case there is still interest, I would consider
checking out Contiki
Here is the wikihttps://en.wikipedia.org/wiki/Contiki
The open source project webpagehttp://www.contiki-os.org/
It's been awhile since I have kept up on this, looks like it keeps moving ahead.
There was also tinyOS (www.tinyos.net
) but it has fallen behind the advancements contiki has made.