kernel: implement support for magenta_debug over serial

This commit is contained in:
2026-06-06 17:51:44 +01:00
parent eb15d2ffa3
commit c425d6e389
7 changed files with 216 additions and 2 deletions
+9 -1
View File
@@ -7,6 +7,7 @@
#include <kernel/clock.h>
#include <kernel/console.h>
#include <kernel/cpu.h>
#include <kernel/debug.h>
#include <kernel/init.h>
#include <kernel/libc/stdio.h>
#include <kernel/machine/cpu.h>
@@ -19,6 +20,7 @@
#include <kernel/types.h>
#include <kernel/util.h>
#include <kernel/vm.h>
#include <magenta/debug/packet.h>
#define HARDWARE_RNG
@@ -69,7 +71,8 @@ static void early_vm_init(uintptr_t reserve_end)
void early_console_init(void)
{
const char *dest = arg_value("kernel.early-console");
if (!dest) {
bool debug = arg_is_set("kernel.enable-debugger");
if (!dest || debug) {
dest = "tty0";
}
@@ -186,5 +189,10 @@ int ml_init(uintptr_t arg)
pit_start(500);
ml_int_enable();
if (arg_is_set("kernel.enable-debugger")) {
debug_await();
debug_create_task();
}
return 0;
}