diff options
-rw-r--r-- | Base/usr/share/man/man7/boot_parameters.md | 6 | ||||
-rw-r--r-- | Kernel/CommandLine.cpp | 10 | ||||
-rw-r--r-- | Kernel/CommandLine.h | 1 | ||||
-rw-r--r-- | Kernel/init.cpp | 10 |
4 files changed, 23 insertions, 4 deletions
diff --git a/Base/usr/share/man/man7/boot_parameters.md b/Base/usr/share/man/man7/boot_parameters.md index 0a1fc305ae..9618e93a00 100644 --- a/Base/usr/share/man/man7/boot_parameters.md +++ b/Base/usr/share/man/man7/boot_parameters.md @@ -35,6 +35,12 @@ List of options: * **`disable_virtio`** - If present on the command line, virtio devices will not be detected, and initialized on boot. +* **`early_boot_console`** - This parameter expects **`on`** or **`off`** and is by default set to **`on`**. + When set to **`off`**, the kernel will not initialize any early console to show kernel dmesg output. + When set to **`on`**, the kernel will try to initialize either a text mode console (if VGA text mode was detected) + or framebuffer console, based on what the Multiboot bootloader specified on the physical address, width, height + and bit color depth. + * **`enable_ioapic`** - This parameter expects **`on`** or **`off`** and is by default set to **`on`**. When set to **`off`**, the kernel will initialize the two i8259 PICs. When set to **`on`**, the kernel will try to initialize the IOAPIC (or IOAPICs if there's more than one), diff --git a/Kernel/CommandLine.cpp b/Kernel/CommandLine.cpp index 1bf2f0a228..8f9d24bdd4 100644 --- a/Kernel/CommandLine.cpp +++ b/Kernel/CommandLine.cpp @@ -135,6 +135,16 @@ UNMAP_AFTER_INIT bool CommandLine::is_ioapic_enabled() const PANIC("Unknown enable_ioapic setting: {}", value); } +UNMAP_AFTER_INIT bool CommandLine::is_early_boot_console_disabled() const +{ + auto value = lookup("early_boot_console"sv).value_or("on"sv); + if (value == "on"sv) + return false; + if (value == "off"sv) + return true; + PANIC("Unknown early_boot_console setting: {}", value); +} + UNMAP_AFTER_INIT bool CommandLine::is_vmmouse_enabled() const { return lookup("vmmouse"sv).value_or("on"sv) == "on"sv; diff --git a/Kernel/CommandLine.h b/Kernel/CommandLine.h index b4ef9b7fb6..0fe2ef1169 100644 --- a/Kernel/CommandLine.h +++ b/Kernel/CommandLine.h @@ -85,6 +85,7 @@ public: [[nodiscard]] bool disable_uhci_controller() const; [[nodiscard]] bool disable_usb() const; [[nodiscard]] bool disable_virtio() const; + [[nodiscard]] bool is_early_boot_console_disabled() const; [[nodiscard]] AHCIResetMode ahci_reset_mode() const; [[nodiscard]] StringView userspace_init() const; [[nodiscard]] NonnullOwnPtrVector<KString> userspace_init_args() const; diff --git a/Kernel/init.cpp b/Kernel/init.cpp index 3e11be2bf1..a89afa848e 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -195,10 +195,12 @@ extern "C" [[noreturn]] UNMAP_AFTER_INIT void init(BootInfo const& boot_info) // NOTE: If the bootloader provided a framebuffer, then set up an initial console. // If the bootloader didn't provide a framebuffer, then set up an initial text console. // We do so we can see the output on the screen as soon as possible. - if (!multiboot_framebuffer_addr.is_null()) { - g_boot_console = &try_make_ref_counted<Graphics::BootFramebufferConsole>(multiboot_framebuffer_addr, multiboot_framebuffer_width, multiboot_framebuffer_height, multiboot_framebuffer_pitch).value().leak_ref(); - } else { - g_boot_console = &Graphics::TextModeConsole::initialize().leak_ref(); + if (!kernel_command_line().is_early_boot_console_disabled()) { + if (!multiboot_framebuffer_addr.is_null()) { + g_boot_console = &try_make_ref_counted<Graphics::BootFramebufferConsole>(multiboot_framebuffer_addr, multiboot_framebuffer_width, multiboot_framebuffer_height, multiboot_framebuffer_pitch).value().leak_ref(); + } else { + g_boot_console = &Graphics::TextModeConsole::initialize().leak_ref(); + } } dmesgln("Starting SerenityOS..."); |