Week 2 Flashcards
What are I/O devices?
allows humans or devices to communicate with computers
What are examples of I/O devices?
Human interface devices: keyboard, mouse, monitor, speaker and printer, game controllers
Storage Devices: HDD’s, SSD’s, USB flash devices
Communication devices: network interface cards
What is a bus used for with I/O devices?
The communication with I/O devices is performed over a bus
What are controllers used for with I/O devices?
The I/O devices are operated using controllers
How does the processor communicate with a controller?
The processor communicates with the controller by reading and writing to the controller’s registers
What are the 4 controller registers?
Data register - temporal storage of data
data-in register - data coming from device
Status register - indicating status of device
Control register - commands to device
What is a Port-mapped I/O (PMIO)?
Isolated
A separate IO address space
CPU uses special IO instructions to access IO devices
What is a Memory-mapped I/O (MMIO)?
Device registers are treated as part of memory space
CPU access registers using standard memory instructions
What are the 2 I/O Control Methods?
Polling
Interrupts
What is Polling (SR)?
CPU repeatedly checks the status register to see if it needs attention
What is an example of Polling?
Writing to a disk
CPU repeatedly checks the status register to determine if disk is ready
If status is ready, CPU can write to the data-out register
Once the write operation is complete, the disk controller updates the status register
What are interrupts?
a signal from an I/O device to notify CPU it requires attention
CPU temporarily halts it current progress
Performs necessary action then resumes previous task
When may polling be preferable?
If controller and device are fast
I/O rate is high
Some I/O data can be ignored
CPU has nothing better to do
How are large data transfers done on devices?
Offloading this work to a special purpose processor (DMA controller)
What is a DMA controller (Direct memory access)?
DMA allows IO devices to bypass CPU and directly read/write from/to memory
Enables CPU to spend more resources on other tasks
What is a Device Driver?
Lets the OS and a device communicate
Hides differences between various device controllers by defining interface between OS and I/O devices for specific class of I/O devices