exectos/xtldr/modules/dummy/dummy.c
Rafal Kupiec 4412d4fc98
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 1m1s
Builds / ExectOS (i686) (push) Successful in 29s
Rewrite core of the XTLDR boot loader
Reviewed-on: #7
Reviewed-by: Piotr Likoski <likoski@noreply.codingworkshop.git>
Co-authored-by: Rafal Kupiec <belliash@codingworkshop.eu.org>
Co-committed-by: Rafal Kupiec <belliash@codingworkshop.eu.org>
2024-01-09 18:51:04 +01:00

70 lines
1.7 KiB
C

/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtldr/modules/dummy/dummy.c
* DESCRIPTION: XTLDR Dummy Module
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
*/
#include <dummy.h>
/* Dummy module information */
XTBL_MODINFO = L"XTLDR Dummy Module";
/**
* Stub boot routine.
*
* @param Parameters
* Supplies all parameters associated with the chosen boot menu entry.
*
* @return This routine returns a status code.
*
* @since XT 1.0
*/
XTCDECL
EFI_STATUS
BlBootDummyOS(IN PXTBL_BOOT_PARAMETERS Parameters)
{
return STATUS_EFI_SUCCESS;
}
/**
* This routine is the entry point of the XT EFI boot loader module.
*
* @param ImageHandle
* Firmware-allocated handle that identifies the image.
*
* @param SystemTable
* Provides the EFI system table.
*
* @return This routine returns a status code.
*
* @since XT 1.0
*/
XTCDECL
EFI_STATUS
XtLdrModuleMain(IN EFI_HANDLE ImageHandle,
IN PEFI_SYSTEM_TABLE SystemTable)
{
EFI_GUID DummyGuid = XT_XTOS_BOOT_PROTOCOL_GUID;
EFI_STATUS Status;
/* Open the XTLDR protocol */
Status = BlGetXtLdrProtocol(SystemTable, ImageHandle, &XtLdrProto);
if(Status != STATUS_EFI_SUCCESS)
{
/* Failed to open the protocol, return error */
return STATUS_EFI_PROTOCOL_ERROR;
}
/* Set boot protocol routines */
BlpDummyProtocol.BootSystem = BlBootDummyOS;
/* Register XTOS boot protocol */
XtLdrProto->Boot.RegisterProtocol(L"XTOS", &DummyGuid);
/* Register DUMMY protocol as XTOS boot protocol */
return XtLdrProto->Protocol.Install(&BlpDummyProtocol, &DummyGuid);
}