diff --git a/src/system/kernel/arch/x86/arch_debug_console.c b/src/system/kernel/arch/x86/arch_debug_console.c index b021fdee1a..e89653f064 100644 --- a/src/system/kernel/arch/x86/arch_debug_console.c +++ b/src/system/kernel/arch/x86/arch_debug_console.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -346,16 +347,21 @@ arch_debug_serial_putchar(const char c) void arch_debug_serial_puts(const char *s) { - cpu_status state = disable_interrupts(); - acquire_spinlock(&sSerialOutputSpinlock); + cpu_status state = 0; + if (!debug_debugger_running()) { + state = disable_interrupts(); + acquire_spinlock(&sSerialOutputSpinlock); + } while (*s != '\0') { _arch_debug_serial_putchar(*s); s++; } - release_spinlock(&sSerialOutputSpinlock); - restore_interrupts(state); + if (!debug_debugger_running()) { + release_spinlock(&sSerialOutputSpinlock); + restore_interrupts(state); + } }