summaryrefslogtreecommitdiff
path: root/src/kernel/log.c
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2020-09-06 13:44:20 -0400
committerBenji Dial <benji6283@gmail.com>2020-09-06 13:44:20 -0400
commit73bb0e48640b842824a0b45fe4854df8ff7faf7b (patch)
tree077dec8a426db1e835393964da4736e91ff4c69d /src/kernel/log.c
parentcbc85f6e897808b29e2f712156e2fa4d073d8277 (diff)
downloadportland-os-73bb0e48640b842824a0b45fe4854df8ff7faf7b.tar.gz
bugfixes, init program, hello world
Diffstat (limited to 'src/kernel/log.c')
-rw-r--r--src/kernel/log.c20
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);
}