Nil RTOS
Kernel Concepts

Nil RTOS Kernel Concepts

Ignore the Rest of this Page

This page has not been edited for Nil RTOS.

Naming Conventions

Nil RTOS APIs are all named following this convention: nil<group><action><suffix>(). The possible groups are: Sys, Thd, Sem.

API Name Suffixes

The suffix can be one of the following:

Examples: nilThdSleep(), nilSemSignalI(), nilSysHalt().

Interrupt Classes

In ChibiOS/RT there are three logical interrupt classes:

The mapping of the above logical classes into physical interrupts priorities is, of course, port dependent. See the documentation of the various ports for details.

System States

When using ChibiOS/RT the system can be in one of the following logical operating states:

Note that the above states are just Logical States that may have no real associated machine state on some architectures. The following diagram shows the possible transitions between the states:

Scheduling

The strategy is very simple the currently ready thread with the highest priority is executed.

A thread's priority is determined by its position in the thread table with higest priority first.

Thread States

Priority Levels

Thread Working Area

Each thread has its own stack, a Thread structure and some preemption areas. All the structures are allocated into a "Thread Working Area", a thread private heap, statically declared in your code. Threads do not use any memory outside the allocated working area except when accessing static shared data.

Note that the preemption area is only present when the thread is not running (switched out), the context switching is done by pushing the registers on the stack of the switched-out thread and popping the registers of the switched-in thread from its stack. The preemption area can be divided in up to three structures:

See the port documentation for details, the area may change on the various ports and some structures may not be present (or be zero-sized).