udev and automatic network configuration
This week, Linux.ars takes a look at udev, the user-space implementation of devfs, as well as a guide to automatic network configuration with Debian. Last, but not least, we take a peek at watching cable with tvtime.
udev: automatic device node creation
Device nodes
Device nodes in *nix systems are special files that provide a sort of interface to programs in order to facilitate the manipulation of devices ? both physical devices as managed by device drivers in the kernel and virtual devices that control various aspects of the kernel’s behavior. Whenever you hear the phrase “everything is a file to UNIX,” the speaker is referring in part to the concept of device nodes, which can frequently be accessed and handled like any other file in the system and for special manipulation (such as changing certain device settings), the ioctl system call can be made on these device nodes.
Traditionally, device nodes are stored in /dev; under Linux, the naming scheme and hierarchy of device nodes is specified by the Linux Standard Base. Currently, the device driver in the kernel expects to have data and control messages “addressed” to a pair of numbers, called the major and minor device numbers that the corresponding special files hold.
As an example, the input core mouse device that is used to get readings off a USB mouse is a character special file (which is to say that a program can read a stream of characters from it, as opposed to a block special file, which supports the ability to consistently seek into arbitrary locations within the device; examples are storage volumes, such as IDE disks and partitions). The input core mouse device carries the major number 13 and minor number 63. (A specific pair of major and minor numbers will indicate different block and character devices; for instance, while the character device with numbers 13, 63 is the input core mouse driver, the block device with those major and minor numbers is the sixty-third partition on an XT hard disk. In other words, major and minor numbers live in different namespaces for character and block devices.)
