Real-time operating system

from Wikipedia, the free encyclopedia

A real-time operating system (English real-time operating system , just RTOS called) is an operating system in the electronic data processing , which is capable of real-time to meet -Anforderungen of applications. This means the secure processing requests of an application program or the arrival of signals via hardware interfaces within a determinable in advance period ( timeout , ). The decisive factor here is not the length of the deadline, but that there is a deadline that can be guaranteed.

The need for a real-time operating system arises whenever computers are connected to the physical world in a measuring and / or controlling manner. That is the qualitative requirement of a real-time operating system.

The quantitative requirement for its real-time behavior results from the application itself. For example, longer values can be used for heating control than when triggering an airbag. Together with the foregoing, it follows that not every real-time operating system is suitable for every real-time application.

Theoretical considerations

Since no specific values ​​are required for the definition of the operating system calls, but only have to be determinable and fixed, theoretically every operating system is a real-time operating system with an upper limit for the number of processes and its system services exclusively from LOOP programs , thus consist of primitive recursive functions. The applicable values ​​could then be calculated. However, the resulting values ​​are too large for any practical application. This justifies the term real-time operating system as a separate class of operating systems with their own requirements, the creation of which takes the real-time property into account. The sporadic and well-known behavior of desktop operating systems "freezing" for a while is unacceptable to RTOS.

Real-time operating system requirements

Preemptive multitasking

A real-time operating system that has multitasking must work with preemptive multitasking , since with cooperative multitasking, a second process could deprive one process of the CPU until the timeout is reached. This requirement is also accompanied by the requirement for an interrupt infrastructure for the CPU.

Predictable time behavior of the system calls

Real-time operating systems must guarantee compliance with defined processing times for system calls, even in the worst case. This mainly applies to scheduling and memory management . If the processing of a request for the allocation of memory can provoke the execution of a garbage collection because the free memory is exhausted, then the real-time behavior that can be said to have deteriorated dramatically and at least for the maximum duration of a garbage collection.

Predictable reaction times to events

An event means any external change of state that is important for a real-time application. This can be the arrival of a data packet, the changing of a bit on a port and the like. In a real application, this can mean the availability of new measurement data, the pressure on a button or the exceeding of a permissible range by a measurement value. A real-time operating system must then be able to ensure that the reaction required for this, which usually consists of the activation of a service routine of the application belonging to the event, takes place within a period fixed in advance.

Early forms of real-time processing

In early real-time applications, the guaranteed response time to events was primarily implemented through the direct use of hardware interrupts by the application program itself. To do this, the requester lowers or raises (depending on the logic) the potential on a pin called IRQ on the CPU. The CPU then immediately stops working on the currently executing program, places the current program counter on the CPU stack, takes the address of the associated interrupt service routine from an interrupt vector table and starts it. At the same time, the interrupt is masked so that it cannot be triggered again directly. The interrupt service routine then handles the event, unmasked the interrupt and then terminated via a command, usually called RETI (Return from Interrupt). The CPU then jumps back to the point in the program at which it interrupted program processing.

A real-time operating system eliminates the need for the application itself to use hardware interrupts.

Areas of application

Real-time operating systems are always used where exceeding maximum response times in response to events causes immediate damage. These are in particular mechanical engineering , control technology and robotics . There, especially in areas of application that pose a risk to life and limb, such as medical technology and fly-by-wire , real-time operating systems (or real-time behavior) are indispensable.


See also

Individual evidence

  1. IT knowledge: RTOS (real time operating system). July 12, 2015, accessed September 14, 2018 .

Web links