Вы находитесь на странице: 1из 111

National Institute of Standards and Technology

Introduction to Linux for Real-Time Control

Introductory Guidelines and Reference for Control Engi-neers and Managers

Pre ared for! Intelligent Systems #i$ision National Institute of Standards % Technology ()) *ureau #ri$e+ Mail Sto ,-.) Gaithers"urg+ M# -),11-,-.)
frederic4' roctor5nist'go$

Pre ared "y!

&eolean Inc' /0 Sarah *isho Road Ridge eld+ CT )2,33(-(/


simon5aeolean'com

6( .)( 13/ .0-/

6( -).

0., .((,

This re ort descri"es a ra idly-e$ol$ing as ect of com uting+ real-time Linux' Since the re ort cannot ca ture e$ery ossi"le detail and facet of the real-time Linux com uting 7orld+ it 7ould "e a reciated if any changes+ corrections+ ne7 material+ noti cations of outdated material+ and any other o"ser$ations are sent to!frederic4' roctor5nist'go$ This material 7ill "ecome the "asis of future releases of this document'

Contents
( Executi$e Summary 1.1 1.2 1.3 1.4 (' / 8istory of Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 1 Standards ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' () Real-Time 9ersions of Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' () & lications ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' (( ( ( . ( 0 ( 0 ( / 1

Sources of Real-Time Linux and Sources of &dditional Information ' ' ' ' ' ' '

- Introduction -' ( Trademar4s and Ser$ice Mar4s ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -' NIST #isclaimer ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
.

: erating Systems and Real-Time ;ernels 3.1 3.2 &rchitecture of an : erating System ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' (/ <unctionality of a general ur ose o erating system ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' (3 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 Memory Management ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' (3 Memory Protection ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' (, Scheduling and Tas4 Management ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' (, 8ard7are Interfaces ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' (1 <ile Management ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' (1 Communication ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -)
.'-'2'(

External Communication ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -)

3.2.6.2

Internal Communication ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -)

.'. Standards ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -( .'.'( #e artment of #efense Standards ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -3.4 Re=uired <unctionality for Real-Time ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' --

NIST! Intelligent Systems #i$ision

9ersion -')')+ -))--(--((T(/.(

C:NTENTS C:NTENTS 3.4.1 3.4.2 3.4.3 3.5 3.5.1 Em"edded $s Real-Time : erating Systems ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -Measures of Performance for Real-Time : erating Systems ' ' ' ' ' ' ' ' -. P:SI> Extensions for Real-Time & lications ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -.

:$er$ie7 of &$aila"le Real-Time :?S ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -. 9x@or4s ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -.
.'/'('( Performance ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -0

3.5.2

@indo7s CE 'NET ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -0
.'/'-'( Performance ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -/

3.5.3

AN> Neutrino RT:S ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -/ .'/'.' (

Performance ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' / .'/'0 S:System . ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' / .'/'0' ( Performance ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 2 .'/'/ Summary ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 2 0 &n Introduction to Real-Time Linux 3 0'( 8istory and <unctionality of Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 3 4.1.1 4.1.2 Nomenclature ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .) Standard Linux for Soft Real-Time & lications ' ' ' ' ' ' ' ' ' ' ' ' ' ' .) . 0'('. Em"edded & lications ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ) . 0'- Modi cations that ma4e Linux Real Time ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ( 4.2.1 4.2.2 Standard-;ernel Preem tion ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .( Real-Time Patches to the Standard ;ernel ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .4.2.2.1 4.2.2.2 0'-'-'. 0'-'-'0 4.3 4.3.1 4.3.2 Micro ;ernel ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .P:SI> Real-Time Extensions ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .. Nano ;ernel ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' Resource ;ernel Extension ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' . 0 . 0

Performance Characteristics ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ./ E$ent Latency ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ./ Periodic Bitter ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .2

4.4

System-Performance Measurement ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ., 4.4.1 4.4.2 Com aring Real-Time and Standard Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ., Com arison 7ith other Real-Time ;ernels ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .1
0'0'-'( Performance Com arison ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .1

NIST! Intelligent Systems #i$ision


9ersion -')')+ -))--(--((T(/.(

C:NTENTS / & 5.1 lication Case Studies

C:NTENTS 0(

NIST Sam led #ata Control ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 0( 5.1.1 5.1.2 5.1.3 EMC ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 0( Ste er Motor Control ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 00 lications ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 02 Ca"le Ro"ots ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 0/ 0 /'-'( #ata &c=uisition ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 2 0 /'-'('( &ir"orne Scanning Radar &ltimeter ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 2 5.2.1.2 5.2.1.3 5.2.1.4 GPS Recei$er ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 02 Electronic Excitation S ectrosco y ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 03 Solar S ectral <lux Radiometer ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 03
/'-'('/ Tel e sco e Cam era ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 03

5.2

:ther Exam les of Real-Time Linux &

5.2.2

Control &

lications ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 0,
/'-'-'( Machine Tool Control ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 0,

5.2.2.2 5.2.2.3 5.2.2.4 5.2.3 5.2.3.1 /'-'0

Controlling Creatures 7ith Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 0, Laser Cutting Machine ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 0, Telesco e Control System ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 0, 8umanoid Ro"ot 83 ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 01

Ro"otics ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 01

0 #istri"uted Real-Time Com uting ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 1 0 /'-'0'( & Real-Time Linux Cluster ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 1 / 2 Real-Time Linux Im lementation Considerations ) / 2'( #e$elo ment En$ironment ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ) / 2'('( Control System #esign Tools ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ( 6.1.2 #e$elo ment Considerations ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /( 6.1.2.1 6.1.2.2 6.1.3 ;ernel S ace Tas4s ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /( Cser S ace Tas4s ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /-

#e"ugging Real-Time Tas4s ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' // 2'- Im lementation Considerations ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .

2'-'( Su 6.2.2 6.2.3 Su

/ orting 8ard7are Interfaces for Machine Control ' ' ' ' ' ' ' ' ' ' ' .

Total Cost of Systems #e$elo ed 7ith Real-Time Linux ' ' ' ' ' ' ' ' ' ' /. ort Considerations ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /.
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

C:NTENTS C:NTENTS 6.2.4 6.2.5 6.2.6 Net7or4ing and <ile System &ccess ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /. @or4ing 7ith the GPL ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /0 Conclusions ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /0 //

3 Sources of Real-Time Linux 7.1 7.1.1 7.1.2 7.1.3 7.1.4 7.1.5 7.2 &#E:S ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /2 ;CRT ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /2 RT&I ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /3 RTLinux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /, TimeSys Linux GPL ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /1

: en-Source #istri"utions of Real-Time Modi cations to Linux ' ' ' ' ' ' ' ' ' //

Commercial #istri"utions of Real-Time Modi cations to Linux ' ' ' ' ' ' ' ' ' ' /1 3'-'( Concurrent Com uter Cor oration ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /1 7.2.2 7.2.3 7.2.5 7.2.6 7.2.7 <SM La"s Inc' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 2) Monta9ista Soft7are Inc' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 2) RE#Sonic Inc' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 2( Synergy Microsystems Inc' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 2TimeSys Cor oration ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 22 . 2 0 2 0 2 0 2 / 2 / 2 / 2 / 2 2

3'-'0 ARTS ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 2(

&

Currently-&$aila"le Real-Time :?S

* Sources of <urther Information * '( Real-Time Linux #istri"utions ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' *' * '. *' 0 * '/ *' 2 C Real-Time Linux Su ort :rganiDations ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

Pu"lications on Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' <re=uently &s4ed Auestions! <&As ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' Real-Time Linux Tutorials ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' Real-Time Linux Com arison Studies ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

*i"liogra hy

# Index
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

3 2
2

List of <igures
.'( : erating System &rchitecture ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' (2 4.1 4.3 4.5 4.6 4.7 /'( /'Linux Mascot ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -, Micro ;ernel Real-Time &rchitecture ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .. Resource ;ernel Real-Time &rchitecture ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .2 E$ent Latency ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .3 Periodic Bitter ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .3 0 0 /

0'- Preem ta"le ;ernel &rchitecture ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .0'0 Nano ;ernel &rchitecture ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ./

EMC Controller &rchitecture ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' Ca"le Ro"ot &rchitecture ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

NIST! Intelligent Systems #i$ision


9ersion -')')+ -))--(--((T(/.(

List of Ta"les
1.1 3.1 Linux Performance Com arison ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' (( P:SI>?IEEE Standards ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -(

0'( Linux 9ersion 8istory ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' -1 4.2 Linux Performance Com arison ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .1

3'( &#E:S Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /2 7.2 3'. 3'0 7.5 7.7 7.8 7.9 ;CRT Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /3 RT&I! Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' RTLinux! Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' TimeSys Linux GPL! Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /1 <SMLa"s RTLinux! Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 2) Monta 9ista Linux! Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 2( ARTS! Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 2( / , / ,

3'2 Red8a74 Linux! Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 2)

7.10 RE#ICE Linux! Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 2( 7.11 Synergy Micro RTLinux! Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 27.12 TimeSys Linux?RealTime! Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 2&'( Real Time : erating Systems ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 2.

NIST! Intelligent Systems #i$ision


9ersion -')')+ -))--(--((T(/.(

Cha ter ( Executi$e Summary


Real-time $ersions of Linux ha$e matured to the oint that they can "e considered as $ia"le candidates for real-time a lications' Successful real-time a lications ha$e "een demonstrated in the ast fe7 years "y research grou s in uni$ersities+ go$ernment la"oratories and indus-try+ the real-time modi cations are sta"le and ro$en+ and commercial enter rises are o ering training and su ort ser$ices'
: en source soft7are ensures future maintaina"ility and extensi"ility of soft7are systems' Real-time $ersions of Linux o er im ortant ad$antages to control engineers in ro$iding an o en source o erating system that ri$als the erformance of the ro rietary real time 4ernels'

&t the National Institute of Standards and Technology ENISTF the Control Systems Grou in the Intelligent Systems #i$ision has had considera"le success in using real-time modi cations to Linux in real-time control a lications for machine tools and ro"ots' & re$ie7 of that 7or4 and summaries of other successful a lications ro$ide the reader 7ith an o$er$ie7 of recent a lications'
This re ort is directed to control engineers and managers' It is intended to ro$ide an o$er$ie7 of real-time o erating systems and articularly of the real-time modi cations to the Linux o erating system in enough detail that the reader can ma4e an informed decision 7hether to commit the resources to e$aluate Linux as a real-time o erating system'

1.1

8istory of Linux

Cnix 7as de$elo ed at *ell La"s around (13)' Since it 7as clean+ e cient+ and ro$ided economical access to a multi-user en$ironment+ it soon gained a signi cant follo7ing in the technical community' Cnix and Cnix-li4e o erating systems came to dominate the ser$er and 7or4station mar4ets 7hen they emerged in the (1,)s'
Linus Tor$alds de$elo ed Linux as a free+ o en source+ Cnix-li4e o erating system as a student roGect at the Cni$ersity of 8elsin4i in (11(' <or many years Linux 7as something of an underground cult henomenon among hac4ers and uni$ersity researchers' In recent years+ NIST! Intelligent Systems #i$ision 1
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control Executi$e Summary

ho7e$er+ Linux has emerged as a mainstream technology+ articularly stimulated "y I*MHs ado tion of Linux for their ser$er "usiness'

1.2

Standards

The Institute of Electrical and Electronic Engineers EIEEEF has led the de$elo ment of a standard+ "ased on the Cnix o erating system+ that de nes the re=uirements of a Porta"le : erating System Interface EP:SI>F' The IEEE Std ()).'(--))( is a uni cation of t7o of the re$ious standardiDation e orts+ P:SI>'( ESystem Interfaces and 8eadersF+ and P:SI>'- EShell and CtilitiesF' StandardiDation e orts in arallel 7ith P:SI>'( de$elo ed P:SI>'0+ to co$er real-time extensions to P:SI>'(' P:SI>'0 has since "een su erseded "y IEEE Std ()).'(d-(111' Linux 7as designed from the start to "e a P:SI>-com liant o erating system' The current standard Linux com lies 7ith P:SI>'(+ the system call interface+ and P:SI>'(c+ the threads extension' It is almost com liant 7ith P:SI>'-+ the shell and utilities standard' Some of the real-time Linux $ariants ha$e "een designed to "e com liant 7ith the ()).'(d real-time extensions standard' This re ort uses P:SI> as the "asic reference standard for discussing o erating systems+ Linux+ and real-time extensions of Linux' This re ort is also rele$ant to standards e orts in the #e artment of #efense since #:# is al7ays interested in extensi"ility and maintaina"ility of their 7ea on systems' In articular+ the s eci cation of a Common : erating En$ironment in the architecture de$elo ed "y the @ea on Systems Technical &rchitecture @or4ing Grou E@ST&@GF references P:SI> system calls for hard real-time em"edded 7ea ons system a lications' Real-time Linux directly addresses this emerging standard'

1.3

Real-Time 9ersions of Linux

Current de$elo er releases of standard Linux can "e used for soft real-time a lications 7here the sam le time is relati$ely long+ say tens of milliseconds+ and the a lication can tolerate missed timing schedules' &n exam le is $ideo rocessing+ 7here an occasional ic4er is often acce ta"le' 8ard real-time a lications re=uire rigid determinism and fast timing' Real-time $ariants of Linux suita"le for such a lications ha$e a eared since (113' Research grou s at Ne7 Mexico Tech+ Politecnico di Milano+ and ;ansas Cni$ersity ha$e roduced 7idelydistri"uted o en-source $ersions that ha$e "een successfully de loyed' There are t7o "asic a roaches to modifying the standard Linux 4ernel+ the core of the o erating system+ to ro$ide this real-time res onse' Each of these is distri"uted as atches to the standard 4ernel'
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

()

Introduction to Linux for Real-Time Control Executi$e Summary

Micro-;ernel! This a roach ENe7 Mexico+ MilanoF is to insert a ne7+ highly e cient code layer "et7een the hard7are and the standard 4ernel' The additional code layer+ called a micro-4ernel+ ta4es care of all of the real-time functionality including interru ts+ scheduling+ and high-resolution timing' This micro-4ernel runs the standard 4ernel as a "ac4ground tas4' &n alternati$e code layer+ called a nano-4ernel E&#E:SF+ is one that only handles interru t dis atching' This nano-4ernel a roach can su ort multi le o erating systems+ one "eing real-time+ including non-Linux o erating systems'

IEEE ()).'(d ;ernel! The second a roach E;ansas+ TimeSysF is to im lement the real-time extensions to P:SI>'( 7ithin the structure of the standard Linux 4ernel' These extensions add timer+ scheduling+ and reem tion logic directly into a single+ monolithic+ 4ernel'
The standard 4ernel in recent de$elo er releases sho7s latency Ethe time delay from an interru t to the start of rocessing that interru tF and Gitter E$ariations of timing of eriodic e$entsF of the order of one millisecond' The real-time $ersions of Linux ha$e latency and Gitter of the order of a fe7 microseconds on rocessors running at se$eral hundred megahertD' Ta"le ('( demonstrates that the erformance is com ara"le to the commercial real time 4ernels'

Standard :?S Standard Linux IEEE ()).'(d Linux Micro-;ernel Linux RT:S ;ernels

& lication Non Real Time Soft Real Time 8ard Real Time 8ard Real Time 8ard Real Time

Latency?Bitter ()) microseconds to ()) milliseconds ( millisecond () to ()) microseconds ( to () microseconds ( to () microseconds

Ta"le ('(! Linux Performance Com arison

@ith this le$el of erformance+ and 7ith the ad$antages of free o en-source distri"ution to ena"le maintaina"ility and extensi"ility+ these real-time $ersions of Linux are nding increasing o ularity in go$ernment and industry as 7ell as in uni$ersities'

1.4

&

lications

The National Institute of Standards and Technology ENISTF has used real-time $ersions of Linux for machine tool control+ ste er motor control and ro"otics' Those a lications+ and a sam ling of other non-NIST a lications+ 7ill "e summariDed to gi$e the reader a feel for the areas 7here real-time Linux has "een used' The Real Time Linux <oundation 7e" site ro$ides an ex anded list of real-time Linux a lications'

NIST! Intelligent Systems #i$ision

((

9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control Executi$e Summary

1.5

Sources of Real-Time Linux and Sources of &ddi-tional Information

Ta"les summariDing the characteristics of "oth o en-source and commercial distri"ution of real-time $ersions of Linux are ro$ided' Pointers are ro$ided to further sources of information throughout the re ort and in the a endices' Lin4s are em"edded in the electronic $ersion of the re ort that 7ill connect the reader directly to those sources' These lin4s are also listed in the "i"liogra hy as text for the readers of hard co y $ersions'
Real-time modi cations of Linux are achie$ing gro7ing acce tance in a lications of control and automation+ data ac=uisition+ and audio and $ideo rocessing' This re ort ro$ides an introduction to that 7orld and directs the reader to sources of further information'

NIST! Intelligent Systems #i$ision


9ersion -')')+ -))--(--((T(/.(

(-

Cha ter Introduction


E$eryone that uses com uters has undou"tedly heard of Linux+ the free+ o en-source+ Cnix-li4e o erating system introduced "y Linus Tor$alds in (11(' It has "een continually re ned and enhanced "y Tor$alds along 7ith a 7orld-7ide grou of contri"utors since then' Particularly since I*M ado ted Linux for their ser$er roducts+ Linux has "ecome a mainstream technology+ gaining something li4e -/I of the mar4et share for ser$ers' @hile organiDations may ado t standard Linux for ser$er a lications+ articularly 7ith handholding and su ort from an I*M+ relati$ely fe7 ha$e used Linux as a de$elo ment lat-form for real-time a lications' This is "ecause real-time extensions of Linux ha$e only a - eared since (113 and using those real-time extensions re=uire modifying the standard Linux 4ernel and hence re=uires intimate familiarity 7ith the Linux 7orld' Real-time $ersions of Linux ha$e matured to the oint that they can no7 "e considered as $ia"le candidates for real-time a lications' Signi cant successes in using Linux for real-time a lications ha$e "een demonstrated in the ast fe7 years "y research grou s in uni$ersities+ industry+ and go$ernment la"oratories' The real-time modi cations are sta"le and ro$en+ and commercial enter rises are o ering training and su ort ser$ices' The Control Systems Grou of the Intelligent Systems #i$ision of NIST has had great suc-cess in using the real-time modi cations to Linux for real-time control a lications in ro"otics and machine tool control' Those a lications+ and a sam ling of other non-NIST a lications 7ill "e summariDed to ro$ide the reader a feel for the areas 7here real-time Linux has "een used' This re ort is directed to control engineers and managers' It is intended to ro$ide an o$er$ie7 of real-time o erating systems and articularly of the real-time modi cations to the Linux o erating system' Enough detail is ro$ided so that the reader can ma4e an informed decision 7hether to commit the resources to e$aluate and consider ado ting Linux as a real-time o erating system' Pointers are ro$ided to further sources of information throughout the re ort and in more detail in the a endices' Lin4s are em"edded in the electronic $ersion of the re ort that 7ill connect the reader directly to those sources' These lin4s are also listed in the "i"liogra hy as text for the readers of hard co y $ersions'
9ersion -')')+ -))--(--((T(/.(

NIST! Intelligent Systems #i$ision

(.

Introduction to Linux for Real-Time Control Introduction

2.1

Trademar4s and Ser$ice Mar4s

&ll and any trademar4s and ser$ice mar4s that are re roduced in this re ort are the legal ro erty of the registered trademar4 or ser$ice mar4 o7ner'
&"solutely no re resentation is made that any trademar4 is the ro erty of the Cnited States Go$ernment+ nor the National Institute of Standards and Technology+ nor &eolean Inc'

2.2

NIST #isclaimer

Certain com anies and roducts are identi ed in this re ort in order to accurately ex lain the conce ts' Such identi cation is not intended to im ly recommendation or endorsement "y the National Institute of Standards and Technology+ nor is it intended to im ly a Gudgment that the roducts identi ed are necessarily the "est a$aila"le for the ur ose' There is no re resentation that the re ort resents an exhausti$e list of all com anies and roducts that are a$aila"le to the user of real-time o erating systems' :mission of any com any or roduct does not im ly a Gudgment that the roduct is unsuited in any 7ay 7hatsoe$er for the ur oses descri"ed in this re ort'

NIST! Intelligent Systems #i$ision


9ersion -')')+ -))--(--((T(/.(

(0

Cha ter . : erating Systems and Real-Time ;ernels


&n o erating system is the interface "et7een a userHs rogram and the underlying com uter hard7are' It also manages the execution of user rograms such that multi le rograms can run simultaneously and access the same hard7are' E$eryone 7ho uses a com uter encounters an o erating system+ 7hether it is @indo7s+ Mac+ Linux+ #:S+ or Cnix'

This cha ter descri"es the architecture and functionality of an o erating system and then summariDes the re=uirements of a real-time o erating system' #iscussion of standards and of s eci c details 7ill "e limited to Cnix-li4e o erating systems+ since Linux is a Cnix-li4e :S' The cha ter concludes 7ith an o$er$ie7 of real time 4ernels'

3.1

&rchitecture of an : erating System

&n o erating system+ or more s eci cally the core or 4ernel of the o erating system+ is al7ays resident in memory and ro$ides the interfaces "et7een user rograms and the com uter hard7are' This is sho7n schematically in <igure .'(' The name 4ernel follo7s from the analogy of a nut+ 7here the 4ernel is the $ery heart of the nut and+ in the com uting domain+ the 4ernel is the $ery heart of the o erating system' Continuing the analogy+ rotecti$e layers around the 4ernel that ro$ide user authoriDation and interaction are called shells '

The hysical memory in the com uter is artitioned into user s ace and 4ernel s ace+ 7ith the 4ernel s ace reser$ed for the 4ernel code' The 4ernel of a multi-tas4ing o erating system can manage multi le user rograms running simultaneously in user s ace so that each rogram thin4s it has com lete use of all of the hard7are resources of the com uter and+ other than for intentional messages sent "et7een rograms+ each rogram thin4s that it has itHs o7n memory s ace and is the only rogram running'
Communication "et7een user-s ace rograms and the 4ernel code is achie$ed through system calls to the 4ernel code' These system calls ty ically are to access shared hysical resources such as dis4 dri$es+ serial? arallel orts+ net7or4 interfaces+ 4ey"oards+ mice+ dis lay screens+ NIST! Intelligent Systems #i$ision (/
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control : erating Systems and Real-Time ;ernels

<igure .'(! : erating System &rchitecture and audio and $ideo de$ices' :ne unifying as ect of Linux?Cnix systems is that all the hysical resources a ear to the user rograms as les and are controlled 7ith the same system calls such as o enEF+ closeEF+ readEF+ 7riteEF' &ll of the in ut?out ut acti$ity is controlled "y the 4ernel code so that the user-s ace rograms do not ha$e to "e concerned 7ith the details of sharing common hysical resources' #e$ice-s eci c dri$ers in the 4ernel manage those details' &n o erating system is thus tailored to run on s eci c com uter hard7are and it isolates user rograms from the s eci cs of the hard7are+ allo7ing for orta"ility of user-s ace a lication code' The o erating system is generally larger than Gust the 4ernel com onent resident in hysical memory' Some code that extends the 4ernel functionality is also resident in hysical memory in user s ace and includes functionality li4e 4ernel logging+ rocess initiation+ timed rocess execution+ and remote rocedure call su ort' Some o erating systems su ort a mechanism of loada"le modules to extend the

4ernel functionality' Linux is one exam le of such an o erating system 7here modules can "e loaded and unloaded into the 4ernel s ace "y user-s ace commands' :ne maGor "ene t is that de$el-o ers of 4ernel dri$ers do not ha$e to re eatedly re"oot the com uter and reload the com lete 4ernel to test changes to the 4ernel functionality' & minor "ene t is to reduce the amount of memory used "y the 4ernel "y loading only the modules that are re=uired to interface to the currently-con gured hard7are'
: erating systems usually ro$ide a 7ide $ariety of common ser$ices "eyond managing NIST! Intelligent Systems #i$ision (2
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control : erating Systems and Real-Time ;ernels

execution of the user rograms and interfacing to the hard7are' <unction li"raries and utility rograms such as le management rograms+ "ro7sers+ editors+ com ilers+ de"uggers+ e-mail user agents+ diagnostics+ and dis4 management rograms are exam les' These rograms remain resident on dis4 until needed' The architecture of an o erating system is thus a core or 4ernel that remains in memory at all times+ a set of rocesses in user-s ace that su ort the 4ernel+ lus $arious modules and utility rograms that remain stored on dis4 until needed' The 4ernel manages simultaneous execution of multi le user rograms and isolates user rograms from the details of managing the s eci c hard7are of the com uter'

3.2

<unctionality of a general ur ose o erating system

The main functions of the 4ernel of the o erating system are memory management+ rocess scheduling+ interfacing to the hard7are+ le management+ and communication 7ith external de$ices and net7or4s' Each of these 7ill "e discussed "rie y' 3.2.1

Memory Management

Memory management is the mechanism ro$ided "y the o erating system to allocate mem-ory re=uested "y a rocess and deallocating memory 7hen a rocess terminates' &nother re=uirement is to ensure that memory+ re$iously allocated and no7 no longer re=uired "y the rocess+ is released and made a$aila"le for allocation to other rocesses' This last re=uirement is 4no7n as gar"age collection' There are t7o fundamentally di erent a roaches to memory addressing' :ne is a at memory model using address registers that are 7ide enough to address any 7ord in the largest-concei$a"le memory s ace such as in the Motorola Po7er PC Micro rocessors' The second is a segmented address model that uses t7o address registers+ one that holds addresses for a su"-set of the memory s ace+ a second one that selects 7hich of the su"sets to address+ such as in the Intel ,)x,2 micro rocessors' The memory s ace a$aila"le to any user rogram is a com"ination of cache memory+ hysical memory and $irtual memory' Cache memory is an integral art of the CPC silicon and stores a small su"set of instructions and data from the currently executing rogram' Physical memory is semiconductor Random &ccess Memory ER&MF and stores instructions and data for the currently executing rogram' 9irtual memory is a ercentage of the a$aila"le hard dis4 storage and ty ically stores instructions and data for rograms that do not t into the hysical memory s ace' Cache memory can "e accessed () to ()) times faster than R&M 7hich in turn is ()) to ())) times faster than dis4 access' The 4ernel code utiliDes the CPC and hard7are memory-management features to trans ar-ently mo$e the instructions and data "et7een cache+ hysical+ and $irtual memory+ trying to antici ate 7hat data and instructions 7ill "e accessed and to ha$e those a$aila"le in cache or at least in R&M 7hen needed'
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

(3

Introduction to Linux for Real-Time Control : erating Systems and Real-Time ;ernels

3.2.2

Memory Protection

& "asic re=uirement for a general- ur ose o erating system is that each user rocess o erates in itHs o7n+ isolated+ address s ace' No user rocess should "e a"le to 7rite into the memory allocated to another user rocess' This user-s ace memory rotection is enforced "y the CPCHs Memory Management Cnit EMMCF' <or most em"edded a lications+ see Sec-tion .'0'(+ the CPC does not ha$e a MMC and conse=uently+ the user-s ace rocesses must "e carefully managed so that memory controlled "y other rocesses is not corru ted' <or the s ecial case of the 4ernel code itself+ all tas4s 7ithin the 4ernel share the same address s ace' The underlying assum tion is that the ex erienced rogrammers 7riting the 4ernel code exercise great care to not 7rite into memory that they are not res onsi"le for'

These memory- rotection rules also a ly to real-time o erating systems' If the realtime o erating system can su ort user-s ace real-time rocesses+ and the CPC does ha$e a MMC+ then the rocesses execute in their o7n+ rotected memory s ace' 3.2.3

Scheduling and Tas4 Management

The 4ernel code is res onsi"le for scheduling the execution of the user-s ace rograms' The scheduling is done in such a 7ay that users are una7are that the rogram code 7ill "e sto ed from executing and laced on hold for many milliseconds to allo7 other user rogram code to execute' The scheduling may "e achie$ed "y gi$ing each user rogram a xed ercentage of CPC time+ or user rograms may "e rioritiDed and higher riority rograms gi$en a higher ercentage of CPC time' @hen a higher riority rogram is executed and the lo7er riority rogram is aused+ then the higher riority rogram is said to ha$e reem ted the lo7er riority one' <ast and deterministic reem tion is the 4ey to e ecti$e real-time o erating systems+ as 7ill "e discussed in later sections of this re ort' The P:SI> standard+ descri"ed in Section .'.+ de nes a thread to "e a o7 of control 7ithin a rocess' &ll threads share the same memory s ace 7ithin the rocess' & rocess is de ned "y the P:SI> standard to "e a single memory s ace 7ith one or more threads executing in that s ace' Each and e$ery rocess running under the o erating system has itHs o7n memory s ace' The acce ted understanding is that rocesses are executing in user s ace rather than 4ernel s ace' There is no commonly agreed de nition of 7hat constitutes a tas4' In this document+ the 7ord tas4 shall "e used to descri"e the executa"le code com onents that are running in 4ernel s ace'
& fundamental conce t of scheduling is that of di$iding execution time into xed slices' This time slicing can "e im lemented in user s ace "y a rocess executing a slee EF system call 7hen the rocess has nished the cyclic com onent of itHs execution' The 4ernel returns control to the user rocess on+ or after+ the ex iration of the time re=uested in the slee EF call' *y returning control some time after the ex iration of the slee EF call+ an o erating system can still claim P:SI> com liance yet introduce Gitter into the execution of re etiti$e tas4s'
NIST! Intelligent Systems #i$ision (,
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control : erating Systems and Real-Time ;ernels

3.2.4

8ard7are Interfaces

: erating systems ro$ide the lo7 le$el rograms+ called de$ice dri$ers + that control the com uter hard7are' #ri$ers can "e 7ritten to "e called directly from 7ithin the 4ernel code or they can o erate inde endently and interru t the 4ernel code 7hen something ha ens that needs attention' The rst mode is called olling and the second is called interru t dri$en' Most o erating systems 7or4 7ith interru t-dri$en dri$ers' #ata originating from sources outside the com uter system can arri$e at any time' The interface de$ice E4ey"oard+ mouse+ serial ort+ arallel ort+ net7or4 interfaceF indicates the arri$al of the data "y signaling the CPC at the hard7are le$el' This signaling is through the interru t ins ro$ided on the CPC' : erating systems generally ac4no7ledge an interru t "y sto ing the CPC from executing the current rocess and running the interru t-ser$ice routine EISRF that reads the incoming data from the interface de$ice' @hen the ISR nishes+ control is returned to the original+ interru ted+ rocess' These interru t rocesses are an integral art of the 4ernel and are designed to erform a minimal amount of rocessing+ ty ically Gust reading the incoming data and 7riting it to 4ernel s ace storage+ "efore returning'

Interru ts can "e assigned riorities so that rocesses that need ra id res onse+ such as dis4 reads+ can interru t lo7er riority rocesses such as serial ort reads'
The time "et7een an interface de$ice re=uesting ser$ice+ "y raising an interru t ag+ and the time that the CPC starts rocessing the interru t rocess is called the interru t latency'
&nother signi cant role for the 4ernel code is to synchroniDe user-s ace and 4ernel-s ace access to the shared hard7are resources' The traditional method is to ena"le some 4ind of soft7are loc4 in the 4ernel 7hen one user-s ace rogram is using a hysical resource+ and to disa"le that loc4 7hen the user-s ace rogram is nished 7ith the resource' &ll other user-s ace rograms are rohi"ited E"y the 4ernel codeF from accessing the hysical resource 7hen it is loc4ed' :ne s eci c ty e of loc4 is a s in loc4+ 7here the rogram sits in a tight loo until the necessary hard7are de$ice is a$aila"le' This maximiDes the res onse for the user rogram'

3.2.5

<ile Management

:ne of the signi cant functions of the o erating systems is to ro$ide ersistent storage of information that is created in memory "y the execution of a rocess' This information is ty ically stored as les on the le system su orted "y the o erating system' The o erating system 4ee s trac4 of 7hich cylinders+ trac4s+ and sectors on a dis4 are used to store each and e$ery "loc4 of information that com rises a le' The user is una7are that the le is stored in non-contiguous grou s of sectors on the dis4 dri$e' Se arate directories+ or folders+ can "e created to hold related les' <iles are managed hierarchically+ such that folders can contain other folders 7hich+ in turn+ contain folders and les' o <ile systems can exist on many di erent ty es of media+ including hard dis4s+ C# R:M+ y dis4s+ ash memory+ e$en read?7rite memory'
Real-time a lications may ha$e le management re=uirements' :ne such exam le is data NIST! Intelligent Systems #i$ision (1
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control : erating Systems and Real-Time ;ernels

ac=uisition systems' In such a lications+ the le management tas4s 7ould "e run at a lo7er riority 7hile the real-time a lications 7ould run at a higher riority+ reem ting the le management tas4s as re=uired' 3.2.6

Communication

#ata communication+ or message assing+ "et7een rocesses in Linux?Cnix is commonly achie$ed 7ith the *er4eley Soft7are #istri"ution E*S#F soc4et system calls' These 7ere introduced in release 0'- of *S# Cnix in (1,.' The idea of a soc4et is to J lug-inK to the other rocess and send the message+ 7ith the o erating system ta4ing care of deli$ering it' The soc4et layer su orts communication "et7een rocesses that are running on the same machine or e$en di erent machines' Soc4ets can "e o ened using a num"er of di erent rotocols including the Cnix soc4et for intra-machine communication and TCP soc4ets for inter-machine communica-tion' :ne disad$antage of the original soc4et im lementation is that information is transmitted as lain text "et7een a air of soc4ets' Netsca e addressed this issue in (110 "y ro osing the Secure Soc4et Layer 7hich ro$ides for encry tion of the information and identi cation of "oth machines in$ol$ed in the communication' The SSL rotocol+ no7 4no7n as the Trans ort Layer Security rotocol+ is at the heart of nancial transactions on the Internet'

Soc4ets allo7 rogrammers to s ecify communications at the a lication le$el' The o erat-ing system then notes 7here the reci ient rocess is and im lements lo7er le$el communication rotocols to deli$er the message' Those lo7er le$el mechanisms can "e distinguished as external or internal communications' 3.2.6.1 External Communication

The o erating system ro$ides a set of rimiti$es that ena"les the com uter to communi-cate 7ith other machines using standard rotocols such as Internet Protocol EIPF+ No$ell IP>+ & leTal4+ and Microsoft SM*' These higher-le$el rotocols are+ in turn+ "uilt u on Ether-net EIEEE ,)-'.F or other Media &ccess Protocols' The o erating-system rimiti$es include de$ice dri$ers for the communication hard7are+ ac4et routing and ltering functions+ and im- lementation of the rotocol stac4s such as Transmission Control Protocol?Internet Protocol ETCP?IPF' 3.2.6.2 Internal Communication

Internal communication is the class of communication "et7een t7o rocesses+ "et7een t7o tas4s+ or "et7een a rocess and a tas4 7hen "oth are running on the same com uter' This is generally referred to as inter- rocess communication'
Inter- rocess communication is su orted "y the o erating system through rimiti$es such as shared memory+ "inary signals+ and i es' Since t7o or more rocesses could "e accessing the shared memory segment at the same time+ there is a need to indicate 7hen one rocess is 7riting to the segment so that the other rocessEesF 7ait until the 7rite is com lete "efore NIST! Intelligent Systems #i$ision -)
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control : erating Systems and Real-Time ;ernels

erforming their o7n read?7rite action' This indication is achie$ed "y sema hores 7hose functionality includes the action of restarting a rocess that has "een laced on hold 7aiting for the shared memory' Pi es are an alternati$e to shared-memory communication and use di erent system calls to the shared-memory interface' Shared-memory and i es allo7 nite-siDe messages to "e assed "et7een rocesses 7hile "inary signals con$ey only one "it of information' Signals are another communication mechanism "et7een rocesses' :nly one "it of infor-mation is in$ol$ed+ "ut the o erating system may su ort a"out ()) such signals 7ith each con$eying their o7n ex licit meaning to the recei$ing rocess'
&ll these inter- rocess communication mechanisms in$ol$e a timing o$erhead' Signals are faster than i es 7hich are faster+ in turn+ than shared memoryL soc4ets are the slo7est of all'

3.3

Standards

The Institute of Electrical and Electronic Engineers EIEEEF has led the de$elo ment of a standard+ "ased on the CNI> o erating system+ that de nes the re=uirements of a Porta"le : erating System Interface EP:SI>F' The IEEE Std ()).'(--))( M 02+ 10N is a uni cation of t7o of the re$ious standardiDation e orts+ P:SI>'( ESystem Interfaces and 8eadersF+ and P:SI>'- EShell and CtilitiesF' StandardiDation e orts in arallel 7ith P:SI>'( de$elo ed IEEE Std ()).'("-(11. to co$er real-time extensions and IEEE Std ()).'(c-(11/?12 to detail the thread extensions' The original 7or4 on real-time extensions 7as 4no7n as P:SI>'0 M .,N' Since (11. there has "een further 7or4 on the real-time extensions standard and+ conse=uently+ IEEE ()).'(" has "een su erseded "y IEEE Std ()).'(d-(111 M 02N' & grou of four ro les for real-time P:SI> characteriDing single-tas4 and multi-tas4 o erating systems 7ith and 7ithout le systems 7as naliDed in (11,' This grou of standards is 4no7n as ()).'(.-(11, PSE/( to PSE/0 EPosix Standard En$ironmentF' The International :rganiDation for StandardiDation EIS:F has ado ted the P:SI>'( stan-dard as IS: 110/-( and the P:SI>'- standard as IS: 110/-- M 2/N and has su erseded IEEE ()).'(. 7ith IS: (/-,3--!-)))' P:SI> Standard P:SI>'( P:SI>'P:SI>'0 P:SI>'0a IEEE Standard ()).'(--))( ()).'(--))( ()).'("-(11. ()).'(d-(111 ()).'(c-(110 #escri tion System Interfaces and 8eaders Shell and Ctilities Real-time extensions Su ersedes ()).'("-(11. Threads Extensions

Ta"le .'(! P:SI>?IEEE Standards


NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

-(

Introduction to Linux for Real-Time Control : erating Systems and Real-Time ;ernels

Linux 7as designed from the start to "e a P:SI>-com liant o erating system' The current standard Linux com lies 7ith P:SI>'(+ the system call interface+ and P:SI>'(c the threads extension' It is almost com liant 7ith P:SI>'-+ the shell and utilities standard' This re ort uses P:SI> as the "asic reference standard for discussing o erating systems+ Linux+ and real-time extensions of Linux' 3.3.1

#e artment of #efense Standards

The #e artment of #efense and the &rmy in articular are 7or4ing to7ard standards for intero era"ility of 7ea ons systems soft7are' The @ea on Systems Technical &rchitecture @or4ing Grou E@ST&@GF has s eci ed a Boint Technical &rchitecture-&rmy EBT&-&F that features a @ea ons Systems Common : erating En$ironment EC:EF' The C:E calls for o en systems 7ith standard interfaces+ and cites P:SI> s eci cally' Rather that trying to s ecify or standardiDe at the o erating system le$el+ the C:E calls for standard & lication Programming Interfaces using standard system calls such as those s eci ed in the P:SI> standards'

@ST&@G is directly targeted at hard real-time and em"edded systems de$elo ers' The o en source and P:SI> conformance features of Linux are directly rele$ant to the @ST&@G hiloso hy' <urther+ the o en source nature of Linux matches the Go$ernmentHs interests in ac=uiring full data rights in order to maximiDe maintaina"ility and extensi"ility'

3.4

Re=uired <unctionality for Real-Time

Real-Time : erating Systems ERT:SF are those a"le to ro$ide a re=uired le$el of ser$ice in a "ounded res onse time M (N' They can deli$er a res onse in a time less than a designated timing inter$al' The timing inter$al may "e long in com uting terms i'e' orders of seconds+ or it may "e short i'e' orders of microseconds' <or exam le+ a real-time rocess control system for a chemical or food lant may only sam le a sensor and calculate a control command once a second' :n the other hand+ for smooth res onse+ a ste er motor must "e ser$iced e$ery fe7 microseconds' & so-called hard real-time system is one that misses no timing deadlines+ a soft real-time system can tolerate missing some timing deadlines'

3.4.1

Em"edded $s Real-Time : erating Systems

Em"edded rograms are those that are a xed and integral art of a de$ice' <or exam le+ a hand-held com uter+ a tele hone ans7ering system+ and the control com uter for the engine of a car all ha$e xed rograms that start u 7hene$er o7er is turned on' These are called em"edded a lications' #e ending on the re=uired res onse time+ the o erating systems for em"edded a lications may or may not "e considered real-time o erating systems' Ser$icing human interactions does not in general re=uire real-time erformance+ "ut controlling a machine tool+ scienti c ex eriment+ or 7ea on system does'
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

--

Introduction to Linux for Real-Time Control : erating Systems and Real-Time ;ernels

3.4.2

Measures of Performance for Real-Time : erating Systems

The most $ital characteristic of a real-time o erating system is ho7 res onsi$e the o erat-ing system is in ser$icing internal and external e$ents' These e$ents include external hard7are interru ts+ internal soft7are signals+ and internal timer interru ts' :ne measure of res onsi$e-ness is latency+ the time "et7een the occurrence of an e$ent and the execution of the rst instruction in the interru t code' & second measure is Gitter+ the $ariation in the eriod of nominally constant- eriod e$ents' To "e a"le to o er lo7 latency and lo7 Gitter+ the o erating system must ensure that any 4ernel tas4 7ill "e reem ted "y the real-time tas4' Section 0'. details these measures and Section 0'0'( ro$ides a summary of latency and Gitter for standard and real-time Linux' 3.4.3

P:SI> Extensions for Real-Time &

lications

The P:SI> real-time extensions M (N ro$ide an insight into the additional functionality that is re=uired for a real-time o erating system' These real time extensions add message =ueues Efor communication "et7een tas4sF+ shared memory+ counting sema hores Eneeded to synchroniDe accesses to shared memoryF+ riority-"ased execution scheduling+ real-time signal extensions+ and higher resolution timers' The timers can generate time inter$als 7ith at least one microsecond resolution'

3.5

:$er$ie7 of &$aila"le Real-Time :?S

& (111 mar4et sur$ey "y Real-Time MagaDine M (--N redicted a mar4et for real-time o er-ating systems in -))( that 7ould ha$e 9x@or4s+ @indo7s CE 'NET+ AN>+ and S:System as the to four RT:S' These four o erating systems are discussed here in some detail' Latency num"ers ro$ided in the corres onding erformance sections are deri$ed from a re ort gener-ated "y the #edicated Systems Encyclo ediaM ..N' & more exhausti$e list of real-time o erating systems is gi$en in Ta"le &'(' 3.5.1

9x@or4s

@ind Ri$erHs 9x@or4s M ((1N has "een 7idely used in ro"otics+ rocess control+ a$ionics+ CNC e=ui ment+ and ight simulation control a lications' 9x@or4s has also "een de loyed in a lications in the telecommunications+ consumer electronics+ data net7or4ing+ and medical system areas'
The 7ind micro-4ernel core of 9x@or4s ro$ides multitas4ing+ interru t su ort and "oth reem ti$e and round ro"in scheduling' The intertas4 communications mechanisms su orted "y 9x@or4s includes shared memory+ message =ueues+ sema hores E"inary+ counting+ mutual exclusion 7ith riority inheritanceF+ e$ents and i es+ soc4ets and remote rocedure calls+ and signals' 9x@or4s is P:SI> com liant+ im lements the P:SI> Threads and adheres to NIST! Intelligent Systems #i$ision -.
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control : erating Systems and Real-Time ;ernels

the P:SI> Real Time Extension+ including asynchronous I?:+ counting sema hores+ message =ueues+ signals+ memory management E age loc4ingF+ and scheduling control'
The Tornado em"edded de$elo ment latform+ of 7hich 9x@or4s is the run-time com onent+ ro$ides a full suite of cross de$elo ment tools and utilities and communication facilities for host connections to the target' The Tornado autoscaling feature analyses the a lication code and incor orates o tional su"systems such as net7or4 ser$ices ETCP?C#P soc4etsF'

The -)) odd *oard Su ort Pac4ages E*SPsF su ort o ular commercial o -the-shelf EC:TSF "oards as 7ell as the RISC and CISC architectures' Exam les of targets su orted are the Motorola?I*M Po7erPC+ Motorola 2,;?CPC.-+ Intel Pentium &rchitecture family+ Intel Strong&rm and &RM' 3.5.1.1 Performance

&$erage latency ('3 microseconds+ maximum latency 2', microseconds on a -))M8D Pen-tium machine M ..N' 3.5.2

@indo7s CE 'NET

MicrosoftHs @indo7s CE 'NET M ,,N is a real-time o erating system designed for mo"ile a lications and a lications re=uiring a small foot rint' It su orts 7ireless technologies such as *luetooth+ ,)-'(x+ IP$2+ :"Gect Exchange Protocol E:*E>F+ MediaSense+ and Real Time Communication ERTCF?Session Initiation Protocol ESIPF' @indo7s CE 'NET su orts the ;er"eros Security Protocol and the Secure Soc4ets Layer ESSLF' It ro$ides -/2 le$els of thread riority+ nested interru ts+ riority in$ersion and can "e con gured to "e -)) ;" 7ith limited 4ernel functions'
@indo7s CE 'NET su orts the &RM3-)T+ &RM1-)T+ &RM()-)T+ Strong&RM+ >Scale+ MIPS II?.- 7ith <P+ MIPS II?.- 7ithout <P+ MIPS(2+ S8-.+ S8-. #SP+ S8-0+ 0,2+ /,2+ Geode+ and Pentium I-I9 rocessors' The Ne7 Platform @iDard hel s in starting designs for de$ices such as Cell hones?Smart hones+ #igital imaging de$ices+ industrial automation de$ices+ Internet?media a liances and Personal digital assistant EP#&F?Mo"ile handhelds' & lications de$elo ers on @indo7s CE 'NET can use a"out ()I of the @in.-&PIHs a$aila"le on the @indo7s -))) :?S' The P:SI> &PI is not su orted "y @indo7s CE 'NET' 'NET a lications may "e created 7ith Microsoft 9isual Studio 'NET and nati$e code created 7ith Microsoft eM"edded 9isual C66 0')' Csing emulation technology+ @indo7s CE 'NET de$elo ers can "uild and test the design on their @indo7s -))) or @indo7s >P Professional 7or4stations'

@indo7s CE 'NET+ as a real-time $ersion of @indo7s+ is not P:SI> com liant since @indo7s is not a Cnix-li4e o erating system'
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

-0

Introduction to Linux for Real-Time Control : erating Systems and Real-Time ;ernels

3.5.2.1

Performance

&$erage latency -'0 microseconds+ maximum latency /'2 microseconds on a -))M8D Pen-tium machine M ..N' 3.5.3

AN> Neutrino RT:S

AN> Soft7are Systems Ltd mar4ets the AN> Neutrino RT:S M ,.N' This RT:S has "een de loyed in em"edded systems for o$er -) years in mission and life-critical systems+ medical instruments+ a$iation and s ace systems+ rocess-control systems+ and in-car de$ices' CPCHs su orted are the x,2?Pentium+ Po7erPC+ &RM+ Strong&RM+ >Scale+ MIPS+ and S8-0' AN> Neutrino com lies 7ith the IEEE ()).'(" real-time standard'
The AN> micro-4ernel ro$ides ser$ices such as thread scheduling+ inter- rocess communication+ and uses synchronous message assing to communicate 7ith other :S modules' &ll :S modules run in their o7n memory rotected address s ace' AN> Neutrino also ro$ides con$entional synchroniDation ser$ices li4e sema hores+ conditional $aria"les+ and s in loc4s' Anet+ the AN> trans arent distri"uted rocessing mechanism facilitates indi$idual nodes in the net7or4 to access and use resources from any other node on the net7or4'

The AN> Neutrino RT:S architecture ro$ides se$eral modular com onents+ including the em"edda"le AN> Photon microGCI to de$elo integrated Internet ca a"ilities+ international fonts+ and so histicated user interfaces' <ile system su ort is ro$ided for AN>+ Linux+ #:S+ <lash+ C#-R:M?#9#+ CI<S and N<S' AN> Neutrino ro$ides net7or4ing su ort 7ith AN> Neutrino distri"uted rocessing EAnetF+ Tiny TCP?IP stac4+ and Net*S# ('/ IP$0 or IP$2 stac4' #e$ices su orted include CS*+ audio+ PCI+ serial+ arallel+ and I#E and SCSI dis4s' AN> Neutrino also ro$ides a range of "oard su ort ac4ages for o ular "oards and rocessors' 3.5.3.1 Performance

&$erage latency ('2 microseconds+ maximum latency 0'( microseconds on a -))M8D Pen-tium machine M ..N' 3.5.4

S:System .

@ind Ri$erHs S:System . M ((,N is a multitas4ing en$ironment designed for use in em"ed-ded system de$elo ment for "oth sim le and com lex net7or4ed a lications' Recent $ersions of the S:System ro$ides the a lication de$elo er 7ith memory management and rotec-tion+ resource monitor+ and an exce tion manager to re$ent system resets on a lication exce tions' The RISM6 . I#E EIntegrated #e$elo ment En$ironmentF and the R:*E6 target?de"ug agent ro$ide tools and technologies to de$elo and de"ug rm7are and mixed latform a lications+ ro le and o timiDe system erformance and ena"le and manage a team-"ased de$elo ment rocess' RISM6 su orted de"uggers allo7 full $ie7ing of S:S6 o"Gects NIST! Intelligent Systems #i$ision -/
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control : erating Systems and Real-Time ;ernels

such as =ueues+ sema hores or memory regions' M:NT6 ro$ides real time analysis tools' The REPC6 reentrant &NSI-com liant li"rary+ 8ILE6 le system manager+ and LM6 li"rary manager facilitate lug-in soft7are com onents and li"raries'
The S:System . multitas4ing de$ice inde endent 4ernel manages?allocates resources and coordinates multi le asynchronous acti$ities' ItHs riority-"ased tas4 scheduler su orts tas4-s eci c+ time-"ased reem ti$e scheduling and handles interru ts externally' S:S6 ser$ices include tas4 management+ sema hores+ e$ents+ timers+ xed?$aria"le length =ueues+ and asyn-chronous signals' :ther features include Cser and Su er$isor modes+ and an E$ent logger'

P:SI> style signals Etimers+ sema hores and messagesF and extensions for Threads are su orted' E$ent dri$en o erations are facilitated "y allo7ing tas4s to simultaneously 7ait for e$ents+ timers+ =ueues and sema hores' Mutual exclusion sema hores 7ith the riority inheritance and riority ceiling rotocol are im lemented' S:System . ro$ides A*IN# E=uic4 "indingsF mode 7hich result in s eed im ro$ements for selected system calls'

Net7or4ing su ort ro$ided "y the S:System . includes TCP?IP stac4s+ L&N?@&N rotocol+ RPC+ N<S client?ser$er rotocols+ STRE&MS+ SNMP and 8TTP'
The *SPs su ort commercially a$aila"le target latforms including the Motorola?I*M Po7erPC architecture family+ Motorola?I*M PPC+ Motorola MPC,xx+ and the MIPS architecture family' The hosts su orted are @indo7s NT 0?-))) and CNI>-Solaris 7or4stations'

3.5.4.1

Performance

&$erage latency ('1 microseconds+ maximum latency .', microseconds on a -))M8D Pen-tium machine M ..N' 3.5.5

Summary

This =uic4 re$ie7 demonstrates that commercial real-time o erating systems are full-featured o erating systems that ro$ide a host of ser$ices 7hich em hasiDe time and memory e ciency and ra id and deterministic e$ent res onse' The maGor commercial roducts outlined a"o$e ha$e "een im lemented on a 7ide $ariety of rocessors and are solid+ 7ell-su orted industrial-grade soft7are roducts' & summary of other RT:S roducts is ro$ided in & endix &'

NIST! Intelligent Systems #i$ision


9ersion -')')+ -))--(--((T(/.(

-2

Cha ter 0 &n Introduction to Real-Time Linux


4.1

8istory and <unctionality of Linux

Linux is a Cnix-li4e o erating system' The rst $ersion of Cnix+ called CNICS ECni lexed : erating and Com uting SystemF 7as de$elo ed "y ;en Thom son for the then ne7 #igital E=ui ment Cor oration P#P (( family of minicom uters' CNICS Elater shortened to CnixF 7as designed to "e a sim ler alternati$e to the MCLTICS EMulti lexed : erating and Com uting SystemF roGect' The MCLTICS roGect 7as a Goint e ort "y General Electric+ Massachusetts Institute of Technology and *ell La"oratories and 7as "egun in the mid (12)Hs' The MCLTICS o erating system 7as in turn ins ired "y MITHs ProGect M&C'

& ne7 system im lementation language+ called C+ 7as 7ritten "y ;en Thom son and #ennis Ritchie' They re7rote the Cnix 4ernel using the C com iler in (13.' C has e$ol$ed into a standard in its o7n right and has "ecome a general ur ose rogramming language commonly used for "oth lo7-le$el de$ice dri$ers and high-le$el a lication rograms' Cnix 7as clean and e cient+ and since it ro$ided economical access to a multi-user en$i-ronment it soon gained great o ularity in the technical community' &T%T ga$e uni$ersities royalty free licenses+ 7hich created a gro7ing ool of ad$ocates as students graduated and 7ent into industry' The 7or4station and ser$er mar4ets ha$e "een dominated "y Cnix and Cnix-li4e o erating systems since they 7ere created in the (1,)Hs' #es ite the fact that licenses 7ere royalty free+ Cnix 7as not an ideal teaching tool since licenses restricted source code distri"ution and modi cation' Se$eral sim li ed Cnixli4e o -erating systems 7ere created for teaching' :ne of the more o ular in the late (1,)Hs 7as &ndre7 Tannen"aumHs o erating system MINI> M (-)N'
In the early (1,)Hs+ Richard Stallman initiated a roGect to de$elo freely-a$aila"le soft7are' <reely-a$aila"le soft7are is characteriDed "y not ha$ing any restrictions+ nor re=uiring any royalty ayments+ on the distri"ution of the soft7are source code' :ne of the rst roGects for the <ree Soft7are <oundation E<S<F 7as to de$elo a C com iler 7hich 7as essential to the maGor goal of de$elo ing an o erating system' Since contri"utors to the <S< had come from a Cnix "ac4ground+ the roGect 7as titled GNC EGnu is Not Cnix+ 7hich is read as Ne7+ is Not NIST! Intelligent Systems #i$ision -3
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control &n Introduction to Real-Time Linux

<igure 0'(! Linux Mascot CnixF M ((/N' The C com iler 7as named gcc EGNC C com ilerF to di erentiate it from the ro rietary cc com iler that 7as su lied 7ith Cnix systems'
The <S< 7anted to ensure that any changes to the gcc com iler+ and any other <S< soft7are+ 7ere made a$aila"le 7ith the same license as the original 7or4' So the GNC Pu"lic Licence EGPLF came into "eing M .3N' The GPL s eci es that source code for any changes to any <S< roGect must "e made a$aila"le 7ith the same conditions as the original contri"ution'

Auic4ly follo7ing the release of an o erational C com iler+ there 7as a concerted e ort to de$elo the user-s ace command-line tools that 7ould "e re=uired for users to interact 7ith the lanned o erating system' Since the command-line tools 7ere de$elo ed from the ground u + these tools do not contain any of &T%THs ro rietary Cnix code'
Linus Tor$alds started the de$elo ment of Linux as a student roGect at the Cni$ersity of 8elsin4i M (-.N' The rst $ersion of Linux+ released in Se tem"er (11(+ 7as distri"uted as source code and could only "e com iled under MINI> using gcc' The early $ersions made extensi$e use of the aging architecture of the Intel .,2 rocessor+ seemingly limiting Linux to that CPC family' These limitations ha$e "een rogressi$ely remo$ed o$er the last decade+ and

no7 standard Linux can execute on fteen di erent rocessor families ranging from I*MHs DSeries mainframes to the &RM rocessor commonly used in handheld de$ices'

& Linux logo com etition e$ol$ed around the time of the release of $ersion -')' &t Linus Tor$alds re=uest+ the focus of all the entries 7as the enguin and Linus nally chose the image in <igure 0'( of a enguin J7ith a stomach full of herringK as em"odying the contented yet strong hiloso hy of Linux M ,(N'
<or many years Linux 7as an underground henomenon+ creating something of a cult among hac4ers and uni$ersity com uter science students and faculties' More recently+ Linux has "ecome 7idely o ular as a main stream technology since it is a$aila"le 7ith o en source code 7ith no re=uirement to ay royalties or license fees' <reely a$aila"le+ o en-source soft7are is not necessarily free of cost for the life of the roduct' Com anies such as Red 8at ha$e "usiness models "ased on selling documentation+ technical su ort and maintenance for Linux' I*MHs NIST! Intelligent Systems #i$ision -,
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control &n Introduction to Real-Time Linux

ado tion of Linux for their ser$er "usiness has gi$en credi"ility for cor orate decision ma4ers and hel ed fuel the ra id rise of Linux in recent years' Linux $ersion num"ering+ as gi$en in Ta"le 0'( ro$ides that e$en-num"ered $ersions e'g' (')'x+ -'-'x are sta"le releases' :dd-num"ered $ersions are de$elo er releases that are contin-ually ha$ing features added to the "ase 4ernel' 9ersion Range )')- O )'11 (')') O ('.'()) -')') O -')'.1 -'(') O -'('(-1 -'-') O -'-'--'.') O -'.'11 -'0') O -'0'(1 -'/') O -'/'/) -'2') O Period :cto"er (11( O March (110 March (110 O May (112 Bune (112 O Banuary -))( Se tem"er (112 O No$em"er (11, Banuary (111 O Se tem"er -))May (111 O May -))) Banuary -))( O &ugust -))No$em"er -))( O #ecem"er -))Release scheduled March -)). Ta"le 0'(! Linux 9ersion 8istory

Contri"utions to the 4ernel code are made "y many de$elo ers from all arts of the 7orld' Cltimately+ the code contri"utions that are incor orated into the o cial releases are erson-ally a ro$ed "y Linus Tor$alds' These o cial releases are made a$aila"le for do7nload from 4ernel'org M (-0N' There are also un-o cial source-code atches to the 4ernel that $arious de-$elo ers ma4e a$aila"le so that eo le 7ho 7ant to incor orate the o ered functionality can do so "y modifying their o7n co y of the 4ernel source code using the atch rogram and the source-code atches' :ne exam le of atches that made their 7ay into the 4ernel'org distri"ution is code contri"uted "y Ro"ert Lo$e that reduced the interru t latency to less than ( millisecond M ,-N' These modi cations 7ere rst made a$aila"le in #ecem"er -))( as atches against 4ernel $ersion -'0'(3' Then in <e"ruary -))- they 7ere incor orated into the 4ernel'org distri"ution 7ith $ersion -'/'0' The moti$ating goal for the de$elo ment of Linux 7as to ha$e a P:SI>-com liant o erating system' This target has "een maintained o$er the years and Linux com lies 7ith P:SI>'(+ system interface and headers+ and+ for the maGor art+ com liant 7ith P:SI>'shell+ tools+ and user utilities' Code de$elo ers for Linux ty ically use the GNC tool chain along 7ith their fa$orite editor to create and test code M ((/N' Com ilers exist for essentially all rogramming languages ranging from &da+ through C?C66+ to Ba$a' There are also gra hical Integrated #esign En$ironments EI#EsF for code-de$elo ment and de"ugging M .(N'
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

-1

Introduction to Linux for Real-Time Control &n Introduction to Real-Time Linux

4.1.1

Nomenclature

Throughout this re ort the hrase Jstandard LinuxK or Jstandard 4ernelK shall refer to the 4ernel'org distri"ution+ or non-real-time Linux 4ernel' The hrase Jreal-time LinuxK or Jreal-time 4ernelK shall refer to all im lementations+ discussed in Section 0'-'-+ that "ring lo7-latency and lo7-Gitter real-time erformance to the Linux 4ernel' 4.1.2

Standard Linux for Soft Real-Time &

lications

It is ossi"le to use standard Linux for soft real-time control a lications 7here the sam le time is relati$ely long+ say ())s of milliseconds+ and the a lication can tolerate missed timing schedules' :ne exam le is dis laying $ideo+ 7here missed schedules mean that a small num"er of frames are lost "ut the $ideo continues' &nother exam le is for streaming audio 7here missed schedules mean loss of audio generally heard as clic4s or o s' & third exam le is data ac=uisition and dis lay 7here a missed schedule means that a small set of data oints ne$er get dis layed' If loss of data can "e tolerated+ then standard Linux+ es ecially the latest 4ernels E$ersion P -'/'0F that include the "ottom-half reem tion logic+ descri"ed in Section 0'-+ can "e used' If that is not the case+ then the hard real-time im lementations are re=uired'

4.1.3

Em"edded &

lications

Real-time systems may also "e em"edded systems' Em"edded a lications ty ically run in small hysical and com uting foot rints+ often 7ithout 4ey"oards+ mice or monitors+ and usually 7ithout rotating media such as hard dri$es or C#-R:Ms that could not 7ithstand harsh en$ironments' Programmers can con gure Linux to run 7ithout any of these de$ices+ and there are se$eral o ular em"edded Linux distri"utions that come re-con gured and include useful tools for customiDation' Common customiDations include adding ash memory storage to re lace rotating media hard dis4s+ and re lacing the memory- and dis4-consuming > @indo7s gra hics com onent 7ith stri ed-do7n $ersions' Indeed+ many commercial roducts run Linux internally and do not resem"le des4to com uters at allL exam les include set-to "oxes+ tele$ision $ideo recorders+ ersonal digital assistants EP#&sF+ and game consoles' Many Linux distri"utions streamline the system considera"ly+ "oth reducing the time to "oot and resource consum tionL a 7e" list is maintained at M ,)N' In em"edded a lications the multi-minute "oot time for standard Linux 7ould generally "e a ro"lem' <or exam le+ a consumer 7ould reasona"ly ex ect a set-to ca"le-T9 "ox to "e o erational as soon as it is turned on' Su"-ten-second "oot times are ossi"le 7ith a memory"ased le-system and+ in the case of an I&.- PC+ re lacing the *I:S 7ith Linux*I:S that contains only the minimal functionality that Linux re=uires at "oot time M 3,N'
The usually-assumed latform for standard Linux is an Intel-"ased des4to or la to ma-chine' @hat is "ecoming more common lace is for manufacturers of handheld de$ices+ set-to de$ices+ or dedicated a liances to incor orate standard Linux as the o erating system for these em"edded a lications' These a lications may not need real-time erformance and the NIST! Intelligent Systems #i$ision .)
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control &n Introduction to Real-Time Linux

latency and Gitter of standard Linux is not a limitation for these a lications' &lternati$ely+ there can "e em"edded hard7are that re=uires deterministic real-time erformance and in these cases+ one of the real-time Linux distri"utions 7ill "e used in the em"edded a lication' So+ em"edded Linux can run on hard7are ranging from des4to machines to $ideo 7rist 7atches+ "ut em"edded Linux is not necessarily real-time Linux'

4.2

Modi cations that ma4e Linux Real Time

Interru t rocessing in the standard 4ernel is di$ided into t7o hal$es' The t7o sections are referred to as to -half and "ottom-half tas4s' The "ottom-half tas4 is the interru t handler and reads data from the hysical de$ice into a memory "u er' The to -half tas4 reads from the memory "u er and asses the data to a 4ernel accessi"le "u er' In the standard 4ernel+ 7ithout the reem tion atches+ all interru ts are disa"led 7hen the "ottom-half tas4 is running' This means that there can "e an ar"itrary delay+ the latency+ "efore a second interru t can "e ser$iced' The standard Linux 4ernel ro$ides a default timer resolution of ten milliseconds' The timer resolution can "e im ro$ed "y recom iling the standard 4ernel using a di erent timer di$isor+ "ut e$en 7ith the im ro$ed latency of one millisecond in $ersion -'/'0 there is not much oint in much higher timer resolution' &ll $ariants of real-time Linux ha$e introduced modi cations at the 4ernel le$el' The result of these modi cations is to reduce "oth the interru t latency and Gitter "et7een eriodic interru ts to the microsecond range+ allo7ing for faster res onse to external e$ents and higher resolution timing' 4.2.1

Standard-;ernel Preem tion

This methodology is to modify the standard Linux 4ernel to ensure that higher riority 4ernel rocesses can reem t lo7er riority rocesses and gain access to needed resources' This in$ol$es changing the standard de$ice-dri$er interru t-handler so that higher- riority interru ts are not "loc4ed for ar"itrary amounts of time 7hile a lo7er- riority interru t handler com letes its tas4'
Starting 7ith Linux $ersion -'/'0+ the standard 4ernel incor orates reem tion logic as sho7n in <igure 0'-' The resultant latency and Gitter is around ( millisecond on Pentium rocessors 7ith CPC cloc4s running at ())s of M8D' This erformance im ro$ement is satisfactory for su orting user-s ace audio and $ideo a lications+ "ut is clearly inade=uate for running eriodic interru ts at su"-millisecond sam le times' These su"-millisecond sam le times are ossi"le 7ith the im lementations discussed in Section 0'-'-'
Note that in <igure 0'- the real-time tas4 is one of many tas4s "eing controlled "y the 4ernel scheduler' This tas4 is the 4ernelHs reference to the real-time user-s ace rocess' The scheduler is a"le to run this higher- riority real-time tas4 "y reem ting any lo7er riority non-real-time NIST! Intelligent Systems #i$ision .(
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control &n Introduction to Real-Time Linux

<igure 0'-! Preem ta"le ;ernel &rchitecture tas4s in 4ernel s ace and thus the user-s ace rocess can achie$e the one millisecond scale latency that $ersion -'/'0 made ossi"le' 4.2.2

Real-Time Patches to the Standard ;ernel

<our strategies for modifying standard Linux to ro$ide real-time ca a"ility are discussed in this Section' Three of the four in$ol$e adding a second+ highly e cient+ 4ernel to handle realtime tas4s and the fourth in$ol$es ma4ing changes directly to the standard 4ernel' Exam le im lementations are "rie y mentioned here and discussed in more detail in Cha ter 3' Each of these $ariants of real-time Linux is distri"uted in the form of 4ernel atches' That is+ none of

these $ariants are a art of the o cial 4ernel source code distri"uted at 4ernel'org'

4.2.2.1

Micro ;ernel

This im lementation style ro$ides a second 4ernel that is an interface layer "et7een the standard 4ernel and the hard7are layer as sho7n in <igure 0'.' This second 4ernel is a com act code module+ a micro 4ernel+ that controls the execution of real-time tas4s and runs the standard Linux 4ernel as a "ac4ground tas4' The micro 4ernel interce ts the hard7are interru ts and ensures that the standard 4ernel cannot reem t any interru t rocessing in the micro 4ernel' It also schedules the real-time tas4s 7ith the highest ossi"le riority to minimiDe the tas4 latency'
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

.-

Introduction to Linux for Real-Time Control &n Introduction to Real-Time Linux

<igure 0'.! Micro ;ernel Real-Time &rchitecture The rimary exam le of the micro-4ernel im lementation is RTLinux+ de$elo ed at Ne7 Mexico Tech' The originator+ 9ictor Qodai4en+ has "een a7arded a atent that co$ers the logic of this im lementation M (.1N' The latest maGor release of RTLinux+ 9ersion .+ 7as made a$aila"le in <e"ruary -))(' The main change for this $ersion is that it im lements the P:SI> ()).'(. PSE/( minimal real-time en$ironment M 3(N' RT&I+ de$elo ed at Politecnico di Milano+ is the second distri"ution of real-time Linux to use the micro-4ernel strategy M -1N' This distri"ution started 7ith an early release of RTLinux+ in & ril -)))+ and enhanced the higher-le$el interfaces to the real-time ser$ices' The most recent release+ $ersion -0'('()+ 7as made in Se tem"er -))-' 4.2.2.2 P:SI> Real-Time Extensions

The second real-time modi cation strategy is to directly modify the standard 4ernel and to

ro$ide li"raries that together im lement the P:SI> real-time extensions+ there"y creating a system that conforms to the IEEE ()).'(d standard' In contrast to the micro-4ernel strategy there is no second 4ernel in this a roach' The atches are made directly to the standard 4ernel to im lement the timers+ signals+ sema hores+ rocess memory loc4ing+ shared memory+ riority scheduling+ synchroniDed and asynchroniDed I?: s eci ed in IEEE ()).'(d'
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

..

Introduction to Linux for Real-Time Control &n Introduction to Real-Time Linux

T7o di erent a

roaches are currently a$aila"le!-

;CRT The ;ansas Cni$ersity Real-Time Linux E;CRTF distri"ution started out as a roGect to im lement the timer enhancements s eci ed in IEEE ()).'(d' @hile the current ;CRT release contains the high-resolution timers and real-time scheduling im ro$ements+ it does not claim adherence to IEEE ()).'(d'
TimeSys Linux TimeSys 7as the distri"utor of the CMC Resource ;ernel a roach descri"ed in Section 0'-'-'0' The Resource ;ernel a roach ro$ided many useful ca a"ilities "ut did not reach latency le$els needed for many hard real-time a lications'

In May -))-+ TimeSys Cor released their o7n o en-source reem tion atches to the standard 4ernel M -.N' In addition to ma4ing the standard 4ernel reem ta"le+ the mod-i cations include a 4ernel scheduler that ro$ides scheduling for the "ottom-half 4ernel interru t rocessing and for interru ts themsel$es' This architecture is de icted in <ig-ure 0'- and "rings the 4ernel latency and Gitter do7n "elo7 ()) microseconds for CPCs running at ())s of M8D'
The reem tion and scheduling atches+ released under a GPL licence+ do not ro$ide the high-resolution timers that are needed for re etiti$e real time tas4s' The code modules that im lement the timers along 7ith modules for CPC and net7or4 resource reser$ation are art of the TimeSys ro rietary de$elo ment en$ironment called TimeSys Linux'

4.2.2.3

Nano ;ernel

The &da ti$e #omain En$ironment for : erating Systems E&#E:SF+ released as an o en-source roGect in Bune -))-+ ro$ides an interface "et7een the standard 4ernel and the hard7are M ()(N' This is similar to the micro 4ernel a roach descri"ed a"o$e+ "ut is im lemented in such a 7ay as to a$oid the claims of the Qodai4en atent' The "ac4ground history and design for &#E:S is descri"ed in a 7hite a er u"lished in -))( M (.2N' The &#E:S roGect is releasing all code under the the ro$isions of the GNC GPL to ro$ide a real-time frame7or4 that is not encum"ered "y any atented technology'
:ne signi cant characteristic of the nano-4ernel a roach is that many o erating systems can "e run in arallel on to of the nano-4ernel layer' &s sho7n in <igure 0'0 one of the o erating systems can "e real time+ the others can "e non-real-time o erating systems' &#E:S de$elo ers ha$e called their hard7are-to-4ernel interface a nano-4ernel rather than a micro-4ernel to further distinguish their contri"ution from the atented 7or4 of Qodai4en'

4.2.2.4

Resource ;ernel Extension

&s sho7n in <igure 0'/ the resource 4ernel is a com act code module that ro$ides a gate7ay to resources such as le systems+ serial and arallel orts+ and net7or4 interfaces for "oth the normal 4ernel and also for user rocesses' Not only does the resource 4ernel control the interru t reem tion issues for the standard 4ernel+ it ro$ides mechanisms 7here user-s ace NIST! Intelligent Systems #i$ision .0
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control &n Introduction to Real-Time Linux

<igure 0'0! Nano ;ernel &rchitecture rograms can re=uest+ reser$e+ and "e guaranteed a nite ercentage of machine resources such as memory+ CPC cycles+ net7or4 and le-system-transfer "and7idth' The resource 4ernel architecture 7as de$elo ed at Carnegie Mellon Cni$ersity starting in (112 M (-/N and 7as distri"uted for se$eral years "y TimeSys' The resource 4ernel as originally de$elo ed ne$er reached latencies re=uired for hard real-time a lications+ "ut it ro$ided the "ase for the TimeSys Linux May -))- release descri"ed in Section 0'-'-'-'

4.3

Performance Characteristics

The fundamental criteria for e$aluating erformance of a real-time o erating system are e$ent latency and eriodic Gitter' &n e$ent can "e an interru t generated "y hard7are external to the CPC or it can "e a signal internal to the o erating system such as a noti cation to start the next tas4 on a ready-to-run =ueue' 4.3.1

E$ent Latency

E$ents can "e either hard7are-generated interru ts or o erating-system generated

soft7are signals' E$ent latency is sho7n in <igure 0'2'


In the case of a hard7are interru t+ the latency is the time from 7hen a hard7are interru t re=uests ser$ice to the time 7hen the rst instruction of the interru t-ser$ice routine is exeNIST! Intelligent Systems #i$ision ./
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control &n Introduction to Real-Time Linux

<igure 0'/! Resource ;ernel Real-Time &rchitecture cuted' This latency can "e measured 7ith instrumentation external to the com uter system e'g' oscillosco es+ timer?counters+ etc' :ne consideration in measuring interru t latency is that the measurement 7ill include any delays introduced "y the com uter-system eri heral "us' Such delays could "e due to other eri heral de$ices transferring data o$er the "us and reem ting CPC "us access' <or an o erating-system generated e$ent+ the latency is the time from 7hen the signal is generated to 7hen the rst instruction of the tas4 is executed' This latency can "e measured using the CPCHs cloc4 counter register' This 20-"it register is incremented at the cloc4 rate+ e$ery - nanoseconds for a /))M8D CPC cloc4+ and a se=uence of its $alues

can "e stored in memory for later analysis' This measurement techni=ue is not a ected "y any delays due to eri heral de$ice "us accesses+ "ecause the counter register is internal to the CPC and is al7ays incremented e$ery cloc4 cycle' 4.3.2

Periodic Bitter

Periodic Gitter as sho7n in <igure 0'3 refers to the $ariations in time that a re etiti$e tas4 ex erience as it executes' The re etiti$e tas4 is at the heart of sam led-data control of mechanical de$ices' The models of the de$ice to "e controlled are calculated on the assum tion that the sam le time is 4no7n and xed' The control algorithms are+ in turn+ calculated from the de$ice model+ reinforcing the de endence on a 4no7n and sta"le sam le time' &ny Gitter in the sam le time leads to im recision in the control-system erformance'
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

.2

Introduction to Linux for Real-Time Control &n Introduction to Real-Time Linux

<igure 0'2! E$ent Latency

<igure 0'3! Periodic Bitter


NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

.3

Introduction to Linux for Real-Time Control &n Introduction to Real-Time Linux

4.4

System-Performance Measurement

Seminal a ers discussing the latency and Gitter issues ha$e "een resented at the Second and Third Real-Time Linux @or4sho s' M 12N M (.)N *oth these a ers discuss+ and resent results+ for eriodic Gitter that ha$e "een o"tained using the time-stam -counter techni=ue discussed in Section 0'.'(' The rst a er+ M 12N+ re orts a eriodic Gitter for "oth RTLinux and RT&I of less than 2 microseconds for a /)) microsecond eriodic e$ent running on a 0))M8D Pentium' Periodic Gitter for a /) millisecond eriodic rocess is re orted as "eing less than () microseconds for "oth RTLinux and RT&I in the second a er M (.)N'

Three articles at linuxde$ices'com M -/N rst resent results that sho7 standard Linux is not ca a"le of real-time erformance "ecause of the signi cant $ariation in interru t latency as the machine load changes' The articles then roceed to loo4 at the o tions a$aila"le that 7ill ma4e Linux real-time+ and then conclude that a eriodic Gitter test rogram running on a 02/M8D Celeron I&.- CPC can roduce a 7orst-case Gitter less than .) microseconds for "oth RTLinux and RT&I'
The mem"ers of the Linux community 7ho are interested in multi-media Eaudio?$ideoF a lications running on standard Linux are concerned 7ith the eriodic Gitter erformance in standard Linux' The large $ariations in eriodic Gitter rom ted the de$elo ment of the 4ernel reem tion code that is no7 art of the -'/ series standard 4ernels' Results resented in M .1N are for a 3/)M8D Pentium running standard 4ernel $ersion -'0'2 that has "een atched 7ith the re-em tion code' The /', millisecond eriodic tas4 is reading 32, "ytes of audio data' The a$erage Gitter re orted is less than ( millisecond 7ith the system running a $ariety of stress tests' & tool 7as de$elo ed M (((N to ease the rocess of lotting the Gitter in either a standard or a real-time 4ernel' The tool lots the data in a gra hical form onto the >(( dis lay'

4.4.1

Com aring Real-Time and Standard Linux

The Electronics La"oratory in the Physics #e artment at the Cni$ersity of La Plata+ &rgentina+ u"lished a com arison of standard and RTLinux M .2N in (113' The hard7are 7as a (-)M8D Pentium machine running standard Linux and then RTLinux' :ne test com ares the eriodic Gitter in generating a 0) millisecond s=uare 7a$e+ the second test com ares the interru t latency for standard and RTLinux' The s=uare 7a$e tas4 7as executing 7hen the machine 7as su"Gect to a num"er of di erent loading conditions' The a$erage eriodic Gitter 7as (,/ microseconds for standard Linux and reduced to ('3/ microseconds for RTLinux
The interru t latency tas4 7as also run under the same $arying load conditions' The latency $aried from -) microseconds to 0,)) microseconds using standard Linux and 7as reduced to a range of -'0 microseconds to 0'0 microseconds 7hen the machine 7as running RTLinux'

These results 7ere o"tained "y measuring the transitions of ins on the arallel ort and the transitions of the interru t-re=uest line 7ith eriod-measuring timer?counter hard7are' :ne com ounding issue for this techni=ue is that the timing data is transferred o$er the CPC data NIST! Intelligent Systems #i$ision .,
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control &n Introduction to Real-Time Linux

"us to the eri heral chi that is the arallel ort+ and this data "us can "e held "y other eri heral de$ices erforming #irect Memory &ccess E#M&F data transfers' The re orted results include the I?: timing uncertainties' 4.4.2

Com arison 7ith other Real-Time ;ernels

Commercial RT:S o er a 7ider range of "oard su ort ac4ages than those ro$ided "y the a$ors of real-time Linux' It is in the commercial interest of CPC "oard manufacturers to "e a"le to o er at least one real-time o erating system that 7ill o erate on their hard7are straight out of the "ox' E=ually+ the commercial interests of RT:S roducers are 7ell ser$ed "y "eing a"le to o er their roduct on a 7ide range of CPCs and CPC?"oard com"inations' Real-time Linux is "ecoming more attracti$e to "oard manufacturers+ so much so that se$eral o er realtime Linux as one of the RT:S that can shi 7ith their "oards'

There are commercial com anies su orting some $ersions of real-time Linux+ listed in Cha ter 3+ and su ort agreements may "e entered into directly 7ith those com anies' In general+ technical su ort for o en-source real-time Linux $arieties is more limited than for commercial RT:S roducts' &n ad$antage of the o en-source model is that it is ossi"le for the user to im lement strategies for further im ro$ing erformance "y modifying the code in the interru t handler+ li4e olling the time-stam counter re orted in M 12N' Techni=ues such as this "ring timing uncertainties into the nanosecond realm' 4.4.2.1 Performance Com arison

Real-time Linux+ such as RTLinux and RT&I+ exhi"it com ara"le latency and eriodic Gitter to commercial real-time o erating systems+ that is+ latency and Gitter in the order of microseconds for rocessors running at a cloc4 rate of ())s of M8D' & lication Non Real Time Soft Real Time 8ard Real Time 8ard Real Time 8ard Real Time Latency?Bitter ()) micro to ()) milliseconds ( millisecond () to ()) microseconds ( to () microseconds ( to () microseconds #e$' Sys' R S/)) S) S) to S-)+))) S) S()+))) Royalty R S()) S) S) S) S())

Standard :?S Standard Linux IEEE ()).'(d Linux Real-Time Linux RT:S ;ernels

Ta"le 0'-! Linux Performance Com arison

Ta"le 0'- summariDes the relati$e erformance and costs of a cross-section of o erating systems' The exam le Standard :?S could "e standard Linux rior to $ersion -'/'0 or @indo7s' The Standard Linux ro7 refers to standard Linux released after $ersion -'/'0' & roximate costs are resented in the last t7o columns' The #e$' Sys' column itemiDes the cost er

NIST! Intelligent Systems #i$ision


-')')+ -))--(--((T(/.(

.1

9ersion

Introduction to Linux for Real-Time Control &n Introduction to Real-Time Linux

de$elo er of a license for the de$elo ment system tools 7hile the Royalty column lists the cost er de loyed unit of the nal roduct' The cost of de$elo ment systems and royalties is only a small art of the total life cycle cost of a real-time or em"edded system' Thus+ Ta"le 0'- should not "y itself "e used to ma4e decisions on 7hich ty e of o erating system to de loy' 8o7e$er+ the attracti$eness of free+ o en-source soft7are for long term extensi"ility and maintaina"ility of soft7are systems is clear' Real-time $ersions of Linux no7 ro$ide those attractions 7ith erformance that is com ara"le to ro rietary commercial RT:S 4ernels'

NIST! Intelligent Systems #i$ision


9ersion -')')+ -))--(--((T(/.(

0)

Cha ter / & lication Case Studies

This cha ter re$ie7s NIST success stories in using RTLinux and RT&I in machine tool and ro"ot control' This is follo7ed "y a sam ling of a lications using real-time Linux in other areas' The intention of this cha ter is to con$ince the reader that real-time Linux is gaining 7ides read acce tance not only in uni$ersities "ut also in go$ernment and industry' The Real Time Linux <oundation ro$ides an extensi$e list of a lications 7here real-time Linux is "eing used at 777'realtimelinuxfoundation'org'

5.1 5.1.1

NIST Sam led #ata Control


EMC

The Enhanced Machine Controller EEMCF is an o en-source im lementation of a machine tool controller originally 7ritten "y NIST+ M -+ (0+ ((-N+ and is no7 a colla"orati$e e ort in-$ol$ing engineers and enthusiasts from around the 7orld' The roGect 7as started at NIST to ro$ide a reference im lementation of a com lete Com uter Numerical Controller ECNCF and to hel $alidate o en architecture controller standards such as the : en Modular &rchitecture Controller E:M&CF and STEP-NC' EMC+ as sho7n in <igure /'(+ im lements real-time control of ser$o or ste er motor ma-chines such as three-axis 4nee mills o ular in small Go" sho s' EMC is con gura"le and has "een used to dri$e other ty es of machines+ such as hexa ods and ro"ot cranes' Real-time im- lementations of EMC ha$e "een orted to RTLinux and RT&I' Non-real-time im lementations ha$e "een orted to Linux+ Sun:S and Microsoft @indo7s' EMC consists of four main com onents' The motion controller emcmot is the real-time com onent+ and is res onsi"le for lanning traGectories+ com uting the machine 4inematics+ and dri$ing the motors' These functions are commonly erformed "y CNCs in industrial automation'
The I?: controller emcio is res onsi"le for handling in ut and out ut associated 7ith s indle control+ the emergency sto relays+ art coolant+ machine lu"ricators and other auxiliary NIST! Intelligent Systems #i$ision 0(
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control &

lication Case Studies

<igure /'(! EMC Controller &rchitecture


NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

0-

Introduction to Linux for Real-Time Control &

lication Case Studies

e=ui ment' These functions are commonly erformed "y rogramma"le logic controllers EPLCsF in industrial automation' emcio does not run in real time+ unli4e a con$entional PLC+ although it is ossi"le to do so' In fact+ se$eral o en source im lementations of realtime PLCs exist+ such as MatPLC M (..N and ClassicLadder M .)N and EMC de$elo ers are acti$ely ursuing them as re lacements to emcio' The tas4 controller emctas4 is res onsi"le for handling user re=uests such as to Gog axes or run numerical control ENCF art rograms+ and se=uences the intero eration of emcmot and emcio' emctas4 contains an inter reter for the RS--30 JG codeK NC rogramming language and is com ati"le 7ith com uter-aided manufacturing EC&MF soft7are+ such as Mastercam and Gi""sC&M' The gra hical user interface emcgui ro$ides a modern oint-and-clic4 7indo7 into the EMC' Se$eral emcgui im lementations ha$e "een 7ritten+ in Ba$a+ C66?> Tool4it and Tcl?T4' These com onents communicate using the Neutral Messaging Language+ a mail"ox model in 7hich commands+ status and other data structures are de ned as C66 structures and read or 7ritten to "u ers' NML is scala"le+ allo7ing rocesses running on one machine and rocessor ty e to communicate trans arently 7ith rocesses on other machines and rocessor architec-tures as easily as they communicate nati$ely' It su orts $arious communication mechanisms+ such as o erating system shared memory+ "ac4 lane "us glo"al memory+ TCP?IP and C#P?IP net7or4ing' NML is art of the NIST Real-time Control Systems ERCSF li"rary M 0)N' RCS ro$ides latform-inde endent a lication rogramming interfaces E&PIsF to common o erat-ing system functions such as shared memory+ sema hores and timers' RCS has "een orted to a 7ide $ariety of real-time and non-realtime o erating systems including Linux+ 9x@or4s+ Sun:S and Microsoft @indo7s'
emcmot communicates 7ith emctas4 using shared memory "u ers+ one for commands from emcmot and one for status "ac4' &lthough Linux rocesses li4e emctas4 cannot inter-ru t a real-time rocess li4e emcmot+ care must "e ta4en to ensure that data read "y either rocess is consistent' <or exam le+ emctas4 may "e in the middle of 7riting the command "u er 7hen it is interru ted "y emcmot' In this case+ emcmot 7ill read a command that is artially ne7 and artially old' Li4e7ise+ emctas4 may "e in the middle of reading the status "u er 7hen it is interru ted+ reading status that is artially old and artially ne7' To re$ent this from ha ening+ or rather detect that it has and ag that it should "e ignored+ head and tail counts are used' 8ead and tail counts are each a "yte that "rac4et the data to "e rotected' The 7riter rst increments the head count+ changes the data+ and sets the tail count to match the head' The reader co ies the data out and then com ares the head and tail count' If they do not match+ the data is ignored' This has the otential of inde nitely ost oning a successful read o eration in cases 7here a match ne$er occurs' In ractice this arises only 7hen the time it ta4es to 7rite the data a roaches the cycle time of the rocesses+ saturating the communication "and7idth' @ell-designed systems should not a roach this limit+ and should al7ays handle occasional unsuccessful read attem ts+ usually "y JcoastingK on the last successful read result'

emcmot executes on the "uilt-in timer interru t+ not on external interru ts that may "e
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

0.

Introduction to Linux for Real-Time Control &

lication Case Studies

generated "y hard7are timers on the I?: "oards that interface to motors or other electronics' T7o ty es of scheduling are a$aila"le in "oth RTLinux and RT&I' @ith one-shot scheduling+ the timer chi is re rogrammed to ex ire at the next scheduling tas4 occurrence' This is useful 7hen the a tas4 eriod $aries de ending on its current acti$ity' The disad$antage is that re rogramming the timer ta4es additional time' @ith ure eriodic scheduling+ the timer chi is set u once at the "eginning 7ith a fundamental eriod+ and all real-time tas4s must execute at that eriod or integer multi les of it' The ad$antage is that re rogramming time is sa$ed' The disad$antage is the in exi"ility in tas4 eriods' In emcmot+ ure eriodic scheduling is used due to the short eriods that must "e su orted E() microseconds if ste er motors are controlledF and the small num"er of tas4s+ one or t7o+ that 7ill run'

5.1.2

Ste

er Motor Control

EMC 7or4s 7ith either ser$o motors or ste er motors' @ith ser$o motors+ the EMC sam les the current osition of the motor+ com utes 7here it should "e "ased on the desired traGectory+ and generates a dri$ing signal "ased on the error "et7een the t7o' This is 4no7n as closed-loo control and is the su"Gect of an extensi$e literature' :f rimary im ortance in these systems is sta"ility' & controller that does not sam le and com ensate often enough 7ill cause the system to oscillate' &s a rule of thum"+ the more res onsi$e the system+ the faster the controller must sam le' Small+ light and =uic4 systems re=uire faster controllers than slo7+ hea$y systems' Machines ty ically controlled "y EMC+ such as machine tools+ are relati$ely slo7 and hea$yL sam le time of a fe7 hundred microseconds are usually su cient' This is "elo7 the threshold that can "e handled "y a general ur ose o erating system+ "ut 7ell 7ithin the range handled "y real-time o erating systems'

@ith ste er motors+ the EMC must generate "oth the out ut oints for the motors and the indi$idual ulses that dri$e the motors themsel$es' These indi$idual ulses occur much more fre=uently than the sam ling time re=uired in a com ara"le closed-loo system+ on the order of tens of microseconds' It is desira"le to reduce the fundamental eriod at 7hich ste er motor ulses can "e generated as much as ossi"le+ since the smaller the "ase eriod+ the ner the control o$er motor s eed'
&ctual EMC installations on ste er motor systems ha$e run 7ith "ase eriods of () microseconds' #uring this time+ the ste er motor tas4 executes+ com uting the u or do7n le$els of airs or =uadru les of "its for each ste er motor+ de ending on the ty e of motor 7iring' The tas4 then 7rites the out uts+ accumulates the ste s and directions ta4en "y each motor as a measure of their osition+ and nishes' &lthough the theoretical s eed attaina"le is /);8D Ecorres onding to -) microsecond total for an u count and the follo7ing do7n countF+ the s eed attaina"le in ractice is a"out one fth of this due to the large di erences in adGacent allo7a"le fre=uencies at the high end' That is+ if a com lete u count?do7n count is com leted in -) microseconds that is a fre=uency of /) ;8D+ "ut if the u count?do7n count cycle ta4es . eriods instead of -+ that is a fre=uency of .. ;8D+ and 0 eriods is -/ ;8D' This =uantiDation e ect of allo7a"le fre=uencies results in large command changes that tend to excite resonances in the ste er motor' The ractical limit is ()) microsecond eriods or () ;8D+ 7here the adGacent allo7a"le fre=uencies are only a"out ()I di erent and resonances are not excited "y sudden extreme command changes' 9ersion -')')+ -))--(--((T(/.( NIST! Intelligent Systems #i$ision 00

Introduction to Linux for Real-Time Control &

lication Case Studies

<igure /'-! Ca"le Ro"ot &rchitecture 5.1.3

Ca"le Ro"ots

NIST "uilt an em"edded real-time Linux controller for a ca"le ro"ot system a lied to ainting+ cleaning+ and descaling o erations in a haDardous en$ironment M 11N' The ca"le ro"ot system+ de icted in <igure /'-+ consists of six ser$o-controlled 7inches attached to a mo$ing latform that is sus ended from xed su ort oints "y ca"les' Indi$idually+ any one ca"le dri$es the latform in a non-intuiti$e 7ay' @hen coordinated ro erly+ all six ca"les can "e commanded to e ect straight-line motion of the latform' The intent of the latform is to carry construction and maintenance e=ui ment+ such as aint s rayers or remo$ers+ throughout the large 7or4 $olume ty ical of shi s or aircraft'
&m li ers 7ith "uilt-in $elocity ser$os o7er the 7inch motors' The am li ers ro$ide a serial interface o$er 7hich $elocity commands and osition feed"ac4 are sent' The controller im lements resol$ed-rate control teleo eration+ in 7hich a Goystic4 generates the desired $elocity of the mo$ing latform in Cartesian s ace E9 x+ 9y+ 9D+ and 9ya7F+ 7ith roll and itch al7ays commanded to Dero $elocity to maintain a sta"le horiDontal orientation of the latform' This desired Cartesian $elocity $ector is transformed into ca"le s eeds through the in$erse Baco"ian function' The ca"le s eed commands to the am li ers occu y a"out .) "ytes'

In one con guration+ a single serial lin4 connects to a single am li er ser$ing a single motor' This utiliDes the RS--.- rotocol running at /2 ;" s and results in a control cycle of a"out / milliseconds' & second con guration uses the RS-0,/ rotocol at 1'2 ;" s and su orts t7o am li ers each of 7hich commands three motors' The cycle time for this con guration is a"out ()) millisecond'
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

0/

Introduction to Linux for Real-Time Control &

lication Case Studies

Note that the longer the eriod+ the longer the time inter$al o$er 7hich the relationshi s "et7een Cartesian and ca"le $elocities 7ill de$iate from their exact $alues at the start of the inter$al' This 7ill induce more drift in the roll and itch directions Eas 7ell as the othersF+ and cause the latform to go out of le$el to a greater degree' So+ although the control eriod does not a ect sta"ility E$elocity ser$o control is done in the am li ersF+ it does a ect 4inematic delity' The system 7as "ased on the PC?()0 form factor 7ith a lo7- o7er Geode Pentiumcom ati"le rocessor+ running *usy*ox Linux+ 4ernel -'0'(+ 7ith the RTLinux 9ersion .') real-time atch' Mass storage is a 12 M*yte #is4:nChi rather than rotating mass storage' The gra hics system consisted of a serial touch screen on an ,))x2))- ixel dis lay+ running the At?Em"edded 7indo7ing interface' &dditional PC?()0 I?: modules ro$ided u to eight serial connections+ and some digital and analog I?:' The system also demonstrated the use of real-time Linux dri$ers for serial I?:' These dri$ers are re=uired due to the restriction against calling standard Linux de$ice dri$ers in real-time code+ as discussed in Section 2'('-'

5.2 5.2.1 5.2.1.1

:ther Exam les of Real-Time Linux &


#ata &c=uisition
&ir"orne Scanning Radar &ltimeter

lications

The Linux-"ased data system for the &ir"orne Scanning Radar &ltimeter ESR&F roGect M (.(N 7as "egun in (11, at the N&S& Goddard S ace <light Center' The SR& uses RTLinux to dri$e the 7a$eform digitiDer+ com ute the centroid-"ased range measurement "et7een the transmit and return ulses+ manage 12 automatic gain control loo s+ correct for aircraft attitude and o -nadir angle and de osit formatted data in a shared memory "loc4 7hich is extracted "y a normal Linux a lication for recording to a dis4 le' The RTLinux code+ running on a -)) M8D Pentium machine+ rocesses -/2- oint 7a$eforms from the radar altimeter e$ery 3)) microseconds and integrates that data 7ith GPS osition information and aircraft attitude data o"tained from the inertial na$igation system' The actual control of the radar is achie$ing using custom rogrammed PIC micro rocessor chi s' Non real-time code 7rites the com uted results to dis4 or ma4es the data a$aila"le to other rocessing nodes for dis lay in real time' 5.2.1.2 GPS Recei$er

The #e artment of Electrical and Com uter Engineering at Cornell Cni$ersity has de$elo ed Cascade+ an RTLinux "ased Glo"al Positioning System M 3)N' @or4 7as started in -))) and 7as made ossi"le "y an : ce of Na$al Research Grant' It is ex ected that Cascade 7ill "e used in ionos heric monitoring stations in e=uatorial regions of the 7orld' NIST! Intelligent Systems #i$ision 02
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control &

lication Case Studies

The recei$er is "ased on the Tarlin4 Semiconductor GP-)-( (--channel GPS correlator' The monolithic #:S $ersion of the GPS architect code structure 7as redesigned and orted to RTLinux running on a 0)) M8D Pentium rocessor' The GPS architect code 7as artitioned into t7o sections+ the a lication code in 4ernel s ace and the user interface code in user s ace' The a lication code consists of $e eriodic threads to calculate the na$igation solution+ an ISR and a <I<: handler' The ISR runs e$ery ,)) microseconds and rocesses ra7 data from the GPS recei$er to maintain the signal-trac4ing loo s' The additional $e threads+ running 7ith eriods from ()) milliseconds to one second+ coo erate to com ute the na$igation solution' <I<:s are used to communicate 7ith the user-interface rocess'

5.2.1.3

Electronic Excitation S ectrosco y

@or4 at #usseldorf Cni$ersity utiliDed RTLinux for the data ac=uisition in a system for $eryhigh-resolution electronic-excitation s ectrosco y of aromatic molecules M 22N' RTLinux ro$ides the round ro"in scheduler and interru t handling mechanisms' The GCI of the data ac=uisition soft7are runs as a rocess in user s ace' Aueues and shared memory are used for communication "et7een the user and 4ernel s ace rocesses' The com lete system runs on a -.. M8D Pentium machine 7ith the real-time code executing e$ery -)) microseconds'

5.2.1.4

Solar S ectral <lux Radiometer

The Solar S ectral <lux Radiometer ESS<RF+ de$elo ed at the &tmos heric Physics *ranch of N&S&Hs &mes Research Center+ is a PC?()0-"ased system that measures solar irradiance to infer the hysical ro erties of aerosols and clouds and to determine the radiati$e e ects of clouds+ aerosols and gases on climate M ((N' The com uting hard7are is centered on a -22 M8D Pentium rocessor 7ith .- M*yte of R&M along 7ith a 0) M*yte ash le system and a PCMCI& slot for remo$a"le ash storage' The hard7are includes an interface to an IRIG-* timecode generator' RTLinux ro$ides a lo7-latency+ constant sam le-time en$ironment to o en and close the shutters on the s ectrometers at re eata"le+ con gura"le sam le times around ()) milliseconds' It also ac=uires aircraft na$igation data 7hich is time la"eled "y the common IRIG-* timecode generator' The nanosecond resolution RTLinux timers are used as a "ac4u if the IRIG-* timestam information is una$aila"le for any reason' 5.2.1.5 Telesco e Camera

Cltracam is a three-channel CC# telesco e camera designed for the o"ser$ation of ra idly changing astronomical henomena' It 7ill image a target at rates of u to /)) 8D and 7ill time stam those images to 7ithin ( millisecond of Cni$ersal Time ECTF M 3N'
The rac4-mounted control PC running RTLinux ro$ides the interface "et7een the GPS recei$er+ that ro$ides the recision time source+ the camera controller itself+ $ia a "er-o tic NIST! Intelligent Systems #i$ision 03
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control &

lication Case Studies

lin4+ and the la"oratory L&N' Cltracam is the result of a Goint e ort "y the C; &stron-omy Technology Centre in Edin"urgh+ Cni$ersity of She eld+ She eld+ C;+ and Cni$ersity of Southam ton+ Southam ton+ C;' This instrument 7as commissioned+ in Se tem"er -))-+ on the @illiam 8erschel Telesco e on La Palma' 5.2.2 5.2.2.1

Control &

lications

Machine Tool Control

i&rte is a real time soft7are en$ironment for the de$elo ment of industrial rocess control and machine control a lications using RT&I Linux M /N' It 7as de$elo ed as a graduate thesis in -))) at the Engineering #e artment of *rescia Cni$ersity' The industrial rocess control functions are realiDed using the familiar Programma"le Logic Control EPLCF structure' The machine control a lications can "e realiDed 7ith a sam le time as lo7 as ( millisecond' Exam- les of machine controls de$elo ed using i&rte are! a cutting machine for granite and mar"le sla"s+ a "all "earing correction and nishing machine+ and a "ra4e systems test "ench'

5.2.2.2

Controlling Creatures 7ith Linux

The Bim 8enson Com anyHs latest Performance Control System E8PCSF culminates (/ years and many generations of animatronic control-system de$elo ment M ()3N' RTLinux is at the heart of the current system+ de$elo ed in (11,?11+ synchroniDing $ideo-frame tra c 7ith actuator control commands sent to the multi le electro-mechanical control loo s in the u ets themsel$es' This ena"les the 8enson u eteers to orchestrate u et motion and "lend that motion 7ith gra hical $ideo imagery' The sam le time for this system is (2'23 milliseconds Eto match 2) frames er second $ideoF' The 8enson de$elo ers commissioned <smLa"s to re ne RTLinux "y im lementing a read-7ait synchroniDation mechanism to ease communication from the real-time micro 4ernel to the user-s ace tas4' 5.2.2.3 Laser Cutting Machine

Prima Industrie of Torino Italy designs+ de$elo s+ manufactures and sells laser machines for the cutting+ 7elding and surface treatment of t7o- and three-dimensional arts' :ne of their roducts is the PL&TIN: M 2-N+ a laser cutting machine 7hich uses the RT&I extensions to Linux for numerical control on a Pentium III rocessor' The cutting machine features s eeds u to -'/ m?sec+ and accelerations u to (- m?sec 5.2.2.4 Telesco e Control System

The S:uthern &stro hysical Research ES:&RF Telesco e Control System 7as rototy ed and de$elo ed 7ith the aid of La"9IE@ under RTLinux o$er the eriod (11,O(111 M 0N' Since the de$elo ers 7ere 7or4ing 7ith $ersion ( of RTLinux+ the communication "et7een user-s ace NIST! Intelligent Systems #i$ision 0,
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control &

lication Case Studies

and real-time rocesses is $ia the+ then+ RTLinux <I<: mechanism' The user-s ace code ran three control loo s+ one at () seconds+ one at ( second+ and the third at /) milliseconds' These loo s 7ere synchroniDed to the real-time acti$ation tas4 through the <I<: communication "u ers' 5.2.3 5.2.3.1

Ro"otics
8umanoid Ro"ot 83

The humanoid ro"ot 83 M 2,N is a research latform for erce tion-action cou ling in intelligent "eha$ior of humanoid ty e ro"ots' The 7or4 7as underta4en "y the #igital 8uman La" at the National Institute of &d$anced Industrial Science and Technology+ Ba an+ in -))(' The ('( G8D Pentium on-"oard com uter runs RTLinux interlea$ing hard real-time tas4s ranging from smooth lo7-le$el motion control to high-le$el $ision?sensor "ased "eha$iors' The online sta"ility control as 7ell as the 7al4ing traGectory generation are im lemented as real time tas4s in the RTLinux 4ernel module' The on-"ody stereo+ $oice in ut?out ut+ o"stacle a$oidance+ foot rint lanning+ and collision detection are im lemented as rocesses in user s ace' The ser$o-loo control runs at a ( millisecond cycle+ "alance feed"ac4 at a () millisecond cycle+ and the traGectory generation at a ( second cycle'

5.2.4 5.2.4.1

#istri"uted Real-Time Com uting


& Real-Time Linux Cluster

In -)))+ researchers at the Mississi i State Cni$ersity rototy ed an eight node+ Linux-"ased rocessing cluster M .N' The real-time com onent of this roGect 7as a customiDed $ersion of one of the earliest RTLinux micro 4ernels' :n each of the com uting nodes+ RTLinux ro-$ides "ounded-Gitter time-"ased scheduling of com uting and communication rocesses' The RTLinux rocesses also enforce the inter-node time "ase to synchroniDe the time-slice com u-tational scheme utiliDed "y the cluster'

NIST! Intelligent Systems #i$ision


9ersion -')')+ -))--(--((T(/.(

01

Cha ter 2 Real-Time Linux Im lementation Considerations


The decision to use an o en-source o erating system+ and the choice of a articular one+ in$ol$es consideration of many factors' S eci cally+ the follo7ing issues must "e considered!

Sta ex ertise and comfort 7ith Cnix and Linux Su ort for s eci c hard7are to "e used

#e$elo ment en$ironments &$aila"ility of technical su needed Total life-cycle costs The GNC Pu"lic Licence This cha ter 7ill touch on se$eral of these issues' ort and consulting if

6.1

#e$elo ment En$ironment

@hile Integrated #e$elo ment En$ironments for standard Linux+ such as the multilanguage Ecli se M .(N and B*uilder for the Ba$a 7orld M (-,N are "ecoming more common+ the usual de$elo ment en$ironment is the >(( 7indo7ing system in 7hich the user de$elo s code 7ith the GNC tool chain featuring the gcc com iler M 21N'
&s for standard Linux+ the common mode for real-time Linux code de$elo ers is to use the GNC tool chain along 7ith their fa$orite editor to create and test code' The im lementation language 7ill "e C to t 7ith the hiloso hy of the standard and real-time 4ernels' The real-time tas4s are 7ritten as loada"le 4ernel modules that can "e inserted or remo$ed from 4ernel s ace "y user-s ace commands' Thus the real-time code can "e de$elo ed and tested 7ithout re"ooting the machine hosting the de$elo ment and execution' NIST! Intelligent Systems #i$ision /)
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control Real-Time Linux Im lementation Considerations

6.1.1

Control System #esign Tools

Control-system design is a eld of study in itself' It su ces to say that the design of the controller re=uires 4no7ledge of the time and fre=uency res onse of the system to "e controlled' :nce that is 4no7n it is ossi"le to a ly design techni=ues to create the discretetime controller' This controller and system can "e simulated in a gra hical en$ironment such as Simulin4 M ,/N or La"9ie7 M (1+ 30N to $alidate the "asic o eration of the controller' Cltimately+ the controller de$elo ed in the gra hical en$ironment must "e im lemented on the target hard7are' The follo7ing material discusses tools to achie$e that goal' Cnited Electronic Industries o ers a Po7er#&A La"9IE@ for Linux M 2.N 7hich allo7s design of real-time Linux rocesses from La"9IE@ and 7or4s 7ith distri"utions of Linux ;ernel -'-'x and -'0'x' The dri$er also runs under RTLinux and RT&I realtime extensions M 20N'

Auality Real Time Systems o ers Real Time Linux Target+ a Simulin4 "ased gra hical design en$ironment for design of real-time control systems M ().N' The design latform must "e running Simulin4' The out ut from RTLT is com iled C code that is executa"le on a RTLinux system' :ne o en-source roGect+ RTiC-La" M 0-N+ is de$elo ing a gra hical en$ironment for designing real-time controllers' Those controllers can "e im lemented in the RTLinux or the RT&I a$ors of real-time Linux'
Scicos M (()N is a gra hical+ dynamic-systems modeler and simulator that is "uilt on to of the matrix com utation ac4age SciLa"' :ut ut from the o en-source Scicos?SciLa" system can "e ost rocessed "y Syn#ex to generate+ amongst other formats+ code for RTLinux M ((0N'

6.1.2 6.1.2.1

#e$elo ment Considerations


;ernel S ace Tas4s

Real-time tas4s that are created to ex licitly run in 4ernel s ace+ ty ically as a loada"le 4ernel module+ su er some restrictions on 7hat soft7are resources they may access' RTLinux and RT&I su ort this style of real-time execution' Standard Linux de$ice dri$ers may not "e called+ so access to resources such as serial orts+ Ethernet cards and other de$ices 7ith entries in the ?de$ directory cannot "e made 7ith the Cnix o enEF call' There are re lacement dri$ers s eci cally 7ritten to 7or4 7ith real-time Linux a$aila"le for most resources+ including the serial and Ethernet de$ices Gust mentioned+ as 7ell as many de$ices common to industrial automation or scienti c com uting such as C&N *us and data ac=uisition "oards'
System 4ernel resources also may not "e used directly' These include dis4 les normally accessed 7ith fo enEF+ hea memory allocation and deallocation 7ith mallocEF?freeEF and ne7?delete+ console rinting $ia rintfEF and traditional Cnix inter rocess communication mechanisms such as i es+ shared memory+ sema hores and message =ueues' 8o7e$er+ real-time Linux ro$ides su"stitutes for many of these' rintfEF is im lemented using sim le NIST! Intelligent Systems #i$ision /(
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control Real-Time Linux Im lementation Considerations

re lacements li4e rtlU rintfEF ERTLinuxF or rtU rint4EF ERT&IF that direct out ut to sys-tem log les such as ?$ar?log?messages' Shared memory and rst-in- rst-out E<I<:F =ueues are su orted through similar re lacements+ and allo7 real-time rocesses to communicate directly 7ith non-real-time Linux rocesses' :ther IPC features+ such as sema hores and message =ueues+ are su orted for synchroniDation and communication "et7een realtime tas4s+ "ut not "et7een real-time tas4s and non-real-time tas4s' More ro"lematic are the lac4 of le access and hea memory o erations' &ccess to les 4no7n a riori can "e accom lished "y Linux-le$el initialiDation rograms that read the les and 7rite them into shared memory "u ers' &ccess to any les "y name can "e accom lished similarly+ 7ith the addition of a rotocol "y 7hich real-time rocesses can s ecify 7hich les are to "e loaded into or cleared from shared memory' 8ea memory counter arts are a$aila"le in real-time Linux+ called memory ools+ 7hich re=uire a setaside of a xed-siDe ool of memory at the "eginning of the real-time a lication' & design o$er$ie7 of the ro"lems associated 7ith mallocEF is gi$en in M 03N' 6.1.2.2 Cser S ace Tas4s

&n alternati$e to ex licitly running the real-time tas4 as a 4ernel module is to run the real-time tas4 as a user-s ace rocess' These rocesses can "e de"ugged using standard de"ugging tools+ such as gd" and can access a far greater range of system resources than the 4ernel-s ace real-time tas4s' Im lementations that su ort user-s ace real time include Process S ace #e$elo ment #o-main EPS##F from fsmla"s M /2N+ Ne7 Linu> Real Time ENE@L>RTF from RT&I M -1N+ and TimeSys Linux M -.N' 6.1.3

#e"ugging Real-Time Tas4s

The GNC #e"ugger+ gd"+ is the tool of choice to de"ug real-time tas4s running in user s ace+ as is the case in the reem ta"le 4ernel modi cations' There is at least one gra hical front end to gd" that ro$ides the comfort of an integrated design en$ironment M -2N' Gd" can also "e used to de"ug real-time tas4s running in 4ernel s ace+ as e$idenced in RTLinux+ and RT&I' Gd" does re=uire de"ugging su ort from 7ithin the real-time tas4+ and that su ort is art of the RTLinux distri"ution' Gd" "eha$es as if it is de"ugging a rocess on another machine+ e$en though the real-time tas4 is running on the same hard7are'

There is a tracing tool4it M (.,N that can "e con gured to trace actions 7ithin RT&I tas4s' This is not de"ugging in the sense of setting "rea4 oints and examining data+ "ut it does ro$ide a gra hical interface into the execution ath ta4en through a RT&I tas4' This Linux Trace Tool4it+ LTT+ has "een chosen as the referred tool for tracing 7ithin the standard Linux 4ernel'
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

/-

Introduction to Linux for Real-Time Control Real-Time Linux Im lementation Considerations

6.2 6.2.1

Im lementation Considerations
Su orting 8ard7are Interfaces for Machine Control

Se$eral choices of hard7are interface cards E lug com ati"le 7ith the PCI or IS& "usesF are a$aila"le to facilitate the im lementation of a real-time Linux system on a commodity I&.- architecture PC' Such cards include+ for exam le+ analog-digital con$erters+ digital-analog con-$erters+ shaft-encoder =uadrature counters+ and ulse-7idth modulation am li ers' Se$eral of these card manufacturers ex licitly su ort Linux and real-time Linux "y ro$iding dri$ers for their roducts M ()3N' Nonetheless+ the nature of real-time control is such that the im lementor of the control system may 7ell need to de$elo the lo7est-le$el dri$ers to access the interface at the register le$el' The Control and Measurement #e$ice Interface+ Comedi M ((2N+ is an o en source roGect to unify the user and 4ernel s ace interfaces to data ac=uisition hard7are' It is a collection of dri$ers+ each im lemented as a core Linux 4ernel module+ and li"raries E"oth user s ace and real timeF that ro$ide a common user interface to the Comedi de$ice dri$ers M (),N' It su orts "oth RT&I and RTLinux extensions' 6.2.2

Total Cost of Systems #e$elo ed 7ith Real-Time Linux

Se$eral factors a ect the total cost of o7nershi ' The cost of ac=uiring the real-time o erating-system soft7are 7ill need to "e ta4en into consideration' &c=uisition costs include de$elo ment licenses and royalty ayments or recurring costs er de loyed system' & maGor consideration should "e the a$aila"ility and cost of the technical engineering and a lication le$el assistance ro$ided 7ith the o erating system' Issues of sta training+ a lication soft7are design+ im lementation+ test and de"ug are signi cant' Cltimately+ the de loyed a lication must "e maintaina"le 7hen defects surface and extensi"le 7hen the re=uirements change and enhancements are made necessary under tight schedules' M /3N'

6.2.3

Su

ort Considerations

Sta training is a maGor cost and time com onent in de$elo ing ex ertise in ne7 technolo-gies' & num"er of commercial training courses are a$aila"le that focus on RealTime Linux design 7ith an em hasis on RT&I M 33N and also RTLinux M (-N' &lso a$aila"le is an o en-source hands-on course 7ith real-time Linux M ()N' 6.2.4

Net7or4ing and <ile System &ccess

Commercial real-time o erating system com anies o er net7or4ing and le system access as additional-cost ac4ages on to of the "asic real-time functionality' <or real-time Linux+ TCP?IP+ IP>+ No$ell+ & letal4+ and SM* Protocol stac4s are freely a$aila"le for the standard NIST! Intelligent Systems #i$ision /.
9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control Real-Time Linux Im lementation Considerations

Linux 4ernel+ and are therefore accessi"le to the real-time a lication de$elo er' & similar situation exists for le systems' Since Linux Gournaling and non-Gournaling le systems+ & le+ Microsoft+ and R&M-"ased le systems are also freely a$aila"le for the standard Linux 4ernel+ these too are a$aila"le for use "y the real-time a lication de$elo er' 6.2.5

@or4ing 7ith the GPL

The GNC Pu"lic License 7as outlined in Section 0'(' GPL ro$ides that any soft7are deri$ed from a 7or4 co$ered "y the GPL must "e distri"uted under the GPL' The o erati$e 7ord is Jderi$edK' So any soft7are that is created from scratch 7ithout using any GPL code can "e distri"uted under the ro$isions of any license' Such distri"ution may "e accom anied "y GPL codeM /1N' Many com anies are adding $alue and code to the GPL code "ase 7hile creating their o7n ro rietary code from scratch and distri"uting that code as "inary li"raries along 7ith source distri"ution of GPL code' Exam les of com anies that ursue this "usiness model include <SMLa"s Inc+ TimeSys Cor + M-Systems Inc+ and Monta9ista Soft7are Inc'

6.2.6

Conclusions

There are se$eral areas in 7hich real-time Linux comes u short in functionality and su ort 7hen com ared 7ith standard Linux and 7ith commercial RT:S o erings' The otential user must "e a7are that they not only ha$e to com ile the 4ernel 7ith atches from another source+ "ut also ha$e to gra le directly 7ith lo7 le$el issues in interfacing to hard7are and managing memory' :n the other hand+ training and consulting ser$ices for real-time Linux are no7 a$aila"le commercially+ and the suite of de$elo ment and su ort tools is considered su"stantial and continuously gro7ing' The =uestion ultimately is 7hether ha$ing a free+ o en-source o erating system for a real-time a lication is 7orth the extra e ort to im lement that a lication' The enthusiasm of real-time Linux con$erts is one form of e$idence that many nd this an agreea"le trade-o '

NIST! Intelligent Systems #i$ision


9ersion -')')+ -))--(--((T(/.(

/0

Cha ter 3 Sources of Real-Time Linux


#istri"utions of real-time Linux are listed and discussed in this Cha ter' They are se arated into t7o sections+ o en source and commercial+ and al ha"etically organiDed 7ithin these sections' The characteristics and functionality of each distri"ution is descri"ed using a ta"ular format' E$ery e ort has "een made to ensure the accuracy of this information at the time of 7riting' 8o7e$er+ as ects 7ill change o$er time' Inaccuracies should "e re orted as er Page - of this document' : en-source distri"utions ro$ide the source code and "uild scri ts so the user can under-stand+ modify+ and "uild the code if desired' There are no royalty fees for use of the code' Since o en-source roGects are de$elo ed "y a loose 4nit community of de$elo ers 7hose focus is generally on code de$elo ment+ documentation may "e s arse and technical su ort non-existent' :n the other hand+ these systems ha$e "een the "asis of many successful a lications+ as discussed a"o$e+ and the a"ility to 7or4 7ith source code o ers su"stantial ad$antages for so histicated users' Intellectual ro erty issues discussed in Sections 0'( and 2'-'/ should "e considered' Commercial distri"utions are "y com anies that must ma4e a ro t to stay in "usiness' Some of these com anies are s in-o s of uni$ersities that ro$ide free o en-source distri"ution and then charge for a lication consulting+ technical su ort and maintenance+ along the lines of the Red 8at "usiness model' :thers sell enhanced $ersions of the soft7are along 7ith su ort and documentation'

7.1

: en-Source #istri"utions of Real-Time Modi ca-tions to Linux


Entries are ordered al ha"etically "y the name of the distri"uting organiDation'
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

//

Introduction to Linux for Real-Time Control Sources of Real-Time Linux

7.1.1

&#E:S

&#E:S ro$ides a hard7are a"straction layer allo7ing a real-time 4ernel and a general ur ose 4ernel to co-exist' The role of this layer is to channel hard7are interru ts to the o erating system 4ernels at the next higher layer in the architecture' These o erating systems could "e real-time or non-real time' The &#E:S system does not im lement a real-time o erating system+ "ut ro$ides the mechanism "y 7hich interru ts can "e assed to a realtime o erating system at the highest ossi"le riority' The same interru ts may "e assed on to a non-real time o erating systems once the real-time tas4 has "een com leted'

The current distri"ution im lements &#E:S as a layer "et7een the hard7are on an I&.- PC system and the $ersion -'0'(, standard Linux 4ernel' The RT&I de$elo ers are 7or4ing to7ards re lacing their micro-4ernel architecture 7ith the &#E:S a roach' This in$ol$es designing and im lementing a RT:S that 7ill sit on to of the &#E:S nano 4ernel' Ite m (' -' .' 0' /' 2' 3' ,' 1' ()' ((' (-' (.' (0' Criteria Product Name Standard ;ernel Real-Time ;ernel 9ersion Su orted 8?@ & lications Qears in Cse Multi rocessor Su ort Real-Time Mechanism Inter-;ernel Communication P:SI> Com liance #e$elo ment En$ironment Performance E$aluation #istri"utor @e"site Product Su ort Comments &#E:S -'0'(, &#E:S mI&.-))-O Qes nano-4ernel Not needed' No real-time P:SI> com liance' Gnu Tool Chain #o7nload &#E:S M ())N' @e" site <&As+ user grou s+ 8:@T:s'

Ta"le 3'(! &#E:S Real-Time Linux

7.1.2

;CRT

;CRT M (-3N is ;ansas Cni$ersityHs Real-Time Linux roGect in the Information and Telecom-munications Technology Center' ;CRT 7as started in (113 M (-2N to im lement the P:SI> real-time extensions to Linux' The de$elo ment has continued and the latest release is a atch to standard Linux $ersion -'0'(,'
&s 7as discussed in Section 0'-'-'-+ ;CRT uses a single 4ernel 7hich is the standard 4ernel modi ed 7ith atches to im lement real-time functionality' The atches im lement the =ueued realtime signals and the high-resolution timers 7hich are s eci ed in the IEEE ()).'(d' NIST! Intelligent Systems #i$ision /2

9ersion -')')+ -))--(--((T(/.(

Introduction to Linux for Real-Time Control Sources of Real-Time Linux

#es ite the im lementation of some of the IEEE ()).'(d s eci cation+ ;CRT does not claim com liance 7ith the ()).'(d standard' Ite m (' -' .' 0' /' 2' 3' ,' 1' ()' ((' (-' (.' (0' Criteria Product Name Standard ;ernel Real-Time ;ernel 9ersion Su orted 8?@ & lications Qears in Cse Multi rocessor Su ort Real-Time Mechanism Inter-;ernel Communication P:SI> Com liance #e$elo ment En$ironment Performance E$aluation #istri"utor @e"site Product Su ort Comments ;CRT Linux! -'0'(, ;CRT $-'. *eta i.,2 Eany I&.- 7ith TSCF &TM net7or4 simulations M 00N' (113O No P:SI> timers and scheduling' :nly one 4ernel' No Gnu tool chain' ()s of microseconds of latency and Gitter ;ansas Cni$ersity M (-3N @e" site <&As+ user grou s'

Ta"le 3'-! ;CRT Real-Time Linux

7.1.3

RT&I

RT&I+ or Linux-RT M -1N is an o en-source roGect initiated "y sta at #i artimento di Ingegneria &eros aDiale - Politecnico di Milano+ Italy' It 7as originally "ased on RTLinux "ut e$ol$ed as a uni=ue a$or of real-time Linux' The list of a lications on their 7e" site M -,N demonstrates the follo7ing that RT&I has in Euro e' Ite m (' -' .' 0' Criteria Product Name Standard ;ernel Real-Time ;ernel 9ersion Su orted 8?@ Comments Real Time & lication Interface -'0'x u to -'0'(1 -0'('() x,2 E7ith and 7ithout <PC and TSCF+ Po7erPC+ &RM EStrong&RML &RM3! cl s3((x-family+ Cirrus Logic EP3xxx+ CS,13(-F+ MIPS Laser Cutting MachineM 2-N and Industrial control de$elo ment en$ironmentM /N -)))O Qes micro 4ernel <I<:s+ Shared Memory

/' 2' 3' ,' 1'

&

lications

Qears in Cse Multi rocessor Su ort Real-Time Mechanism Inter-;ernel

()'

Communication P:SI> Com liance

No
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

/3

Introduction to Linux for Real-Time Control Sources of Real-Time Linux

Ite m ((' (-' (.' (0'

Criteria #e$elo ment En$ironment Performance E$aluation #istri"utor @e"site Product Su ort

Comments Gnu tool chain R () microseconds latency and Gitter #i artimento di Ingegneria &eros aDiale - Politecnico di Milano M -1N @e" Site <&As+ user grou s

Ta"le 3'.! RT&I! Real-Time Linux

7.1.4

RTLinux

@or4+ led "y 9ictor Qodai4en+ at the Ne7 Mexico Institute of Technology roduced the rst real-time Linux M 01N in (112' No7 fsmla"s'com M /0N is ro$iding access to the o ensource roGect and o ering maintenance and de$elo ment consulting ser$ices' Qodai4en 7as granted a atent in (111 that co$ers the logic of running standard Linux as a "ac4ground thread to the real-time tas4s M (.1N' The license conditions in the RTLinux source code ro$ide for royalty-free use of the atented rocess 7hen it is used 7ith soft7are licensed under the <ree Soft7are <oundation GPL+ or 7hen it is used 7ith soft7are executing 7ithin an : en RTLinux Execution En$ironment' The article J: en Source Real-Time : erating SystemsK M ()2N ro$ides some insights into the design tradeo and considerations in de$elo ing a lications 7ith RTLinux' Ite m (' -' .' 0' /' 2' 3' ,' 1' ()' ((' (-' (.' (0' Criteria Product Name Standard ;ernel Real-Time ;ernel 9ersion Su orted 8?@ & lications Comments RTLinux -'-'(1 % -'0'0' 9.'( I&.- 0,2 and u + Po7erPC+ MIPS+ &M# Elan NetSC/-)+ &l ha Machine Tool Control M ((-N Ca"le Ro"ot Control M 11N &nimatronics Control M ()3N (113O I&.- SMP micro 4ernel <I<:s+ Shared Memory ())('(. PSE/( Gnu tool chain R () microseconds latency and Gitter <SMLa"s Inc' M 01N @e" Site <&As+ fsmla"s'com M /0N+ user grou s

Qears in Cse Multi rocessor Su ort Real-Time Mechanism Inter-;ernel Communication P:SI> Com liance #e$elo ment En$ironment Performance E$aluation #istri"utor @e"site Product Su ort

Ta"le 3'0! RTLinux! Real-Time Linux


NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

/,

Introduction to Linux for Real-Time Control Sources of Real-Time Linux

7.1.5

TimeSys Linux GPL

TimeSys has released their standard-Linux reem tion atches as TimeSys Linux GPL' This code is the heart of their commercial o ering+ see Section 0'-'-'-+ and ro$ides a reem ta"le 4ernel and an im ro$ed tas4 scheduler' The ro rietary com onents that add timers+ eriodic tas4s+ CPC and net7or4 reser$ation mechanisms are licensed for single-user de$elo ment of real-time code' Ite m (' -' .' 0' /' 2' 3' ,' 1' ()' ((' (-' (.' (0' Criteria Product Name Standard ;ernel Real-Time ;ernel 9ersion Su orted 8?@ Comments TimeSys Linux GPL -'0'3 .-( &RM+ MIPS+ Pentium+ Po7erPC+ SP&RC+ Su er 8+ >Scale (11,O Qes Preem ta"le ;ernel Trans arent to real-time a lication Real-time extensions+ IEEE ()).'(d-(111 GCI I#E R ()) microseconds of latency and Gitter TimeSys Cor oration' M -.N @e" Site <&As+ user grou s+ Su"scri tion 7ith TimeSys Cor '

& lications Qears in Cse Multi rocessor Su ort Real-Time Mechanism Inter-;ernel Communication P:SI> Com liance #e$elo ment En$ironment Performance E$aluation #istri"utor @e"site Product Su ort

Ta"le 3'/! TimeSys Linux GPL! Real-Time Linux

7.2

Commercial #istri"utions of Real-Time Modi ca-tions to Linux

The follo7ing descri tions of commercial distri"utions of real-time modi cations to Linux are resented "y com any name in al ha"etical order' 7.2.1

Concurrent Com uter Cor oration

Concurrent Com uter Cor orations o ers ac4aged hard7are?soft7are solutions of 7hich real-time Linux is one' The standard Linux 4ernel is re laced 7ith their licensed Red8a74 Linux M (3N 4ernel that is IEEE ()).'(d com liant' They are targeting the real time M (2N dataac=uisition+ $ideo-on-demand+ and simulation mar4ets' They ha$e a licensing agreement M (/N

to resell Monta9istaHs 8ard8at Linux as their o7n Red8a74 4ernel' NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

/1

Introduction to Linux for Real-Time Control Sources of Real-Time Linux

Ite m (' -' .' 0'

Criteria Product Name Su orted 8?@ Real-Time Mechanism #e$elo ment En$ironment

/'

#istri"utor @e"site

Comments Red8a74 Linux Concurrent i8a74 ,2) Intel-"ased multi rocessors ;ernel reem tion enhancements GCI de$elo ment tools+ Source-le$el #e"ugger+ E$ent &nalyDer+ GCI interface to the Red8a74 Linux fre=uency-"ased scheduler+ #ata Monitor tools M (3N' Concurrent Com uter Cor oration M (3N M (,N'

Ta"le 3'2! Red8a74 Linux! Real-Time Linux

7.2.2

<SM La"s Inc'

<inite State Machine La"s E<SMLa"sF 7as founded "y 9ictor Qodai4en and Cort #ougan in (11/ as 9BQ &ssociates' Cort 7as the rime author of Po7erPC Linux 7hich he orted and o timiDed for his masters thesis' They 7ere Goined "y Michael *ara"ano$+ 7ho had im lemented RTLinux for his MasterHs 7or4' Cort and Michael "oth 7ere graduate students at Ne7 Mexico Tech 7hen 9ictor Qodai4en 7as a rofessor there' RTLinux $ersion .') o ers de$elo ers the o tion of using either Linux or net*S# as their general ur ose :S+ using the identical P:SI> threads &PI M //N' Ite m (' -' .' 0' /' Criteria Product Name Su orted 8?@ Real-Time Mechanism #e$elo ment En$ironment #istri"utor @e"site Comments <SMLa"s RTLinux M /(N x,2+ Po7erPC+ &l ha Micro 4ernel GNC tool chain using IEEE ()).'(. real-time ser$ices M /-N' <SM La"s Inc M /0N' <ree #o7nload M /.N' Product Su ort % Pre ac4aged or Custom designed su ort ac4ages M /)N'

Ta"le 3'3! <SMLa"s RTLinux! Real-Time Linux

7.2.3

Monta9ista Soft7are Inc'

Monta9ista Soft7are Inc' M 2)N M /,N 7as founded in (111 "y Bames <' Ready+ the cofounder of the 7orldHs rst ro rietary RT:S com any E8unter % ReadyL 9RT>F' The Monta9ista Linux o erating system is an o erating system tailored to the needs of

em"edded soft7are de$elo ers' Bim ReadyHs goal 7ith Monta9ista is Jto ta4e Linux 7here 9RT> 7ent+ generating income from su ort and su"scri tions+ not from royaltiesK M ()0N'
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

2)

Introduction to Linux for Real-Time Control Sources of Real-Time Linux

Ite m (' -' .' 0' /'

Criteria Product Name Su orted 8?@

Real-Time Mechanism #e$elo ment En$ironment #istri"utor @e"site

Comments Monta9ista Linux M 2(N' x,2?I&-.-+ Po7erPC+ Strong&RM+ >Scale+ MIPS+ S8+ &RM ;ernel re-em tion enhancements GCI I#E for Gnu Tool Chain Monta9ista Soft7are Inc' M 2)N'

Ta"le 3',! Monta 9ista Linux! Real-Time Linux

7.2.4

ARTS

Auality Real Time Systems de$elo s a lications for real-time control and simulation' Their soft7are can use the system calls of either RTLinux or AN>' Ite m (' -' .' 0' /' Criteria Product Name Su orted 8?@ Real-Time Mechanism #e$elo ment En$ironment #istri"utor @e"site Comments Custom & lications I&.RTLinux micro 4ernel GNC tool chain Auality Real Time M ()-N

Ta"le 3'1! ARTS! Real-Time Linux

7.2.5

RE#Sonic Inc'

RE#ICE-Linux M ()/N o ers a re$ised reem ta"le 4ernel "y im lementing selected and limited reem tion oints 7ithin the 4ernel' RE#Sonic integrates the dual 4ernel a roach and the reem ta"le 4ernel to ro$ide a hy"rid solution' Ite m (' -' Criteria Product Name Su orted 8?@ Comments RE#ICE-Linux M ()/N Intel Pentium II+ -..M8D and higher+ x,2 and Po7erPC architectures+ Strong&RM+ &RM+ and MIPS architectures' Micro 4ernel and ;ernel Preem tion' RE#ICE-Linux S#;

.' 0'

Real-Time Mechanism #e$elo ment En$ironment

/'

#istri"utor @e"site

RE#ICE-Linux M ()/N

Ta"le 3'()! RE#ICE Linux! Real-Time Linux


NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

2(

Introduction to Linux for Real-Time Control Sources of Real-Time Linux

7.2.6

Synergy Microsystems Inc'

Synergy Microsystems M ,1N rimarily manufactures single "oard com uters 7ith "oth general- ur ose CPCs and #SP chi sets' They su ort RTLinux as the o erating system on their Po7erPC single-"oard com uters' Ite m (' -' .' 0' /' Criteria Product Name Su orted 8?@ Real-Time Mechanism #e$elo ment En$ironment #istri"utor @e"site Comments Linux SMP Po7erPC RTLinux micro 4ernel GNC Tool Chain Synergy Micro Systems M 1)N

Ta"le 3'((! Synergy Micro RTLinux! Real-Time Linux

7.2.7

TimeSys Cor oration


roduct o ering 7as erformed at

The original de$elo ment of the current TimeSys Carnegie Mellon Cni$ersity M (-/N'

The roduct "uilds on an o en-source reem ta"le 4ernel com onent and adds three ro ri-etary com onents' These com onents connect to the 4ernel $ia call"ac4 hoo4s and augment the normal o erating system 7ith high-resolution timers and riority inheritance+ 7ith guaranteed access to CPC resources+ and 7ith guaranteed access to net7or4 resources'

Ite m (' -' .' 0' /'

Criteria Product Name Su orted 8?@

Real-Time Mechanism #e$elo ment En$ironment #istri"utor @e"site

Comments TimeSys Linux?RealTime+ TimeSys Linux?Net+ TimeSys Linux?CPC PPC+ x,2+ MIPS+ >scale+ &RM+ Strong&RM+ CltraSP&RC+ Su er 8' Preem ta"le ;ernel' Tools M --N and S#;Hs M -(N' TimeSys Cor oration M -)N' #o7nloads M -.N'

Ta"le 3'(-! TimeSys Linux?RealTime! Real-Time Linux

NIST! Intelligent Systems #i$ision


9ersion -')')+ -))--(--((T(/.(

2-

&

endix &

Currently-&$aila"le Real-Time :?S


& fe7 real time o erating systems 7ere discussed as exam les of commercial roduct o er-ings in Cha ter .' This a endix ro$ides ointers to additional RT:S roducts' The list of real-time o erating systems gi$en in Ta"le &'( is resented in al ha"etical order'
: erating system name &rx RT:S &$SQS CM> RT:S Chorus ER:S 8armony Integrity iRM> Lynx:S Maruti Nucleus :S-1 :nCore :S :n Time RT:S-.:SE RT:S P#:S S:System . AN> Neutrino RT:S Precise?MA> RT:S Real Time Mach RE&L?I> P> RTM> :?S SM> RT:S S ring ProGect SCM: Thread> TS>-.9RT> 9x@or4s @indo7s CE 'NET Manufacturer Seoul National Cni$ersity &$ocet Systems CM> Systems Baluna S'&' C Penn National Research Council Green 8ills Soft7are Ten&sys Lynux7or4s Cni$ersity of Maryland Mentor Gra hics Micro7are :nCore Systems Cor oration :n Time ENE& EQRING cor oration @ind Ri$er AN> Soft7are Systems Ltd &RC International CMC Modcom RTM> Incor orated Micro #igital Inc' CMass+ &mherst Lancaster Cni$ersity Green 8ills Soft7are S % 8 Com uter Systems Mentor Gra hics @ind Ri$er Microsoft

Ta"le &'(! Real Time : erating Systems

NIST! Intelligent Systems #i$ision


9ersion -')')+ -))--(--((T(/.(

2.

&

endix *

Sources of <urther Information


This Cha ter resents a selection of lin4s Einto the *i"liogra hyF that ro$ide more detailed information on the to ic of real-time Linux' These lin4s are listed in order of $alue and utility in the creation of this re ort'

*'( Real-Time Linux #istri"utions


The authoritati$e source for the standard Linux 4ernel code M (-0N' #o7nload site for RTLinux M /.N #o7nload site for RT&I M -1N #o7nload site for TimeSys Linux M -.N #o7nload site for ;CRT M (-3N

*'- Real-Time Linux Su

ort :rganiDations

The Real Time Linux <oundation organiDes an annual 7or4sho on real-time Linux M 32N and maintains a list of roGects that utiliDe real-time Linux M (.0N' Linux#e$ices'com co$ers "oth em"edded and real-time Linux issues M 31N' The site resents roduct announcements and re$ie7s along 7ith tutorial material'
LinuxLin4s'com M ,)Nmaintains a list of 7e" lin4s to em"edded Linux distri"utions' Em"eddedLinux'com home age lists a $ariety of sources of em"edded Linux M .-N'

&n &ustrian RTLinux site maintains a collection of lin4s to RTLinux documentation M ,2N and a age of o en-source RTLinux roGects and a lications M ,3N'
NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

20

Introduction to Linux for Real-Time Control &

endix *! Sources of <urther Information

*'. Pu"lications on Real-Time Linux


Linux Bournal is a rint media and 7e" monthly u"lication that includes articles on real-time Linux M 23N' #edicated Systems Encyclo edia u"lishes a "uyers guide for real-time o erating systems including real-time Linux M .0N' #SP Consulting u"lished a com arati$e sur$ey including ricing information from (111 M (.N'

*'0 <re=uently &s4ed Auestions! <&As


<&As from <SMLa"s ro$ide an o$er$ie7 of RTLinux M 0,N' RT&I does not ha$e an <&A age as such+ "ut this lin4 is the closest to an <&A age M -3N' <&As on real-time systems in general M ,N'

*'/ Real-Time Linux Tutorials


This tutorial ta4es the reader through the exam le using RTLinux M ((.N' rocess of de$elo ing a small code

& signi cant+ detailed descri tion of the architecture and design rocess for a realtime Linux system M 3/N' The exam les are "ased on RT&I' & hands-on+ self study course on real-time Linux is found at M ()N' The exam les are "ased on RT&I'

*'2 Real-Time Linux Com arison Studies


The N&S& Glenn Research Center has u"lished an e$aluation of Real-Time Linux M 1N'

NIST! Intelligent Systems #i$ision


9ersion -')')+ -))--(--((T(/.(

2/

*i"liogra hy
[1] IEEE Std ()).'("-(11. IEEE Standard for Information Technology' Porta"le o erating
system interface EP:SI>F art (! System a lication rogramming interface+ amendment (! Realtime extensions' Technical re ort+ IEEE+ Ne7 Qor4+ (110'

[2] Bames S &l"us and R Lumia' The enhanced machine controller EemcF! &n o en architecture
controller for machine tools' Bournal of Manufacturing Re$ie7+ 3E.F!-3,O-,)+ Se tem"er (110'

[3] ManoG & te+ Srigurunath Cha4ra$arthi+ Bothi Padmana"han+ and &nthony S4Gellum' & synchroniDed real-time Linux "ased myrinet cluster for deterministic high erformance com uting and m i?rt' Technical re ort+ Mississi i State Cni$ersity+ -))(' htt !??777'm isofttech'com?com any? u"lications? les?@P#RTS -))( <inal' df'

[4] Michael C' &she and German Schumacher' S:&R control systems o eration! :CS and TCS'
In Proceedings of SPIE+ *oston+ M&+ &ugust -3O-, -))-' SPIE' htt !??777'soartelesco e'org?#ocuments?#ocuments?0))1-)/ S:&R Controls Pa er' df'

[5] RT &utomation' iarte! Industrial automation real time en$ironment+ -)))'


htt !??777'rtautomation'it?inglese?main'html'

[6] Michael *ara"ano$ and 9ictor Qodai4en' Introducing real-time Linux' Linux Bournal+ .0!(O(+
<e"ruary (113' htt !??noframes'linuxGournal'com?lGissues?)-.-'html'

[7] Ste$en *eard+ &ndre7 9ic4+ #a$id &t4inson+ 9i4 #hillon+ Tom Marsh+ Ste7art McLay+ Mar4
Ste$enson+ and Chris Tierney' The Cltracam camera control and data ac=uisition system' In Proceedings of SPIE+ *oston+ M&+ &ugust -3O-, -))-' SPIE' htt !??777'shef'ac'u4? hys? eo le?$dhillon?ultracam?s ie a er?s ie a er'html'

[8] * 9an *eneden' Realtime com uting <&A+ -))-'


htt !??777'fa=s'org?fa=s?realtime-com uting?fa='

[9] ;alynnda *erens' Real-time Linux e$aluation' Technical re ort+ Glenn Research Center+
N&S&+ -))-' htt !??777'i$$'nasa'go$?"usiness?research?osmasas?conclusion-))-?;alynnda Real-time Linux E$aluation' t' Linux @or4sho + Milan+ Italy+ -))(' htt !?? eo le'mech'4uleu$en'ac'"e? "ruyninc?rtho7to' NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

*erens

[10] 8erman *ruyninc4x' &n o en source hands-on course 7ith real-time Linux' In Real Time
22

*I*LI:GR&P8Q

*I*LI:GR&P8Q

[11] Sam Clanton' Em"edded real-time Linux for instrument control and data logging+
-))(' htt !??777'linuxGournal'com?article' h VsidW/223'

[12] ; Com uting' Em"edded and real-time Linux de$elo ment+


-))-' htt !??777'4com uting'com?datasheet rtlinux'html'

[13] #SP Consulting' Em"edded real-time o erating system ERT:SF $endors+


(111' htt !??777'ds consulting'com?rtos'html'

[14] Enhanced Machine Control' EMC Sourceforge 8ome Page+


-))-' htt !??sourceforge'net? roGects?emc'

[15] Concurrent Com uter Cor oration' Monta 9ista Licensing agreement+
-))(' htt !??777'linuxde$ices'com?ne7s?NS-/.0)2/3(0'html'

[16] Concurrent Com uter Cor oration' &"out Real-Time+ -))-'


htt !??777'ccur'com?realtime?rt a"out'htm'

[17] Concurrent Com uter Cor oration' Red8a74 Linux+ -))-'


htt !??777'ccur'com?realtime?sys rdh74lnx'html'

[18] Concurrent Com uter Cor oration' Ser$ice and Su


-))-' htt !??777'ccur'com?realtime?rt ser$ice su ort'htm'

ort+

[19] National Instruments Cor oration' @hat is La"9IE@V+ -))-'


htt !??am 'ni'com?ni7c?la"$ie7?7hat'Gs VnodeW(.,('

[20] TimeSys Cor oration' 8ome Page+


-))-' htt !??777'timesys'com'

[21] TimeSys Cor oration' Linux Resource ;ernel S#;+ -))-'


htt !??777'timesys'com?index'cfmVhdrWsd4 header'cfm%"dyWsd4 "dy'cfm'

[22] TimeSys Cor oration' Linux Resource ;ernel Tools+ -))-'


htt !??777'timesys'com?index'cfmVhdrWtools header'cfm%"dyWtools "dy'cfm'

[23] TimeSys Cor oration' TimeSys Linux do7nloads+ -))-'


htt !??timesys'com?index'cfmVhdrWlinux header'cfm%"dyWlinux "dy do7nloads'cfm'

[24] Charles Curley' : en source soft7are for real-time solutions' Linux Bournal+ 22!(O(+ :cto"er
(111' htt !??noframes'linuxGournal'com?lG-issues?issue22?./32'html'

[25] ;e$in #an47ardt' @hat is real timeV and "enchmar4s on real time Linux - Part (+-+.+
<e"ruary -))-' htt !??777'linuxde$ices'com?articles?&T/113))32)-'html'

[26] GNC ###' #dd data dis lay de"ugger $ .'.+


-))-' htt !??777'gnu'org?soft7are?ddd'

[27] #i artimento di Ingegneria &eros aDiale Politecnico di Milano' &"out RT&I+ -))-'
htt !??777'aero' olimi'it? rtai?a"out?index'html' NIST! Intelligent Systems #i$ision 23

9ersion -')')+ -))--(--((T(/.(

*I*LI:GR&P8Q

*I*LI:GR&P8Q
lications+ -))-'

[28] #i artimento di Ingegneria &eros aDiale Politecnico di Milano' RT&I &


htt !??777'aero' olimi'it? rtai?a lications?index'html'

[29] #i artimento di Ingegneria &eros aDiale Politecnico di Milano' RT&I 8ome Page+
-))-' htt !??777'aero' olimi'it? rtai?ne7s?index'html'

[30] Marc Le #ouarain' Classic Ladder+ -))-'


htt !??mem"res'lycos'fr?ma$ati?classicladder'

[31] ecli se'org'

Ecli se! a uni$ersal -))(O-))-' htt !??777'ecli se'org' -))-' htt !??777'em"eddedlinux'com'

tool

latform+

[32] Em"eddedLinux'com' Em"edded Linux

roGects and sources+

[33] #edicated Systems Encyclo aedia' <ree do7nloada"le re orts+ -))-'


htt !??777'dedicated-systems'com?encyc?"uyersguide?rtos?e$aluations'

[34] #edicated Systems Encyclo aedia' The RT:S "uyerHs guide+ -))-'
htt !??777'dedicated-systems'com?encyc?"uyersguide?rtos?#ir--,'html'

[35] Berry E

lin' Inside Real-Time Linux' #r' #o""Hs Bournal of Soft7are Tools+ -/E.F!3-O3,+ March -)))' htt !??777'ddG'com?ft ?-)))?-))) ).?rtlinux'txt' ment+ Electronics La"oratory+ (113' htt !??777' sica'unl 'edu'ar?rt'

[36] <ISIC&' Testing Real-Time Linux' Technical re ort+ Cni$ersity of La Plata+ Physics #e art-

[37] <ree Soft7are <oundation' @hat Is Co yleft+


-))-' htt !??777'gnu'org?co yleft?co yleft'html'

[38] *ill :' Gallmeister' P:SI>'0 O Programming for the Real @orld' :HReilly % &ssociates+ (11/'
P:SI>'0 7as the original nomenclature for the current P:SI>'("'

[39] Nigel Gam"le' The Linux 4ernel reem tion roGect+ -))('
htt !??4 reem t'sourceforge'net'

[40] 9eysel GaDi+ Mathe7 L Moore+ ;e$in M Passino+ @illiam P Shac4leford+ <rederic4 M Proctor+ and Bames S &l"us' The RCS 8and"oo4! Tools for Real-Time Control Systems Soft7are #e$elo ment' Bohn @iley % Sons+ Inc'+ Ne7 Qor4+ -))('

[41] Marcus Goncal$es' Is real-time Linux for realV Technical re ort+ Real-Time MagaDine+
(111' htt !??777'realtime-info'"e?magaDine?11=0?ar-' df'

[42] Edgar < 8ilton' Real Time Controls La"oratory+ -))('


htt !??sourceforge'net? roGects?rtic-la"'

[43] Edgar <' 8ilton and 9ictor Qodai4en' Real-time a

lications 7ith RTLinux' Em"edded Linux

Bournal+ (!(,O-)+ --O-/+ Banuary?<e"ruary -))(' htt !??em"edded'linuxGournal'com?magaDine?issue)(' NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

2,

*I*LI:GR&P8Q

*I*LI:GR&P8Q

[44] S' 8ouse and #' Niehaus' ;CRT-Linux su

ort for synchronous ne-grain distri"uted com utations' In Proceedings of the Sixth IEEE Real-Time Technology and & lications Sym osium ERT&S H))F+ ages 3,O,1+ @ashington - *russels - To4yo+ Bune -)))' IEEE' htt !??hegel'ittc'u4ans'edu? roGects? roteus?docs?RT&S--)))' df'
high s eed magnetic "earing system' In Proceedings of the <ifth IEEE Real-Time Technol-ogy and & lications Sym osium ERT&S H11F+ ages (-(O(.(+ @ashington - *russels - To4yo+ Bune (111' IEEE'

[45] M' 8um hrey+ E' 8ilton+ and P' &llaire' Ex eriences using RT-Linux to im lement a controller for a

[46] IEEE Std ()).'(--))( E: en Grou Technical Standard+ Issue 2F' Standard for Information
TechnologyXPorta"le : erating System Interface EP:SI>F' Technical re ort+ IEEE Press+ Ne7 Qor4+ -))(' Su erceeds ()).'(-(112+ ()).'--(11-+ and include ()).'(d-(111'

[47] <SM La"s Inc' RTLinux #esign @hite a er+ -))('


htt !??777'fsmla"s'com?de$elo ers?7hite a ers?design'htm'

[48] <SM La"s Inc' <&A+ -))-'


htt !??777'fsmla"s'com? roducts?fa='htm'

[49] <SM La"s Inc' <irst real-time linux+ -))-'


htt !??777'fsmla"s'com?community'

[50] <SM La"s Inc' <SMLa"s Product Su


htt !??777'fsmla"s'com? roducts?su

ort+ -))-' ort'htm'

[51] <SM La"s Inc' <SMLa"s RTLinux+ -))-'


htt !??777'fsmla"s'com? roducts?soft7are'htm'

[52] <SM La"s Inc' <SMLa"s RTLinux #e$elo ment+


-))-' htt !??777'fsmla"s'com?de$elo ers'

[53] <SM La"s Inc' <SMLa"s RTLinux <ree #o7nload+


-))-' htt !??777'fsmla"s'com? roducts?do7nload'htm'

[54] <SM La"s Inc' 8ome

age+ -))-' htt !??777'fsmla"s'com' -))-' htt !??777'fsmla"s'com'

[55] <SM La"s Inc' RTCore?*S# Released+ [56] <smla"s Inc' Process S ace #e$elo ment #omain+ -))-'
htt !??777'linuxde$ices'com?ne7s?NS..)0.,2303'html'

[57] Lineo Inc' Em"edded Linux! Issues+ =uestions+ and ans7ers+ -))-'
htt !??777'lineo'com? roducts?em"edix sd4?em"edix?Em"edding Linux $(-.' df'

[58] Monta9ista Soft7are Inc' Com any :$er$ie7+ -))-'


htt !??777'm$ista'com?com any?o$er$ie7'html'

[59] Monta9ista Soft7are Inc' <re=uently &s4ed Auestions+


-))-' htt !??777'm$ista'com? roducts?fa='html' NIST! Intelligent Systems #i$ision 21

9ersion -')')+ -))--(--((T(/.(

*I*LI:GR&P8Q

*I*LI:GR&P8Q

[60] Monta9ista Soft7are Inc' 8ome Page+


-))-' htt !??777'm$ista'com'

[61] Monta9ista Soft7are Inc' Monta9ista Linux Professional and Carrier Grade Editions+ -))-'
htt !??777'm$ista'com? roducts?index'html'

[62] Prima Industrie' Platino roduct information age+ -))-'


htt !??777' rimaindustrie'com? r latino'html'

[63] Cnited Electronic Industries' Po7er #&A La"9IE@ for Linux+ -))-'
htt !??777'ueida='com? roducts? roducts'as V nWL&*9IE@-LINC>'

[64] Cnited Electronic Industries' Po7er #&A La"9IE@ for Linux - Press release+
-))-' htt !??777'ueida='com? ress? ress'as VMM RecordIdW..'

[65] IS:' Information technology O Porta"le : erating System Interface EP:SI>F O Part (! System
& lication Program Interface E&PIF MC LanguageN+ (112' htt !??777'iso'org'

[66] Bochen ;Yu

er' #ata ac=uisition 7ith real-time Linux' MasterHs thesis+ #uesseldorf Cni$ersity+ -)))' htt !??777- u"lic'rD'uni-duesseldorf'de? Gochen?com uter?RT-Linux?RT-Linux'html' htt !??777'linuxGournal'com'

[67] Linux Bournal' The Monthly MagaDine of the Linux Community+ -))-'
8umano ro" h and M2,N Satoshi ;agami' id ot 3 for autonomous intelligent soft7ar Linu @or4sho + e research' In Real Time x Milan+ Italy+ -))(' ft !??ft 'realtimelinuxfoundation'org? u"?e$ents?rtl7s--))(? roc?4)--4agami' df'

[69] Bason ;roll' #e$elo ing soft7are 7ith Linux+ (111'


htt !??linuxsolutions'hy ermart'net?linux?linux main'htm'

[70] *rent Led$ina+ <' Mota+ and P'M' ;intner' & coming of age for g s! & rtlinux "ased g s
recei$er' In Proc' of the @or4sho on Real Time : erating Systems and & lications and Second Real Time Linux @or4sho Ein conGunction 7ith IEEE RTSS -)))F+ :rlando+ <lorida+ -)))' htt !??g s'ece'cornell'edu'

[71] Ric4 Lehr"aum' &n inter$ie7 7ith 9ictor Qodai4en' Em"edded Linux Bournal+ )!0-O02+
No$em-"er -)))'

[72] Ric4 Lehr"aum' Csing Linux in em"edded and real-time systems' Linux Bournal+ 3/+ Buly -)))' [73] Ric4 Lehr"aum' &deos O a resource sharing multi-os en$ironment+
-))(' htt !??777'linuxde$ices'com?articles?&T33,,//13.-'html'

[74] Thomas Lei"ner' Gra hical Programming of Realtime &

lications 7ith La"9IE@ for Linux RT&I' Technical re ort+ Real Time Linux <oundation+ -))-' ft !??ft 'realtimelinuxfoundation'org? u"?e$ents?rtl7s--))-? roc?c)0 lei"ner' df' real-time architecture+ -))-'

[75] &rnold Leucht' 8ard real-time ca a"ility under Linux O de$elo ment 7ithin the micro-4ernel

htt !??777'electronicengineering'com?features?em"edded?:EG-))-)--)S)))1' NIST! Intelligent Systems #i$ision 3)


9ersion -')')+ -))--(--((T(/.(

*I*LI:GR&P8Q

*I*LI:GR&P8Q

[76] Real Time Linux <oundation Inc' Real time Linux foundation inc'+ -))-'
htt !??777'realtimelinuxfoundation'org'

[77] &SCENSIT Linux Solutions' Real-Time Linux #e$elo ment+ -))-'


htt !??777'ascensit'com?education?aa.).?VLangWus'

[78] Linux*I:S'org' The Linux*I:S 8ome Page+


-))-' htt !??777'linux"ios'org'

[79] Linux#e$ices'com' Em"edded and real-time Linux roducts+ roGects+ and sources+
-))-' htt !??777'linuxde$ices'com'

[80] LiNC>LiN;S'com' The Linux ortal! Em"edded distri"utions+ -))-'


htt !??777'linuxlin4s'com?Em"edded?#istri"utions'

[81] Linux'org' Linux Logos and Mascots+


(112' htt !??777'linux'org?info?logos'html'

[82] Ro"ert Lo$e' My Linux 4ernel


-))(' htt !??777'tech1'net?rml?linux'

atches+

[83] AN> Soft7are Systems Ltd' AN> Neutrino RT:S+ -))-'


htt !??777'=nx'com?resource'

[84] P' MantegaDDa+ E' *ianchi+ L' #oDio+ and S' Pa acharalam"ous' Rtai! Real time a
interface' Linux Bournal+ 3-!(O(+ & ril -)))' htt !??noframes'linuxGournal'com?lGissues?issue3-?.,.,'html'

lication

[85] The Math@or4s' Simulin4 /')'(+ -))-'


htt !??777'math7or4s'com? roducts?simulin4'

[86] Nicholas McGuire' Primary user documents+


-))-' htt !??777'rtlinux'at?documents'html'

[87] Nicholas McGuire' Rtlinux a


-))-' htt !??777'rtlinux'at?a

lications and enhancements+ lications'html'

[88] Microsoft' @indo7s CE 'NET 8ome Page+ -))-'


htt !??777'microsoft'com?7indo7s?em"edded?ce'net?default'as '

[89] Synergy Microsystems' 8ome

age+ -))-' htt !??777'synergymicro'com'


htt !??777'synergymicro'com?Soft7are?Linux'html'

[90] Synergy Microsystems' Linux SMP o$er$ie7 age+ -))-' [91] Charles B Murray' Shifting o inion sha4es footing of em"edded Linux' EE Times+ May (-+ -))-' [92] Intelligent Machine #i$ision NIST! Manufacturing Engineering La"oratory' Pu"lication List+
-))-' htt !??777'isd'mel'nist'go$?documents? u"list'htm' NIST! Intelligent Systems #i$ision 3(

9ersion -')')+ -))--(--((T(/.(

*I*LI:GR&P8Q

*I*LI:GR&P8Q

[93] Bames Norton and Clar4 Roundy' Real-time Linux - 7here is it no7V Technical re ort+ RealTime MagaDine+ (111' htt !??777'realtime-info'"e?magaDine?11=.?altatech' df'

[94] Institute of Electrical and Electronic Engineers' IEEE Std ()).'(--))(+


-))(' htt !??777'o engrou 'org?online u"s?))31)013/?xrat?contents'html'

[95] <rederic4 M' Proctor' Linux+ Real-Time Linux+ and IPC' #r' #o""Hs Bournal of Soft7are Tools+
-0E((F!.-O.1+ No$em"er (111' code as TIP leL code as tgD le'

[96] <rederic4 M' Proctor' Measuring erformance in real time Linux' In Real Time Linux @or4sho +
Milan+ Italy+ roctor' df' -))(' ft !??ft 'realtimelinuxfoundation'org? u"?e$ents?rtl7s--))(? roc?4).-

[97] <rederic4 M Proctor+ * #amaDo+ C Qang+ and S <rechette' : en architectures for machine
control' Technical re ort+ National Institute of Standards and Technology+ Gaithers"urg+ M#+ #ecem"er (11.'

[98] <rederic4 M Proctor and @illiam P Shac4leford' Timing studies of real-time Linux for control' In
Proceedings of #ETC )( &SME -))( #esign Engineering Technical Conferences % Information in Engineering Conference+ Pitts"urgh+ P&+ Se tem"er 1O(- -))(' &SME' htt !??777'isd'mel'nist'go$?documents? u"list'htm'

[99] <rederic4 M Proctor and @illiam P Shac4leford' Em"edded real-time Linux for ca"le ro"ot
control' In Proceedings of #ETCH)- &SME -))- #esign Engineering Technical Conf' % Comuters % Information in Engineering Conference+ Montreal+ Canada+ Se tem"er -1O:cto"er -))-' htt !??777'isd'mel'nist'go$?documents? u"list'htm'

[100] &#E:S ProGect' #o7nload age+ -))-'


htt !??sa$annah'gnu'org?do7nload?adeos'

[101] &#E:S ProGect' 8ome age+ -))-'


htt !??777'o ersys'com?adeos'

[102] ARTS' Auality Real Time Systems+


-))-' htt !??=rts'com'

[103] ARTS' Real time Linux target! & simulin4-"ased real-time control-design en$ironment+ -))-'
htt !??=rts'com? roducts?rtlt linux?index'shtml'

[104] Bim Ready' Em"edded systems conference! ;eynote+ -)))'


htt !??777'linuxde$ices'com?articles?&T-.)2(2.01-'html'

[105] RE#Sonic' 8ome age+ -))-'


htt !??777'redsonic'com'

[106] Rafee= Cr Rehman' : en source real-time o erating systems' Sys &dmin! The Bournal for
CNI> Systems &dministrators+ ()E(F!1(O1/+ Banuary -))(' htt !??777'samag'com?documents?sW((//?sam)()(4?)()(4'htm' NIST! Intelligent Systems #i$ision
9ersion -')')+ -))--(--((T(/.(

3-

*I*LI:GR&P8Q

*I*LI:GR&P8Q

[107] Ste$e Rosen"luth+ Michael *a"coc4+ and #a$id *arrington 8olt' Controlling creatures 7ith
Linux' Linux Bournal+ ().!-,O./+ No$em"er -))-' htt !??777'linuxde$ices'com?articles?&T20./)2/1(,'html'

[108] #a$id Schleef' @riting a Real-Time Com ati"le #e$ice #ri$er for Linux! Comedi' Technical
re ort+ Real Time Linux <oundation+ (111' ft !??ft 'realtimelinuxfoundation'org? u"?e$ents?rtl7s-(111? (2-schleef' df'

[109] Paul G' Schreier' Interfacing #& 8ard7are To Linux' Technical re ort+ Cnited Electronic
Industries+ -))(' htt !??777'e$aluationengineering'com?archi$e?articles?)()-data'htm'

[110] #octor Scila"' Scicos 8ome Page+ -))-'


htt !??777-roc='inria'fr?scila"?doc?scicos html'

[111] *enno Senoner' Periodic Bitter+ -)))'


htt !??777'linuxdG'com?latency-gra h'

[112] @illiam P Shac4leford and <rederic4 M Proctor' Cse of o en source distri"ution for a machine tool
controller' In Proceedings of the International Society for : tical Engineering ESPIEF Photonics East Conference+ *oston+ M&+ No$em"er /O, -)))' SPIE' htt !??777'isd'mel'nist'go$?documents? u"list'htm'

[113] Matt Sherer' Rtlinux a

lication de$elo ment tutorial+ -))(' htt !??777'linuxGournal'com?article' h VsidW/210' htt !??777-roc='inria'fr?syndex'

[114] Q$es Sorel' The &&&Methodology and Syn#Ex+ -))-' [115] Richard Stallman' GNCHs Not CnixZ+ -))-'
htt !??777'fsf'org'

[116] stm'l"l'go$' comedi! linux control and measurement de$ice interface+


-)))' htt !??stm'l"l'go$?comedi?intro'html'

[117] :ncore Systems' 8ome age+ -))-'


htt !??777'oncoresystems'com'

[118] @ind Ri$er Systems' S:System . 8ome Page+ -))-'


htt !??777'7indri$er'com? roducts? sosystem .?index'html'

[119] @ind Ri$er Systems' 9x@or4s /'x+ -))-'


htt !??777'7indri$er'com? roducts?$x7or4s/?index'html'

[120] &ndre7 Tannen"aum' MINI> Information Sheet+ (1,3O(112'


htt !??777'cs'$u'nl? ast?minix'html'

[121] &' Terrasa+ &' Es inosa+ and &' Garc a-<ornes' Extending RT-Linux to su

ort exi"le hard real-time systems 7ith o tional com onents' Lecture Notes in Com uter Science+ (030!0(O0,+ (11,' htt !??lin4's ringer-ny'com?lin4?ser$ice?series?)//,? a ers?(030?(030))0(' df' NIST! Intelligent Systems #i$ision 3.
9ersion -')')+ -))--(--((T(/.(

*I*LI:GR&P8Q

*I*LI:GR&P8Q

[122] Martin Timmeman' RT:S Mar4et Sur$ey Preliminary Results+ (111'


htt !??777'realtime-info'"e?magaDine?11=(?(111=( ))2' df'

[123] Linus Tor$alds' Linux history+ (11('


htt !??777'li'org?linuxhistory' h '

[124] Linus Tor$alds' The Linux 4ernel archi$es+


-))-' htt !??777'4ernel'org'

[125] Carnegie Mellon Cni$ersity' Linux?R;+ :riginal #e$elo ment+ (113'


htt !??777--'cs'cmu'edu? raG4umar?linux-r4'html'

[126] ;ansas Cni$ersity' ;CRT! P:SI> roGect+ (113'


htt !??hegel'ittc'u4ans'edu? roGects? osix'

[127] ;ansas Cni$ersity' ;CRT! Real Time Linux+ (113'


htt !??777'ittc'4u'edu?4urt'

[128] *orland CS&' B*uilder do7nload age+ -))-'


htt !??777'"orland'com? roducts?do7nloads?do7nload G"uilder'html'

[129] *ill @ein"erg and Claes Lundholm' Em"edded Linux - ready for real-time' Technical re ort+
Monta9ista Soft7are+ Inc'+ -))(' htt !??777'm$ista'com?ds7 ?RTReady' df'

[130] Phil @ilshire' Real time Linux! Testing and e$aluation' In Real Time Linux @or4sho + :rlando+
<L+ -)))' ft !??ft 'thin4ingnerds'com? u"? roGects? -a). 7ilshire' df'

[131] C' @ayne @right and Ed7ard B' @alsh' Scanning radar altimeter' Linux Bournal+ /,!(O(+
<e"ruary (111' htt !??lidar'7 'nasa'go$?sra?lG1,'

[132] @ST&@G' @ea ons Systems Technical &rchitecture @or4ing Grou +


-))-' htt !??7sta7g'army'mil'

[133] Curt @uollet' MatPLC+ -))-'


htt !??mat'sourceforge'net'

[134] Peter @urmsdo"ler' Real-time Linux "ased roGects+ -))-'


htt !??777'realtimelinuxfoundation'org? roGects? roGects'html'

[135] Peter @urmsdo"ler and Nicholas McGuire' MiniRTL! & minimal real-time Linux' #r' #o""Hs
Bournal of Soft7are Tools+ -/E(-F!0,+ /)+ /-+ /0+ #ecem"er -)))' htt !??777'ddG'com?ft ?-)))?-))) (-?minirtl'txt'

[136] ;arim Qaghmour' &da ti$e #omain En$ironment for : erating Systems' Technical re ort+
: erSys'com+ -))(' htt !??o ersys'com?ft ? u"?&deos?adeos' df'

[137] ;arim Qaghmour' Tracing real-time a

lication interface using the Linux Trace Tool4it' Em"edded Linux Bournal+ -!.1O0)+ 0-+ March?& ril -))(' htt !??em"edded'linuxGournal'com?magaDine?issue)-' NIST! Intelligent Systems #i$ision 30

9ersion -')')+ -))--(--((T(/.(

*I*LI:GR&P8Q

*I*LI:GR&P8Q

[138] ;arim Qaghmour' The Linux Trace Tool4it+ -))-'


htt !??o ersys'com?LTT'

[139] 9ictor Qodai4en' CS/11/30/! &dding real-time su ort to general ur ose o erating systems+
(111' htt !??777'del hion'com?detailsV nWCS)/11/30/ '

[140] 9ictor Qodai4en' <SMLa"s Lean P:SI> for RTLinux' Technical re ort+ <SMLa"s Inc+ -))('
htt !??777'fsmla"s'com?de$elo ers?7hite a ers? osix'htm'

[141] 9ictor Qodai4en+ Pierre Cloutier+ #a$id Schleef+ Phili N' #aly+ Ragunathan RaG4umar+ and
*ernhard ;uhn' #e$elo ment of RT:Ses and the osition of Linux in the RT:S and em"edded mar4et' In Proceedings of the -(stSym osium on Real-Time Systems ERSS-))F+ ages ,O,+ Los &lamitos+ C&+ No$em"er -3O.) -)))' IEEE Com uter Society'

NIST! Intelligent Systems #i$ision


9ersion -')')+ -))--(--((T(/.(

3/

-- e$ent Gitter+ .2

Index
&#E:S+ .0+ /2 a lication
animatronics+ 0, ca"le ro"ots+ 0/

control a lications+ 0, data ac=uisition+ 02 distri"uted real-time com uting+ 01 electronic excitation s ectrosco y+ 03 GPS recei$er+ 02 humanoid ro"ot+ 01 i&rte+ 0, laser cutting machine+ 0, machine tool control+ 0, machine tool controller+ 0( PL&TIN:+ 0, radar altimeter+ 02 real-time cluster+ 01 ro"otics+ 01 solar s ectral ux radiometer+ 03 ste er motor control+ 00 telesco e camera+ 03 telesco e control system+ 0,

*S# RTLinux+ 2)
soc4ets+ -)
C language+ -3 C&N *us+ /( Comedi+ /. communication+ -)

external+ -) interrocess+ -)+ /( internal+ -) Concurrent Com uter Cor oration+ /1 de$ice dri$er+ (2+ (1+ /( em"edded systems+

NI ST!

Int Systems #i$ision elli 32 ge 9ersion -')')+ nt -))--(--((T(/.(

e$ent latency+ ./ <ile Management+ (1 <ree Soft7are <oundation+ -3 <SM La"s Inc+ /, <SM La"s Inc'+ 2)
gd"+ /GNC+ -, de"ugger+ /tool chain+ /)

GNC Pu"lic Licence+ -, GPL+ -, gra hical design en$ironment+ /( hard real-time system+ -- hard7are+ (1+ /. IEEE ()).'(d com liant+ /1 IEEE ()). ()).'(+ -(
()).'(.+ -( ()).'("+ -( ()).'(c+ -( ()).'(d+ -( ()).'-+ -(

integrated de$elo ment en$ironments+ -1 inter- rocess communication+ -)+ /( interru t+ (1 latency+ (1 riority+ (1 IS: (/-,3--!-)))+ -( 110/-(+ -( 110/--+ -(
Gitter+ --+ .2 eriodic+ .2

Boint Technical &rchitecture+ --

IN#E>

IN#E>
m + ( / m u l t i t a s 4 i n g + ( / o er a t i n g s y s t e m s r e a l t i m e

Monta9ista ;ansas Cni$ersity real-time Linux+ /2 4ernel+ (/ Soft7are Inc'+ micro+ .- nano+ .0 2) 4ernel modules+ (2+ /) 4ernel n atch+ -1 4ernel resources+ /( a 4ernel s ace+ (/+ /n de"ug+ /- ;CRT+ /2 o do7nload site+ 20
La"9IE@+ 0,+ /( latency+ --+ ./ 4 e r n e l + . 0 n e t 7 o r 4 i n g + )

e$ent+ ./ Linus Tor$alds+ -, Linux+ 1 de$elo ment considerations+ /( em"edded+ .) history+ -3 IEEE ()).'(d+ .. interru t rocessing+ .( 4ernel reem tion+ .( 4ernel source+ 20 P:SI> real-time+ .. real-time+ .) resource 4ernel+ .0 soft realtime+ .) standard+ .) system cost+ /. timer resolution+ .( training+ /. $ersion history+ -1 Linux Trace Tool4it+ /machine control+ /. memory rotection+ (, segmentation+ (3 $irtual+ (3 memory management+ (3 memory model
at+ (3 segmented+ (3

micro 4ernel+ .- MINI>+ -3 Monta9ista Linux+ 2)

Ne7 Mexico Institute of Technology+ /, NIST+ 1


o er a t i n g s y s t e

S:S+ -/ A N >

Neutrino RT:S+ -/ 9x@or4s+ -. @indo7s CE 'NET+ -0


atch+ -1 atent

RTLinux+ /, Performance Measures+ -. i e+ -( Politecnico di Milano+ /3 olling+ (1


P:SI>+ -( PSE/(+ ..

reem tion+ (, rocess+ (,

communication+ -) rotocols+ -) ARTS+ 2( Auality Real Time Systems+ /(+ 2(


real-time Linux &#E:S+ /2

<SMLa"s RTLinux+ 2) ;CRT+ /2 Monta9ista Linux+ 2) ARTS+ 2( Red8a74 Linux+ /1 RE#ICE-Linux+ 2( RT&I+ /3 RTLinux+ /, su ort organiDations+ 20 synergymicro NIST! Intellig

RTLi nux+ 2Time Sys Linux GPL+ .0+ /1 Time Sys Linux ?Real Time+ 2tutori al+ 2/

ent s #i$ision 33 System -))--(--((T(/.(

9ersion -')')+

IN#E>

IN#E>
IS : 11 0/ + -( P : SI >' (+ -( + -1 P : S I > ' +
( + 1 P : S I > ' 0 + ( synchr oniDati on+ (1 Syn#e x+ /( Syne rgy Micr osyst

user s ace+ /- 7or4sho + 20 real-time system+ -hard+ -- soft+ --

Red8a74 Linux+ /1 RE#ICE-Linux+ 2( RE#Sonic Inc'+ 2( Richard Stallman+ -3 RT&I+ /3 a lication+ 2/ do7nload site+ 20 <&A+ 2/ RTiC-La"+ /(
RTLinux+ /, do7nload site+ 20

ems Inc'+ 2synergy micro RTLinux + 2system calls+ (/ tas4+ (, t a s 4 m a n a g e m e n t + ( , t h r e a d + ( , time slicing+ (, TimeS ys Co r o rati on+ /1+ 2-

<&A+ 2/ La"9IE@+ 0, atent+ /, RT:S "uyers guide+ 2/ <&A+ 2/ sur$ey+ 2/ scheduling+ (, Scicos+ /( SciLa"+ /( sema hore+ -( shared memory+ -) shell+ (/
signals+ -( Simulin4+ /( soc4ets+ -)

secure+ -) soft real-time system+ -- source code atch+ -1 SSL+ -) Stallman+ Richard+ -3 standards IEEE ()).+ -( IEEE ()).'(+ .. IEEE ()).'(.+ -( IEEE ()).'("+ -( IEEE ()).'(c+ -(
IEEE ()).'(d+ -( IS: (/-,3--!-)))+ -(

do7nload site+ 20 TimeSys Linux GPL+ .0+ /1 TimeSys Linux?RealTime+ 2- Tor$alds+ Linus+ -, Cnited Electronic Industries+ /( Cnix+ -3 N

user s ace+ (/+ /-

@ST&@G + -Qodai4en+ 9ictor+ /,

Вам также может понравиться