diff options
author | Ian Moffett <ian@osmora.org> | 2024-01-17 20:59:53 -0500 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-01-17 20:59:53 -0500 |
commit | 469f601e210a74bb08408be894c9ec84701d6715 (patch) | |
tree | 41e8b517fceddbf581ac2333a82bb39f21899647 /sys/kern/kern_syslog.c | |
parent | 09f3fd474c0175170c177cdcb372034eda86c70f (diff) |
kernel: Add serial logging support
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern/kern_syslog.c')
-rw-r--r-- | sys/kern/kern_syslog.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/kern/kern_syslog.c b/sys/kern/kern_syslog.c index ebc5512..84943b3 100644 --- a/sys/kern/kern_syslog.c +++ b/sys/kern/kern_syslog.c @@ -29,6 +29,7 @@ #include <sys/syslog.h> #include <sys/tty.h> +#include <sys/machdep.h> #include <string.h> static struct tty syslog_tty; @@ -39,6 +40,15 @@ static bool is_conlog_init = false; static void syslog_write(const char *s, size_t len) { +#if defined(__SERIAL_DEBUG) + size_t tmp_len = len; + const char *tmp_s = s; + + while (tmp_len--) { + serial_dbgch(*tmp_s++); + } +#endif /* defined(__SERIAL_DEBUG) */ + if (is_conlog_init) { tty_write(&syslog_tty, s, len); } |