WIPIVERSE All articles

RTLinux

RTLinux is a hard real-time operating system (RTOS) microkernel that runs the entire Linux operating system as a fully preemptive process. The hard real-time property makes it possible to control robots, data acquisition systems, manufacturing plants, and other time-sensitive instruments and machines from RTLinux applications. Despite the similar name, it is not related to the Real-Time Linux project of the Linux Foundation.

History

RTLinux was developed by Victor Yodaiken, Michael Barabanov, Cort Dougan, and others at the New Mexico Institute of Mining and Technology, and later as a commercial product at FSMLabs (Finite State Machine Labs). Wind River Systems acquired FSMLabs' embedded technology in February 2007 and made a version available as Wind River Real-Time Core for Wind River Linux. As of August 2011, Wind River discontinued the Wind River Real-Time Core product line, effectively ending commercial support for the RTLinux product.

Design Objective

The key design objective of RTLinux was to add hard real-time capabilities to a commodity operating system. Rather than building a single OS supporting both real-time and non-real-time functions, RTLinux shares a computing device between a real-time kernel (RTCore) and a non-real-time OS (Linux or BSD), such that:

  1. The real-time OS can never be blocked from execution by the non-real-time OS.
  2. Components running in both environments can easily share data.

This approach was inspired by MERT (Multi-Environment Real-Time), a pioneering system from Bell Labs. However, RTLinux improved on MERT by virtualizing only the guest interrupt control rather than encapsulating the entire guest OS in a virtual machine, reducing overhead.

Implementation

RTLinux virtualizes the guest OS's interrupt controller, allowing the real-time kernel to intercept hardware interrupts before they reach Linux. Interrupts needed for deterministic processing are handled by the real-time core, while others are forwarded to Linux, which runs as the lowest-priority task. Standard Linux drivers work without source modification, though they must be recompiled with virtualization hooks (a form of paravirtualization).

On x86 hardware circa 2000, RTLinux achieved a worst-case interrupt response time of under 15 microseconds and periodic task scheduling precision within 35 microseconds.

Core Components

RTLinux is structured as a small core component with optional loadable kernel modules:

  • rtl_sched — A priority scheduler supporting a "lite POSIX" interface and the original V1 API.
  • rtl_time — Controls processor clocks and exports an abstract interface for connecting handlers to clocks.
  • rtl_posixio — Supports POSIX-style read/write/open interface for device drivers.
  • rtl_fifo — Connects real-time tasks and interrupt handlers to Linux processes via a device layer.
  • semaphore — Blocking semaphores for real-time tasks.
  • mbuff — Shared memory between real-time components and Linux processes.

Programming Interface

RTLinux implements a POSIX threads (pthreads) API. Real-time tasks are implemented as kernel modules with direct hardware access and no virtual memory. Threads are created using pthread_create and assigned static priorities; higher-priority threads can preempt lower-priority ones. The guest Linux OS serves as the idle task.

Related Projects

  • RTAI — Began as a variant of RTLinux called "MyRTlinux."
  • Xenomai — Another real-time Linux framework.
  • SCHED_DEADLINE — A Linux kernel scheduler for real-time tasks.

Licensing

RTLinux was released under the GNU General Public License version 2 (GPLv2). The design was covered by U.S. Patent 5,995,745.

Browse

More topics to explore

    Browse all articles