feat(panic): funMessages in panic

feat(rand): also implemented rand
This commit is contained in:
karina
2026-04-30 13:09:59 +04:00
parent fa6e8dfe7c
commit b519e69fbd
3 changed files with 40 additions and 1 deletions
-1
View File
@@ -31,7 +31,6 @@ void KernelMain(Bootinfo* bootinfo) {
);
TimerInitialize();
CPUEnableInterrupts();
SchedulerInitialize();
OSLog("Kernel initialized.\n");
+22
View File
@@ -1,6 +1,7 @@
#include <OS/Panic.h>
#include <OS/Log.h>
#include <Arch/CPU.h>
#include <Lib/Rand.h>
static const ASCII* GetExceptionClassString(UInt32 class) {
switch (class) {
@@ -20,6 +21,24 @@ static const ASCII* GetExceptionClassString(UInt32 class) {
}
}
static const ASCII* sFunMessages[] = {
"Execution finished abnormally with code: 0x_x",
"Ah shit, here we go again",
"It's definitely your fault.",
"No more Roblox!",
"Call your mom 4 help!",
"2bad4u",
"Touch grass",
"Skill issue",
"You should just go outside actually",
"Perfect opportunity to take a shower",
"404 not found",
"Windows is locked! Password:___ Time left: 5:45:41",
"\"NAM PIZDA\": hackers dropped our registry",
"That's all, folks!",
"rip",
};
__attribute__((noreturn)) static void Halt() {
loop {
CPUDisableInterrupts();
@@ -36,6 +55,9 @@ static void DrawPanicHeader() {
PrintSeparator();
OSLog("\tKernel Panic! :(\n");
PrintSeparator();
UInt64 funMessagesCount = sizeof(sFunMessages) / sizeof(sFunMessages[0]);
OSLog("\t%s\n", sFunMessages[Rand() % funMessagesCount]);
PrintSeparator();
}
static void DrawPanicFooter() {