-   Programming (
-   -   Hal (

gamehack 12-15-2004 06:13 AM

Hello all,

I want to integrate HAL into an application but I cannot find any HOWTO. Does somebody know if some tutorials exist?


Marius2 12-15-2004 07:26 AM

Huh? What exactly do you mean by the term "HAL"? If you're talking about the hardware abstraction layer, you don't integrate that in an application since it's already there, and as long as you stick to using the OS you are using it automatically (since, for example, you don't talk to the graphics adapter directly, you're using Xlib or whichever graphics library).

gamehack 12-15-2004 08:01 AM

I meant this

Marius2 12-15-2004 08:25 AM

It's already in your X server, you don't have to add anything to your application than Xlib (and, if required, its extensions).

kamstrup 12-15-2004 12:30 PM

From the HAL faq:

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.

-- Main.DavidZeuthen - 24 Nov 2003
Isn't that contradicting your claims Marius2 ?

Marius2 12-16-2004 01:54 AM


Originally posted by kamstrup
Isn't that contradicting your claims Marius2 ?

No - actually the opposite is the case.

Maybe a small sketch may shed more light on this, we're talking of the following layers:

gamehacks application
|talks to, through standardized interfaces
X server (Xlib for example, that's the libs mentioned by Mr. Zeuthen)
|talks to, through its own interfaces
|talks to, through OS and implementation specific interfaces
|talks to, through hw specific interfaces (=hw registers)

As you can see, an application would not talk to the HAL directly. Actually it would be a bad idea to do so (its very well possible, at least if you have the appropriate bindings), since the HAL may be implementation specific, that is: XFree86 HAL may be completely different from Xorg HAL (while the interfaces to application level are the same).

kamstrup 12-16-2004 02:38 AM

I must admit not being a X hacker in any way, but how would XLib be aware of digital cameras? I would more excpect this to be a Gnome thing..?

Marius2 12-16-2004 03:03 AM

I did not say that Xlib can handle cameras (if it can, I'd rather
suspect the functionality to be in the X extensions). This was
just to illustrate the relation to Mr. Zeuthens remark.

All times are GMT -5. The time now is 10:44 AM.