LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Hal (http://www.linuxquestions.org/questions/programming-9/hal-266595/)

gamehack 12-15-2004 05:13 AM

Hal
 
Hello all,

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

Thanks

Marius2 12-15-2004 06: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 07:01 AM

I meant this http://www.freedesktop.org/wiki/Software_2fhal

Marius2 12-15-2004 07: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 11:30 AM

From the HAL faq:
Quote:

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 12:54 AM

Quote:

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
V
X server (Xlib for example, that's the libs mentioned by Mr. Zeuthen)
|
|talks to, through its own interfaces
V
HAL
|
|talks to, through OS and implementation specific interfaces
V
driver
|
|talks to, through hw specific interfaces (=hw registers)
V
hardware

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 01: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 02: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 06:16 PM.