I/O Flashcards
I/O subsystems common concepts
Port Bus (daisy chain or shared direct access) Controller (host adapter) I/O instructions control devices Devices have addresses, used by Direct I/O instructions Memory-mapped I/O
OS works with device drivers (not controllers)
Polling
Each interrupt is numbered; polling chks status
Determines state of device
command-ready, busy, error
Can run another device while polling
General architecture for I/O device
Control registers
Command registers
Status registers
Buffer (read, write, handles timing differences)
Interrupts
I/O device driver initiate I/O
Input ready, output complete, or error generates interrupt signal
CPU interrupt request line triggered by I/O device
CPU transfers control to interrupt handler
Interrupt handler receives interrupts
Interrupt handler processes data, returns from interrupt
CPU resumes processing of interrupted task
Maskable interrupt
Maskable to ignore or delay some interrupts
Interrupt vector to dispatch interrupt to correct handler
Based on priority, some nonmaskable
Interrupt mechanism also used for exceptions
Direct Memory Access
Used to avoid programmed I/O for large data movement
Requires DMA controller
Bypasses CPU to transfer data directly between I/O device and memory
Busy-wait cycle
Same as polling, a check status command if (CMD) busy = 1; while (1) {WAIT, do I/O stuff}
when does cpu check for interrupt
end of every instruction
how can interrupts be disabled
disabled by CLI (clear interrupts)
enabled by STI (set interrupts)