blob: 39fc1bad2c9fe32ee459322595b824c97dd051c4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#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++);
}
|