This commit is contained in:
parent
d9860e89a7
commit
f0b4236407
8 changed files with 20 additions and 31 deletions
1
.clang-format
Normal file
1
.clang-format
Normal file
|
@ -0,0 +1 @@
|
|||
ColumnLimit: 200
|
|
@ -12,6 +12,16 @@ jobs:
|
|||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- name: Download Rust
|
||||
run: |
|
||||
curl -O ${{ vars.RUST_URL }}
|
||||
mkdir rust
|
||||
cd rust
|
||||
unzip ../compiler.zip
|
||||
chmod +x bin/rustc
|
||||
chmod +x lib/rustlib/x86_64-unknown-linux-gnu/bin/rust-lld
|
||||
- name: Link toolchain
|
||||
run: . ~/.bashrc && rustup toolchain link x86_64-unknown-os rust
|
||||
- name: Build
|
||||
run: . ~/.bashrc && ./build.py
|
||||
- name: Install cargo-deny
|
||||
|
|
5
build.py
5
build.py
|
@ -18,7 +18,10 @@ def main():
|
|||
|
||||
components = ["init", "kernel", "loader"]
|
||||
for component in components:
|
||||
cargo_cmd = f'cargo build {"--release" if target == "release" else ""}'
|
||||
toolchain = "+x86_64-unknown-os"
|
||||
if component == "kernel" or component == "loader":
|
||||
toolchain = ""
|
||||
cargo_cmd = f'cargo {toolchain} build {"--release" if target == "release" else ""}'
|
||||
run_command(cargo_cmd, cwd=component)
|
||||
|
||||
loader_path = f"target/x86_64-unknown-uefi/{target}/loader.efi"
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
[build]
|
||||
target = "x86_64-unknown-none"
|
||||
target = "x86_64-unknown-os"
|
||||
rustflags = ["-C", "link-arg=-no-pie"]
|
||||
|
|
|
@ -1,15 +1 @@
|
|||
#![no_std]
|
||||
#![no_main]
|
||||
use core::{arch::global_asm, panic::PanicInfo};
|
||||
|
||||
global_asm!(include_str!("start.s"), options(att_syntax));
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn main() -> ! {
|
||||
loop {}
|
||||
}
|
||||
|
||||
#[panic_handler]
|
||||
fn panic(_info: &PanicInfo) -> ! {
|
||||
loop {}
|
||||
}
|
||||
fn main() {}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
.text
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
mov $stack, %rsp
|
||||
call main
|
||||
|
||||
.section .bss
|
||||
.align 16
|
||||
.skip 0x10000
|
||||
stack:
|
|
@ -66,10 +66,10 @@ global_asm!(include_str!("cpu/trampoline.s"), options(att_syntax));
|
|||
global_asm!(include_str!("cpu/usermode.s"), options(att_syntax));
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
const INIT_BINARY: &[u8] = include_bytes!("../../target/x86_64-unknown-none/debug/init");
|
||||
const INIT_BINARY: &[u8] = include_bytes!("../../target/x86_64-unknown-os/debug/init");
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
const INIT_BINARY: &[u8] = include_bytes!("../../target/x86_64-unknown-none/release/init");
|
||||
const INIT_BINARY: &[u8] = include_bytes!("../../target/x86_64-unknown-os/release/init");
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn early_main(temp_loader_struct: *const LoaderStruct) -> ! {
|
||||
|
|
|
@ -3,7 +3,7 @@ COMPONENTS:=dispatcher events executer hardware namespace parser resources table
|
|||
CFILES:=$(foreach comp, $(COMPONENTS), $(wildcard ../acpica/source/components/$(comp)/*.c)) printf.c
|
||||
OFILES:=$(patsubst %.c, %.o, $(CFILES))
|
||||
CC:=clang
|
||||
CFLAGS:=--target=x86_64-elf -ffreestanding -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -fstack-protector-strong -O2 -I. -I../acpica/source/include -DACPI_LIBRARY -D__linux__
|
||||
CFLAGS:=--target=x86_64-elf -ffreestanding -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -fstack-protector-strong -Wall -Werror -O2 -I. -I../acpica/source/include -DACPI_LIBRARY -D__linux__
|
||||
|
||||
libacpica.a: $(OFILES)
|
||||
llvm-ar rcD $@ $^
|
||||
|
|
Loading…
Add table
Reference in a new issue