Kernel Driver Topics¶
This section organizes Linux kernel driver concepts into reusable topic pages.
Unlike the original Day-based labs, these topics are organized by subject area rather than chronological learning order. Each module can be studied independently while still following a recommended progression.
Driver Foundation¶
Core concepts required before developing Linux kernel drivers.
| Topic | Main Idea | Related Labs |
|---|---|---|
| Linux Driver Model | Understand device, driver, bus, matching, probe, and sysfs hierarchy | Day71 |
| Platform Bus | Understand platform devices, platform drivers, matching, and Device Tree integration | Day72 |
| Character Device Basics | Register a character device and expose a file interface | Day05, Day06 |
| Platform Driver and Device Tree Binding | Bind hardware description to a driver using compatible |
Day08, Day09, Day10 |
DMA Engine¶
Learn how Linux abstracts DMA hardware into reusable transaction-based interfaces.
| Topic | Main Idea | Related Labs |
|---|---|---|
| Linux DMA Engine Framework | Understand the DMA Engine architecture and framework abstraction | Day99 |
| DMA Controller Driver | Understand DMA controllers, DMA channels, channel allocation, and Device Tree integration | Day100 |
| DMA Descriptor | Understand DMA transaction objects, descriptor ownership, preparation, submission, queue lifecycle, and controller scheduling | Day101, Day102 |
| DMA Completion and Transaction Status | Understand hardware completion, cookie completion, transaction status, residue reporting, deferred callback processing, and descriptor finalization | Day103 |
| DMA Termination and Synchronization | Understand DMA termination, completion synchronization, shutdown races, and safe client resource cleanup | Day104 |
| Cyclic DMA | Understand long-running cyclic DMA transactions, periods, period callbacks, producer/consumer behavior, residue, and cyclic DMA shutdown | Day105 |
| DMA Slave Configuration | Configure peripheral addresses, transfer widths, burst behavior, and understand how slave configuration combines with transaction descriptors. | Day106 |
| DMA Slave Transfer | Prepare and execute one-shot slave DMA transfers using DMA-mapped buffers, single or scatter-gather transactions, completion handling, and safe resource cleanup | Day107 |
| DMA Scatter-Gather Transfer | Build and map scatter-gather memory, distinguish original SG entries from DMA-visible segments, and prepare slave SG transactions with dmaengine_prep_slave_sg() |
Day108 |
| DMA Client Driver Architecture | Coordinate request-based and continuous DMA transfers, persistent mappings, buffer ownership, producer-consumer flow, completion, and safe cleanup | Day109, Day110 |
Event Notification and Asynchronous I/O¶
Learn how Linux drivers notify user space and integrate with event-driven I/O.
| Topic | Main Idea | Related Labs |
|---|---|---|
| Blocking and Non-blocking I/O | Implement blocking and non-blocking read paths using wait queues | Day12, Day14, Day18, Day50 |
| Wait Queue and poll Support | Integrate drivers with poll(), select(), and epoll() |
Day12, Day15, Day50, Day51 |
| epoll | Scale event notification using Interest List and Ready List | Day86 |
| fasync and SIGIO | Notify user space asynchronously using signals | Day52 |
Interrupts and Deferred Execution¶
Learn how interrupt handling is separated from deferred execution.
| Topic | Main Idea | Related Labs |
|---|---|---|
| GPIO and IRQ Driver | Build GPIO interrupt drivers using gpiod and IRQ handlers | Day09, Day11, Day13 |
| Deferred Work Selection | Compare Threaded IRQ, Workqueue, kthread_worker, and Dedicated kthread | Day80, Day81, Day82, Day83 |
Driver Synchronization¶
Learn how Linux protects shared kernel resources.
| Topic | Main Idea | Related Labs |
|---|---|---|
| Kernel Locking | Protect shared kernel data using spinlocks, mutexes, and reader-writer semaphores | Day88 |
Driver Control Plane¶
Learn how drivers expose configuration interfaces separately from the data path.
| Topic | Main Idea | Related Labs |
|---|---|---|
| Driver Control Plane | Separate data path from configuration path using ioctl() and sysfs |
Day16, Day17 |
Core Driver Model¶
Device Tree
↓
platform_device
↓
platform_match()
↓
platform_driver.probe()
↓
initialize hardware and software state
↓
file_operations
↓
open/read/write/poll/ioctl/release
↓
/dev/<name>
↓
User-space application
DMA Learning Path¶
Linux DMA Engine Framework
↓
DMA Controller Driver
↓
DMA Descriptor
↓
Descriptor Submission
↓
DMA Completion and Transaction Status
↓
DMA Termination and Synchronization
↓
Cyclic DMA
↓
DMA Slave Configuration
↓
DMA Slave Transfer
↓
DMA Scatter-Gather Transfer
↓
DMA Client Driver Architecture
Deferred Execution Learning Path¶
Related Notes¶
- Linux Driver Model Fundamentals
- Linux Kernel Module
- Character Device Driver Notes
- Linux GPIO Driver
- GPIO Driver with IRQ
- Driver I/O Model
- Event-Driven I/O in Linux
- IOCTL and Control Plane
- Sysfs vs ioctl
- Pollable Character Driver
- epoll Internals
- Linux fasync / SIGIO / eventfd Notes