Kernel modules system #2

Merged
karina merged 3 commits from feat/modules into dev 2026-05-03 14:32:02 +00:00
5 changed files with 43 additions and 13 deletions
Showing only changes of commit bedb03fc37 - Show all commits
+1 -1
View File
@@ -20,7 +20,7 @@ Address ExceptionsHandler(ExceptionsContext* frame, ExceptionsType type) {
}
if (class == 0x15 && syndrome == 0) {
OSPanic("Wow! We are inside EL0! Syscall caught successfully! :D");
OSPanic("Hi from userspace!!");
}
}
OSPanicException(frame);
+23
View File
@@ -0,0 +1,23 @@
ENTRY(_start)
SECTIONS
{
. = 0x400000;
.text : ALIGN(4K) {
*(.text .text.*)
}
.rodata : ALIGN(4K) {
*(.rodata .rodata.*)
}
.data : ALIGN(4K) {
*(.data .data.*)
}
.bss : ALIGN(4K) {
*(.bss .bss.*)
*(COMMON)
}
}
+15 -8
View File
@@ -2,7 +2,8 @@
# Copyright (c) 2026 0xKSor
cmake_minimum_required(VERSION 3.20)
project(ksOS_init LANGUAGES C)
project(ksOS_init LANGUAGES C ASM)
file(GLOB_RECURSE INIT_SOURCES CMAKE_CONFIGURE_DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/Source/*.S
@@ -17,21 +18,27 @@ target_include_directories(init PRIVATE
)
target_compile_options(init PRIVATE
$<$<COMPILE_LANGUAGE:C>:
-std=c23
-ffreestanding
-fno-stack-protector
-fno-builtin
-Wall -Wextra
-Wall
-Wextra
>
-ffreestanding
-g
-mgeneral-regs-only
)
# Передаем "голые" аргументы напрямую для ld.lld
target_link_options(init PRIVATE
"-Ttext=0x400000"
"-e" "_start"
"-z" "max-page-size=0x1000"
"--no-dynamic-linker"
-nostdlib
-static
-no-pie
-T "${CMAKE_CURRENT_SOURCE_DIR}/../../Common/linker.ld"
-Ttext=0x400000
-e _start
-z max-page-size=0x1000
--no-dynamic-linker
)
set_target_properties(init PROPERTIES
+1 -1
View File
@@ -20,7 +20,7 @@ _default:
echo " 🛠️ CMake build: ${TARGET_SUBPATH}"
TOOLCHAIN_FILE="{{ justfile_directory() }}/cmake/aarch64.cmake"
TOOLCHAIN_FILE="{{ justfile_directory() }}/Common/aarch64.cmake"
TOOLCHAIN=""
if [ -f "${TOOLCHAIN_FILE}" ]; then
TOOLCHAIN="-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}"