diff --git a/xCAT-server/share/xcat/netboot/windows/detectefi.cpp b/xCAT-server/share/xcat/netboot/windows/detectefi.cpp new file mode 100755 index 000000000..0ae0db057 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/windows/detectefi.cpp @@ -0,0 +1,19 @@ +/* Compile this with cl.exe from MS SDK, e.g. 'cl efidetect.cpp', that is all. */ +/* IBM(c) 2011 EPL license http://www.eclipse.org/legal/epl-v10.html */ + +#include +#include + + +int main(int argc, char* argv[]) +{ + GetFirmwareEnvironmentVariableA("","{00000000-0000-0000-0000-000000000000}",NULL,0); + if (GetLastError() == ERROR_INVALID_FUNCTION) { // This.. is.. LEGACY BIOOOOOOOOS.... + printf("Legacy"); + return 1; + } else { + printf("UEFI"); + return 0; + } + return 0; +} diff --git a/xCAT-server/share/xcat/netboot/windows/detectefi.exe b/xCAT-server/share/xcat/netboot/windows/detectefi.exe new file mode 100755 index 000000000..5844afd3c Binary files /dev/null and b/xCAT-server/share/xcat/netboot/windows/detectefi.exe differ