From c0fc7e35191ca9edf13958e12c4eb79e5c49e21c Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 1 Nov 2019 01:42:55 +0100 Subject: Tried implementing better logging system --- src/kernel/system.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/kernel/system.c') diff --git a/src/kernel/system.c b/src/kernel/system.c index 2de1183..3b3cf95 100644 --- a/src/kernel/system.c +++ b/src/kernel/system.c @@ -1,15 +1,16 @@ -#ifndef MELVIX_SYSTEM_H -#define MELVIX_SYSTEM_H - #include #include #include #include +char *vga_buffer = (char *) 0x500; + void vga_log(char *msg, int line) { uint16_t *terminal_buffer = (uint16_t *) 0xB8000; for (size_t i = 0; i < strlen(msg); i++) terminal_buffer[line * 80 + i] = (uint16_t) msg[i] | (uint16_t) 0x700; + strcpy(msg, "\n"); + memcpy(vga_buffer, msg, sizeof(msg)); } void kernel_time() { @@ -62,5 +63,3 @@ void assert(int x) { panic("Assertion failed"); } } - -#endif -- cgit v1.2.3