Learn the Nineth chapter, the Hardware abstraction layer:HAL. HALThe hardware abstraction layer is built on theLinuxa set of libraries on top of the driver. Belong toLinuxthe application layer on the kernel layer. HALThe main purpose is to avoid direct access to the applicationLinuxto protect "private property". of traditionalLinuxdrivers generally have two types of code: the code that accesses the hardware register and the business logic code. The hardware abstraction layer is the interface layer between the operating system kernel and the hardware circuitry, which is designed to abstract the hardware. It hides the hardware interface details for a particular platform,providing a virtual hardware platform for the operating system,make it hardware agnostic,can be ported on multiple platforms. The hardware abstraction layer is a programming layer that allows computer operating systems to interact with hardware devices at the logical layer rather than at the hardware level. The hardware abstraction layer can be called by either the operating system core or the hardware driver. In either case, the calling program does not need to know the specifics of the hardware design, only the parameters required by the abstraction layer. Writing SupportHALof theLinuxDriver steps:1.WriteLinuxDrive;2.WriteHAL Library;3.WriteService Library.
InAndroidused in the systemLinuxThere are two ways of driving:1.through the traditional way directly withLinuxDrive interactions. 2.androidpeculiar to, by theHALmodule. is essentially throughLinuxShared Libraries(. So)with theLinuxthe driver interacts, and then the application re-accessesLinuxshared libraries. In learningAndroidin the process of the hardware abstraction layer, we will learn how to write hardware drivers in kernel space, how to add interfaces in the hardware abstraction layer to support access to hardware, how to provide hardware access services at system startup, and how to writeJNImakes it possible to passJavainterface to access hardware, and so on.
Android Deep Explore Nineth Chapter Summary