COA Lecture 23 Interupt Driven Io PDF
COA Lecture 23 Interupt Driven Io PDF
No No
Done? Done?
Yes Yes
Next instruction Next instruction
(a) Programmed I/O (b) Interrupt-driven I/O
Figure 7.4 Three Techniques for Input of a Block of Data
Interrupt-Driven I/O
The problem with programmed I/O is that the
processor has to wait a long time for the I/O module
to be ready for either reception or transmission of data
Device controller or
other system hardware
issues an interrupt
Save remainder of
process state
information
Processor finishes
execution of current
instruction
Process interrupt
Processor signals
acknowledgment
of interrupt
Restore process state
information
Processor pushes PSW
and PC onto control
stack
Restore old PSW
and PC
Processor loads new
PC value based on
interrupt
+1 +
Program Program
Counter Counter
Start Start
Interrupt General Interrupt General
Service Registers Service Registers
+ Return Routine + Return Routine
Stack Stack
Pointer Pointer
Processor Processor
+1 User's +1 User's
Program Program
Main Main
Memory Memory
Software poll
When processor detects an interrupt it branches to an interrupt-service routine whose job is to
poll each I/O module to determine which module caused the interrupt
Time consuming
Slave Master
82C59A 82C59A
interrupt interrupt 80386
controller controller processor
External device 08 IR0 IR0
External device 09 IR1 INT IR1 INT INTR
IR2 IR2
IR3 IR3
IR4 IR4
IR5 IR5
IR6 IR6
External device 15 IR7 IR7
Slave
82C59A
interrupt
controller
External device 56 IR0
External device 57 IR1 INT
IR2
IR3
IR4
IR5
IR6
External device 63 IR7
C4 Data ready
C5 Acknowledge
82C55A
B0 S0
B1 S1
B2 S2
B3 S3
OUTPUT DISPLAY
B4 S4
PORT
B5 S5
B6 Backspace
B7 Clear
C1 Data ready
C2 Acknowledge
C6 Blanking
C0 C7 Clear line
Interrupt
request
Address
Address lines register
Request to DMA
Acknowledge from DMA
Control
Interrupt
logic
Read
Write
Instruction Cycle
DMA Interrupt
Breakpoints Breakpoint
I/O
I/O I/O
System bus
I/O bus