On Feb 25, 2014, at 6:03 PM, John Davis <davi...@gmail.com> wrote:

> Hello Andrew,
> 
> Thanks, I appreciate the pointer.
> 
> FWIW, I have also learned based upon Bill Pauls previous Moo code sample, you 
> don't need to put apps in packages.  I was using the 
> MdeModulePkg/Application/HelloWorld/ directory as a source.  I got tired of 
> having to stop the emulator each time I made a change to my code in order for 
> it to build.  Consquently, I learned you can do this:
> 
> 1. Create you app at top level directory.
> ex. MyFindRom2/MyFindRom2.inf and .c
> 2.  Add the .inf to Nt32Pkg/Nt32Pkg.dsc
> 3.  Build all
> 4. Build run
> 5. Run app via MyFindRom2
> 6. Make change to app
> 7. Build app via > build -m MyFindRom2\MyFindRom2.inf
> 8. return to emulator and run the new app without having to shutdown the 
> emulator.
> 

Yep that works. You can load Apps or Drivers from the EFI shell from a USB key. 
Since the emulator makes some magic OS directories show up as EFI drives in the 
emulator you can just copy things over there. 

Thanks,

Andrew Fish

PS The source level debugging is based on finding the PE/COFF debug directory 
and with VC++ that will point to your PDB file. So as long as you are running 
on the system where you built the App you should get source level debug. 

> Bill was building a completely new package with a .dsc. I am just building a 
> component using a .inf.  I believe it was you who told me previously about 
> the contents of a .fdf and .dsc file.  
> 
> Thanks again
> 
> John
> 
> 
> On Tue, Feb 25, 2014 at 5:55 PM, Andrew Fish <af...@apple.com> wrote:
> 
> On Feb 25, 2014, at 4:46 PM, Bill Paul <wp...@windriver.com> wrote:
> 
>> Of all the gin joints in all the towns in all the world, John Davis had to 
>> walk into mine at 16:34:49 on Tuesday 25 February 2014 and say:
>> 
>>> Hmm. That is what I did to begin with.
>>> 
>>> Here are my includes and my .inf.
>>> 
>>> Now, I am really puzzled.  When I pasted the error from the build below, I
>>> noticed the error is actually in the code I used as a model for this app.
>>> How could this app cause the other app which used to build to fail?
>>> 
>>> ---------
>>> #include <Uefi.h>
>> 
>> Try adding
>> 
>> #include <PiPei.h>
>> 
> 
> To be pedantic you would want #include <PiDxe.h>, and then you don’t need 
> <Uefi.h>
> 
> I’ll explain what is going on….
> 
> UEFI spec replaces legacy BIOS and is an interface specification that talks 
> to Option ROMs, Applications, and OS Loaders.  It does not go into how the 
> firmware is constructed internally. 
> 
> The PI spec is a a standaard way to construct firmware based on the Platform 
> Initialization specifications. A UEFI platform does not have to support PI, 
> but a PI platform supports UEFI. 
> 
> PEI - is Pre EFI Initialization. This is the IA32 code that turns on memory 
> and jumps to X64 mode (on a typical PC). The DXE Phase is the Driver 
> Execution Phase. The DXE Core produces the EFI services. 
> 
> The general rule of thumb is match your module type:
> PEIM -> #include <PiPei.h>
> DXE_DRIVER -> #include <PiDxe.h>
> UEFI_DRIVER -> #include <Uefi.h>
> UEFI_APPLICATION -> #include <Uefi.h> 
> 
> If you need to write an application that accesses things PI (it may not run 
> everywhere) you can #include <PiDxe.h> in place of Uefi.h as this will also 
> include the main stuff from the UEFI spec.
> 
> https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdePkg/Include/PiDxe.h
> #ifndef __PI_DXE_H__
> #define __PI_DXE_H__
> 
> #include <Uefi/UefiBaseType.h>
> #include <Uefi/UefiSpec.h>
> 
> #include <Pi/PiDxeCis.h>
> 
> #endif
> Thanks,
> 
> Andrew Fish
> 
>> here.
>> 
>> The compiler is complaining because the EFI_BOOT_MODE macro isn't defined. 
>> It's define in PiBootMode.h, which gets pulled in if you use the above 
>> #include.
>> 
>> That's how I dealt with this in my code at any rate.
>> 
>> -Bill
>> 
>>> #include <Pi/PiFirmwareFile.h>
>>> #include <Library/DebugLib.h> // ASSERT_EFI_ERROR
>>> #include <Protocol/LoadedImage.h> // EFI_LOADED_IMAGE_PROTOCOL
>>> #include <Pi/PiFirmwareVolume.h>
>>> #include <Library/PcdLib.h>
>>> #include <Library/UefiLib.h>
>>> #include <Library/UefiApplicationEntryPoint.h>
>>> #include <Library/UefiBootServicesTableLib.h>
>>> #include <Library/UefiRuntimeServicesTableLib.h>
>>> #include <Protocol/FirmwareVolume.h>
>>> #include <Library/GenericBdsLib.h> // DevicePathToStr
>>> ---------
>>> <some snipped>
>>> [Packages]
>>>  MdePkg/MdePkg.dec
>>>  MdeModulePkg/MdeModulePkg.dec
>>>  IntelFrameworkPkg/IntelFrameworkPkg.dec
>>>  IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
>>> 
>>> [LibraryClasses]
>>>  UefiApplicationEntryPoint
>>>  UefiLib
>>>  PcdLib
>>> 
>>> [ Protocols ]
>>>  gEfiLoadedImageProtocolGuid
>>>  gEfiDevicePathToTextProtocolGuid
>>> 
>>> [FeaturePcd]
>>>  gEfiMdeModulePkgTokenSpaceGuid.PcdMyFindRomPrintEnable
>>> 
>>> [Pcd]
>>>  ## Valid when gEfiMdeModulePkgTokenSpaceGuid.PcdMyFindRomPrintEnable
>>>  gEfiMdeModulePkgTokenSpaceGuid.PcdMyFindRomPrintString ||
>>> gEfiMdeModulePkgTokenSpaceGuid.PcdMyFindRomPrintEnable
>>> 
>>>  ## Valid when gEfiMdeModulePkgTokenSpaceGuid.PcdMyFindRomPrintEnable
>>>  gEfiMdeModulePkgTokenSpaceGuid.PcdMyFindRomPrintTimes  ||
>>> gEfiMdeModulePkgTokenSpaceGuid.PcdMyFindRomPrintEnable
>>> ----------
>>> 
>>> This is the error:
>>> 
>>> 
>>> MyFindRom.c
>>>        "GenFw" -e UEFI_APPLICATION -o
>>> c:\fw\edk2\Build\NT32IA32\DEBUG_VS2010x86\IA32\MdeModulePkg\Application\Hel
>>> loWorld\HelloWorld\DEBUG\HelloWorld.efi c:\fw\edk2\Build\
>>> DEBUG_VS2010x86\IA32\MdeModulePkg\Application\HelloWorld\HelloWorld\DEBUG\H
>>> elloWorld.dll "C:\Program Files (x86)\Microsoft Visual Studio
>>> 10.0\Vc\bin\link.exe"
>>> /OUT:c:\fw\edk2\Build\NT32IA32\DEBUG_VS2010x86\IA32\Nt32Pkg\WinNtSimpleFile
>>> SystemDxe\WinNtSim stemDxe\DEBUG\WinNtSimpleFileSystemDxe.dll /NOLOGO
>>> /NODEFAULTLIB
>>> /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D
>>> /SECTION:.pdata,D /MACHINE:X86 /LTCG /D
>>> 
>>> :_ModuleEntryPoint /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0
>>> 
>>> /DRIVER /DEBUG /EXPORT:InitializeDriver=_ModuleEntryPoint /BASE:0x10000
>>> /ALIGN:4096 /FILEALIGN:40
>>> STEM:CONSOLE
>>> @c:\fw\edk2\Build\NT32IA32\DEBUG_VS2010x86\IA32\Nt32Pkg\WinNtSimpleFileSys
>>> temDxe\WinNtSimpleFileSystemDxe\OUTPUT\static_library_files.lst copy /y
>>> c:\fw\edk2\Build\NT32IA32\DEBUG_VS2010x86\IA32\MdeModulePkg\Application\Hel
>>> loWorld\HelloWorld\DEBUG\HelloWorld.efi
>>> c:\fw\edk2\Build\NT32IA32\DEBUG_VS2010x8
>>> eModulePkg\Application\HelloWorld\HelloWorld\OUTPUT
>>> c:\fw\edk2\IntelFrameworkModulePkg\Include\Library/GenericBdsLib.h(239) :
>>> error C2143: syntax error : missing ')' before '*'
>>> c:\fw\edk2\IntelFrameworkModulePkg\Include\Library/GenericBdsLib.h(239) :
>>> error C2143: syntax error : missing '{' before '*'
>>> c:\fw\edk2\IntelFrameworkModulePkg\Include\Library/GenericBdsLib.h(240) :
>>> error C2059: syntax error : ')'
>>> c:\fw\edk2\IntelFrameworkModulePkg\Include\Library/GenericBdsLib.h(240) :
>>> warning C4431: missing type specifier - int assumed. Note: C no longer
>>> supports default-int
>>> c:\fw\edk2\IntelFrameworkModulePkg\Include\Library/GenericBdsLib.h(240) :
>>> warning C4218: nonstandard extension used : must specify at least a storage
>>> class or a type
>>>        1 file(s) copied.
>>>        "C:\Program Files (x86)\Microsoft Visual Studio
>>> 10.0\Vc\bin\link.exe"
>>> /OUT:c:\fw\edk2\Build\NT32IA32\DEBUG_VS2010x86\IA32\Nt32Pkg\WinNtGopDxe\Win
>>> NtGopDxe\DEBUG\Win dll /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
>>> /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D
>>> /MACHINE:X86 /LTCG /DLL
>>> /ENTRY:_ModuleEntryPoint /SUBSYSTEM:
>>> SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
>>> /EXPORT:InitializeDriver=_ModuleEntryPoint /BASE:0x10000 /ALIGN:4096
>>> /FILEALIGN:4096 /SUBSYSTEM:CONSOLE  @c:\fw\edk2\Buil
>>> 2\DEBUG_VS2010x86\IA32\Nt32Pkg\WinNtGopDxe\WinNtGopDxe\OUTPUT\static_librar
>>> y_files.lst copy /y
>>> c:\fw\edk2\Build\NT32IA32\DEBUG_VS2010x86\IA32\MdeModulePkg\Application\Hel
>>> loWorld\HelloWorld\DEBUG\HelloWorld.efi
>>> c:\fw\edk2\Build\NT32IA32\DEBUG_VS2010x8
>>>   Creating library
>>> c:\fw\edk2\Build\NT32IA32\DEBUG_VS2010x86\IA32\Nt32Pkg\WinNtSimpleFileSyste
>>> mDxe\WinNtSimpleFileSystemDxe\DEBUG\WinNtSimpleFileSystemDxe.lib and object
>>> 2\Build\NT32IA32\DEBUG_VS2010x86\IA32\Nt32Pkg\WinNtSimpleFileSystemDxe\WinN
>>> tSimpleFileSystemDxe\DEBUG\WinNtSimpleFileSystemDxe.exp Generating code
>>>        1 file(s) copied.
>>> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio
>>> 10.0\Vc\bin\cl.exe"' : return code '0x2'
>>> Stop.
>>>        copy /y
>>> c:\fw\edk2\Build\NT32IA32\DEBUG_VS2010x86\IA32\MdeModulePkg\Application\Hel
>>> loWorld\HelloWorld\DEBUG\*.map
>>> c:\fw\edk2\Build\NT32IA32\DEBUG_VS2010x86\IA32\Md
>>> g\Application\HelloWorld\HelloWorld\OUTPUT
>> 
>> -- 
>> =============================================================================
>> -Bill Paul            (510) 749-2329 | Senior Member of Technical Staff,
>>                 wp...@windriver.com | Master of Unix-Fu - Wind River Systems
>> =============================================================================
>>   "I put a dollar in a change machine. Nothing changed." - George Carlin
>> =============================================================================
>> 
>> ------------------------------------------------------------------------------
>> Flow-based real-time traffic analytics software. Cisco certified tool.
>> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
>> Customize your own dashboards, set traffic alerts and generate reports.
>> Network behavioral analysis & security monitoring. All-in-one tool.
>> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/edk2-devel
> 
> 
> 
> 
> -- 
> John F. Davis
> 6 Kandes Court
> Durham, NC 27713
> 919-888-8358
> 
> 独树一帜
> 
> 
> ------------------------------------------------------------------------------
> Flow-based real-time traffic analytics software. Cisco certified tool.
> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> Customize your own dashboards, set traffic alerts and generate reports.
> Network behavioral analysis & security monitoring. All-in-one tool.
> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk_______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to