| 6 | #include <logging.h> |
| 7 | |
| 8 | void 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 | } |
no test coverage detected