μC/OS-Ⅱ is an open source real-time kernel adopting priority preemptive schedule strategy. Aiming at the problem of μC/OS-Ⅱ failing to support homology priority tasks scheduling, an approach for solution is proposed. The basic idea is adding round-robin scheduling strategy in its original scheduler in order to schedule homology priority tasks through time slice roundrobin. Implementation approach is given in detail. Firstly, the Task Control Block (TCB) is extended. And then, a new priority index table is created, in which each index pointer points to a set of homology priority tasks. Eventually, on the basis of reconstructing μC/OS-Ⅱ real-time kernel, task scheduling module is rewritten. Otherwise, schedulability of homology task supported by modified kernel had been analyzed, and deadline formula of created homology tasks is given. By theoretical analysis and experiment verification, the modified kernel can support homology priority tasks scheduling, meanwhile, it also remains preemptive property of original μC/OS-Ⅱ.
IntroductionμC/OS-Ⅱ is an embedded real-time operation system with open source code. It is widely applied for embedded real-time application development because of its reliability, high efficiency, portability and preemptive scheduling property [1] . As a real-time operation system with preemptive kernel, μC/OS-Ⅱ has many strong functions that can be compared with some commercial kernel [2,3] . However, while developing real-time application based on μC/OS-Ⅱ, every created real-time task must assign a unique priority different from other tasks', namely, μC/OS-Ⅱ can not support homology priority tasks scheduling. In practical real-time application, some tasks, which realize identical function, should have same priority and could be scheduling by RTOS [4] . It is not a good logical design for assigning different priority to this kind of tasks. For instance, in heat-treating furnace cluster control system, multi-point temperature collection tasks of individual heat-treating furnaces should have same priority. Nevertheless, such tasks can not be scheduled in μC/OS-Ⅱ. To support homology priority tasks scheduling, μC/OS-Ⅱ kernel schedule function should be extended. Consequently, round-robin scheduling method is added so as to allow μC/OS-Ⅱ scheduling homology priority tasks after reconstructing its real-time kernel and rewriting its scheduling module.