Do not stop the scheduler at the beginning of the crash handler

This commit is contained in:
Alex 2022-11-15 15:22:18 +02:00
parent c2628019b7
commit 89f5d29135
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
2 changed files with 5 additions and 14 deletions

View File

@ -291,8 +291,6 @@ namespace CrashHandler
// TODO: SUPPORT SMP // TODO: SUPPORT SMP
CPU::Interrupts(CPU::Disable); CPU::Interrupts(CPU::Disable);
error("An exception occurred!"); error("An exception occurred!");
if (TaskManager)
TaskManager->Panic();
SBIdx = 255; SBIdx = 255;
CHArchTrapFrame *Frame = (CHArchTrapFrame *)Data; CHArchTrapFrame *Frame = (CHArchTrapFrame *)Data;
#if defined(__amd64__) #if defined(__amd64__)
@ -301,6 +299,8 @@ namespace CrashHandler
if (Frame->cs != GDT_USER_CODE && Frame->cs != GDT_USER_DATA) if (Frame->cs != GDT_USER_CODE && Frame->cs != GDT_USER_DATA)
{ {
debug("Exception in kernel mode"); debug("Exception in kernel mode");
if (TaskManager)
TaskManager->Panic();
Display->CreateBuffer(0, 0, SBIdx); Display->CreateBuffer(0, 0, SBIdx);
} }
else else
@ -320,17 +320,8 @@ namespace CrashHandler
if (data->CurrentThread) if (data->CurrentThread)
{ {
debug("Current thread is valid %#lx", data->CurrentThread); debug("Current thread is valid %#lx", data->CurrentThread);
if (!data->CurrentThread->Security.IsCritical) UserModeExceptionHandler(Frame);
{ return;
debug("Current thread is not critical");
UserModeExceptionHandler(Frame);
return;
}
else
{
Display->CreateBuffer(0, 0, SBIdx);
EHPrint("\eFF0000Init process crashed!");
}
} }
} }
} }

View File

@ -106,7 +106,7 @@ void KernelMainThread()
KPrint("\eE85230Userspace process exited with code %d", ret.Thread->GetExitCode()); KPrint("\eE85230Userspace process exited with code %d", ret.Thread->GetExitCode());
error("Userspace process exited with code %d (%#x)", ret.Thread->GetExitCode(), ret.Thread->GetExitCode()); error("Userspace process exited with code %d (%#x)", ret.Thread->GetExitCode(), ret.Thread->GetExitCode());
Exit: Exit:
KPrint("Well, that's it. I'm going to sleep now."); KPrint("Well, this is awkward. I guess you'll have to reboot.");
CPU::Halt(true); CPU::Halt(true);
} }