diff --git a/.gitignore b/.gitignore index 1c2d52b6..f5378f80 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .idea/* +os/target/* diff --git a/os/.cargo/config b/os/.cargo/config new file mode 100644 index 00000000..6a5ba745 --- /dev/null +++ b/os/.cargo/config @@ -0,0 +1,2 @@ +[build] +target = "riscv64gc-unknown-none-elf" \ No newline at end of file diff --git a/os/Cargo.lock b/os/Cargo.lock new file mode 100644 index 00000000..b85588b1 --- /dev/null +++ b/os/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "os" +version = "0.1.0" diff --git a/os/Cargo.toml b/os/Cargo.toml new file mode 100644 index 00000000..b6770dc1 --- /dev/null +++ b/os/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "os" +version = "0.1.0" +authors = ["Yifan Wu "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/os/src/lang_items.rs b/os/src/lang_items.rs new file mode 100644 index 00000000..c03b9538 --- /dev/null +++ b/os/src/lang_items.rs @@ -0,0 +1,6 @@ +use core::panic::PanicInfo; + +#[panic_handler] +fn panic(_info: &PanicInfo) -> ! { + loop {} +} diff --git a/os/src/main.rs b/os/src/main.rs new file mode 100644 index 00000000..8d4ade6f --- /dev/null +++ b/os/src/main.rs @@ -0,0 +1,5 @@ +#![no_std] +#![no_main] + +mod lang_items; +