mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-30 00:08:03 +00:00
Added Schedule()
This commit is contained in:
parent
971f4b2b27
commit
664cea41a5
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include "../kernel.h"
|
||||||
|
|
||||||
static unsigned long DeadLocks = 0;
|
static unsigned long DeadLocks = 0;
|
||||||
|
|
||||||
extern "C" void DeadLockHandler(LockClass *Lock)
|
extern "C" void DeadLockHandler(LockClass *Lock)
|
||||||
@ -10,5 +12,9 @@ extern "C" void DeadLockHandler(LockClass *Lock)
|
|||||||
Lock->GetLockData()->AttemptingToGet,
|
Lock->GetLockData()->AttemptingToGet,
|
||||||
Lock->GetLockData()->CurrentHolder,
|
Lock->GetLockData()->CurrentHolder,
|
||||||
DeadLocks++);
|
DeadLocks++);
|
||||||
|
|
||||||
|
if (TaskManager)
|
||||||
|
TaskManager->Schedule();
|
||||||
|
|
||||||
// TODO: Print on screen too.
|
// TODO: Print on screen too.
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ void KernelMainThread()
|
|||||||
{
|
{
|
||||||
Tasking::TCB *CurrentWorker = nullptr;
|
Tasking::TCB *CurrentWorker = nullptr;
|
||||||
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);
|
||||||
KPrint("C++ Language Version (__cplusplus) :%ld", __cplusplus);
|
KPrint("C++ Language Version (__cplusplus): %ld", __cplusplus);
|
||||||
TaskManager->GetCurrentThread()->SetPriority(1);
|
TaskManager->GetCurrentThread()->SetPriority(1);
|
||||||
|
|
||||||
CurrentWorker = TaskManager->CreateThread(TaskManager->GetCurrentProcess(), (Tasking::IP)StartFilesystem);
|
CurrentWorker = TaskManager->CreateThread(TaskManager->GetCurrentProcess(), (Tasking::IP)StartFilesystem);
|
||||||
@ -89,16 +89,16 @@ void KernelMainThread()
|
|||||||
}
|
}
|
||||||
TaskManager->WaitForThread(ret.Thread);
|
TaskManager->WaitForThread(ret.Thread);
|
||||||
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());
|
||||||
CPU::Halt(true);
|
CPU::Halt(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KernelShutdownThread(bool Reboot)
|
void KernelShutdownThread(bool Reboot)
|
||||||
{
|
{
|
||||||
debug("Shutting down...");
|
trace("Shutting Down/Rebooting...");
|
||||||
if (Reboot)
|
if (Reboot)
|
||||||
PowerManager->Reboot();
|
PowerManager->Reboot();
|
||||||
else
|
else
|
||||||
PowerManager->Shutdown();
|
PowerManager->Shutdown();
|
||||||
|
|
||||||
CPU::Stop();
|
CPU::Stop();
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,8 @@ namespace Tasking
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Task::Schedule() { OneShot(100); }
|
||||||
|
|
||||||
__attribute__((naked, used, no_stack_protector)) void IdleProcessLoop()
|
__attribute__((naked, used, no_stack_protector)) void IdleProcessLoop()
|
||||||
{
|
{
|
||||||
#if defined(__amd64__) || defined(__i386__)
|
#if defined(__amd64__) || defined(__i386__)
|
||||||
|
@ -214,6 +214,7 @@ namespace Tasking
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
void Schedule();
|
||||||
long GetUsage(int Core) { return 100 - IdleProcess->Info.Usage[Core]; }
|
long GetUsage(int Core) { return 100 - IdleProcess->Info.Usage[Core]; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user