diff options
| -rw-r--r-- | halt/Cargo.toml | 5 | ||||
| -rw-r--r-- | halt/src/lib.rs (renamed from halt/src/main.rs) | 13 |
2 files changed, 8 insertions, 10 deletions
diff --git a/halt/Cargo.toml b/halt/Cargo.toml index 160a513..14c75e0 100644 --- a/halt/Cargo.toml +++ b/halt/Cargo.toml @@ -4,6 +4,10 @@ version = "0.1.0" authors = ["Gustav Sörnäs <gustav@sornas.net>"] edition = "2018" +[lib] +name = "halt" +crate-type = ["staticlib"] + # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [profile.dev] @@ -11,6 +15,7 @@ panic = "abort" [profile.release] panic = "abort" +lto = true [dependencies.libc] version = "0.2" diff --git a/halt/src/main.rs b/halt/src/lib.rs index 8abf38a..43470b2 100644 --- a/halt/src/main.rs +++ b/halt/src/lib.rs @@ -1,8 +1,7 @@ #![no_std] -#![no_main] -#![feature(start)] //#![feature(asm)] -//#![link_args = "-L -lmain"] +//#![feature(link_args)] +//#![link_args = "-L -lpintos"] #[panic_handler] fn panic(_info: &core::panic::PanicInfo) -> ! { @@ -10,7 +9,7 @@ fn panic(_info: &core::panic::PanicInfo) -> ! { } #[no_mangle] -pub unsafe extern "C" fn main() { +pub unsafe extern "C" fn entry() { exit(0x69); } @@ -18,9 +17,3 @@ pub unsafe extern "C" fn main() { extern { fn exit(status: i32); } - -//#[no_mangle] -//#[start] -//unsafe extern "C" fn _start() { -// exit(main()); -//} |
