From 4cc1eecd56fb2937b9665f027cc3ec9f2e443b99 Mon Sep 17 00:00:00 2001 From: Ruidy Date: Sat, 24 Apr 2021 17:11:40 +0200 Subject: [PATCH 1/3] disable unwinding --- Cargo.lock | 2 +- Cargo.toml | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 445860f..8c91175 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,5 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] -name = "rouilleOS" +name = "rouille_os" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 069a18b..65d5504 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,14 @@ [package] -name = "rouilleOS" +name = "rouille_os" version = "0.1.0" authors = ["Ruidy "] edition = "2018" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[profile.dev] +panic = "abort" + +[profile.release] +panic = "abort" \ No newline at end of file From 23e5a4e35a5f5ff7e2f28e7bf7c023124a496b74 Mon Sep 17 00:00:00 2001 From: Ruidy Date: Sat, 24 Apr 2021 17:17:30 +0200 Subject: [PATCH 2/3] overwrite entry point --- src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index d774d11..6a525d9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,14 @@ #![no_std] - +#![no_main] use core::panic::PanicInfo; -fn main() {} +/// Disabling mangling ensures the compiler returns a function named `_start` +/// +/// We tell the compiler to use `C calling convention` +#[no_mangle] +pub extern "C" fn _start() -> ! { + loop {} +} /// Function called on panic. It is a diverging function with a `never` return type. /// /// # Arguments From b31b43ea66249ffc042c5c483db00c300c9528b2 Mon Sep 17 00:00:00 2001 From: Ruidy Date: Sat, 24 Apr 2021 17:24:24 +0200 Subject: [PATCH 3/3] doc --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 65d5504..e9e2a98 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" [dependencies] [profile.dev] -panic = "abort" +panic = "abort" # disable stack unwinding on panic [profile.release] -panic = "abort" \ No newline at end of file +panic = "abort" # disable stack unwinding on panic \ No newline at end of file