Remove leftover old headers and fix missed spots
Some checks failed
Builds / ExectOS (amd64, release) (push) Failing after 20s
Builds / ExectOS (amd64, debug) (push) Failing after 21s
Builds / ExectOS (i686, debug) (push) Failing after 21s
Builds / ExectOS (i686, release) (push) Failing after 19s

This commit is contained in:
2025-09-16 08:46:53 +02:00
parent ee97388981
commit f4561c1f4f
31 changed files with 33 additions and 2610 deletions

View File

@@ -34,7 +34,7 @@ MM::HardwarePool::AllocateHardwareMemory(IN PFN_NUMBER PageCount,
PLOADER_MEMORY_DESCRIPTOR Descriptor, ExtraDescriptor, HardwareDescriptor;
PFN_NUMBER Alignment, MaxPage;
ULONGLONG PhysicalAddress;
PLIST_ENTRY ListEntry;
PLIST_ENTRY ListEntry, LoaderMemoryDescriptors;
/* Assume failure */
(*Buffer).QuadPart = 0;
@@ -49,9 +49,12 @@ MM::HardwarePool::AllocateHardwareMemory(IN PFN_NUMBER PageCount,
return STATUS_INSUFFICIENT_RESOURCES;
}
/* Get a list of memory descriptors provided by the boot loader */
LoaderMemoryDescriptors = KE::BootInformation::GetMemoryDescriptors();
/* Scan memory descriptors provided by the boot loader */
ListEntry = KeGetInitializationBlock()->MemoryDescriptorListHead.Flink;
while(ListEntry != &KeGetInitializationBlock()->MemoryDescriptorListHead)
ListEntry = LoaderMemoryDescriptors->Flink;
while(ListEntry != LoaderMemoryDescriptors)
{
Descriptor = CONTAIN_RECORD(ListEntry, LOADER_MEMORY_DESCRIPTOR, ListEntry);
@@ -77,7 +80,7 @@ MM::HardwarePool::AllocateHardwareMemory(IN PFN_NUMBER PageCount,
}
/* Make sure we found a descriptor */
if(ListEntry == &KeGetInitializationBlock()->MemoryDescriptorListHead)
if(ListEntry == LoaderMemoryDescriptors)
{
/* Descriptor not found, return error */
return STATUS_INSUFFICIENT_RESOURCES;

View File

@@ -28,7 +28,7 @@ MM::Init::InitializeMemoryManager(VOID)
{
/* Insufficient physical pages, kernel panic */
DebugPrint(L"Insufficient physical pages! Install additional memory\n");
KePanic(0);
KE::Crash::Panic(0);
}
/* Proceed with architecture specific initialization */
@@ -46,16 +46,19 @@ XTAPI
VOID
MM::Init::ScanMemoryDescriptors(VOID)
{
PLIST_ENTRY LoaderMemoryDescriptors, MemoryMappings;
PLOADER_MEMORY_DESCRIPTOR MemoryDescriptor;
PLIST_ENTRY MemoryMappings;
PFN_NUMBER FreePages;
/* Initially, set number of free pages to 0 */
FreePages = 0;
/* Get a list of memory descriptors provided by the boot loader */
LoaderMemoryDescriptors = KE::BootInformation::GetMemoryDescriptors();
/* Iterate through memory mappings provided by the boot loader */
MemoryMappings = KeGetInitializationBlock()->MemoryDescriptorListHead.Flink;
while(MemoryMappings != &KeGetInitializationBlock()->MemoryDescriptorListHead)
MemoryMappings = LoaderMemoryDescriptors->Flink;
while(MemoryMappings != LoaderMemoryDescriptors)
{
/* Get memory descriptor */
MemoryDescriptor = CONTAIN_RECORD(MemoryMappings, LOADER_MEMORY_DESCRIPTOR, ListEntry);