| The Internet of Things is a new concept of the development of informationtechnology, it is on the basis of the Internet, with the use of RFID, wireless datacommunication technology, to construct an "Internet of Things" covers everything in theworld. As an important part of the Internet of Things, wireless sensor network is afrontier research topic which is currently paid high international attention to and highlyoverlapped by the multi-disciplinary. Wireless sensor network operating system is thebasic software environment for wireless sensor network, and the basis of thedevelopment of many wireless sensor network applications. The efficiency, flexibilityand real-time of Wireless sensor network operating system directly affect theperformance of the system, so it is necessary to solve some typical problems of wirelesssensor network from the aspect of wireless sensor network operating system, such asreal time. However, the characteristics of wireless sensor networks bring challenges forthe design of Wireless sensor network operating system.The features of wireless sensor network such as large scale and strong dynamicitydetermine the node operating system should have the features of modular andconcurrency operation satisfied. Sensor nodes have the features of low power andlimited space, which determines the design of the operating system to meet the featuresof miniaturization. For the characteristics of wireless sensor network applications suchas concurrent operation is frequent and real-time communication is strong, a kind ofmicro embedded sensor-network operating system named mesOS is implemented in thisthesis, event-driven mechanism is used to meet the requirements of frequent concurrentoperation in the system, real time is the primary goal in the design of scheduler. Atpresent, mesOS mainly includes task scheduling module, time management module andcommunication module.In task scheduling module, tasks are classified processed, task queue are dividedinto three kinds of priority queue, and introducing the preemption in the highest priorityqueue, two preemptive principles are designed in order to reduce the time of taskswitching, a task in the highest priority queue can preempt the task running in otherqueues only when it satisfies preemptive principles. In the time management module,mesOS adopts an independent control structure which is used to define the softwaretimer. Software timer use the timer-pulse of system for timing, the source of timer-pulse is hardware timer and timer-pulse’s accuracy depends on the different applications. Incommunication module, the most basic communication message data format is designedin the system and the basic message transmission and reception function are realized. Inorder to facilitate the management of messages, mesOS sets a message buffer for storingthe received message in message reception function.Finally, mesOS is ported and experiments are conducted. Experimental results showthat mesOS can run correctly and achieves good results in real-time, miniaturization andflexibility. |