ableos_userland/libraries/std/src/entry.rs

26 lines
485 B
Rust
Raw Normal View History

2023-03-09 06:36:35 -06:00
use core::arch::asm;
#[no_mangle]
unsafe extern "C" fn _start() -> ! {
extern "C" {
fn main(argc: isize, argv: *const *const u8) -> isize;
}
// TODO: grab and pass arguments to main
main(0, core::ptr::null());
2023-03-30 01:31:55 -05:00
// asm!(
// "syscall",
// in("rax") 60,
// in("rdi") 0,
// options(noreturn)
// );
2023-03-09 06:36:35 -06:00
}
#[lang = "start"]
fn lang_start<T>(main: fn() -> T, _: isize, _: *const *const u8, _: u8) -> isize {
main();
0
}