feat: ported debug logging

This commit is contained in:
2023-09-27 22:26:50 +02:00
parent 7411fb55ea
commit 0567926814
10 changed files with 342 additions and 11 deletions

View File

@@ -11,6 +11,7 @@ if (NOT ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
endif ()
# Define global options
option(USE_DEBUG "Enable debug code" ON)
option(USE_LIMINE "Enable support for the limine boot protocol" ON)
# Find builtins
@@ -57,10 +58,17 @@ if (NOT ${USE_LIMINE})
endif ()
# Find sources
file(GLOB KERNEL_SOURCES src/rt/*.c src/ulibc/*.c)
file(GLOB KERNEL_SOURCES
src/rt/*.c
src/ulibc/*.c)
file(GLOB PLATFORM_GENERIC_SOURCES src/platform/generic/*.c)
if (${USE_DEBUG})
add_definitions(-DUSE_DEBUG)
file(GLOB DEBUG_KERNEL_SOURCES src/rt/debug/*.c)
endif ()
if (${USE_LIMINE})
add_definitions(-DUSE_LIMINE)
file(GLOB LIMINE_KERNEL_SOURCES src/rt/limine/*.c)
endif ()
if (NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/${CMAKE_SYSTEM_PROCESSOR})
@@ -77,6 +85,7 @@ file(GLOB CRTN src/platform/generic/crt/crtn.c)
set(KERNEL_SOURCE_FILES
${KERNEL_SOURCES}
${LIMINE_KERNEL_SOURCES}
${DEBUG_KERNEL_SOURCES}
${PLATFORM_GENERIC_SOURCES}
${PLATFORM_SPECIFIC_SOURCES}
${PLATFORM_SPECIFIC_ASM_SOURCES}