diff --git a/boot/xtldr/modules/xtos_o/xtos.cc b/boot/xtldr/modules/xtos_o/xtos.cc index 7cfc0f2..563e0ff 100644 --- a/boot/xtldr/modules/xtos_o/xtos.cc +++ b/boot/xtldr/modules/xtos_o/xtos.cc @@ -480,7 +480,7 @@ Xtos::InitializeLoaderBlock(IN PXTBL_PAGE_MAPPING PageMap, XtLdrProtocol->Memory.CopyMemory((PVOID)((UINT_PTR)LoaderBlock + sizeof(KERNEL_INITIALIZATION_BLOCK)), Parameters->Parameters, ParametersSize); - /* HACK: Commit page map to avoid memory leaks (AGAIN!) */ + /* Commit mappings */ XtLdrProtocol->Memory.CommitPageMap(PageMap); /* Initialize system resources list */ @@ -725,14 +725,6 @@ Xtos::RunBootSequence(IN PEFI_FILE_HANDLE BootDir, return Status; } - /* Commit mappings */ - Status = XtLdrProtocol->Memory.CommitPageMap(&PageMap); - if(Status != STATUS_EFI_SUCCESS) - { - XtLdrProtocol->Debug.Print(L"Failed to commit hardware mappings (Pass 1)\n"); - return Status; - } - /* Store virtual address of kernel initialization block for future kernel call */ KernelParameters = (PKERNEL_INITIALIZATION_BLOCK)VirtualAddress; @@ -745,15 +737,6 @@ Xtos::RunBootSequence(IN PEFI_FILE_HANDLE BootDir, return Status; } - /* HACK: Commit mappings again to include the kernel initialization block */ - Status = XtLdrProtocol->Memory.CommitPageMap(&PageMap); - if(Status != STATUS_EFI_SUCCESS) - { - /* Failed to build page map */ - XtLdrProtocol->Debug.Print(L"Failed to build page map (Status code: %zX)\n", Status); - return Status; - } - /* Get kernel entry point */ PeCoffProtocol->GetEntryPoint(ImageContext, (PVOID*)&KernelEntryPoint);