diff options
Diffstat (limited to 'src/kernel/log.c')
-rw-r--r-- | src/kernel/log.c | 20 |
1 files changed, 13 insertions, 7 deletions
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); } |