Panic message if OpenRuntime is wrong.

OC version.
This commit is contained in:
jief666 2021-09-25 13:02:47 +03:00
parent 0bca61ad3d
commit f70da719e5
3 changed files with 25 additions and 1 deletions

@ -1 +1 @@
Subproject commit c8e7ee0a48ff20c7e50898a2d03f6c7592458c36
Subproject commit 93feac4ed96bad9bb54a817e24426241e1df1d5f

View File

@ -25,6 +25,7 @@ extern "C" {
#include <Library/OcMainLib.h> // OcMiscEarlyInit
//#include <Protocol/OcBootstrap.h> // OC_BOOTSTRAP_PROTOCOL
#include <Library/OcBootManagementLib/BootManagementInternal.h>
#include <Library/OcAfterBootCompatLib/BootCompatInternal.h>
#include <Guid/AppleApfsInfo.h>

View File

@ -1189,6 +1189,29 @@ void LOADER_ENTRY::StartLoader()
if ( !EFI_ERROR(Status) ) {
Status = gBS->StartImage(DriverHandle, 0, 0);
DBG("Start '%ls' : Status %s\n", OpenRuntimeEfiName.wc_str(), efiStrError(Status));
if ( !EFI_ERROR(Status) )
{
OC_FIRMWARE_RUNTIME_PROTOCOL *FwRuntime;
Status = gBS->LocateProtocol (
&gOcFirmwareRuntimeProtocolGuid,
NULL,
(VOID **) &FwRuntime
);
if (!EFI_ERROR (Status)) {
if (FwRuntime->Revision == OC_FIRMWARE_RUNTIME_REVISION) {
} else {
DEBUG ((
DEBUG_ERROR,
"OCABC: Incompatible OpenRuntime r%u, require r%u\n",
(UINT32) FwRuntime->Revision,
(UINT32) OC_FIRMWARE_RUNTIME_REVISION
));
panic("Incompatible OpenRuntime r%llu, require r%u\n", FwRuntime->Revision, OC_FIRMWARE_RUNTIME_REVISION);
}
}
}
}else{
panic("Error when loading '%ls' : Status %s.\n", OpenRuntimeEfiName.wc_str(), efiStrError(Status));
}