On Aug 21, 2014, at 12:12 PM, Bruce Cran <bruce.c...@gmail.com> wrote:

> On 8/21/2014 12:38 AM, Dong, Eric wrote:
>> As well as I understand that HII was introduced in EFI 2.1 specification 
>> revision. So how should the cases be handled when the driver is loaded in 
>> revisions of EFI that are lower then 2.1?
>> [[[Eric]]] in this case, I suggest you do driver build with the same system 
>> version, else, just like this case, some protocol maybe not find and driver 
>> can't run.
> 
> I've been wondering how people solve the problem of having a driver 
> support features from newer UEFI specifications but continue to work on 
> older systems.
> 
> Coming from a Windows background, is there some mechanism similar to 
> LoadLibrary() and GetProcAddress() to detect and conditionally load 
> libraries at runtime?  

All the edk2 libraries are statically linked. There is no dynamic linking in 
EFI. In EFI you call protocols to call code you are not linked against. 

You can write code that checks for the protocols existence and if it is not 
present fall back to an older one. 

The “real world” problem you run into is if you use an edk2 library that 
assumes UEFI 2.3 or >, and it fails on an older system. The only solution would 
be to make another instance of the library that falls back to the older 
version. 

Thanks,

Andrew Fish

> Or is the solution simply to have multiple driver 
> builds - for UEFI 2.1, 2.3, 2.4 etc.?  If so, which build do you use for 
> the optrom - or is there a solution using some sort of custom loader 
> binary that runs the best driver that's in rom?
> 
> -- 
> Bruce
> 
> ------------------------------------------------------------------------------
> Slashdot TV.  
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to