From 4aa2c1b8151dd0f15a4cb83af90f8d091f385896 Mon Sep 17 00:00:00 2001 From: Nicholas Novak <34256932+NickyBoy89@users.noreply.github.com> Date: Thu, 16 Jan 2025 16:48:20 -0800 Subject: [PATCH] feat: Initial commit and post 1 --- .cargo/config.toml | 2 ++ .gitignore | 1 + Cargo.lock | 7 +++++++ Cargo.toml | 12 ++++++++++++ src/main.rs | 14 ++++++++++++++ x86_64-blog_os.json | 15 +++++++++++++++ 6 files changed, 51 insertions(+) create mode 100644 .cargo/config.toml create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 src/main.rs create mode 100644 x86_64-blog_os.json diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..92cee48 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[unstable] +build-std = ["core", "compiler_builtins"] diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..6cbf711 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "rust_os" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..6915a3d --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "rust_os" +version = "0.1.0" +edition = "2018" + +[profile.dev] +panic = "abort" + +[profile.release] +panic = "abort" + +[dependencies] diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..43f9387 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,14 @@ +#![no_std] +#![no_main] + +use core::panic::PanicInfo; + +#[panic_handler] +fn panic(_info: &PanicInfo) -> ! { + loop {} +} + +#[no_mangle] +pub extern "C" fn _start() -> ! { + loop {} +} diff --git a/x86_64-blog_os.json b/x86_64-blog_os.json new file mode 100644 index 0000000..ceedc5d --- /dev/null +++ b/x86_64-blog_os.json @@ -0,0 +1,15 @@ +{ + "llvm-target": "x86_64-unknown-none", + "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128", + "arch": "x86_64", + "target-endian": "little", + "target-pointer-width": "64", + "target-c-int-width": "32", + "os": "none", + "executables": true, + "linker-flavor": "ld.lld", + "linker": "rust-lld", + "panic-strategy": "abort", + "disable-redzone": true, + "features": "-mmx,-sse,+soft-float" +}