Real-Time Linux

Linux is widely used as an embedded operating system, often with real-time constraints such as multimedia processing, communications and control systems. And yet people often claim that Linux is “not real-time”. The fact is that Linux can be used in real-time applications but it does require some knowledge about kernel configurations and real-time programming.

This two day course shows how to create reliable real-time programs using Linux. It analyses the effectiveness of different kernel configurations including the PREEMPT_RT “real time” option. Delegates will also get the chance to look at issues of selecting the right scheduling policy, techniques to handle priority inversion in multi-threaded applications and how to minimise jitter in interrupt handlers.

Delegates will spend roughly half the time in practical sessions where they will use the knowledge gained to build a real-time system running on a BeagleBone development board.

EL-204
Two days
Contact Feabhas (available for on-site delivery only)
pdf download

Course Outline

 

Course Outline:

Measuring real-time behaviour

  • The characteristics of a real-time task
  • Different ways of instrumenting code
  • Features in the Linux kernel for measuring delays and variability
  • What happens in overload conditions (when the schedule cannot be met)

Scheduling, processes and threads

  • Review the difference between process and threads in Linux
  • Scheduling policies and priorities for real time and non-real-time tasks
  • Periodic tasks
  • Assigning priorities using rate monotonic analysis
  • Synchronisation between threads: the mutex
  • Description of the various mutex types Linux has to offer and when to use each one
  • The problem of priority inversion and priority inheritance mutexes

Timers and periodic tasks

  • A look at the accuracy of timers
  • Configuring high resolution timers
  • Using POSIX timers
  • Creating reliable periodic tasks

Interrupts and kernel preemption

  • Description of the interrupt model and the factors that cause interrupt jitter.
  • How kernel pre-emption helps
  • The problem with kernel spin locks
  • What happens when you have more than one processor core?

PREEMPT_RT: The Real Time Linux Kernel

  • Analysis of non-preemptive sections in Linux (“atomic contexts”)
  • Description of PREEMTP_RT “real time” Linux patch and how it resolves the problem
  • Examples and tips for deploying versions of real time Linux

Course Overview

 

A two day course showing how to create reliable real-time programs using Linux. 

Course Objectives:

  • To understand the characteristics of real-time programs
  • To be able to relate that knowledge to the POSIX API offered by Linux
  • To be able to configure a kernel for real-time behaviour
  • To diagnose and fix real-time problems in existing projects

Delegates will learn:

The extent to which Linux may be used to write real-time applications from scratch and how to diagnose and improve existing systems

Pre-requisites:

Who should attend:

  • Application and kernel programmers, support engineers and system architects involved with real-time programming for Linux.

Duration:
Two days

Course Materials:
Delegate handbook

Related Courses:

Course Workshop:
For the practical part of the course delegates will cross compile sample applications on a Linux PC and run them on a BeagleBone development board