How to get info into HAL?

Bob Smith bsmith at linuxtoys.org
Sat Jul 15 13:12:59 PDT 2006


Matthew Garrett wrote:
> On Fri, Jul 14, 2006 at 12:50:35PM -0700, bsmith wrote:
>>BTW: I work for PalmSource where we are building a highly memory
>>constrained desktop on dedicated hardware.  (PDAs have become
>>small desktops these days.)  HAL seems pretty tightly tied to the
>>PC (and ACPI) and might be a poor fit for a handheld system with
>>an ARM CPU, battery, low disk, and relatively low RAM.
> 
> So this is obviously not a desirable situation. Are the issues with 
> dependencies, resource usage, disk usage or more general functionality? 
> There's almost certainly low-hanging fruit in terms of memory savings.
> 
> Providing your hardware is exposed through the standard kernel 
> interfaces, ensuring that HAL knows about it shouldn't be difficult. A 
> better understanding of what problems you're facing should help here.

Matthew
    From my reply to Richard ....
 >  I've given up on HAL as being too undocumented to use.

While what I said about assumptions is still true, the
immediate problem was that I had three days to figure out
HAL and add a new (non-ACPI) battery to it.  At the end
of three days I still had no idea how to start and my two
posts to this mailing list were unanswered.  It wasn't
footprint -- is was the documentation.  A "use the source"
mantra is fine for core contributors but I just wanted to
add what should have been a very simple device.

The Hardware Abstraction Layer is crucial to the success
of Linux, and while I've given up on HAL, I sincerely hope
that no one else on the mailing list has.  If you do rewrite
HAL to make it modular, please write the following two
documents as part of your effort:

- HAL Architecture and Design
  Present and explain a high level block diagram of the whole
system including what the major components are, why they are
needed, and how they communicate and interact.  Of more use
that a code review is a _data_ review.  I can easily see
what the code does, but I can not always tell how a variable
is used or what it means.

- HOWTO to Add a New Device to HAL
  Give an overview of the steps needed to add a new device.
Describe how to get HAL to collect the device information.
Describe what you expect a device driver to make visible in
/sys and the format you expect the data to take.  (I don't
know what else to add here since this was my original
question and I never did figure it out.)

To get someplace, you need to know both where you are going
and how to get there.  That is, I think you might be well
served to have at least a draft of the above two documents
done before you start writing any new code.


One final request:  It seems like a lot of projects, including
HAL, are adding (and reinventing) databases and database APIs
and methods.  Please recognize that you really are building
a database and treat it as a real database.  I've had good
luck using Run-Time-Access to make daemon embedded databases
look like databases.


thanks
Bob Smith




More information about the hal mailing list