.
.
.
.
.
Yesterday has compiled the Android 4.2.2 source code, see "Ubuntu 14.04 compiled Android 4.2.2 for Tiny4412" article.
Today we continue with the rest of the work, allowing our Android system to run on the Tiny4412 Development Board.
Android and Linux are different, and Android is based on the Linux kernel. We compiled the Android source code is the Android system itself, and the kernel refers to the original Linux source code has been coming through the kernel source, so they need us to compile separately. and the version number of the Android system and the version number of the Linux source code is not strictly relevant, as long as a certain version of the Linux kernel can support a version of the Android system, then they can be combined.
The kernel doesn't say much, its role in Android is no different from what it does in other Linux distributions, so let's take a brief look at the structure of the Android file system.
Linux system Startup process: Bootloader (GRUB)---->zimage (Kernel)---->ramdisk (temporary root, in memory)---->ROOTFS (permanent root, on disk)
Android boot process: bootloader (vendor supplied)---->zimage (Kernel)---->ramdisk (permanent root, in memory for Speed-up)
So what's stored in Android RAMDisk, usually divided into four partitions:
[FAT32] built-in storage space. FAT32 is not a name, it is a partition format.
Mount to the system directory when [systems] is started
Mount to the data directory when the [data] system is started
[Cache] equals swap partition
Where the system partition and data partition are the two most important partitions on Android, let's briefly describe their common uses.
System
[App] xxx.apk | System comes with the Software installation directory, ordinary users do not have permission to uninstall. System applications like phone book, dialer, SMS, etc. are installed here. There are also many custom-made mobile phones that have been preinstalled by unscrupulous manufacturers, and all kinds of garbage programs that cannot be uninstalled are placed here. The programs here are written in Java.
[Framework] Xxx.jar | Storing libraries written in Java
[Bin] xxx | Store local programs, usually written by c/c++/asm
[Lib] xxx.so | Storing libraries written in c/c++/asm
Data
This directory is in memory and is the home directory of the Android system. The system configuration file is in this partition, and the factory reset is usually the format of the partition.
OK, the Android file system is introduced to this, the following starts today's topic, compile the Linux kernel source code.
I'm using the Linux 3.5 kernel, and I've been transplanted by the gods, so I'm not going to do menuconfig anymore, I'm just compiling it with the great God-made configuration file. I have not studied how to transplant the kernel, the last toss to the middle of the night has failed, so this time to honestly take the great God transplant the kernel to do experiments, and so on a period of time to study the core transplant and then share.
Since there is a kernel transplanted by the great God, it is much simpler to compile and there is no pit in the process.
tar xzf linux-3.5-20140422android]$ CD linux-3.5/[[Email protected ] linux-3.5CP tiny4412_linux_defconfig. Config[[email protected] linux-3.5 Make-J4 ... 10,000 words omitted here objcopy arch/arm/boot/zimagekernel:arch/arm/boot/zimage is ready
OK, see the above two words we know that the compilation is successful, and the compiled kernel is placed in the arch/arm/boot/zimage here.
can start to write the system to the Development Board, chicken frozen ing ...
==================== Gorgeous split-line ====================
Next we copy the compiled data to the SD card, then we can burn the system through SD card.
First, the friendly arm (the manufacturer of the Tiny4412 Development Board) provides the superboot (just a bootloader) to the SD card so that our SD card can be booted up.
1. Insert the SD card
2. View the corresponding device files for SD card
[Email protected] tools]$sudoFDISK-Ldisk/DEV/SDC:7948MB,7948206080bytes +HeadsTenSectors/track,81704Cylinders, Total15523840sectorsunits= Sectors of1* += +bytessector size (logical/physical): +Bytes/ +Bytesi/o Size (minimum/optimal): +Bytes/ +bytesdisk Identifier:0x00000000Device Boot Start End Blocks Id System/dev/sdc1155217 15523839 7684311+ b W95 FAT32
Visible my SD card is/DEV/SDC, you see in the back of my command contains/DEV/SDC or/DEV/SDC1, you need to replace the machine on the query out the corresponding device file path, do not write wrong!
= = ahead of the high-energy warning, please do not have any personnel immediately evacuated, the relevant personnel must be aware of the situation under the careful operation!!! ====
3. Write the superboot to the SD card
In fact, you can use Read (2), write (2) function and other ways to burn, I already have a ready-made tool, so directly to use. If you do not have a burning tool can write their own, because I do not have the source code of the tool so do not paste the source code, pay attention to do not overwrite the partition table on the line.
In addition, Bootloader is written on the device (ie,/DEV/SDC) instead of burning on the partition (/DEV/SDC1).
[[email protected] tools]$./write4412boot Usage:<./write4412boot> <boot.bin> <dev> sudo ./write4412boot. /images_all/superboot4412.bin/dev/SDC Start ..... ... end ..... .......
4. Ramdisk-u.img, System.img, Userdata.img, and the Linux kernel linux-x.x/arch/arm/boot/zimage and Superboot4412.bin Copy to the SD card images directory.
[Email protected] android-4.2.2_r1]$mkdir-p/media/yuhuashi/2caa-71b6/images/android4.2.2/[[email protected] Android-4.2.2_r1]$CPRamdisk-u.img system.img Userdata-4g.img/media/yuhuashi/2caa-71b6/images/android4.2.2/[[email protected] Android-4.2.2_r1]$CPUserdata-16g.img userdata-8g.img Userdata.img/media/yuhuashi/2caa-71b6/images/android4.2.2/[[email protected] Android-4.2. 2_r1]$ CD. [[Email protected] android]$ CD Linux-3.5/[[email protected] Linux-3.5]$CPArch/arm/boot/zimage/media/yuhuashi/2caa-71b6/images/android4.2.2/[[email protected] Android-4.2.2_r1]$CP~/arm/class_boot/source/images_all/superboot4412.bin/media/yuhuashi/2caa-71b6/images/
We have already superboot burned to the SD card, the reason is to copy a copy to the SD card, is because the previous burning superboot is to allow the SD card to start, and now copy to the SD card this superboot is for a while to burn write into EMMC Boot our Android system on the Development Board.
Note that one of the images I copied is called userdata-4g.img, which I said yesterday after the Android compilation is complete, we execute the./gen-img.sh command generates several IMG files that contain userdata-16g.img, Userdata-4g.img,userdata-8g.img,userdata.img, These images are suitable for different sizes of EMMC devices. In general, the use of userdata.img can be, but the friendly arm of the Development Board some special, 4GB EMMC board must use USERDATA-4G.IMG.
5. Create the Friendlyarm.ini file in the images folder of the SD card
[email protected] images]$ Vim Friendlyarm.ini#this line cannot being removed. by Friendlyarm (www.arm9.net) Checkonebutton=noaction=Installos=Androidlowformat=Noverifynandwrite=NOLCD-mode =NoCheckCRC32=Nostatustype= Beeper |led################### Android4.2.2################### #Android-bootloader =superboot4412.binandroid-kernel = Android4.2.2/zimageandroid-commandline = CONSOLE=TTYSAC0,115200N8 androidboot.console=ttysac0 ctp=2Skipcali=y vmalloc=512m ethmac=1c:6f: $: the:Wuyi: 7E lcd=s700 host=nandroid-ramdisk =android4.2.2/ramdisk-u.imgandroid-rootfs-installimage = Android4.2.2/system.imgandroid-userdata-4g = Android4.2.2/userdata-4g.imgandroid-userdata-8g = Android4.2.2/userdata-8g.imgandroid-userdata-16g = Android4.2.2/userdata-16g.imgandroid-userdata = Android4.2.2/userdata.img
Note that the first line of comments should not be deleted, otherwise superboot may not be able to boot.
When finished, unmount the SD card, then insert the card into the slot of the board and toggle the boot mode switch to the SD card.
[Email protected] images]$ CD ~umount /media/yuhuashi/2caa-71b6
To be Continued ...
Build Linux 3.5 Kernel Burn-write Android 4.2.2 to Tiny4412 Development Board