From a9f5722fd9dfc76bbded9540324d368f0e64f938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sun, 23 Mar 2025 11:31:03 +0800 Subject: [PATCH] BIOS (OpenBSD): check bios type --- src/detection/bios/bios_windows.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/detection/bios/bios_windows.c b/src/detection/bios/bios_windows.c index 1e22b9a6b..d9bc16dd3 100644 --- a/src/detection/bios/bios_windows.c +++ b/src/detection/bios/bios_windows.c @@ -27,6 +27,11 @@ typedef struct _SYSTEM_BOOT_ENVIRONMENT_INFORMATION }; }; } SYSTEM_BOOT_ENVIRONMENT_INFORMATION; +#elif __OpenBSD__ +#include "common/io/io.h" + +#include +#include #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;