BIOS (OpenBSD): check bios type

This commit is contained in:
李通洲
2025-03-23 11:31:03 +08:00
parent 0952d7917f
commit a9f5722fd9
+9 -1
View File
@@ -27,6 +27,11 @@ typedef struct _SYSTEM_BOOT_ENVIRONMENT_INFORMATION
};
};
} SYSTEM_BOOT_ENVIRONMENT_INFORMATION;
#elif __OpenBSD__
#include "common/io/io.h"
#include <fcntl.h>
#include <unistd.h>
#endif
typedef struct FFSmbiosBios
@@ -89,9 +94,12 @@ const char* ffDetectBios(FFBiosResult* bios)
default: break;
}
}
#elif __HAIKU__ || __OpenBSD__
#elif __HAIKU__
// Currently SMBIOS detection is supported in legency BIOS only
ffStrbufSetStatic(&bios->type, "BIOS");
#elif __OpenBSD__
FF_AUTO_CLOSE_FD int fd = open("/dev/efi", O_RDONLY);
ffStrbufSetStatic(&bios->type, fd >= 0 ? "UEFI" : "BIOS");
#endif
return NULL;