From f3443cf4de47138b79b351a5f71414cd830f5fba Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Wed, 21 Jun 2023 14:42:37 -0700 Subject: [PATCH] [zion] Link against glacier as a POC --- zion/CMakeLists.txt | 3 +++ zion/loader/init_loader.cpp | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/zion/CMakeLists.txt b/zion/CMakeLists.txt index 63b9e1d..f77df3d 100644 --- a/zion/CMakeLists.txt +++ b/zion/CMakeLists.txt @@ -45,6 +45,9 @@ target_include_directories(zion ${CMAKE_CURRENT_SOURCE_DIR} ) +target_link_libraries(zion + glacier) + # -c -- Don't run the linker (only necessary for the assembler) # -ffreestanding # -fno-rtti -- No runtime type information (might mess with polymorphism?) diff --git a/zion/loader/init_loader.cpp b/zion/loader/init_loader.cpp index 4a82123..3158d94 100644 --- a/zion/loader/init_loader.cpp +++ b/zion/loader/init_loader.cpp @@ -1,5 +1,7 @@ #include "loader/init_loader.h" +#include + #include "boot/boot_info.h" #include "debug/debug.h" #include "include/zcall.h" @@ -103,11 +105,13 @@ void DumpModules() { #endif } -const limine_file& GetInitProgram(const char* path) { +const limine_file& GetInitProgram(glcr::String path) { const limine_module_response& resp = boot::GetModules(); for (uint64_t i = 0; i < resp.module_count; i++) { const limine_file& file = *resp.modules[i]; - if (streq(file.path, path)) return file; + if (path == file.path) { + return file; + } } panic("Program not found: %s", path); }