diff options
author | Ian Moffett <ian@osmora.org> | 2024-07-07 21:56:41 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-07-07 22:32:04 -0400 |
commit | 8d1e5ffe355b0e0bbb60fa88d306304a1746bc8c (patch) | |
tree | b4d6c3e527d7a5021a21a9f631f8958d3c98955b /sys/arch | |
parent | abced67cbb8a19369ae1a5aaafd6318f0b2ee069 (diff) |
kernel/amd64: Add serial debug logging
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 14 | ||||
-rw-r--r-- | sys/arch/amd64/conf/GENERIC | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index b047dd8..03b10f0 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -28,6 +28,7 @@ */ #include <sys/types.h> +#include <sys/syslog.h> #include <machine/cpu.h> #include <machine/gdt.h> #include <machine/tss.h> @@ -36,6 +37,7 @@ #include <machine/asm.h> #include <machine/cpuid.h> #include <machine/lapic.h> +#include <machine/uart.h> #if defined(__SPECTRE_IBRS) #define SPECTRE_IBRS __SPECTRE_IBRS @@ -90,6 +92,18 @@ try_mitigate_spectre(void) ibrs_enable(); } +void +serial_init(void) +{ + uart_init(); +} + +void +serial_putc(char c) +{ + uart_write(c); +} + /* * Get the descriptor for the currently * running processor. diff --git a/sys/arch/amd64/conf/GENERIC b/sys/arch/amd64/conf/GENERIC index a7bbc81..19c9a62 100644 --- a/sys/arch/amd64/conf/GENERIC +++ b/sys/arch/amd64/conf/GENERIC @@ -1,5 +1,6 @@ // Kernel options option SPECTRE_IBRS no +option SERIAL_DEBUG yes // Kernel constants setval SCHED_NQUEUE 4 |