summaryrefslogtreecommitdiff
path: root/src/kernel/log.c
blob: bc8ff849c15335607a45d1bc505bec55ff7c938b (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
#include "vga.h"
#include "serial.h"

#define INFO_COM COM1

void init_log() {
  vga_set_color(0x30);
  vga_blank();
}

void logch(char ch) {
  if (ch == '\n') {
    sout(INFO_COM, (uint8_t)'\r');
    sout(INFO_COM, (uint8_t)'\n');
  }
  else
    sout(INFO_COM, (uint8_t)ch);

  vga_printch(ch);
}

void logsz(const char *sz) {
  while (*sz)
    logch(*sz++);
}