/
dgrigorev
/
MicroNT
Обзор
Документация
Войти
/
dgrigorev
/
MicroNT
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
kernel/core/panic.cpp
33 строки
1 KB
dagrigorev
Initial commit. Bootloader completed
04 май 2026, 09:52
04 май 2026, 09:52
4f2bed8
Код
Авторство
О чём код?
// panic.cpp - MicroNT kernel panic handler #include "../include/debug.h" #include "../include/hal.h" [[noreturn]] void KernelPanic(const char* msg) { HAL::DisableInterrupts(); Debug::Printf("\n"); Debug::Printf("=======================================================\n"); Debug::Printf(" MicroNT KERNEL PANIC\n"); Debug::Printf("=======================================================\n"); Debug::Printf(" %s\n", msg); Debug::Printf("=======================================================\n"); Debug::Printf("System halted.\n"); HAL::CpuHalt(); } // C++ ABI stubs required by the linker in a freestanding environment extern "C" { void __cxa_pure_virtual() { KernelPanic("Pure virtual function called"); } // Stack protector stub (disabled by default but provided for safety) [[noreturn]] void __stack_chk_fail() { KernelPanic("Stack smashing detected"); } // Provide a minimal __stack_chk_guard to satisfy the linker if -fstack-protector is used __attribute__((weak)) uptr __stack_chk_guard = 0xDEADBEEFCAFEBABEULL; } // extern "C"