Create directory structure and initial build system (AI)

This commit is contained in:
AI
2026-02-23 08:21:49 +00:00
parent ffb8b02762
commit 34382babb3
5 changed files with 64 additions and 2 deletions

13
src/CMakeLists.txt Normal file
View File

@@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.16)
add_executable(kernel
kernel.c
)
# Use our custom linker script
target_link_options(kernel PRIVATE -T ${CMAKE_CURRENT_SOURCE_DIR}/linker.ld)
target_include_directories(kernel PRIVATE
${CMAKE_SOURCE_DIR}/vendor
${CMAKE_SOURCE_DIR}/include # If created later
)

3
src/kernel.c Normal file
View File

@@ -0,0 +1,3 @@
void _start() {
while(1) {}
}

28
src/linker.ld Normal file
View File

@@ -0,0 +1,28 @@
ENTRY(_start)
SECTIONS
{
. = 1M;
.text BLOCK(4K) : ALIGN(4K)
{
KEEP(*(.multiboot))
*(.text)
}
.rodata BLOCK(4K) : ALIGN(4K)
{
*(.rodata)
}
.data BLOCK(4K) : ALIGN(4K)
{
*(.data)
}
.bss BLOCK(4K) : ALIGN(4K)
{
*(COMMON)
*(.bss)
}
}