Professional Documents
Culture Documents
• I/O interface
• Input/output mechanism
Memory-mapped
y pp I/O
/
Programmed I/O
Interrupts
Direct Memory Access
• Buses
Synchronous Bus
Asynchronous Bus
I/O in CO and O/S
• Programmed I/O
• Interrupts
• DMA (Direct memory Access)
A bus is a shared communication link,, which uses one
set of wires to connect multiple subsystems.
– Address Decoder
– Control Circuits
– Data registers
– Status registers
Memory
Address
Processor Data
Control
Address
Add Control
C t l Data
D t andd status
t t
I/O
/O
Interface
Decoders circuits registers
Input
p device (s)
( )
• Memory mapped I/O
Input Output
• Programmed I/O
mechanism
h i
• Interrupts
Reason why
R h b
bus ddesign
i iis so difficult
diffi lt :
- the maximum bus speed is largely limited by physical
factors: the length of the bus and the number of devices.
These physical limits prevent us from running the bus
arbitrarily fast.
DataRdy:
D t Rd Used
U d tot indicate
i di t that
th t the
th data
d t word
d is
i now ready
d on the
th
data lines; asserted by: Output/Memory and Input/I_O Device.
Memory
- Move DATAIN, R0
reads the data from DATAIN and stores them into processor
register R0;
User p
programs
g are p
prevented from issuing
g I/O
/
operations directly because the OS does not provide access to
the address space assigned to the I/O devices and thus the
addresses are protected by the address translation.
DATAOUT
7 6 5 4 3 2 1 0
Interrupt-driven
Interrupt driven I/O,
I/O employs I/O interrupts to
indicate to the processor that an I/O device needs attention.
registers flags,
• All the registers, flags program counter values are saved
p Latency”
execution overhead Æ “Interrupt y
interrupt-acknowledge signal - I/O device interface
p
accomplishes this by
y execution of an instruction in the
interrupt-service routine (ISR) that accesses a status or
data register in the device interface; implicitly informs the
device that its interrupt request has been recognized. IRQ
signal is then removed by device.
Pull-up
Pull up
resister
Supply
pp y
R
INTR Pull-up
Processor resister
INTR
Enabling and Disabling Interrupts
• Device activates interrupt signal line and waits with this
signal activated until processors attends
• What
h if the
h same d
device
i iinterrupts again,
i within
i hi an ISR ?
• Disabling Interrupts
– Processor automatically disables interrupts before
starting the execution of the ISR
– The processor saves the contents of PC and PS (status
register) before performing interrupt disabling.
– The interrupt-enable is set to 0 – no further interrupts
allowed
– When return from interrupt instruction is executed the
contents of the PS are restored from the stack, and the
interrupt enable is set to 1
p
• Special Interrupt
p line