AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
initramfs.h File Reference
#include <fs/vfs.h>
#include <boot/boot.h>

Go to the source code of this file.

Functions

int initramfs_archiver_register (struct fs *fs)
 Registers a filesystem that can make a root from a RAM disk archive.
int load_ramdisk (module_t *module)
 Mounts the RAM disk as the root filesystem.

Variables

struct fs initramfs

Function Documentation

◆ initramfs_archiver_register()

int initramfs_archiver_register ( struct fs * fs)

Registers a filesystem that can make a root from a RAM disk archive.

Parameters
fsthe filesystem, whose load operation reads the archive
Returns
0, or -ENOMEM

Definition at line 32 of file initramfs.c.

References archivers, initramfs_archiver_register(), fs::name, and printk().

Referenced by cpio_init(), and initramfs_archiver_register().

◆ load_ramdisk()

int load_ramdisk ( module_t * module)

Mounts the RAM disk as the root filesystem.

The kernel can't go on without a root: if no archiver can read the RAM disk, it panics.

Parameters
modulethe boot loader's module that holds the RAM disk
Returns
what mounting the root returns

Definition at line 49 of file initramfs.c.

References archivers, DEV, devfs, vnode::fs, kmalloc(), fs::load, load_ramdisk(), M_ZERO, vnode::mode, NULL, panic, printk(), queue_for, rd_dev, rd_size, vnode::rdev, vnode::size, and vfs_mount_root().

Referenced by kmain(), and load_ramdisk().

Variable Documentation

◆ initramfs

struct fs initramfs
extern