diff options
author | Benji Dial <Benji3.141@gmail.com> | 2020-08-13 23:59:14 -0400 |
---|---|---|
committer | Benji Dial <Benji3.141@gmail.com> | 2020-08-13 23:59:14 -0400 |
commit | 7ff724fe8f709440da9c730fdb8dcbaa4f989ed5 (patch) | |
tree | e7f768ff56798bef3edc166a30e9cb8d7f25bd1e /src/kernel/log.c | |
parent | 2ddbeb9f7214f6d3feef651eba83e6a9d120a743 (diff) | |
download | portland-os-7ff724fe8f709440da9c730fdb8dcbaa4f989ed5.tar.gz |
FAT16 directory enumeration, making many functions static, new 'log' functions to wrap vga and serial
Diffstat (limited to 'src/kernel/log.c')
-rw-r--r-- | src/kernel/log.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/kernel/log.c b/src/kernel/log.c new file mode 100644 index 0000000..e8695cc --- /dev/null +++ b/src/kernel/log.c @@ -0,0 +1,25 @@ +#include "vga.h" +#include "serial.h" + +#define INFO_COM COM1 + +void init_log() { + vga_set_color(0x2f); + 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++); +}
\ No newline at end of file |