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

master
Ishan Jain 4 years ago
commit d1f89d3b33
  1. 2
      .gitignore
  2. 4
      Cargo.lock
  3. 6
      Cargo.toml
  4. 17
      src/main.rs
  5. 15
      x86_64-os.json

2
.gitignore vendored

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

4
Cargo.lock generated

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

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

@ -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 {}
}

@ -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…
Cancel
Save