ArticleslgStudy

computer science

RTLinux

RTLinux is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand RTLinux rather than just read about it. In short: 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.

Key takeaways

  • RTLinux belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect RTLinux to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of RTLinux from memory before moving on to harder problems.

Reference excerpt

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. RTLinux was developed by Victor Yodaiken, Michael Barabanov, Cort Dougan and others at the New Mexico Institute of Mining and Technology and then as a commercial product at FSMLabs. 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 has discontinued the Wind River Real-Time Core product line, effectively ending commercial support for the RTLinux product.

Background The key RTLinux design objective was to add hard real-time capabilities to a commodity operating system to facilitate the development of complex control programs with both capabilities. For example, one might want to develop a real-time motor controller that used a commodity database and exported a web operator interface. Instead of attempting to build a single operating system that could support real-time and non-real-time capabilities, RTLinux was designed to share a computing device between a real-time and non-real-time operating system so that (1) the real-time operating system could never be blocked from execution by the non-real-time operating system and (2) components running in the two different environments could easily share data. As the name implies RTLinux was originally designed to use Linux as the non-real-time system but it eventually evolved so that the RTCore real-time kernel could run with either Linux or Berkeley Software Distribution (BSD) Unix. Multi-Environment Real-Time (MERT) was the first example of a real-time operating system coexisting with a Unix system. MERT relied on traditional virtualization techniques: the real-time kernel was the host operating system (or hypervisor) and Bell Systems Unix was the guest. RTLinux was an attempt to update the MERT concept to the PC era and commodity hardware. It was also an attempt to also overcome the performance limits of MERT, particularly the overhead introduced by virtualization. Instead of encapsulating the guest OS in a virtual machine, RTLinux virtualized only the guest interrupt control. This method allowed the real-time kernel to convert the guest operating system into a system that was completely preemptible but that could still directly control, for example, storage devices. In particular, standard drivers for the guest worked without source modification although they needed to be recompiled to use the virtualization "hooks". See also paravirtualization. The Unix pipe was adapted to permit real-time and non-real-time programs to communicate, although other methods such as shared memory were also added. From the programmer's point of view, RTLinux originally looked like a small threaded environment for real-time tasks plus the standard Linux environment for everything else. The real-time operating system was implemented as a loadable kernel module which began by virtualizing guest interrupt control and then started a real-time scheduler. Tasks were assigned static priorities and scheduling was originally purely priority driven. The guest operating system was incorporated as the lowest priority task and essentially acted as the idle task for the real-time system. Real-time tasks ran in kernel mode. Later development of RTLinux adopted the Portable Operating System Interface (POSIX) POSIX threads application programming interface (API) and then permitted creation of threads in user mode with real-time threads running inside guest processes. In multiprocessor environments threads were locked to processor cores and it was possible to prevent the guest thread from running on designated core (effectively reserving cores for only real-time processing).

Implementation RTLinux provides the ability to run special real-time tasks and interrupt handlers on the same machine as standard Linux. These tasks and handlers execute when they need to execute no matter what Linux is doing. The worst-case time between the moment a hardware interrupt is detected by the processor and the moment an interrupt handler starts to execute is under 15 microseconds on RTLinux running on a generic x86 (circa 2000). A RTLinux periodic task runs within 35 microseconds of its scheduled time on the same hardware. These times are hardware limited, and as hardware improves RTLinux will also improve. Standard Linux has excellent average performance and can even provide millisecond-level scheduling precision for tasks using the POSIX soft real-time capabilities. Standard Linux is not, however, designed to provide sub-millisecond precision and reliable timing guarantees. RTLinux was based on a lightweight virtual machine where the Linux "guest" was given a virtualized interrupt controller and timer, and all other hardware access was direct. From the point of view of the real-time "host", the Linux kernel is a thread. Interrupts needed for deterministic processing are processed by the real-time core, while other interrupts are forwarded to Linux, which runs at a lower priority than real-time threads. Linux drivers handled almost all I/O. First-In-First-Out pipes (FIFO) or shared memory can be used to share data between the operating system and RTLinux.

Objective The key RTLinux design objective is that the system should be transparent, modular, and extensible . Transparency means that there are no unopenable black boxes and the cost of any operation should be determinable. Modularity means that it is possible to omit functionality and the expense of that functionality if it is not needed. And extensibility means that programmers should be able to add modules and tailor the system to their requirements. The base RTLinux system supports high-speed interrupt handling and no more. It has simple priority scheduler that can be easily replaced by schedulers more suited to the needs of some specific application. When developing RTLinux, it was designed to maximize the advantage we get from having Linux and its powerful capabilities available.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with RTLinux

Start with the simplest possible case. Write down what RTLinux claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to RTLinux before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about RTLinux ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of RTLinux

In research
RTLinux appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses RTLinux in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
RTLinux is common in secondary-school and first-year university syllabi. It links to neighbouring topics ARM operating systems, Embedded operating systems, Free software operating systems, so understanding it makes those chapters shorter.
In everyday life
Look for RTLinux outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study RTLinux in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what RTLinux means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain RTLinux out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is RTLinux in simple terms?

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 machin…

Why does RTLinux matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study RTLinux?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on RTLinux.

Tags

  • ARM operating systems
  • Embedded operating systems
  • Free software operating systems
  • Linux kernel variant
  • Real-time operating systems
  • X86 operating systems

Keep exploring