From 5badddbadad80268929d63718751aa5615da6fb0 Mon Sep 17 00:00:00 2001 From: Jarkko Toivanen Date: Fri, 23 Jun 2023 22:54:46 +0300 Subject: [PATCH] Using framebuffer info for putpixel loop instead of hardcoded values (never expect Multiboot to give you what you want!) --- src/kernel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kernel.c b/src/kernel.c index 115a290..60d6c3a 100644 --- a/src/kernel.c +++ b/src/kernel.c @@ -71,8 +71,8 @@ void kmain (unsigned int mbootmagick, multiboot_info_t* mbootinfo) { int x, y, i; unsigned char c = 0; for(;;) { - for(y=0;y<768;y++) { - for(x=0;x<1024;x++) { + for(y=0; y < mbootinfo->framebuffer_height; y++) { + for(x=0; x < mbootinfo->framebuffer_width; x++) { putpixel(x, y, c, c, c, 0xff); } }