From fefc9a138f4d4f26e6b676c4cdca77b3140e4206 Mon Sep 17 00:00:00 2001 From: "marcel.braun" Date: Tue, 17 Feb 2026 17:41:10 +0100 Subject: Save WIP --- arch/x86_64/support/grub.cfg.in | 1 + arch/x86_64/support/modules/test.img | Bin 0 -> 2097152 bytes cmake/Modules/GenerateBootableIso.cmake | 12 ++++++++++++ 3 files changed, 13 insertions(+) create mode 100644 arch/x86_64/support/modules/test.img diff --git a/arch/x86_64/support/grub.cfg.in b/arch/x86_64/support/grub.cfg.in index 49f19ce..b29fc36 100644 --- a/arch/x86_64/support/grub.cfg.in +++ b/arch/x86_64/support/grub.cfg.in @@ -3,5 +3,6 @@ default=0 menuentry "TeachOS" { multiboot2 /$ + module2 isofs/modules/test.img boot } \ No newline at end of file diff --git a/arch/x86_64/support/modules/test.img b/arch/x86_64/support/modules/test.img new file mode 100644 index 0000000..914fa7f Binary files /dev/null and b/arch/x86_64/support/modules/test.img differ diff --git a/cmake/Modules/GenerateBootableIso.cmake b/cmake/Modules/GenerateBootableIso.cmake index 3d1ee30..abdc907 100644 --- a/cmake/Modules/GenerateBootableIso.cmake +++ b/cmake/Modules/GenerateBootableIso.cmake @@ -3,6 +3,13 @@ include_guard(GLOBAL) function(target_generate_bootable_iso TARGET) find_package("grub-mkrescue") + # set(MODULE_SRC + # "${PROJECT_SOURCE_DIR}/arch/${CMAKE_SYSTEM_PROCESSOR}/support/test.img" + # ) + # set(MODULE_DST + # "$/isofs/test.img" + # ) + file(GENERATE OUTPUT "$/isofs/boot/grub/grub.cfg" INPUT "${PROJECT_SOURCE_DIR}/arch/${CMAKE_SYSTEM_PROCESSOR}/support/grub.cfg.in" @@ -10,6 +17,10 @@ function(target_generate_bootable_iso TARGET) add_custom_command(TARGET "${TARGET}" POST_BUILD + # COMMAND "${CMAKE_COMMAND}" -E make_directory "$/isofs" + # COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${MODULE_SRC}" "${MODULE_DST}" + COMMAND "${CMAKE_COMMAND}" -E make_directory "$/isofs" + COMMAND "${CMAKE_COMMAND}" -E copy_directory "${PROJECT_SOURCE_DIR}/arch/${CMAKE_SYSTEM_PROCESSOR}/support/modules" "$/isofs/modules" COMMAND "${GRUB_MKRESCUE_EXE}" "-o" "$/${TARGET}.iso" @@ -19,4 +30,5 @@ function(target_generate_bootable_iso TARGET) BYPRODUCTS "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/${TARGET}.iso" COMMENT "Creating bootable ISO image" ) + endfunction() -- cgit v1.2.3