0

I'm trying to gain a clearer understanding of the Linux boot process and the role of initramfs in loading kernel modules. Specifically, I'm interested in knowing whether the modules loaded by initramfs are placed in user space or kernel space.

As far as I know, initramfs is a temporary file system used during the initial stages of the Linux kernel boot process. It contains essential files and drivers required to mount the actual root file system

Could someone please clarify whether these modules are loaded into user space or kernel space? Additionally, it would be helpful if you could provide a brief explanation of the boot process and how the transition from kernel space to user space occurs in this context

1 Answer 1

1

Kernel modules are loaded into kernel space, hence the term "kernel modules". (Whether they're done by initramfs or rootfs doesn't matter.)

The loading is initially done by a user space tool such as udev or modprobe, which uses libkmod to find the necessary module, then invokes the init_module(2) system call to transfer it into kernel space.

The initramfs is not limited to only loading kernel modules, however; it can run any userspace tools – including modprobe/insmod to load kernel modules, of course, but it can also include userspace daemons if necessary (e.g. ntfs-3g if your rootfs is on NTFS, or iscsid if it's an iSCSI volume).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .