Article title: Linux kernel source code usage experience. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Many people are familiar with linux, an open-kernel source-code OS, so open-source topics will not be described here. The problem is, after obtaining the linux kernel source (I don't know where it is, let's take a look at http://www.kernel.org/bar), how should I correctly configure, compile, install/upgrade it. It is stated in advance that, before the kernel installation/upgrade operation is executed, only kernel-related source files are modified in the system. after the kernel is executed, the old kernel is replaced by the new kernel, if there is any incompatibility problem caused by configuration errors or version errors, it cannot be restored without backup?
(1) Configure the kernel
After obtaining the kernel, the first step is to configure it. (if you do not compile the kernel first, you cannot. the compilation result is that the module selection depends on the configuration ). The three basic configuration commands are as follows: (run the command in the linux/directory of the kernel source code. The Complete Directory is usually/usr/src/liunx /)
A) text dialog interface
Make config
B) menu interface (semi-graphical interface)
Make menuconfig
C) graphical interface (with Xwindow library required)
Make xconfig
Many options are available when you configure the kernel, such as CPU, kernel management, memory usage, plug-and-play support, and network protocol components, we recommend that you understand the meaning of the options and then modify them. Otherwise, you may compile a kernel that is different from what you want. You can go to http://www.tldp.org/ to define the content.
(2) Compile the kernel
A series of commands, even if there is no error prompt, pass.
Make dep confirm dependency
Make bzImage to generate the kernel file
Make modules configuration options
Make modules_install
(3) Install/Update
Update the generated arch/i386/boot/bzImage and System. map to/boot, and then point the MBR boot program (LILO, GRUB, etc) image option to the new bzImage.