diff --git a/EfiClock/UefiMain.c b/EfiClock/UefiMain.c index b2c28f2..1ade1ca 100644 --- a/EfiClock/UefiMain.c +++ b/EfiClock/UefiMain.c @@ -29,21 +29,20 @@ static inline void drawRectangle(UINT32 x, UINT32 y, UINT32 w, UINT32 h, UINT32 EFI_STATUS EFIAPI UefiEntry(IN EFI_HANDLE imgHandle, IN EFI_SYSTEM_TABLE* sysTable) { gST = sysTable; - gBS = sysTable->BootServices; - gImageHandle = imgHandle; + gBS = gST->BootServices; gBS->SetWatchdogTimer(0, 0, 0, NULL); - EFI_STATUS status = 0; + EFI_STATUS Status = 0; /** * GOP Setup */ - status = gBS->LocateProtocol(&gop_guid, NULL, (VOID **)&Gop); - if (EFI_ERROR(status)) { - Print(u"\r\nERROR: %x; Cannot locate GOP protocol. Return.\r\n", status); - return status; + Status = gBS->LocateProtocol(&gop_guid, NULL, (VOID **)&Gop); + if (EFI_ERROR(Status)) { + Print(u"\r\nERROR: %x; Cannot locate GOP protocol. Return.\r\n", Status); + return Status; } Gop_FrameBufferBase = Gop->Mode->FrameBufferBase; @@ -85,8 +84,12 @@ EFI_STATUS EFIAPI UefiEntry(IN EFI_HANDLE imgHandle, IN EFI_SYSTEM_TABLE* sysTab UINTN EventIndex = 0; EFI_EVENT Event = NULL; - status = gBS->CreateEvent(EVT_TIMER, TPL_CALLBACK, (EFI_EVENT_NOTIFY)NULL, (VOID*)NULL, &Event); - status = gBS->SetTimer(Event, TimerPeriodic, 1e6); + Status = gBS->CreateEvent(EVT_TIMER, TPL_CALLBACK, (EFI_EVENT_NOTIFY)NULL, (VOID*)NULL, &Event); + Status = gBS->SetTimer(Event, TimerPeriodic, 1e6); + if (EFI_ERROR(Status)) { + Print(u"\r\nERROR: %x; Unable to set timer. Return.\r\n", Status); + return Status; + } while(1) {