How to compile the kernel 2.6.0-test2 (Chinese version)

Source: Internet
Author: User
Article Title: how to compile the kernel 2.6.0-test2 (Chinese version ). 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.
Maybe the 2.6.0 kernel will bring a revolution to linux. Starting from the. * kernel, linux has the capital to enter high-end applications. This 2.6.0 kernel also has major changes in advanced applications. In addition, more devices are supported (nForce2 motherboard requires new kernel support ). These are not the scope of our discussion. By the way, the new kernel is easy to use with the mouse and keyboard. Inner checks these peripherals for optimization. (In the future, we may also get a kernel dedicated for display. at that time, linux will be able to enter the desktop .) In fact, these features are already available in some 2.5.* versions. The Makefile of 2.6.0 also changes a lot and may be much easier to use than you think.
  
The new kernel can be downloaded at http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.0-test2.tar.gz.
First Copy linux-2.6.0-test2.tar.gz to the tar-zxf linux-2.6.0-test2.tar.gz under/usr/src/; cd linux-2.6.0-test2 because the new kernel has not been compiled, so do not make mrproper to delete the original compiled garbage
You can use one of the following commands to configure the kernel based on your needs and hobbies:
  
# Make config (text-based most traditional configuration interface)
  
# Make menuconfig (text menu-based configuration interface)
  
# Make xconfig (graphical window mode-based configuration interface)
  
# Make oldconfig (if you only want to modify some small points based on the original kernel configuration, it will save a lot of trouble)
  
  
During configuration, the default values can be used for most options. only a small part of options need to be selected based on the user's needs. For example, if you want the kernel to support a file system with DOS partitions, you need to select FAT or dossystem for the file system. if the system is equipped with a Nic or PCMCIA card, select the type of the corresponding card in the network configuration.
  
When you select the corresponding configuration, there are three options, which represent the following meanings:
  
"Y"-compile this function into the kernel
  
"N"-do not compile this function into the kernel
  
"M"-compile this function into a module that can be dynamically inserted into the kernel as needed.
  
Compile some functional code that is far away from the other parts of the core and is not frequently used into a loadable module. This helps reduce the length of the kernel and reduce the memory consumed by the kernel, this feature simplifies the impact on the kernel when the corresponding environment changes. Many functions can be processed in this way, such as Nic support and file system support such as FAT.
  
In fact, the most important thing to compile the kernel is to configure the kernel. I usually use make menuconfig to configure the kernel.
When you configure the 2.6.0 kernel, if your motherboard is an Intel chip, you may get a satisfactory kernel by default. Make menuconfig and save it when it leaves.
  
The difficulty here is pci. if your hard disk is IDE, you must choose the Nanqiao chip on your motherboard. For SCSI, select your scsicard model.
There is also the model of the NIC and sound card chip. you can use lspci to find their models.
  
Sh-2.05a #/sbin/lspci
00:00. 0 Host bridge: ServerWorks CNB20LE Host Bridge (rev 05)
00:00. 1 Host bridge: ServerWorks CNB20LE Host Bridge (rev 05)
00:02. 0 PCI bridge: Intel Corp. 80960RP [i960 RP Microprocessor/Bridge] (rev 01)
00:02. 1 I2O: Intel Corp. 80960RP [i960RP Microprocessor] (rev 01)
. 0 Ethernet controller: 3Com Corporation 3c985 1000 BaseSX (SX/TX) (rev 01)
. 0 PCI bridge: Digital Equipment Corporation DECchip 21152 (rev 03)
00: 0e. 0 VGA compatible controller: ATI Technologies Inc 3D Rage IIC (rev 7a)
00: 0f. 0 ISA bridge: ServerWorks OSB4 South Bridge (rev 4f)
00: 0f. 1 IDE interface: ServerWorks OSB4 IDE Controller
. 0 Ethernet controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (rev 05)
. 0 Ethernet controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (rev 05)
0:02. 0 PCI bridge: Intel Corp. 80960RM [i960RM Bridge] (rev 01)
. 0 Ethernet controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (rev 08)
  
You only need to select all the items on your pci. You can use the default one for the rest.
  
After kernel preparation, make install also says that make install is also the most recent option from 2.5.69 kernel (based on the kernel release time). it can help you complete a lot of things. Great convenience.
2.4.21 you can use make install
  
Now, these steps are not required to make install.
  
# Make dep (ensure that the key files are in the correct location) 2. 5. *-2.6.0 is not required. In fact,. * Some kernels are not required.
  
# Make clean (make sure all related files are in the latest version)
  
# Make zImage (compile the compressed kernel)
  
When the kernel supports many peripherals and functions, the kernel may become very large. in this case, you can compile the large kernel:
  
# Make bzImage
  
The compilation time is related to factors such as hardware conditions and kernel configuration of the machine. taking the player 300 in 64 MB memory as an example, it takes about 20 minutes to compile the kernel at a time. The obtained kernel is located in the/usr/src/linux/arch/i386/boot directory. assume that your CPU is x86.
  
If you select a loadable module, compile the selected module after compiling the kernel:
  
# Make module)
  
# Make module-install (transfer the compiled module to the standard system location)
  
The standard Directory of the module in the system is located in/lib/modules/x. y. z, followed by x. y. z is the version number. for security reasons, it is best to back up/lib/modules before running # make modules-install. A module is usually a file with the. o extension. use the command # lsmod to list the modules in the current kernel.
  
I usually make dep; make bzImage; make module-install
  
Cp/usr/src/linux2.6.0-test2/arch/i386/boot/bzImage/boot/vmlinuz-2.6.0-test2
  
Cp/usr/src/linux-2.6.0-test2/System. map/boot/System. map-2.6.0-test2
  
All these make install operations can be done.
  
The rest is to modify/etc/lilo. conf.
  
Vi/etc/lilo. conf
  
Add a new kernel. Sometimes make install has been modified for you.
Below is my lilo. conf
Prompt
Timeout = 50
Default = linux
Boot =/dev/sda
Map =/boot/map
Install =/boot. B
Message =/boot/message
Linear
  
Image =/boot/vmlinuz-2.4.18-3smp
Label = linux
Initrd =/boot/initrd-2.4.18-3smp.img
Read-only
Root =/dev/sda6
  
Image =/boot/vmlinuz-2.6.0-test2
Label = linux-2.6.0-test2
Initrd =/boot/initrd-2.6.0-test2.img
Read-only
Root =/dev/sda6
  
Run Again
Sh-2.05a # lilo
Regenerate lilo
  
In this way, your kernel will be upgraded.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.