which devices will be displayed in hal-device-manager
Dan Williams
dcbw at redhat.com
Wed Sep 7 04:21:32 PDT 2005
On Wed, 7 Sep 2005 WMWu at Winbond.com.tw wrote:
> Dear All:
>
> Which device will be displayed in hal-device-manager? My OS is Fedora
> Core 3, version of hal-device-manager is 0.4.0
Hi,
hal-device-manager will display any device that HAL itself knows about. Another
way to see all the devices HAL knows about is the 'lshal' command, which is
similar to the standard 'lspci' command.
HAL finds devices (and information about those devices) in a number of ways:
1) Reading various entries in /proc, for example mountpoints and other things.
Some device information is found here, but this is historical and most
everything for hardware devices should be in /sys already.
2) Reading stuff in /sys. This is _really_ important, and is highly
device-driver dependent. If a device driver doesn't expose its information via
the sysfs filesystem in /sys, then the driver is considered broken and buggy
anyway. For example, network device drivers MUST use the SET_NETDEV_DEV() call
to make the link from /sys/class/net/eth[x]/device to their device's entry in
/sys/bus/pci or /sys/bus/pcmcia. If you're writing a driver, make sure that it
follows the correct rules for exposing its details via sysfs. HAL will then be
able to see all its details. The Intel ipw2200 driver is a great example here.
3) .fdi files. When HAL can't determine details about a particular device from
the information in /proc, /sys, or other places, it looks at .fdi files and
merges the properties listed in those files onto the device node in the HAL
device list. This allows for detection of certain digital cameras and other
devices for which there is not enough identifying information.
4) Reading information from the device (?) I'm not sure if this is still done
for things like file systems, but HAL used to try to read some information from
various devices, like disks, to figure out what filesystem type they had, or
whether they were encrypted, etc.
If you're wondering why a device doesn't show up in HAL, first make sure that it
is listed in sysfs (/sys). Each device will usually have at least two entries,
for example /sys/class/net/eth0 (which is the capability of the device, and is
driver-created) and /sys/devices/pci0000:00/0000:00:1e.0/0000:02:00.0 (which is
from the Linux kernel PCI drivers). The driver-created entries, ie
/sys/class/net/eth0 needs to have a device link pointing to the second entry
here, the PCI one. That's created in the driver by SET_NETDEV_DEV() for
example. Other types of devices, like USB, IDE devices, etc, have similar
mechanisms for populating their sysfs directories.
In general, the earlier the kernel is in the 2.6 series, the worse the driver
support for HAL is. You should really only use HAL with 2.6.8 and later
kernels, and each kernel release after 2.6.8 gets better driver support for
sysfs, and therefore also for HAL.
David Z will probably have more to say, but hope this helps. Was there any
paritcular device that didn't show up that you were wondering about?
Dan
More information about the hal
mailing list