summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorIan M. <ian@aptel.org>2026-09-11 03:45:03 +0000
committerIan M. <ian@aptel.org>2026-09-11 03:46:03 +0000
commit4f97daf67e0baaf64251b5643af5c9552c522156 (patch)
treea9a45abcf288fa538b03fb566d2ee5c069b2af4e /core
initial commit
Signed-off-by: Ian M. <ian@aptel.org>
Diffstat (limited to 'core')
-rw-r--r--core/sboot.c35
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 (;;);
+}