On 09/09/14 21:52, [email protected] wrote: > *Dell - Internal Use - Confidential *
(not very confidential...) > I would like to know if there is a way from the EFI shell to determine > if this is a 32-bit or 64-bit environment. > > For the most part, I am using BOOTX64.efi. > > However, it would be nice to be able to gracefully handle the situation > where BOOTIA32.efi was used. > > For example, let’s say I have a home grown utility that has a 32-bit and > a 64-bit efi file. How do I determine which one to use from an nsh script? When in doubt, use brute force, I guess. Start the 64-bit variant, and if it fails, start the 32-bit one. LoadImage() won't let you load a binary with incorrect bitness (or another architecture mismatch). IIRC the return value in this case is EFI_UNSUPPORTED. Granted, this might not allow you to tell apart genuine error exits of the application from "failed to load due to wrong bitness". For that case, write an empty application (one that returns with success from main() immediately), and use the brute force approach on those -- they can't really fail due to any other reason than wrong bitness. Then key off the real application's selection from this result. Just my 2 cents. Laszlo ------------------------------------------------------------------------------ Want excitement? Manually upgrade your production database. When you want reliability, choose Perforce. Perforce version control. Predictably reliable. http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
