Top Banner

of 111

Linux Report

Jun 04, 2018

Download

Documents

Phani Bhamidi
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/13/2019 Linux Report

    1/111

    National Institute of Standards and Technology

    Introduction to Linux forReal-Time Control

    Introductory Guidelines and Reference for Control Engi-neersand Managers

    Pre ared for! Pre ared "y!Intelligent Systems #i$isionNational Institute of Standards %Technology &eolean Inc'()) *ureau #ri$e+ Mail Sto , .) /0 Sarah *isho Road

    Gaithers"urg+ M# ),11-, .)Ridge eld+ CT )2,33-( (/

    frederic4' roctor5nist'go$ simon5aeolean'com

  • 8/13/2019 Linux Report

    2/111

    6( .)( 13/ .0 /6(

    ).0.,

    .((,

  • 8/13/2019 Linux Report

    3/111

    This re ort descri"es a ra idly-e$ol$ing as ect of com uting+ real-time Linux' Since there ort cannot ca ture e$ery ossi"le detail and facet of the real-time Linux com uting7orld+ it 7ould "e a reciated if any changes+ corrections+ ne7 material+ noti cations ofoutdated 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'

  • 8/13/2019 Linux Report

    4/111

    Contents

    ( Executi$e Summary 1

    1.1 8istory of Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 1

    1.2 Standards ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ()

    1.3 Real-Time 9ersions of Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ()

    1.4 & lications ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ((

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

    (

    Introduction(.

    '( Trademar4s and Ser$ice Mar4s ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

    (0

    '

    NIST #isclaimer ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

    (

    0 . : erating Systems and Real-Time ;ernels

    (/

    3.1 &rchitecture of an : erating System ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' (/

    3.2

  • 8/13/2019 Linux Report

    5/111

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

  • 8/13/2019 Linux Report

    6/111

  • 8/13/2019 Linux Report

    7/111

    4.4 System-Performance Measurement ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .,

    4.4.1 Com aring Real-Time and Standard Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .,

    4.4.2 Com arison 7ith other Real-Time ;ernels ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .1

    0'0' '( Performance Com arison ' ' ' '' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' . 1

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

    http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page38http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page38http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page38http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page38http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page39http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page39http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page39http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page39http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page39http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page39http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page39http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page39http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page38http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page38http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page39http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page39
  • 8/13/2019 Linux Report

    8/111

    C:NTENTS C:NTENTS

    / & lication Case Studies 0(

    5.1 NIST Sam led #ata Control ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 0(

    5.1.1 EMC ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 0(

    5.1.2 Ste er Motor Control ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 00 5.1.3 Ca"le Ro"ots ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 0/

    5.2 :ther Exam les of Real-Time Linux & lications ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 02

    /' '( #ata &c=uisition ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '02

    /' '('( &ir"orne Scanning Radar &ltimeter ' ' ' ' ' ' ' ' ' ' ' ' ' ' '02

    5.2.1.2 GPS Recei$er ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 02

    5.2.1.3 Electronic Excitation S ectrosco y ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 03

    5.2.1.4 Solar S ectral

  • 8/13/2019 Linux Report

    9/111

    2' '( Su orting 8ard7are Interfaces for Machine Control ' ' ' ' ' ' ' ' ' ' '/.

    6.2.2 Total Cost of Systems #e$elo ed 7ith Real-Time Linux ' ' ' ' ' ' ' ' ' ' /.

    6.2.3 Su ort Considerations ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /. NIST! Intelligent Systems #i$ision /

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

    http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page53http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page53http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page53http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page53http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page53http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page53http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page53http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page53http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page53
  • 8/13/2019 Linux Report

    10/111

    C:NTENTS C:NTENTS

    6.2.4 Net7or4ing and

  • 8/13/2019 Linux Report

    11/111

    # Index32

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

  • 8/13/2019 Linux Report

    12/111

  • 8/13/2019 Linux Report

    13/111

    List of Ta"les

    1.1 Linux Performance Com arison ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ((

    3.1 P:SI>?IEEE Standards ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' (

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

    3'( E:S Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /2

    7.2 ; RT Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /3

    3'. RT&I! Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '/,

    3'0 RTLinux! Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '/,

    7.5 TimeSys Linux GPL! Real-Time Linux ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' /1

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

    7.7

  • 8/13/2019 Linux Report

    14/111

    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 "eendemonstrated in the ast fe7 years "y research grou s in uni$ersities+ go$ernmentla"oratories and indus-try+ the real-time modi cations are sta"le and ro$en+ andcommercial 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 ano 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 NISTF the Control SystemsGrou in the Intelligent Systems #i$ision has had considera"le success in using real-timemodi 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 7ithan o$er$ie7 of recent a lications'

    This re ort is directed to control engineers and managers' It is intended to ro$ide ano$er$ie7 of real-time o erating systems and articularly of the real-time modi cations to theLinux o erating system in enough detail that the reader can ma4e an informed decision7hether to commit the resources to e$aluate Linux as a real-time o erating system'

    1.1 8istory of Linux

    nix 7as de$elo ed at *ell La"s around (13)' Since it 7as clean+ e cient+ andro$ided economical access to a multi-user en$ironment+ it soon gained a signi cant

    follo7ing in the technical community' nix and nix-li4e o erating systems came todominate 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+ nix-li4e o erating system as astudent ro ect at the ni$ersity of 8elsin4i in (11('

  • 8/13/2019 Linux Report

    15/111

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

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

    1.2 StandardsThe Institute of Electrical and Electronic Engineers IEEEF has led the de$elo ment of a

    standard+ "ased on the nix o erating system+ that de nes the re=uirements of a Porta"le: erating System Interface P:SI>F' The IEEE Std ()).'(- ))( is a uni cation of t7o ofthe re$ious standardiDation e orts+ P:SI>'( System Interfaces and 8eadersF+ andP:SI>' Shell and tilitiesF' StandardiDation e orts in arallel 7ith P:SI>'( de$elo edP: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' Thecurrent 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 eratingsystems+ 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 architecturede$elo ed "y the @ea on Systems Technical &rchitecture @or4ing Grou @ST&@GFreferences P:SI> system calls for hard real-time em"edded 7ea ons systema 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-timea lications 7here the sam le time is relati$ely long+ say tens of milliseconds+ and thea lication can tolerate missed timing schedules' &n exam le is $ideo rocessing+ 7herean occasional ic4er is often acce ta"le'

    8ard real-time a lications re=uire rigid determinism and fast timing' Real-time $ariantsof Linux suita"le for such a lications ha$e a eared since (113' Research grou s atNe7 Mexico Tech+ Politecnico di Milano+ and ;ansas ni$ersity ha$e roduced 7idely-distri"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 theo 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(/.(

  • 8/13/2019 Linux Report

    16/111

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

    Micro-;ernel! This a roach Ne7 Mexico+ MilanoF is to insert a ne7+ highly e cient codelayer "et7een the hard7are and the standard 4ernel' The additional code layer+ called amicro-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:SF+ is one thatonly handles interru t dis atching' This nano-4ernel a roach can su ort multi leo erating systems+ one "eing real-time+ including non-Linux o erating systems'

    IEEE ()).'(d ;ernel! The second a roach ;ansas+ TimeSysF is to im lement thereal-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 the time delay from aninterru t to the start of rocessing that interru tF and itter $ariations of timing of eriodic e$entsF ofthe order of one millisecond' The real-time $ersions of Linux ha$e latency and itter of the order ofa fe7 microseconds on rocessors running at se$eral hundred megahertD' Ta"le ('( demonstratesthat the erformance is com ara"le to the commercial real time 4ernels'

    & lication Latency?Bitter

    Standard :?SNon RealTime

    ()) microseconds to ())milliseconds

    Standard Linux Soft Real Time ( millisecond

    IEEE ()).'(d Linux8ard RealTime () to ()) microseconds

    Micro-;ernel Linux8ard RealTime ( to () microseconds

    RT:S ;ernels8ard RealTime ( 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"utionto ena"le maintaina"ility and extensi"ility+ these real-time $ersions of Linux are ndingincreasing o ularity in go$ernment and industry as 7ell as in uni$ersities'

    1.4 & lications

    The National Institute of Standards and Technology NISTF has used real-time $ersionsof 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 afeel for the areas 7here real-time Linux has "een used' The Real Time Linux

  • 8/13/2019 Linux Report

    17/111

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

  • 8/13/2019 Linux Report

    18/111

  • 8/13/2019 Linux Report

    19/111

    Cha ter

    Introduction

    E$eryone that uses com uters has undou"tedly heard of Linux+ the free+ o en-source+nix-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 amainstream technology+ gaining something li4e / of the mar4et share for ser$ers'

    @hile organiDations may ado t standard Linux for ser$er a lications+ articularly 7ithhandholding 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$eonly a - eared since (113 and using those real-time extensions re=uire modifying thestandard 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 consideredas $ia"le candidates for real-time a lications' Signi cant successes in using Linux forreal-time a lications ha$e "een demonstrated in the ast fe7 years "y research grou s inuni$ersities+ industry+ and go$ernment la"oratories' The real-time modi cations are sta"leand 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 greatsuc-cess in using the real-time modi cations to Linux for real-time control a lications inro"otics and machine tool control' Those a lications+ and a sam ling of other non-NISTa lications 7ill "e summariDed to ro$ide the reader a feel for the areas 7here real-timeLinux has "een used'

    This re ort is directed to control engineers and managers' It is intended to ro$ide ano$er$ie7 of real-time o erating systems and articularly of the real-time modi cations tothe Linux o erating system' Enough detail is ro$ided so that the reader can ma4e aninformed decision 7hether to commit the resources to e$aluate and consider ado tingLinux as a real-time o erating system'

    Pointers are ro$ided to further sources of information throughout the re ort and inmore detail in the a endices' Lin4s are em"edded in the electronic $ersion of the re ortthat 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'

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

  • 8/13/2019 Linux Report

    20/111

    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 thelegal 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 nitedStates 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 accuratelyex lain the conce ts' Such identi cation is not intended to im ly recommendation orendorsement "y the National Institute of Standards and Technology+ nor is it intended toim ly a udgment 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 allcom 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 udgment that the roduct isunsuited in any 7ay 7hatsoe$er for the ur oses descri"ed in this re ort'

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

  • 8/13/2019 Linux Report

    21/111

    Cha ter .

    : erating Systems and Real-Time;ernels

    &n o erating system is the interface "et7een a userHs rogram and the underlyingcom 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 acom uter encounters an o erating system+ 7hether it is @indo7s+ Mac+ Linux+ #:S+ or nix'

    This cha ter descri"es the architecture and functionality of an o erating system andthen summariDes the re=uirements of a real-time o erating system' #iscussion ofstandards and of s eci c details 7ill "e limited to nix-li4e o erating systems+ since Linuxis a nix-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 al7aysresident in memory and ro$ides the interfaces "et7een user rograms and the com uterhard7are' This is sho7n schematically in

  • 8/13/2019 Linux Report

    22/111

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

  • 8/13/2019 Linux Report

    23/111

    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 ma or "enet is that de$el-o ers of 4ernel dri$ers do not ha$e to re eatedly re"oot the com uter andreload the com lete 4ernel to test changes to the 4ernel functionality' & minor "ene t is toreduce the amount of memory used "y the 4ernel "y loading only the modules that arere=uired to interface to the currently-con gured hard7are'

    : erating systems usually ro$ide a 7ide $ariety of common ser$ices "eyond managingNIST! Intelligent Systems #i$ision (2

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

  • 8/13/2019 Linux Report

    24/111

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

    execution of the user rograms and interfacing to the hard7are'

  • 8/13/2019 Linux Report

    25/111

  • 8/13/2019 Linux Report

    26/111

    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 thecom 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 thatneeds 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 sourcesoutside the com uter system can arri$e at any time' The interface de$ice 4ey"oard+ mouse+serial ort+ arallel ort+ net7or4 interfaceF indicates the arri$al of the data "y signaling theCP at the hard7are le$el' This signaling is through the interru t ins ro$ided on the CP ': erating systems generally ac4no7ledge an interru t "y sto ing the CP from executingthe current rocess and running the interru t-ser$ice routine ISRF that reads the incomingdata 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 ust reading the incoming dataand 7riting it to 4ernel s ace storage+ "efore returning'

    Interru ts can "e assigned riorities so that rocesses that need ra id res onse+ suchas 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+ andthe time that the CP 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 aceaccess to the shared hard7are resources' The traditional method is to ena"le some 4ind ofsoft7are loc4 in the 4ernel 7hen one user-s ace rogram is using a hysical resource+ and todisa"le that loc4 7hen the user-s ace rogram is nished 7ith the resource' &ll other user-s ace

    rograms are rohi"ited "y the 4ernel codeF from accessing the hysical resource 7hen it isloc4ed' :ne s eci c ty e of loc4 is a s in loc4+ 7here the rogram sits in a tight loo until thenecessary hard7are de$ice is a$aila"le' This maximiDes the res onse for the user rogram'

    3.2.5

  • 8/13/2019 Linux Report

    27/111

    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 alo7er riority 7hile the real-time a lications 7ould run at a higher riority+ reem ting thele management tas4s as re=uired'

    3.2.6 Communication

    #ata communication+ or message assing+ "et7een rocesses in Linux? nix is commonlyachie$ed 7ith the *er4eley Soft7are #istri"ution *S#F soc4et system calls' These 7ere intro-duced in release 0' of *S# nix in (1,.' The idea of a soc4et is to J lug-inK to the other rocessand send the message+ 7ith the o erating system ta4ing care of deli$ering it' The soc4et layersu orts communication "et7een rocesses that are running on the same machine or e$en dierent machines' Soc4ets can "e o ened using a num"er of di erent rotocols including the nixsoc4et for intra-machine communication and TCP soc4ets for inter-machine communica-tion' :nedisad$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 Soc4etLayer 7hich ro$ides for encry tion of the information and identi cation of "oth machines in$ol$edin the communication' The SSL rotocol+ no7 4no7n as the Trans ort Layer Security rotocol+ is atthe heart of nancial transactions on the Internet'

    Soc4ets allo7 rogrammers to s ecify communications at the a lication le$el' Theo erat-ing system then notes 7here the reci ient rocess is and im lements lo7er le$elcommunication rotocols to deli$er the message' Those lo7er le$el mechanisms can "edistinguished 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 tocommuni-cate 7ith other machines using standard rotocols such as Internet Protocol IPF+No$ell IP>+ & leTal4+ and Microsoft SM*' These higher-le$el rotocols are+ in turn+ "uiltu on Ether-net IEEE ,) '.F or other Media &ccess Protocols' The o erating-system

    rimiti$es include de$ice dri$ers for the communication hard7are+ ac4et routing andltering functions+ and im- lementation of the rotocol stac4s such as Transmission ControlProtocol?Internet Protocol TCP?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 samecom 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 asshared memory+ "inary signals+ and i es' Since t7o or more rocesses could "e accessing theshared memory segment at the same time+ there is a need to indicate 7hen one rocess is 7ritingto the segment so that the other rocess esF 7ait until the 7rite is com lete "efore

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

  • 8/13/2019 Linux Report

    28/111

    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 7hosefunctionality includes the action of restarting a rocess that has "een laced on hold7aiting for the shared memory'

    Pi es are an alternati$e to shared-memory communication and use di erent systemcalls to the shared-memory interface' Shared-memory and i es allo7 nite-siDe messagesto "e assed "et7een rocesses 7hile "inary signals con$ey only one "it of information'

    Signals are another communication mechanism "et7een rocesses' :nly one "it ofinfor-mation is in$ol$ed+ "ut the o erating system may su ort a"out ()) such signals 7itheach 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 arefaster than i es 7hich are faster+ in turn+ than shared memory soc4ets are the slo7est of all'

    3.3 Standards

    The Institute of Electrical and Electronic Engineers IEEEF has led the de$elo ment of astandard+ "ased on the NI> o erating system+ that de nes the re=uirements of a Porta"le: erating System Interface P:SI>F' The IEEE Std ()).'(- ))( 02 + 10 is a uni cationof t7o of the re$ious standardiDation e orts+ P:SI>'( System Interfaces and 8eadersF+and P:SI>' Shell and tilitiesF'

    StandardiDation e orts in arallel 7ith P:SI>'( de$elo ed IEEE Std ()).'("-(11. toco$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 ., ' Since (11. therehas "een further 7or4 on the real-time extensions standard and+ conse=uently+ IEEE()).'(" has "een su erseded "y IEEE Std ()).'(d-(111 02 '

    & 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 standardsis 4no7n as ()).'(.-(11, PSE/( to PSE/0 Posix Standard En$ironmentF'

    The International :rganiDation for StandardiDation IS:F has ado ted the P:SI>'(stan-dard as IS: 110/-( and the P:SI>' standard as IS: 110/- 2/ and hassu erseded IEEE ()).'(. 7ith IS: (/ ,3- ! )))'

    P:SI> Standard IEEE Standard #escri tion

    P:SI>'( ()).'(- ))(

    System Interfaces and

    8eadersP:SI>' ()).'(- ))( Shell and tilitiesP:SI>'0 ()).'("-(11. Real-time extensions

    ()).'(d-(111 Su ersedes ()).'("-(11.P:SI>'0a ()).'(c-(110 Threads Extensions

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

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

    http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page69http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page69http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page69http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page69http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page69http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page69http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page69http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page69http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page69http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70
  • 8/13/2019 Linux Report

    29/111

  • 8/13/2019 Linux Report

    30/111

    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 theo 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' :nemeasure of res onsi$e-ness is latency+ the time "et7een the occurrence of an e$ent andthe execution of the rst instruction in the interru t code' & second measure is itter+ the$ariation in the eriod of nominally constant- eriod e$ents' To "e a"le to o er lo7 latencyand lo7 itter+ the o erating system must ensure that any 4ernel tas4 7ill "e reem ted "ythe real-time tas4' Section 0'. details these measures and Section 0'0'( ro$ides asummary of latency and itter for standard and real-time Linux'

    3.4.3 P:SI> Extensions for Real-Time & lications

    The P:SI> real-time extensions ( ro$ide an insight into the additional functionalitythat is re=uired for a real-time o erating system' These real time extensions add message=ueues for communication "et7een tas4sF+ shared memory+ counting sema hores

    needed to synchroniDe accesses to shared memoryF+ riority-"ased execution scheduling+real-time signal extensions+ and higher resolution timers' The timers can generate timeinter$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 ( redicted a mar4et for real-timeo er-ating systems in ))( that 7ould ha$e 9x@or4s+ @indo7s CE 'NET+ AN>+ andS: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 arederi$ed from a re ort gener-ated "y the #edicated Systems Encyclo edia .. ' & moreexhausti$e list of real-time o erating systems is gi$en in Ta"le &'( '

    3.5.1 9x@or4s

    @ind Ri$erHs 9x@or4s ((1 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 "eende loyed in a lications in the telecommunications+ consumer electronics+ datanet7or4ing+ and medical system areas'

    The 7ind micro-4ernel core of 9x@or4s ro$ides multitas4ing+ interru t su ort and "othreem ti$e and round ro"in scheduling' The intertas4 communications mechanisms su orted "y

    9x@or4s includes shared memory+ message =ueues+ sema hores "inary+ counting+ mutualexclusion 7ith riority inheritanceF+ e$ents and i es+ soc4ets and remote rocedure calls+ andsignals' 9x@or4s is P:SI> com liant+ im lements the P:SI> Threads and adheres to

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

    http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page35http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page35http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page38http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page38http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page66http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page66http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page66http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page74http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page74http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page74http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page63http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page63http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page35http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page38http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page66http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page74http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page63http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73
  • 8/13/2019 Linux Report

    31/111

    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 age loc4ingF+ and scheduling control'

    The Tornado em"edded de$elo ment latform+ of 7hich 9x@or4s is the run-time com o-nent+ ro$ides a full suite of cross de$elo ment tools and utilities and communication facilitiesfor host connections to the target' The Tornado autoscaling feature analyses the a licationcode and incor orates o tional su"systems such as net7or4 ser$ices TCP? #P soc4etsF'

    The )) odd *oard Su ort Pac4ages *SPsF su ort o ular commercial o -the-shelfC:TSF "oards as 7ell as the RISC and CISC architectures' Exam les of targets

    su orted are the Motorola?I*M Po7erPC+ Motorola 2,;?CP . + Intel Pentium &rchitecture family+ Intel Strong&rm and &RM'

    3.5.1.1 Performance

    &$erage latency ('3 microseconds+ maximum latency 2', microseconds on a ))M8DPen-tium machine .. '

    3.5.2 @indo7s CE 'NET

    MicrosoftHs @indo7s CE 'NET ,, is a real-time o erating system designed for mo"ilea lications and a lications re=uiring a small foot rint' It su orts 7ireless technologiessuch as *luetooth+ ,) '(x+ IP$2+ :" ect Exchange Protocol :*E>F+ MediaSense+ andReal Time Communication RTCF?Session Initiation Protocol SIPF' @indo7s CE 'NETsu orts the ;er"eros Security Protocol and the Secure Soc4ets Layer SSLF' 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

  • 8/13/2019 Linux Report

    32/111

    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 ))M8DPen-tium machine .. '

    3.5.3 AN> Neutrino RT:S

    AN> Soft7are Systems Ltd mar4ets the AN> Neutrino RT:S ,. ' 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-carde$ices' CP Hs 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 commu-nication+ 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$idescon$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 thenet7or4 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+ includingthe em"edda"le AN> Photon microG I to de$elo integrated Internet ca a"ilities+international fonts+ and so histicated user interfaces' + Linux+ #:S+ Neutrino also ro$ides a range of "oard su ortac4ages for o ular "oards and rocessors'

    3.5.3.1 Performance

    &$erage latency ('2 microseconds+ maximum latency 0'( microseconds on a ))M8DPen-tium machine .. '

    3.5.4 S:System .

    @ind Ri$erHs S:System . ((, is a multitas4ing en$ironment designed for use in em"ed-dedsystem 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 Integrated #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+ role 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" ectsNIST! Intelligent Systems #i$ision /

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

    http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page71http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page71http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page71http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page71http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73
  • 8/13/2019 Linux Report

    33/111

    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 analysistools' 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 andcoordinates multi le asynchronous acti$ities' ItHs riority-"ased tas4 scheduler su orts tas4-s ecic+ time-"ased reem ti$e scheduling and handles interru ts externally' S:S6 ser$ices includetas4 management+ sema hores+ e$ents+ timers+ xed?$aria"le length =ueues+ and asyn-chronoussignals' :ther features include ser and Su er$isor modes+ and an E$ent logger'

    P:SI> style signals timers+ sema hores and messagesF and extensions for Threads aresu orted' E$ent dri$en o erations are facilitated "y allo7ing tas4s to simultaneously 7ait fore$ents+ timers+ =ueues and sema hores' Mutual exclusion sema hores 7ith the riorityinheritance and riority ceiling rotocol are im lemented' S:System . ro$ides A*IN#

    =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?@&Nrotocol+ RPC+ N-Solaris 7or4stations'

    3.5.4.1 Performance

    &$erage latency ('1 microseconds+ maximum latency .', microseconds on a ))M8DPen-tium machine .. '

    3.5.5 Summary

    This =uic4 re$ie7 demonstrates that commercial real-time o erating systems are full-featuredo erating systems that ro$ide a host of ser$ices 7hich em hasiDe time and memory e ciency andra id and deterministic e$ent res onse' The ma or commercial roducts outlined a"o$e ha$e "eenim 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 29ersion ')')+ )) -( -((T(/.(

    http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page63http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page63http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page63
  • 8/13/2019 Linux Report

    34/111

    Cha ter 0

    &n Introduction to Real-Time Linux

    4.1 8istory and

  • 8/13/2019 Linux Report

    35/111

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

    using gcc' The early $ersions madeextensi$e use of the aging architecture of the Intel .,2 rocessor+ seemingly limiting Linux tothat CP family' These limitations ha$e "een rogressi$ely remo$ed o$er the last decade+ and

    http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page74http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page74http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page74http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page74
  • 8/13/2019 Linux Report

    36/111

    no7 standard Linux can execute on fteen di erent rocessor families ranging from I*MHsDSeries 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 LinusTor$alds re=uest+ the focus of all the entries 7as the enguin and Linus nally chose theimage in

  • 8/13/2019 Linux Report

    37/111

    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 decisionma4ers 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 $ersionse'g' (')'x+ ' 'x are sta"le releases' :dd-num"ered $ersions are de$elo er releases thatare contin-ually ha$ing features added to the "ase 4ernel'

    9ersion Range Period)') O )'11 :cto"er (11( O March (110(')') O ('.'()) March (110 O May (112

    ')') O ')'.1 Bune (112 O Banuary ))(

    '(') O '('( 1Se tem"er (112 O No$em"er(11,

    ' ') O ' 'Banuary (111 O Se tem"er

    ))'.') O '.'11 May (111 O May )))'0') O '0'(1 Banuary ))( O &ugust ))

    '/') O '/'/)No$em"er ))( O #ecem"er

    ))'2') O 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 the7orld' ltimately+ 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 fordo7nload from 4ernel'org ( 0 ' There are also un-o cial source-code atches to the4ernel that $arious de-$elo ers ma4e a$aila"le so that eo le 7ho 7ant to incor orate theo ered functionality can do so "y modifying their o7n co y of the 4ernel source code usingthe atch rogram and the source-code atches' :ne exam le of atches that made their7ay into the 4ernel'org distri"ution is code contri"uted "y Ro"ert Lo$e that reduced theinterru t latency to less than ( millisecond , ' These modi cations 7ere rst madea$aila"le in #ecem"er ))( as atches against 4ernel $ersion '0'(3' Then in

  • 8/13/2019 Linux Report

    38/111

  • 8/13/2019 Linux Report

    39/111

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

    latency and itter 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 inthese cases+ one of the real-time Linux distri"utions 7ill "e used in the em"eddeda 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 sectionsare referred to as to -half and "ottom-half tas4s' The "ottom-half tas4 is the interru thandler and reads data from the hysical de$ice into a memory "u er' The to -half tas4reads from the memory "u er and asses the data to a 4ernel accessi"le "u er' In thestandard 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' Thetimer resolution can "e im ro$ed "y recom iling the standard 4ernel using a di erent timerdi$isor+ "ut e$en 7ith the im ro$ed latency of one millisecond in $ersion '/'0 there is notmuch oint in much higher timer resolution'

    &ll $ariants of real-time Linux ha$e introduced modi cations at the 4ernel le$el' Theresult of these modi cations is to reduce "oth the interru t latency and itter "et7een

    eriodic interru ts to the microsecond range+ allo7ing for faster res onse to externale$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 riority4ernel rocesses can reem t lo7er riority rocesses and gain access to neededresources' This in$ol$es changing the standard de$ice-dri$er interru t-handler so thathigher- riority interru ts are not "loc4ed for ar"itrary amounts of time 7hile a lo7er- riorityinterru t handler com letes its tas4'

    Starting 7ith Linux $ersion '/'0+ the standard 4ernel incor orates reem tion logic assho7n in

  • 8/13/2019 Linux Report

    40/111

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

  • 8/13/2019 Linux Report

    41/111

  • 8/13/2019 Linux Report

    42/111

  • 8/13/2019 Linux Report

    43/111

    ro$ide li"raries that together im lement the P:SI> real-time extensions+ there"y creating asystem that conforms to the IEEE ()).'(d standard' In contrast to the micro-4ernel strategythere is no second 4ernel in this a roach' The atches are made directly to the standard4ernel to im lement the timers+ signals+ sema hores+ rocess memory loc4ing+ sharedmemory+ riority scheduling+ synchroniDed and asynchroniDed I?: s eci ed in IEEE ()).'(d'

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

  • 8/13/2019 Linux Report

    44/111

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

    T7o di erent a roaches are currently a$aila"le!-

    ; RT The ;ansas ni$ersity Real-Time Linux ; RTF distri"ution started out as a ro ectto im lement the timer enhancements s eci ed in IEEE ()).'(d' @hile the current; RT release contains the high-resolution timers and real-time schedulingim ro$ements+ it does not claim adherence to IEEE ()).'(d'

    TimeSys Linux TimeSys 7as the distri"utor of the CM Resource ;ernel a roach descri"edin Section 0' ' '0 ' The Resource ;ernel a roach ro$ided many useful ca a"ilities "utdid 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 tothe standard 4ernel . ' In addition to ma4ing the standard 4ernel reem ta"le+ themod-i cations include a 4ernel scheduler that ro$ides scheduling for the "ottom-half4ernel interru t rocessing and for interru ts themsel$es' This architecture isde icted in

  • 8/13/2019 Linux Report

    45/111

  • 8/13/2019 Linux Report

    46/111

  • 8/13/2019 Linux Report

    47/111

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

  • 8/13/2019 Linux Report

    48/111

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

    4.3.2 Periodic Bitter

    Periodic itter as sho7n in

  • 8/13/2019 Linux Report

    49/111

  • 8/13/2019 Linux Report

    50/111

  • 8/13/2019 Linux Report

    51/111

  • 8/13/2019 Linux Report

    52/111

    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 othereri heral de$ices erforming #irect Memory &ccess #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 "ythe a$ors of real-time Linux' It is in the commercial interest of CP "oard manufacturers to "ea"le to o er at least one real-time o erating system that 7ill o erate on their hard7are straightout of the "ox' E=ually+ the commercial interests of RT:S roducers are 7ell ser$ed "y "einga"le to o er their roduct on a 7ide range of CP s and CP ?"oard com"inations' Real-timeLinux is "ecoming more attracti$e to "oard manufacturers+ so much so that se$eral o er real-time 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 inCha ter 3+ and su ort agreements may "e entered into directly 7ith those com anies' Ingeneral+ technical su ort for o en-source real-time Linux $arieties is more limited than forcommercial RT:S roducts'

    &n ad$antage of the o en-source model is that it is ossi"le for the user to im lementstrategies for further im ro$ing erformance "y modifying the code in the interru t handler+li4e olling the time-stam counter re orted in 12 ' Techni=ues such as this "ring timinguncertainties 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 itter to commercial real-time o erating systems+ that is+ latency and itter in the order ofmicroseconds for rocessors running at a cloc4 rate of ())s of M8D'

    & lication Latency?Bitter #e$' Sys' Royalty

    Standard :?SNon RealTime

    ()) micro to ())milliseconds /)) ())

    Standard Linux Soft Real Time ( millisecond ) )IEEE ()).'(dLinux

    8ard RealTime () to ()) microseconds

    ) to)+))) )

    Real-Time Linux8ard RealTime ( to () microseconds ) )

    RT:S ;ernels8ard RealTime ( to () microseconds ()+))) ())

    Ta"le 0' ! Linux Performance Com arison

    Ta"le 0' summariDes the relati$e erformance and costs of a cross-section of o eratingsystems' 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

    http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page39http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page39http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page39
  • 8/13/2019 Linux Report

    53/111

  • 8/13/2019 Linux Report

    54/111

    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 thecost 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 cyclecost of a real-time or em"edded system' Thus+ Ta"le 0' should not "y itself "e used toma4e decisions on 7hich ty e of o erating system to de loy' 8o7e$er+ the attracti$enessof free+ o en-source soft7are for long term extensi"ility and maintaina"ility of soft7aresystems 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 0)9ersion ')')+ )) -( -((T(/.(

    http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page39http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page39http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page39
  • 8/13/2019 Linux Report

    55/111

  • 8/13/2019 Linux Report

    56/111

    Introduction to Linux for Real-Time Control & lication Case Studies

  • 8/13/2019 Linux Report

    57/111

  • 8/13/2019 Linux Report

    58/111

  • 8/13/2019 Linux Report

    59/111

  • 8/13/2019 Linux Report

    60/111

  • 8/13/2019 Linux Report

    61/111

  • 8/13/2019 Linux Report

    62/111

  • 8/13/2019 Linux Report

    63/111

  • 8/13/2019 Linux Report

    64/111

    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 ofthe inter$al' This 7ill induce more drift in the roll and itch directions as 7ell as theothersF+ 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 $elocity ser$o control is done in the am li ersF+ itdoes a ect 4inematic delity'

    The system 7as "ased on the PC?()0 form factor 7ith a lo7- o7er Geode Pentium-com 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 massstorage' The gra hics system consisted of a serial touch screen on an ,))x2))- ixeldis 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?:' Thesedri$ers are re=uired due to the restriction against calling standard Linux de$ice dri$ers inreal-time code+ as discussed in Section 2'(' '

    5.2 :ther Exam les of Real-Time Linux & lications

    5.2.1 #ata &c=uisition

    5.2.1.1 &ir"orne Scanning Radar &ltimeter

    The Linux-"ased data system for the &ir"orne Scanning Radar &ltimeter SR&F ro ect

    (.( 7as "egun in (11, at the N&S& Goddard S ace

  • 8/13/2019 Linux Report

    65/111

    Introduction to Linux for Real-Time Control & lication Case Studies

    The recei$er is "ased on the arlin4 Semiconductor GP ) ( ( -channel GPS correlator'The monolithic #:S $ersion of the GPS architect code structure 7as redesigned and orted toRTLinux running on a 0)) M8D Pentium rocessor' The GPS architect code 7as artitionedinto t7o sections+ the a lication code in 4ernel s ace and the user interface code in users ace' The a lication code consists of $e eriodic threads to calculate the na$igationsolution+ an ISR and a

  • 8/13/2019 Linux Report

    66/111

    Introduction to Linux for Real-Time Control & lication Case Studies

    lin4+ and the la"oratory L&N' ltracam is the result of a oint e ort "y the ; &stron-omyTechnology Centre in Edin"urgh+ ni$ersity of She eld+ She eld+ ;+ and ni$ersity ofSoutham ton+ Southam ton+ ;' This instrument 7as commissioned+ in Se tem"er )) +on the @illiam 8erschel Telesco e on La Palma'

    5.2.2 Control & lications

    5.2.2.1 Machine Tool Control

    i&rte is a real time soft7are en$ironment for the de$elo ment of industrial rocess controland machine control a lications using RT&I Linux / ' It 7as de$elo ed as a graduate thesisin ))) at the Engineering #e artment of *rescia ni$ersity' The industrial rocess controlfunctions are realiDed using the familiar Programma"le Logic Control PLCF structure' Themachine 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 andmar"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 8PCSF culminates (/years and many generations of animatronic control-system de$elo ment ()3 ' RTLinux isat the heart of the current system+ de$elo ed in (11,?11+ synchroniDing $ideo-frame tra c7ith 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 to match 2) frames er second $ideoF' The 8enson de$elo erscommissioned

  • 8/13/2019 Linux Report

    67/111

    Introduction to Linux for Real-Time Control & lication Case Studies

    and real-time rocesses is $ia the+ then+ RTLinux

  • 8/13/2019 Linux Report

    68/111

    Cha ter 2

    Real-Time Linux Im lementationConsiderations

    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 nix and Linux

    Su ort for s eci c hard7are to "e used

    #e$elo ment en$ironments

    &$aila"ility of technical su ort and consulting if

    needed Total life-cycle costsThe GN Pu"lic Licence

    This cha ter 7ill touch on se$eral of these issues'

    6.1 #e$elo ment En$ironment

    @hile Integrated #e$elo ment En$ironments for standard Linux+ such as the multi-language Ecli se .( and B*uilder for the Ba$a 7orld ( , are "ecoming more common+the usual de$elo ment en$ironment is the >(( 7indo7ing system in 7hich the userde$elo s code 7ith the GN tool chain featuring the gcc com iler 21 '

    &s for standard Linux+ the common mode for real-time Linux code de$elo ers is to use theGN tool chain along 7ith their fa$orite editor to create and test code' The im lementationlanguage 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$edfrom 4ernel s ace "y user-s ace commands' Thus the real-time code can "e de$elo ed andtested 7ithout re"ooting the machine hosting the de$elo ment and execution'

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

    http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page74http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page74http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page74http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page74http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70
  • 8/13/2019 Linux Report

    69/111

    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 thecontroller 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 discrete-time controller' This controller and system can "e simulated in a gra hical en$ironment suchas Simulin4 ,/ or La"9ie7 (1 + 30 to $alidate the "asic o eration of the controller'

    ltimately+ the controller de$elo ed in the gra hical en$ironment must "e im lemented on thetarget hard7are' The follo7ing material discusses tools to achie$e that goal'

    nited Electronic Industries o ers a Po7er#&A La"9IE@ for Linux 2. 7hich allo7sdesign 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 20 '

    Auality Real Time Systems o ers Real Time Linux Target+ a Simulin4 "ased gra hicaldesign en$ironment for design of real-time control systems (). ' The design latformmust "e running Simulin4' The out ut from RTLT is com iled C code that is executa"le ona RTLinux system'

    :ne o en-source ro ect+ RTiC-La" 0 + is de$elo ing a gra hical en$ironment fordesigning real-time controllers' Those controllers can "e im lemented in the RTLinux orthe RT&I a$ors of real-time Linux'

    Scicos (() is a gra hical+ dynamic-systems modeler and simulator that is "uilt on to of thematrix 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 ((0 '

    6.1.2 #e$elo ment Considerations6.1.2.1 ;ernel S ace Tas4s

    Real-time tas4s that are created to ex licitly run in 4ernel s ace+ ty ically as a loada"le4ernel 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 serialorts+ Ethernet cards and other de$ices 7ith entries in the ?de$ directory cannot "e made

    7ith the nix o en F 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 ustmentioned+ as 7ell as many de$ices common to industrial automation or scienti ccom uting such as C&N *us and data ac=uisition "oards'

    System 4ernel resources also may not "e used directly' These include dis4 les normallyaccessed 7ith fo en F+ hea memory allocation and deallocation 7ith malloc F?free F andne7?delete+ console rinting $ia rintf F and traditional nix inter rocess communicationmechanisms such as i es+ shared memory+ sema hores and message =ueues' 8o7e$er+real-time Linux ro$ides su"stitutes for many of these' rintf F is im lemented using sim le

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

    http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page71http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page71http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page71http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page71http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page70http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page68http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page73
  • 8/13/2019 Linux Report

    70/111

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

    re lacements li4e rtlU rintf F RTLinuxF or rtU rint4 F RT&IF that direct out ut to sys-tem logles such as ?$ar?log?messages' Shared memory and rst-in- rst-out

  • 8/13/2019 Linux Report

    71/111

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

    6.2 Im lementation Considerations

    6.2.1 Su orting 8ard7are Interfaces for Machine Control

    Se$eral choices of hard7are interface cards 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 acommodity I&. architecture PC' Such cards include+ for exam le+ analog-digitalcon$erters+ digital-analog con-$erters+ shaft-encoder =uadrature counters+ and ulse-7idthmodulation am li ers' Se$eral of these card manufacturers ex licitly su ort Linux andreal-time Linux "y ro$iding dri$ers for their roducts ()3 ' Nonetheless+ the nature ofreal-time control is such that the im lementor of the control system may 7ell need tode$elo the lo7est-le$el dri$ers to access the interface at the register le$el'

    The Control and Measurement #e$ice Interface+ Comedi ((2 + is an o en sourcero ect 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 "othuser s ace and real timeF that ro$ide a common user interface to the Comedi de$icedri$ers (), ' 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-timeo erating-system soft7are 7ill need to "e ta4en into consideration' &c=uisition costs includede$elo ment licenses and royalty ayments or recurring costs er de loyed system' & ma orconsideration should "e the a$aila"ility and cost of the technical engineering and a licationle$el assistance ro$ided 7ith the o erating system' Issues of sta training+ a lication soft7aredesign+ im lementation+ test and de"ug are signi cant' ltimately+ the de loyed a licationmust "e maintaina"le 7hen defects surface and extensi"le 7hen the re=uirements change andenhancements are made necessary under tight schedules' /3 '

    6.2.3 Su ort Considerations

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

    6.2.4 Net7or4ing and

  • 8/13/2019 Linux Report

    72/111

    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' & similarsituation exists for le systems' Since Linux ournaling and non- ournaling le systems+

    & le+ Microsoft+ and R&M-"ased le systems are also freely a$aila"le for the standardLinux 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 GN Pu"lic License 7as outlined in Section 0'( ' GPL ro$ides that any soft7arederi$ed from a 7or4 co$ered "y the GPL must "e distri"uted under the GPL' The o erati$e7ord is Jderi$edK' So any soft7are that is created from scratch 7ithout using any GPL codecan "e distri"uted under the ro$isions of any license' Such distri"ution may "e accom anied"y GPL code /1 ' Many com anies are adding $alue and code to the GPL code "ase 7hilecreating their o7n ro rietary code from scratch and distri"uting that code as "inary li"rariesalong 7ith source distri"ution of GPL code' Exam les of com anies that ursue this "usinessmodel include

  • 8/13/2019 Linux Report

    73/111

    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 a-rated into t7o sections+ o en source and commercial+ and al ha"etically organiDed 7ithinthese sections' The characteristics and functionality of each distri"ution is descri"ed usinga ta"ular format' E$ery e ort has "een made to ensure the accuracy of this information atthe time of 7riting' 8o7e$er+ as ects 7ill change o$er time' Inaccuracies should "ere orted as er Page of this document'

    : en-source distri"utions ro$ide the source code and "uild scri ts so the user canunder-stand+ modify+ and "uild the code if desired' There are no royalty fees for use of thecode' Since o en-source ro ects are de$elo ed "y a loose 4nit community of de$elo ers7hose focus is generally on code de$elo ment+ documentation may "e s arse andtechnical su ort non-existent' :n the other hand+ these systems ha$e "een the "asis ofmany successful a lications+ as discussed a"o$e+ and the a"ility to 7or4 7ith sourcecode o ers su"stantial ad$antages for so histicated users' Intellectual ro erty issuesdiscussed 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-sourcedistri"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 thesoft7are along 7ith su ort and documentation'

    7.1 : en-Source #istri"utions of Real-Time Modi ca-tions toLinux

    Entries are ordered al ha"etically "y the name of the distri"uting organiDation'

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

    http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page27http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page27http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page54http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page54http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page27http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page54
  • 8/13/2019 Linux Report

    74/111

    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 generalur 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 systemscould "e real-time or non-real time' The E:S system does not im lement a real-timeo erating system+ "ut ro$ides the mechanism "y 7hich interru ts can "e assed to a real-time o erating system at the highest ossi"le riority' The same interru ts may "e assed onto 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 anI&. PC system and the $ersion '0'(, standard Linux 4ernel'

    The RT&I de$elo ers are 7or4ing to7ards re lacing their micro-4ernel architecture 7iththe E:S a roach' This in$ol$es designing and im lementing a RT:S that 7ill sit onto of the E:S nano 4ernel'

    Item Criteria Comments(' Product Name E:S

    ' Standard ;ernel '0'(,.' Real-Time ;ernel 9ersion E:S m0' Su orted 8?@ I&./' & lications2' Qears in se )) O3' Multi rocessor Su ort Qes,' Real-Time Mechanism nano-4ernel

    1' Inter-;ernelCommunication Not needed'()' P:SI> Com liance No real-time P:SI> com liance'((' #e$elo ment En$ironment Gnu Tool Chain( ' Performance E$aluation(.' #istri"utor @e"site #o7nload E:S ()) '(0' Product Su ort @e" site

  • 8/13/2019 Linux Report

    75/111

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

  • 8/13/2019 Linux Report

    76/111

    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+ ; RT does notclaim com liance 7ith the ()).'(d standard'

    Ite

    m Criteria Comments(' Product Name ; RT' Standard ;ernel Linux! '0'(,

    .' Real-Time ;ernel 9ersion ; RT $ '. *eta0' Su orted 8?@ i.,2 any I&. 7ith TSCF/' & lications &TM net7or4 simulations 00 '2' Qears in se (113O3' Multi rocessor Su ort No,' Real-Time Mechanism P:SI> timers and scheduling'

    1'Inter-;ernelCommunication :nly one 4ernel'

    ()' P:SI> Com liance No((' #e$elo ment En$ironment Gnu tool chain'( ' Performance E$aluation ()s of microseconds of latency and itter (.' #istri"utor @e"site ;ansas ni$ersity ( 3 (0' Product Su ort @e" site

  • 8/13/2019 Linux Report

    77/111

    Communication()' P:SI> Com liance No

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

  • 8/13/2019 Linux Report

    78/111

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

    Item Criteria Comments((' #e$elo ment En$ironment Gnu tool chain( ' Performance E$aluation () microseconds latency and itter

    (.' #istri"utor @e"site #i artimento di Ingegneria &eros aDiale - PolitecnicodiMilano 1

    (0' Product Su ort @e" Site Com liance ())('(. PSE/(((' #e$elo ment En$ironment Gnu tool chain( ' Performance E$aluation () microseconds latency and itter (.' #istri"utor @e"site

  • 8/13/2019 Linux Report

    79/111

  • 8/13/2019 Linux Report

    80/111

    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 LinuxGPL' 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 thatadd timers+ eriodic tas4s+ CP and net7or4 reser$ation mechanisms are licensed forsingle-user de$elo ment of real-time code'

    Item Criteria Comments(' Product Name TimeSys Linux GPL

    ' Standard ;ernel '0'3.' Real-Time ;ernel 9ersion .-(

    0' Su orted 8?@ &RM+ MIPS+ Pentium+ Po7erPC+ SP&RC+ Su er 8+>S-

    cale/' & lications2' Qears in se (11,O3' Multi rocessor Su ort Qes,' Real-Time Mechanism Preem ta"le ;ernel

    1'Inter-;ernelCommunication Trans arent to real-time a lication

    ()' P:SI> Com liance Real-time extensions+ IEEE ()).'(d-(111((' #e$elo ment En$ironment G I I#E( ' Performance E$aluation ()) microseconds of latency and itter (.' #istri"utor @e"site TimeSys Cor oration' .

    (0' Product Su ort@e" Site

  • 8/13/2019 Linux Report

    81/111

    to resell Monta9istaHs 8ard8at Linux as their o7n Red8a74 4ernel'NIST! Intelligent Systems #i$ision /1

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

  • 8/13/2019 Linux Report

    82/111

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

    Item Criteria Comments(' Product Name Red8a74 Linux

    ' Su orted 8?@ Concurrent i8a74 ,2) Intel-"ased multi rocessors

    .' Real-Time Mechanism ;ernel reem tion enhancements

    0'#e$elo mentEn$ironment

    G I de$elo ment tools+ Source-le$el #e"ugger+E$ent

    &nalyDer+ G I interface to the Red8a74 Linuxfre=uency-"ased scheduler+ #ata Monitor tools (3 '

    /' #istri"utor @e"site Concurrent Com uter Cor oration (3 (, '

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

    7.2.2

  • 8/13/2019 Linux Report

    83/111

    em"edded soft7are de$elo ers' Bim ReadyHs goal 7ith Monta9ista is Jto ta4e Linux 7here9RT> 7ent+ generating income from su ort and su"scri tions+ not from royaltiesK ()0 '

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

    http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72
  • 8/13/2019 Linux Report

    84/111

  • 8/13/2019 Linux Report

    85/111

    /' #istri"utor @e"site RE#ICE-Linux ()/

    Ta"le 3'()! RE#ICE Linux! Real-Time LinuxNIST! Intelligent Systems #i$ision 2(

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

    http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page72
  • 8/13/2019 Linux Report

    86/111

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

    7.2.6 Synergy Microsystems Inc'

    Synergy Microsystems ,1 rimarily manufactures single "oard com uters 7ith "othgeneral- ur ose CP s and #SP chi sets' They su ort RTLinux as the o erating system

    on their Po7erPC single-"oard com uters'Item Criteria Comments(' Product Name Linux SMP

    ' Su orted 8?@ Po7erPC.' Real-Time Mechanism RTLinux micro 4ernel

    0'#e$elo mentEn$ironment GN Tool Chain

    /' #istri"utor @e"site Synergy Micro Systems 1)

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

    7.2.7 TimeSys Cor oration

    The original de$elo ment of the current TimeSys roduct o ering 7as erformed atCarnegie Mellon ni$ersity ( / '

    The roduct "uilds on an o en-source reem ta"le 4ernel com onent and adds threero 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+ 7ithguaranteed access to CP resources+ and 7ith guaranteed access to net7or4 resources'

    Item Criteria Comments(' Product Name TimeSys Linux?RealTime+ TimeSys Linux?Net+

    TimeSys Linux?CP' Su orted 8?@ PPC+ x,2+ MIPS+ >scale+ &RM+ Strong&RM+ ltra-

    SP&RC+ Su er 8'.' Real-Time Mechanism Preem ta"le ;ernel'

    0'#e$elo mentEn$ironment Tools and S#;Hs ( '

    /' #istri"utor @e"site TimeSys Cor oration ) ' #o7nloads . '

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

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

    http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page71http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page71http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page71http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page71http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page71http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page71http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page74http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page74http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page74http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page71http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page71http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page74http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page67
  • 8/13/2019 Linux Report

    87/111

    & 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' Thelist of real-time o erating systems gi$en in Ta"le &'( is resented in al ha"etical order'

    : erating systemname Manufacturer

    &rx RT:S Seoul National ni$ersity &$SQS &$ocet Systems CM> RT:S CM> Systems Chorus Baluna S'&' ER:S Penn 8armony National Research Council Integrity Green 8ills Soft7are iRM> Ten&sys Lynx:S Lynux7or4s Maruti ni$ersity of Maryland Nucleus Mentor Gra hics :S-1 Micro7are

    :nCore :S :nCore SystemsCor oration

    :n Time RT:S-. :n Time :SE RT:S ENE& P#:S EQRING cor oration S:System . @ind Ri$er AN> Neutrino RT:S AN> Soft7are Systems Ltd Precise?MA> RT:S &RC International Real Time Mach CM RE&L?I> P> Modcom RTM> :?S RTM> Incor orated SM> RT:S Micro #igital Inc' S ring Pro ect Mass+ &mherst S M: Lancaster ni$ersity Thread> Green 8ills Soft7are TS>-. S % 8 Com uter Systems 9RT> Mentor Gra hics 9x@or4s @ind Ri$er @indo7s CE 'NET Microsoft

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

    http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page63http://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page63http://arx.snu.ac.kr/html/overview-arx.en.htmlhttp://arx.snu.ac.kr/html/overview-arx.en.htmlhttp://arx.snu.ac.kr/html/overview-arx.en.htmlhttp://www.avocetsystems.com/company/techshee/asheets/avsys.htmlhttp://www.avocetsystems.com/company/techshee/asheets/avsys.htmlhttp://www.avocetsystems.com/company/techshee/asheets/avsys.htmlhttp://www.cmx.com/http://www.cmx.com/http://www.cmx.com/http://www.jaluna.com/http://www.jaluna.com/http://www.jaluna.com/http://www.cis.upenn.edu/~eros/http://www.cis.upenn.edu/~eros/http://www.cis.upenn.edu/~eros/http://wwwsel.iit.nrc.ca/projects/harmony/http://wwwsel.iit.nrc.ca/projects/harmony/http://wwwsel.iit.nrc.ca/projects/harmony/http://www.ghs.com/products/rtos/integrity.htmlhttp://www.ghs.com/products/rtos/integrity.htmlhttp://www.ghs.com/products/rtos/integrity.htmlhttp://www.tenasys.com/http://www.tenasys.com/http://www.tenasys.com/http://www.lynx.com/http://www.lynx.com/http://www.lynx.com/http://www.cs.umd.edu/projects/maruti/http://www.cs.umd.edu/projects/maruti/http://www.cs.umd.edu/projects/maruti/http://www.acceleratedtechnology.com/http://www.acceleratedtechnology.com/http://www.acceleratedtechnology.com/http://www.microware.com/oem_products/op-os9.cfm?MS=Microware%20Enhanced%20OS-9%20Solutionhttp://www.microware.com/oem_products/op-os9.cfm?MS=Microware%20Enhanced%20OS-9%20Solutionhttp://www.microware.com/oem_products/op-os9.cfm?MS=Microware%20Enhanced%20OS-9%20Solutionhttp://www.oncoresystems.com/http://www.oncoresystems.com/http://www.oncoresystems.com/http://www.on-time.com/http://www.on-time.com/http://www.on-time.com/http://www.enea.com/solutions/products/rtos/rtos.jsphttp://www.enea.com/solutions/products/rtos/rtos.jsphttp://www.enea.com/solutions/products/rtos/rtos.jsphttp://www.eyring.com/pdos/http://www.eyring.com/pdos/http://www.eyring.com/pdos/http://www.windriver.com/products/psosystem_3/index.htmlhttp://www.windriver.com/products/psosystem_3/index.htmlhttp://www.windriver.com/products/psosystem_3/index.htmlhttp://www.qnx.com/resource/http://www.qnx.com/resource/http://www.qnx.com/resource/http://www.psti.com/ARC/index.htmlhttp://www.psti.com/ARC/index.htmlhttp://www.psti.com/ARC/index.htmlhttp://www-2.cs.cmu.edu/afs/cs/project/art-6/www/overview.htmlhttp://www-2.cs.cmu.edu/afs/cs/project/art-6/www/overview.htmlhttp://www-2.cs.cmu.edu/afs/cs/project/art-6/www/overview.htmlhttp://www.modcomp.com/realtime/products/descriptions/8272.htmlhttp://www.modcomp.com/realtime/products/descriptions/8272.htmlhttp://www.modcomp.com/realtime/products/descriptions/8272.htmlhttp://www.rtmx.com/http://www.rtmx.com/http://www.rtmx.com/http://www.smxinfo.com/http://www.smxinfo.com/http://www.smxinfo.com/http://none.cs.umass.edu/spring/arch.htmlhttp://none.cs.umass.edu/spring/arch.htmlhttp://none.cs.umass.edu/spring/arch.htmlhttp://www.comp.lancs.ac.uk/computing/research/sumo/sumo.htmlhttp://www.comp.lancs.ac.uk/computing/research/sumo/sumo.htmlhttp://www.comp.lancs.ac.uk/computing/research/sumo/sumo.htmlhttp://www.ghs.com/products/rtos/threadx.htmlhttp://www.ghs.com/products/rtos/threadx.htmlhttp://www.ghs.com/products/rtos/threadx.htmlhttp://sandh.com/tsx32.htmhttp://sandh.com/tsx32.htmhttp://sandh.com/tsx32.htmhttp://www.mentor.com/embedded/brochures/vrtx.htmlhttp://www.mentor.com/embedded/brochures/vrtx.htmlhttp://www.mentor.com/embedded/brochures/vrtx.htmlhttp://www.windriver.com/products/vxworks5/index.htmlhttp://www.windriver.com/products/vxworks5/index.htmlhttp://www.windriver.com/products/vxworks5/index.htmlhttp://www.microsoft.com/windows/embedded/ce.net/default.aspahttp://www.microsoft.com/windows/embedded/ce.net/default.aspahttp://www.microsoft.com/windows/embedded/ce.net/default.aspahttp://var/www/apps/conversion/tmp/scratch_2/HYPERLINK%23page63http://arx.snu.ac.kr/html/overview-arx.en.htmlhttp://www.avocetsystems.com/company/techshee/asheets/avsys.htmlhttp://www.cmx.com/http://www.jaluna.com/http://www.cis.upenn.edu/~eros/http://wwwsel.iit.nrc.ca/projects/harmony/http://www.ghs.com/products/rtos/integrity.htmlhttp://www.tenasys.com/http://www.lynx.com/http://www.cs.umd.edu/pro