Have you ever heard about real time systems? Real-time systems are computing systems that must react within precise time constraints to events in the environment. Rather than being fast, a real time computing system should be predictable.
If we call each unit of work scheduled and executed by the system a job and its deadline the maximum allowable response time, then the main difference between a real time and a normal task is that the first one is characterized by a deadline. In a critical application, a result produced after the deadline is considered to be a fatal fault, late result produced by the job after the deadline may have disastrous consequences. A late command to stop a train may cause a collision.
Real-time tasks are usually distinguished in two classes, hard and soft. The difference between them is based on the functional criticality of jobs and the usefulness of late results.
- Soft RT: A real-time task is said to be soft if meeting its deadline is desirable for performance reasons, but missing its deadline does not cause serious damage to the environment.
- Hard RT Task: A real-time task is said to be hard if missing its deadline may cause catastrophic consequences on the environment under control. [Buttazzo – Hard Real Time Computing Systems]
The key factor is the scheduling algorithm, the way the system selects which task to execute first impacts the overall system performance.
In this tutorial we will use Xenomai which is a real-time development framework cooperating with the Linux kernel and the embedded board Raspberry Pi model B+. We will be able to create a kernel module to handle interrupts attached to the GPIO connectors of the board.
The first steps will help us to build a minimal system with Buildroot and we will apply the Adeos and Xenomai patches to the 3.8.13 kernel in the third part.
You will need a few things to run this tutorial:
- A Raspberry Pi Model B+.
- SD Card (4GB or greater)
- Power supply for your Pi & a Micro USB cable
- A monitor with the HDMI input port
- An oscilloscope to test the time response of the implemented system (optional)
- An Arduino to generate the inputs (optional)
We are ready to go!