mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-22 15:44:45 +00:00
Kernel: Instantiate a TextModeConsole early on if there's no framebuffer
If the bootloader that loaded us is providing a framebuffer details from the Multiboot protocol then we can instantiate a framebuffer console. Otherwise, we should use a text mode console, assuming that the BIOS and the bootloader didn't try to modeset the screen resolution so we have is a VGA 80x25 text mode being displayed on screen. Since "boot_framebuffer_console" is no longer a good representative as a global variable name, it's changed to g_boot_console to match the fact that it can be assigned with a text mode console and not framebuffer console if needed.
This commit is contained in:
@@ -23,7 +23,7 @@ namespace Kernel {
|
||||
|
||||
static Singleton<GraphicsManagement> s_the;
|
||||
|
||||
extern Atomic<Graphics::BootFramebufferConsole*> boot_framebuffer_console;
|
||||
extern Atomic<Graphics::Console*> g_boot_console;
|
||||
|
||||
GraphicsManagement& GraphicsManagement::the()
|
||||
{
|
||||
@@ -221,7 +221,7 @@ UNMAP_AFTER_INIT bool GraphicsManagement::initialize()
|
||||
if (!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 = boot_framebuffer_console.load()) {
|
||||
if (auto* boot_console = g_boot_console.load()) {
|
||||
m_console = *boot_console;
|
||||
boot_console->unref(); // Drop the leaked reference from Kernel::init()
|
||||
}
|
||||
@@ -247,7 +247,7 @@ void GraphicsManagement::set_console(Graphics::Console& console)
|
||||
{
|
||||
m_console = console;
|
||||
|
||||
if (auto* boot_console = boot_framebuffer_console.exchange(nullptr)) {
|
||||
if (auto* boot_console = g_boot_console.exchange(nullptr)) {
|
||||
// Disable the initial boot framebuffer console permanently
|
||||
boot_console->disable();
|
||||
// TODO: Even though we swapped the pointer and disabled the console
|
||||
|
||||
Reference in New Issue
Block a user