Concepts in RT Systems
In this section, the key concepts associated with an RT system are introduced. These concepts define the basic framework for design and analysis of an RT system.
RT Operating System (RTOS)
In the most general case, an RT system consists of a number of tasks programmed to run in an RTOS environment of varying complexity. The general requirements of an RTOS may be enumerated as follows:
- • The operating system (OS) must support fixed-priority preemptive scheduling for tasks (both threads and processes, as applicable).
- • Interrupts must have a fixed upper bound on latency. By extension, nested interrupt support is required.
- • The OS kernel must be pre-emptible.
- • OS services must execute at a priority determined by the client of the service.
- • A special requirement (for systems with small memory): the kernel should be small.
- • User control over OS policies: scheduling and memory allocation.
- • Tasks are usually kept fixed in memory and do not use virtual memory.
- • Support for multitasking, synchronization, intertask communications, and timer functions.
These requirements ensure that the basic requirement of deterministic response time is met in an RTOS as opposed to a general purpose operating system (GPOS).
An RTOS can be categorized into three basic categories as follows:
- 1. Kernels for embedded applications—Typical examples are VxWorks , MATLAB xPC target, QNX, Windows CE , OSE (for mobile phone applications) , OSEK (automotive applications) , and TinyOS (Wireless Sensor Nodes) . The choice of the kernel depends on the complexity of the application, code size, and response time requirements. Response times as low as 100 ps are achievable with some of these kernels, and typical application code sizes range from 1 KB to 1 MB.
- 2. GPOS with RT extensions—Typical examples are RT Linux and Windows NT. These RTOSs, like the RT Linux, for example, have an
RT extender, which is implemented as a kernel between the standard GPOS kernel and the hardware. This kernel allows the user to specify RT attributes for tasks and provides functionalities for achieving an RT response. In RT Linux, for example, the RT extender runs standard Linux calls at a lower priority compared to an RT system call. The RT extender filters only RT system calls and no RT system calls are handled by the GPOS kernel. These systems are capable of supporting much larger applications but have larger response times compared to kernels for embedded applications.
3. RT programming languages with runtime systems—A typical examples is RT Java.
This book introduces the basic concepts of RT systems applicable for RTOS categories 1 and 2, since most of the RT applications are built on such RTOSs.