From 5a4f0191916b20e383830bc740e533d1c6988290 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Fri, 25 Oct 2019 15:31:10 +0200 Subject: Add target x86_64-uff --- kernel/.cargo/config | 3 +++ kernel/Cargo.toml | 9 +++++++++ kernel/README.md | 2 ++ kernel/src/lib.rs | 13 +++++++++++++ kernel/x86_64-uff.json | 15 +++++++++++++++ 5 files changed, 42 insertions(+) create mode 100644 kernel/.cargo/config create mode 100644 kernel/Cargo.toml create mode 100644 kernel/src/lib.rs create mode 100644 kernel/x86_64-uff.json diff --git a/kernel/.cargo/config b/kernel/.cargo/config new file mode 100644 index 0000000..e698526 --- /dev/null +++ b/kernel/.cargo/config @@ -0,0 +1,3 @@ + +[build] +target = "x86_64-uff.json" diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml new file mode 100644 index 0000000..410d6d7 --- /dev/null +++ b/kernel/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "kernel" +version = "0.1.0" +authors = ["Dennis Kobert ", + "Jan Zwerschke"] +edition = "2018" + +[lib] +crate-type = ["staticlib"] diff --git a/kernel/README.md b/kernel/README.md index cf458c8..1b2c7a8 100644 --- a/kernel/README.md +++ b/kernel/README.md @@ -6,3 +6,5 @@ Required tools: * xorriso * grub * nasm +* rust +* cargo xbuild diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs new file mode 100644 index 0000000..066a526 --- /dev/null +++ b/kernel/src/lib.rs @@ -0,0 +1,13 @@ +#![no_std] +#![no_main] + +#[no_mangle] +pub extern "C" fn _start() -> ! { + loop {} +} + +#[panic_handler] +#[no_mangle] +pub extern "C" fn panic_handler(_info: &core::panic::PanicInfo) -> ! { + loop {} +} diff --git a/kernel/x86_64-uff.json b/kernel/x86_64-uff.json new file mode 100644 index 0000000..7d2110d --- /dev/null +++ b/kernel/x86_64-uff.json @@ -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" +} -- cgit v1.2.3-70-g09d2