Skip to content

Commit a9f5722

Browse files
committed
BIOS (OpenBSD): check bios type
1 parent 0952d79 commit a9f5722

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/detection/bios/bios_windows.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ typedef struct _SYSTEM_BOOT_ENVIRONMENT_INFORMATION
2727
};
2828
};
2929
} SYSTEM_BOOT_ENVIRONMENT_INFORMATION;
30+
#elif __OpenBSD__
31+
#include "common/io/io.h"
32+
33+
#include <fcntl.h>
34+
#include <unistd.h>
3035
#endif
3136

3237
typedef struct FFSmbiosBios
@@ -89,9 +94,12 @@ const char* ffDetectBios(FFBiosResult* bios)
8994
default: break;
9095
}
9196
}
92-
#elif __HAIKU__ || __OpenBSD__
97+
#elif __HAIKU__
9398
// Currently SMBIOS detection is supported in legency BIOS only
9499
ffStrbufSetStatic(&bios->type, "BIOS");
100+
#elif __OpenBSD__
101+
FF_AUTO_CLOSE_FD int fd = open("/dev/efi", O_RDONLY);
102+
ffStrbufSetStatic(&bios->type, fd >= 0 ? "UEFI" : "BIOS");
95103
#endif
96104

97105
return NULL;

0 commit comments

Comments
 (0)