2010年11月23日 星期二

android 的 user space HAL

網路上一個有關user space HAL的問題
Q:
Hi All,

  I would like to know if there is any documents or related web links
for device driver development on "User Space Abstraction Layer ".
  I would appreciate if anyone can give me how this really works in
real world scenario.

 Thanks...

A:
I would suggest you to have a look of the overlay code in
hardware/libhardware/moudule/overlay.
In the new HAL architecutre, it introduced a "stub" concept which replaced
the legacy architecture which load the c/c++ library from java
application/service directly. In "stub", you need to implement some
interfaces and provide them to hardware service. For example if you wanna
implement a LED, the architecture will be:
Kernel Driver (driver to control the LED hardware) <-> syscall (open, close,
ioctl for LED, etc.) <-> hardware/libhardware/module/led (the led HAL
interfaces or "stub" ) <-> framework/base/services/jni/
com_android_server_LedService.cpp (the java native interface for LED )<->
framework/base/service/java/com/android/server/LedService.java (the java
interface of LED service <-> framwork/base/core/java
/android/hardware/LedManager (the java code of LED manager) and
ILedService.aidl (the android interface description language file for LED)
<-> LED application

這裡有一個文章連結

jollen的blog也有相關介紹文章

沒有留言:

張貼留言