[BOOT] Add EFI headers and entry point
This commit is contained in:
60
BOOT/ENVIRON/APP/BOOTMGR/EFI/efientry.c
Normal file
60
BOOT/ENVIRON/APP/BOOTMGR/EFI/efientry.c
Normal 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));
|
||||
}
|
44
BOOT/ENVIRON/APP/BOOTMGR/bootmgr.c
Normal file
44
BOOT/ENVIRON/APP/BOOTMGR/bootmgr.c
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user