diff --git a/kernel/arch/i386/VESA.cpp b/kernel/arch/i386/VESA.cpp index 0b196303..4413dc1b 100644 --- a/kernel/arch/i386/VESA.cpp +++ b/kernel/arch/i386/VESA.cpp @@ -85,7 +85,10 @@ namespace VESA bool Initialize() { if (!(s_multiboot_info->flags & MULTIBOOT_FLAGS_FRAMEBUFFER)) + { + derrorln("bootloader did not provide a memory map"); return false; + } auto& framebuffer = s_multiboot_info->framebuffer; s_addr = framebuffer.addr; @@ -101,7 +104,7 @@ namespace VESA { if (s_bpp != 24 && s_bpp != 32) { - dprintln("Unsupported bpp {}", s_bpp); + derrorln("Unsupported bpp {}", s_bpp); return false; } @@ -123,7 +126,7 @@ namespace VESA } else { - dprintln("Unsupported type for VESA framebuffer"); + derrorln("Unsupported type for VESA framebuffer"); return false; } @@ -291,7 +294,7 @@ namespace VESA static void TextPutCharAt(uint16_t ch, uint32_t x, uint32_t y, Color fg, Color bg) { - uint32_t index = y * s_pitch + x; + uint32_t index = y * s_width + x; ((uint16_t*)s_addr)[index] = TextEntry(ch, TextColor(fg, bg)); } diff --git a/kernel/kernel/kernel.cpp b/kernel/kernel/kernel.cpp index c280d974..a02de45a 100644 --- a/kernel/kernel/kernel.cpp +++ b/kernel/kernel/kernel.cpp @@ -67,10 +67,7 @@ extern "C" void kernel_main(multiboot_info_t* mbi, uint32_t magic) s_multiboot_info = mbi; if (!VESA::Initialize()) - { - dprintln("Could not initialize VESA"); return; - } ParsedCommandLine cmdline; if (mbi->flags & 0x02)