ArticleslgStudy

science

Vmlinux

Vmlinux is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Vmlinux rather than just read about it. In short: vmlinux (Virtual Memory Linux) is a statically linked executable file that contains the Linux kernel in one of the object file formats supported by Linux, which includes Executable and Linkable Format (ELF) and Common Object File Format (COFF). The vmlinux file might be required for kernel debugging, symbol table generation or other operations, but must be made bootable before being used as an operating system kerne…

Vmlinux — main illustration
Vmlinux — illustration

Key takeaways

  • Vmlinux belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Vmlinux to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Vmlinux from memory before moving on to harder problems.

Reference excerpt

vmlinux (Virtual Memory Linux) is a statically linked executable file that contains the Linux kernel in one of the object file formats supported by Linux, which includes Executable and Linkable Format (ELF) and Common Object File Format (COFF). The vmlinux file might be required for kernel debugging, symbol table generation or other operations, but must be made bootable before being used as an operating system kernel by adding a multiboot header, bootsector and setup routines. vmlinuz is the compressed version of vmlinux.

Etymology Traditionally, UNIX platforms called the kernel image /unix. With the development of virtual memory, kernels that supported this feature were given the vm- prefix to differentiate them. The name vmlinux is a mutation of vmunix, while in vmlinuz the letter z at the end denotes that it is compressed (for example gzipped).

Location Traditionally, the kernel was located in the root directory of the filesystem hierarchy; however, as the bootloader must use BIOS drivers to access the hard disk, limitations on some i386 systems meant only the first 1024 cylinders of the hard disk were addressable. To overcome this, Linux distributors encouraged users to create a partition at the beginning of their drives specifically for storing bootloader and kernel-related files. GRUB, LILO and SYSLINUX are common bootloaders. By convention, this partition is mounted on the filesystem hierarchy as /boot. This was later standardised by the Filesystem Hierarchy Standard (FHS), which now requires the Linux kernel image to be located in either / or /boot, although there is no technical restriction enforcing this.

Compression Traditionally, when creating a bootable kernel image, the kernel is also compressed using gzip, or, since Linux 2.6.30, using LZMA or bzip2, which requires a very small decompression stub to be included in the resulting image. The stub decompresses the kernel code, on some systems printing dots to the console to indicate progress, and then continues the boot process. Support for LZO, xz, LZ4 and zstd compression was added later. The decompression routine is a negligible factor in boot time, and prior to the development of the bzImage, the size constraints of some architectures, notably i386, were extremely limiting, making compression a necessity. On the SPARC architecture, the vmlinux file is compressed using simple gzip, because the SILO boot loader transparently decompresses gzipped images. The filename of the bootable image is not important, but many popular distributions use vmlinuz.

bzImage

As the Linux kernel matured, the size of the kernels generated by users grew beyond the limits imposed by some architectures, where the space available to store the compressed kernel code is limited. The bzImage (big zImage) format was developed to overcome this limitation by splitting the kernel over non-contiguous memory regions. The bzImage was compressed using gzip until Linux 2.6.30, which introduced more algorithms. Although the bz prefix may suggest that bzip2 compression is used, this is not the case. (The bzip2 package is often distributed with tools prefixed with bz, such as bzless, bzcat, etc.) The bzImage file is in a specific format. It contains concatenated bootsect.o + setup.o + misc.o + piggy.o. piggy.o contains the gzipped vmlinux file in its data section. The script extract-vmlinux found under scripts/ in the kernel sources decompresses a kernel image. Some distributions (e.g. Red Hat and clones) may come with a kernel-debuginfo RPM that contains the vmlinux file for the matching kernel RPM, and it typically gets installed under /usr/lib/debug/lib/modules/$(uname -r)/vmlinux or /usr/lib/debug/lib64/modules/$(uname -r)/vmlinux.

See also

Booting process of Linux Linux kernel Module (Linux) initrd System.map Object file

Notes and references

Further reading Alavoor Vasudevan (2003-08-15). "10. Kernel Files Information". The Linux Kernel HOWTO. Archived from the original on 2017-10-10. Retrieved 2014-03-11. Daniel Pierre Bovet (2013-01-03). "Special sections in Linux binaries". LWN.net. all special sections appearing in the Linux kernel end up packed in one of the segments defined in the vmlinux ELF header. Each special section fulfills a particular purpose.

External links Boot process

Illustrations

Vmlinux: Linux kernel boot and decompression process
Linux kernel boot and decompression process
Vmlinux: Anatomy of a bzImage
Anatomy of a bzImage

Worked examples

Example 1 — a first encounter with Vmlinux

Start with the simplest possible case. Write down what Vmlinux claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Vmlinux before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Vmlinux ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Vmlinux

In research
Vmlinux appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Vmlinux in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Vmlinux is common in secondary-school and first-year university syllabi. It links to neighbouring topics Linux kernel, so understanding it makes those chapters shorter.
In everyday life
Look for Vmlinux outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Vmlinux” →

How to study Vmlinux in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Vmlinux means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Vmlinux out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Vmlinux in simple terms?

vmlinux (Virtual Memory Linux) is a statically linked executable file that contains the Linux kernel in one of the object file formats supported by Linux, which includes Executable and Linkable Format (ELF) and Common Object File Format (COFF). The vmlinux file might be required for kernel debuggin…

Why does Vmlinux matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Vmlinux?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Vmlinux.

Tags

  • Linux kernel

Keep exploring