0. Linux kernel boot process
1. Obtain and extract the kernel sources
Linux kernel official website: www.kernel.org .
This tutorial is version 3.4.2, older, so I put in a public number, please pay attention to the public in the end the number Mculover666 reply keyword "kernel source" Get.
After acquiring placed on the Linux system, extract:
tar -jxvf linux-3.4.2.tar.bz2
Linux kernel has more than 30,000 files, v parameters can be removed, extract the information is not displayed.
2. Configure and compile
Into the unpacked folder:
cd linux-3.4.2/
2.1. Configurable architecture and compilation chain
In the makefile in the root directory of search ARCH, found as shown in two configurations:
ARCH
: To run Linux CPU architectureCROSS_COMPILE
: Cross compiler name
2.2. Select the default profile
Into the arm architecture veneer default configuration file directory:
cd arch/arm/configs/
You can see all current arm architecture board configuration file:
here back to the root directory, set the s3c2410_defconfig
default profile:
cd ../../../
make s3c2410_defconfig
Implementation of epigenetic became a configuration file .config
used to compile:
in the boards supported by the file list is as follows:
2.3. Compile
make uImage
Wait compiled ......
Middle an error:
Access to information ( refer to blog post), this is because errors in the new version of Linux compiled on older versions of the kernel version appeared: the solution is:
The kernel/timeconst.pl
file in the first row 373 defined () is removed as follows:
vim kernel/timeconst.pl
Re-make:
make uImage
I encountered a problem:
this is because Linux hosts make uImage image of a dependent package is not installed, run:
sudo apt-get install u-boot-tools
Compiled again, compiled successfully:
2.4 Test kernel image
Compile the kernel to copy files out easily downloaded to the local:
cp arch/arm/boot/uImage ../
Download this file to the TFTP server directory, and then get the file in uboot development board to memory:
tftp 30000000 uImage
启动内核:
bootm 30000000
可以看到,内核成功启动起来:
内核分区和挂载根文件系统有误,后续几篇文章中进行处理。
接收更多精彩文章及资源推送,欢迎订阅我的微信公众号:『mculover666』。