Overview of the hardware abstraction layer (HAL) for Android

Source: Internet
Author: User

In short, the hardware abstraction layer of Android encapsulates the Linux kernel driver and provides interfaces up to shield implementation details at the lower layer. That is to say, the hardware support is divided into two layers: one layer in the user space and the other layer in the kernel space, where the hardware abstraction layer runs in the user space, the Linux Kernel Driver runs in the kernel space. Why is this arrangement necessary? Is it not feasible to integrate the hardware abstraction layer with the kernel driver into the kernel space? From the technical implementation point of view, yes. However, from the commercial point of view, putting the hardware support logic in the kernel space may harm the interests of the manufacturer. We know that the Linux kernel source code copyright complies with GNULicense, while the Android source code copyright complies with ApacheLicense. The former must publish the source code when releasing the product, while the latter does not need to publish the source code. If you place all the code supported by the hardware on the Linux driver layer, it means that the source code of the driver must be published at the time of release, the open source code means that the hardware-related parameters and implementations are made public. In today's fierce competition in the mobile phone market, the damage is very huge for manufacturers. Therefore, Android will think of dividing hardware support into hardware abstraction layer and kernel driver layer. The kernel driver layer only provides simple access to hardware logic, such as reading and writing hardware registers, as for what value is read from the hardware or what value is written to the logic in the hardware, it is placed in the hardware abstraction layer, so that the trade secrets can be hidden. Because of this layering, Android is kicked out of the main line code tree of the Linux kernel. The driver program for Android in the kernel space does not provide complete hardware support. When we port the Linux kernel to another machine, the hardware abstraction layer is not supported, hardware is completely unavailable, Which is why Android is an open system rather than an open source system.

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.