summaryrefslogtreecommitdiff
path: root/sys/os
diff options
context:
space:
mode:
Diffstat (limited to 'sys/os')
-rw-r--r--sys/os/os_trace.c16
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