Devices & I/O
Explain how the kernel talks to devices and how programs do I/O efficiently, and measure block I/O behaviour.
4 objectives 6 steps about 130 min
Check what you know
The lessons are coming later. The knowledge check is ready now.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Explain device drivers, interrupts, DMA and the difference between character and block devices, and find devices under /dev and /sys.
- Describe the Linux block layer (blk-mq), I/O schedulers, and the difference between buffered, direct and synchronous I/O.
- Compare blocking, non-blocking, multiplexed (epoll) and asynchronous (io_uring) I/O and pick one for a workload.
- Measure IOPS, throughput and latency with fio and iostat and interpret the results.
Lesson plan
6 steps, about 130 min · 0 of 5 lessons available so far
- How the kernel talks to hardware: drivers, interrupts, DMA and device files Concept · 20 min · coming later
- The block I/O path: page cache, blk-mq, schedulers and O_DIRECT Concept · 20 min · coming later
- I/O models for programs: blocking, non-blocking, epoll and io_uring Concept · 20 min · coming later
- Worked example: an epoll event loop that serves many pipes Worked example · 25 min · coming later
- Lab: lsblk, udevadm and /sys, then fio and iostat on sequential vs random I/O Lab · 30 min · coming later
- Check: choose an I/O model and explain a benchmark Knowledge check · 8 questions
Practise it
Write an event loop with epoll (C) or selectors (Python) that multiplexes several named pipes without blocking, then run fio for 4 KiB random reads and 1 MiB sequential reads, buffered and direct, on the same disk and explain the IOPS, throughput and latency differences with iostat output.
Build it from scratch
Practice builds that exercise this skill by re-creating a real technology.
- Build your own Text EditorIntermediate · 10–20 h
- Build your own Virtual MachineIntermediate · 6–12 h
- Build your own Operating SystemAdvanced · 40–80 h
References
Hard prerequisites
None.
Unlocks
Nothing depends on this skill yet.
On these roadmaps
Progress and evidence for this skill are shared across all of them.