alcyone/BOOT/ENVIRON/APP/BOOTMGR/bootmgr.c

77 lines
1.4 KiB
C

/*++
Copyright (c) 2024, Quinn Stephens.
Provided under the BSD 3-Clause license.
Module Name:
bootmgr.c
Abstract:
Boot manager main routine.
--*/
#include "bootmgr.h"
NTSTATUS
BmMain (
IN PBOOT_APPLICATION_PARAMETERS ApplicationParameters
)
/*++
Routine Description:
Firmware-independent boot manager entry point.
Arguments:
ApplicationParameters - Input parameters for the boot manager.
Return Value:
Error code on failure.
Does not return on success, as control is transferred to the OS loader.
--*/
{
NTSTATUS Status;
BOOT_LIBRARY_PARAMETERS LibraryParameters;
HANDLE DataStoreHandle;
LibraryParameters.Flags = 0;
LibraryParameters.TranslationType = TRANSLATION_TYPE_NONE;
LibraryParameters.MinimumPageAllocation = 16;
//
// Initialize the boot library.
//
Status = BlInitializeLibrary(ApplicationParameters, &LibraryParameters);
if (!NT_SUCCESS(Status)) {
ConsolePrintf(L"BlInitializeLibrary() failed: 0x%x\r\n", Status);
goto Exit;
}
//
// Open the boot data store.
//
(VOID)BmOpenDataStore(&DataStoreHandle);
//
// Stop here for now.
// Later this will be used to wait for input.
//
while (TRUE) {
#if defined(__x86_64__) || defined(__i386__)
asm volatile("hlt");
#endif
}
Exit:
BlDestroyLibrary();
return Status;
}