udev - A Userspace Implementation of devfs

Starting with the 2.5 kernel, all physical and virtual devices in a system are visible to userspace in a hierarchal fashion through sysfs. /sbin/hotplug provides a notification to userspace when any device is added or removed from the system. Using these two features, a userspace implementation of a dynamic /dev is now possible that can provide a very flexible device naming policy.

This paper will discuss udev, a program that replaces the functionality of devfs (only providing /dev entries for devices that are in the system at any moment in time), and allows for features that were previously not able to be done through devfs alone, such as:

  • Persistent naming for devices when they move around the device tree.
  • Notification of external systems of device changes.
  • A flexible device naming scheme.
  • Allow the kernel to use dynamic major and minor numbers
  • Move all naming policy out of the kernel.

This paper will describe why such a userspace program is superior to a kernel based devfs, and detail the design decisions that went into its creation. The paper will also describe how udev works, how to write plugins that extend the functionality of it (different naming schemes, etc.), and different trade offs that were made in order to provide a working system.


Download PDF.