diff options
| author | Jon Santmyer <jon@jonsantmyer.com> | 2026-10-16 16:42:22 -0400 |
|---|---|---|
| committer | Jon Santmyer <jon@jonsantmyer.com> | 2026-10-16 16:42:22 -0400 |
| commit | d8aca3ff2501f9a77e22e5afb7a30380aed205af (patch) | |
| tree | a27db1749a35aea07317406f170a2d9b2a799ce7 /arch/x86_64/debug | |
| parent | 548506392b789f58b1556a6ffca917441e1d89fd (diff) | |
| download | jove-kernel-d8aca3ff2501f9a77e22e5afb7a30380aed205af.tar.gz jove-kernel-d8aca3ff2501f9a77e22e5afb7a30380aed205af.tar.bz2 jove-kernel-d8aca3ff2501f9a77e22e5afb7a30380aed205af.zip | |
remove explicit framebuffer in kernel. reduce locking in syscalls
Diffstat (limited to 'arch/x86_64/debug')
| -rw-r--r-- | arch/x86_64/debug/debug.c | 10 | ||||
| -rw-r--r-- | arch/x86_64/debug/printf.c | 20 |
2 files changed, 30 insertions, 0 deletions
diff --git a/arch/x86_64/debug/debug.c b/arch/x86_64/debug/debug.c new file mode 100644 index 0000000..5b2c918 --- /dev/null +++ b/arch/x86_64/debug/debug.c @@ -0,0 +1,10 @@ +#include "debug/debug.h" +#include "arch/x86_64/hal/serial_com.h" + +void _debug_init_arch(void) +{ + #ifdef DEBUG_SERIAL + _debug_has_output = true; + serial_com_init(); + #endif +} diff --git a/arch/x86_64/debug/printf.c b/arch/x86_64/debug/printf.c new file mode 100644 index 0000000..13737b9 --- /dev/null +++ b/arch/x86_64/debug/printf.c @@ -0,0 +1,20 @@ +#include "lib/printf.h" +#include "../hal/serial_com.h" +#include "api/error.h" +#include "debug/debug.h" + +int +kvprintf(const char *fmt, va_list ap) +{ + if(!_debug_has_output) return -EBADCALL; + + char buffer[256] = { 0 }; + int r = vsnprintf(buffer, 256, fmt, ap); + int wlen = (r > 256 ? 256 : r); + +#ifdef DEBUG_SERIAL + serial_com_write(SERIAL_COM1, buffer, wlen); +#endif + + return r; +} |
