# DxeFrb

## Function Table

| Address | Name | Description |
|---------|------|-------------|
|  | **DebugPrint** |  |
|  | **DebugAssert** |  |
|  | **ReadUnaligned64** |  |
|  | **CompareGuid** |  |
|  | **GetHobList** |  |
|  | **WchgGetState** |  |
|  | **WchgSetTimerValue** |  |
|  | **WchgSetEnableFlags** |  |
|  | **WchgSetActionFlags** |  |
|  | **WchgProgramAndArm** |  |
|  | **WchgReadBackVerify** |  |
|  | **Frb2OpromNotify** |  |
|  | **Frb2PasswordNotify** |  |
|  | **Frb2PasswordDoneNotify** |  |
|  | **Frb2PromptTimeoutNotify** |  |
|  | **Frb2PromptTimeoutDoneNotify** |  |
|  | **ShellEntryNotify** |  |
|  | **ReadyToBootCallback** |  |
|  | **BootPhaseNotify** |  |
|  | **RegisterBootEvent** |  |
|  | **RegisterReadyToBootEvent** |  |
|  | **InitializeHobList** |  |
|  | **FreePool** |  |
|  | **DxeFrbEntryPoint** |  |
| Globals | **// ============================================================================** |  |
| qword_2110 | **-- EFI_WATCHDOG_TIMER_ARCH_PROTOCOL** |  |
| qword_1CC8 | **-- HOB list pointer** |  |
| qword_1CD8 | **-- Allocated driver instance** |  |
| qword_1CC0 | **-- WCHG debug protocol** |  |
| byte_1CE6 | **BOOLEAN                   gOsWdtEnabled = FALSE;  // byte_1CEB** |  |
| byte_1CEE | **UINT16                    gOsWdtTimeout = 600;    // n600 (600 * 100ms = 60s)** |  |
| byte_1CD1 | **//** |  |
| WCHG | **timer state storage** | 3 timers * 6 bytes each (at 0x2120) |
| UINT8 | **gWchgTimerState[0x30];** |  |
| GUIDs | **used by this module** |  |
| EFI_GUID | **gEfiWatchdogTimerArchProtocolGuid  = EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID;** |  |
| Internal | **Helpers** |  |
| Read | **CMOS index 0x4B to get current debug level** |  |
| SavedCMOSIndex | **= IoRead8 (0x70);** |  |
| Normalize | **debug level** |  |
| if | **(DebugLevel > 3) {** |  |
| 0 | **or 3 => ERROR | WARN** |  |
| WCHG | **Hardware Access Layer** |  |
| Register | **index (timer state)** |  |
| Access | **type: read** |  |
| Decode | **returned data** |  |
| For | **FRB2 (timer 1), check if this is a cold boot via HOB** |  |
| if | **(TimerIndex == 1) {** |  |
| S3 | **resume** | skip |
| Prepare | **WCHG register data** |  |
| Countdown | **= *(UINT16 *)&gWchgTimerState[6 * TimerIndex];** |  |
| Countdown | **of 0 means timer is disabled** |  |
| Set | **action mask based on whether this is a full system reset** |  |
| if | **(!ResetSystem) {** |  |
| FRB2 | **action** |  |
| OS | **WDT action** |  |
| Full | **system reset action** |  |
| Write | **register data** |  |
| ResultSize | **= 6;** |  |
| Access | **type: write** |  |
| Second | **write to commit/arm** |  |
| ResultSize | **= 0;** |  |
| Access | **type: commit/arm** |  |
| Read | **hardware state** |  |
| ResultSize | **= 8;** |  |
| Timer | **is running** | verify index, sync state |
| if | **((WchgData[0] & 7) != TimerIndex) {** |  |
| Timer | **not running** | already disabled |
| DEBUG | **((DEBUG_ERROR, "%a: EfiFrb2 already disabled\n", __FUNCTION__));** |  |
| Boot | **Phase Notification Handlers** |  |
| Event | **Registration Helpers** |  |
| Driver | **Entry Point** |  |
| Status | **= gBS->LocateProtocol (** |  |
| Driver | **= AllocateZeroPool (sizeof (FRB2_DRIVER));** |  |
| Status | **= gBS->InstallProtocolInterface (** |  |
| VariableSize | **= sizeof (ServerSetup);** |  |
| Defaults | **when variable not found** |  |
| gFrb2Enabled | **= TRUE;** |  |
| 60 | **seconds (600 * 100ms)** |  |
| if | **(gFrb2Enabled) {** |  |

---
*Generated by HR650X BIOS Decompilation Project*