Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
outsize of I think zimage is gz compression and bzimage is bz compression... jut naming, afaik none of it means a damn thing. but I could be wrong. –  xenoterracide Jan 7 '11 at 14:26
    
-1. are you going to learn such trivial things yourself at least sometime? –  alex Jan 7 '11 at 15:16
    
@alex Is this such a bad question? What's so trivial about it? –  Tshepang Jan 7 '11 at 17:10
1  
@Gilles Isn't it a case that a whole bunch of questions in here can also be answered by reading Wikipedia? I just want to know what criteria is there? I thought the idea was that this becomes THE canonical Q&A on matters related to Unix/Linux. –  Tshepang Jan 7 '11 at 18:59
1  
I created a discussion on meta for this. See Is it okay to ask questions here when Wikipedia already has the answer? –  Stefan Lasiewski Jan 7 '11 at 19:45
show 6 more comments

2 Answers

up vote 14 down vote accepted

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 binary file format.

vmlinuz

The vmlinux file usually gets compressed with zlib. Since 2.6.30 LZMA and bzip2 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:

Decompressing Linux... done
Booting the kernel.

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:

ls -lh /boot/vmlinuz-$(uname -r)
-rw-r--r-- 1 root root 4.1M 2010-11-24 12:21 /boot/vmlinuz-2.6.35-23-generic

file /boot/vmlinuz-$(uname -r)
/boot/vmlinuz-2.6.35-23-generic: Linux kernel x86 boot executable bzImage, version 2.6.35-23-generic (buildd@rosea, RO-rootFS, root_dev 0x6801, swap_dev 0x4, Normal VGA
share|improve this answer
    
Where is this decompress_kernel() function implementation located? –  Sen Jan 10 '11 at 5:43
    
Great Answer.. Thanks.. –  Sen Jan 10 '11 at 5:44
    
It is located at /arch/$ARCH/boot/compressed/misc.c, see here: lxr.linux.no/#linux+v2.6.37/arch/x86/boot/compressed/… –  wag Jan 10 '11 at 9:28
add comment

It's all in here: http://en.wikipedia.org/wiki/Vmlinux

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.