#include "vga.h" #include "serial.h" #include "log.h" #define LOG_COM COM1 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(LOG_COM, (uint8_t)'\r'); sout(LOG_COM, (uint8_t)'\n'); } else sout(LOG_COM, (uint8_t)ch); vga_printch(ch); } void logsz(const char *sz) { while (*sz) logch(*sz++); }