vmlinux
is a
statically linked
A stand-alone program, also known as a freestanding program, is a computer program that does not load any external module, library function or program and that is designed to boot with the bootstrap procedure of the target processor – it runs o ...
executable
In computing, executable code, an executable file, or an executable program, sometimes simply referred to as an executable or binary, causes a computer "to perform indicated tasks according to encoded instruction (computer science), instructi ...
file that contains the
Linux kernel
The Linux kernel is a free and open-source, monolithic, modular, multitasking, Unix-like operating system kernel. It was originally authored in 1991 by Linus Torvalds for his i386-based PC, and it was soon adopted as the kernel for the GNU ope ...
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
In computer programming and software development, debugging is the process of finding and resolving '' bugs'' (defects or problems that prevent correct operation) within computer programs, software, or systems.
Debugging tactics can involve in ...
,
symbol table generation or other operations, but must be made bootable before being used as an
operating system kernel
The kernel is a computer program at the core of a computer's operating system and generally has complete control over everything in the system. It is the portion of the operating system code that is always resident in memory and facilitates in ...
by adding a
multiboot
Multi-booting is the act of installing multiple operating systems on a single computer, and being able to choose which one to boot. The term dual-booting refers to the common configuration of specifically two operating systems. Multi-booting may ...
header,
bootsector and setup routines.
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 The History of the Berkeley Software Distribution begins in the 1970s.
1BSD (PDP-11)
The earliest distributions of Unix from Bell Labs in the 1970s included the source code to the operating system, allowing researchers at universities to modify an ...
, 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
In a computer file system, and primarily used in the Unix and Unix-like operating systems, the root directory is the first or top-most directory in a hierarchy. It can be likened to the trunk of a tree, as the starting point where all branches ...
of the filesystem hierarchy; however, as the bootloader must use
BIOS
In computing, BIOS (, ; Basic Input/Output System, also known as the System BIOS, ROM BIOS, BIOS ROM or PC BIOS) is firmware used to provide runtime services for operating systems and programs and to perform hardware initialization during the ...
drivers to access the
hard disk
A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating platters coated with magnet ...
, limitations on some
i386 systems meant only the
first 1024 cylinders of the
hard disk
A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating platters coated with magnet ...
were addressable.
To overcome this, Linux distributors encouraged users to create a
partition
Partition may refer to:
Computing Hardware
* Disk partitioning, the division of a hard disk drive
* Memory partition, a subdivision of a computer's memory, usually for use by a single job
Software
* Partition (database), the division of a ...
at the beginning of their drives specifically for storing
bootloader and kernel-related files.
GRUB
Grub can refer to Grub (larva), of the beetle superfamily Scarabaeoidea, or as a slang term for food. It can also refer to:
Places
* Grub, Appenzell Ausserrhoden, Switzerland
* Grub, St. Gallen, Switzerland
* Grub (Amerang), a hamlet in Bavaria, ...
,
LILO and
SYSLINUX are common
bootloaders.
By convention, this partition is
mount
Mount is often used as part of the name of specific mountains, e.g. Mount Everest.
Mount or Mounts may also refer to:
Places
* Mount, Cornwall, a village in Warleggan parish, England
* Mount, Perranzabuloe, a hamlet in Perranzabuloe parish, C ...
ed on the filesystem hierarchy as
/boot
. This was later standardised by the
Filesystem Hierarchy Standard
The Filesystem Hierarchy Standard (FHS) is a reference describing the conventions used for the layout of a UNIX system. It has been made popular by its use in Linux distributions, but it is used by other UNIX variants as well. It is maintained b ...
(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,
[Linux 2.6.30, released the 9th of June 2009, added support to compress the kernel image with the LZMA and bzip2 algorithm]
/ref> 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
Zstandard, commonly known by the name of its reference implementation zstd, is a lossless data compression algorithm developed by Yann Collet at Facebook.
''Zstd'' is the reference implementation in C. Version 1 of this implementation was re ...
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
A silo (from the Greek σιρός – ''siros'', "pit for holding grain") is a structure for storing bulk materials. Silos are used in agriculture to store fermented feed known as silage, not to be confused with a grain bin, which is used t ...
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
A prefix is an affix which is placed before the Word stem, stem of a word. Adding it to the beginning of one word changes it into another word. For example, when the prefix ''un-'' is added to the word ''happy'', it creates the word ''unhappy'' ...
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
Red Hat, Inc. is an American software company that provides open source software products to enterprises. Founded in 1993, Red Hat has its corporate headquarters in Raleigh, North Carolina, with other offices worldwide.
Red Hat has become ass ...
and clones) may come with a kernel-debuginfo
RPM
Revolutions per minute (abbreviated rpm, RPM, rev/min, r/min, or with the notation min−1) is a unit of rotational speed or rotational frequency for rotating machines.
Standards
ISO 80000-3:2019 defines a unit of rotation as the dimensionl ...
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
* Linux kernel
The Linux kernel is a free and open-source, monolithic, modular, multitasking, Unix-like operating system kernel. It was originally authored in 1991 by Linus Torvalds for his i386-based PC, and it was soon adopted as the kernel for the GNU ope ...
* Module (Linux)
* initrd
* System.map In Linux, the file is a symbol table used by the kernel.
A symbol table is a look-up between symbol names and their addresses in memory. A symbol name may be the name of a variable or the name of a function. The System.map is required when the add ...
* Object file
Notes and references
Further reading
*
*
External links
Boot process
{{Linux kernel
Linux kernel