Kernel now boots on BIOS systems

This commit is contained in:
Alex 2022-11-07 11:17:06 +02:00
parent b60ec62bde
commit 6409dfdf0b
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
5 changed files with 21 additions and 12 deletions

View File

@ -52,11 +52,15 @@ namespace Power
CPU::Stop(); CPU::Stop();
} }
void Power::InitDSDT()
{
if (((ACPI::ACPI *)this->acpi)->FADT)
this->dsdt = new ACPI::DSDT((ACPI::ACPI *)acpi);
}
Power::Power() Power::Power()
{ {
this->acpi = new ACPI::ACPI(bInfo); this->acpi = new ACPI::ACPI(bInfo);
if (((ACPI::ACPI *)this->acpi)->FADT)
this->dsdt = new ACPI::DSDT((ACPI::ACPI *)acpi);
this->madt = new ACPI::MADT(((ACPI::ACPI *)acpi)->MADT); this->madt = new ACPI::MADT(((ACPI::ACPI *)acpi)->MADT);
trace("Power manager initialized"); trace("Power manager initialized");
} }

View File

@ -79,6 +79,7 @@ EXTERNC void Entry(BootInfo *Info)
} }
KPrint("Enabling Interrupts on Bootstrap Processor"); KPrint("Enabling Interrupts on Bootstrap Processor");
Interrupts::Enable(0); Interrupts::Enable(0);
PowerManager->InitDSDT();
KPrint("Initializing Timers"); KPrint("Initializing Timers");
#if defined(__amd64__) #if defined(__amd64__)
TimeManager = new Time::time(PowerManager->GetACPI()); TimeManager = new Time::time(PowerManager->GetACPI());

View File

@ -17,11 +17,11 @@ class LockClass
{ {
struct SpinLockData struct SpinLockData
{ {
uint64_t LockData; uint64_t LockData = 0x0;
const char *CurrentHolder; const char *CurrentHolder = "(nul)";
const char *AttemptingToGet; const char *AttemptingToGet = "(nul)";
uint64_t Count; uint64_t Count = 0;
long Core; long Core = 0;
}; };
private: private:

View File

@ -44,6 +44,7 @@ namespace Power
*/ */
void Shutdown(); void Shutdown();
void InitDSDT();
Power(); Power();
~Power(); ~Power();
}; };

View File

@ -15,6 +15,9 @@ public:
Vector() Vector()
{ {
#ifdef DEBUG_MEM_ALLOCATION
debug("VECTOR INIT: Vector( )");
#endif
VectorCapacity = 0; VectorCapacity = 0;
VectorSize = 0; VectorSize = 0;
VectorBuffer = 0; VectorBuffer = 0;
@ -25,7 +28,7 @@ public:
VectorCapacity = Size; VectorCapacity = Size;
VectorSize = Size; VectorSize = Size;
#ifdef DEBUG_MEM_ALLOCATION #ifdef DEBUG_MEM_ALLOCATION
debug("VECTOR ALLOCATION: Vector( %lld )", Size); debug("VECTOR INIT: Vector( %lld )", Size);
#endif #endif
VectorBuffer = new T[Size]; VectorBuffer = new T[Size];
} }
@ -35,7 +38,7 @@ public:
VectorSize = Size; VectorSize = Size;
VectorCapacity = Size; VectorCapacity = Size;
#ifdef DEBUG_MEM_ALLOCATION #ifdef DEBUG_MEM_ALLOCATION
debug("VECTOR ALLOCATION: Vector( %lld %llx )", Size, Initial); debug("VECTOR INIT: Vector( %lld %llx )", Size, Initial);
#endif #endif
VectorBuffer = new T[Size]; VectorBuffer = new T[Size];
for (uint64_t i = 0; i < Size; i++) for (uint64_t i = 0; i < Size; i++)
@ -47,7 +50,7 @@ public:
VectorSize = Vector.VectorSize; VectorSize = Vector.VectorSize;
VectorCapacity = Vector.VectorCapacity; VectorCapacity = Vector.VectorCapacity;
#ifdef DEBUG_MEM_ALLOCATION #ifdef DEBUG_MEM_ALLOCATION
debug("VECTOR ALLOCATION: Vector( <vector> )->Size: %lld", VectorSize); debug("VECTOR INIT: Vector( <vector> )->Size: %lld", VectorSize);
#endif #endif
VectorBuffer = new T[VectorSize]; VectorBuffer = new T[VectorSize];
for (uint64_t i = 0; i < VectorSize; i++) for (uint64_t i = 0; i < VectorSize; i++)
@ -57,7 +60,7 @@ public:
~Vector() ~Vector()
{ {
#ifdef DEBUG_MEM_ALLOCATION #ifdef DEBUG_MEM_ALLOCATION
debug("VECTOR ALLOCATION: ~Vector( ~%lx )", VectorBuffer); debug("VECTOR INIT: ~Vector( ~%lx )", VectorBuffer);
#endif #endif
delete[] VectorBuffer; delete[] VectorBuffer;
} }
@ -144,7 +147,7 @@ public:
delete[] VectorBuffer; delete[] VectorBuffer;
VectorSize = Vector.VectorSize; VectorSize = Vector.VectorSize;
VectorCapacity = Vector.VectorCapacity; VectorCapacity = Vector.VectorCapacity;
#ifdef DEBUG_MEM_ALLOCATION #ifdef DEBUG_MEM_ALLOCATION
debug("VECTOR ALLOCATION: operator=( <vector> )->Size:%lld", VectorSize); debug("VECTOR ALLOCATION: operator=( <vector> )->Size:%lld", VectorSize);
#endif #endif
VectorBuffer = new T[VectorSize]; VectorBuffer = new T[VectorSize];