Radboud University Nijmegen

Real-time Linux (Xenomai)

Background


Real-Time Linux Introduction

Linux is a free Unix-like operating system that runs on a variety of platforms, including PCs. Numerous Linux distributions such as Red Hat, Debian and Mandrake bundle the Linux OS with tools, productivity software, games, etc.


How does RT Linux work?

The general idea of RT Linux is that a small real-time kernel runs beneath Linux, meaning that the real-time kernel has a higher priority than the Linux kernel. Real-time tasks are executed by the real-time kernel, and normal Linux programs are allowed to run when no real-time tasks have to be executed. Linux can be considered as the idle task of the real-time scheduler. When this idle task runs, it executes its own scheduler and schedules the normal Linux processes.  Since the real-time kernel has a higher priority, a normal Linux process is preempted when a real-time task becomes ready to run and the real-time task is executed immediately.

How is the real-time kernel given higher priority than Linux kernel?

Basically, an operating system is driven by interrupts, which can be considered as the heartbeats of a computer:

RT Linux uses the flow of interrupts to give the real-time kernel a higher priority than the Linux kernel:

Hence, when a normal Linux program runs and a new interrupt arrives:

To let the real-time kernel and the Linux kernel coexist on a single machine, a special way of passing of the interrupts between real-time kernel and the Linux kernel is needed. Each flavor of RT Linux does this is in its own way. Xenomai uses an interrupt pipeline from the Adeos project. For more information, see also Life with Adeos.

RT Linux Tasks are not Linux Programs

Xenomai

Timing in Xenomai

Scheduling in Xenomai Linux

Note: In the latest Xenomai versions one can have a different periodic mode per skin, and have programs using different skins to run at the same time. To implement this, one does not use the periodic mode of the timer chip anymore. Instead all timings are done using one-shot programming of the timer chip. Periodic mode is emulated by a software driver which implements it by doing one-shot programming of the system timer periodically.


Last Updated: 29 August 2016 (Jozef Hooman)
Created by: Harco Kuppens
h.kuppens@cs.ru.nl