"Android Deep Exploration" (Vol. 1) Hal and Driver Development Nineth Chapter Experience

Source: Internet
Author: User

This chapter mainly studies the hardware abstraction layer: HAL.

The hardware abstraction layer of Android, simply, is the encapsulation of the Linux kernel driver, providing an interface upward, shielding the implementation details of the lower level. That is, the support for the hardware is divided into two layers, one layer in user space, one layer in the kernel space (Kernel spaces), where the hardware abstraction layer runs in user space, and the Linux kernel driver runs in kernel space. Why do we have to do this? Is it not OK to combine the hardware abstraction layer with the kernel driver and put it in the kernel space? From a technical implementation point of view, it is possible, but from a commercial point of view, the hardware support logic is placed in the kernel space, may harm the interests of manufacturers. We know that the Linux kernel source code copyright complies with the GNU License, while the Android source code copyright complies with Apache License, the former must publish the source code when publishing the product, while the latter does not need to publish the source code. If the hardware support for all the code is placed on the Linux driver, it means that the release of the source code to expose the driver, and open source code means that the hardware parameters and implementation are open, in the mobile phone market competition today, which for manufacturers, the damage is very large. Therefore, Android will think of hardware support into the hardware abstraction layer and the kernel driver layer, the kernel driver layer only provides simple access to hardware logic, such as read and write hardware registers of the channel, as to what value from the hardware or write what value to the hardware logic, are placed in the hardware abstraction layer, This will hide the business secrets. It is also because of this layering that Android is kicked out of the Linux kernel mainline code tree. As you can imagine, the hardware support for Android's driver in kernel space is incomplete, and when the Linux kernel is ported to another machine, the hardware is completely useless due to lack of support from the hardware abstraction layer, which is why Android is an open system rather than an open source system.

Aside from these arguments, learning about the Android hardware abstraction layer is extremely useful for understanding the entire Android system, as it involves the hardware drive layer of the Android system, the hardware abstraction layer, the runtime library, the application framework layer, and so on. The following diagram illustrates the location of the hardware abstraction layer in the Android system and its relationship to other layers, as well as the role Hal plays throughout the Android system throughout the boot process and during application invocation.

http://www.cnblogs.com/z378560707/

"Android Deep Exploration" (Vol. 1) Hal and Driver Development Nineth Chapter Experience

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.