1 HAL is a set of libraries built on Linux drivers that are not part of the Linux kernel but belong to the application layer on the Linux kernel layer. Its purpose is to protect "private property" and to avoid direct access to Linux Drivers by the application .
2 There are two ways to use Linux drivers in an Android system. One is to interact directly with Linux in a traditional way , such as directly reading data from a device file. The other is Andrid Unique, is through the HAL module.
The 3 HAL module essentially interactswith Linux drivers through a Linux shared library (.so). The application then accesses the Linux shared library.
4 each HAL Shared library specifies an ID to locate the corresponding .so by ID . File (called Stubhere). Google also recommends using stubs to write HAL modules.
5 steps and principles for writing HAL modules:
(1) Defining structures and macros
(2) Writing the HAL module's open function
(3) Define hw_module_methods_t structure variables
(4) Define hal_module_info_sym variables
(5) Write the close function of the HAL module
(6) Write a function to control the LED
6Android System's properties file Total 4 : /default.prop;/system/build.prop;/system/default.prop;/data/ Local.prop. Android will automatically load these properties files at startup.
My blog Address
http://www.cnblogs.com/zhanghui4521/
Read the "Hardware abstraction Layer: HAL" experience