Nano-RK is a real-time operating system (RTOS) from Carnegie Mellon University designed to run on micro-controllers for use in sensor networks. Nano-RK supports a fixed-priority fully preemptive scheduler with fine-grained timing primitives to support real-time task sets. "Nano" implies that the RTOS is small consuming 2K of RAM and using 18K of flash, while "RK" is short for Resource Kernel. A resource kernel provides reservations on how often system resources can be consumed. For example, a task might only be allowed to execute 10ms every 150ms (CPU Reservation), or a node might only be allowed to transmit 10 network packets per minute (Network Reservation). These reservations form a virtual energy budget to ensure a node meets its designed battery lifetime as well as protects a failed node from generating excessive network traffic. Nano-RK is open source, written in C and runs on the Atmel based FireFly sensor networking platform, the MicaZ motes as well as the MSP430 processor.
The following article  discusses some of the tradeoffs associated with using an RTOS in sensor networks.