Android HAL concept

2,016 views
Skip to first unread message

Dudero

unread,
Feb 25, 2011, 7:36:34 AM2/25/11
to android-platform
Hello,

i would like to learn more about the HAL concept in Android, but there
are really little information...

I found that that the HAL has developed from the module-concept of
>>libhardware-legacy<< to the stub-concept of >>libhardware<< - are
there more changes in the newer versions?

It would be really nice, if somebody can give me some background for
this interessting topic.


Greetz
dudero

Ashutosh Deshmukh

unread,
Feb 27, 2011, 2:01:13 PM2/27/11
to android-platform
Let us consider this situation.

You set the screen timeout in the device for 30 sec and now that 30
sec duration is over.
What Android will do? How will be the flow of action and what
components of Android system are involved?

First PowerManagerService will call the JNI method to turn off the
screen. This JNI method will in turn invoke a function which is
implemented in HAL.

The HAL code will receive the input from JNI call and it will try
operate on the interface provided by the Lower level drivers.
In the power management example above, the interface is sysfs files
exported by Android power management driver.

So, it is the HAL code which is actually doing the talking to lower
level interfaces.

Hope this helps.

FrankG

unread,
Feb 28, 2011, 3:52:54 PM2/28/11
to android-platform
No, this doesn't fit in my eyes into the definition of a HAL. IMHO a
HAL
handles low level interaction with hardware and the different hardware
architectures
for the operating system.


On 27 Feb., 20:01, Ashutosh Deshmukh <ashutosh.deshmukh2...@gmail.com>
wrote:
> > dudero- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

Dianne Hackborn

unread,
Feb 28, 2011, 8:29:37 PM2/28/11
to android-...@googlegroups.com, FrankG
Then call it something else in your head. :}


--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.




--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Chinmay S

unread,
Mar 1, 2011, 12:13:12 AM3/1/11
to android-...@googlegroups.com, Dianne Hackborn, FrankG
@Dianne LOL :)

@FrankG what you said is the classic definition of a HAL (i.e. Hardware Abstraction Layer).

At this stage, let me first affirm you statement,
Android HAL DOES handle low level interaction with hardware and the different hardware architectures.
But the HAL is NOT the lowest level of abstraction. Rather it sits on top of the Kernel device drivers.

There is often a standard interface which the Kernel device-drivers support
& which the Android HAL expect the drivers to support. The communication
between the HAL & drivers happens using this interface.

Earlier we used to see a lot of IOCTLs being used as the standard interface.
Recently we see a conscious effort to move towards using the sysfs as the
standard interface between the HAL & the Kernel device-drivers.

Regards
CVS

Frank Grützmacher

unread,
Mar 1, 2011, 7:31:31 AM3/1/11
to Dianne Hackborn, android-...@googlegroups.com
Hi Dianne,
 
?? Why so hard with me.
 
I didn't expect that you read such a discussion.
 
All the best for you ! Frank

2011/3/1 Dianne Hackborn <hac...@android.com>

Frank Grützmacher

unread,
Mar 1, 2011, 7:38:24 AM3/1/11
to Chinmay S, android-...@googlegroups.com


2011/3/1 Chinmay S <cvs...@gmail.com>
Hello !
 
Yes, you are right .. my definition fits better in the case where you have a implementation
of a certain functionality like some communication protocols and you need to support
different hardware archictures.
 
Thanks to clarify it.
 
Frank

Arun K. Singh

unread,
Mar 2, 2011, 9:20:51 AM3/2/11
to android-...@googlegroups.com, Chinmay S, Dianne Hackborn, FrankG
> At this stage, let me first affirm you statement,
> Android HAL DOES handle low level interaction with hardware and the
> different hardware architectures.
> But the HAL is NOT the lowest level of abstraction. Rather it sits on top of
> the Kernel device drivers.
>
> There is often a standard interface which the Kernel device-drivers support
> & which the Android HAL expect the drivers to support. The communication
> between the HAL & drivers happens using this interface.
>
> Earlier we used to see a lot of IOCTLs being used as the standard interface.
> Recently we see a conscious effort to move towards using the sysfs as the
> standard interface between the HAL & the Kernel device-drivers.

How does this "low level hw interaction" definition classify this
layer to be "Hardware abstraction layer"?
That way every platforms bsp or firmware code should also be a "HAL"?
The very fact that this so called "HAL" sits on top of well defined
kernel sysfs i/f makes it no good for any abstractions ... unless we
miss any other feature of this layer classifying it to be HAL?

hw abstraction should not be construed as "low lever interactions", imho ...

Thanks,
Arun

Chinmay S

unread,
Mar 2, 2011, 10:10:10 AM3/2/11
to Arun K. Singh, android-...@googlegroups.com
Hi Arun,

Right you are!! :)
In general, the "HAL" always goes below the kernel.

exexutive-kernel-mode.jpg

I wonder why its a bit different in the Android eco-system.
Should we stop calling the Android HAL a "HAL".
Any comments anyone?...


Regards
CVS

Arun K. Singh

unread,
Mar 2, 2011, 1:05:34 PM3/2/11
to Frank Grützmacher, android-platform
Hi Frank,

> I agree with you ..I see the HAL also more as hardware abstraction.
> When you provide certain sw like a usb implementation for
> different hw platform ( i.e. for different TI or Infineon platforms )
> then you build them against different HALs ..
>
> I think the whole sysfs handling really depends from the concrete
> manufacturer.
> The asop platform will have on kind of kernel interface .. and the different
> manufacturers
> like samsung or log will have more or changed sysfs handles.
>
> So in my eyes the HAL depends from hardware platform and the sysfs interface
> depends
> more from the supported features on this platform.
>
> Just my two cents to this.

This sounds to me like the closest explanation for Android "HAL" to
not sound incongruous with its abbreviated name. Thanks for sharing
same!

CVS: I hope you too would agree with this definition!

Best Regards,
Arun
www.crazydaks.com

Reply all
Reply to author
Forward
0 new messages