From 3f7102d7193d3c0f6cdda8e3106aac77188bb475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Mon, 23 Nov 2020 04:07:45 +0100 Subject: intial rs --- halt/src/main.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 halt/src/main.rs (limited to 'halt/src') diff --git a/halt/src/main.rs b/halt/src/main.rs new file mode 100644 index 0000000..8abf38a --- /dev/null +++ b/halt/src/main.rs @@ -0,0 +1,26 @@ +#![no_std] +#![no_main] +#![feature(start)] +//#![feature(asm)] +//#![link_args = "-L -lmain"] + +#[panic_handler] +fn panic(_info: &core::panic::PanicInfo) -> ! { + loop {} +} + +#[no_mangle] +pub unsafe extern "C" fn main() { + exit(0x69); +} + +#[link(name="pintos", kind="static")] +extern { + fn exit(status: i32); +} + +//#[no_mangle] +//#[start] +//unsafe extern "C" fn _start() { +// exit(main()); +//} -- cgit v1.2.1