mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
The scheduler now keeps track of the initial process.
This commit is contained in:
parent
f9e10ab265
commit
884ce30c07
3 changed files with 12 additions and 3 deletions
|
@ -283,6 +283,7 @@ namespace Sortix
|
|||
if ( !initstart ) { Panic("could not construct ELF image for init process"); }
|
||||
Thread* initthread = CreateThread(initstart);
|
||||
if ( !initthread ) { Panic("could not create thread for the init process"); }
|
||||
Scheduler::SetInitProcess(init);
|
||||
|
||||
// Lastly set up the timer driver and we are ready to run the OS.
|
||||
Time::Init();
|
||||
|
|
|
@ -55,6 +55,7 @@ namespace Sortix
|
|||
Thread* idlethread;
|
||||
Thread* firstrunnablethread;
|
||||
Thread* firstsleepingthread;
|
||||
Process* initprocess;
|
||||
bool hacksigintpending = false;
|
||||
|
||||
void Init()
|
||||
|
@ -89,9 +90,14 @@ namespace Sortix
|
|||
dummythread->process = process;
|
||||
}
|
||||
|
||||
void SetInitialProcess(Process* init)
|
||||
void SetInitProcess(Process* init)
|
||||
{
|
||||
dummythread->process = init;
|
||||
initprocess = init;
|
||||
}
|
||||
|
||||
Process* GetInitProcess()
|
||||
{
|
||||
return initprocess;
|
||||
}
|
||||
|
||||
void MainLoop()
|
||||
|
|
|
@ -35,7 +35,9 @@ namespace Sortix
|
|||
void MainLoop() SORTIX_NORETURN;
|
||||
void Switch(CPU::InterruptRegisters* regs);
|
||||
void SetIdleThread(Thread* thread);
|
||||
void SetDummyThreadOwner(Process* init);
|
||||
void SetDummyThreadOwner(Process* process);
|
||||
void SetInitProcess(Process* init);
|
||||
Process* GetInitProcess();
|
||||
|
||||
void SetThreadState(Thread* thread, Thread::State state);
|
||||
Thread::State GetThreadState(Thread* thread);
|
||||
|
|
Loading…
Add table
Reference in a new issue