I have been working on my graduation thesis and reply for a while, and I have to rush back to work. I haven't finished Android development for a while. I will not talk much about it.ArticleMentioned fromSource codeThe latest Android source downloaded from the treeCodeThe kernel code is not included, that is, the android source code project does not contain the Linux kernel code by default, but uses the pre-compiled kernel, that is, the prebuilt/Android-arm/kernel-qemu file. As we all know, a new Android system must use its own Android kernel to add some special features for some customized development. How can we run our own Android kernel? Because the Google official website already has the android kernel source code that can be downloaded, Samsung and HTC have released their own Android kernel source code, allowing developers to have greater permissions to develop specific applications, I am blind enough to know that such a strategy is of great benefit to Samsung and HTC!
Because Google has the goldfish Android kernel source code that can be run in the simulator, it is a good choice to use it to learn the DIY Android kernel, during my study, I mainly referred to Lao Luo's Android journey. The specific reference is as follows:
Reference: http://blog.csdn.net/luoshengyang/article/details/6564592
In addition, what I want to say is that any knowledge must be tried in person to learn better!
I = download the Linux kernel for Android source code.
1. Use the GIT tool to download and execute the following command:
User-name @ machine-Name :~ /Android $
Mkdir Kernel
User-name @ machine-Name :~ /Android $CD Kernel
User-name @ machine-Name :~ /Android/kernel $Git clone
Http://android.googlesource.com/kernel/goldfish.git
Then go to the synchronized file. After synchronization, I only have one goldfish directory.
The next step is to check the android kernel source code that can be run in the android simulator, CD goldfish; thenGit checkout remotes/ORIGIN/archive/android-gldfish-2.6.29
II= Compiled and downloaded Android kernel source code goldfish 1. Export the cross-compilation tool directory to the $ PATH environment variable:
User-name @ machine-Name :~ /Android/kernel/common $Export Path = $ path :~/Android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin 2. Modify the MAKEFILE file in the common directory in the following two actions:
# Arch
? = (Subarch)
# Cross_compile
? =
Arch ? = Arm # The architecture is arm
Cross_compile? = Arm-Eabi-# prefix of the Cross-compiled toolchain,
References ~ /Android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin directory
3. Start Compilation:
User-name @ machine-Name :~ /Android/kernel/common $Make goldfish_defconfig
Inexplicable error, make: ***/root/build_kernel/linux-2.6.14.1/ARCH/ARM is a directory. Stop
I learned from the online query that it was originally because of arch? = A space is added after arm. I thought it was a configuration error !!! Success !!!
Modify makefile, remove spaces, and compile
User-name @ machine-Name :~ /Android/kernel/common $Make
Compiled successfully!
3.=Run the compiled Android Kernel
Emulator-kernel/home/Hu/Android-2.3/kernel/goldfish/ARCH/ARM/boot/zimage
Use ADB shell to view running kernel information
Show that running is the android kernel compiled just now. Next, download an android kernel corresponding to your mobile phone on the internet, compile it, and download it to your mobile phone for use, this will truly feel the charm of the DIY Android kernel! Attach the graphic tutorial http://www.miui.com/thread-683503-1-1.html for compiling the HTC Android kernel by a machine friend on the Xiaomi forum. Program You can try it !!!