refactor: drop posix-uefi from bootloader
Replace the vendored POSIX-UEFI runtime with a small local EFI entry and header so the bootloader depends only on the UEFI interfaces it actually uses. Made-with: Cursor
This commit is contained in:
+10
-23
@@ -1,45 +1,32 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
project(ksOS_bootloader LANGUAGES C ASM)
|
||||
|
||||
set(UEFI_COMPILE_OPTIONS
|
||||
set(UEFI_COMPILE_OPTIONS
|
||||
-std=c23
|
||||
-target aarch64-unknown-windows-msvc
|
||||
-Wall -Wextra
|
||||
-fno-builtin
|
||||
)
|
||||
|
||||
set(POSIX_UEFI_SOURCES
|
||||
Source/uefi/crt_aarch64.c
|
||||
Source/uefi/dirent.c
|
||||
Source/uefi/qsort.c
|
||||
Source/uefi/stat.c
|
||||
Source/uefi/stdio.c
|
||||
Source/uefi/stdlib.c
|
||||
Source/uefi/string.c
|
||||
Source/uefi/time.c
|
||||
Source/uefi/unistd.c
|
||||
add_executable(BOOTAA64
|
||||
Source/uefi/efi_entry.c
|
||||
Source/main.c
|
||||
)
|
||||
|
||||
add_library(posix_uefi_lib OBJECT ${POSIX_UEFI_SOURCES})
|
||||
target_compile_options(posix_uefi_lib PRIVATE ${UEFI_COMPILE_OPTIONS})
|
||||
target_include_directories(posix_uefi_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/Source/uefi)
|
||||
|
||||
|
||||
add_executable(BOOTAA64 Source/main.c)
|
||||
target_compile_options(BOOTAA64 PRIVATE ${UEFI_COMPILE_OPTIONS})
|
||||
|
||||
target_link_libraries(BOOTAA64 PRIVATE posix_uefi_lib)
|
||||
target_include_directories(BOOTAA64 PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Source
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Source/uefi
|
||||
)
|
||||
|
||||
target_link_options(BOOTAA64 PRIVATE
|
||||
-fuse-ld=lld
|
||||
-target aarch64-unknown-windows-msvc
|
||||
-nostdlib
|
||||
-Wl,-subsystem:efi_application
|
||||
-Wl,-include:uefi_init
|
||||
-Wl,-entry:uefi_init
|
||||
-Wl,-entry:efi_main
|
||||
)
|
||||
|
||||
set_target_properties(BOOTAA64 PROPERTIES
|
||||
set_target_properties(BOOTAA64 PROPERTIES
|
||||
SUFFIX ".EFI"
|
||||
OUTPUT_NAME "BOOTAA64"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/efi_bin"
|
||||
|
||||
Reference in New Issue
Block a user