"Android Deep Exploration Volume One" reading notes one

Source: Internet
Author: User

A Android System Architecture

The Android system architecture is divided into 4 tiers:

First layer: Linux kernel

Android is based on the Linux kernel, so The core structure of the Android kernel and the standard Linux2.6 are basically the same, with subtle differences in the Linux kernel that Android has added primarily to some Android-specific drivers and device drivers used by Android, which may not be common in different versions of Android.

Second tier: C + + code base

is a code base written in C + +, which is the. so file under Linux, and the Android Runtime Environment (Androidruntime).

Tier Three: Application Framework (Android SDK API)

is a variety of libraries written in the Java language (based on the Dalvik virtual machine format).

Layer Fourth: Applications

This layer is equivalent to the Android UI, and all Android apps, including photos, text messages, browsers and games, all belong to this layer. This layer relies primarily on the Android SDK API in the 3rd tier to accomplish a variety of functions.

Two Android System porting

Android system porting is divided into two parts: application porting and system porting.

Application porting refers to porting an application to a particular hardware platform. Generic Android application porting does not involve porting the drive and HAL Libraries.

System porting refers to having the Android operating system run on a particular hardware platform. Make the operating system run on a specific hardware platform the CPU architecture that requires the operating system to support the hardware platform. The Linux kernel supports a number of commonly used CPU architectures, so Android does not have to be too modified to migrate between different CPU architectures. It also requires Android to be able to recognize the various hardware on the plane. This is done by the Linux driver. Android also adds a HAL (Hardware abstraction Layer) to access the driver, which is different from the direct access drivers for other Linux system applications. If you add a new driver or modify the driver code, the code in the HAL is adjusted accordingly.

Attention:

Android porting is great for porting the Linux kernel. Android version is different from Linux version, regardless of which Android version its kernel is based on Linux2.3 or Linux3.0 (in the future will be later), but will be modified according to the requirements to add drivers or other. When porting Linux drivers, Android versions are portable as long as the Linux kernel is the same.

Three Linux kernel version number

To view the Linux version number, execute the following command on the Linux terminal:

"Uname-a" or "cat/proc/version"

The Linux version number defines the rule:

Major version number + minor version number--(Linux version series)

+ revision number + fine-tuning version number + description for specific Linux system calibration

Four Learn what Linux drivers are prepared to do:

Linux operating system, Development Board, GNU c knowledge, related hardware knowledge, and continuous practice (introspection: No matter how much learning, often to practice to master, not lazy).

Linux-driven learning not only has a Linux kernel, but also has a development environment that can be powered on and tested. Google tests Android using Ubuntu Linux, so it is recommended to use Ubuntu Linux10.04 above version of the operating system.

GNU c is an extension of standard C and is the most commonly used C language compilation environment under Linux.

Five Linux device drivers:

device-driven communication hardware and software, and distinguish between the hardware, to make a clear responsibility for the engineers and engineers, do not need soft and hard balance. device driver and hardware direct interaction abstraction interface, so that the application software can be driven in different hardware devices switch freely, to prevent hardware over-coupling situation.

The hardware of a computer system is mainly composed of CPU, memory and peripherals. The driver targets the memory and peripherals: Character devices, block devices, network devices.

Character device: A device that must be accessed sequentially sequentially, and the actual hardware I/O operation occurs immediately following a read/write request.

Block device: A device that can be accessed in any order, using system memory as a buffer for read/write requests.

Network devices: Designed for packet reception and delivery, and does not correspond to node access for the file system.

Six Summarize:

Any Linux driver has a load function (called when the driver is loaded) and an unload function (called when the function is unloaded). Linux kernel is the same, regardless of which Linux system, the driver can be common. Judging the Linux kernel is the same as the five parts that make up the kernel version number. Android Driver Development is Linux-driven development and HAL (Android-specific).

"Android Deep Exploration Volume One" reading notes one

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.