Calculate total boot image size and pass it to kernel
This commit is contained in:
@@ -234,6 +234,9 @@ Xtos::GetMemoryDescriptorList(IN PXTBL_PAGE_MAPPING PageMap,
|
|||||||
|
|
||||||
XtLdrProtocol->Memory.PhysicalListToVirtual(PageMap, MemoryDescriptorList, PhysicalBase, *VirtualAddress);
|
XtLdrProtocol->Memory.PhysicalListToVirtual(PageMap, MemoryDescriptorList, PhysicalBase, *VirtualAddress);
|
||||||
|
|
||||||
|
/* Calculate next valid virtual address */
|
||||||
|
*VirtualAddress = (PUINT8)*VirtualAddress + (Pages * EFI_PAGE_SIZE);
|
||||||
|
|
||||||
return STATUS_EFI_SUCCESS;
|
return STATUS_EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -469,6 +472,9 @@ Xtos::InitializeLoaderBlock(IN PXTBL_PAGE_MAPPING PageMap,
|
|||||||
XtLdrProtocol->LinkedList.InitializeHead(&LoaderBlock->MemoryDescriptorListHead);
|
XtLdrProtocol->LinkedList.InitializeHead(&LoaderBlock->MemoryDescriptorListHead);
|
||||||
GetMemoryDescriptorList(PageMap, VirtualAddress, &LoaderBlock->MemoryDescriptorListHead);
|
GetMemoryDescriptorList(PageMap, VirtualAddress, &LoaderBlock->MemoryDescriptorListHead);
|
||||||
|
|
||||||
|
/* Set boot image size */
|
||||||
|
LoaderBlock->BootImageSize = (PFN_NUMBER)(((ULONGLONG)*VirtualAddress - KSEG0_BASE) / EFI_PAGE_SIZE);
|
||||||
|
|
||||||
/* Return success */
|
/* Return success */
|
||||||
return STATUS_EFI_SUCCESS;
|
return STATUS_EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ typedef struct _KERNEL_INITIALIZATION_BLOCK
|
|||||||
ULONG BlockVersion;
|
ULONG BlockVersion;
|
||||||
ULONG ProtocolVersion;
|
ULONG ProtocolVersion;
|
||||||
PWCHAR KernelParameters;
|
PWCHAR KernelParameters;
|
||||||
|
PFN_NUMBER BootImageSize;
|
||||||
LIST_ENTRY LoadOrderListHead;
|
LIST_ENTRY LoadOrderListHead;
|
||||||
LIST_ENTRY MemoryDescriptorListHead;
|
LIST_ENTRY MemoryDescriptorListHead;
|
||||||
LIST_ENTRY BootDriverListHead;
|
LIST_ENTRY BootDriverListHead;
|
||||||
|
|||||||
Reference in New Issue
Block a user