1Android system porting and Driver development overview

Source: Internet
Author: User

1, the Android system architecture is divided into four layers, from bottom to top of the Linux kernel layer, C + + code base, Android SDK API, application, to be familiar with each layer of content and functionality;

2, the Android transplant is divided into the application transplant and the system transplant, the system transplant main work is the transplant Linux drive and the transplant hal,android transplant the basic principle is to find the driver and the HAL source code, in the source code based on the modification is much easier, if actually cannot find the source code, You can only write from scratch. Android migration is largely a Linux kernel migration, the Linux kernel migration is mainly the porting driver, different Linux version of the driver is not common, need to modify the source code, and to be recompiled under the new Linux kernel to run under the new Linux kernel version;

3, the driver development and the kernel version of the dependence is very high, so before the driver development, to clear the Linux kernel version, the current Linux kernel maintenance of the three versions are: Linux2.4, Linux2.6 and linux3.x; there are 2 ways to view the kernel version of a Linux system: Using the command "Uname-a" or "cat/proc/version"; it is important to note that/proc is not an ordinary file system, but rather an image of the system kernel, The files in this directory are stored in the system kernel, which provides the interface for accessing the kernel data of the system in the way of file system;

4, the Linux kernel version of the good composition: Major version number, minor version number, revision number, fine-tuning version number, special tuning for the specific Linux system description;

5, want to learn good Linux drive development, to do the following points:

(1) Prepare a familiar Linux operating system for the development and testing of Linux drivers;

(2) Prepare a development board;

(3) Learn gun C;

(4) Learning relevant hardware knowledge;

(5) to practice continuously;

6, the role of Linux device driver: The hardware abstraction, reduce the coupling between the application and hardware;

7. Linux devices are divided into:

(1) Character devices: Devices that must be accessed sequentially in serial order;

(2) Block devices: can be accessed in any order, in blocks for the operation of units;

(3) Network equipment

8. Any Linux driver has a load function (called when the driver is loaded) and an unload function (called when the driver is unloaded), and the load function and unload function are specified by Module_init and module_exit macros respectively;

9, Linux driver is only related to the Linux kernel, and Linux system-independent, as long as the use of the same kernel, the driver can be common; the kernel is the same method of determining the Linux kernel version number, only the five parts that make up the kernel version number are identical, To show that the kernel of the two Linux systems is the same;

10, the difference between Android driver and Linux driver is that Android added Hal, the general Android driver will have the corresponding HAL, but also not necessary, through the NDK can directly access the Linux driver, but Google recommends that the Linux driver to write the The HAL Program library that should be;

1Android system porting and Driver development overview

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.