Calculate descriptor pages strictly based on the actual map size
All checks were successful
Builds / ExectOS (i686, debug) (push) Successful in 31s
Builds / ExectOS (i686, release) (push) Successful in 30s
Builds / ExectOS (amd64, release) (push) Successful in 45s
Builds / ExectOS (amd64, debug) (push) Successful in 47s

This commit is contained in:
2026-03-13 12:28:15 +01:00
parent b692fe4cef
commit c71d58b737

View File

@@ -409,8 +409,8 @@ Xtos::InitializeLoaderBlock(IN PXTBL_PAGE_MAPPING PageMap,
}
FbPages = EFI_SIZE_TO_PAGES(FbSize);
/* Add padding to MapSize to account for the ledger mappings */
DescriptorPages = EFI_SIZE_TO_PAGES((PageMap->MapSize + 16) * sizeof(LOADER_MEMORY_DESCRIPTOR));
/* Calculate number of pages needed for memory descriptor list */
DescriptorPages = EFI_SIZE_TO_PAGES(PageMap->MapSize * sizeof(LOADER_MEMORY_DESCRIPTOR));
/* Allocate memory for the kernel initialization block and boot parameters */
Status = XtLdrProtocol->Memory.AllocatePages(AllocateAnyPages, BlockPages, &PhysicalBlock);