diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-04-25 10:21:19 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-04-25 10:21:19 +0200 |
| commit | 8b46ad6f40df85c1939196f0f75e46d212193756 (patch) | |
| tree | 6e13a8d54332bcb583cf5c798a28ede5aa9aee30 | |
| parent | 4b7ec5d5d2351f47f3ce423147b956247997d532 (diff) | |
MHR-16: Prevent other EFI from booting.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
| -rw-r--r-- | Private/FirmwareKit/EFI/API.hxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Private/FirmwareKit/EFI/API.hxx b/Private/FirmwareKit/EFI/API.hxx index 0e2ef200..093d10b3 100644 --- a/Private/FirmwareKit/EFI/API.hxx +++ b/Private/FirmwareKit/EFI/API.hxx @@ -121,6 +121,13 @@ inline void InitEFI(EfiSystemTable *SystemTable) noexcept { ST->BootServices->SetWatchdogTimer(0, 0, 0, nullptr); ST->ConOut->EnableCursor(ST->ConOut, false); + + if (ST->FirmwareVendor[0] != '@' || + ST->FirmwareVendor[1] != 'M' || + ST->FirmwareVendor[1] != 'H' || + ST->FirmwareVendor[1] != 'R') { + EFI::ThrowError(L"Unsupported Firmware", L"Firmware is unsupported, please build OVMF by yourself."); + } } #ifdef __BOOTLOADER__ |
