Sync computers
This commit is contained in:
17
justfile
17
justfile
@@ -2,6 +2,7 @@ release := ""
|
||||
qemu_flags := ""
|
||||
cargo_flags := "" + if release != "" { "--release" } else { "" }
|
||||
bin_path := if release != "" { "target/riscv64/release" } else { "target/riscv64/debug" }
|
||||
rust_src := `rustc --print sysroot` / "lib/rustlib/src/rust/library/std/src"
|
||||
|
||||
default: run
|
||||
|
||||
@@ -12,6 +13,18 @@ mount_filesystem:
|
||||
sync_filesystem:
|
||||
sync
|
||||
|
||||
cp_std path:
|
||||
@echo "Copying {{ path }}"
|
||||
@mkdir {{ "crates/std/src" / parent_directory(path) }} -p
|
||||
@cp {{ rust_src / path }} {{ "crates/std/src" / path }}
|
||||
@perl -i -0777 -pe 's/^\s*#!?\[(un)?stable\(.*?\)\s*\]\n//gsm' {{ "crates/std/src" / path }}
|
||||
@perl -i -0777 -pe 's/^\s*#!?\[rustc_.*?\]\n//gsm' {{ "crates/std/src" / path }}
|
||||
|
||||
update_std:
|
||||
@just cp_std "ffi/c_str.rs"
|
||||
@just cp_std "ffi/mod.rs"
|
||||
@just cp_std "ffi/os_str.rs"
|
||||
|
||||
build_user_prog prog:
|
||||
RUSTFLAGS="-C relocation-model=pic -C link-arg=-Tuser.ld -C link-arg=-pie" cargo b {{ cargo_flags }} --package {{ prog }}
|
||||
riscv64-elf-strip {{ bin_path / prog }}
|
||||
@@ -34,8 +47,8 @@ qemu := f"qemu-system-riscv64 \
|
||||
-device bochs-display \
|
||||
-device virtio-keyboard-pci \
|
||||
-device virtio-mouse-pci \
|
||||
-device loader,file=disk.img,addr=0x90000000 \
|
||||
-bios none -m 512M {{qemu_flags}}"
|
||||
-device loader,file=disk.img,addr=0xA0000000 \
|
||||
-bios none -m 1024M {{qemu_flags}}"
|
||||
|
||||
# -trace \"virtio*\"
|
||||
# -d guest_errors,unimp,int"
|
||||
|
||||
Reference in New Issue
Block a user