Read "Android Deep Exploration (Volume 1) HAL and drive Development" some thoughts 09

Source: Internet
Author: User

Google for Android to join Hal mainly for the following purposes .

The calling interface for unified hardware. Because Hal has a standard calling interface, Hal can be used to mask the complex, non-uniform interface of Linux drives .

resolved GP l copyright issue. Because linux kernel based on GPL protocol, and android based on apache Licence 2. 0, agreement. So google played a" crossing "that would have been in linux< Span style= "font-family: the song Body;" > The sensitive code in the drive moves up one level . So these sensitive code out of the GPL linux drive "There is no need for open source.

For some special requirements. For some hardware, you may need to visit some user-space resources, or work that is inconvenient in the kernel space, and special needs. In these cases, the HAL code located in the user space can be used to assist the Linux driver in doing some work.

Steps to write a Linux driver that supports HAL

Step 1 , write Linux Drivers

"Writing Linux drives " is nonsense from the show, but if you want to add HALto the Linux drive and want to protect sensitive data as much as possible. the code for the Linux Drive should be as concise as possible to put the business logic into the HAL Library .

Step 2 : Write HAL

The HAL library is an ordinary Linux Library (*.so ) file. However, this type of library file has an interface. The SYM variable is module_info through the HAL. Service Library is defined in this interface by the ID positioning hallibrary the.

Step 3 : Write the Service Library

Although this step is not required, the new HAL architecture requires us to do so. the Service library is also a Linux library . This step is more flexible. Service Library it can be normal. Linux Library , or it can be JNI Library.

Read "Android Deep Exploration (Volume 1) HAL and drive Development" some thoughts 09

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.