| Real-time systems are used when rigid time requirements have been placed on the operation of a processor or the flow of data; thus, it is often used as a control device in a dedicated application. A real-time system has well-defined, fixed time constrains. Processing must be done with the defined constrains, or the system will fail. The operating system, and in particular the scheduler, is perhaps the most important component of a real-time system.In this paper, we chose μC/OS- Ⅱ -a real-time kernel with all source code available as the archetype for building our real-time operating system model. Due to its unique Ready List structure, μC/OS- Ⅱ behaves efficiently in task scheduling. But it achieved this at a cost that no task can share the same priority. This paper presents an improved task scheduling method by extending the Ready List structure of μC/OS- Ⅱ to eliminate the restriction mentioned above. On the basis of that, a round robin scheduling method among two or more tasks having the same priority is given. Furthermore, we were aware of another defect about task stack in μC/OS-Ⅱ kernel. These defects induce serious memory cost, which is inappropriate in most real-time embedded applications. We improved it by introducing a new stack layout into the original μC/OS- Ⅱ kernel. In the end, we study the method of porting μC/OS- Ⅱ on ARM architectures and presented some critical codes section to illustrate our method. |