> On Nov 6, 2015, at 10:28 AM, Shubha Ramani <[email protected]> wrote:
> 
> Here:http://wiki.phoenix.com/wiki/index.php/EFI_BOOT_SERVICES#AllocatePages.28.29
> 
> First of all, is there a concept of Virtual Memory in UEFI ? 

EFI Boot Services runs with physical addresses. When the OS takes over it can 
provide a virtual address space for the EFI Runtime Services. See UEFI 2.5 
Chapter 7 Runtime Services - 7.4 Virtual Memory Services. That is why a memory 
descriptor contains the VirtualStart.

> Why does EFI_MEMORY_DESCRIPTOR have VirtualStart ? What is it used for ?
> typedef struct {
>  UINT32               Type;
>  EFI_PHYSICAL_ADDRESS PhysicalStart;
>  EFI_VIRTUAL_ADDRESS  VirtualStart;
>  UINT64               NumberOfPages;
>  UINT64               Attribute;
> } EFI_MEMORY_DESCRIPTOR; Finally, if there is no virtual memory, then why is 
> AllocatePages even required ?  If all you care about is reading/writing to 
> pure physical memory addresses, then do you need to call AllocatePages ?

To allocate page aligned memory. The OS uses virtual memory even if EFI does 
not, thus the EFI Runtime Services code, and tables passed to the OS are page 
aligned to make it easier for the OS to map. 

Thanks,

Andrew Fish

> Thanks,
> Shubha
> Shubha D. [email protected]
> [email protected]
> _______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.01.org/mailman/listinfo/edk2-devel

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to