Allocate executive thread structure for idle thread and assign PRCB pointers
This commit is contained in:
@@ -27,7 +27,7 @@ KE::KernelInit::BootstrapApplicationProcessor(IN PPROCESSOR_START_BLOCK StartBlo
|
|||||||
{
|
{
|
||||||
PKPROCESSOR_CONTROL_BLOCK ControlBlock;
|
PKPROCESSOR_CONTROL_BLOCK ControlBlock;
|
||||||
PKPROCESS IdleProcess;
|
PKPROCESS IdleProcess;
|
||||||
PKTHREAD IdleThread;
|
PETHREAD IdleThread;
|
||||||
|
|
||||||
/* Initialize application CPU */
|
/* Initialize application CPU */
|
||||||
AR::ProcessorSupport::InitializeProcessor(StartBlock->ProcessorStructures);
|
AR::ProcessorSupport::InitializeProcessor(StartBlock->ProcessorStructures);
|
||||||
@@ -60,13 +60,14 @@ KE::KernelInit::BootstrapApplicationProcessor(IN PPROCESSOR_START_BLOCK StartBlo
|
|||||||
HL::Timer::InitializeLocalClock();
|
HL::Timer::InitializeLocalClock();
|
||||||
|
|
||||||
/* Allocate and wipe memory for Idle thread */
|
/* Allocate and wipe memory for Idle thread */
|
||||||
MM::Allocator::AllocatePool(NonPagedPool, sizeof(KTHREAD), (PVOID *)&IdleThread);
|
MM::Allocator::AllocatePool(NonPagedPool, sizeof(ETHREAD), (PVOID *)&IdleThread);
|
||||||
RTL::Memory::ZeroMemory(IdleThread, sizeof(KTHREAD));
|
RTL::Memory::ZeroMemory(IdleThread, sizeof(ETHREAD));
|
||||||
|
|
||||||
/* Initialize Idle thread */
|
/* Initialize Idle thread */
|
||||||
IdleProcess = KE::KProcess::GetIdleProcess();
|
IdleProcess = KE::KProcess::GetIdleProcess();
|
||||||
ControlBlock->CurrentThread = IdleThread;
|
ControlBlock->CurrentThread = &IdleThread->ThreadControlBlock;
|
||||||
KE::KThread::InitializeIdleThread(IdleProcess, IdleThread, ControlBlock, StartBlock->Stack);
|
ControlBlock->IdleThread = &IdleThread->ThreadControlBlock;
|
||||||
|
KE::KThread::InitializeIdleThread(IdleProcess, &IdleThread->ThreadControlBlock, ControlBlock, StartBlock->Stack);
|
||||||
|
|
||||||
/* Register DISPATCH interrupt handler */
|
/* Register DISPATCH interrupt handler */
|
||||||
HL::Irq::RegisterSystemInterruptHandler(APIC_VECTOR_DPC, KE::Dispatcher::HandleDispatchInterrupt);
|
HL::Irq::RegisterSystemInterruptHandler(APIC_VECTOR_DPC, KE::Dispatcher::HandleDispatchInterrupt);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ KE::KernelInit::BootstrapApplicationProcessor(IN PPROCESSOR_START_BLOCK StartBlo
|
|||||||
{
|
{
|
||||||
PKPROCESSOR_CONTROL_BLOCK ControlBlock;
|
PKPROCESSOR_CONTROL_BLOCK ControlBlock;
|
||||||
PKPROCESS IdleProcess;
|
PKPROCESS IdleProcess;
|
||||||
PKTHREAD IdleThread;
|
PETHREAD IdleThread;
|
||||||
|
|
||||||
/* Initialize application CPU */
|
/* Initialize application CPU */
|
||||||
AR::ProcessorSupport::InitializeProcessor(StartBlock->ProcessorStructures);
|
AR::ProcessorSupport::InitializeProcessor(StartBlock->ProcessorStructures);
|
||||||
@@ -60,13 +60,14 @@ KE::KernelInit::BootstrapApplicationProcessor(IN PPROCESSOR_START_BLOCK StartBlo
|
|||||||
HL::Timer::InitializeLocalClock();
|
HL::Timer::InitializeLocalClock();
|
||||||
|
|
||||||
/* Allocate and wipe memory for Idle thread */
|
/* Allocate and wipe memory for Idle thread */
|
||||||
MM::Allocator::AllocatePool(NonPagedPool, sizeof(KTHREAD), (PVOID *)&IdleThread);
|
MM::Allocator::AllocatePool(NonPagedPool, sizeof(ETHREAD), (PVOID *)&IdleThread);
|
||||||
RTL::Memory::ZeroMemory(IdleThread, sizeof(KTHREAD));
|
RTL::Memory::ZeroMemory(IdleThread, sizeof(ETHREAD));
|
||||||
|
|
||||||
/* Initialize Idle thread */
|
/* Initialize Idle thread */
|
||||||
IdleProcess = KE::KProcess::GetIdleProcess();
|
IdleProcess = KE::KProcess::GetIdleProcess();
|
||||||
ControlBlock->CurrentThread = IdleThread;
|
ControlBlock->CurrentThread = &IdleThread->ThreadControlBlock;
|
||||||
KE::KThread::InitializeIdleThread(IdleProcess, IdleThread, ControlBlock, StartBlock->Stack);
|
ControlBlock->IdleThread = &IdleThread->ThreadControlBlock;
|
||||||
|
KE::KThread::InitializeIdleThread(IdleProcess, &IdleThread->ThreadControlBlock, ControlBlock, StartBlock->Stack);
|
||||||
|
|
||||||
/* Register DISPATCH interrupt handler */
|
/* Register DISPATCH interrupt handler */
|
||||||
HL::Irq::RegisterSystemInterruptHandler(APIC_VECTOR_DPC, KE::Dispatcher::HandleDispatchInterrupt);
|
HL::Irq::RegisterSystemInterruptHandler(APIC_VECTOR_DPC, KE::Dispatcher::HandleDispatchInterrupt);
|
||||||
|
|||||||
Reference in New Issue
Block a user