Search:  
Gentoo Wiki

HAL

Introduction

Traditionally, desktop applications discovered hardware by communicating directly with the kernel, which maintains the list of devices connected to the system. HAL makes information about certain classes of hardware accessible in a uniform format. When a new device powers up within the system (an event known as hotplugging), it can broadcast an asynchronous signal on the system message bus of the D-Bus IPC mechanism giving details of the new device and its capabilities. Any desktop application can connect to this message bus to discover the hardware. System-level scripts may also run to configure the device. kernel calls out to udev which in turn provides notifications to HAL through a standard Unix domain socket whenever a device plugs in. The HAL daemon (generally running as hald) maintains a list of devices; the list contains well-defined key-value pairs describing what each object represents. Each device object has a Universally Unique Identifier, or UUID. The HAL specification types and defines key-value pairs (namely device properties), so applications using HAL can interpret the values for each property.

HAL and D-Bus are inter-connected. D-Bus (Desktop Bus) allows programs to register on it for offering services to others. Programs can also register as waiting for events of the kernel like hot swapping hardware. D-Bus is implemented as a daemon. Each instance of D-Bus is called a channel. There is a privileged system channel and a private instance for each logged in user. The main mission of the system channel is to deliver the signals from the HAL daemon to the processes interested in them.

Using HAL

You will probably have HAL installed as a dependency if you have the hal use flag (you need hal and dbus useflags if you want to automount devices in KDE). You should check if you have hald in your default runlevel:

rc-update show | grep hald
               hald |      default

Otherwise, you should add it:

rc-update add hald default

hald maintains a database of the devices connected to the system system in real-time and connects to the D-Bus system message bus to provide an API that applications can use to discover, monitor and invoke operations on devices.

The lshal command queries the HAL daemon for devices and returns a list of all devices objects that the HAL daemon knows about.

To get detailed information on your logs, ask hald to be verbose changing your /etc/conf.d/hald:

HALD_VERBOSE="yes"

Information on how to understand hal information can be found in /usr/share/doc/hal-(your version)/spec/hal-spec.html or in the links at the end of this document.

See also

Retrieved from "http://www.gentoo-wiki.info/HAL"

Last modified: Fri, 05 Sep 2008 09:48:00 +0000 Hits: 2,739