Initial Commit
This commit is contained in:
commit
fa2420d5d9
6 changed files with 65 additions and 0 deletions
9
.cargo/config.toml
Normal file
9
.cargo/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
[build]
|
||||||
|
target = "x86_64_plain_os.json"
|
||||||
|
|
||||||
|
[unstable]
|
||||||
|
# enable implementations for memset, memcpy and memcmp etc.
|
||||||
|
build-std-features = ["compiler-builtins-mem"]
|
||||||
|
# for our target triple, there is no `core` prebuilt. So we need to do this by
|
||||||
|
# ourselves using this option:
|
||||||
|
build-std = ["core", "compiler_builtins"]
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/target
|
7
Cargo.lock
generated
Normal file
7
Cargo.lock
generated
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "plain_os"
|
||||||
|
version = "0.1.0"
|
16
Cargo.toml
Normal file
16
Cargo.toml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
[package]
|
||||||
|
name = "plain_os"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
resolver = "2"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[profile.dev]
|
||||||
|
panic = "abort" # disable stack unwinding on panic
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
panic = "abort" # disable stack unwinding on panic
|
||||||
|
|
||||||
|
[dependencies]
|
17
src/main.rs
Normal file
17
src/main.rs
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#![no_std]
|
||||||
|
#![no_main]
|
||||||
|
|
||||||
|
use core::panic::PanicInfo;
|
||||||
|
|
||||||
|
/// This function defines the panic handler
|
||||||
|
#[panic_handler]
|
||||||
|
fn panic(_info: &PanicInfo) -> ! {
|
||||||
|
loop{}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn _start() -> ! {
|
||||||
|
// this function is the entry point, since the linker looks for a function
|
||||||
|
// named `_start` by default
|
||||||
|
loop {}
|
||||||
|
}
|
15
x86_64_plain_os.json
Normal file
15
x86_64_plain_os.json
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"llvm-target": "x86_64-unknown-none",
|
||||||
|
"data-layout": "e-m:e-i64:64-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"
|
||||||
|
}
|
Loading…
Reference in a new issue