Home >System Tutorial >LINUX >Analyzing the feature updates of the Android kernel and the standard Linux kernel

Analyzing the feature updates of the Android kernel and the standard Linux kernel

WBOY
WBOYOriginal
2024-06-03 11:53:511166browse

Android系统内核剖析

[Abstract] Analyze the android platform system architecture linux, delete the folder, analyze the latest Android source code, compare it with the standard Linux kernel source code, analyze the function updates of the Android kernel in detail, and discuss the difference between the Android kernel and the standard Linux kernel. The difference between the two and the advantages of Android in China Unicom platform were analyzed, and Android was positioned among various kernels, and the acquisition and compilation of the Android kernel in the Ubuntu environment were introduced.

[Keywords]Android; linux; kernel; compilation

CLC classification number: G354.3 Document code: A Article number: 1009-914X (2013) 33-0119-01

1 Overview

With the rapid development of embedded technology, the operating speed and integrated functions of China Unicom's intelligent platform have been greatly improved. Furthermore, the Open Handset Alliance OHA, led by Google, took advantage of the situation and launched the Android China Unicom terminal platform in 2008. Android is an open and free Unicom terminal platform[1]. It has broken the monopoly of Motorola's Symbian operating system on traditional smartphone platforms. At the same time, its platform advantages have also greatly enriched various handheld devices. Software functionality.

2. Android system architecture

Android is an open source mobile phone operating system based on the Linux platform developed by Google. It is a China Unicom terminal platform that includes all the software required for China Unicom phones to work. It is composed of operating system, middleware, UI and applications.

linux内核android_内核管理器_内核稳定

The Android system architecture consists of the following four levels from bottom to bottom [2]: Linux-based kernel module, runtime library and other libraries, application framework, and application.

The first layer: Linux operating system and Android system expansion, implemented by C language.

The second layer: system library layer and Android runtime environment linux software, implemented by C/C++.

The third layer: Android application framework Hidden in front of each application is a series of services and systems.

The fourth layer: Android application

The Android application layer is composed of all applications running on Android devices. In addition to system applications such as calls, text messages, and contacts, it also includes other third-party applications that are subsequently installed on the device. 3. Android kernel analysis

内核管理器_linux内核android_内核稳定

2.1 The status of the kernel in the operating system

Android is based on the Linux operating system and consists of four major parts: hardware, system kernel, system services and applications. Among them, the kernel is the core part. Its main function is to interact with computer hardware, realize programming control and socket operations of the hardware, schedule access to hardware resources, and at the same time provide an intermediate execution environment and virtualization of the hardware to applications. jack. The main functions include: interrupt service routine, process scheduler, video memory management of process address space, and inter-process communication.

2.2Android kernel

In order to compare and analyze the Android kernel, a compilation and development platform for the Android kernel was built on the Ubuntu operating system, and the latest Android kernel code version JellyBean was downloaded through the repo.

After detailed comparison with the standard Linux kernel source code, it can be found that there are differences between the Android kernel and the standard Linux kernel in terms of file system, inter-process communication mechanism, memory management, etc.

(1)File system

内核稳定_linux内核android_内核管理器

The Android kernel has reduced the YAFFS2 file system that is not adopted in the standard Linux kernel.

(2) Inter-process communication mechanism

Binder is an inter-process communication mechanismlinux kernel android, although it provides remote procedure call (RPC) function. exist

The Binder mechanism of the Android system consists of a system component, namely Client, Server, ServiceManager and Binder driver. Client, Server and ServiceManager run in user space, and the Binder driver runs in kernel space.

(3)Video memory management

In the video memory management module, the Android kernel uses a low-level kernel that is not used in the standard Linux kernel

Deposit management strategy. The Android system uses a mechanism called LMK (LowMemoryKiller), which classifies and groups processes according to their importance. When there is insufficient video memory, the process in the lowest level group will be shut down.

4. Android kernel acquisition and compilation

The following takes the Ubuntu13.04 operating system as an example to explain how to build it under the Ubuntu13.04 system

Android kernel compilation and development platform. To build an Android kernel compilation environment on Ubuntu, the specific steps are as follows:

(1) Plan the system environment, required software package list flex, bison, gperf, libsdl-dev, libesd0-

dev, libwxgtk2.6-dev (optional), build-essential, zip, curl; (2) Install version 1.7 of JDK; (3) Install repo; (4) Build a bin folder in the main file directory and Add it to the environment variables; (5) Download the repo script and change its attributes to executable curlhttp:///repo>~/bin/repochmoda+x~/bin/repo; (6) Create a directory to save the source code mkdircoredroidcdcoredroid(7) Get the Android kernel code: gitclonegit:///kernel/common.git

linux内核android_内核管理器_内核稳定

After the above steps, the latest version of the Android kernel is downloaded to the folder coredroid. After the make compilation is completed, the zImage file is generated. You can use the simulator to test and run cdmydroid/out/cupcake/out/target/product/genericemulator-imagesystem.img-datauserdata.img-ramdiskramdisk.img-kernel~/coredroid/common/arch/arm/ boot/zImage

5 Conclusion

The Android kernel is optimized from the standard Linux kernel. It inherits various advantages of the Linux kernel and retains the main structure of the standard Linux kernel. At the same time, Android has made changes in the file system, memory management, inter-process communication mechanism, power management and other aspects according to the needs of China Unicom platform, added relevant drivers and necessary new functions, and is compatible with most streamlined embedded Linux operations. Compared with other systems, Android retains the basic architecture of standard Linux to a large extent. For this reason, the Android system has a wider range of applications and is more scalable.

references

[1]CodeHome.Android-AnOpenHandsetAllianceProject.[EB/OL]http:///android/what-is-android.

[2] Gong Lei, Zhou Cong. Development and research of China Unicom terminal application based on Android [M]. People's Posts and Telecommunications Press linux kernel android, 2007

[3]Zhao Jiong. Complete Annotation of Linux Kernel[M]. Machinery Industry Press, 2004.

[4]Chen Lijun. Analysis and Application of Linux Kernel[J]. Journal of Nanjing University of Posts and Telecommunications.

The above is the detailed content of Analyzing the feature updates of the Android kernel and the standard Linux kernel. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn