[BOOT] Add EFI headers and entry point

This commit is contained in:
2024-05-22 19:56:17 -04:00
parent 88449693d4
commit 8e7c2d02bb
15 changed files with 1395 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
/*++
Copyright (c) 2024, the LibreXP developers.
Provided under the BSD 3-Clause license.
Module Name:
entry.c
Abstract:
Boot manager entry point on EFI systems.
--*/
#include "bootmgr.h"
EFI_STATUS
EFIAPI
EfiEntry (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
/*++
Routine Description:
Boot manager entry point from EFI firmware.
Arguments:
ImageHandle - Handle for the boot manager image.
SystemTable - Pointer to the EFI system table.
Return Value:
EFI_SUCCESS if successful.
EFI_INVALID_PARAMEER if input parameter structure creation fails.
Any other value defined in efierr.h.
--*/
{
PBOOT_APPLICATION_PARAMETERS InputParameters;
//
// Create firmware-independent input structure from EFI parameters.
//
InputParameters = EfiInitCreateInputParameters(ImageHandle, SystemTable);
if (InputParameters == NULL) {
return EFI_INVALID_PARAMETER;
}
//
// Transfer control to the firmware-independent boot manager.
//
return EfiGetEfiStatusCode(BmMain(InputParameters));
}

View File

@@ -0,0 +1,44 @@
/*++
Copyright (c) 2024, the LibreXP developers.
Provided under the BSD 3-Clause license.
Module Name:
bootmgr.c
Abstract:
Main functions of the boot manager.
--*/
#include "bootmgr.h"
NTSTATUS
BmMain (
IN PBOOT_APPLICATION_PARAMETERS Parameters
)
/*++
Routine Description:
Firmware-independent boot manager entry point.
Arguments:
Parameters - 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.
--*/
{
/* TODO: Implement BmMain() */
return STATUS_SUCCESS;
}