Data Center.com

real-time operating system (RTOS)

By Alexander S. Gillis

What is a real-time operating system (RTOS)?

A real-time operating system (RTOS) is an OS that guarantees real-time applications a certain capability within a specified deadline. RTOSes are designed for critical systems and for devices like microcontrollers that are timing-specific. RTOS processing time requirements are measured in milliseconds. Any delays in responding could have disastrous consequences.

Real-time operating systems have similar functions as general-purpose OSes (GPOSes), like Linux, Microsoft Windows or macOS, but are designed so that a scheduler in the OS can meet specific deadlines for different tasks.

RTOSes also commonly appear in embedded systems, which are a combination of hardware and software designed for a specific function and may also operate within a larger system. Often, embedded systems are used in real-time environments and use a real-time operating system to communicate with the hardware.

RTOSes are designed to handle multiple processes at one time, ensuring that these processes respond to events within a predictable time limit. Processing in an RTOS occurs within defined time constraints and monitors the priority of tasks. An RTOS is also able to make changes to task priority. Systems that are event-driven often switch between tasks based on priority.

Some real-time operating systems are created for special applications, while others are more general purpose. Usually, RTOSes provide the following functionality:

RTOSes are included in the following devices:

Characteristics of a real-time operating system

Real-time operating systems generally have the following characteristics:

How does an RTOS work?

RTOSes are subdivided into soft and hard real-time systems. A soft RTOS is designed to operate within a few hundred milliseconds, while a hard RTOS is designed to provide predictable response times within tens of milliseconds.

Soft real-time systems typically have larger file sizes compared to hard RTOSes. Some executions act less predictably during peak load but are tolerated, as computations are rolled back to previously established checkpoints if an error occurs. Soft RTOSes are normally used in systems where time-based executions are less important, such as in PCs, cameras and smartphones.

Hard RTOSes typically have small or medium-sized data files. They act predictably during moments of peak loads, and computation is rolled back if an error occurs. Hard RTOSes are normally used in systems that require important time-based executions, such as in airplane sensors, autopilot systems or medical devices.

In hard real-time OSes, if the calculation cannot be performed to make an object available at the designated time, the OS terminates with a failure. In a soft RTOS, the OS continues to function, but certain tasks may be unproductive if they fail to execute at a given time.

RTOSes also act as a scheduler, in which tasks can be scheduled as ready to run, running or blocked.

They typically have a monolithic kernel and microkernel architecture. The OS kernel is the core of an OS, which provides basic services for all other parts of the OS. Kernels are the main layer between the OS and hardware.

Monolithic RTOS kernel and operation processes share one space. This architecture operates quickly when compared to microkernel configurations and typically provides better performance. Even though monolithic RTOSes run faster, they are harder to perform updates on, and a programming error in the file system, protocol stack or driver can cause system crashes.

The microkernel architecture houses the kernel and operations in separate locations. This architecture is slower than monolithic RTOS, as any action must return to the kernel before it can move to the component it references. The microkernel also lacks file systems.

RTOS vs. GPOS

General-purpose OSes, like Windows or Unix, can handle multiple tasks concurrently but are not ideal for important, time-sensitive applications due to latency and synchronization issues. GPOSes can also operate without time constraints, so tasks may sometimes fail or take longer to execute. In other words, they provide a potential nondeterministic, soft real-time response to tasks.

RTOSes typically provide a deterministic, hard real-time response with the goal of providing a quick reaction to events. While GPOSes are good for general consumer use, RTOSes are designed for instances where a system needs to respond to an event or task within a short, designated time frame. RTOSes need to be quick and accurate for the typically embedded systems they reside in.

Popular RTOS software and factors for choosing an OS

Popular open source and commercial RTOS software products include the following:

When looking for an RTOS, the following factors should be considered:

Learn more about RTOSes and how they work in internet of things (IoT) edge computing.

14 Feb 2022

All Rights Reserved, Copyright 2000 - 2024, TechTarget | Read our Privacy Statement