SerenityOS / serenity

The Serenity Operating System 🐞
https://serenityos.org
BSD 2-Clause "Simplified" License
29.46k stars 3.14k forks source link

Userland: Move base system initialization from SystemServer to separate program, add "drop to shell" feature #24574

Closed supercomputer7 closed 3 days ago

supercomputer7 commented 2 weeks ago

The BuggieBox program is now the first program to run in the system, so it will initialize all the basic stuff once so SystemServer doesn't need to worry about this again in its main code.

The init program is now the first program to run in the system, so it will initialize all the basic stuff once so SystemServer doesn't need to worry about this again in its main code.

In case the user requests this, init can drop directly to a shell without trying to spawn SystemServer.

To test this on x86-64, run:

Meta/serenity.sh run x86_64 GNU "init_args=emergency"

This functionality can be useful in many cases:

supercomputer7 commented 1 week ago

I can see the value in splitting out init (and therefore integrating it into BuggieBox via the usual utility path), but I'm having my doubts that we want the user to go through BuggieBox on a normal booting system. Keep in mind that BusyBox will either keep all the various libraries mapped in memory or will eventually be statically linked, so it's not exactly ideal for the leanest boot and rescue environment.

I can see the value in splitting out init (and therefore integrating it into BuggieBox via the usual utility path), but I'm having my doubts that we want the user to go through BuggieBox on a normal booting system. Keep in mind that BusyBox will either keep all the various libraries mapped in memory or will eventually be statically linked, so it's not exactly ideal for the leanest boot and rescue environment.

Why not ideal for the leanest boot and rescue environment? I'd expect us to have support for initramfs in the future (see the containers PR) and by doing that we could use buggiebox from a RAMFS instance, which should result in a fast load of commands.