From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.4114.1627681834799814580 for ; Fri, 30 Jul 2021 14:50:35 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: stuart.yoder@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 475E011B3; Fri, 30 Jul 2021 14:50:24 -0700 (PDT) Received: from [10.119.32.108] (unknown [10.119.32.108]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 277C33F70D; Fri, 30 Jul 2021 14:50:24 -0700 (PDT) Subject: Re: [edk2-devel] edk2 memory map on QEMU To: Andrew Fish , edk2-devel-groups-io References: <69abbbc0-f6ab-f21a-17ba-baf273cbc735@arm.com> <975C0799-99BF-4C5C-9628-EF7604670117@apple.com> From: "Stuart Yoder" Message-ID: <4d7aafe3-5e5b-cc7f-14be-2054b7341196@arm.com> Date: Fri, 30 Jul 2021 16:50:23 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <975C0799-99BF-4C5C-9628-EF7604670117@apple.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 7/30/21 3:36 PM, Andrew Fish wrote: >=20 >=20 >> On Jul 30, 2021, at 12:32 PM, Stuart Yoder > wrote: >> >> I am playing around with EDK2 on QEMU with a UEFI shell application an= d in the app I allocate some memory using gBS->AllocatePool(EfiBootServic= esData, ...) >> >> 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 0x40= 000000. >> >=20 > You can run the `memmap` command at the EFI Shell to see the layout. >=20 >> But, when I print the address returned by AllocatePool the value is "0= x39177018". >> >=20 > Print !=3D printf on some of the format string so be careful about that= =E2=80=A6. >=20 I figured it out. It was a dumb Print() formatting error that resulted i= n the address getting truncated to 8 bytes. Thanks, Stuart