Android underlying driver development (i)

Source: Internet
Author: User
<span id="Label3"></p><p><p><span style="font-size:24px; color:#ff0000">1 <span style="font-family:宋体">Why Android joins the hardware abstraction layer</span> <span style="font-family:‘Times New Roman‘">HAL</span></span></p></p><p><p><span style="font-size:24px"><span style="color:#ff0000">A</span> <span style="font-family:宋体">Unified Hardware calling interface, so use</span> <span style="font-family:Times New Roman">HAL</span> to <span style="font-family:宋体">Shield</span> <span style="font-family:Times New Roman">linux</span> <span style="font-family:宋体">-driven complex, non-uniform Interfaces</span></span></p></p><p><p><span style="font-size:24px"><span style="font-family:宋体"><br></span></span></p></p><p><span style="font-size:24px"><span style="color:#ff0000"><span style="color:#ff0000">B</span></span><span style="font-family:宋体"><span style="font-family:宋体">Solve</span></span><span style="font-family:Times New Roman"><span style="font-family:Times New Roman">GPL</span></span><span style="font-family:宋体"><span style="font-family:宋体">copyright issues due to</span></span><span style="font-family:Times New Roman"><span style="font-family:Times New Roman">Linux</span></span><span style="font-family:宋体"><span style="font-family:宋体">kernel based on</span></span><span style="font-family:Times New Roman"><span style="font-family:Times New Roman">GPL</span></span><span style="font-family:宋体"><span style="font-family:宋体">agreement, This</span></span><span style="font-family:Times New Roman"><span style="font-family:Times New Roman">GPL</span></span><span style="font-family:宋体"><span style="font-family:宋体">the agreement requires open source, and</span></span><span style="font-family:Times New Roman"><span style="font-family:Times New Roman">Android</span></span><span style="font-family:宋体"><span style="font-family:宋体">comply with</span></span><span style="font-family:Times New Roman"><span style="font-family:Times New Roman">Apache License2.0</span></span><span style="font-family:宋体"><span style="font-family:宋体">agreement, This agreement does not require open source, so</span></span><span style="font-family:Times New Roman"><span style="font-family:Times New Roman">Google</span></span><span style="font-family:宋体"><span style="font-family:宋体">played a crossing that would have been in</span></span><span style="font-family:Times New Roman"><span style="font-family:Times New Roman">Linux</span></span><span style="font-family:宋体"><span style="font-family:宋体">the sensitive code in the drive (business logic Code) moves up a layer so that the sensitive code is just a</span></span><span style="font-family:Times New Roman"><span style="font-family:Times New Roman">GPL</span></span><span style="font-family:宋体"><span style="font-family:宋体">the binding of the agreement, those who do not want open source</span></span><span style="font-family:Times New Roman"><span style="font-family:Times New Roman">Linux</span></span><span style="font-family:宋体"><span style="font-family:宋体">the driver does not want to open source now without open source. </span></span></span></p><p><p><span style="font-size:24px"><span style="font-family:宋体"><br></span></span></p></p><p><p><span style="font-size:24px"><span style="color:#ff0000">C</span> <span style="font-family:宋体">for some special requirements. For some hardware, you may want to access the user space resources, the kernel is inconvenient to complete the work requirements, in this case, you can use the HAL code located in the user space</span> <span style="font-family:Times New Roman"></span> <span style="font-family:宋体">to assist</span> the <span style="font-family:Times New Roman">Linux</span> <span style="font-family:宋体">driver to do some Work. </span></span></p></p><p><p><span style="font-size:24px"><span style="font-family:宋体"><br></span></span></p></p><p><p><span style="font-size:24px; color:#ff0000">2 Android HAL <span style="font-family:宋体">architecture</span></span></p></p><p><p><span style="font-family:Verdana,Geneva,Arial,Helvetica,sans-serif; line-height:19px"><span style="font-size:24px"><br></span></span></p></p><p><p><span style="font-family:Verdana,Geneva,Arial,Helvetica,sans-serif; line-height:19px"><span style="font-size:24px">Hal currently has two architectures, the old HAL schema in the Libhardware_legacy directory, and the new HAL schema in the Libhardware directory. The two frameworks are as Follows:</span></span></p></p><p><p><span style="font-family:宋体"><span style="font-size:24px"></span></span></p></p><p style="line-height:19px; margin:10px auto; font-family:Verdana,Geneva,Arial,Helvetica,sans-serif"><p style="line-height:19px; margin:10px auto; font-family:Verdana,Geneva,Arial,Helvetica,sans-serif"></p></p><p style="line-height:19px; margin:10px auto; font-family:Verdana,Geneva,Arial,Helvetica,sans-serif"><p style="line-height:19px; margin:10px auto; font-family:Verdana,Geneva,Arial,Helvetica,sans-serif"></p></p><p style="line-height:19px; margin:10px auto; font-family:Verdana,Geneva,Arial,Helvetica,sans-serif"><p style="line-height:19px; margin:10px auto; font-family:Verdana,Geneva,Arial,Helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif"><span style="color:#ff0000">3 Android underlying driver development process</span></span></p></p><p><p><span style="font-size:24px">First Step: write a simple Linux driver</span></p></p><p><p><span style="font-size:24px">Step Two: Write the HAL layer code</span></p></p><p><p><span style="font-size:24px">Step three: Write the JNI layer code</span></p></p><p><p><span style="font-size:24px">Fourth Step: write a Java library that calls JNI</span></p></p><p><p><span style="font-size:24px">Fifth step: Android app layer test</span></p></p><p><p><span style="font-size:24px"></span></p></p><p><p>Android underlying driver development (i)</p></p></span>

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.