Document Udev
Document Udev
• Udev is the device manager for the Linux 2.6 kernel series, Primarily, it manages
device nodes in /dev.
• On device creation, udev reads the sysfs directory of the given device to collect
device attributes like label, serial number or bus device number. These attributes
may be used as keys to determine a unique name for the device. udev maintains a
database for devices present on the system.
On device removal, udev queries its database for the name of the device file to be
deleted.
• Udev relies on the kernel hot plug mechanism to create device files in user space.
Udev is a generic kernel device manager. It runs as a daemon on a Linux system
and listens to uevents the kernel sends out (via netlink socket) if a new device is
initialized or a device is removed from the system.
• In response to the interrupt, the kernel ascertains the details of the newly-added
device, either by using a specific protocol to query the hardware controller or by
searching at hard-coded addresses – such as the PCI card configuration area – for
information stored there, more specifically, for the vendor and product IDs.
• The kernel then goes on to create a KObject for each new device; data on the
device type (char or block) and the major and minor numbers are passed to and
stored by the KObject via the global kernel component namespace introduced in
kernel 2.6.
• Udev uses this approach both when devices are added to a running system (hot
plugging) and for initialization during the boot phase (cold plugging). The kernel
searches the buses for devices and creates uevent files based on the results.
• All major and minor numbers are assigned a name that matches up with a type of
Device. This allocation is done by The Linux Assigned Names And Numbers
Authority(LANANA).
By
Thenralarasan M