From 469f601e210a74bb08408be894c9ec84701d6715 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 17 Jan 2024 20:59:53 -0500 Subject: kernel: Add serial logging support Signed-off-by: Ian Moffett --- sys/kern/kern_syslog.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sys/kern') 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 #include +#include #include 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); } -- cgit v1.2.3