Computer Organization & Architecture Lecture #19 Input/Output
Computer Organization & Architecture Lecture #19 Input/Output
Lecture #19
Input/Output
The computer system’s I/O architecture is its interface to the outside world. This
architecture is designed to provide a systematic means of controlling interaction
with the outside world and to provide the operating system with the information it
needs to manage I/O activity effectively.
There are three principal I/O techniques: programmed I/O, in which I/O occurs
under he direct and continuous control of the program requesting the I/O operation;
interrupt-driven I/O, in which a program issues an I/O command and then
continues to execute, until it is interrupted by the I/O hardware to signal the end of
the I/O operations; and direct memory access (DMA), in which a specialized I/O
processor takes over control of an I/O operation to move a large block of data.
Two important examples of external I/O interfaces are FireWire and Infiniband.
Keyboard/Monitor
• Contains electronics for exchanging data, control, and status signals with an I/O
module
• Contains electronics for controlling the disk read/write mechanism
• Fixed-head disk – transducer converts between magnetic patterns on the disk
surface and bits in the buffer
• Moving-head disk – must move the disk arm rapidly across the surface
I/O Modules
Module Function
Processor communication
• Command decoding: I/O module accepts commands from the processor sent
as signals on the control bus
• Data: data exchanged between the processor and I/O module over the data bus
• Status reporting: common status signals BUSY and READY are used because
peripherals are slow
• Address recognition: I/O module must recognize a unique address for each
peripheral that it controls
I/O module communication
• Device communication: commands, status information, and data
• Data buffering: data comes from main memory in rapid burst and must be
buffered by the I/O module and then sent to the device at the device’s rate
• Error detection: responsible for reporting errors to the processor
Programmed I/O
The processor issues an address, specifying I/O module and device, and an I/O
command. The commands are:
I/O Instructions
• Memory-mapped I/O
o Single address space for both memory and I/O devices
disadvantage – uses up valuable memory address space
o I/O module registers treated as memory addresses
o Same machine instructions used to access both memory and I/O devices
advantage – allows for more efficient programming
o Single read line and single write lines needed
o Commonly used
• Isolated I/O
o Separate address space for both memory and I/O devices
o Separate memory and I/O select lines needed
o Small number of I/O instructions
o Commonly used
Interrupt-Driven I/O
• Overcomes the processor having to wait long periods of time for I/O modules
• The processor does not have to repeatedly check the I/O module status
How does the processor determine which device issued the interrupt
How are multiple interrupts dealt with
Device identification
• Multiple interrupt lines – each line may have multiple I/O modules
• Software poll – poll each I/O module
o Separate command line – TESTI/O
o Processor read status register of I/O module
o Time consuming
• Daisy chain
o Hardware poll
o Common interrupt request line
o Processor sends interrupt acknowledge
o Requesting I/O module places a word of data on the data lines – “vector”
that uniquely identifies the I/O module – vectored interrupt
• Bus arbitration
o I/O module first gains control of the bus
o I/O module sends interrupt request
o The processor acknowledges the interrupt request
o I/O module places its vector of the data lines
Multiple interrupts
• The techniques above not only identify the requesting I/O module but provide
methods of assigning priorities
• Multiple lines – processor picks line with highest priority
• Software polling – polling order determines priority
• Daisy chain – daisy chain order of the modules determines priority
• Bus arbitration – arbitration scheme determines priority
DMA Function
DMA Operation
DMA Configurations
• More and more the I/O function is performed without processor involvement.
• The processor is increasingly relieved of I/O related tasks – improved
performance.
Type of Interfaces
FireWire Configurations
• Daisy chain
• 63 devices on a single port – 64 if you count the interface itself
• 1022 FireWire busses can be interconnected using bridges
• Hot plugging
• Automatic configuration
• No terminations
• Can be tree structured rather than strictly daisy chained
Physical layer
• Defines the transmission media that are permissible and the electrical and
signaling characteristics of each
• 25 to 400 Mbps
• Converts binary data to electrical signals
• Provides arbitration services
o Based on tree structure
o Root acts as arbiter
o First come first served
o Natural priority controls simultaneous requests – nearest root
o Fair arbitration
o Urgent arbitration
Link layer
• Describes the transmission of data in the packets
• Asynchronous
o Variable amount of data and several bytes of transaction data transferred
as a packet
o Uses an explicit address
o Acknowledgement returned
• Isochronous
o Variable amount of data in sequence of fixed sized packets at regular
intervals
o Uses simplified addressing
o No acknowledgement
Transaction layer
• Defines a request-response protocol that hides the lower-layer detail of
FireWire from applications
InfiniBand
InfiniBand Operations