I. Introduction to the Linux kernel
The Linux system architecture is divided into kernel space and user space. Switching conditions between them: 1. System call 2. Hardware interrupt. Kernel Architecture: 1. System call Interface 2. Process Management Block 3. Memory Management 4. Architecture-related code 4. virtual file System 5. network stack 6. Device Driver two. Making the Linux kernel1. Modify the configuration fileMake config--text mode interactive configurationMake menuconfig--menu-based configuration (intuitive, simple, efficient, recommended) in text mode configuration file Selection: 1. Default 2. Existing configuration files, the Linux system under the/boot/directory to save the current system configuration items, we can directly use. 2. Compiling the source codemake Zimage--can be used when the kernel is less than 512k. make Bzimage (v=1)--The kernel is saved in the Arch/cpu/boot directory after the successful compilation of the Bzimage binary file (the compilation is successful if the source file directory must have a. config file). 3. Compiling kernel modulesMake modules--Generate kernel modules (*.ko). make nodules--collect the kernel modules scattered in each folder into the/lib/modules directory under the root directory I have a folder named 2.6.394. Making RAMDiskmkinitrd rd-$version $version--Example MKINITRD rd-2.6.39 2.6.39 5. Copy kernel filesCP linux-2.6.39/arch/x86/boot/bzimage/boot/vmlinuz-2.6.39CP rd-2.6.39/boot/ 6. Change the startup filevi/etc/grub.conf my original kernel is 2.6.32-279.el6.i686, I made the kernel for 2.6.39 above is the content I modified. 7. reboot and replace the kernelPress any key on the timing page to go to the Select Kernel version interface. Note: Here we just change the system kernel, the data of the user space is not modified, so the data of the hard disk will not change after system startup. (view kernel version uname-r)8. Clean up the kernel source codeMake clean--cleans up the resulting *.O fileMake Distclean--Clean *.o files, configuration files, *.ko files three. Creating an embedded kernelThere is no difference between the method and the Linux kernel, just pay attention to:configuration-time command-make menuconfig arch=arm;compile command--make uimage arch=arm cross_compile=arm-linux-usually in the compilation is a lack of mkimage files can be found in the Uboot source code/tools/directory to copy it to the root directory of the/bin directory can be.
Embedded Linux kernel Authoring