Android Deep Explore Nineth Chapter

Source: Internet
Author: User

Hal is a set of libraries built on Linux drivers. This library is not part of the Linux kernel, but is the application layer on top of the Linux kernel layer. Google's main purpose of adding Hal to Android is to avoid direct access to Linux drivers, and there is an important reason to protect ' private property '.

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.

Google's addition to the HAL for Android is mainly for the following purposes:

(1) The calling interface of the unified hardware. Since HAL has a standard calling interface, HAL can be used to shield Linux drivers from complex and non-uniform interfaces.

(2) fixed the issue of GPL copyright. Because the Linux kernel is based on the GPL protocol, Android is based on the Apache Licence 2.0 protocol. So Google played a traversal, moving the sensitive code that was already in the Linux drive up one level. This way, these sensitive code is freed from the GPL, and there is no need for open source Linux-driven authors.

(3) for some special requirements. For some hardware, you may need access to some user-space resources, or work that is inconvenient in kernel space, and special needs. In this case, the HAL code located in the user space can be used to assist the Linux driver to do some work.

The source code storage location of the Android HAL is not fixed and is typically stored in the <android source directory >/hardware directory.

Android Deep Explore 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.