summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2022-05-06 01:03:18 +0300
committerLinus Groh <mail@linusgroh.de>2022-05-06 12:28:19 +0200
commita0a1ac0656f6dfe2d57392d7315901fbde8e3661 (patch)
tree671f694c19b2320f0e2a1890a03299f10d7d7794
parent7ab51b6df2f5c53f6a816285f0a4ddbd02ba0b2b (diff)
downloadserenity-a0a1ac0656f6dfe2d57392d7315901fbde8e3661.zip
Kernel/Graphics: Use boot console if the subsystem is disabled
This lets us actually to initialize VirtualConsoles later on.
-rw-r--r--Kernel/Graphics/GraphicsManagement.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/Kernel/Graphics/GraphicsManagement.cpp b/Kernel/Graphics/GraphicsManagement.cpp
index 48a383fc21..8f966ee0be 100644
--- a/Kernel/Graphics/GraphicsManagement.cpp
+++ b/Kernel/Graphics/GraphicsManagement.cpp
@@ -250,8 +250,16 @@ UNMAP_AFTER_INIT bool GraphicsManagement::initialize()
*/
auto graphics_subsystem_mode = kernel_command_line().graphics_subsystem_mode();
- if (graphics_subsystem_mode == CommandLine::GraphicsSubsystemMode::Disabled)
+ if (graphics_subsystem_mode == CommandLine::GraphicsSubsystemMode::Disabled) {
+ VERIFY(!m_console);
+ // If no graphics driver was instantiated and we had a bootloader provided
+ // framebuffer console we can simply re-use it.
+ if (auto* boot_console = g_boot_console.load()) {
+ m_console = *boot_console;
+ boot_console->unref(); // Drop the leaked reference from Kernel::init()
+ }
return true;
+ }
if (graphics_subsystem_mode == CommandLine::GraphicsSubsystemMode::Limited && !multiboot_framebuffer_addr.is_null() && multiboot_framebuffer_type != MULTIBOOT_FRAMEBUFFER_TYPE_RGB) {
dmesgln("Graphics: Using a preset resolution from the bootloader, without knowing the PCI device");