Completed code to build for a custom architecture that is independent of linux etc
This commit is contained in:
commit
d1f89d3b33
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/target
|
||||
**/*.rs.bk
|
4
Cargo.lock
generated
Normal file
4
Cargo.lock
generated
Normal file
|
@ -0,0 +1,4 @@
|
|||
[[package]]
|
||||
name = "os_boot"
|
||||
version = "0.1.0"
|
||||
|
6
Cargo.toml
Normal file
6
Cargo.toml
Normal 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
17
src/main.rs
Normal 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
15
x86_64-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 New Issue
Block a user