1. uC/OS-II file structure
2. uC/OS-II Components
UC/OS-II can be roughly divided into the system core (including task scheduling), task management, time management, multi-task synchronization and communication, memory management, CPU transplantation and other parts.
(1) core part (oscore. c): uC/OS-II processing core, including initialization, startup, interrupt management, clock interrupt, task scheduling and event processing functions for basic maintenance of the system.
(2) Task Management (ostask. c): Contains functions closely related to task operations, including task creation, deletion, suspension, and recovery. uC/OS II schedules tasks as the basic unit.
(3) clock part (ostime. c): the smallest unit of clock in UC/OS-II is timetick, which contains time delay, clock settings and clock recovery and other clock-related functions.
(4) multi-task synchronization and Communication (osmbox. c, OSQ. c, ossem. c, osmutex. c, osflag. c): Contains event management functions, including mbox, msgq, SEM, mutex, and flag.
(5) memory management part (osmem. c): it is mainly used to build a private memory partition management mechanism, including creating mempart, applying for/releasing mempart, and obtaining partition information.
(6) CPU interface part: uC/OS-II for specific CPU transplantation part, due to the involvement of SP and other system pointers, usually written in assembly language, including task switching, interrupt processing and other content.
3. uC/OS-II task status
In uC/OS-II, a task is a thread that can be thought of as its own CPU. The task has its own stack and CPU register, and is given a certain priority. A task may be in sleep, ready, running, waiting, or interrupted service status.
4. Comparison of uC/OS-II and VxWorks