Field Guide · concept

Also known as: RTOS

A real-time operating system (RTOS) is a small operating system that schedules tasks with guaranteed, bounded timing, so a response is delivered within a known deadline.1

High Medium Low runs time → · higher priority always preempts lower
Preemptive priority scheduling: the low task runs until a medium task becomes ready and preempts it, then a high-priority task preempts in turn, finishes, and control falls back down — the low task resuming only once nothing higher is waiting. Because the highest-priority ready task always runs, worst-case response time is bounded and predictable.

Overview

What makes an OS “real-time” is not raw speed but determinism: the worst-case time to react to an event is predictable and small. An RTOS provides a priority-based, usually preemptive scheduler, plus primitives like tasks, queues, semaphores, and timers, all in a footprint of a few kilobytes.

On a microcontroller it sits between your application and the hardware, multiplexing several jobs onto one core while honoring deadlines. The scheduler guarantees that the highest-priority ready task is the one running, so a time-critical job is never left waiting behind less important work. Popular examples include FreeRTOS, Zephyr, and ThreadX.

RTOS versus bare metal

The same chip can run either way; the trade is structure and guarantees against overhead:

Aspect Bare metal RTOS
Concurrency Hand-coded super loop Scheduled tasks
Timing guarantee Ad hoc Bounded worst case
Overhead None A few KB code + RAM
Primitives You build them Tasks, queues, semaphores
Sweet spot 1–2 jobs Many competing deadlines

Where it fits

Simple firmware often runs bare metal — a single loop plus interrupts — which is enough when there are only a couple of jobs. An RTOS earns its keep once an embedded system juggles many concurrent tasks (reading sensors, driving a radio, servicing a network stack) with competing deadlines. It ports easily across ARM Cortex-M parts, so the same code runs on many chips. The same determinism argument scales up: a busy SDR decode host leans on its general-purpose OS scheduler to keep real-time sample streams flowing without dropouts.

Sources

  1. Real-time operating system — Wikipedia, on RTOS design and determinism. 

See also