Add EFI bootloader subproject
All checks were successful
ci/woodpecker/push/build Pipeline was successful
All checks were successful
ci/woodpecker/push/build Pipeline was successful
This commit is contained in:
parent
0a7b105d96
commit
09e4edc026
@ -63,3 +63,4 @@ set_disk_image_size(128)
|
|||||||
|
|
||||||
# Build subprojects
|
# Build subprojects
|
||||||
add_subdirectory(bootdata)
|
add_subdirectory(bootdata)
|
||||||
|
add_subdirectory(xtldr)
|
||||||
|
27
xtldr/CMakeLists.txt
Normal file
27
xtldr/CMakeLists.txt
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# XT Boot Loader
|
||||||
|
PROJECT(XTLDR)
|
||||||
|
|
||||||
|
# Specify include directories
|
||||||
|
include_directories(
|
||||||
|
${EXECTOS_SOURCE_DIR}/sdk/xtdk
|
||||||
|
${XTLDR_SOURCE_DIR}/includes)
|
||||||
|
|
||||||
|
# Specify list of source code files
|
||||||
|
list(APPEND XTLDR_SOURCE
|
||||||
|
${XTLDR_SOURCE_DIR}/xtldr.c)
|
||||||
|
|
||||||
|
# Add executable
|
||||||
|
add_executable(xtldr ${XTLDR_SOURCE})
|
||||||
|
|
||||||
|
# Set proper binary name and install target
|
||||||
|
if(ARCH STREQUAL "i686")
|
||||||
|
set(BINARY_NAME "bootia32")
|
||||||
|
elseif(ARCH STREQUAL "amd64")
|
||||||
|
set(BINARY_NAME "bootx64")
|
||||||
|
endif()
|
||||||
|
set_target_properties(xtldr PROPERTIES OUTPUT_NAME ${BINARY_NAME} SUFFIX .efi)
|
||||||
|
set_install_target(xtldr efi/boot)
|
||||||
|
|
||||||
|
# Set loader entrypoint, imagebase address, ordinals and subsystem
|
||||||
|
set_entrypoint(xtldr "XtLoaderStartup")
|
||||||
|
set_subsystem(xtldr efi_application)
|
25
xtldr/includes/xtbl.h
Normal file
25
xtldr/includes/xtbl.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* PROJECT: ExectOS
|
||||||
|
* COPYRIGHT: See COPYING.md in the top level directory
|
||||||
|
* FILE: xtldr/includes/xtbl.h
|
||||||
|
* DESCRIPTION: Top level header for XTLDR
|
||||||
|
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __XTLDR_XTBL_H
|
||||||
|
#define __XTLDR_XTBL_H
|
||||||
|
|
||||||
|
#include <xtkmapi.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* EFI Image Handle */
|
||||||
|
EXTERN EFI_HANDLE EfiImageHandle;
|
||||||
|
|
||||||
|
/* EFI System Table */
|
||||||
|
EXTERN EFI_SYSTEM_TABLE *EfiSystemTable;
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
XtLoaderStartup(IN EFI_HANDLE ImageHandle,
|
||||||
|
IN PEFI_SYSTEM_TABLE SystemTable);
|
||||||
|
|
||||||
|
#endif /* __XTLDR_XTBL_H */
|
44
xtldr/xtldr.c
Normal file
44
xtldr/xtldr.c
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/**
|
||||||
|
* PROJECT: ExectOS
|
||||||
|
* COPYRIGHT: See COPYING.md in the top level directory
|
||||||
|
* FILE: xtldr/xtldr.c
|
||||||
|
* DESCRIPTION: UEFI XT Bootloader
|
||||||
|
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <xtbl.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* EFI Image Handle */
|
||||||
|
EFI_HANDLE EfiImageHandle;
|
||||||
|
|
||||||
|
/* EFI System Table */
|
||||||
|
PEFI_SYSTEM_TABLE EfiSystemTable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This routine is the entry point of the XT EFI boot loader.
|
||||||
|
*
|
||||||
|
* @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
|
||||||
|
*/
|
||||||
|
EFI_STATUS
|
||||||
|
XtLoaderStartup(IN EFI_HANDLE ImageHandle,
|
||||||
|
IN PEFI_SYSTEM_TABLE SystemTable)
|
||||||
|
{
|
||||||
|
/* Set the system table and image handle */
|
||||||
|
EfiImageHandle = ImageHandle;
|
||||||
|
EfiSystemTable = SystemTable;
|
||||||
|
|
||||||
|
/* Infinite bootloader loop */
|
||||||
|
for(;;);
|
||||||
|
|
||||||
|
/* Return success */
|
||||||
|
return STATUS_EFI_SUCCESS;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user