I/O Management Flashcards
What are an I/O device’s control registers?
Use to communicate with OS. Three types: command (send commands to device), data (send data), status (status of device).
Describe the I/O device stack
Hardware Controller (incl. with device) Driver kernel I/O Subsystem Kernel
What s a device driver?
A piece of software that is responsible for accessing, managing, and controlling a device. Each OS has an interface that each device must implement.
What are the types of I/O devices?
- Block (e.g. disk) - read blocks of data
- Character (keyboard) - get/put a char
- Network - stream data chunks of different sizes
Name some virtual devices
/dev/null, /dev/random
How does an OS represent a device?
A file, can use file abstractions to write to device. Can use a special file system (tempfs, devfs)
Name the two types of device–>CPU interactions
Memory-mapped and I/O port
What is memory-mapped I/O?
Part of the OS’s physical memory is dedicated to I/O interactions and devices’ registers appear to OS as physical memory addresses. The PCI bus translates physical memory to appropriate device
What is BAR?
Base Address Registers - device registers that control how much memory the device needs mapped into the OS (in memory-mapped I/O)
What is I/O Port?
Device-CPU interaction where the CPU has special instructions to interact with the device
How does a device communicate back to the OS?
Interrupts or Polling
What is PIO?
Programmed I/O - device access method where CPU can ‘program’ the device using the command registers and passing data through data registers. Requires no additional hardware support, but is slow
What is DMA?
Device Memory Access - device access method that relies on additional hardware support, but is faster than PIO for large data transfers. CPU writes commands to command registers, but configures DMA controller to point to MM where data is located. DMA then copies data over.
What is an OS Bypass device access?
Can have user process directly access device by mapping device into user address space. Requires a user-level driver that is included while linking and the device needs to be able to support multiple processes accessing it - sufficient resources to split them + know which process to send a result back to
What is an inode?
Persistent representation of a file. A list of blocks that contain the file’s data