MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / KernelPanic

Function KernelPanic

Kernel/src/panic.cpp:8–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include <logging.h>
7
8void KernelPanic(const char** reasons, int reasonCount){
9 asm("cli");
10
11 APIC::Local::SendIPI(0, ICR_DSH_OTHER, ICR_MESSAGE_TYPE_FIXED, IPI_HALT);
12
13 video_mode_t v = Video::GetVideoMode();
14 Video::DrawRect(0,0,v.width,v.height,0,0,0);
15 int pos = 20;
16 for(int i = 0; i < reasonCount; i++){
17 Video::DrawString(reasons[i], v.width / 2 - strlen(reasons[i]) * 8 / 2, pos,255,0,0);
18 pos += 10;
19 }
20
21 Video::DrawString("Lemon has encountered a fatal error.", 0, v.height - 200, 255, 255, 255);
22 Video::DrawString("The system has been halted.", 0, v.height - 200 + 8, 255, 255, 255);
23
24 if(Log::console){
25 Log::console->Update();
26 }
27
28 asm("hlt");
29}

Callers 14

KernelProcessFunction · 0.85
__cxa_pure_virtualFunction · 0.85
KernelAssertionFailedFunction · 0.85
isr_handlerFunction · 0.85
InitFunction · 0.85
laihost_panicFunction · 0.85
__stack_chk_failFunction · 0.85
Allocate4KPagesFunction · 0.85
KernelAllocate4KPagesFunction · 0.85
KernelAllocate2MPagesFunction · 0.85
Free4KPagesFunction · 0.85

Calls 6

SendIPIFunction · 0.85
GetVideoModeFunction · 0.85
strlenFunction · 0.85
DrawRectFunction · 0.70
DrawStringFunction · 0.70
UpdateMethod · 0.45

Tested by

no test coverage detected