| With the development of embedded technology, embedded system has become widely-used. Because of the low cost with low-level micro-processor, it is still the first choice of many embedded systems. Currently, applications based on low-level micro-processor mainly adopt the mode of foreground/background systems. But there are many problems in these systems, for example, the difficulties of design and maintenance, the slow response of external event and the terrible real-timing. While adopting multi-task system is an effective approach to solve these problems and improve the performance of low-level micro-processor. However, due to a stringent requirement of storage resources, current embedded real-time operating systems are not feasible for low-level micro-processors with limited storage resources. Therefore, it is extremely useful to implement a new micro embedded real-time operating system.In this thesis, by analyzing relevant embedded real-time operating system technologies, a new portable micro embedded real-time operating system named mROS is implemented. It aims at 8-bit low-level micro-processor, and has four modules containing task management, task communication, time management and driver management.In the task management module, mROS adopts the priority based preemptive schedule strategy, decides the schedule time according to the wait signals from task control block. When the wait signals come, scheduler will immediately get executed, which guarantees the real-timing of the system. In the task communication module, mROS adopts the"signal plus command queue"idea, in terms of which, the signal solve the synchronization problem among tasks and the command queue is used to deliver the data. In the time management module, mROS adopts an independent control structure which is used to define the software timer. The timer-pulse of system drives software timers to work. In this way, timing and time delay can be achieved for tasks. In the driver management module, mROS adopts the idea of function pointer table, which masks the disparities from bottom-level hardware. This module provides the unified management of drivers for application designing. For the portable feature, mROS adopts the layered designing idea, the main code architecture is above the hardware abstraction level, the micro-processors architecture disparities is masked by hardware abstraction level. Finally, experiments are conducted on the low-level SCM STC89C58. Experimental results show that mROS has achieved the requirements of an embedded real-time operating system. At the aspect of storage, mROS has spared of 25% storage resources compared withμC/OS-Ⅱ. At the aspect of real-timing, mROS has achieved the level ofμC/OS-Ⅱ. |