From 73bb0e48640b842824a0b45fe4854df8ff7faf7b Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 6 Sep 2020 13:44:20 -0400 Subject: bugfixes, init program, hello world --- src/kernel/log.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/kernel/log.c') diff --git a/src/kernel/log.c b/src/kernel/log.c index bc8ff84..39fc1ba 100644 --- a/src/kernel/log.c +++ b/src/kernel/log.c @@ -1,20 +1,26 @@ #include "vga.h" #include "serial.h" +#include "log.h" -#define INFO_COM COM1 +#define LOG_COM COM1 -void init_log() { - vga_set_color(0x30); - vga_blank(); +static const uint8_t log_mode_colors[] = { + 0x30, + 0x07, + 0x4f +}; + +void set_log_mode(enum log_mode mode) { + vga_set_color(log_mode_colors[mode]); } void logch(char ch) { if (ch == '\n') { - sout(INFO_COM, (uint8_t)'\r'); - sout(INFO_COM, (uint8_t)'\n'); + sout(LOG_COM, (uint8_t)'\r'); + sout(LOG_COM, (uint8_t)'\n'); } else - sout(INFO_COM, (uint8_t)ch); + sout(LOG_COM, (uint8_t)ch); vga_printch(ch); } -- cgit v1.2.3