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