mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-27 15:04:33 +00:00
Fixed kernel hang on IPC wait
This commit is contained in:
parent
dc43de81e8
commit
9416bd5cb9
@ -663,14 +663,14 @@ namespace CrashHandler
|
||||
|
||||
if (Frame->cs != GDT_USER_CODE && Frame->cs != GDT_USER_DATA)
|
||||
{
|
||||
debug("Exception in kernel mode");
|
||||
debug("Exception in kernel mode (ip: %#lx, cr2: %#lx)", Frame->rip, PageFaultAddress);
|
||||
if (TaskManager)
|
||||
TaskManager->Panic();
|
||||
Display->CreateBuffer(0, 0, SBIdx);
|
||||
}
|
||||
else
|
||||
{
|
||||
debug("Exception in user mode");
|
||||
debug("Exception in user mode (ip: %#lx, cr2: %#lx)", Frame->rip, PageFaultAddress);
|
||||
CPUData *data = GetCurrentCPU();
|
||||
if (!data)
|
||||
{
|
||||
|
@ -134,8 +134,9 @@ void KernelMainThread()
|
||||
TaskManager->GetCurrentThread()->SetPriority(Tasking::Critical);
|
||||
|
||||
#ifdef DEBUG
|
||||
Tasking::PCB *tskMgr = TaskManager->CreateProcess(TaskManager->GetCurrentProcess(), "Debug Task Manager", Tasking::TaskTrustLevel::Kernel);
|
||||
TaskManager->CreateThread(tskMgr, (Tasking::IP)TaskMgr)->SetPriority((Tasking::TaskPriority)200);
|
||||
/* TODO: This should not be enabled because it may cause a deadlock. Not sure where or how. */
|
||||
// Tasking::PCB *tskMgr = TaskManager->CreateProcess(TaskManager->GetCurrentProcess(), "Debug Task Manager", Tasking::TaskTrustLevel::Kernel);
|
||||
// TaskManager->CreateThread(tskMgr, (Tasking::IP)TaskMgr)->SetPriority(Tasking::High);
|
||||
#endif
|
||||
|
||||
KPrint("Kernel Compiled at: %s %s with C++ Standard: %d", __DATE__, __TIME__, CPP_LANGUAGE_STANDARD);
|
||||
|
@ -170,7 +170,7 @@ namespace InterProcessCommunication
|
||||
warn("Interrupts are disabled. This may cause a kernel hang.");
|
||||
debug("Waiting for IPC %d (now %s)", ID, Hnd->Listening ? "listening" : "ready");
|
||||
while (Hnd->Listening)
|
||||
TaskManager->Schedule();
|
||||
CPU::Halt();
|
||||
debug("IPC %d is ready", ID);
|
||||
return IPCSuccess;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user