diff options
author | Ian Moffett <ian@osmora.org> | 2024-07-07 21:56:41 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-07-07 22:32:04 -0400 |
commit | 8d1e5ffe355b0e0bbb60fa88d306304a1746bc8c (patch) | |
tree | b4d6c3e527d7a5021a21a9f631f8958d3c98955b /sys/kern/kern_syslog.c | |
parent | abced67cbb8a19369ae1a5aaafd6318f0b2ee069 (diff) |
kernel/amd64: Add serial debug logging
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern/kern_syslog.c')
-rw-r--r-- | sys/kern/kern_syslog.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/kern_syslog.c b/sys/kern/kern_syslog.c index 6962a69..7f66db0 100644 --- a/sys/kern/kern_syslog.c +++ b/sys/kern/kern_syslog.c @@ -34,6 +34,12 @@ #include <stdarg.h> #include <string.h> +#if defined(__SERIAL_DEBUG) +#define SERIAL_DEBUG __SERIAL_DEBUG +#else +#define SERIAL_DEBUG 0 +#endif + /* Global logger lock */ static struct spinlock lock = {0}; @@ -44,6 +50,9 @@ syslog_write(const char *s, size_t len) while (len--) { cons_putch(&g_root_scr, *p); + if (SERIAL_DEBUG) { + serial_putc(*p); + } ++p; } } |