Initrd: Difference between revisions

197 bytes added ,  12 years ago
Some rework, mainly to give a better idea on the why and what.
[unchecked revision][unchecked revision]
(Created page with "{{Filesystems}} {{Stub}} == Initial ramdisk == Is a small (usually few MiBs) filesystem image that has to be loaded before kernel execution take place at boot. It contains es...")
 
(Some rework, mainly to give a better idea on the why and what.)
Line 2:
{{Stub}}
 
"Initrd" stands for "initial ramdisk".
== Initial ramdisk ==
Is a small (usually few MiBs) filesystem image that has to be loaded before kernel execution take place at boot. It contains essential parts of the kernel, if kernel supports multiple object files (like [[Microkernel]] or [[Modular Kernel]]).
 
A modular kernel (like a [[Microkernel]] or [[Modular Kernel]]) commonly faces a chicken-and-egg problem: In order to initialize the hardware, it needs to load driver modules; in order to load anything from disk, it needs the necessary drivers (e.g. IDE / SATA, filesystem driver etc.).
The filesystem of the image is totally kernel and version dependent. It's a common way to store data in a static archive file, and on boot "uncompress" it to dynamic filesystem in memory. Simplier implementations use flat image, which has several benefits:
 
* fast boot time (no need to interpret data, bulk copy can be used)
An initial ramdisk is one way to solve this problem. Elementary modules are packed into a single file, which is then loaded together with the kernel by the bootloader. The kernel can then use the in-memory Initrd to initialize elementary hardware (e.g. those required for mass storage access).
* easy to implement loader with BIOS calls in 512 byte
 
* Grub also supports loading image file as ramdisk
The format of the image is totally depending on the kernel and its version. It could be a compressed archive of a "real" ramdisk with filesystem semantics, which is uncompressed in memory, or it could be a flat image.
Also a very popular design choice to compress image file to shorten load time.
 
Popular bootloaders like [[GRUB]] support loading initial ramdisks. GRUB also supports loading additional kernel modules directly.
 
== See Also ==
448

edits