Re: [edk2] UEFI drivers dependency and ExitBootServices() event limitations

Subject: Re: [edk2] UEFI drivers dependency and ExitBootServices() event limitations

From: Felipe Martins <ffmmjj@gmail.com>

To: Andrew Fish <afish@apple.com>

Date: 2013-07-19 00:09:07

Thank you so much, that's exactly what we needed! :D


2013/7/18 Andrew Fish <afish@apple.com>
It is possible to use gBS->CreateEventEx() to register for an EFI_EVENT_GROUP_READY_TO_BOOT to know that the system is about to attempt to boot. This is generally used to complete tables needed for the OS handoff.

It is possible to gBS->RegisterProtocolNotify() for EFI_LOADED_IMAGE_PROTOCOL to know when an image is loaded.

Thanks,

Andrew Fish


On Jul 18, 2013, at 11:28 AM, Felipe Martins <ffmmjj@gmail.com> wrote:

Hello everyone,

My team needs to implement an UEFI driver(A service driver, to be precise) that exports a few functions and consumes the protocols from a third-party UEFI driver to execute a relatively complex routine. This latter routine shouldpreferablybe executed after all the other UEFI images are loaded during the boot(I can't detail why this is so). Given these constraints, We've come to the following points:


  • We could execute the routine in the driver entry point: however, there are no guarantees that the third-party driver protocol will be available when our driver is loaded(since it's not possible to specify dependencies among UEFI drivers);
  • We could register the routine as a notification function for anEVT_SIGNAL_EXIT_BOOT_SERVICESevent: this would guarantee that our driver is loaded after the third-party one and would address the preference mentioned in the previous paragraph, but it imposes the serious limitation of not being able to use Memory Allocation services in this routine, which makes it impossible to be implemented, in practice. As far as I understood from the specs, there are also no guarantees that the third-party driver will still be in memory when the routine is called.
So, here comes my doubt: is it possible to, somehow, specify a dependency among UEFI drivers(i.e, to guarantee that one driver is loaded before the other)? Also, are there any workarounds to the issues raised about using theEVT_SIGNAL_EXIT_BOOT_SERVICESevent?

Thanks in advance,

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel