User: Password:
Subscribe / Log in / New account

Initramfs arrives

Initramfs arrives

Posted Nov 12, 2002 15:09 UTC (Tue) by IkeTo (subscriber, #2122)
In reply to: Initramfs arrives by pflugstad
Parent article: Initramfs arrives

Perhaps the section in Kernel Traffic about the matter can give some idea about what it is about. Or perhaps just its name gives enough idea what it is: "Early user-space".

If my understanding is correct (correct me if not), the problem is that traditionally, the first user-mode code can be executed only when the init process (process 1) is created by the swapper process (process 0), which is quite some time after the computer boots up. Further, process 1 requires a complete user-mode picture, so at that time a lot of things must have been set up correctly. Things like a working root directory or a working initrd image, a working console (together with fonts), etc. All these must be hard-coded in kernel mode, even though the code to do such things as mounting a root directory, choose a console driver, etc., must be exposed to the userland anyway for later manipulations.

So the idea is that a "sorta user space" is created, which executes without the full privilege of the kernel just like a "real" user-space, and interacts with the kernel using system calls likewise, but is non-compliant to any Unix standard, and can lack anything that a normal user-space program would normally expect: things like user-id, root directory (or even a real directory structure), console driver, C-library, process id, etc can all be missing. By removing the full user-space burden, we can execute user-space "mini-programs" to do the initialization tasks that are currently done by hard-coding into kernel. The advantage is that the amount of code to be executed in kernel mode is reduced. The remaining of the story is that of the LWN article.

So the initrd mechanism handles the loading of modules, but that's it. Still the kernel has to mount of the root directory (which is the initrd directory), and this has to be hard-coded. It does remove the pain of having to recompile the kernel everytime (because now the hard-coding is only for things that *can* be made always the same), but still the kernel bloat is there. Early user-space take them out.

(Log in to post comments)

Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds