diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2020-11-24 15:08:20 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2020-11-24 15:08:20 +0100 |
| commit | eba74d74502641a4565dc6011db33742e8450680 (patch) | |
| tree | f7785882d1084944b309bd777d4663112823070a /halt-rs | |
| parent | 0960f519d9e1e3c108b1825a0ec241b1c56c5cca (diff) | |
| download | pintos-rs-eba74d74502641a4565dc6011db33742e8450680.tar.gz | |
move rust "libc" to separate crate and link with that instead
Diffstat (limited to 'halt-rs')
| -rw-r--r-- | halt-rs/Cargo.toml | 23 | ||||
| -rw-r--r-- | halt-rs/rust-toolchain | 1 | ||||
| -rw-r--r-- | halt-rs/src/lib.rs | 13 |
3 files changed, 37 insertions, 0 deletions
diff --git a/halt-rs/Cargo.toml b/halt-rs/Cargo.toml new file mode 100644 index 0000000..7486789 --- /dev/null +++ b/halt-rs/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "pintos-rs" +version = "0.1.0" +authors = ["Gustav Sörnäs <gustav@sornas.net>"] +edition = "2018" + +[lib] +name = "haltrs" +crate-type = ["staticlib"] + +[profile.dev] +panic = "abort" + +[profile.release] +panic = "abort" + +[dependencies.libc] +version = "0.2" +default-features = false +features = ["extra_traits"] + +[dependencies.libpintos] +path = "../libpintos-rs" diff --git a/halt-rs/rust-toolchain b/halt-rs/rust-toolchain new file mode 100644 index 0000000..adfa491 --- /dev/null +++ b/halt-rs/rust-toolchain @@ -0,0 +1 @@ +nightly-i686-unknown-linux-gnu diff --git a/halt-rs/src/lib.rs b/halt-rs/src/lib.rs new file mode 100644 index 0000000..5455087 --- /dev/null +++ b/halt-rs/src/lib.rs @@ -0,0 +1,13 @@ +#![no_std] + +use libpintos::exit; + +#[panic_handler] +fn panic(_info: &core::panic::PanicInfo) -> ! { + loop {} +} + +#[no_mangle] +pub unsafe extern "C" fn entry() { + exit(0x69); +} |
