diff --git a/kern.img b/kern.img index fa2b04d..1f5f9d1 100644 Binary files a/kern.img and b/kern.img differ diff --git a/libk/error/debug.c b/libk/error/debug.c index bf1cae3..4b6fd3e 100644 --- a/libk/error/debug.c +++ b/libk/error/debug.c @@ -1,12 +1,18 @@ #include #include +#include #include +static void _dbgPutc(char c, void* arg) { + (void)arg; + serialWrite(PORT_COM1, c); + if (c == '\n') { serialWrite(PORT_COM1, '\r'); } +} + int debugf(const char* fmt, ...) { va_list va; va_start(va, fmt); - serialPrint(PORT_COM1, fmt); // TODO: use a printf - int res = 0; + int res = vpprintf(_dbgPutc, NULL, fmt, va); va_end(va); return res; }