Io's and Interrupts

download Io's and Interrupts

of 31

Transcript of Io's and Interrupts

  • 8/9/2019 Io's and Interrupts

    1/31

  • 8/9/2019 Io's and Interrupts

    2/31

  • 8/9/2019 Io's and Interrupts

    3/31

    Book reading : Supplementary !!!

    Topics covered in this lecture are from thesetexts.

    !omp. Or". # Arc$itecture%&t$ edition%'tallin"s

    or interrupts ()ele*ant to slides only

    )ead !$apter Top le*el *iew of !omputerunctions%'ection + (su,part Interrupts

    or Input / Output ()ele*ant to slides only

    )ead !$apter Input / Output %section -%+

    'ection % ()ele*ant details related to slidesonly

  • 8/9/2019 Io's and Interrupts

    4/31

    Input/output :I/O

  • 8/9/2019 Io's and Interrupts

    5/31

    Input/output Pro,lems

    0$y I/1s not directly connected

    to system ,us2 Wide variety of peripherals

    Delivering dierent amounts of data

    t dierent speeds n dierent formats

    ll slowerthan "#$ and %&

    'eed () modules

  • 8/9/2019 Io's and Interrupts

    6/31

    Input/Output 3odule

    nterface to "#$ and &emory

    nterface to one or more peripherals

  • 8/9/2019 Io's and Interrupts

    7/31

  • 8/9/2019 Io's and Interrupts

    8/31

    I/O 3odule 'tructure : Dia"ram

  • 8/9/2019 Io's and Interrupts

    9/31

    I/O 3odule unction

    () &odule functioning could +e explained

    +y processor communication. !ommand decodin"

    Data

    'tatus reportin"

    Address )eco"nition

    !ommand decodin" : () module acceptscommands from processor on "ontrol +us,

    0ike read or -rite data.

    Data :Data is exchanged +et-een processor

    and () module over data +us

  • 8/9/2019 Io's and Interrupts

    10/31

    I/O 3odule unction

    () &odule functioning could +e explained

    +y processor communication. "ommand decoding

    Data

    Status reporting

    ddress %ecognition

    'tatus )eportin" : () module are much

    slo-er than "#$ and memory, they had tosend STT$S signals to report their progress.1or 2xample : B$S3 or %2D3 signal to report() status to processor

  • 8/9/2019 Io's and Interrupts

    11/31

    I/O 3odule unction

    () &odule functioning could +e explained

    +y processor communication. "ommand decoding

    Data

    Status reporting

    ddress %ecognition

    Address )eco"nition : () module mustreceive multiple re4uests from processor thus

    () module must recogni5e and decode eachaddress.1or 2xample : fter decoding () -ill identify,send control and data signal to selectedperipheral.

  • 8/9/2019 Io's and Interrupts

    12/31

    I/O 3odule unction

    "ontrol 6 Timing

    "#$ "ommunication

    Device "ommunication Data Buering

    2rror Detection

  • 8/9/2019 Io's and Interrupts

    13/31

    I/O 'teps

    "#$ checks () module device status

    () module returns status f ready, "#$ re4uests data transfer

    () module gets data from device

    () module transfers data to "#$

    7ariations for output

    Direct "#$ ccess

    Direct &emory ccess

  • 8/9/2019 Io's and Interrupts

    14/31

    !P6 7iewpoint

    ssue read command

    Do ot$er work "heck for interrupt at end of each

    instruction cycle

    f interrupted:8

    Save context registers/

    #rocess interrupt 1etch data 6 store

    I f i I/O #

  • 8/9/2019 Io's and Interrupts

    15/31

    Interfacin" I/O # processors :

  • 8/9/2019 Io's and Interrupts

    16/31

    9+!A

  • 8/9/2019 Io's and Interrupts

    17/31

    Interrupts

    I t t

  • 8/9/2019 Io's and Interrupts

    18/31

    Interrupts

    &echanism +y -hich other modules e.g. ()/

    may interrupt normal se4uence of processing #rogram

    e.g. over9o-, division +y 5ero

    Timer

    enerated +y internal processor timer

    $sed in pre8emptive multi8tasking

    ()

    from () controller

    *ard-are failure

    e.g. memory parity error

  • 8/9/2019 Io's and Interrupts

    19/31

    Interrupts

    P l ! t l

  • 8/9/2019 Io's and Interrupts

    20/31

    Pro"ram low !ontrol

    'imple Interrupt Processin"

  • 8/9/2019 Io's and Interrupts

    21/31

    'imple Interrupt Processin"

    I t t ! l

  • 8/9/2019 Io's and Interrupts

    22/31

    Interrupt !ycle

    dded to instruction cycle

    #rocessor checks for interrupt ndicated +y an interrupt signal

    f no interrupt, fetch next instruction f interrupt pending:

    Suspend execution of current program

    Save context

    Set #" to start address of interrupt handler routine #rocess interrupt

    %estore context and continue interrupted program

  • 8/9/2019 Io's and Interrupts

    23/31

    Interrupts

  • 8/9/2019 Io's and Interrupts

    24/31

    () Wait

  • 8/9/2019 Io's and Interrupts

    25/31

    Interrupts :

    3ultiple Interrupts

  • 8/9/2019 Io's and Interrupts

    26/31

    3ultiple Interrupts

    Disa,le interrupts

    #rocessor -ill ignore further interrupts -hilstprocessing one interrupt

    nterrupts remain pending and are checkedafter ;rst interrupt has +een processed

    nterrupts handled in se4uence as they occur De;ne priorities

    0o- priority interrupts can +e interrupted +yhigher priority interrupts

    When higher priority interrupt has +eenprocessed, processor returns to previousinterrupt

  • 8/9/2019 Io's and Interrupts

    27/31