From 510f295124f7c8e51ec66f59be61a9e9aa8f9d25 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Tue, 21 Apr 2026 23:21:47 +0800 Subject: feat: add minimal C++ ABI stubs for freestanding kernel --- na/lib/panic.cc | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'na/lib/panic.cc') diff --git a/na/lib/panic.cc b/na/lib/panic.cc index 4745272..753f910 100644 --- a/na/lib/panic.cc +++ b/na/lib/panic.cc @@ -11,21 +11,9 @@ */ #include +#include #include - -// Minimal direct UART output (same as main.cc early boot) -// This can be used by other early-boot code before console_init() - -constexpr uint64 kUart0VA = 0x10000000UL + 0xFFFFFFC000000000ULL; - -extern "C" void early_putc(char c) { - volatile auto* uart = reinterpret_cast(kUart0VA); - *uart = static_cast(c); -} - -extern "C" void early_puts(const char* s) { - while (*s) early_putc(*s++); -} +#include extern "C" [[noreturn]] void kernel_panic(const char* msg, const char* detail) { arch::cpu::intr_off(); -- cgit v1.2.3