Frequently Asked Questions about HAL

Feel free to either update this page or send suggestions to [[David]]. Some of the answers are copy/paste from public mailing lists and are not necessarily from myself.

What is the point of HAL?

To merge information from various sources such that desktop applications can locate and use hardware devices. The point is that the exact set of information to merge varies by device and bus type. In order to do this, we need to define a format for the information, hence the HAL specification.

We may read some stuff from the hardware itself, then add some info provided by the kernel, then add some metadata from some systemwide files, then add some data that has been obtained by the desktop and stored per-user, then look at some blacklist, and finally we have a complete picture of everything known about that particular device.

An extra value is that we can do this in an operating system independent way. Stuff like this is important to the major desktop environments.

Isn't this already handled today? Why do we need Yet Another Abstraction Layer?

Things aren't handled properly today in the sense that there's no UI on it, there's no integration with applications. To add that on the desktop/app level, we first have to have a single API that will work with different kinds of device and on different operating systems.

One principle to keep in mind is: application code should not know the details of specific devices. If I add a new device model, apps should automatically use it. Ideally, I can even add a new kind of bus and apps can use devices on that bus; e.g. an app doesn't care if a scanner is SCSI or USB. From an OEM standpoint, if I submit a patch to one or a small well-defined set of projects, then my device should get used by all the interesting apps. You may be lumping all user space code together. Remember that the main desktop apps are built on dozens of libraries, all with opaque long-term-frozen ABIs that create additional abstraction layers.

Will HAL slow down access to my hardware?

No. HAL is simply just a piece of user-space software that maintains a list of device with well-defined properties for each device. In addition, HAL provides space for application defined properties per device.

HAL is not concerned with how to use the hardware, nor is HAL concerned with configuring the hardware. However, HAL can be used in applications that needs the hardware by providing the list of devices and space for storing configuration values. One example is configuration files for display servers.

So what's the point of HAL if it's only a list of devices?

The fun can begin when (existing) libraries for accessing devices adopts HAL. The simplest use-case would be accessing a camera. The application programmer uses HAL for finding a camera device; he then tosses the HAL device id to the camera library and gets the pictures. In the process the application programmer is not concerned with any hardware specific parts of the device.

Other future applications of HAL include handling of pluggable storage, network-transparent device access, device ACL's, locking of devices etc. Right now we are working on the basics.

How to mount a specific storage device to a specific mountpoint using fdi files

Answer welcome ;)

How to choose the suspend method/backend ?

Answer welcome ;)

How to mount a media storage in r/w mode?

It seems that removable media storage are mounted read only, so you can't remove photos with hal. I know that hal doesn't mount anything but nothing is in /etc/fstab but in /etc/mtab and in /proc/mount I got:

     * /dev/sdd1 /media/disk vfat ro,nosuid,nodev,uid=501,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1 0 0  

Answer welcome ;)

-- Main.?DavidZeuthen - 24 Nov 2003