Download compiler in CI
All checks were successful
Build / build (push) Successful in 2m43s

This commit is contained in:
Mathieu Strypsteen 2024-12-25 20:03:32 +01:00
parent d9860e89a7
commit f0b4236407
8 changed files with 20 additions and 31 deletions

1
.clang-format Normal file
View file

@ -0,0 +1 @@
ColumnLimit: 200

View file

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

View file

@ -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"

View file

@ -1,3 +1,3 @@
[build]
target = "x86_64-unknown-none"
target = "x86_64-unknown-os"
rustflags = ["-C", "link-arg=-no-pie"]

View file

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

View file

@ -1,11 +0,0 @@
.text
.global _start
_start:
mov $stack, %rsp
call main
.section .bss
.align 16
.skip 0x10000
stack:

View file

@ -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) -> ! {

View file

@ -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 $@ $^