feat: create libkos crate with core modules (syscall, alloc, rt)
This commit is contained in:
21
crates/libkos/src/rt.rs
Normal file
21
crates/libkos/src/rt.rs
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user