keyboard through PCI&VirtIO
This commit is contained in:
18
justfile
18
justfile
@@ -1,4 +1,5 @@
|
||||
release := ""
|
||||
qemu_flags := ""
|
||||
cargo_flags := "" + if release != "" { "--release" } else { "" }
|
||||
bin_path := if release != "" { "target/riscv64/release" } else { "target/riscv64/debug" }
|
||||
|
||||
@@ -15,31 +16,28 @@ 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 }}
|
||||
cp {{ bin_path / prog }} {{ "mnt/usr/bin" / prog }}
|
||||
# riscv64-elf-objcopy -O binary {{ 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 }}
|
||||
just sync_filesystem
|
||||
|
||||
run: build
|
||||
cargo r {{ cargo_flags }}
|
||||
run: build (runner f"{{bin_path / "kernel-rust"}}")
|
||||
|
||||
map_dir dir recipe:
|
||||
@for file in `ls {{ dir }}`; do \
|
||||
{{ recipe }} $file ; \
|
||||
done
|
||||
|
||||
qemu := "qemu-system-riscv64 \
|
||||
qemu := f"qemu-system-riscv64 \
|
||||
-machine virt \
|
||||
-serial mon:stdio \
|
||||
-device bochs-display \
|
||||
-global virtio-mmio.force-legacy=false \
|
||||
-device virtio-keyboard-device,bus=virtio-mmio-bus.0 \
|
||||
-device virtio-keyboard-pci \
|
||||
-device loader,file=disk.img,addr=0x90000000 \
|
||||
-bios none -m 512M"
|
||||
-bios none -m 512M {{qemu_flags}}"
|
||||
|
||||
# \
|
||||
# -d guest_errors,unimp \
|
||||
# -trace \"virtio*\""
|
||||
# -trace \"virtio*\"
|
||||
# -d guest_errors,unimp,int"
|
||||
|
||||
perf: build
|
||||
{{ qemu }} -perfmap -kernel {{ bin_path / "kernel-rust" }}&
|
||||
|
||||
Reference in New Issue
Block a user