Reading notes the Nineth Chapter

Source: Internet
Author: User

Nineth Chapter
Hal is a set of libraries built on Linux drivers. This library is not part of the Linux kernel, but rather belongs to the application layer on top of the Linux kernel layer. can be used to protect authors who do not want to expose source code.
The HAL architecture is simple, and the basic principle is to use the library in Android to invoke Linux drivers in kernel space, and then the Android application can access the libraries in the HAL through the NDK program, or access the libraries in the HAL directly in the Android application.
To write a Linux driver that supports HAL:
1, write Linux driver, Linux driver code to try to brief, as far as possible to put business logic into the HAL Library.
2, write HAL Library,hal Library is a common Linux library file, single such library file has an interface. Implemented by Hal_module_info_sym variables.
3, the preparation of service Library, this is the necessary steps.
Test read-Write register operations: During the process of writing Linux drivers and driver-related programs, each part of the program should be tested in pieces, and each part should be tested using the appropriate method to minimize the currently written program bugs.
Steps and principles for writing HAL modules:
1. Define the structure and macros.
2. Write the HAL module's open function as a program entry port.
3, define HW_MODULE_METHODS_T structure variables.
4, define the HAL_MODULE_INFO_SYM variable.
5. Write the close function of the HAL module.
6, write the function of control led.

Reading notes the Nineth Chapter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.