This chapter describes the-HAL(Hardware abstraction layer), a set of libraries built on Linux drivers. It is not part of the Linux kernel, but rather belongs to the application layer on top of the Linux kernel layer.
In order to meet the requirements of these Linux drivers who do not want to open source , the runtime layer in the Android hierarchy adds a HAL, thereby unifying the calling interface of the hardware, solves the GPL Copyright Issue and addresses some special requirements.
In the new hal The core code in the architecture is still the same, just adding a new entry code, Enable these programs to be automatically android system identification. android HAL <android source code directory >/hardware directory.
led driver did not add hal code, but a variety of test methods used are directly accessed through drive device file in the same way as led drive interaction. This section will first make a change to the previous line, write the linux drive, Then write hal Library Finally, the Span style= "FONT-FAMILY:CALIBRI;" >service Library
The steps and principles of writing the Hal module, the first step: defining structs and macros, step two: Writing the Hal module's open function, step three: defining hw_module_methods_t struct variables, step fourth: Define hal_module_info_sym variables, step fifth: Write HAL The close function of the module , step sixth: Write A function that controls the LEDs.
http://www.cnblogs.com/SJ-0325/
hal--hardware Abstraction Layer Reading notes