In the network, many servers use Linux. In order to further improve the performance of the server, it may be necessary to recompile the Linux kernel according to specific hardware and requirements. To compile the Linux kernel, you need to follow the prescribed steps. Several important files are involved in compiling the kernel. For example, for RedHat Linux, there are some files related to the Linux kernel in the /boot directory, and enter /boot to execute: ls –l. Those who have compiled the RedHat Linux kernel may have a deep impression on System.map, vmlinuz, initrd-2.4.7-10.img, because the process of compiling the kernel involves the establishment of these files. So how did these files come about? What is the role? This article will introduce some of this.
1. vmlinuz
vmlinuz is a bootable, compressed kernel. “vm” stands for "Virtual Memory". Linux supports virtual memory, unlike older operating systems such as DOS that have a 640KB memory limit. Linux can use hard disk space as virtual memory, hence the name "vm". Vmlinuz is an executable Linux kernel located at /boot/vmlinuz, which is typically a soft link.
There are two ways to build vmlinuz. First, when compiling the kernel, create it by “make zImage”, then pass:
“cp /usr/src/linux-2.4/arch/i386/linux/boot/zImage /boot/vmlinuz” zImage works in the case of small kernels and exists for backward compatibility. The second is that the kernel is compiled with the command make bzImage, and then generated by: < cp /usr/src/linux-2.4/arch/i386/linux/boot/bzImage /boot/vmlinuz” bzImage is a compressed kernel image. Note that bzImage is not compressed with bzip2. bz in bzImage is easy to misunderstand, bz means "big zImage". b in bzImage is "big" meaning.
zImage(vmlinuz) and bzImage(vmlinuz) are both compressed with gzip. Not only are they a compressed file, but gzip decompressed code is embedded in the beginning of the two files. So you can't unpack vmlinuz with gunzip or gzip –dc.
The kernel file contains a tiny gzip for decompressing the kernel and booting it. The difference between the two is that the old zImage decompresses the kernel to low-end memory (the first 640K), and bzImage decompresses the kernel to high-end memory (1M or more). If the kernel is small, you can use one of zImage or bzImage. The system running in the two ways is the same. Large kernels use bzImage and cannot use zImage.
vmlinux is an uncompressed kernel, vmlinuz is a compressed file of vmlinux.
Second, initrd-x.x.x.img
initrd is short for “initial ramdisk”. Initrd is generally used to temporarily boot the hardware to the state where the actual kernel vmlinuz can take over and continue to boot. For example, if you use a scsi hard disk, and the kernel vmlinuz does not have this scsi hardware driver, the kernel cannot load the root file system before loading the scsi module, but the scsi module is stored under the /lib/modules of the root file system. To solve this problem, you can boot an initrd kernel that reads the actual kernel and use initrd to fix the scsi boot problem. Initrd-2.4.7-10.img is a file compressed with gzip. Let's take a look at the contents of this file.
The initrd implementation loads some modules and installs filesystems, etc.
The initrd image file is created using mkinitrd. The mkinitrd utility is able to create initrd image files. This command is proprietary to RedHat. Other Linux distributions may have corresponding commands. This is a handy utility. For details, please refer to the help: man mkinitrd
The following command creates an initrd image file:
3. System.map System.map is a kernel symbol table for a specific kernel. It is a link to the System.map of the kernel you are currently running.
How is the kernel symbol table created? System.map is generated by “nm vmlinux” and the unrelated symbols are filtered out. For the examples in this article, System.map is created in /usr/src/linux-2.4/System.map when compiling the kernel. Like this:
nm /boot/vmlinux-2.4.7-10 > System.map
The following lines are from /usr/src/linux-2.4/Makefile:
nm vmlinux
We have been doing a task in the usual way until we know there is a better way to handle it. As a fo
Use httpry to sniff HTTP traffic under Linux Tutorial Sometimes you want to sniff HTTP traffic for
The disk sector defaults to 512 bytes. To verify, execute it from the command line: fdisk -l
According to foreign media reports, Linux does not seem to be fully loved by people. Operating syste
Registration of the s3c2410 device
Set up a personal Bluetooth LAN under Linux
The principle and function of Redo log
How to reinstall Linux under Linux operating system
Considerations for using ssh to manage VPS under Linux
How to enable dhcp relay to assign IP
Two common startup failure resolution methods for Linux operation
Linux Tips: Introduce two ways to modify port 22
Ubuntu system encrypts files for transmission method
LVS ipvsadm Command Reference Guide
Linux system management and maintenance -zip/unzip command
Solve the situation where the graphic in Ubuntu details is unknown.
Use Windows XP startup script to restore the system user password
How do I display my computer, documents, network and other icons on the win7 desktop?
How to close the win10 firewall?
Windows Server 2003 Server Settings IP Security Policy
What should I do if the win10 touchpad is not closed?
Win10 system adjustment icon size tips
McAfee: Vista can't ensure that users are "absolutely" secure
Win8 system to open the God mode method