Embedded Linux kernel Creation
I. Linux kernel introduction the Linux system architecture is divided into kernel space and user space. Switching conditions between them: 1. System Call 2. Hardware interruption. Kernel architecture: 1. system Call interface 2. process Management Module 3. memory Management 4. architecture code 4. virtual File System 5. network Stack 6. device Driver 2. create Linux kernel 1. modify the configuration file make config -- Interactive configuration in text mode make menuconfig -- select a menu configuration (intuitive, simple, efficient, and recommended) based on text mode: 1. default Value: 2. the current configuration file is saved in the/boot/directory of the Linux system. We can use it directly. 2. Compile the source code make zImage -- this can be used when the kernel is smaller than K. Make bzImage (v = 1) -- The bzImage binary file stored in the arch/cpu/boot directory in the kernel after compilation is successful (the premise of successful compilation is that it must be included in the source file directory. config file ). 3. Compile the kernel module make modules -- generate the kernel module (*. ko ). Make nodules -- collect kernel modules scattered in various folders to the/lib/modules directory under the root directory. Here, the folder name is 2.6.394. create ramdisk mkinitrd rd-$ version -- Example mkinitrd rd-2.6.39 2.6.39 5. copy kernel files cp linux-2.6.39/arch/x86/boot/bzImage/boot/vmlinuz-2.6.39cp rd-2.6.39/boot/6. change the Startup File vi/etc/grub. conf my original kernel is 2.6.32-279. el6.i686. The kernel I made this time is 2.6.39 and above is what I modified. 7. Restart and replace the kernel. Press any key on the timing page to go to the kernel version selection page. Note: Here we only change the system kernel without modifying the user space data, so the hard disk data will not change after the system is started. (View the kernel version uname-r) 8. clean up the kernel source code make clean -- to clean up and generate *. o file make distclean -- clear *. o file, configuration file ,*. ko file 3. there is no big difference between the method for creating an embedded kernel and the method for creating a Linux kernel. You only need to note that the command -- make menuconfig ARCH = arm during configuration; compile command -- make uImage ARCH = arm CROSS_COMPILE = arm-linux-generally, the mkimage file is missing during compilation. You can copy it to the root directory in the/tools/directory of uboot source code. directory/bin directory.