Initrd: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
(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: Line 2:
{{Stub}}
{{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 ==
== See Also ==

Revision as of 07:33, 31 May 2012

Filesystems
Virtual Filesystems

VFS

Disk Filesystems
CD/DVD Filesystems
Network Filesystems
Flash Filesystems
This page is a stub.
You can help the wiki by accurately adding more contents to it.

"Initrd" stands for "initial ramdisk".

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.).

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).

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.

Popular bootloaders like GRUB support loading initial ramdisks. GRUB also supports loading additional kernel modules directly.

See Also

  • tar archive format
  • SFS simple filesystem implementation

External Links

  • cpio archive format
  • SquashFS filesystem designed for small disks
  • CramFS filesystem designed for compressed ram disks