Compile the kernel

xiaoxiao2021-03-06  38

Maybe 2.6.0 The core will bring the revolution to Linux. From 2.5. * The kernel starts Linux with capital to high-end applications. This 2.6.0 core is also mainly a large change in advanced applications. There is also a support for more equipment (NFORCE2 motherboards need new kernel support). These are not the scope of our discussion. For the new kernel, give everyone the first feeling is, the mouse, keyboard, easy to use. The new kernel optimizes these peripherals. (You may also get a dedicated kernel for the display. If Linux can really enter the desktop.) These features are actually on 2.5. * Some versions have been there. There is also 2.6.0 Makefile files vary greatly, perhaps more than you want.

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 / usr / src / below tar -zxf linux-2.6.0-test2.tar.gz; cd Linux-2.6.0-test2 is not in the new kernel Compiled, so you don't have to delete the original compilation.

Configuring the kernel can use one of the following commands as needed:

#Make config (the most traditional configuration interface based on the text)

#Make menuconfig (Configuration Interface Based on Text Menu)

#Make xconfig (Configuration Interface Based on Graphic Window Mode)

#Make oldconfig (if you only want to modify some small places on the basis of the original kernel configuration, you will save a lot of trouble)

When configuring, most of the options can use their default values, only small parts need to be selected according to different users. For example, if you need a file system that supports the DOS partition, you must select FAT or DOS system support in the file system section; if the system is equipped with a NIC, a PCMCIA card, etc., you need to select the type of card in the network configuration.

When you select the appropriate configuration, there are three options, which represent the meaning of each other as follows:

"Y" - compile this function into the kernel

"N" - Do not compile this function into the kernel

"M" - compiles this function into modules that can be inserted into the kernel when needed.

The partial function code that is far from the core other partial relationship and is not frequently used, facilitates the reduction of the length of the kernel, reducing the memory consumption of kernel, simplifies the impact of the kernel when the function changes. Many functions can be handled like this, such as support of the network card mentioned above, support for Fat and other file systems.

In fact, the most critical places in compiling the kernel is to configure the kernel. I generally configure the kernel with make menuconfig.

When you are configured 2.6.0, if your motherboard is an Intel chip, you can get a satisfactory kernel with the default system. The approach is to choose to save when Make MenuConfig leaves.

The difficulty here is that PCI, if your hard drive is the IDE, you must choose your motherboard on the South Bridge chip. If SCSI is to choose your SCSI card model.

There is also a network card, the sound card chip model, their model you can use LSPCI to find something such as mine.

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) 00: 04.0 Ethernet Controller: 3COM Corporation 3C985 1000BaseSX (SX / TX) (REV 01)

00: 08.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

02: 04.0 Ethernet Controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (REV 05)

02: 05.0 Ethernet Controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (REV 05)

03: 02.0 PCI Bridge: Intel Corp. 80960RM [I960RM Bridge] (REV 01)

03: 08.0 Ethernet Controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (REV 08)

Just choose all the things on your PCI. The rest is used by default.

Make Install also said that Make Install is also the nearest option from the 2.5.69 kernel (according to the kernel release time). He can help you complete a lot. It is convenient.

2.4.21 You can use make install

These steps are now doing Make Install.

#Make dep (Make sure the key file is in the correct location) 2.5. * - 2.6.0 is not required. In fact, 2.4. * Some kernels are not needed.

#Make clean (Make sure all related files are in the latest version)

#Make zimage (the kernel in the form of compression)

When you need a kernel to support more peripherals and functions, the kernel may become large, at which time you can compile the large kernel:

#Make bzimage

The compiled time is related to factors such as the hardware conditions of the machine and the configuration of the kernel. Take the author's 64MB memory classifier 300 as an example, compile core nuclear once a generally takes more than 20 minutes. The location of the core obtained is in / usr / src / linux / arch / i386 / boot directory, of course, it is assumed that the user's CPU is X86.

If you select the loading module, after compiling the kernel, you should compile the selected module:

#MAKE MODULE (Module Select)

#Make module-install (transfer the compiled module to the system standard location)

The module is located in /lib/modules/x.y.z in the standard directory in the system, and the following X.y.z is the version number. For security reasons, it is best to back up / lib / modules before running #make modules-install. The module is usually a file with an extension .o, using command #lsmod to list the module of the current kernel.

I am generally made decance; make module; make module-install

Cp /usr/src/linux2.6.0-test2/Arch/i386/boot/bzimage /boot/vmlinuz-2.6.0-test2cp /usr/src/linux-2.6.0-test2/system.map / boot / system. MAP-2.6.0-TEST2

These make installs can be done.

The rest is modified /etc/lilo.conf

vi /etc/lilo.conf

Add a new kernel. Sometimes Make Install has been modified by this.

Here is my lilo.conf

Prompt

TIMEOUT = 50

Default = linux

Boot = / dev / sda

MAP = / boot / map

INSTALL = / boot / 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

So your kernel is upgraded.

转载请注明原文地址:https://www.9cbs.com/read-62623.html

New Post(0)