}I/O
system consists of I/O devices ,device controllers and driver software.
}I/O Module Function
a) Control & Timing
-To
coordinate flow of traffic between external devices and internal resources.
b)Processor
Communication
-For
decoding in I/O module ,data exchange through data bus , status reporting about peripheral , and CPU assigning
unique address for each I/O module.
c)Device Communication
-Device
Communication involves commands ,status information and data.
d)Data
Buffering
-The data
are buffered in the I/O module and then sent to the peripheral device at its
data rate.
e)Error
Detection
-For
reporting errors to the processor.
I/O Module Diagram
I/O Mapping
}Memory
mapped I/O
-Device
and memory share an address space.
-I/O looks just like memory read/write
-No special commands for I/O.
}Isolated
I/O
-Separate address spaces
-Need I/O or memory select lines
-Special commands for I/O
Input Output
Techniques
}Programmed
I/O
-Data are exchanged between the processor
and the I/O module.
-CPU has direct control over I/O
-sensing
status
-read/write
commands
-transferring
data
-waste CPU time
Programmed I/O-Detail
}CPU
requests I/O operation
}I/O
module performs operation
}I/O
module sets status bits
}CPU
checks status bits periodically (known as polling)
}I/O
module does not inform CPU directly
}I/O
module does not interrupt CPU
}CPU may
wait or come back later
Programmed I/O
}Interrupt
Driven I/O
-Overcomes CPU waiting
-No repeated CPU checking of Device
-I/O module interrupts when ready.
Interrupt Driven
I/O-Basic Operation
}CPU issues read command
}I/O module gets data from peripheral whilst CPU does other work
}I/O module interrupts CPU
}CPU requests data
}I/O module transfers data
Interrupt Driven I/O
Interrupt I/O
}Interrupt I/O is more efficient than programmed I/O because it
eliminates needless waiting.
}Interrupt
I/O consumes a lot of processor
time, because data transfer from memory to I/O module to memory must passed
through the processor.
Drawbacks of
Programmed and Interrupt Driven I/O
nBoth forms of I/O
suffer from two inherent drawbacks:
1)The I/O transfer rate
is limited by the speed with which the processor can test and service a device
2)The processor is tied
up in managing an I/O transfer; a number of instructions must be executed for
each I/O transfer
}Direct
Memory Access
-Interrupt driven and programmed I/O require
active CPU intervention
-DMA is the answer.
-Advantage
:Large amounts of data can be transferred
between memory and the peripheral W/O severely impacting CPU
performance.
Direct Memory Access
DMA Function
}Additional Module (hardware) on bus
}DMA controller takes over from CPU for I/O
Direct Memory Access
DMA Transfer – Cycling
Stealing
}In
cycling-stealing ,DMA controller acquires the bus ,transfer a single byte or
word for a cycle.
}Cycling-stealing
is not an interruption because CPU dose not switch context.
}CPU
suspend just before it accesses bus.
}This
allow other devices , and in particular the CPU , to share the bus during DMA
transfers.
}Slow down
CPU.
DMA Configurations(1)
}Single
Bus ,Detached DMA controller
}Each
transfer uses bus twice
}CPU is
suspended twice
DMA Configurations(2)
}Single
Bus ,Integrated DMA controller
}DMA
Controller may support>1 device
}Each
transfer uses bus once
}CPU is
suspended once
DMA Configuration(3)
}Separate
I/O Bus
}Bus
supports all DMA enable devices
}Each
transfer uses bus once
}CPU is
suspended once
By Fam Jiang Yuan