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
What is a character device + examples?
transfers bytes one by one
examples: keyboards, computer mice, microphones, speakers
What does the character I/O interface include?
get - read()
put - write()
other operations, line by line access ,seek ,editing services (eg. backspace)
What are Block I/Os + examples?
Block devices handle I/O in blocks (chunks) of data
examples: HDD, SSD, CD-ROM, and DVD drives
Usually high volume devices
What does the Block I/O interface include?
read - reading blocks of data
write - writing blocks of data
What do Network I/O’s do?
sending and receiving packets over the connection
What is the main difference between network I/Os and other I/O devices?
things routinely go wrong (missing packets etc.)
Therefore there need to be system functions for:
Checking whether data transfer was successful
recovering gracefully from unsuccessful transfers
What is a Program?
A set of instructions for performing a specific task (passive)
Stored on disk
What is a Process?
Instance of a program in execution (active)
Requires CPU resources, memory and I/O
There can be multiple process instances of one program