"Android Deep Exploration Volume One" reading notes five

Source: Internet
Author: User

Download and compile the Linux kernel source code

The Android source code does not contain the Linux source code and must be downloaded separately. You cannot download the Linux kernel directly from www.kernel.org, you should download the Linux kernel used in Android on the website provided by Google.

1. Download "Git clone https://android.googlesource.com/kernel/common.git", go to the common directory, "git branch-a" to view the current remote version, then export To export the required version "Git checkout-b android-*** remotes/origin/android-***"

2.Linux Kernel Source code directory structure:

  3. Install the Android kernel's build environment

(1). Configure the Makefile file:

(2). Copy the following files to your working directory:

The version depends on the machine condition.

(3). Unzip, "ls/usr/local/arm-l" to see if the installation was successful.

(4). Install LIBNCURSES5, "Apt-get install Libncurses5-dev"

4. Configuring and compiling the Linux kernel

Typically, there is no. config file in the Linux source directory, which determines which functions and modules are part of the build Linux kernel. Perform one of the following 4 commands to generate a. config file:

(1) Make config: configured in text format;

(2) Make Menuconfig: configured as a character interface menu;

(3) Make Oldconfig: will give the default value of the text format configuration;

(4) Make xconfig: Configuring the Linux kernel as a graphical interface will require QT installation, "Apt-get install Libqt-dev"

It is recommended to use make menuconfig, which will generate Zimage files (Linux kernel binaries) after successful compilation, which can be installed on the Development Board or used to test the Linux kernel.

Android porting is primarily a Linux kernel migration, and Linux kernel porting is primarily a Linux-powered migration. To develop and test Linux drivers, you need to build an Android application development environment and a Linux kernel development environment.

"Android Deep Exploration Volume One" reading notes five

Related Article

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.