devices-overview - Hardware Detection and Discovery
devices-overview - Hardware Detection and Discovery
Updated: 09 November 2000
Create a central repository for recording information about system hardware.
This system, should be field extensible;
that is, a third party should be able to augment the system without affecting other third party additions.
To be field extensible, the system is modular;
this has a side benefit of allowing pieces to be upgraded independently.
At boot time, the detection system runs as /etc/rcS.d/S90detector, the script assumes that the file system is stable.
The systems executes a series of scripts to scan all known hardware and stores this information in a new file.
Next, the system compares the new detection with the previous detection and executes scripts to configure different aspects of the system.
|/etc/devices||The root of the detection system|
|/etc/devices/devices.inf||The current state of the hardware on the machine|
|/etc/devices/devices.new||Hardware detected at boot time|
|/etc/devices/devices.bak||Hardware state before boot|
|/etc/devices/devices.ovr||Overrides detected hardware parameters in devices.inf|
|/etc/devices/det_util/||Scripts for detecting the hardware|
|/etc/devices/det_order/||Symlinks to /etc/devices/det_util to indicate the order of hardware detection, see below|
|/etc/devices/conf_util/||Scripts for configuring hardware when a change is detected|
|/var/log/devices.log||Log of detection process; this is created every time the detect script is run|
This file contains information about all known devices.
Each device starts with an class identifier in square brackets followed by tag = value pairs.
hwaddr = 00:90:27:58:63:6C
driver = eepro100.o
manu = Intel Corporation
desc = Intel EtherExpress PRO/100 PCI (82557)
pci = 0x8086, 0x1229, 14
Common device classes are:
NOTE: this list is incomplete, any device class may be added
|cdrom||CD-ROM or CD-RW|
|zip||zip, jazz or ditto (removable mass storage)|
|ide||IDE controller (hard disk interface)|
|usbhub||USB hub plugged into USB controller|
|boot||Control over LILO boot image|
|monitor||Monitor connected to video card|
|display||a virtual device, this controls resolution and refresh rates|
Common device tags are:
NOTE: all tags are optional
|desc||Description of device|
|manu||Manufacturer of device|
|model||Model of device|
|driver||Driver required to access device|
|pci||PCI bus information|
This is a collection of shell and Perl scripts that detect hardware.
The script should report discovered hardware by printing the information to stdout
in the same format as the devices.inf file.
The script that invokes the det_util scripts gathers the information and builds one file, devices.new.
Some scripts call programs which may probe hardware,
other scripts discover information already detected by the kernel or by looking for specific files.
A script must be in this directory to be included in the det_order directory.
|detect_boot||Look for files used to generate the LILO config file|
|Device class: boot|
|detect_disks||Detect mass storage devices on the IDE, SCSI and PCMCIA busses.|
|Device classes: disk, cdrom, zip|
|detect_floppy||Scan the Kernel messages looking for information about the floppy drives.|
|Device class: floppy|
|detect_kbd||Read information from /etc/kbd/keymapping|
|Device class: keyboard|
|detect_monitor||Currently, this produces a canned list of most VESA modes.Comming soon . . . we are working on reading the DDC information from the monitor.|
|Device class: monitor|
|detect_mouse||Call the pestcontrol utility; pestcontrol scans the serial ports and checks the PS/2 mouse port.|
|Device class: mouse|
|detect_pci||This script calls cprobe; cprobe scans the PCI bus and matches cards in the /etc/pcimap.inf file.|
|Device classes: video, scsi, ide, floppy, ipi, raid, storage, network, video3d, camera, audio, telephony, serial, parallel, winmodem, keyboard, point, mouse, input, firewire, accessbus, SSA, usb-stack, SMBus, irda, IRcon, RFcon, I2O, TVcon|
|detect_printer||Ask the kernel what it has detected.|
|Device class: printer|
|detect_raid||This script translates the information from /etc/raidtab|
|Device class: raid|
|detect_usb||Ask the kernel what devices are attached to the USB.|
|Device classes: audio, keyboard, mouse, joystick, printer, usbhub, usb|
|detect_xserver||This script detects the current version of the X Server to ensure that the config scripts are generated for the correct version.|
This directory defines the order that the hardware will be detected.
This is done by creating symlinks to the det_util directory in the form D##detutil;
the ## is a number from 00 to 99, the symlinks are invoked in numerical order.
update_det_order should be used to create and remove these links.
When installed, the detection package used update_det_order to create symlinks ...
update_det_order detect_pci 10
update_det_order detect_usb 20
update_det_order detect_disks 30
update_det_order detect_mouse 41
update_det_order detect_kbd 42
update_det_order detect_monitor 60
update_det_order detect_printer 62
update_det_order detect_xserver 80
update_det_order detect_boot 85
update_det_order detect_floppy 90
update_det_order detect_raid 35
When the detection systems runs, it creates a new set of information called devices.new.
The code copies devices.inf to devices.old then compares devices.new to devices.inf.
Any differences between the two files are copied to the devices.inf file
and the script for the corresponding device class is executed.
For example, if the detection discovers that the user has changed their video card,
the script conf_util/video will rebuild the X server configuration files to reflect the change of video card.
|audio||Install driver in /etc/modules|
|cdrom||Run fooze, then restart autofs|
|disk||Run buildhdinf then fooze|
|mouse||Create a symlink to /dev/mouse then run buildxconf|
|network||Install driver in /etc/install and restart the interface|
|usb-stack||Install driver in /etc/modules|
|video||Special code to load the agpgart module if necessary and then run buildxconf|
|winmodem||Install driver in /etc/modules|
|zip||Run fooze, then restart autofs|
|/sbin/detect||This is the script which controls the detection process|
|/etc/init.d/detector||This script calls detect from the run-levels|
|This is run as /etc/rcS.d/S90detector.|
|/sbin/update_det_order||This utility installs and removes symlinks from the det_order directory.|
|etcdev||Query or Get information from devices.inf style files|
|etcdevdiff||Compare devices.inf and devices.new, copy changes and execute scripts from the conf_util directory.|
|etcdevovr||Apply the devices.ovr file to the devices.new file.|
|etcdevset||Set information in devices.inf style files|
|buildhdinf||Create the /etc/harddrive.inf file used by fooze to create the fstab and lilo.conf files.|
|ddetective||Disk Detective; determine the contents of a partition.|
|fooze||Create the /etc/fstab and any necessary mount points as well as building/etc/lilo.conf, /etc/lilop.conf and running lilo.|
|buildxconf||Create the /etc/X11/XF86Config file to configure the X server.|
The detection will restart if any changes are detected.
This may happen upto 3 times.
|/etc/rcS.d/S90detector||is symlinked to /etc/init.d/detector|
|/etc/init.d/detector||executes /sbin/detect probe|
|/sbin/detect||run the detection system...|
|copy devices.inf to devices.old|
|Execute the symlinks from det_order and pipe the output to devices.new|
|Use etcdevovr to apply the devices.ovr file to devices.new|
|Use etcdevdiff to compare and edit devices.inf with devices.new.For each devices class that has changed, run the corresponding conf_util script.|
Robin Burgener, Corel Corporation, firstname.lastname@example.org