1.1android System Architecture
First tier Linux kernel: Drivers and programs for managing memory, process, power, and other resources
The second-tier C + + code library Linux. So files and NDK code embedded in the APK program
Third tier Android SDK API direct application-oriented Java APK
Fourth tier Application
1. The main work of 2Android system porting
System porting: Let the Android operating system run on a specific platform, provided the operating system supports the CPU architecture of the hardware platform, the porting of Linux drivers, the porting HAL (Hal is on the second tier, and the Android SDK accesses the Linux driver directly through the HAL), The latter two are the main tasks of Android system porting.
Application porting: The fourth tier application continues to a specific platform, due to differences between hardware platforms, the Android SDK API may be different, need to modify the source code, does not involve the driver and the HAL Library
1.3 Viewing the kernel version
Method 1: Execute on Linux terminal: uname-a
Method 2: Execute in Terminal: cat/proc/version
1.4linux kernel version naming rules
1.5 How to learn Linux drivers
A Linux operating system for developing and testing Linux drivers
A board test driver is able to run correctly on Android-enabled development boards
Learn Gun C gun c is an extension to standard C
Relevant hardware knowledge and continuous practice
1.6 Linux Device drivers
The same type, but different models of the device is abstracted into a unified interface, this interface is the driver, drive direct and hardware interaction.
Character devices, block devices, network devices
Linux has a load function (called when the driver is loaded) Mobule_init and an unload function (called when unloading the drive) mobule_exit
Linux drivers are only related to the Linux kernel and are not related to Linux systems. Only the kernel version number can determine whether the Linux kernel is the same. Learning Android Drive Development is essentially learning Linux driver development, Android has added a HAL to Linux, but HAL is not required, and the NDK can also access the Linux driver directly.
Android system porting and Driver development overview