> On Apr 7, 2015, at 1:46 PM, Carsey, Jaben <jaben.car...@intel.com> wrote:
> 
> I think you’re right that there is no ideal event for your purpose.
>  
> I don’t know what the guaranteed behavior is for BDS and DRIVER#### 
> variables.  What about using BOOT#### variables to launch your app?  This 
> would also mean you’re running at TPL_APPLICATION.
>  

Why not just add a driver to the ROM to do this? Connect the network stack on 
driver entry and download the data. Server the data on the event. 

The Network Stack drivers don’t have a Depex, so they depend on all the 
architectural protocols being present. If you place your driver in the FV after 
the network stack drivers the entry point will be called after all the network 
stack driver binding protocols have been registered. Note: This depends on an 
implementation artifact on how the dispatcher works (early location in FV 
breaks ties when it comes to dispatch order), but it sounds like this is a tool 
for debugging so no big deal. 

Thanks,

Andrew Fish

> From: Olivier Martin [mailto:olivier.mar...@arm.com 
> <mailto:olivier.mar...@arm.com>] 
> Sent: Tuesday, April 07, 2015 11:18 AM
> To: edk2-devel@lists.sourceforge.net <mailto:edk2-devel@lists.sourceforge.net>
> Subject: Re: [edk2] Downloading a file from the network before starting BDS - 
> TPL issue
>  
> The network stack is guarantee to be loaded (but not started) before my ideal 
> event (which is before the EFI OS Loader is started).
> The EFI OS Loader is likely to be loaded from the EFI System partition that 
> might not have any link with the network stack.
>  
> And ideally I would like this ideal event to be the same when my ACPI/FDT 
> file is loaded from any other supported media (eg: a removable device).
>  
>  
> From: Carsey, Jaben [mailto:jaben.car...@intel.com 
> <mailto:jaben.car...@intel.com>] 
> Sent: 07 April 2015 19:07
> To: edk2-devel@lists.sourceforge.net <mailto:edk2-devel@lists.sourceforge.net>
> Subject: Re: [edk2] Downloading a file from the network before starting BDS - 
> TPL issue
>  
> Is the network stack guaranteed to be installed before your ideal event or 
> are you doing the install of it?
>  
> -Jaben
>  
> From: Olivier Martin [mailto:olivier.mar...@arm.com 
> <mailto:olivier.mar...@arm.com>] 
> Sent: Tuesday, April 07, 2015 10:31 AM
> To: edk2-devel@lists.sourceforge.net <mailto:edk2-devel@lists.sourceforge.net>
> Subject: [edk2] Downloading a file from the network before starting BDS - TPL 
> issue
> Importance: High
>  
> Hello,
> I am trying to solve a TPL issue…
>  
> Use Case: Download ACPI tables (actually it is the Device Tree but the 
> principle is the same) from the network before BDS is started for enabling 
> developers to work on his ACPI/FDT tables on his host machine. The path of 
> the file is defined by a UEFI Device Path.
>  
> My current design was to make the ACPI/FDT Platform driver waiting for the PI 
> signal EndOfDxe 
> (https://github.com/tianocore/edk2/blob/master/EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.c#L124
>  
> <https://github.com/tianocore/edk2/blob/master/EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.c#L124>).
>  And to download the file(s) when this event is signalled 
> (https://github.com/tianocore/edk2/blob/master/EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.c#L204
>  
> <https://github.com/tianocore/edk2/blob/master/EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.c#L204>).
>  
> The issue with this design is the EndOfDxe event is called at TPL_CALLBACK. 
> And the DHCP & TFTP stack cannot be initialized at TPL_CALLBACK 
> (https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c#L824
>  
> <https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c#L824>).
>  
> I can see few solutions to solve my issue but I do not like none of them L:
> -          Solution A: Encapsulate the use case in an EFI application/Driver 
> that would be invoked by the user in BDS (either in the EFI Shell or as a 
> Driver#### boot entry)
> Drawback: it means the user has to do a specific action for this use case.
>  
> -          Solution B: Replace EnfOfDxe event to use a dummy EFI protocol 
> that would be installed by the BDS
> Drawback: it means the mechanism must be implemented in every BDS. While I am 
> looking for a generic solution.
>  
> -          Solution C: Return an error saying the UEFI specification does not 
> allow this use case.
> Drawback: So what is the alternative? Changing the spec?
>  
> -          Solution D: Change my implementation to download a file from TFTP 
> and make the implementation non-blocking/asynchronous when called at 
> TPL_CALLBACK.
> Drawback: it makes the implementation much more complicated to maintain. And 
> I cannot guarantee the file is downloaded when the BDS is started.
>  
> Any comment/suggestion?
>  
> Thanks,
> Olivier
> 
> -- IMPORTANT NOTICE: The contents of this email and any attachments are 
> confidential and may also be privileged. If you are not the intended 
> recipient, please notify the sender immediately and do not disclose the 
> contents to any other person, use it for any purpose, or store or copy the 
> information in any medium. Thank you.
> 
> ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, 
> Registered in England & Wales, Company No: 2557590
> ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, 
> Registered in England & Wales, Company No: 2548782
> 
> -- IMPORTANT NOTICE: The contents of this email and any attachments are 
> confidential and may also be privileged. If you are not the intended 
> recipient, please notify the sender immediately and do not disclose the 
> contents to any other person, use it for any purpose, or store or copy the 
> information in any medium. Thank you.
> 
> ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, 
> Registered in England & Wales, Company No: 2557590
> ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, 
> Registered in England & Wales, Company No: 2548782
> ------------------------------------------------------------------------------
> BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
> Develop your own process in accordance with the BPMN 2 standard
> Learn Process modeling best practices with Bonita BPM through live exercises
> http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- 
> <http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual-> event?utm_
> source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF_______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net <mailto:edk2-devel@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/edk2-devel 
> <https://lists.sourceforge.net/lists/listinfo/edk2-devel>
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to