[BOOT] Add boot manager headers
This commit is contained in:
parent
1f041b4444
commit
d2c2ba65ea
@ -14,6 +14,7 @@ Abstract:
|
|||||||
--*/
|
--*/
|
||||||
|
|
||||||
#include "bootmgr.h"
|
#include "bootmgr.h"
|
||||||
|
#include "efilib.h"
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
|
@ -38,7 +38,9 @@ Return Value:
|
|||||||
--*/
|
--*/
|
||||||
|
|
||||||
{
|
{
|
||||||
/* TODO: Implement BmMain() */
|
(VOID)Parameters;
|
||||||
|
|
||||||
|
/* Not implemented */
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
34
BOOT/ENVIRON/INC/bootmgr.h
Normal file
34
BOOT/ENVIRON/INC/bootmgr.h
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/*++
|
||||||
|
|
||||||
|
Copyright (c) 2024, Quinn Stephens.
|
||||||
|
Provided under the BSD 3-Clause license.
|
||||||
|
|
||||||
|
Module Name:
|
||||||
|
|
||||||
|
bootmgr.h
|
||||||
|
|
||||||
|
Abstract:
|
||||||
|
|
||||||
|
Boot manager definitions.
|
||||||
|
|
||||||
|
--*/
|
||||||
|
|
||||||
|
#ifndef _BOOTMGR_H
|
||||||
|
#define _BOOTMGR_H
|
||||||
|
|
||||||
|
#include <nt.h>
|
||||||
|
|
||||||
|
#define BOOT_APPLICATION_PARAMETERS_SIGNATURE 0x50504120544f4f42 /* "BOOT APP" */
|
||||||
|
#define BOOT_APPLICATION_PARAMETERS_VERSION 2
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
ULONGLONG Signature;
|
||||||
|
ULONG Version;
|
||||||
|
} BOOT_APPLICATION_PARAMETERS, *PBOOT_APPLICATION_PARAMETERS;
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
BmMain (
|
||||||
|
IN PBOOT_APPLICATION_PARAMETERS Parameters
|
||||||
|
);
|
||||||
|
|
||||||
|
#endif
|
34
BOOT/ENVIRON/INC/efilib.h
Normal file
34
BOOT/ENVIRON/INC/efilib.h
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/*++
|
||||||
|
|
||||||
|
Copyright (c) 2024, Quinn Stephens.
|
||||||
|
Provided under the BSD 3-Clause license.
|
||||||
|
|
||||||
|
Module Name:
|
||||||
|
|
||||||
|
efilib.h
|
||||||
|
|
||||||
|
Abstract:
|
||||||
|
|
||||||
|
Boot manager EFI library definitions.
|
||||||
|
|
||||||
|
--*/
|
||||||
|
|
||||||
|
#ifndef _EFILIB_H
|
||||||
|
#define _EFILIB_H
|
||||||
|
|
||||||
|
#include <nt.h>
|
||||||
|
#include "bootmgr.h"
|
||||||
|
#include "efi.h"
|
||||||
|
|
||||||
|
PBOOT_APPLICATION_PARAMETERS
|
||||||
|
EfiInitCreateInputParameters (
|
||||||
|
IN EFI_HANDLE ImageHandle,
|
||||||
|
IN EFI_SYSTEM_TABLE *SystemTable
|
||||||
|
);
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EfiGetEfiStatusCode (
|
||||||
|
IN NTSTATUS Status
|
||||||
|
);
|
||||||
|
|
||||||
|
#endif
|
58
BOOT/ENVIRON/LIB/EFI/efiinit.c
Normal file
58
BOOT/ENVIRON/LIB/EFI/efiinit.c
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
/*++
|
||||||
|
|
||||||
|
Copyright (c) 2024, Quinn Stephens.
|
||||||
|
Provided under the BSD 3-Clause license.
|
||||||
|
|
||||||
|
Module Name:
|
||||||
|
|
||||||
|
efiinit.c
|
||||||
|
|
||||||
|
Abstract:
|
||||||
|
|
||||||
|
Provides EFI initialization utilities.
|
||||||
|
|
||||||
|
--*/
|
||||||
|
|
||||||
|
#include "bootmgr.h"
|
||||||
|
#include "efi.h"
|
||||||
|
|
||||||
|
UCHAR EfiInitScratch[2048];
|
||||||
|
|
||||||
|
PBOOT_APPLICATION_PARAMETERS
|
||||||
|
EfiInitCreateInputParameters (
|
||||||
|
IN EFI_HANDLE ImageHandle,
|
||||||
|
IN EFI_SYSTEM_TABLE *SystemTable
|
||||||
|
)
|
||||||
|
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
|
||||||
|
Creates the input parameter structure for the boot application.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
ImageHandle - Handle for the boot manager image.
|
||||||
|
|
||||||
|
SystemTable - Pointer to the EFI system table.
|
||||||
|
|
||||||
|
Return Value:
|
||||||
|
|
||||||
|
Pointer to parameter structure on success or NULL on failure.
|
||||||
|
|
||||||
|
--*/
|
||||||
|
|
||||||
|
{
|
||||||
|
ULONG ScratchUsed = 0;
|
||||||
|
PBOOT_APPLICATION_PARAMETERS InputParameters;
|
||||||
|
|
||||||
|
(VOID)ImageHandle;
|
||||||
|
(VOID)SystemTable;
|
||||||
|
|
||||||
|
InputParameters = (PBOOT_APPLICATION_PARAMETERS)(&EfiInitScratch[ScratchUsed]);
|
||||||
|
InputParameters->Signature = BOOT_APPLICATION_PARAMETERS_SIGNATURE;
|
||||||
|
InputParameters->Version = BOOT_APPLICATION_PARAMETERS_VERSION;
|
||||||
|
ScratchUsed += sizeof(BOOT_APPLICATION_PARAMETERS);
|
||||||
|
|
||||||
|
return InputParameters;
|
||||||
|
}
|
@ -14,6 +14,7 @@ Abstract:
|
|||||||
--*/
|
--*/
|
||||||
|
|
||||||
#include "bootmgr.h"
|
#include "bootmgr.h"
|
||||||
|
#include "efi.h"
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EfiGetEfiStatusCode (
|
EfiGetEfiStatusCode (
|
||||||
|
Loading…
Reference in New Issue
Block a user