10 - Io
10 - Io
System Bus
CPU
I/O Devices
3
Generic Model of I/O Module
5
Source: http://lilt.ilstu.edu/cheri/itk254/sc/inputoutput/InputOutput_print.html
I/O Module Functions – Example
Source: http://lilt.ilstu.edu/cheri/itk254/sc/inputoutput/InputOutput_print.html
SweRVolfX
7
SweRVolfX IO at low level
8
Input Output Techniques
Programmed I/O
Polling
Interrupt driven I/O
Direct Memory Access (DMA)
9
Programmed I/O
CPU has direct control over I/O
Continuously sense status – Poll
Read/write commands
Transferring data
CPU waits for I/O module to complete operation
Wastes CPU time
10
Addressing I/O Devices
Under programmed I/O data transfer
is like memory access
Use LOAD/STORE instructions
Each device is given a unique
identifier
Address[15:6]
CPU commands contain identifier
(address)
Registers within I/O controller are
identified by
Address[5:2]
11
I/O Mapping
Source:
12
http://me-lrt.de/memory-map-port-isolated-input
I/O Mapping (Cont.)
Memory Mapped I/O Isolated I/O
Devices & memory share Separate address spaces
same address space
I/O looks just like memory Need I/O or memory
read/write select lines
No special commands for Special commands for I/O
I/O Limited set
Large selection of memory
access commands
13
E.g. Memory mapped - GPIO
Three memory-mapped registers:
– Read Register: value read from pin
– Write Register: value to write to pin
– Enable Register: 1 = output, 0 = input
14
Interrupt Driven I/O
No repeated CPU checking of device
No waiting
CPU does its own work
I/O module interrupts CPU when ready
Steps
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
15
Interrupt Processing (Cont.)
17
DMA (Cont.)
Memory
Memory
CPU CPU
DMA
IO
device IO
device
18
3 Techniques for
Input of a Block of Data
System bus
Disk/DMA DMA
controller controller Printer Keyboard
21