An In-Depth Overview of Linux Input Device Architecture
This article offers a detailed examination of the Linux input stack, breaking down its architecture from hardware to user-space components. It divides input handling into kernel-level and user-space levels, highlighting key parts like the input core subsystem and device drivers in the kernel, along with the event abstraction layer (evdev), devtmpfs, sysfs, and procfs. The user-space side involves udev for device management and module loading via MODALIAS, as well as libraries like libinput and XKB used by graphical servers and compositors to interpret input events. The kernel input core manages device lifecycles, event diffusion to handlers, and abstracts device-specific protocols into standardized formats such as evdev. It also describes the sysfs filesystem exposing kernel objects and properties, and the hierarchy of kernel objects representing buses, devices, and drivers, essential for plug-and-play functionality. The article dives into the relationships between hardware buses (PCI, USB) and higher-level drivers like HID, explaining device tree structure in sysfs and mechanisms for dynamic module loading triggered by udev. Finally, it provides practical examples and commands for exploring device hierarchies and kernel modules, clarifying how electrical input signals transit through layered protocols until exposed as standardized input events for user-space consumption.
