Add more from the std

This commit is contained in:
2026-03-20 09:47:32 +01:00
parent 3121c0b68b
commit 48a75485b6
297 changed files with 598 additions and 60308 deletions

View File

@@ -1,6 +1,7 @@
release := ""
qemu_flags := ""
cargo_flags := "" + if release != "" { "--release" } else { "" }
KERNEL_FLAGS := "-Zbuild-std=core,compiler_builtins,alloc -Zbuild-std-features=compiler-builtins-mem"
bin_path := if release != "" { "target/riscv64/release" } else { "target/riscv64/debug" }
default: run
@@ -13,15 +14,18 @@ sync_filesystem:
sync
update-std:
@cd crates/std && just update-std
@cd library/std && just update-std
build-sysroot:
@cd library/std && just build-sysroot
build_user_prog prog:
RUSTFLAGS="-C relocation-model=pic -C link-arg=-Tuser.ld -C link-arg=-pie" cargo b {{ cargo_flags }} --package {{ prog }}
RUSTFLAGS="-C relocation-model=pic -C link-arg=-Tuser.ld -C link-arg=-pie --sysroot {{ justfile_directory() / "sysroot" }}" cargo b {{ cargo_flags }} --package {{ prog }}
riscv64-elf-strip {{ bin_path / prog }}
cp {{ bin_path / prog }} {{ "mnt/usr/bin" / prog }}
build: mount_filesystem (map_dir "user" f"just release=\"{{release}}\" cargo_flags=\"{{cargo_flags}}\" build_user_prog")
cargo b {{ cargo_flags }}
cargo b {{ cargo_flags }} {{ KERNEL_FLAGS }}
just sync_filesystem
run: build (runner f"{{bin_path / "kernel-rust"}}")
@@ -56,4 +60,5 @@ runner args:
{{ qemu }} -kernel {{ args }}
clean:
cd library && just clean
cargo clean