/* * Copyright (c) 2026, Apollo Telephone Laboratories. * Provided under the BSD-3 clause. */ #include #include #include #include #include #include #include /* Private globals */ static UINT8 *KernelBin = NULL; static PLATFORM_MEMMAP MemMap; /* Globals */ EFI_FILE_HANDLE gBootVolume; EFI_STATUS EFIAPI efi_main(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) { BOOT_ENTRY Entry; EFI_STATUS Status; InitializeLib(ImageHandle, SystemTable); /* Disable the watchdog timer */ FwiSetWatchdogTimer( 0, 0, 0, NULL ); Status = FileGetVolume(ImageHandle, &gBootVolume); if (EFI_ERROR(Status)) { Hcf(); } Print( L"SBOOT %s - %d boot entrie(s)\n", SBOOT_VERSION, NELEM(ConfigBootEntries) - 1 ); SBootMenu(&Entry); Status = FileReadToBuffer(Entry.BootPath, (VOID **)&KernelBin); if (EFI_ERROR(Status)) { Hcf(); } Status = SBootGetMemmap(&MemMap); if (EFI_ERROR(Status)) { Hcf(); } /* Get out of here! */ Status = uefi_call_wrapper( gBS->ExitBootServices, 2, ImageHandle, MemMap.MapKey ); if (EFI_ERROR(Status)) { Hcf(); } ((VOID(*)(VOID))KernelBin)(); for (;;); }