diff options
Diffstat (limited to 'core')
| -rw-r--r-- | core/sboot.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/core/sboot.c b/core/sboot.c new file mode 100644 index 0000000..e0b2387 --- /dev/null +++ b/core/sboot.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2026, Apollo Telephone Laboratories. + * Provided under the BSD-3 clause. + */ + +#include <efi.h> +#include <efilib.h> +#include <sboot/sboot.h> +#include <sboot/config.h> + +EFI_STATUS +EFIAPI +efi_main(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) +{ + UINTN NrBootEntries; + BOOT_PROTOCOL LastProtocol; + + InitializeLib(ImageHandle, SystemTable); + NrBootEntries = NELEM(ConfigBootEntries); + + /* Ensure the list is terminated */ + LastProtocol = ConfigBootEntries[NrBootEntries - 1].Protocol; + if (LastProtocol != PROTOCOL_END) { + Print(L"fatal: boot entry list not terminated\n"); + Hcf(); + } + + Print( + L"SBOOT %s - %d boot entrie(s)\n", + SBOOT_VERSION, + NELEM(ConfigBootEntries) - 1 + ); + + for (;;); +} |
