From the course: Exploring Linux Internals: Advanced Insights and Practical Applications

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Understanding device nodes

Understanding device nodes

- So to understand how the kernel uses hardware, the first thing to analyze is device notes. So kernel drivers, in the end, are used to load drivers for the devices. And to access these drivers, a representation in user space is needed. And this representation is made by device nodes in the /dev directory. And this is really where the "everything is a file" statement applies. By using device files, users can easily access block as well as character devices. So how do we get from the device node to the kernel module? When the device driver is loaded as a module in the kernel, it registers itself with a major number, which is used to identify devices that are managed by that specific module. The device nodes are configured with the major number needed to access these specific devices. And there is the minor number on the device node, which is handled by the device driver itself. The kernel doesn't know anything about these minors, and this provides access to where it is specifically…

Contents