vxworks and embedded linux.ppt

Embed Size (px)

Citation preview

  • 8/9/2019 vxworks and embedded linux.ppt

    1/26

    VxWorksVxWorks

    1

  • 8/9/2019 vxworks and embedded linux.ppt

    2/26

    2

    Topics CoveredTopics Covered

    What is Real Time Operating System (RTOS)

    Standard for RTOS

    VxWorks Features as RTOS

    Layer Struture

    !irokernal Funtions"

    !ultitasking

    Sheduling

    #nterrupt Ser$ie %ode

    Shared %ode and Reentrany

    #ntertask %ommuniations

    &ppliations for VxWorks

  • 8/9/2019 vxworks and embedded linux.ppt

    3/26

    3

    What is Real Time OS (RTOS)What is Real Time OS (RTOS)

    RTOS Characteristics

    'roessing must e done ithin a time onstraint or thesystem ill fail*

    &ll delays in the system ill e ounded+ from the retrie$al of

    stored data to the time RTOS finishes the re,uest*

    Types of RTOS

    -ard RTOS

    Soft RTOS

  • 8/9/2019 vxworks and embedded linux.ppt

    4/26

    4

    Standard for RTOSStandard for RTOS

    Standard re,uirement for RTOS

    'OS#. /001*/ y #SO2#333 hapter*

    &synhronous #2O

    Semaphore

    !essage ,ueues

    4ueued signals

    Sheduling %loks and timers

    !emory management

    'OS#. interfaes"

  • 8/9/2019 vxworks and embedded linux.ppt

    5/26

    5

    Layer StructureLayer Structure

    Real5Time 3medded &ppliation

    6raphis !ultiproessing #nternet

    7a$a Support 'OS#. Lirary File System

    Wind8et 8etorking

    Wind Microkernal%ore OS"

  • 8/9/2019 vxworks and embedded linux.ppt

    6/26

  • 8/9/2019 vxworks and embedded linux.ppt

    7/26

    7

    Schedulin!" One C#$Schedulin!" One C#$

    'riority5ased preempti$e sheduling

    3ah task has priority (from 0 5 highest to ABB 5loest)* 3ah priority has its on ,ueue*

    #f to tasks are in the ready state< a loer priority taskould e pre5empted y one of a higher priority*

    Round5roin sheduling

    &fter time slie for a task expires< another task ith the

    same priority ill exeute during the gi$en time slie*

    'reemption loks

    These loks pre$ent task ontext sithing< ut do notpre$ent interrupt handling*

  • 8/9/2019 vxworks and embedded linux.ppt

    8/26

    8

    %nterrupt Service Code%nterrupt Service Code

    Via interrupts< the system is informed of externale$ents*

    #nterrupt Ser$ie Routines (#SRs) run outside anytask ontext*

    #nterrupt handling in$ol$es no task ontext sith*

    Limitations of #SR"

    &ll #SRs share the same stak

    #SR has no ontext that an e suspended

    %annot take the semaphore< ut an gi$e thesemaphores< releasing any task aiting on them*

    %annot perform #2O through dri$ers exept pipe*

  • 8/9/2019 vxworks and embedded linux.ppt

    9/26

    9

    Shared Code and ReentrancyShared Code and Reentrancy

    Shared Code5 a single opy of ode exeuted y multipletasks*

    Shared %ode must e reentrant* & suroutine is reentrant if asingle opy of the routine an e alled simultaneously fromse$eral task ontexts ithout onflit*

    Reentrany Tehni,ues"

    9ynami Stak Variales 6loal and Stati Variales 6uarded y Semaphores

    Task Variales

  • 8/9/2019 vxworks and embedded linux.ppt

    10/26

    10

    Shared Code and Reentrancy" ContinuedShared Code and Reentrancy" Continued

    Task/( )C D**

    omFun(my9ata/)

    E

    TaskA( )C D**

    omFun(my9ataA)

    E

    omFun(your9ata)CE

    my9ata/

    my9ataA

    9ynami Stak Variales

    Tasks Task Staks %ommon Funtion

  • 8/9/2019 vxworks and embedded linux.ppt

    11/26

    11

    Shard Code and Reentrancy" ContinuedShard Code and Reentrancy" Continued

    6uarded 6loal and Stati Variales

    Mutual-exclusionmehanism 5 only one task at a time

    an e in a ritial setion of the ode*

    Task Variales

    Four yte $ariales are added to the task ontextlok (T%@)*

  • 8/9/2019 vxworks and embedded linux.ppt

    12/26

    12

    %ntertask Communications" One C#$%ntertask Communications" One C#$

    Shared 9ata

    !essage 4ueue

    'ipes 5 Virtual #20

    8etork #ntertask %ommuniation

    Sokets

    Remote 'roedure %all

    Types of #ntertask %ommuniations"

  • 8/9/2019 vxworks and embedded linux.ppt

    13/26

    13

    %ntertask Communication" Shared &ata%ntertask Communication" Shared &ata

    &ess Shar9ata

    &ess Shar9ata

    Tasks !emory

    &ess Shar9ata

    Shar9ata

    /*

    A*

    1*

  • 8/9/2019 vxworks and embedded linux.ppt

    14/26

    14

    SemaphoresSemaphores

    Semaphore 5 mehanism for mutual exlusion and intertaskommuniation*

    @inary Semaphore

    Semaphore

    a$ailale

    TimeOut=

    8oWait

    Task ispended fortimeOut

    Task ont*

    Semaphore

    taken

    8O8O 8O

    G3S

    Task ont*

    Semaphore

    not taken

    G3S

  • 8/9/2019 vxworks and embedded linux.ppt

    15/26

    15

    Semaphores" ContinuedSemaphores" Continued

    #s semaphore is gi$en and no tasks areloked< ount >>

    %ounting Semaphore

    3$ery time is semaphore is gi$en ount >>

    3$ery time is semaphore is taken ount 55

    #f ount=0< task that tried to take semaphore is loked #f semaphore is gi$en and task is loked< task isunloked

    Speial Semaphore Option (8ot in 'OS#.)

    Timeout

    Time the task is illing to ait (time in tiks) in pended

    state* #f time H timeout< 3RROR ours*

  • 8/9/2019 vxworks and embedded linux.ppt

    16/26

    16

    %ntertask Communication" essa!e%ntertask Communication" essa!e'ueue'ueue

    &llos a $ariale numer of messages to e ,ueued

    &ny task or #SR an send a message to a ,ueue*

    !ultiple tasks an send and reei$e from the samemessage ,ueue*

    Timeout 'arameter"

    Send message" ho long to ait for uffer spae

    to plae message*

    Reei$e message" ho long to ait to otainmessage*

  • 8/9/2019 vxworks and embedded linux.ppt

    17/26

    17

    pplications for VxWorkspplications for VxWorks

    Flight simulators

    Radio and optial telesopes

    8a$igation systems

    9eep sea instrumentation

    Traffi ontrol systems

    !odems

    D any systems here rigid time re,uirement ha$e eenplaed on the operation of a proessor or the flo of the data*

    Some usage of RTOS

    'rinters

    9igital ameras

    -and5held omputingde$ies

    Routers< sithes< andother netork de$ies

  • 8/9/2019 vxworks and embedded linux.ppt

    18/26

    Commercial m*edded LinuxCommercial m*edded Linux

    +eo,are +eoLinux

    Red -at derived for informationappliances

    #alm#alm Tynux%nternet appliuance and multimedia

    Red -at m*edded Linux

    !eneral purpose em*edded solution

    RedSonic Red.%ce Linux

    runs from &iskonChip orCompact/lash

  • 8/9/2019 vxworks and embedded linux.ppt

    19/26

    Commercial m*edded LinuxCommercial m*edded Linux

    Rid!eRun &S# Linux

    for multimedia" ,ireless" RT on &S#

    TimeSys Linux 0#L

    lo, latency enhanced kernelTuxia TST

    distro tar!ets %nternet appliances

    Vital Systems vLinuxfor R *ased em*edded apps

  • 8/9/2019 vxworks and embedded linux.ppt

    20/26

    Open Source m*edded LinuxOpen Source m*edded Linux

    m*edded &e*ian #ro1ect

    convert &e*ian to an em*edded OS

    TLinux

    for #C234 S5C6s

    uCLinux

    for microprocessors that don6t have

    uLinux (muLinux)distro fits on a sin!le floppy

  • 8/9/2019 vxworks and embedded linux.ppt

    21/26

    Commercial Linux RTOSCommercial Linux RTOS

    /SLa*s . Open RT Linux

    Lineo . m*edix Realtime

    LynuxWorks . 5lueCat RT

    ontaVista Soft,are . Real Timextensions

    R&Sonic . R&%C Linux

    TimeSys . Linux7Real.Time

  • 8/9/2019 vxworks and embedded linux.ppt

    22/26

    Open Source Linux RTOSOpen Source Linux RTOS

    RT Linux . real time extension *ased onRTLinux

    8$RT . event schedules ,ith 23us resolution

    Linux.SRT . for soft real time apps likemultimedia

    'linux . provides 'uality of Service !uarantees

    RT% . 9hard: Real Time pplication %nterface

  • 8/9/2019 vxworks and embedded linux.ppt

    23/26

    RTLinuxRTLinux

    9hard real.time: mini operatin! system

    runs Linux as it6s lo,est priority executionthread

    Linux thread completely preempti*le

    Real time threads and interrupt handlersnever delayed *y non.realtime operations

    Supports user level pro!rammin!

    iniRTL implementation fits on a floppy

  • 8/9/2019 vxworks and embedded linux.ppt

    24/26

    What6s so special a*out Linux;What6s so special a*out Linux;

    ultiple choices vs< sole source

    Source code freely availa*le

    Ro*ust and relia*le

    odular" confi!ura*le" scala*le

    Super* support for net,orkin!and %nternet

    +o runtime licenses

    Lar!e pool of skilled developers

  • 8/9/2019 vxworks and embedded linux.ppt

    25/26

    What6s so special a*out Linux;What6s so special a*out Linux;

  • 8/9/2019 vxworks and embedded linux.ppt

    26/26

    What6s special a*out Open Source;What6s special a*out Open Source;