diff options
| author | Ian Moffett <ian@osmora.org> | 2025-12-21 18:16:59 -0500 |
|---|---|---|
| committer | Ian Moffett <ian@osmora.org> | 2025-12-21 18:16:59 -0500 |
| commit | 2b31623fc4e72633e3e1f5b6714b031d9c8aa658 (patch) | |
| tree | af27f91f1a890d20e562d2ab6c022c74d95ae956 | |
| parent | 21fb4d3c9bfc961a405b3acb603a9f51aef81c18 (diff) | |
mos: kern: Add serial raw trace function
Signed-off-by: Ian Moffett <ian@osmora.org>
| -rw-r--r-- | mos/sys/inc/kern/trace.h | 17 | ||||
| -rw-r--r-- | mos/sys/kern/kern_trace.c | 22 |
2 files changed, 39 insertions, 0 deletions
diff --git a/mos/sys/inc/kern/trace.h b/mos/sys/inc/kern/trace.h new file mode 100644 index 0000000..820478e --- /dev/null +++ b/mos/sys/inc/kern/trace.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2025, Ian Moffett. + * Provided under the BSD-3 clause. + */ + +#ifndef _KERN_TRACE_H_ +#define _KERN_TRACE_H_ + +/* + * Write a raw null terminated string to the system + * trace logs + * + * @str: String to write + */ +void trace_raw(const char *str); + +#endif /* !_KERN_TRACE_H_ */ diff --git a/mos/sys/kern/kern_trace.c b/mos/sys/kern/kern_trace.c new file mode 100644 index 0000000..65f32a6 --- /dev/null +++ b/mos/sys/kern/kern_trace.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2025, Ian Moffett. + * Provided under the BSD-3 clause. + */ + +#include <sdk/string.h> +#include <sdk/types.h> +#include <mu/uart.h> +#include <kern/trace.h> + +void +trace_raw(const char *str) +{ + USIZE len; + + if (str == NULL) { + return; + } + + len = strlen(str); + mu_uart_writed(str, len); +} |
