HAL (Hardware abstraction Layer, Hardware abstraction cavity) is a set of turn-up fonts built on Linux drivers. The program's J rate does not belong to the Linux kernel, but is the application layer on top of the Linux kernel layer. Google's main purpose of adding HAL to Android is to protect "private property" in addition to avoiding direct access to Linux drivers. -For those who both want to publish stubble · For Android, the Linux driver, and the enterprise or individual that does not want to expose the core business logic, this time HAL seems very important.
In traditional Linux. Linux drivers in the system generally have two types of code: the code that accesses the hardware register and the business logic has code. There is no secret to the code that accesses the hardware registers, as this is a standard operation for calling the standard functions of the Linux kernel (such as ioad32 iowrite32, etc.). The rationale behind this is that it is simpler to use a library CSO file in an Android system to call a Linux driver with a gatekeeper kernel space (typically accessed through a device file). Then communicate with the 1droid side program {APK file), or you can access the program library in the HAL through the NDK program, or you can access it directly from your Android program.
Steps to write Linux drivers that support HAL: 1. Writing Linux drivers 2. Write HAL Library 3. Write the Service Library.
There are two ways to use Linux drivers in Android. One is to interact directly with the Limux driver in a traditional way. For example, directly read and write data from a device file. In addition → Species is unique to Android, that is, through the HAL Module HAL module is essentially through the Linux shared library and Linux driver interaction, and then the application to access Linux. Shared libraries. Early HAL module applications were called directly by accessing the Linux common font. The higher version of the Android system for Hal I added a stub in other words or for each Hali shared library to specify an ID, and then use this ID with a certain rule to find the Linux shared library, so that the Linux shared library to replace the file name, mobile location is very convenient.
http://www.cnblogs.com/suntao123/
Android transplant and Driver Development Nineth Chapter Experience