Linux Subsystems¶
Linux subsystems provide reusable kernel frameworks for common hardware classes and data paths. Instead of exposing every device as a custom character driver, a driver can register with an existing subsystem and inherit a standard user-space ABI.
Why Subsystems Matter¶
Subsystems help keep drivers portable and maintainable:
- Device Tree describes the hardware connection.
- The bus layer, such as I2C or SPI, handles device communication.
- The subsystem defines the user-space interface.
- The driver focuses on device-specific register access and event handling.
Subsystem Map¶
| Subsystem | Main Purpose | Typical User-Space Interface | Related Labs |
|---|---|---|---|
| IIO | Sensors and ADC-style sampled data | /sys/bus/iio, /dev/iio:deviceX |
Day33 - Day42 |
| Input | Keys, buttons, touch, gesture-like input events | /dev/input/eventX |
Day43 - Day44 |
| TTY / UART | Serial communication | /dev/tty* |
Day29, Day31 |
| GPIO / gpiod | GPIO descriptor access and GPIO-backed functions | sysfs/debug tools, driver APIs | Day09, Day11 - Day14 |
| hwmon | Hardware monitoring values such as temperature | /sys/class/hwmon |
Day20 - Day22 |
| Device Tree Overlay | Hardware description and driver binding | /boot/firmware/overlays, kernel probe path |
Day04 - Day09 |
Recommended Learning Path¶
- Start with Device Tree Overlay to understand how hardware is described.
- Review GPIO and gpiod to understand descriptor-based GPIO lookup.
- Study hwmon as a simple subsystem with a standard sysfs ABI.
- Move to IIO for buffered sensor data, triggers, FIFO, scan masks, and timestamps.
- Review Input for event reporting and
/dev/input/eventXintegration. - Use TTY / UART to understand Linux serial devices and line discipline concepts.