Completed code to build for a custom architecture that is independent of linux etc

This commit is contained in:
Ishan Jain 2018-07-20 17:33:26 +05:30
commit d1f89d3b33
5 changed files with 44 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/target
**/*.rs.bk

4
Cargo.lock generated Normal file
View File

@ -0,0 +1,4 @@
[[package]]
name = "os_boot"
version = "0.1.0"

6
Cargo.toml Normal file
View File

@ -0,0 +1,6 @@
[package]
name = "os_boot"
version = "0.1.0"
authors = ["ishanjain28 <ishanjain28@gmail.com>"]
[dependencies]

17
src/main.rs Normal file
View File

@ -0,0 +1,17 @@
#![feature(panic_implementation)] // required to define panic handler
#![no_std] // don't include rust std lib
#![no_main] // disable all rust entry point
use core::panic::PanicInfo;
/// This function is called on panic.
#[panic_implementation]
#[no_mangle]
pub fn panic(_info: &PanicInfo) -> ! {
loop {}
}
#[no_mangle] // don't change the name of function in symbol table
pub extern "C" fn _start() -> ! {
loop {}
}

15
x86_64-os.json Normal file
View 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"
}