From ff08fdffab42742411512f3a7c8c9d889946a1a9 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Fri, 29 Oct 2021 09:51:00 +0200 Subject: [PATCH] Debug refactor --- drivers/vga.c | 5 ++++- drivers/vga.h | 3 ++- kernel/kernel.c | 9 +++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/vga.c b/drivers/vga.c index 0d238dd..26b8b4f 100644 --- a/drivers/vga.c +++ b/drivers/vga.c @@ -12,7 +12,9 @@ void vga_init() { port_outb(0x3d5, 0x20); // Clear screen - clear_screen(); + // clear_screen(); + + set_cursor_pos(0, 11); } /* @@ -23,6 +25,7 @@ char* get_memory_charpos(unsigned int col, unsigned int row) { } void writechar(char c, unsigned int col, unsigned int row, int attribute_byte) { + if( !attribute_byte ) attribute_byte = DEFAULT_COLOR; diff --git a/drivers/vga.h b/drivers/vga.h index 41cab80..3a9365f 100644 --- a/drivers/vga.h +++ b/drivers/vga.h @@ -1,7 +1,8 @@ #define VGA_ADDRESS (char*)0xb8000 #define VGA_ADDRESS_MAX (char*)0xb8fa0 -#define DEFAULT_COLOR 0x07 +// #define DEFAULT_COLOR 0x07 +#define DEFAULT_COLOR 0x0f #define MAX_ROWS 25 #define MAX_COLS 80 diff --git a/kernel/kernel.c b/kernel/kernel.c index f96074a..67a13cf 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -13,8 +13,13 @@ void main() { char* subtitle = "A x86 operating system, licenced under GPL-2.0"; println(subtitle, DEFAULT_COLOR); - char* strbuf = "String concat: "; - char* str2 = "WORKS! :D"; + /* + print("Kernel offset: ", DEFAULT_COLOR); + println("0x1000", DEFAULT_COLOR); + */ + + char* strbuf = "Concat test: "; + char* str2 = "Works!"; strbuf = strcat(strbuf, str2); set_cursor_pos(0, 4); println(strbuf, DEFAULT_COLOR);