Reading notes the Nineth Chapter

Source: Internet
Author: User

The HAL (Hardware abstraction Layer, the hardware abstraction cavity, is a set of flip fonts built on Linux drivers. This program is not part of the Linux kernel, but belongs to 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 trying to avoid direct access to Linux drives by the application. Linux drivers typically have two types of code in a traditional Linux system: the code that accesses the hardware register and the business logic code. There is no secret to the code that accesses the hardware registers, as this is the standard operation of calling the standard functions of the Linux kernel. To write a Linux driver that supports HAL: 1. Writing Linux drivers 2. Write the HAL Library3. Write the service. To write the HAL module steps: 1. Defining structs and Macros 2. Write the open function of the HAL module. 3. Define the structure variables of the hw_module_methods_t. 4. Define HAL--MODULE_INFO_SYM5. Write the close function of the HAL module. 6. Write the function of the LED. There are two ways to use the Linux driver in an Android system. One is to interact directly with Linux drivers in a traditional way. Data such as direct reading and writing of device files. The other is Android-specific, which is through the HAL module. The HAL module essentially interacts with Linux drivers through a Linux shared library. The application then accesses the Linux shared library.

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.