mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 10:44:58 +00:00
Kernel: Don't use framebuffer if flag is not set
According to multiboot spec if flag for framebuffer isn't set then corresponding fields are invalid. In reality they're set to 0 but let's be defensive.
This commit is contained in:
parent
10d4bbd133
commit
342c707be3
1 changed files with 1 additions and 1 deletions
|
@ -254,7 +254,7 @@ extern "C" [[noreturn]] UNMAP_AFTER_INIT void init([[maybe_unused]] BootInfo con
|
||||||
// If the bootloader didn't provide a framebuffer, then set up an initial text 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.
|
// We do so we can see the output on the screen as soon as possible.
|
||||||
if (!kernel_command_line().is_early_boot_console_disabled()) {
|
if (!kernel_command_line().is_early_boot_console_disabled()) {
|
||||||
if (!multiboot_framebuffer_addr.is_null() && multiboot_framebuffer_type == MULTIBOOT_FRAMEBUFFER_TYPE_RGB) {
|
if ((multiboot_flags & MULTIBOOT_INFO_FRAMEBUFFER_INFO) && !multiboot_framebuffer_addr.is_null() && multiboot_framebuffer_type == MULTIBOOT_FRAMEBUFFER_TYPE_RGB) {
|
||||||
g_boot_console = &try_make_lock_ref_counted<Graphics::BootFramebufferConsole>(multiboot_framebuffer_addr, multiboot_framebuffer_width, multiboot_framebuffer_height, multiboot_framebuffer_pitch).value().leak_ref();
|
g_boot_console = &try_make_lock_ref_counted<Graphics::BootFramebufferConsole>(multiboot_framebuffer_addr, multiboot_framebuffer_width, multiboot_framebuffer_height, multiboot_framebuffer_pitch).value().leak_ref();
|
||||||
} else {
|
} else {
|
||||||
g_boot_console = &Graphics::VGATextModeConsole::initialize().leak_ref();
|
g_boot_console = &Graphics::VGATextModeConsole::initialize().leak_ref();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue