R8C Family General RTOS Concepts
Features of RTOS
The design of an RTOS is essentially a balance between providing a reasonably rich feature set for application development and deployment and, not sacrificing predictability and timeliness. A basic RTOS will be equipped with the following features:
i. Multitasking and Preemptibility An RTOS must be multi-tasked and preemptible to support multiple tasks in real-time applications. The scheduler should be able to preempt any task in the system and allocate the resource to the task that needs it most even at peak load.
ii. Task Priority
Preemption defines the capability to identify the task that needs a resource the most and allocates it the control to obtain the resource. In RTOS, such capability is achieved by assigning individual task with the appropriate priority level. Thus, it is important for RTOS to be equipped with this feature.
iii. Reliable and Sufficient Inter Task Communication Mechanism
For multiple tasks to communicate in a timely manner and to ensure data integrity among each other, reliable and sufficient inter-task communication and synchronization mechanisms are required.
iv. Priority Inheritance
To allow applications with stringent priority requirements to be implemented, RTOS must have a sufficient number of priority levels when using priority scheduling.
v. Predefined Short Latencies An RTOS needs to have accurately defined short timing of its system calls. The behavior metrics are:
Task switching latency: The time needed to save the context of a currently executing task and switching to another task is desirable to be short.
Interrupt latency: The time elapsed between execution of the last instruction of the interrupted task and the first instruction in the interrupt handler.
Interrupt dispatch latency. The time from the last instruction in the interrupt handler to the next task scheduled to run.
Control of Memory Management
To ensure predictable response to an interrupt, an RTOS should provide way for task to lock its code and data into real memory.
The architecture of an RTOS is dependent on the complexity of its deployment. Good RTOSs are scalable to meet different sets of requirements for different applications. For simple applications, an RTOS usually comprises only a kernel. For more complex embedded systems, an RTOS can be a combination of various modules, including the kernel, networking protocol stacks, and other components as illustrated in Figure 3.
Figure 3 General Architecture of RTOS
Page 5 of 18