Add basic ARM rust freestanding binary

Following the modern version of Philipp Oppermann's blog-tutorial. Build
with `cargo build --target thumbv7em-none-eabihf`
This commit is contained in:
Greg Shuflin
2022-02-09 20:31:53 -08:00
parent 288dd537c0
commit d504aa2a6d
4 changed files with 37 additions and 0 deletions

7
os-in-rust/Cargo.lock generated Normal file
View File

@@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "os-in-rust"
version = "0.1.0"

14
os-in-rust/Cargo.toml Normal file
View File

@@ -0,0 +1,14 @@
[package]
name = "os-in-rust"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[profile.dev]
panic = "abort"
[profile.release]
panic = "abort"
[dependencies]

15
os-in-rust/src/main.rs Normal file
View File

@@ -0,0 +1,15 @@
#![no_std]
#![no_main]
use core::panic::PanicInfo;
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
loop {}
}
#[no_mangle]
pub extern "C" fn _start() -> ! {
loop {}
}