Difference between revisions of "Linux device management"
m (→Original Text: internal links for udev & sysfs) |
|||
Line 23: | Line 23: | ||
functionality, but the system proved to have problems which could not | functionality, but the system proved to have problems which could not | ||
be easily fixed. | be easily fixed. | ||
− | udev is the "new" way of managing /dev directories, designed to clear | + | [[udev]] is the "new" way of managing /dev directories, designed to |
− | up some issues with previous /dev implementations, and provide a robust | + | clear up some issues with previous /dev implementations, and provide a |
− | path forward. In order to create and name /dev device nodes | + | robust path forward. In order to create and name /dev device nodes |
corresponding to devices that are present in the system, udev relies on | corresponding to devices that are present in the system, udev relies on | ||
matching information provided by sysfs with rules provided by the user. | matching information provided by sysfs with rules provided by the user. | ||
− | sysfs is a new filesystem to the 2.6 kernels. It is managed by the | + | [[sysfs]] is a new filesystem to the 2.6 kernels. It is managed by the |
kernel, and exports basic information about the devices currently | kernel, and exports basic information about the devices currently | ||
plugged into your system. udev can use this information to create | plugged into your system. udev can use this information to create |
Revision as of 22:47, 5 October 2005
Linux: Devices
Notes
- Copied from http://www.reactivated.net/writing_udev_rules.html because
it seemed like it might be useful information, even if it contained some inaccuracies. Original document was published under [http://www.gnu.org/licenses/gpl.html GNU General Public License, Version 2].
Original Text
A basic introduction only, might not be totally accurate. On typical linux-based systems, the /dev directory is used to store file-like device nodes which refer to certain devices in the system. Each node points to a part of the system (a device), which might or might not exist. Userspace applications can use these device nodes to interface with the systems hardware, for example, XFree86 will "listen to" /dev/input/mice so that it can relate the users mouse movements to moving the visual mouse pointer. The original /dev directories were just populated with every device that might possibly appear in the system. /dev directories were typically very large because of this. devfs came along to provide a more managable approach (noticably, it only populated /dev with hardware that is plugged into the system), as well as some other functionality, but the system proved to have problems which could not be easily fixed. udev is the "new" way of managing /dev directories, designed to clear up some issues with previous /dev implementations, and provide a robust path forward. In order to create and name /dev device nodes corresponding to devices that are present in the system, udev relies on matching information provided by sysfs with rules provided by the user. sysfs is a new filesystem to the 2.6 kernels. It is managed by the kernel, and exports basic information about the devices currently plugged into your system. udev can use this information to create device nodes corresponding to your hardware. sysfs is mounted at /sys and is browsable. You may wish to investigate some of the files stored there before getting to grips with udev. Throughout this document, I will use the terms /sys and SYSFS interchangeably.