While browsing through the Kernel Makefiles, I found these terms. So I would like to know what is the difference between vmlinux
, vmlinuz
, vmlinux.bin
, zimage
& bzimage
?
Linux Kernel – Difference Between vmLinux, vmlinuz, vmlinux.bin, zimage & bzimage
file formatkernellinux
Best Answer
vmlinux
This is the Linux kernel in an statically linked executable file format. Generally, you don't have to worry about this file, it's just a intermediate step in the boot procedure.
The raw vmlinux file may be useful for debugging purposes.
vmlinux.bin
The same as vmlinux, but in a bootable raw binary file format. All symbols and relocation information is discarded. Generated from
vmlinux
byobjcopy -O binary vmlinux vmlinux.bin
.vmlinuz
The vmlinux file usually gets compressed with
zlib
. Since 2.6.30LZMA
andbzip2
are also available. By adding further boot and decompression capabilities to vmlinuz, the image can be used to boot a system with the vmlinux kernel. The compression of vmlinux can occur with zImage or bzImage.The function
decompress_kernel()
handles the decompression of vmlinuz at bootup, a message indicates this:zImage (
make zImage
)This is the old format for small kernels (compressed, below 512KB). At boot, this image gets loaded low in memory (the first 640KB of the RAM).
bzImage (
make bzImage
)The big zImage (this has nothing to do with
bzip2
), was created while the kernel grew and handles bigger images (compressed, over 512KB). The image gets loaded high in memory (above 1MB RAM). As today's kernels are way over 512KB, this is usually the preferred way.An inspection on Ubuntu 10.10 shows: