I/O Devices
- Two main types
- Block: random access to data organized in fixed-size blocks
- Serial/Character: Individual bytes, not addressable, can be one-way
- Data Rates
- Raw: Total number of physically transferred bits per second
- Effective data: Total number of physically transferred bits per second, excluding the protocol overhead
- Burst data rate: Maximum data rate at which a communication channel can deliver data within a short time frame
- Sustained data rate: The average transfer rate of a device over time
Handling
| CPU | Co-Proc |
---|
Memory | MMIO | DMA |
Isolated | PMIO | Channels |
- Memory Mapped IO (MMIO)
- IO corresponds to a spot in memory
- Port Mapped IO (PIO)
- Separate memory spaces for each device
- Direct Memory Access (DMA)
- CPU tells co-processor to read and write, and the coprocessor handles the modification
- Prevents the CPU from constantly having to deal with interrupts (the DMA controller handles them instead)
- Very common
- Channels
- High performance bus
- Rarely used
Kernel’s Role
- Programmed IO with Pooling
- Wait for the device to be ready and then write to it
- Would need to block that entire time
- Programmed IO with Interrupts
- Device alerts CPU when it is ready
- Does not spin wait but still blocks the user until the interrupt is fired
- Direct memory access
- The controller handles the IO for the CPU
- The CPU needs to program the DMA which takes a considerable amount of time upfront