diff options
author | Marvin Borner | 2019-11-01 01:42:55 +0100 |
---|---|---|
committer | Marvin Borner | 2019-11-01 01:42:55 +0100 |
commit | c0fc7e35191ca9edf13958e12c4eb79e5c49e21c (patch) | |
tree | fc3ff586b53b21a1f2c68d1cd2d12800c9ac97c8 /src/kernel/system.c | |
parent | ae3b264c17e25325fb91831494f459bd6b1c4b7a (diff) |
Tried implementing better logging system
Diffstat (limited to 'src/kernel/system.c')
-rw-r--r-- | src/kernel/system.c | 9 |
1 files changed, 4 insertions, 5 deletions
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 <kernel/timer/timer.h> #include <kernel/io/io.h> #include <kernel/graphics/vesa.h> #include <kernel/lib/lib.h> +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 |