Newer
Older
AMI-Aptio-BIOS-Reversed / LenovoServerPkg / POSTStatus / LnvDxeStatusCode / LnvDxeStatusCode.md
@Ajax Dong Ajax Dong 2 days ago 3 KB Restructure the repo

LnvDxeStatusCode

Function Table

Address Name Description
ReportStatusCodeFiltered
DebugAssertViaProtocol
ReadUnaligned64
IsHobListGuid
LocateRuntimeStatusCodeProtocol
OnExitBootServicesClearBs
OnExitBootServicesConvertLenovo
RuntimeProtocolNotifyNop
OnExitBootServicesConvertReg
OnExitBootServicesConvertRuntime
OnVirtualAddressChange
DriverSetupInit
LnvDxeStatusCodeEntryPoint
Custom Lenovo Status Code Protocol (0x3000):
gEfiStatusCodeRuntimeProtocolGuid (0x3010) from MdeModulePkg.
gEfiHobListGuid (0x3020) from MdePkg.
gEfiEventExitBootServicesGuid (0x3030).
gEfiEventVirtualAddressChangeGuid (0x3040).
Lenovo custom protocol vtable layout
offset +0x00
offset +0x08
Global variables
0x3060 EFI_SYSTEMTABLE *gSystemTable = NULL; // 0x3050
0x3058 EFI_RUNTIMESERVICES *gRuntimeServices = NULL; // 0x3068
0x3070 VOID *gRegClearBs_ = NULL; // 0x3080
0x3088 VOID *gLenovoProtocol_ = NULL; // 0x3090
0x3098 BOOLEAN gRuntimeInitDone_ = FALSE; // 0x30A0
0x30A8 VOID *gRegVirtAddrChange_ = NULL; // 0x30B8
0x30C0 VOID *gRuntimeServicesReg_ = NULL; // 0x30D0
0x30D8 //
GUID constants in .data section
STATIC CONST GUID mStatusCodeProtocolGuid = LENOVO_STATUS_CODE_PROTOCOL_GUID;
CMOS debug register definitions
Status code severity masks
Forward declarations
ReadUnaligned64 (0x179C) read a UINT64 from memory
IsHobListGuid (0x172C) compare a HOB UUID to gEfiHobListGuid
GetHobListFromConfigTable (0x159C) find the HOB list in the
SystemTable configuration table
Config table entry: GUID (16 bytes) + VendorTable (8 bytes) = 24 bytes.
if (IsHobListGuid ((EFI_GUID )(&EntryPtr[Index 3]))) {
ReportStatusCodeFiltered (
GetLenovoStatusCodeProtocol (0x1420) locate the custom Lenovo protocol
Status = gBootServicesBs_->AllocatePool (EfiBootServicesData, 31, &Pool);
ReportStatusCodeFiltered (0x14A8) CMOS-gated status code report
Read debug level from CMOS register 0x4B.
Preserve NMI bit (0x80) in the index byte.
CmosIdx **= (UINT8)(IoRead8 (CMOS_PORT_INDEX) & CMOS_NMI_MASK) CMOS_DEBUG_REG;**
Build severity filter mask from the debug level.
Level 0 -> silent (all filtered)
Level 1 -> errors only (0xC0000000)
Level 2 -> + warnings (0x80000000)
Level 3 -> all severities
SeverityFilter = REPORT_SEVERITY_ERROR;
DebugAssertViaProtocol (0x1528) forward ASSERT via the Lenovo protocol
LocateRuntimeStatusCodeProtocol (0x168C)
Event callbacks
sub_1568 (0x1568) clear the boot-services pointer on ExitBootServices.
VOID EFIAPI
sub_1574 (0x1574) convert the Lenovo protocol pointer on ExitBS.
sub_1674 (0x1674) NOP protocol notification.
sub_1678 (0x1678) convert RuntimeServices notification registration.
sub_16EC (0x16EC) convert runtime protocol ptr on ExitBS/VAC.
sub_1714 (0x1714) re-locate runtime protocol + set init done flag.
DriverSetupInit (0x10F4) main initialisation
gImageHandle_ = ImageHandle;
GetHobListFromConfigTable ();
Status = gBootServicesBs_->RegisterProtocolNotify (
_ModuleEntryPoint (0x10D0)

Generated by HR650X BIOS Decompilation Project