From 20eb8b73f7914c86812eda4b3b14ee2d0cd5a826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Mon, 23 Nov 2020 14:52:17 +0100 Subject: userprog makefile --- rust/src/lib.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 rust/src/lib.rs (limited to 'rust/src') diff --git a/rust/src/lib.rs b/rust/src/lib.rs new file mode 100644 index 0000000..43470b2 --- /dev/null +++ b/rust/src/lib.rs @@ -0,0 +1,19 @@ +#![no_std] +//#![feature(asm)] +//#![feature(link_args)] +//#![link_args = "-L -lpintos"] + +#[panic_handler] +fn panic(_info: &core::panic::PanicInfo) -> ! { + loop {} +} + +#[no_mangle] +pub unsafe extern "C" fn entry() { + exit(0x69); +} + +#[link(name="pintos", kind="static")] +extern { + fn exit(status: i32); +} -- cgit v1.2.1