Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There’s plenty on the web, as rheldaemon points out, but as a (simplified) quick summary:

When a device driver is loaded in Linux, it requests a unique ID (number) from the kernel. This is the major number. For each device that the driver provides support for, it allocates a unique (to the driver) ID, the minor number.

The kernel puts that information in virtual files in /sys. The kernel and UDev daemon between them maintain the files in /dev, which are essentially just aliases allowing software to identify and access devices. They’re basically just files containing the major and minor numbers (just like symbolic links contain file-names), and when a device node is opened, the numbers are used by the kernel to identify the driver and device that handle the I/O.

There’s plenty on the web, as rheldaemon points out, but as a (simplified) quick summary:

When a device driver is loaded in Linux, it requests a unique ID (number) from the kernel. This is the major number. For each device that the driver provides support for, it allocates a unique (to the driver) ID, the minor number.

The kernel puts that information in virtual files in /sys. The kernel and UDev daemon between them maintain the files in /dev, which are essentially just aliases allowing software to identify and access devices. They’re basically just files containing the major and minor numbers (just like symbolic links contain file-names), and when a device node is opened, the numbers are used by the kernel to identify the driver and device that will handle the I/O.