Reading notes (ix)

Source: Internet
Author: User

HAL: Hardware Abstraction Layer

The HAL (Hardware abstraction Layer, the hardware abstraction cavity, is a set of flip 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. 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, because this is the standard operation of calling the standard functions of the Linux kernel (such as IO bit ad32) while the Linux-driven business logic section strikes some businesses or individuals who do not want to expose the source code. Although these lipux drivers are free to users ' use, because these Linux drive implementations involve some technical patents or commercial secret kilns, exposing the source code can be a big hassle. But as a Linux. Driver, you have to expose the source code. This is because the Linux kernel uses the GPL protocol (see 6j.3. Section), and the GPL protocol requires that all programs that use the GPL-based source code must be open source because Linux drivers are part of the Linux kernel, Linux drivers must be open source.

The steps and principles for writing the HAL module are as follows. 1th Step: Define structs and macros.

The 2nd step is to write the HAL module's open function.

3rd step: Define the Hw_module_methods_ t struct variable.

4th step: Define the HAL_MODULE_INFO_SYM variable.

5th step: Write the close function of the HAL module.

6th Step Z Write the function that controls the LEDs.

There are two ways to use Linux drivers in an Android system, and one is to interact directly with Linux drivers in a traditional way. For example, directly read and write the data of the device files, and the other is Android-specific, that is, through the HAL module.

http://home.cnblogs.com/u/lkm-6398/

Reading notes (ix)

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.