[edk2-devel] edk2 memory map on QEMU

Stuart Yoder stuart.yoder at arm.com
Fri Jul 30 21:50:23 UTC 2021



On 7/30/21 3:36 PM, Andrew Fish wrote:
> 
> 
>> On Jul 30, 2021, at 12:32 PM, Stuart Yoder <stuart.yoder at arm.com <mailto:stuart.yoder at arm.com>> wrote:
>>
>> I am playing around with EDK2 on QEMU with a UEFI shell application and in the app I allocate some memory using gBS->AllocatePool(EfiBootServicesData, ...)
>>
>> Programmatically accessing the pointer returned works fine, but when I print it, it does not seem to be what I would expect is a valid address.
>>
>> I've allocated 4GB to the QEMU machine, which I believe starts at 0x40000000.
>>
> 
> You can run the `memmap` command at the EFI Shell to see the layout.
> 
>> But, when I print the address returned by AllocatePool the value is "0x39177018".
>>
> 
> Print != printf on some of the format string so be careful about that….
> 

I figured it out.  It was a dumb Print() formatting error that resulted in
the address getting truncated to 8 bytes.

Thanks,
Stuart


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78459): https://edk2.groups.io/g/devel/message/78459
Mute This Topic: https://groups.io/mt/84558767/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list