Rtlinux: and Embedded Programming
Rtlinux: and Embedded Programming
RTLinux p.1/33
Outline.
The usual: denitions of realtime.
RTLinux p.2/33
Outline.
The usual: denitions of realtime. Who needs realtime?
RTLinux p.2/33
Outline.
The usual: denitions of realtime. Who needs realtime? How RTLinux works.
RTLinux p.2/33
Outline.
The usual: denitions of realtime. Who needs realtime? How RTLinux works. Why RTLinux works that way.
RTLinux p.2/33
Time sharing software: switch between different tasks fast enough to create the illusion that all are going forward at once.
RTLinux p.3/33
Time sharing software: switch between different tasks fast enough to create the illusion that all are going forward at once. Realtime software: switch between different tasks in time to meet deadlines.
RTLinux p.3/33
Hard realtime
1. Predictable performance at each moment in time: not as an average. 2. Low latency response to events. 3. Precise scheduling of periodic tasks.
RTLinux p.4/33
Soft realtime
Good average case performance Low deviation from average case performance
RTLinux p.5/33
RTLinux p.6/33
RTLinux p.6/33
RTLinux p.6/33
RTLinux p.7/33
RTLinux p.7/33
RTLinux p.7/33
RTLinux p.8/33
RTLinux p.8/33
RTLinux p.8/33
RTLinux p.8/33
RTLinux p.9/33
Timing
1. A 30 microsecond delay can drop 20 Gig Ethernet packets. 2. 10 70hz video streams need packets unloaded at millisecond rates. 3. Time for 1 degree error on manipulator: 10 microseconds.
RTLinux p.10/33
RTLinux p.11/33
Larger examples.
Multiple software "Virtual routers" operating on packets in realtime. Interactive robot control with non-RT graphical interface.
RTLinux p.12/33
RTLinux p.13/33
RTLinux p.14/33
RTLinux p.15/33
RTLinux p.16/33
Results
1. Example on AMD SC520 133Mhz. Low latency response to events. 15microseconds or less. Precise scheduling of periodic tasks. 20 microseconds or less error. 2. On a standard PC: 19 microseconds and 50 microseconds 3. On SOCs we are in the single digits
RTLinux p.17/33
Programming model
1. For Realtime tasks and event handlers: POSIX Pthreads. 2. For Linux processes connection via POSIX I/O, shared memory, and signals. As standard as possible with no efciency loss.
RTLinux p.18/33
Programming view
1. The hard realtime component of realtime applications should run in a simple, minimal, predictable environment. 2. The non-realtime components should run in UNIX until something better is invented. 3. Hard realtime and non-realtime should be decoupled in operation.
RTLinux p.19/33
Programming interface
1. "Lean" POSIX threads for RT components, standard POSIX for non-RT components. 2. RTLinux can support alternate APIs. 3. API is programmer convenience: not technology fundamental.
RTLinux p.20/33
RTLinux p.21/33
RTLinux p.22/33
RTLinux p.23/33
Where is it used?
1. Communications: PBXs, routers, ... 2. Factory automation: machine tools, production lines. 3. Robotics: stepper motors, A/D, ... 4. Multimedia: animations, ...
RTLinux p.24/33
RTLinux p.25/33
RTLinux p.26/33
RTLinux p.27/33
RTLinux p.28/33
RTLinux p.29/33
Coming in V4
1. RT networking. (for industrial control and comms). 2. User mode RTLinux functions. 3. Failover technologies. 4. Optimizations.
RTLinux p.30/33
RTLinux p.31/33
RTLinux p.32/33
www.rtlinux.com
w.fsmlabs.com@
RTLinux p.33/33