start
This commit is contained in:
commit
e538cc6b8b
|
@ -0,0 +1,20 @@
|
||||||
|
[alias]
|
||||||
|
b = "build"
|
||||||
|
br = "build --release"
|
||||||
|
c = "check"
|
||||||
|
t = "test"
|
||||||
|
r = "run"
|
||||||
|
rr = "run --release"
|
||||||
|
|
||||||
|
[build]
|
||||||
|
incremental = true
|
||||||
|
pipelining = true
|
||||||
|
rustflags = [
|
||||||
|
"-C", "code-model=large",
|
||||||
|
"-C", "relocation-model=static",
|
||||||
|
"-C", "embed-bitcode=no"
|
||||||
|
]
|
||||||
|
target = ["x86_64-unknown-none"]
|
||||||
|
|
||||||
|
[profile.x86_64-unknown-none]
|
||||||
|
panic = "abort"
|
|
@ -0,0 +1 @@
|
||||||
|
/target
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"rust-analyzer.cargo.allTargets": false,
|
||||||
|
"rust-analyzer.cargo.extraArgs": [
|
||||||
|
"--target",
|
||||||
|
"x86_64-unknown-none"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nonx"
|
||||||
|
version = "0.1.0"
|
|
@ -0,0 +1,16 @@
|
||||||
|
[package]
|
||||||
|
name = "nonx"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = ["large"]
|
||||||
|
large = [] # Enable for server or desktop devices.
|
||||||
|
small = [] # Enable for legacy server or desktop devices.
|
||||||
|
embeded = [] # Enable for embeded devices and extremely old devices.
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
crate-type = ["staticlib"]
|
||||||
|
test = false
|
|
@ -0,0 +1,30 @@
|
||||||
|
use std::{env, path::Path, process::Command};
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let out_dir = env::var("OUT_DIR").unwrap();
|
||||||
|
Command::new("llvm-as")
|
||||||
|
.args(&["src/kernel_end.ll", "-o"])
|
||||||
|
.arg(&format!("{}/kernel_end.bc", out_dir))
|
||||||
|
.status()
|
||||||
|
.unwrap();
|
||||||
|
Command::new("llc")
|
||||||
|
.arg(&format!("{}/kernel_end.bc", out_dir))
|
||||||
|
.arg("-o")
|
||||||
|
.arg(&format!("{}/kernel_end.s", out_dir))
|
||||||
|
.status()
|
||||||
|
.unwrap();
|
||||||
|
Command::new("as")
|
||||||
|
.arg("-o")
|
||||||
|
.arg(&format!("{}/kernel_end.o", out_dir))
|
||||||
|
.arg(&format!("{}/kernel_end.s", out_dir))
|
||||||
|
.status()
|
||||||
|
.unwrap();
|
||||||
|
Command::new("ar")
|
||||||
|
.args(&["crus", "libkernel_end.a", "kernel_end.o"])
|
||||||
|
.current_dir(&Path::new(&out_dir))
|
||||||
|
.status()
|
||||||
|
.unwrap();
|
||||||
|
println!("cargo::rustc-link-search=native={}", out_dir);
|
||||||
|
println!("cargo::rustc-link-lib=static=kernel_end");
|
||||||
|
println!("cargo::rerun-if-changed=src/kernel_end.ll");
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
@KERNEL_END = global i32 0, section ".kernel-end"
|
|
@ -0,0 +1,13 @@
|
||||||
|
#![no_std]
|
||||||
|
|
||||||
|
extern crate alloc;
|
||||||
|
|
||||||
|
use core::panic::PanicInfo;
|
||||||
|
|
||||||
|
pub mod memm;
|
||||||
|
pub mod plugin;
|
||||||
|
|
||||||
|
#[panic_handler]
|
||||||
|
fn panic_handler(_panic: &PanicInfo) -> ! {
|
||||||
|
loop {}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
use alloc::string::String;
|
||||||
|
|
||||||
|
struct APIRegister{
|
||||||
|
name: String,
|
||||||
|
call: *mut fn(),
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
pub mod api_bus;
|
Loading…
Reference in New Issue