exectos/xtldr2/modules/dummy/dummy.c
Rafal Kupiec 09ca6dace9
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 27s
Builds / ExectOS (i686) (push) Successful in 27s
Implement BlRegisterProtocol() routine
2024-01-01 19:27:51 +01:00

67 lines
1.6 KiB
C

/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtldr/modules/dummy/dummy.c
* DESCRIPTION: Dummy XTLDR module
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
*/
#include <xtblapi.h>
/* Dummy module information */
XTBL_MODINFO = L"Dummy XTLDR module";
// XTBL_MODDEPS = {L"dummy2"};
/* XTLDR protocol handler */
PXTBL_LOADER_PROTOCOL XtLdrProto;
/* Dummy Boot Protocol handler */
XTBL_BOOT_PROTOCOL DummyProtocol;
XTCDECL
EFI_STATUS
BootDummyOS(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 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_LOAD_ERROR;
}
/* Set boot protocol routines */
DummyProtocol.BootSystem = BootDummyOS;
/* Register XTOS boot protocol */
XtLdrProto->Boot.RegisterProtocol(L"XTOS", &DummyGuid);
/* Register DUMMY protocol as XTOS boot protocol */
return XtLdrProto->Protocol.Register(&DummyGuid, &DummyProtocol);
}