Chapter 3
Software Frameworks for Real-time and Embedded Systems
3.1 Real-time operating system
Real-time operating system (RTOS)is an operating system intended to serve real time application
that process data as it comes in, mostly without buffer delay. In a RTOS, Processing time
requirement is calculated in tenths of second’s increments of time. It is time-bound system that
can be defined as fixed time constraints. In this type of system, processing must be done inside
the specified constraints. Otherwise, the system will fail. Real-time operating systems are widely
used in airline traffic control systems, Command Control Systems, airline reservation systems,
Heart pacemakers, Network Multimedia Systems, robots, etc.
RTOS Examples:
1.FreeRTOS: FreeRTOS is a popular open-source Real time OS. It is designed for
microcontrollers and small embedded systems.
2.VxWorks: VxWorks is a real time operating system developed by Wind River Systems. It is
widely used in the aerospace, defense, and industrial automation industries.
3.QNX: QNX is a commercial real time operating system developed by BlackBerry. It is used in
mission-critical applications such as automotive, medical devices, and nuclear power plants.
4.ThreadX: ThreadX is a real time operating system developed by Express Logic. It is widely
used in consumer electronics, medical devices, and automotive applications.
5.Nucleus RTOS: Nucleus RTOS is a real time operating system developed by Mentor
Graphics. It is used in a wide range of applications, including consumer electronics, medical
devices, and automotive systems.
Why use an RTOS?
It offers priority-based scheduling, which allows you to separate analytical processing
from non- critical processing.
The Real time OS provides API functions that allow clear and smaller application code.
Abstracting timing dependencies and the task-based design results in fewer
interdependencies between modules.
RTOS offers modular task-based development, which allows modular task-based testing
The task-based API encourages modular development as a task, will typically have a
clearly defined role. It allows designers/teams to work independently on their parts of the
project.
An RTOS is event-driven with no time wastage on processing time for the event which is
not occurring.
Components of RTOS
Figure 3.1 Components of RTOS
The Scheduler: This component of RTOS tells that in which order, the tasks can be executed
which is generally based on the priority.
Symmetric Multiprocessing (SMP): It is a number of multiple different tasks that can be
handled by the RTOS so that parallel processing can be done.
Function Library: It is an important element of RTOS that acts as an interface that helps you to
connect kernel and application code. This application allows you to send the requests to the
Kernel using a function library so that the application can give the desired results.
Memory Management: this element is needed in the system to allocate memory to every
program, which is the most important element of the RTOS.
Fast dispatch latency: It is an interval between the termination of the task that can be identified
by the OS and the actual time taken by the thread, which is in the ready queue, which has started
processing.
User-defined data objects and classes: RTOS system makes use of programming languages
like C or C++, which should be organized according to their operation
Characteristics of RTOS
Reliability: It operates for a reasonably long time without human interference. Reliability also means the
configuration to enable the system to choose the right or most profitable action for current operations.
For example, a system for the telecom or banking industries needs to consider the cost of terminating or
engaging certain actions, compared to a phone or calculator whose cost is limited to an individual.
Predictability: A system must execute actions within a known time frame and produce known results.
Such results are determined by the procedures or operations taking place. The determination is by
targets set during production or procedural planning.
Performance: real-time operating systems are designed to make work easier. Every system must solve a
problem or reduce the workload. As such, the developer should provide a system that is easily
assimilated with existing software and hardware as well as aligned to the goals of the organization.
Manageability: This means a system whose veracity or bulkiness is manageable. The software and
hardware required to operate the RTOS must be of reasonable size. Technicians should also be easy to
find and orient. The idea is to reduce the cost of implementation.
Scalability: The needs of any production or event will change as the environment change. a system may
require an upgrade or downgrade. Such provisions must be made during design and installation of any
RTOS.
Functionality of RTOS
Processor management: a critical function of the RTOSBy managing processes, the operating system can
ensure that resources are used efficiently and that the system remains stable. In addition, process
management allows the operating system to control how programs interact with each other. Memory
management: the functionality of an RTOS that handles or manages primary memory and moves
processes back and forth between main memory and disk during execution.
Memory management keeps track of each and every memory location, regardless of either it is
allocated to some process or it is free. It checks how much memory is to be allocated to processes. It
decides which process will get memory at what time. It tracks whenever some memory gets freed or
unallocated and correspondingly it updates the status.
Timer management: It provides functions to startand stop functions/tasks to determine the CPU speed
and let a thread uses the CPU for a specified time and after that time it will releases the CPU.