Objective
Issue commands to the devices
Catch interrupts
Handle errors
Provide user interface
I/O Device Classification
Based on data flow :
Block device
Save and transfer data as blocks, example :
disk, tape, CDROM, optical disk
Character device
Save and transfer data as character,
example : terminal, printer line, mouse
Basic Concept
-I/O device is connected to computer by port.
-Communicate with processor and other devices by bus.
-Communication between devices and processor – 2
methods – memory mapped and direct I/O instruction.
-Processor repeatedly checks for available access to
devices – polling
-I/O Device tells processor for available access –
interrupt
Register for I/O Port
- Data-in register
- Data-out register
- Status
- Control
Bus Structure
Processor – I/O Communication
1.Direct I/O instruction
each control register is assigned an I/O port number,
an 8- or 16-bit integer. Example : IN REG,PORT
(read), OUT PORT,REG (write)
2.Memory mapped
I/O registers are part of the regular memory address
space,
Direct I/O instruction Memory Mapped
Interrupt
Because of :
-Available to be accessed
-Output
-Error
Steps :
1.Controller sends interrupt signal using interrupt request line, detected by
processor
2.Processor saves the state of process and identify interrupt
3.Control transfer to interrupt handler
4.Processor continues its job