From 4f4df52d3d5a393799464d49e52b372a72e94b5b Mon Sep 17 00:00:00 2001 From: Aiken Harris Date: Fri, 17 Oct 2025 09:12:54 +0200 Subject: [PATCH] Include architecture-specific code in VBR --- boot/bootsect/CMakeLists.txt | 2 ++ boot/bootsect/espboot.S | 3 +++ boot/bootsect/mbrboot.S | 1 + 3 files changed, 6 insertions(+) diff --git a/boot/bootsect/CMakeLists.txt b/boot/bootsect/CMakeLists.txt index f9a1404..5085291 100644 --- a/boot/bootsect/CMakeLists.txt +++ b/boot/bootsect/CMakeLists.txt @@ -1,6 +1,8 @@ # XT Boot Sector PROJECT(BOOTSECT) +add_definitions("-DARCH_ESP_SOURCE=\\\"${ARCH}/cpu.S\\\"") + # Compile boot sectors compile_bootsector(mbrboot ${BOOTSECT_SOURCE_DIR}/mbrboot.S 0x7C00 Start) compile_bootsector(espboot ${BOOTSECT_SOURCE_DIR}/espboot.S 0x7C00 Start) diff --git a/boot/bootsect/espboot.S b/boot/bootsect/espboot.S index 0b09b19..0f230df 100644 --- a/boot/bootsect/espboot.S +++ b/boot/bootsect/espboot.S @@ -273,6 +273,9 @@ StartSectors: int $0x16 int $0x19 +/* Include architecture specific code */ +.include ARCH_ESP_SOURCE + msgUnavailable: .ascii "XTLDR requires EFI-based system!\r\nPress any key to restart\r\n" diff --git a/boot/bootsect/mbrboot.S b/boot/bootsect/mbrboot.S index 73dd338..545abbd 100644 --- a/boot/bootsect/mbrboot.S +++ b/boot/bootsect/mbrboot.S @@ -4,6 +4,7 @@ * FILE: boot/bootsect/amd64/mbrboot.S * DESCRIPTION: XT Boot Loader MBR boot code * DEVELOPERS: Rafal Kupiec + * Aiken Harris */ .text