* Building EmulatorPkg and EDK2 project issue.
@ 2018-10-30 14:04 Prem Kumar
2018-10-30 23:57 ` Gao, Liming
0 siblings, 1 reply; 14+ messages in thread
From: Prem Kumar @ 2018-10-30 14:04 UTC (permalink / raw)
To: edk2-devel
Hi All,
Below are the issue i'm currently facing,
- EmulatorPkg:
o Building of EmulatorPkg using below command
§ build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
IA32
o But when I try to launch Emulator using below command, it failed. I
searched for WinHost.exe file, and it is not present in Build folder also.
§ cd Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
- Building EDK2 project for ARM using LLVM
o What are the steps/changes need to do in-order to build EDK2 project
for ARM+LLVM configuration.
Kindly provide any comments. Any pointer is helpful.
*Note:*
Trying to build in Windows environment. Build and launch of Nt32Pkg is
successful.
--
Regards,
Prem.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building EmulatorPkg and EDK2 project issue.
2018-10-30 14:04 Building EmulatorPkg and EDK2 project issue Prem Kumar
@ 2018-10-30 23:57 ` Gao, Liming
2018-10-31 12:18 ` Prem Kumar
0 siblings, 1 reply; 14+ messages in thread
From: Gao, Liming @ 2018-10-30 23:57 UTC (permalink / raw)
To: Prem Kumar, edk2-devel@lists.01.org
For emulator, please type below command and see what's happen.
build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a IA32 -m EmulatorPkg/Win/Host/WinHost.inf
>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>Prem Kumar
>Sent: Tuesday, October 30, 2018 10:04 PM
>To: edk2-devel@lists.01.org
>Subject: [edk2] Building EmulatorPkg and EDK2 project issue.
>
>Hi All,
> Below are the issue i'm currently facing,
>
>- EmulatorPkg:
>
>o Building of EmulatorPkg using below command
>
>§ build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
>IA32
>
>o But when I try to launch Emulator using below command, it failed. I
>searched for WinHost.exe file, and it is not present in Build folder also.
>
>§ cd Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
>
>- Building EDK2 project for ARM using LLVM
>
>o What are the steps/changes need to do in-order to build EDK2 project
>for ARM+LLVM configuration.
>
>
>Kindly provide any comments. Any pointer is helpful.
>
>*Note:*
>
> Trying to build in Windows environment. Build and launch of Nt32Pkg is
>successful.
>
>--
>Regards,
>Prem.
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building EmulatorPkg and EDK2 project issue.
2018-10-30 23:57 ` Gao, Liming
@ 2018-10-31 12:18 ` Prem Kumar
2018-11-03 8:42 ` Prem Kumar
0 siblings, 1 reply; 14+ messages in thread
From: Prem Kumar @ 2018-10-31 12:18 UTC (permalink / raw)
To: liming.gao; +Cc: edk2-devel
Hi Liming,
Thanks for quick response and details,
EmulatorPkg\Win
Above folder was not present in UDK2018. But available in EDK2 master
When I used below command I'm able to build success,
build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a IA32
-m EmulatorPkg/Win/Host/WinHost.inf
But when i try to launch I'm facing below error,
[image: image.png]
--
Thanks,
Prem.
On Wed, Oct 31, 2018 at 5:28 AM Gao, Liming <liming.gao@intel.com> wrote:
> For emulator, please type below command and see what's happen.
>
> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a IA32
> -m EmulatorPkg/Win/Host/WinHost.inf
>
> >-----Original Message-----
> >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> >Prem Kumar
> >Sent: Tuesday, October 30, 2018 10:04 PM
> >To: edk2-devel@lists.01.org
> >Subject: [edk2] Building EmulatorPkg and EDK2 project issue.
> >
> >Hi All,
> > Below are the issue i'm currently facing,
> >
> >- EmulatorPkg:
> >
> >o Building of EmulatorPkg using below command
> >
> >§ build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
> >IA32
> >
> >o But when I try to launch Emulator using below command, it failed. I
> >searched for WinHost.exe file, and it is not present in Build folder also.
> >
> >§ cd Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
> >
> >- Building EDK2 project for ARM using LLVM
> >
> >o What are the steps/changes need to do in-order to build EDK2 project
> >for ARM+LLVM configuration.
> >
> >
> >Kindly provide any comments. Any pointer is helpful.
> >
> >*Note:*
> >
> > Trying to build in Windows environment. Build and launch of Nt32Pkg is
> >successful.
> >
> >--
> >Regards,
> >Prem.
> >_______________________________________________
> >edk2-devel mailing list
> >edk2-devel@lists.01.org
> >https://lists.01.org/mailman/listinfo/edk2-devel
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building EmulatorPkg and EDK2 project issue.
2018-10-31 12:18 ` Prem Kumar
@ 2018-11-03 8:42 ` Prem Kumar
2018-11-03 17:11 ` Andrew Fish
0 siblings, 1 reply; 14+ messages in thread
From: Prem Kumar @ 2018-11-03 8:42 UTC (permalink / raw)
To: liming.gao; +Cc: edk2-devel
Hi All,
Any comments for this to proceed further.
--
Thanks & Regards,
Prem.
On Wed, Oct 31, 2018 at 5:48 PM Prem Kumar <perry.prem@gmail.com> wrote:
> Hi Liming,
> Thanks for quick response and details,
>
> EmulatorPkg\Win
> Above folder was not present in UDK2018. But available in EDK2 master
>
> When I used below command I'm able to build success,
> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a IA32
> -m EmulatorPkg/Win/Host/WinHost.inf
>
> But when i try to launch I'm facing below error,
> [image: image.png]
>
>
>
> --
> Thanks,
> Prem.
>
> On Wed, Oct 31, 2018 at 5:28 AM Gao, Liming <liming.gao@intel.com> wrote:
>
>> For emulator, please type below command and see what's happen.
>>
>> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
>> IA32 -m EmulatorPkg/Win/Host/WinHost.inf
>>
>> >-----Original Message-----
>> >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>> >Prem Kumar
>> >Sent: Tuesday, October 30, 2018 10:04 PM
>> >To: edk2-devel@lists.01.org
>> >Subject: [edk2] Building EmulatorPkg and EDK2 project issue.
>> >
>> >Hi All,
>> > Below are the issue i'm currently facing,
>> >
>> >- EmulatorPkg:
>> >
>> >o Building of EmulatorPkg using below command
>> >
>> >§ build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
>> >IA32
>> >
>> >o But when I try to launch Emulator using below command, it failed. I
>> >searched for WinHost.exe file, and it is not present in Build folder
>> also.
>> >
>> >§ cd Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
>> >
>> >- Building EDK2 project for ARM using LLVM
>> >
>> >o What are the steps/changes need to do in-order to build EDK2 project
>> >for ARM+LLVM configuration.
>> >
>> >
>> >Kindly provide any comments. Any pointer is helpful.
>> >
>> >*Note:*
>> >
>> > Trying to build in Windows environment. Build and launch of Nt32Pkg is
>> >successful.
>> >
>> >--
>> >Regards,
>> >Prem.
>> >_______________________________________________
>> >edk2-devel mailing list
>> >edk2-devel@lists.01.org
>> >https://lists.01.org/mailman/listinfo/edk2-devel
>>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building EmulatorPkg and EDK2 project issue.
2018-11-03 8:42 ` Prem Kumar
@ 2018-11-03 17:11 ` Andrew Fish
2018-11-03 19:26 ` Prem Kumar
0 siblings, 1 reply; 14+ messages in thread
From: Andrew Fish @ 2018-11-03 17:11 UTC (permalink / raw)
To: Prem Kumar; +Cc: Gao, Liming, edk2-devel
Prem,
Looks like the mailing list ate your attachment. What error did you see? Can you copy the text into an email?
Thanks,
Andrew Fish
> On Nov 3, 2018, at 1:42 AM, Prem Kumar <perry.prem@gmail.com> wrote:
>
> Hi All,
> Any comments for this to proceed further.
>
> --
> Thanks & Regards,
> Prem.
>
> On Wed, Oct 31, 2018 at 5:48 PM Prem Kumar <perry.prem@gmail.com> wrote:
>
>> Hi Liming,
>> Thanks for quick response and details,
>>
>> EmulatorPkg\Win
>> Above folder was not present in UDK2018. But available in EDK2 master
>>
>> When I used below command I'm able to build success,
>> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a IA32
>> -m EmulatorPkg/Win/Host/WinHost.inf
>>
>> But when i try to launch I'm facing below error,
>> [image: image.png]
>>
>>
>>
>> --
>> Thanks,
>> Prem.
>>
>> On Wed, Oct 31, 2018 at 5:28 AM Gao, Liming <liming.gao@intel.com> wrote:
>>
>>> For emulator, please type below command and see what's happen.
>>>
>>> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
>>> IA32 -m EmulatorPkg/Win/Host/WinHost.inf
>>>
>>>> -----Original Message-----
>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>>>> Prem Kumar
>>>> Sent: Tuesday, October 30, 2018 10:04 PM
>>>> To: edk2-devel@lists.01.org
>>>> Subject: [edk2] Building EmulatorPkg and EDK2 project issue.
>>>>
>>>> Hi All,
>>>> Below are the issue i'm currently facing,
>>>>
>>>> - EmulatorPkg:
>>>>
>>>> o Building of EmulatorPkg using below command
>>>>
>>>> § build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
>>>> IA32
>>>>
>>>> o But when I try to launch Emulator using below command, it failed. I
>>>> searched for WinHost.exe file, and it is not present in Build folder
>>> also.
>>>>
>>>> § cd Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
>>>>
>>>> - Building EDK2 project for ARM using LLVM
>>>>
>>>> o What are the steps/changes need to do in-order to build EDK2 project
>>>> for ARM+LLVM configuration.
>>>>
>>>>
>>>> Kindly provide any comments. Any pointer is helpful.
>>>>
>>>> *Note:*
>>>>
>>>> Trying to build in Windows environment. Build and launch of Nt32Pkg is
>>>> successful.
>>>>
>>>> --
>>>> Regards,
>>>> Prem.
>>>> _______________________________________________
>>>> edk2-devel mailing list
>>>> edk2-devel@lists.01.org
>>>> https://lists.01.org/mailman/listinfo/edk2-devel
>>>
>>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building EmulatorPkg and EDK2 project issue.
2018-11-03 17:11 ` Andrew Fish
@ 2018-11-03 19:26 ` Prem Kumar
2018-11-03 20:26 ` Andrew Fish
0 siblings, 1 reply; 14+ messages in thread
From: Prem Kumar @ 2018-11-03 19:26 UTC (permalink / raw)
To: afish; +Cc: liming.gao, edk2-devel
Hi Andrew,
Thanks for your reply.
Below is the error when trying to launch Emulator after successful build,
*1.Launching Emulator using below command:*
C:\UEFIWorkspace\edk2-master_2018_Latest>cd
Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
BootMode 0x00
OS Emulator passing in 128 KB of temp RAM at 0x04400000 to SEC
ERROR : Could not allocate PeiServicesTablePage @ 03000000
*2. Launching WinHose.exe directly:*
C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorIA32\DEBUG_VS2015x86\IA32>WinHost.exe
EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
BootMode 0x00
OS Emulator passing in 128 KB of temp RAM at 0x04ab0000 to SEC
ERROR : Could not allocate PeiServicesTablePage @ 03000000
--
Regards,
Prem.
On Sat, Nov 3, 2018 at 10:41 PM Andrew Fish <afish@apple.com> wrote:
> Prem,
>
> Looks like the mailing list ate your attachment. What error did you see?
> Can you copy the text into an email?
>
> Thanks,
>
> Andrew Fish
>
> > On Nov 3, 2018, at 1:42 AM, Prem Kumar <perry.prem@gmail.com> wrote:
> >
> > Hi All,
> > Any comments for this to proceed further.
> >
> > --
> > Thanks & Regards,
> > Prem.
> >
> > On Wed, Oct 31, 2018 at 5:48 PM Prem Kumar <perry.prem@gmail.com> wrote:
> >
> >> Hi Liming,
> >> Thanks for quick response and details,
> >>
> >> EmulatorPkg\Win
> >> Above folder was not present in UDK2018. But available in EDK2 master
> >>
> >> When I used below command I'm able to build success,
> >> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
> IA32
> >> -m EmulatorPkg/Win/Host/WinHost.inf
> >>
> >> But when i try to launch I'm facing below error,
> >> [image: image.png]
> >>
> >>
> >>
> >> --
> >> Thanks,
> >> Prem.
> >>
> >> On Wed, Oct 31, 2018 at 5:28 AM Gao, Liming <liming.gao@intel.com>
> wrote:
> >>
> >>> For emulator, please type below command and see what's happen.
> >>>
> >>> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
> >>> IA32 -m EmulatorPkg/Win/Host/WinHost.inf
> >>>
> >>>> -----Original Message-----
> >>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf
> Of
> >>>> Prem Kumar
> >>>> Sent: Tuesday, October 30, 2018 10:04 PM
> >>>> To: edk2-devel@lists.01.org
> >>>> Subject: [edk2] Building EmulatorPkg and EDK2 project issue.
> >>>>
> >>>> Hi All,
> >>>> Below are the issue i'm currently facing,
> >>>>
> >>>> - EmulatorPkg:
> >>>>
> >>>> o Building of EmulatorPkg using below command
> >>>>
> >>>> § build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD
> -a
> >>>> IA32
> >>>>
> >>>> o But when I try to launch Emulator using below command, it failed.
> I
> >>>> searched for WinHost.exe file, and it is not present in Build folder
> >>> also.
> >>>>
> >>>> § cd Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
> >>>>
> >>>> - Building EDK2 project for ARM using LLVM
> >>>>
> >>>> o What are the steps/changes need to do in-order to build EDK2
> project
> >>>> for ARM+LLVM configuration.
> >>>>
> >>>>
> >>>> Kindly provide any comments. Any pointer is helpful.
> >>>>
> >>>> *Note:*
> >>>>
> >>>> Trying to build in Windows environment. Build and launch of Nt32Pkg is
> >>>> successful.
> >>>>
> >>>> --
> >>>> Regards,
> >>>> Prem.
> >>>> _______________________________________________
> >>>> edk2-devel mailing list
> >>>> edk2-devel@lists.01.org
> >>>> https://lists.01.org/mailman/listinfo/edk2-devel
> >>>
> >>
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building EmulatorPkg and EDK2 project issue.
2018-11-03 19:26 ` Prem Kumar
@ 2018-11-03 20:26 ` Andrew Fish
2018-11-03 20:55 ` Prem Kumar
0 siblings, 1 reply; 14+ messages in thread
From: Andrew Fish @ 2018-11-03 20:26 UTC (permalink / raw)
To: Prem Kumar; +Cc: liming.gao, edk2-devel
Prem,
I've not run the emulator on Windows in a very very long time. But lets take a look at your error message.
/Volumes/Case/UDK2018(vUDK2018)>git grep "Could not allocate PeiServicesTablePage"
EmulatorPkg/Unix/Host/Host.c:508: printf ("MapFd0(): Could not allocate PeiServicesTablePage @ %lx\n", (long unsigned int)EmuMagicPage);
That seems to point to PcdPeiServicesTablePage
/Volumes/Case/UDK2018(vUDK2018)>git grep PcdPeiServicesTablePage -- *.dec
EmulatorPkg/EmulatorPkg.dec:73: gEmulatorPkgTokenSpaceGuid.PcdPeiServicesTablePage|0x1003000000|UINT64|0x0000101b
Which has a default value of 0x1003000000. But since you built for IA32 it gets truncated to 0x03000000
Do you need 32-bit IA32? Can do a 64-bit build and use X64. Something like:
build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a X64 -m EmulatorPkg/Win/Host/WinHost.inf
It looks like that is hard coded address that needs to get allocated in the emulator, and in your case that allocation is failing.
Thanks,
Andrew Fish
PS I'm not sure the printf is correct: printf ("MapFd0(): Could not allocate PeiServicesTablePage @ %lx\n", (long unsigned int)EmuMagicPage);
Given the width of long is different on different platforms. UINT64 uses long long to make sure things are 64-bits. Not to mention EmuMagicPage is a pointer, not an long unsigned int.
> On Nov 3, 2018, at 12:26 PM, Prem Kumar <perry.prem@gmail.com> wrote:
>
> Hi Andrew,
> Thanks for your reply.
>
> Below is the error when trying to launch Emulator after successful build,
>
> 1.Launching Emulator using below command:
> C:\UEFIWorkspace\edk2-master_2018_Latest>cd Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
>
> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/ <http://www.tianocore.org/edk2/>
> BootMode 0x00
> OS Emulator passing in 128 KB of temp RAM at 0x04400000 to SEC
> ERROR : Could not allocate PeiServicesTablePage @ 03000000
>
> 2. Launching WinHose.exe directly:
> C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorIA32\DEBUG_VS2015x86\IA32>WinHost.exe
>
> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/ <http://www.tianocore.org/edk2/>
> BootMode 0x00
> OS Emulator passing in 128 KB of temp RAM at 0x04ab0000 to SEC
> ERROR : Could not allocate PeiServicesTablePage @ 03000000
>
>
>
> --
> Regards,
> Prem.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building EmulatorPkg and EDK2 project issue.
2018-11-03 20:26 ` Andrew Fish
@ 2018-11-03 20:55 ` Prem Kumar
2018-11-03 23:45 ` Tian, Hot
2018-11-04 18:05 ` Andrew Fish
0 siblings, 2 replies; 14+ messages in thread
From: Prem Kumar @ 2018-11-03 20:55 UTC (permalink / raw)
To: afish; +Cc: liming.gao, edk2-devel
Hi Andrew,
Thanks for your explanation.
After building for x64 I could see below error.
C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorX64\DEBUG_VS2015x86\X64>WinHost.exe
EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
BootMode 0x00
OS Emulator passing in 128 KB of temp RAM at 0x65e70000 to SEC
ERROR : Can not open Firmware Device File ../FV/FV_RECOVERY.fd (0xE).
Exiting.
*I've searched for FV_RECOVERY.fd in entire project and found no such file
generated after built.*
--
Thanks & Regards,
Prem.
On Sun, Nov 4, 2018 at 1:56 AM Andrew Fish <afish@apple.com> wrote:
> Prem,
>
> I've not run the emulator on Windows in a very very long time. But lets
> take a look at your error message.
>
> /Volumes/Case/UDK2018(vUDK2018)>git grep "Could not allocate
> PeiServicesTablePage"
> EmulatorPkg/Unix/Host/Host.c:508: printf ("MapFd0(): *Could not
> allocate PeiServicesTablePage* @ %lx\n", (long unsigned int)EmuMagicPage);
>
> That seems to point to PcdPeiServicesTablePage
> /Volumes/Case/UDK2018(vUDK2018)>git grep PcdPeiServicesTablePage -- *.dec
> EmulatorPkg/EmulatorPkg.dec:73: gEmulatorPkgTokenSpaceGuid.
> *PcdPeiServicesTablePage*|0x1003000000|UINT64|0x0000101b
>
> Which has a default value of 0x1003000000. But since you built for IA32
> it gets truncated to 0x03000000
>
> Do you need 32-bit IA32? Can do a 64-bit build and use X64. Something like:
>
> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
> X64 -m EmulatorPkg/Win/Host/WinHost.inf
>
> It looks like that is hard coded address that needs to get allocated in
> the emulator, and in your case that allocation is failing.
>
> Thanks,
>
> Andrew Fish
>
> PS I'm not sure the printf is correct: printf ("MapFd0(): Could not
> allocate PeiServicesTablePage @ %lx\n", (long unsigned int)EmuMagicPage);
> Given the width of long is different on different platforms. UINT64 uses
> long long to make sure things are 64-bits. Not to mention EmuMagicPage is a
> pointer, not an long unsigned int.
>
>
> On Nov 3, 2018, at 12:26 PM, Prem Kumar <perry.prem@gmail.com> wrote:
>
> Hi Andrew,
> Thanks for your reply.
>
> Below is the error when trying to launch Emulator after successful build,
>
> *1.Launching Emulator using below command:*
> C:\UEFIWorkspace\edk2-master_2018_Latest>cd
> Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
>
> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
> BootMode 0x00
> OS Emulator passing in 128 KB of temp RAM at 0x04400000 to SEC
> ERROR : Could not allocate PeiServicesTablePage @ 03000000
>
> *2. Launching WinHose.exe directly:*
>
> C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorIA32\DEBUG_VS2015x86\IA32>WinHost.exe
>
> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
> BootMode 0x00
> OS Emulator passing in 128 KB of temp RAM at 0x04ab0000 to SEC
> ERROR : Could not allocate PeiServicesTablePage @ 03000000
>
>
>
> --
> Regards,
> Prem.
>
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building EmulatorPkg and EDK2 project issue.
2018-11-03 20:55 ` Prem Kumar
@ 2018-11-03 23:45 ` Tian, Hot
2018-11-04 2:04 ` Prem Kumar
2018-11-04 18:05 ` Andrew Fish
1 sibling, 1 reply; 14+ messages in thread
From: Tian, Hot @ 2018-11-03 23:45 UTC (permalink / raw)
To: Prem Kumar, afish@apple.com
Cc: edk2-devel@lists.01.org, Gao, Liming, Ni, Ruiyu
Are you using the latest EDKII master code? Windows support is added recently by https://bugzilla.tianocore.org/show_bug.cgi?id=1112. + Ruiyu Ni.
Thanks,
Hot
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Prem Kumar
Sent: Sunday, November 04, 2018 4:55
To: afish@apple.com
Cc: edk2-devel@lists.01.org; Gao, Liming <liming.gao@intel.com>
Subject: Re: [edk2] Building EmulatorPkg and EDK2 project issue.
Hi Andrew,
Thanks for your explanation.
After building for x64 I could see below error.
C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorX64\DEBUG_VS2015x86\X64>WinHost.exe
EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
BootMode 0x00
OS Emulator passing in 128 KB of temp RAM at 0x65e70000 to SEC ERROR : Can not open Firmware Device File ../FV/FV_RECOVERY.fd (0xE).
Exiting.
*I've searched for FV_RECOVERY.fd in entire project and found no such file generated after built.*
--
Thanks & Regards,
Prem.
On Sun, Nov 4, 2018 at 1:56 AM Andrew Fish <afish@apple.com> wrote:
> Prem,
>
> I've not run the emulator on Windows in a very very long time. But
> lets take a look at your error message.
>
> /Volumes/Case/UDK2018(vUDK2018)>git grep "Could not allocate
> PeiServicesTablePage"
> EmulatorPkg/Unix/Host/Host.c:508: printf ("MapFd0(): *Could not
> allocate PeiServicesTablePage* @ %lx\n", (long unsigned
> int)EmuMagicPage);
>
> That seems to point to PcdPeiServicesTablePage
> /Volumes/Case/UDK2018(vUDK2018)>git grep PcdPeiServicesTablePage --
> *.dec
> EmulatorPkg/EmulatorPkg.dec:73: gEmulatorPkgTokenSpaceGuid.
> *PcdPeiServicesTablePage*|0x1003000000|UINT64|0x0000101b
>
> Which has a default value of 0x1003000000. But since you built for
> IA32 it gets truncated to 0x03000000
>
> Do you need 32-bit IA32? Can do a 64-bit build and use X64. Something like:
>
> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
> X64 -m EmulatorPkg/Win/Host/WinHost.inf
>
> It looks like that is hard coded address that needs to get allocated
> in the emulator, and in your case that allocation is failing.
>
> Thanks,
>
> Andrew Fish
>
> PS I'm not sure the printf is correct: printf ("MapFd0(): Could not
> allocate PeiServicesTablePage @ %lx\n", (long unsigned
> int)EmuMagicPage); Given the width of long is different on different
> platforms. UINT64 uses long long to make sure things are 64-bits. Not
> to mention EmuMagicPage is a pointer, not an long unsigned int.
>
>
> On Nov 3, 2018, at 12:26 PM, Prem Kumar <perry.prem@gmail.com> wrote:
>
> Hi Andrew,
> Thanks for your reply.
>
> Below is the error when trying to launch Emulator after successful
> build,
>
> *1.Launching Emulator using below command:*
> C:\UEFIWorkspace\edk2-master_2018_Latest>cd
> Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
>
> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
> BootMode 0x00
> OS Emulator passing in 128 KB of temp RAM at 0x04400000 to SEC ERROR
> : Could not allocate PeiServicesTablePage @ 03000000
>
> *2. Launching WinHose.exe directly:*
>
> C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorIA32\DEBUG_VS20
> 15x86\IA32>WinHost.exe
>
> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
> BootMode 0x00
> OS Emulator passing in 128 KB of temp RAM at 0x04ab0000 to SEC ERROR
> : Could not allocate PeiServicesTablePage @ 03000000
>
>
>
> --
> Regards,
> Prem.
>
>
>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building EmulatorPkg and EDK2 project issue.
2018-11-03 23:45 ` Tian, Hot
@ 2018-11-04 2:04 ` Prem Kumar
2018-11-04 2:18 ` Prem Kumar
0 siblings, 1 reply; 14+ messages in thread
From: Prem Kumar @ 2018-11-04 2:04 UTC (permalink / raw)
To: hot.tian; +Cc: afish, edk2-devel, liming.gao, ruiyu.ni
Yes, I'm using latest EDKII master cod. In latest EDK code I could see
EmulatorPkg\Win folder not in previous/UDK2018 label.
--
Thanks,
Prem.
On Sun, Nov 4, 2018 at 5:15 AM Tian, Hot <hot.tian@intel.com> wrote:
> Are you using the latest EDKII master code? Windows support is added
> recently by https://bugzilla.tianocore.org/show_bug.cgi?id=1112. + Ruiyu
> Ni.
>
> Thanks,
> Hot
>
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Prem Kumar
> Sent: Sunday, November 04, 2018 4:55
> To: afish@apple.com
> Cc: edk2-devel@lists.01.org; Gao, Liming <liming.gao@intel.com>
> Subject: Re: [edk2] Building EmulatorPkg and EDK2 project issue.
>
> Hi Andrew,
> Thanks for your explanation.
>
> After building for x64 I could see below error.
>
>
> C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorX64\DEBUG_VS2015x86\X64>WinHost.exe
>
> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
> BootMode 0x00
> OS Emulator passing in 128 KB of temp RAM at 0x65e70000 to SEC ERROR :
> Can not open Firmware Device File ../FV/FV_RECOVERY.fd (0xE).
> Exiting.
>
>
> *I've searched for FV_RECOVERY.fd in entire project and found no such file
> generated after built.*
>
> --
> Thanks & Regards,
> Prem.
>
>
>
> On Sun, Nov 4, 2018 at 1:56 AM Andrew Fish <afish@apple.com> wrote:
>
> > Prem,
> >
> > I've not run the emulator on Windows in a very very long time. But
> > lets take a look at your error message.
> >
> > /Volumes/Case/UDK2018(vUDK2018)>git grep "Could not allocate
> > PeiServicesTablePage"
> > EmulatorPkg/Unix/Host/Host.c:508: printf ("MapFd0(): *Could not
> > allocate PeiServicesTablePage* @ %lx\n", (long unsigned
> > int)EmuMagicPage);
> >
> > That seems to point to PcdPeiServicesTablePage
> > /Volumes/Case/UDK2018(vUDK2018)>git grep PcdPeiServicesTablePage --
> > *.dec
> > EmulatorPkg/EmulatorPkg.dec:73: gEmulatorPkgTokenSpaceGuid.
> > *PcdPeiServicesTablePage*|0x1003000000|UINT64|0x0000101b
> >
> > Which has a default value of 0x1003000000. But since you built for
> > IA32 it gets truncated to 0x03000000
> >
> > Do you need 32-bit IA32? Can do a 64-bit build and use X64. Something
> like:
> >
> > build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
> > X64 -m EmulatorPkg/Win/Host/WinHost.inf
> >
> > It looks like that is hard coded address that needs to get allocated
> > in the emulator, and in your case that allocation is failing.
> >
> > Thanks,
> >
> > Andrew Fish
> >
> > PS I'm not sure the printf is correct: printf ("MapFd0(): Could not
> > allocate PeiServicesTablePage @ %lx\n", (long unsigned
> > int)EmuMagicPage); Given the width of long is different on different
> > platforms. UINT64 uses long long to make sure things are 64-bits. Not
> > to mention EmuMagicPage is a pointer, not an long unsigned int.
> >
> >
> > On Nov 3, 2018, at 12:26 PM, Prem Kumar <perry.prem@gmail.com> wrote:
> >
> > Hi Andrew,
> > Thanks for your reply.
> >
> > Below is the error when trying to launch Emulator after successful
> > build,
> >
> > *1.Launching Emulator using below command:*
> > C:\UEFIWorkspace\edk2-master_2018_Latest>cd
> > Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
> >
> > EDK II WIN Host Emulation Environment from
> http://www.tianocore.org/edk2/
> > BootMode 0x00
> > OS Emulator passing in 128 KB of temp RAM at 0x04400000 to SEC ERROR
> > : Could not allocate PeiServicesTablePage @ 03000000
> >
> > *2. Launching WinHose.exe directly:*
> >
> > C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorIA32\DEBUG_VS20
> > 15x86\IA32>WinHost.exe
> >
> > EDK II WIN Host Emulation Environment from
> http://www.tianocore.org/edk2/
> > BootMode 0x00
> > OS Emulator passing in 128 KB of temp RAM at 0x04ab0000 to SEC ERROR
> > : Could not allocate PeiServicesTablePage @ 03000000
> >
> >
> >
> > --
> > Regards,
> > Prem.
> >
> >
> >
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building EmulatorPkg and EDK2 project issue.
2018-11-04 2:04 ` Prem Kumar
@ 2018-11-04 2:18 ` Prem Kumar
0 siblings, 0 replies; 14+ messages in thread
From: Prem Kumar @ 2018-11-04 2:18 UTC (permalink / raw)
To: hot.tian; +Cc: afish, edk2-devel, liming.gao, ruiyu.ni
Hi Andrew/Hot,
Currently I'm trying to build EmulatorPkg using Visual Studio 2015. I'm
able to build EmulatorPkg successfully but failing to launch.
After going through bugzilla I've found below bug-Id,
*Bug 1138* <https://bugzilla.tianocore.org/show_bug.cgi?id=1138> -
[EmulatorPkg]
Win host cannot be built with VS2015
So Is it like EmulatorPkg works on VS2017 and not using VS2015?
Kindly provide your comments.
--
Regards,
Prem.
On Sun, Nov 4, 2018 at 7:34 AM Prem Kumar <perry.prem@gmail.com> wrote:
> Yes, I'm using latest EDKII master cod. In latest EDK code I could see
> EmulatorPkg\Win folder not in previous/UDK2018 label.
>
> --
> Thanks,
> Prem.
>
> On Sun, Nov 4, 2018 at 5:15 AM Tian, Hot <hot.tian@intel.com> wrote:
>
>> Are you using the latest EDKII master code? Windows support is added
>> recently by https://bugzilla.tianocore.org/show_bug.cgi?id=1112. + Ruiyu
>> Ni.
>>
>> Thanks,
>> Hot
>>
>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>> Prem Kumar
>> Sent: Sunday, November 04, 2018 4:55
>> To: afish@apple.com
>> Cc: edk2-devel@lists.01.org; Gao, Liming <liming.gao@intel.com>
>> Subject: Re: [edk2] Building EmulatorPkg and EDK2 project issue.
>>
>> Hi Andrew,
>> Thanks for your explanation.
>>
>> After building for x64 I could see below error.
>>
>>
>> C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorX64\DEBUG_VS2015x86\X64>WinHost.exe
>>
>> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
>> BootMode 0x00
>> OS Emulator passing in 128 KB of temp RAM at 0x65e70000 to SEC ERROR :
>> Can not open Firmware Device File ../FV/FV_RECOVERY.fd (0xE).
>> Exiting.
>>
>>
>> *I've searched for FV_RECOVERY.fd in entire project and found no such
>> file generated after built.*
>>
>> --
>> Thanks & Regards,
>> Prem.
>>
>>
>>
>> On Sun, Nov 4, 2018 at 1:56 AM Andrew Fish <afish@apple.com> wrote:
>>
>> > Prem,
>> >
>> > I've not run the emulator on Windows in a very very long time. But
>> > lets take a look at your error message.
>> >
>> > /Volumes/Case/UDK2018(vUDK2018)>git grep "Could not allocate
>> > PeiServicesTablePage"
>> > EmulatorPkg/Unix/Host/Host.c:508: printf ("MapFd0(): *Could not
>> > allocate PeiServicesTablePage* @ %lx\n", (long unsigned
>> > int)EmuMagicPage);
>> >
>> > That seems to point to PcdPeiServicesTablePage
>> > /Volumes/Case/UDK2018(vUDK2018)>git grep PcdPeiServicesTablePage --
>> > *.dec
>> > EmulatorPkg/EmulatorPkg.dec:73: gEmulatorPkgTokenSpaceGuid.
>> > *PcdPeiServicesTablePage*|0x1003000000|UINT64|0x0000101b
>> >
>> > Which has a default value of 0x1003000000. But since you built for
>> > IA32 it gets truncated to 0x03000000
>> >
>> > Do you need 32-bit IA32? Can do a 64-bit build and use X64. Something
>> like:
>> >
>> > build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
>> > X64 -m EmulatorPkg/Win/Host/WinHost.inf
>> >
>> > It looks like that is hard coded address that needs to get allocated
>> > in the emulator, and in your case that allocation is failing.
>> >
>> > Thanks,
>> >
>> > Andrew Fish
>> >
>> > PS I'm not sure the printf is correct: printf ("MapFd0(): Could
>> not
>> > allocate PeiServicesTablePage @ %lx\n", (long unsigned
>> > int)EmuMagicPage); Given the width of long is different on different
>> > platforms. UINT64 uses long long to make sure things are 64-bits. Not
>> > to mention EmuMagicPage is a pointer, not an long unsigned int.
>> >
>> >
>> > On Nov 3, 2018, at 12:26 PM, Prem Kumar <perry.prem@gmail.com> wrote:
>> >
>> > Hi Andrew,
>> > Thanks for your reply.
>> >
>> > Below is the error when trying to launch Emulator after successful
>> > build,
>> >
>> > *1.Launching Emulator using below command:*
>> > C:\UEFIWorkspace\edk2-master_2018_Latest>cd
>> > Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
>> >
>> > EDK II WIN Host Emulation Environment from
>> http://www.tianocore.org/edk2/
>> > BootMode 0x00
>> > OS Emulator passing in 128 KB of temp RAM at 0x04400000 to SEC ERROR
>> > : Could not allocate PeiServicesTablePage @ 03000000
>> >
>> > *2. Launching WinHose.exe directly:*
>> >
>> > C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorIA32\DEBUG_VS20
>> > 15x86\IA32>WinHost.exe
>> >
>> > EDK II WIN Host Emulation Environment from
>> http://www.tianocore.org/edk2/
>> > BootMode 0x00
>> > OS Emulator passing in 128 KB of temp RAM at 0x04ab0000 to SEC ERROR
>> > : Could not allocate PeiServicesTablePage @ 03000000
>> >
>> >
>> >
>> > --
>> > Regards,
>> > Prem.
>> >
>> >
>> >
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel
>>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building EmulatorPkg and EDK2 project issue.
2018-11-03 20:55 ` Prem Kumar
2018-11-03 23:45 ` Tian, Hot
@ 2018-11-04 18:05 ` Andrew Fish
2018-11-04 18:41 ` Prem Kumar
1 sibling, 1 reply; 14+ messages in thread
From: Andrew Fish @ 2018-11-04 18:05 UTC (permalink / raw)
To: Prem Kumar; +Cc: liming.gao, edk2-devel
> On Nov 3, 2018, at 1:55 PM, Prem Kumar <perry.prem@gmail.com> wrote:
>
> Hi Andrew,
> Thanks for your explanation.
>
> After building for x64 I could see below error.
>
> C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorX64\DEBUG_VS2015x86\X64>WinHost.exe
>
> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/ <http://www.tianocore.org/edk2/>
> BootMode 0x00
> OS Emulator passing in 128 KB of temp RAM at 0x65e70000 to SEC
> ERROR : Can not open Firmware Device File ../FV/FV_RECOVERY.fd (0xE). Exiting.
>
>
> I've searched for FV_RECOVERY.fd in entire project and found no such file generated after built.
>
Prem,
The FD (Flash Device) image should be constructed by the build, and end up in the generated Build directory. The start of the path is the target name, and then a directory that represents some of the flags to the build command.
So the FD should live in: Build\EmulatorX64\DEBUG_VS2015x86\FV\FV_RECOVERY.fd. If it is not present it would seem like your build failed? Did you get error messages at the end of the build?
This is the fix for the Bugzilla and it does not seem to relate to your failure.
/Volumes/Case/UDK2018(vUDK2018)>git show f4eaaf1a6d50c761e2af9a6dd0976fb8a3bd3c08
commit f4eaaf1a6d50c761e2af9a6dd0976fb8a3bd3c08
Author: Ruiyu Ni <ruiyu.ni@intel.com>
Date: Fri Aug 31 16:55:36 2018 +0800
Emulator/Win: Fix build failure using VS2015x86 or old WinSDK
When build with WinSDK <= Win10 TH2, the terminal over CMD.exe
doesn't work. Because Win10 later than TH2 starts to support VT
terminal.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
diff --git a/EmulatorPkg/Win/Host/WinHost.c b/EmulatorPkg/Win/Host/WinHost.c
index 9b98d5330f..65e8960eff 100644
--- a/EmulatorPkg/Win/Host/WinHost.c
+++ b/EmulatorPkg/Win/Host/WinHost.c
@@ -673,7 +673,7 @@ Returns:
// Transfer control to the SEC Core
//
SwitchStack (
- (SWITCH_STACK_ENTRY_POINT)SecCoreEntryPoint,
+ (SWITCH_STACK_ENTRY_POINT)(UINTN)SecCoreEntryPoint,
SecCoreData,
GetThunkPpiList (),
TopOfStack
diff --git a/EmulatorPkg/Win/Host/WinThunk.c b/EmulatorPkg/Win/Host/WinThunk.c
index 306fe75ecd..6007db73b5 100644
--- a/EmulatorPkg/Win/Host/WinThunk.c
+++ b/EmulatorPkg/Win/Host/WinThunk.c
@@ -71,15 +71,23 @@ SecConfigStdIn (
//
// Disable buffer (line input), echo, mouse, window
//
- Success = SetConsoleMode (
- GetStdHandle (STD_INPUT_HANDLE),
- Mode | ENABLE_VIRTUAL_TERMINAL_INPUT & ~(ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT)
- );
- }
- if (Success) {
+ Mode &= ~(ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT);
+
+#if defined(NTDDI_VERSION) && defined (NTDDI_WIN10_TH2) && (NTDDI_VERSION > NTDDI_WIN10_TH2)
//
- // Enable terminal mode
+ // Enable virtual terminal input for Win10 above TH2
//
+ Mode |= ENABLE_VIRTUAL_TERMINAL_INPUT;
+#endif
+
+ Success = SetConsoleMode (GetStdHandle (STD_INPUT_HANDLE), Mode);
+ }
+
+#if defined(NTDDI_VERSION) && defined (NTDDI_WIN10_TH2) && (NTDDI_VERSION > NTDDI_WIN10_TH2)
+ //
+ // Enable terminal mode for Win10 above TH2
+ //
+ if (Success) {
Success = GetConsoleMode (GetStdHandle (STD_OUTPUT_HANDLE), &Mode);
if (Success) {
Success = SetConsoleMode (
@@ -88,6 +96,7 @@ SecConfigStdIn (
);
}
}
+#endif
return Success ? EFI_SUCCESS : EFI_DEVICE_ERROR;
}
Thanks,
Andrew Fish
> --
> Thanks & Regards,
> Prem.
>
>
>
> On Sun, Nov 4, 2018 at 1:56 AM Andrew Fish <afish@apple.com <mailto:afish@apple.com>> wrote:
> Prem,
>
> I've not run the emulator on Windows in a very very long time. But lets take a look at your error message.
>
> /Volumes/Case/UDK2018(vUDK2018)>git grep "Could not allocate PeiServicesTablePage"
> EmulatorPkg/Unix/Host/Host.c:508: printf ("MapFd0(): Could not allocate PeiServicesTablePage @ %lx\n", (long unsigned int)EmuMagicPage);
>
> That seems to point to PcdPeiServicesTablePage
> /Volumes/Case/UDK2018(vUDK2018)>git grep PcdPeiServicesTablePage -- *.dec
> EmulatorPkg/EmulatorPkg.dec:73: gEmulatorPkgTokenSpaceGuid.PcdPeiServicesTablePage|0x1003000000|UINT64|0x0000101b
>
> Which has a default value of 0x1003000000. But since you built for IA32 it gets truncated to 0x03000000
>
> Do you need 32-bit IA32? Can do a 64-bit build and use X64. Something like:
>
> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a X64 -m EmulatorPkg/Win/Host/WinHost.inf
>
> It looks like that is hard coded address that needs to get allocated in the emulator, and in your case that allocation is failing.
>
> Thanks,
>
> Andrew Fish
>
> PS I'm not sure the printf is correct: printf ("MapFd0(): Could not allocate PeiServicesTablePage @ %lx\n", (long unsigned int)EmuMagicPage);
> Given the width of long is different on different platforms. UINT64 uses long long to make sure things are 64-bits. Not to mention EmuMagicPage is a pointer, not an long unsigned int.
>
>
>> On Nov 3, 2018, at 12:26 PM, Prem Kumar <perry.prem@gmail.com <mailto:perry.prem@gmail.com>> wrote:
>>
>> Hi Andrew,
>> Thanks for your reply.
>>
>> Below is the error when trying to launch Emulator after successful build,
>>
>> 1.Launching Emulator using below command:
>> C:\UEFIWorkspace\edk2-master_2018_Latest>cd Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
>>
>> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/ <http://www.tianocore.org/edk2/>
>> BootMode 0x00
>> OS Emulator passing in 128 KB of temp RAM at 0x04400000 to SEC
>> ERROR : Could not allocate PeiServicesTablePage @ 03000000
>>
>> 2. Launching WinHose.exe directly:
>> C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorIA32\DEBUG_VS2015x86\IA32>WinHost.exe
>>
>> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/ <http://www.tianocore.org/edk2/>
>> BootMode 0x00
>> OS Emulator passing in 128 KB of temp RAM at 0x04ab0000 to SEC
>> ERROR : Could not allocate PeiServicesTablePage @ 03000000
>>
>>
>>
>> --
>> Regards,
>> Prem.
>
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: Building EmulatorPkg and EDK2 project issue.
2018-11-04 18:05 ` Andrew Fish
@ 2018-11-04 18:41 ` Prem Kumar
2018-11-05 6:31 ` Ni, Ruiyu
0 siblings, 1 reply; 14+ messages in thread
From: Prem Kumar @ 2018-11-04 18:41 UTC (permalink / raw)
To: afish; +Cc: liming.gao, edk2-devel
Hi Andrew,
Thanks for your reply.
I have tried below way now I'm able to launch Emulator
1. Done full build for EmulatorPkg using command *build -p
EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a X64 *
2. Build got success without any build error
3. .FD file generated
4. Launching using command
*cd Build\EmulatorX64\DEBUG_VS2017\X64\ && WinHost.exe *
Earlier I was building only one component *WinHost.inf* without building
entire EmulatorPkg, bcz of this .FD was not generated.
*build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a X64
-m EmulatorPkg/Win/Host/WinHost.inf*
--
Regards,
Prem.
On Sun, Nov 4, 2018 at 11:35 PM Andrew Fish <afish@apple.com> wrote:
>
>
> On Nov 3, 2018, at 1:55 PM, Prem Kumar <perry.prem@gmail.com> wrote:
>
> Hi Andrew,
> Thanks for your explanation.
>
> After building for x64 I could see below error.
>
>
>
> C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorX64\DEBUG_VS2015x86\X64>WinHost.exe
>
> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
> BootMode 0x00
> OS Emulator passing in 128 KB of temp RAM at 0x65e70000 to SEC
> ERROR : Can not open Firmware Device File ../FV/FV_RECOVERY.fd (0xE).
> Exiting.
>
>
> *I've searched for FV_RECOVERY.fd in entire project and found no such file
> generated after built.*
>
>
> Prem,
>
> The FD (Flash Device) image should be constructed by the build, and end up
> in the generated Build directory. The start of the path is the target name,
> and then a directory that represents some of the flags to the build
> command.
>
> So the FD should live in:
> Build\EmulatorX64\DEBUG_VS2015x86\FV\FV_RECOVERY.fd. If it is not present
> it would seem like your build failed? Did you get error messages at the end
> of the build?
>
>
> This is the fix for the Bugzilla and it does not seem to relate to your
> failure.
>
> /Volumes/Case/UDK2018(vUDK2018)>git show
> f4eaaf1a6d50c761e2af9a6dd0976fb8a3bd3c08
> commit f4eaaf1a6d50c761e2af9a6dd0976fb8a3bd3c08
> Author: Ruiyu Ni <ruiyu.ni@intel.com>
> Date: Fri Aug 31 16:55:36 2018 +0800
>
> Emulator/Win: Fix build failure using VS2015x86 or old WinSDK
>
>
> When build with WinSDK <= Win10 TH2, the terminal over CMD.exe
> doesn't work. Because Win10 later than TH2 starts to support VT
> terminal.
>
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
>
> *diff --git a/EmulatorPkg/Win/Host/WinHost.c
> b/EmulatorPkg/Win/Host/WinHost.c*
> *index 9b98d5330f..65e8960eff 100644*
> *--- a/EmulatorPkg/Win/Host/WinHost.c*
> *+++ b/EmulatorPkg/Win/Host/WinHost.c*
> @@ -673,7 +673,7 @@ Returns:
> // Transfer control to the SEC Core
> //
> SwitchStack (
> - (SWITCH_STACK_ENTRY_POINT)SecCoreEntryPoint,
> + (SWITCH_STACK_ENTRY_POINT)(UINTN)SecCoreEntryPoint,
> SecCoreData,
> GetThunkPpiList (),
> TopOfStack
> *diff --git a/EmulatorPkg/Win/Host/WinThunk.c
> b/EmulatorPkg/Win/Host/WinThunk.c*
> *index 306fe75ecd..6007db73b5 100644*
> *--- a/EmulatorPkg/Win/Host/WinThunk.c*
> *+++ b/EmulatorPkg/Win/Host/WinThunk.c*
> @@ -71,15 +71,23 @@ SecConfigStdIn (
> //
> // Disable buffer (line input), echo, mouse, window
> //
> - Success = SetConsoleMode (
> - GetStdHandle (STD_INPUT_HANDLE),
> - Mode | ENABLE_VIRTUAL_TERMINAL_INPUT &
> ~(ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT |
> ENABLE_WINDOW_INPUT)
> - );
> - }
> - if (Success) {
> + Mode &= ~(ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT
> | ENABLE_WINDOW_INPUT);
> +
> +#if defined(NTDDI_VERSION) && defined (NTDDI_WIN10_TH2) && (NTDDI_VERSION
> > NTDDI_WIN10_TH2)
> //
> - // Enable terminal mode
> + // Enable virtual terminal input for Win10 above TH2
> //
> + Mode |= ENABLE_VIRTUAL_TERMINAL_INPUT;
> +#endif
> +
> + Success = SetConsoleMode (GetStdHandle (STD_INPUT_HANDLE), Mode);
> + }
> +
> +#if defined(NTDDI_VERSION) && defined (NTDDI_WIN10_TH2) && (NTDDI_VERSION
> > NTDDI_WIN10_TH2)
> + //
> + // Enable terminal mode for Win10 above TH2
> + //
> + if (Success) {
> Success = GetConsoleMode (GetStdHandle (STD_OUTPUT_HANDLE), &Mode);
> if (Success) {
> Success = SetConsoleMode (
> @@ -88,6 +96,7 @@ SecConfigStdIn (
> );
> }
> }
> +#endif
> return Success ? EFI_SUCCESS : EFI_DEVICE_ERROR;
> }
>
>
>
>
> Thanks,
>
> Andrew Fish
>
>
> --
> Thanks & Regards,
> Prem.
>
>
>
> On Sun, Nov 4, 2018 at 1:56 AM Andrew Fish <afish@apple.com> wrote:
>
>> Prem,
>>
>> I've not run the emulator on Windows in a very very long time. But lets
>> take a look at your error message.
>>
>> /Volumes/Case/UDK2018(vUDK2018)>git grep "Could not allocate
>> PeiServicesTablePage"
>> EmulatorPkg/Unix/Host/Host.c:508: printf ("MapFd0(): *Could not
>> allocate PeiServicesTablePage* @ %lx\n", (long unsigned
>> int)EmuMagicPage);
>>
>> That seems to point to PcdPeiServicesTablePage
>> /Volumes/Case/UDK2018(vUDK2018)>git grep PcdPeiServicesTablePage -- *.dec
>> EmulatorPkg/EmulatorPkg.dec:73: gEmulatorPkgTokenSpaceGuid.
>> *PcdPeiServicesTablePage*|0x1003000000|UINT64|0x0000101b
>>
>> Which has a default value of 0x1003000000. But since you built for IA32
>> it gets truncated to 0x03000000
>>
>> Do you need 32-bit IA32? Can do a 64-bit build and use X64. Something
>> like:
>>
>> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
>> X64 -m EmulatorPkg/Win/Host/WinHost.inf
>>
>> It looks like that is hard coded address that needs to get allocated in
>> the emulator, and in your case that allocation is failing.
>>
>> Thanks,
>>
>> Andrew Fish
>>
>> PS I'm not sure the printf is correct: printf ("MapFd0(): Could not
>> allocate PeiServicesTablePage @ %lx\n", (long unsigned int)EmuMagicPage);
>> Given the width of long is different on different platforms. UINT64 uses
>> long long to make sure things are 64-bits. Not to mention EmuMagicPage is a
>> pointer, not an long unsigned int.
>>
>>
>> On Nov 3, 2018, at 12:26 PM, Prem Kumar <perry.prem@gmail.com> wrote:
>>
>> Hi Andrew,
>> Thanks for your reply.
>>
>> Below is the error when trying to launch Emulator after successful build,
>>
>> *1.Launching Emulator using below command:*
>> C:\UEFIWorkspace\edk2-master_2018_Latest>cd
>> Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
>>
>> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
>> BootMode 0x00
>> OS Emulator passing in 128 KB of temp RAM at 0x04400000 to SEC
>> ERROR : Could not allocate PeiServicesTablePage @ 03000000
>>
>> *2. Launching WinHose.exe directly:*
>>
>> C:\UEFIWorkspace\edk2-master_2018_Latest\Build\EmulatorIA32\DEBUG_VS2015x86\IA32>WinHost.exe
>>
>> EDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/
>> BootMode 0x00
>> OS Emulator passing in 128 KB of temp RAM at 0x04ab0000 to SEC
>> ERROR : Could not allocate PeiServicesTablePage @ 03000000
>>
>>
>>
>> --
>> Regards,
>> Prem.
>>
>>
>>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building EmulatorPkg and EDK2 project issue.
2018-11-04 18:41 ` Prem Kumar
@ 2018-11-05 6:31 ` Ni, Ruiyu
0 siblings, 0 replies; 14+ messages in thread
From: Ni, Ruiyu @ 2018-11-05 6:31 UTC (permalink / raw)
To: Prem Kumar, afish@apple.com; +Cc: edk2-devel@lists.01.org, Gao, Liming
Sorry I just saw your mails.
So now you can successfully build EmulatorPkg using VS2015 and VS2017.
And the WinHost.exe can be launched successfully.
Correct?
I know that the EmulatorPkg may not be launched in certain Windows OSes.
The error message is: ERROR : Could not allocate PeiServicesTablePage @ 03000000
I haven't got time to look into this.
I also saw you ever met this error. How did you solve it?
Thanks/Ray
> -----Original Message-----
> From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of Prem
> Kumar
> Sent: Monday, November 5, 2018 2:41 AM
> To: afish@apple.com
> Cc: edk2-devel@lists.01.org; Gao, Liming <liming.gao@intel.com>
> Subject: Re: [edk2] Building EmulatorPkg and EDK2 project issue.
>
> Hi Andrew,
> Thanks for your reply.
>
> I have tried below way now I'm able to launch Emulator
>
> 1. Done full build for EmulatorPkg using command *build -p
> EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a X64 *
> 2. Build got success without any build error
> 3. .FD file generated
> 4. Launching using command
> *cd Build\EmulatorX64\DEBUG_VS2017\X64\ && WinHost.exe *
>
>
> Earlier I was building only one component *WinHost.inf* without building
> entire EmulatorPkg, bcz of this .FD was not generated.
> *build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
> X64 -m EmulatorPkg/Win/Host/WinHost.inf*
>
>
> --
> Regards,
> Prem.
>
>
>
> On Sun, Nov 4, 2018 at 11:35 PM Andrew Fish <afish@apple.com> wrote:
>
> >
> >
> > On Nov 3, 2018, at 1:55 PM, Prem Kumar <perry.prem@gmail.com> wrote:
> >
> > Hi Andrew,
> > Thanks for your explanation.
> >
> > After building for x64 I could see below error.
> >
> >
> >
> > C:\UEFIWorkspace\edk2-
> master_2018_Latest\Build\EmulatorX64\DEBUG_VS201
> > 5x86\X64>WinHost.exe
> >
> > EDK II WIN Host Emulation Environment from
> http://www.tianocore.org/edk2/
> > BootMode 0x00
> > OS Emulator passing in 128 KB of temp RAM at 0x65e70000 to SEC ERROR
> > : Can not open Firmware Device File ../FV/FV_RECOVERY.fd (0xE).
> > Exiting.
> >
> >
> > *I've searched for FV_RECOVERY.fd in entire project and found no such
> > file generated after built.*
> >
> >
> > Prem,
> >
> > The FD (Flash Device) image should be constructed by the build, and
> > end up in the generated Build directory. The start of the path is the
> > target name, and then a directory that represents some of the flags to
> > the build command.
> >
> > So the FD should live in:
> > Build\EmulatorX64\DEBUG_VS2015x86\FV\FV_RECOVERY.fd. If it is not
> > present it would seem like your build failed? Did you get error
> > messages at the end of the build?
> >
> >
> > This is the fix for the Bugzilla and it does not seem to relate to
> > your failure.
> >
> > /Volumes/Case/UDK2018(vUDK2018)>git show
> > f4eaaf1a6d50c761e2af9a6dd0976fb8a3bd3c08
> > commit f4eaaf1a6d50c761e2af9a6dd0976fb8a3bd3c08
> > Author: Ruiyu Ni <ruiyu.ni@intel.com>
> > Date: Fri Aug 31 16:55:36 2018 +0800
> >
> > Emulator/Win: Fix build failure using VS2015x86 or old WinSDK
> >
> >
> > When build with WinSDK <= Win10 TH2, the terminal over CMD.exe
> > doesn't work. Because Win10 later than TH2 starts to support VT
> > terminal.
> >
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
> >
> > *diff --git a/EmulatorPkg/Win/Host/WinHost.c
> > b/EmulatorPkg/Win/Host/WinHost.c*
> > *index 9b98d5330f..65e8960eff 100644*
> > *--- a/EmulatorPkg/Win/Host/WinHost.c* *+++
> > b/EmulatorPkg/Win/Host/WinHost.c* @@ -673,7 +673,7 @@ Returns:
> > // Transfer control to the SEC Core
> > //
> > SwitchStack (
> > - (SWITCH_STACK_ENTRY_POINT)SecCoreEntryPoint,
> > + (SWITCH_STACK_ENTRY_POINT)(UINTN)SecCoreEntryPoint,
> > SecCoreData,
> > GetThunkPpiList (),
> > TopOfStack
> > *diff --git a/EmulatorPkg/Win/Host/WinThunk.c
> > b/EmulatorPkg/Win/Host/WinThunk.c*
> > *index 306fe75ecd..6007db73b5 100644*
> > *--- a/EmulatorPkg/Win/Host/WinThunk.c*
> > *+++ b/EmulatorPkg/Win/Host/WinThunk.c*
> > @@ -71,15 +71,23 @@ SecConfigStdIn (
> > //
> > // Disable buffer (line input), echo, mouse, window
> > //
> > - Success = SetConsoleMode (
> > - GetStdHandle (STD_INPUT_HANDLE),
> > - Mode | ENABLE_VIRTUAL_TERMINAL_INPUT &
> > ~(ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT
> |
> > ENABLE_WINDOW_INPUT)
> > - );
> > - }
> > - if (Success) {
> > + Mode &= ~(ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT |
> > + ENABLE_MOUSE_INPUT
> > | ENABLE_WINDOW_INPUT);
> > +
> > +#if defined(NTDDI_VERSION) && defined (NTDDI_WIN10_TH2) &&
> > +(NTDDI_VERSION
> > > NTDDI_WIN10_TH2)
> > //
> > - // Enable terminal mode
> > + // Enable virtual terminal input for Win10 above TH2
> > //
> > + Mode |= ENABLE_VIRTUAL_TERMINAL_INPUT; #endif
> > +
> > + Success = SetConsoleMode (GetStdHandle (STD_INPUT_HANDLE),
> Mode);
> > + }
> > +
> > +#if defined(NTDDI_VERSION) && defined (NTDDI_WIN10_TH2) &&
> > +(NTDDI_VERSION
> > > NTDDI_WIN10_TH2)
> > + //
> > + // Enable terminal mode for Win10 above TH2 // if (Success) {
> > Success = GetConsoleMode (GetStdHandle (STD_OUTPUT_HANDLE),
> &Mode);
> > if (Success) {
> > Success = SetConsoleMode (
> > @@ -88,6 +96,7 @@ SecConfigStdIn (
> > );
> > }
> > }
> > +#endif
> > return Success ? EFI_SUCCESS : EFI_DEVICE_ERROR; }
> >
> >
> >
> >
> > Thanks,
> >
> > Andrew Fish
> >
> >
> > --
> > Thanks & Regards,
> > Prem.
> >
> >
> >
> > On Sun, Nov 4, 2018 at 1:56 AM Andrew Fish <afish@apple.com> wrote:
> >
> >> Prem,
> >>
> >> I've not run the emulator on Windows in a very very long time. But lets
> >> take a look at your error message.
> >>
> >> /Volumes/Case/UDK2018(vUDK2018)>git grep "Could not allocate
> >> PeiServicesTablePage"
> >> EmulatorPkg/Unix/Host/Host.c:508: printf ("MapFd0(): *Could not
> >> allocate PeiServicesTablePage* @ %lx\n", (long unsigned
> >> int)EmuMagicPage);
> >>
> >> That seems to point to PcdPeiServicesTablePage
> >> /Volumes/Case/UDK2018(vUDK2018)>git grep PcdPeiServicesTablePage -
> - *.dec
> >> EmulatorPkg/EmulatorPkg.dec:73: gEmulatorPkgTokenSpaceGuid.
> >> *PcdPeiServicesTablePage*|0x1003000000|UINT64|0x0000101b
> >>
> >> Which has a default value of 0x1003000000. But since you built for IA32
> >> it gets truncated to 0x03000000
> >>
> >> Do you need 32-bit IA32? Can do a 64-bit build and use X64. Something
> >> like:
> >>
> >> build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -D WIN_SEC_BUILD -a
> >> X64 -m EmulatorPkg/Win/Host/WinHost.inf
> >>
> >> It looks like that is hard coded address that needs to get allocated in
> >> the emulator, and in your case that allocation is failing.
> >>
> >> Thanks,
> >>
> >> Andrew Fish
> >>
> >> PS I'm not sure the printf is correct: printf ("MapFd0(): Could not
> >> allocate PeiServicesTablePage @ %lx\n", (long unsigned
> int)EmuMagicPage);
> >> Given the width of long is different on different platforms. UINT64 uses
> >> long long to make sure things are 64-bits. Not to mention EmuMagicPage
> is a
> >> pointer, not an long unsigned int.
> >>
> >>
> >> On Nov 3, 2018, at 12:26 PM, Prem Kumar <perry.prem@gmail.com>
> wrote:
> >>
> >> Hi Andrew,
> >> Thanks for your reply.
> >>
> >> Below is the error when trying to launch Emulator after successful build,
> >>
> >> *1.Launching Emulator using below command:*
> >> C:\UEFIWorkspace\edk2-master_2018_Latest>cd
> >> Build\EmulatorIA32\DEBUG_VS2015x86\IA32\ && WinHost.exe
> >>
> >> EDK II WIN Host Emulation Environment from
> http://www.tianocore.org/edk2/
> >> BootMode 0x00
> >> OS Emulator passing in 128 KB of temp RAM at 0x04400000 to SEC
> >> ERROR : Could not allocate PeiServicesTablePage @ 03000000
> >>
> >> *2. Launching WinHose.exe directly:*
> >>
> >> C:\UEFIWorkspace\edk2-
> master_2018_Latest\Build\EmulatorIA32\DEBUG_VS2015x86\IA32>WinHost.
> exe
> >>
> >> EDK II WIN Host Emulation Environment from
> http://www.tianocore.org/edk2/
> >> BootMode 0x00
> >> OS Emulator passing in 128 KB of temp RAM at 0x04ab0000 to SEC
> >> ERROR : Could not allocate PeiServicesTablePage @ 03000000
> >>
> >>
> >>
> >> --
> >> Regards,
> >> Prem.
> >>
> >>
> >>
> >
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2018-11-05 6:31 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-30 14:04 Building EmulatorPkg and EDK2 project issue Prem Kumar
2018-10-30 23:57 ` Gao, Liming
2018-10-31 12:18 ` Prem Kumar
2018-11-03 8:42 ` Prem Kumar
2018-11-03 17:11 ` Andrew Fish
2018-11-03 19:26 ` Prem Kumar
2018-11-03 20:26 ` Andrew Fish
2018-11-03 20:55 ` Prem Kumar
2018-11-03 23:45 ` Tian, Hot
2018-11-04 2:04 ` Prem Kumar
2018-11-04 2:18 ` Prem Kumar
2018-11-04 18:05 ` Andrew Fish
2018-11-04 18:41 ` Prem Kumar
2018-11-05 6:31 ` Ni, Ruiyu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox