Input/Output
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 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) 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 : Controller sends interrupt signal using interrupt request line, detected by processor Processor saves the state of process and identify interrupt Control transfer to interrupt handler Processor continues its job
Direct Memory Access