uC-OS-III CPU Independent Source Code

The files in these directories are µC/OS-III processor independent files provided in source form.

\Micrium
    \Software
        \uCOS-III
            \Cfg\Template
                \os_app_hooks.c
                \os_cfg.h
                \os_cfg_app.h
            \Source
                \os.h
                \os_cfg_app.c
                \os_core.c
                \os_dbg.c
                \os_flag.c
                \os_mem.c
                \os_msg.c
                \os_mutex.c
                \os_prio.c
                \os_q.c
                \os_sem.c
                \os_stat.c
                \os_task.c
                \os_tick.c
                \os_time.c
                \os_tmr.c
                \os_trace.h
                \os_type.h
                \os_var.c
            \TLS
                \<tool>
                    \os_tls.c
            \Trace
                \<tool>
                    \Cfg
                        \Template
                            \*.h
                    \Source  
                        \os_trace_events.h
                    \ThirdPartyLibrary  
                        \*.*                      

\Micrium

Contains all software components and projects provided by Micriµm.

\Software

This sub-directory contains all software components and projects.

\uCOS-III

This is the main µC/OS-III directory.

\Cfg\Template

This directory contains examples of configuration files to copy to the project directory. You will then modify these files to suit the needs of the application.

os_app_hooks.c shows how to write hook functions that are called by µC/OS-III. Specifically, this file contains eight empty functions.

os_cfg.h specifies which features of µC/OS-III are available for an application. The file is typically copied into an application directory and edited based on which features are required from µC/OS-III. See Appendix B, “µC/OS-III Configuration Manual”.

os_cfg_app.h is a configuration file that is typically copied into an application directory and edited based on application requirements. This file enables the user to determine the size of the idle task stack, the tick rate, the number of messages available in the message pool and more. See Appendix B, “µC/OS-III Configuration Manual”.

\Source

The directory containing the CPU-independent source code for µC/OS-III. All files in this directory should be included in the build. Features that are not required will be compiled out based on the value of #define constants in os_cfg.h and os_cfg_app.h.

os.h contains the main µC/OS-III header file, which declares constants, macros, µC/OS-III global variables (for use by µC/OS-III only), function prototypes, and more.

os_cfg_app.c declares variables and arrays based on the values in os_cfg_app.h.

os_core.c contains core functionality for µC/OS-III such as OSInit() to initialize µC/OS-III, OSSched() for the task level scheduler, OSIntExit() for the interrupt level scheduler, pend list (or wait list) management (see Pend Lists), ready list management (see Ready List in General Statistics - Run-Time), and more.

os_dbg.c contains declarations of constant variables used by a kernel aware debugger or µC/Probe.

os_flag.c contains the code for event flag management. See Synchronization for details about event flags.

os_mem.c contains code for the µC/OS-III fixed-size memory manager, see Memory Management API Changes.

os_msg.c contains code to handle messages. µC/OS-III provides message queues and task specific message queues. os_msg.c provides common code for these two services. See Message Passing.

os_mutex.c contains code to manage mutual exclusion semaphores, see Resource Management.

os_prio.c contains the code to manage the bitmap table used to keep track of which tasks are ready-to-run, see The Ready List. This file can be replaced by an assembly language equivalent to improve performance if the CPU used provides bit set, clear and test instructions, and a count leading zeros instruction.

os_q.c contains code to manage message queues. See Message Passing.

os_sem.c contains code to manage semaphores used for resource management and/or synchronization. See Resource Management and Synchronization.

os_stat.c contains code for the statistic task, which is used to compute the global CPU usage and the CPU usage of each task. See About Task Management.

os_task.c contains code for managing tasks using OSTaskCreate(), OSTaskDel(), OSTaskChangePrio(), and many more. See About Task Management.

os_tick.c contains code to manage tasks that have delayed themselves or that are pending on a kernel object with a timeout. See About Task Management.

os_time.c contains code to allow a task to delay itself until some time expires. See Time Management.

os_tmr.c contains code to manage software timers. See Timer Management.

os_trace.h contains code to define the default trace macros. See Trace.

os_type.h contains declarations of µC/OS-III data types that can be changed by the port designer to make better use of the CPU architecture. In this case, the file would typically be copied to the port directory and then modified. See Appendix B, “µC/OS-III Configuration Manual”.

os_var.c contains the µC/OS-III global variables. These variables are for µC/OS-III to manage and should not be accessed by application code.

\TLS\<tool>

The directory containing the compiler interface functions that allow library functions to be thread safe. If this feature is not required then you can omit the files in this directory.

os_tls.c provides the compiler specific thread safe interface functions for the specific <tool>.  Note that the brackets are not included.

\Trace\<tool>\Cfg\Template\*.h

The directory containing the configuration template files to configure the third-party tool code of choice to record the µC/OS-III trace. If this feature is not required then you can omit the entire \Trace directory.

\Trace\<tool>\Source\os_trace_events.h

This file provides the interface between the trace macros called throughout µC/OS-III and the actual functions that record such events depending on your trace recorder tool of choice. If this feature is not required then you can omit the entire \Trace directory.

\Trace\<tool>\ThirdPartyLibrary\*.*

The directory containing the third-party tool code of choice to record the µC/OS-III trace. If this feature is not required then you can omit the entire \Trace directory.