From 04b031c6f20abc7efcbe71440e2faaae93984d42 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Tue, 14 Aug 2018 19:03:48 -0700 Subject: [PATCH] Start Rust OS stuff. --- README.rst | 1 + rust-os/README.md | 4 ++++ rust-os/bareos/Cargo.lock | 4 ++++ rust-os/bareos/Cargo.toml | 12 ++++++++++++ rust-os/bareos/src/main.rs | 16 ++++++++++++++++ 5 files changed, 37 insertions(+) create mode 100644 rust-os/README.md create mode 100644 rust-os/bareos/Cargo.lock create mode 100644 rust-os/bareos/Cargo.toml create mode 100644 rust-os/bareos/src/main.rs diff --git a/README.rst b/README.rst index ad45b97..3ef6bda 100644 --- a/README.rst +++ b/README.rst @@ -18,6 +18,7 @@ Projects + ``pio/``: `PlatformIO `_ projects + ``practical_prolog/``: `The Practice of Prolog `_ + ``qc/``: Quantum computing experiments ++ ``rust-os/``: working through writing an OS in Rust + ``uc/``: `Understanding Computation `_ Related diff --git a/rust-os/README.md b/rust-os/README.md new file mode 100644 index 0000000..d6625b6 --- /dev/null +++ b/rust-os/README.md @@ -0,0 +1,4 @@ +rust-os +======= + +Following along with [Writing an OS in Rust (Second Edition)](https://os.phil-opp.com/). diff --git a/rust-os/bareos/Cargo.lock b/rust-os/bareos/Cargo.lock new file mode 100644 index 0000000..e23e4b9 --- /dev/null +++ b/rust-os/bareos/Cargo.lock @@ -0,0 +1,4 @@ +[[package]] +name = "bareos" +version = "0.1.0" + diff --git a/rust-os/bareos/Cargo.toml b/rust-os/bareos/Cargo.toml new file mode 100644 index 0000000..bed0000 --- /dev/null +++ b/rust-os/bareos/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "bareos" +version = "0.1.0" +authors = ["Kyle Isom "] + +[profile.dev] +panic = "abort" + +[profile.release] +panic = "abort" + +[dependencies] diff --git a/rust-os/bareos/src/main.rs b/rust-os/bareos/src/main.rs new file mode 100644 index 0000000..4a15ecb --- /dev/null +++ b/rust-os/bareos/src/main.rs @@ -0,0 +1,16 @@ +#![feature(panic_implementation)] +#![no_std] +#![no_main] + +use core::panic::PanicInfo; + +#[panic_implementation] +#[no_mangle] +pub fn panic(_info: &PanicInfo) -> ! { + loop {} +} + +#[no_mangle] +pub extern "C" fn _start() -> ! { + loop {} +}