Real-time
- Due to its advantages, Linux and open-source software are more and more commonly used in embedded applications
- However, some applications also have real-time constraints
- They, at the same time, want to
- Get all the nice advantages of Linux: hardware support, components re-use, low cost, etc.
- Get their real-time constraints met
Embedded Linux and real time
- Linux is an operating system part of the large Unix family
- It was originally designed as a time-sharing system
- The main goal was to get the best throughput from the available hardware, by making the best possible usage of resources (CPU, memory, I/O)
- Time determinism was not taken into account
- On the opposite, real-time constraints imply time determinism, even at the expense of lower global throughput
- Best throughput and time determinism are contradictory requirements
Linux and real-time approaches
- Over time, two major approaches have been taken to bring real-time requirements into Linux
- Approach 1
- Improve the Linux kernel itself so that it matches real-time requirements, by providing bounded latencies, real-time APIs, etc.
- Approach taken by the mainline Linux kernel and the PREEMPT_RT project.
- Approach 2
- Add a layer below the Linux kernel that will handle all the real-time requirements, so that the behaviour of Linux doesn't affect real-time tasks.
- Approach taken by RTLinux, RTAI and Xenomai
An alternative approach is to use specific hardware to run real-time work on:
- Dedicating a CPU core to a real-time OS or to a real-time application, using some kind of hypervizor.
- Running real-time work on an FPGA
- Running real-time work on a dedicated microcontroller. For example, the TI AM335x CPU (used in the Beaglebone Black) has a "Programmable Real-Time Unit and Industrial Communication Subsystem (PRU-ICSS)", which can be used for real-time processing.