From 5bcf1f4e4af10fc0ba43d281cc7be4dc12976f50 Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Tue, 30 May 2023 20:54:37 -0700 Subject: [PATCH] Add a second process to be loaded by the bootloader. --- CMakeLists.txt | 2 +- scripts/build_image.sh | 1 + sys/CMakeLists.txt | 12 ++++++++++++ sys/test2.cpp | 8 ++++++++ zion/boot/limine.cfg | 1 + 5 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 sys/test2.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 65f4f5d..5cedbe6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ add_subdirectory(sys) add_custom_command( OUTPUT disk.img COMMAND sudo sh ../scripts/build_image.sh disk.img - DEPENDS zion test + DEPENDS zion test test2 USES_TERMINAL ) diff --git a/scripts/build_image.sh b/scripts/build_image.sh index 150022c..a02047d 100644 --- a/scripts/build_image.sh +++ b/scripts/build_image.sh @@ -38,5 +38,6 @@ cp ../zion/boot/limine.cfg efi/ cp zion/zion efi/ mkdir -p efi/sys cp sys/test efi/sys/test +cp sys/test2 efi/sys/test2 chown drew:drew $1 diff --git a/sys/CMakeLists.txt b/sys/CMakeLists.txt index 6884a8e..19eb698 100644 --- a/sys/CMakeLists.txt +++ b/sys/CMakeLists.txt @@ -15,3 +15,15 @@ set_target_properties(test COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${_COMPILE_FLAGS}" LINK_FLAGS "${CMAKE_EXE_LINK_FLAGS} ${_LINK_FLAGS}" ) + +add_executable(test2 + test2.cpp) + +target_link_libraries(test2 + zion_lib) + +set_target_properties(test2 + PROPERTIES + COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${_COMPILE_FLAGS}" + LINK_FLAGS "${CMAKE_EXE_LINK_FLAGS} ${_LINK_FLAGS}" + ) diff --git a/sys/test2.cpp b/sys/test2.cpp new file mode 100644 index 0000000..02b5700 --- /dev/null +++ b/sys/test2.cpp @@ -0,0 +1,8 @@ + + +#include "zcall.h" + +int main() { + ZDebug("Testing"); + return 0; +} diff --git a/zion/boot/limine.cfg b/zion/boot/limine.cfg index 3470793..3a85003 100644 --- a/zion/boot/limine.cfg +++ b/zion/boot/limine.cfg @@ -7,3 +7,4 @@ TIMEOUT=0 KERNEL_PATH=boot:///zion MODULE_PATH=boot:///sys/test + MODULE_PATH=boot:///sys/test2