build: add build script to configure kernel and tools build systems

This commit is contained in:
2025-05-19 22:01:12 +01:00
parent 4d12cab7f7
commit 675a6de47e
5 changed files with 55 additions and 8 deletions

View File

@@ -3,3 +3,8 @@ target_compile_options(${kernel_exe_name} PRIVATE
-mno-sse -mno-sse2 -D_64BIT -DBYTE_ORDER=1234)
target_link_libraries(${kernel_exe_name} "-z max-page-size=0x1000" "-T ${CMAKE_CURRENT_SOURCE_DIR}/arch/x86_64/layout.ld")
add_custom_command(TARGET ${kernel_exe_name} POST_BUILD
COMMAND ${BUILD_TOOLS_DIR}/e64patch $<TARGET_FILE:${kernel_exe_name}>
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Patching kernel elf64 image"
)

View File

@@ -1,5 +1,5 @@
# the name of the target operating system
set(CMAKE_SYSTEM_NAME Magenta)
set(CMAKE_SYSTEM_NAME Mango)
# which compilers to use for C and C++
set(CMAKE_C_COMPILER x86_64-elf-gcc)