## 1 Introduction  
With the recent advances in microelectronic, computing and communication technologies, wireless sensor network (WSN) nodes have become physically smaller and more inexpensive. As a result, WSN technology has become increasingly popular in widespread application domains [1; 2]. Since WSN nodes are minimized in physical size and cost, they are mostly restricted to platform resources such as processor computation ability, memory resources and energy supply. The constrained platform resources and diverse application requirements make software development on the WSN platform complicated. On the one hand, the software running on the WSN platform should be small in the memory footprint, low in energy consumption and high in execution efficiency. On the other hand, the diverse application development requirements, such as the real-time guarantee and the high reprogramming performance, should be met by the WSN software. The operating system (OS) technology is significant for the WSN proliferation. An outstanding WSN OS can not only utilize the constrained WSN platform resources efficiently, but also serve the WSN applications soundly. Currently, a set of WSN OSes have been developed, such as the TinyOS [3], the Contiki [4], the SOS [5], the openWSN [6] and the mantisOS [7]. However, many OS development challenges still exist. Firstly, most WSN OSes are either event-driven or multithreaded ones. The event-driven OSes cost less in data memory, but rate poorly in real-time performance. The multithreaded OSes are good in real-time performance but high in data memory cost [8]. Since most WSN nodes are constrained in the memory resources and the real-time guarantee is required by many WSN applications, the development of a WSN OS which is high in real-time performance yet low in memory footprint is a critical challenge. Secondly, the RAM resources on most WSN nodes are precious and need to be utilized efficiently. To utilize the RAM resources efficiently, dynamic allocation needs to be implemented. However, many WSN OSes use the static allocation, such as the TinyOS and the openWSN. With these OSes, the utilization efficiency of the memory resources is low. Some other OSes like the Contiki and mantisOS implement dynamic allocators. However, the allocators are either inflexible or cannot address the memory fragmentation challenge well. Therefore, performance improvement for these allocators is needed. Thirdly, the application programming and reprogramming processes on most current WSN OSes are complicated. The programming is complicated because different application programming patterns are supported by different WSN OSes, thus the users need to understand the diverse low-level system details to begin programming. The reprogramming is complicated because the application part in many WSN OSes is not decoupled from the system part. Thus, the monolithic software image, which can be larger than 100 kilobytes, needs to be updated during the reprogramming process. This process is difficult to complete as the energy resource on the WSN nodes is constrained and the communication bandwidth in the WSN is limited. Therefore, the development of a WSN OS that can on the one hand simplify the application programming complexity, and on the other hand improve the application reprogramming performancebecomes essential. Finally, the energy resource on most WSN nodes is constrained. To prolong the WSN nodes' lifetime and avoid the labor work of bringing the deployed nodes back for the power recharging, the energy conservation mechanism needs to be realized. The current sleep/wakeup mechanism used in most OSes for energy conservation is not quite adequate. To reduce significantly energy consumption, a new energy conservation approach becomes essential. In this article, a new hybrid, real-time, memory-efficient, energy-efficient, user-friendly and fault-tolerant WSN OS MIROS is designed and implemented.