feat: create libkos crate with core modules (syscall, alloc, rt)

This commit is contained in:
2026-10-19 00:53:31 +02:00
parent 2792387348
commit dbec3842fa
9 changed files with 412 additions and 0 deletions

21
crates/libkos/src/rt.rs Normal file
View File

@@ -0,0 +1,21 @@
// Architecture-specific entry points.
// To add a new architecture: add a cfg block with the appropriate global_asm.
#[cfg(all(target_arch = "riscv64", target_os = "none"))]
core::arch::global_asm!(
r#"
.section .text.entry
.globl _start
_start:
call main
li a7, 16
ecall
j _start
"#
);
#[cfg(target_os = "none")]
#[panic_handler]
fn panic(_: &core::panic::PanicInfo) -> ! {
crate::syscall::exit();
}