36. I/O Devices Flashcards

1
Q

What is true about buses?

A

The shorter and closer the bus to CPU, the faster it is. The longest and furthest buses are the slowest. The width of bus also defines its speed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What kind of buses are there?

A

Memory bus, closest to CPU or integrated into it, connects to CPU.
General I/O bus (for network cards, NVME, videocards), connects to CPU or chipset. Peripheral I/O bus, for slower device, connects to chipset, slowest because its devices don’t require that much speed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is canonical I/O device composed of?

A

First it has some kind of interface for communication with the hardware, this interface is used by OS. Then it has an internal structure, which is responsible for implementing the abstraction the device present to system (actual instructions). Complex devices will include own small CPU, some general purpose memory and other device-specific chips.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What registers does canonical device have?

A

Status, command, data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is programmed I/O?

A

It’s when CPU is involved with data movement into device’s registers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is two-phased approach?

A

It’s an approach where the CPU polls the device for an operation completion a little bit before giving up and waiting for interrupt. It can improve efficiency when the operations are quite fast so there is no need to wait for interrupt and overload the system with these interrupts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is coalescing?

A

It’s an optimization where device waits for a bit to group the requests before issuing an interrupt.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is DMA?

A

Direct Memory Access (DMA) is a specialized hardware device that performs data transfers between I/O devices and main memory without much CPU involvement. The OS configures the DMA by specifying the source, destination, and size of the data. The DMA controller handles the transfer independently and raises an interrupt upon completion to notify the OS. This approach is much more efficient than Programmed I/O (PIO), as it reduces CPU overhead and allows the CPU to focus on more critical tasks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are two ways to communicate with I/O devices?

A
  1. Explicit I/O instructions. The CPU issues ‘in’ and ‘out’ instructions to send data to registers. These are priviliged.
  2. Memory-mapped I/O. Hardware makes device registers available if they were memory locations, the CPU then uses usual load/store instructions and hardware then routes them to a device.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How is device-specific implementation hidden from an OS?

A

The request comes through a POSIX API to a filesystem, which then translates a request into a block-level request to generic block layer. The generic layers in its turn transforms a request into a device driver instruction. The device instruction is a final place which translates driver instructions into hardware-specific instructions.

There is also ‘RAW’ interface which allows to bypass filesystem and operate on the block level.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly