diff options
| -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); +} |
