Replace obsolete bootloader code, since new one can already start XTOS kernel
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 27s
Builds / ExectOS (i686) (push) Successful in 28s

This commit is contained in:
2024-01-04 22:47:40 +01:00
parent 297ac1acf6
commit 2f8820a021
65 changed files with 927 additions and 6751 deletions

View File

@@ -0,0 +1,27 @@
# XT Boot Loader
PROJECT(XTLDR_DUMMY)
# Specify include directories
include_directories(
${EXECTOS_SOURCE_DIR}/sdk/xtdk
${XTLDR_DUMMY_SOURCE_DIR}/includes)
# Specify list of source code files
list(APPEND XTLDR_DUMMY_SOURCE
${XTLDR_DUMMY_SOURCE_DIR}/dummy.c
${XTLDR_DUMMY_SOURCE_DIR}/globals.c)
# Link bootloader executable
add_executable(dummy ${XTLDR_DUMMY_SOURCE})
# Add linker libraries
target_link_libraries(dummy libxtldr libxtos)
# Set proper binary name and install target
set_target_properties(dummy PROPERTIES SUFFIX .efi)
set_install_target(dummy efi/boot/xtldr/modules)
# Set module entrypoint and subsystem
set_entrypoint(dummy "XtLdrModuleMain")
set_linker_map(dummy TRUE)
set_subsystem(dummy efi_boot_service_driver)

View File

@@ -0,0 +1,61 @@
/**
* 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>
#include <globals.h>
/* Dummy module information */
XTBL_MODINFO = L"Dummy XTLDR module";
// XTBL_MODDEPS = {L"dummy2"};
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 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.Register(&DummyGuid, &BlpDummyProtocol);
}

View File

@@ -0,0 +1,16 @@
/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtldr/modules/dummy/globals.c
* DESCRIPTION: Dummy XTLDR module global variables
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
*/
#include <xtblapi.h>
/* XTLDR protocol handler */
PXTBL_LOADER_PROTOCOL XtLdrProto;
/* Dummy Boot Protocol handler */
XTBL_BOOT_PROTOCOL BlpDummyProtocol;

View File

@@ -0,0 +1,21 @@
/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtldr/modules/dummy/includes/globals.h
* DESCRIPTION: Dummy XTLDR module global variables
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
*/
#ifndef __XTLDR_DUMMY_GLOBALS_H
#define __XTLDR_DUMMY_GLOBALS_H
#include <xtblapi.h>
/* XTLDR protocol handler */
EXTERN PXTBL_LOADER_PROTOCOL XtLdrProto;
/* Dummy Boot Protocol handler */
EXTERN XTBL_BOOT_PROTOCOL BlpDummyProtocol;
#endif/* __XTLDR_DUMMY_GLOBALS_H */