Android Deep Explore (Vol. 1) Hal with Driver Development Nineth Chapter reading notes

Source: Internet
Author: User

This chapter focuses on the hardware abstraction layer:HAL. Hal is built on Linux Drive A set of libraries,Google for Android to join HAL mainly for the purpose of the following.

1. Calling interface for unified hardware

2. Fixed the issue of GPI copyright

3. For a number of special requirements

In the LED driver, we joined HAL to use the program does not need to care about the Linux driver and device files interactive way. To write a Linux driver that supports HAL:

First step: Writing Linux drivers

Step two: Write the HAL Library

Step three: Write the Service library

The steps and principles for writing the HAL module are as follows:

First step: defining structs and macros

Describes the hw-module-t structure of the HAL module

Describes the hw-device-t structure of a HAL device

HW-MODULE-METHODS-T Structure describing the module entry function

Step two: Write the HAL module's open function

Step three: Define HW-MODULE-METHODS-T structure variables

Fourth step: Define the hal-module-info-sym variable

Fifth step: Write the close function of the HAL module

Sixth step: Write the function that controls the LED

Linux drivers are used in Android systems in two ways. One is the traditional way to directly interact with the Linux driver, the other is Android -specific, is the HAL module.

Android Deep Explore (Vol. 1) Hal with Driver Development Nineth Chapter reading notes

Related Article

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.