diff options
| author | Ian Moffett <ian@osmora.org> | 2025-11-15 23:13:22 -0500 |
|---|---|---|
| committer | Ian Moffett <ian@osmora.org> | 2025-11-15 23:13:22 -0500 |
| commit | dd84182c0b25206536632a3895d7239cfe9cf005 (patch) | |
| tree | 864a7c567077e2817c76417ecd9eec03711f62dd /sys/os | |
| parent | 39aeb9070dfdbe466bdc7162f1116d17d4d3f989 (diff) | |
kern: dev: Add initial console driver
This commit introduces the boot console driver and integrates it with
the tracing system
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/os')
| -rw-r--r-- | sys/os/os_trace.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/os/os_trace.c b/sys/os/os_trace.c index f8c989d..dd14cae 100644 --- a/sys/os/os_trace.c +++ b/sys/os/os_trace.c @@ -27,15 +27,29 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include <sys/types.h> #include <os/trace.h> +#include <dev/cons/cons.h> #include <kern/serial.h> #include <lib/stdarg.h> #include <lib/string.h> +extern struct console g_bootcons; + static void trace_write(const char *s) { - serial_write(s, strlen(s)); + size_t len; + + if (s == NULL) { + return; + } + + len = strlen(s); + serial_write(s, len); + if (g_bootcons.active) { + console_write(&g_bootcons, s, len); + } } void |
