Skip to main content

rust_kernel_rt/
lib.rs

1#![no_std]
2
3pub extern crate alloc;
4
5pub use rust_kernel_shared_consts as shared_consts;
6
7mod panic;
8mod allocator;
9pub mod syscall;
10pub mod print;
11
12// TODO : allocator
13
14unsafe extern "Rust" {
15    fn main() -> i32;
16}
17
18#[unsafe(no_mangle)]
19pub fn _start() -> ! {
20    let exit = unsafe { main() };
21    unsafe {
22        core::arch::asm!(
23            "int 0x80",
24            in("rax") exit as usize,
25            options(noreturn),
26        );
27    }
28}
29