added riscv64 VM
authorRalph Ronnquist <rrq@rrq.au>
Sat, 21 Sep 2024 02:51:42 +0000 (12:51 +1000)
committerRalph Ronnquist <rrq@rrq.au>
Sat, 21 Sep 2024 02:51:42 +0000 (12:51 +1000)
vm.sh

diff --git a/vm.sh b/vm.sh
index c75ff8a5308a96d9a6688cc8f424d175f71b5d82..910cda3a00db62f615a8899bb71cae2514958c7c 100755 (executable)
--- a/vm.sh
+++ b/vm.sh
@@ -78,6 +78,21 @@ case "$ARCH" in
            -netdev vde,sock=/run/vde.ctl,id=unet
        )
        ;;
+    riscv64)
+       QEMU=qemu-system-riscv64
+       ARGS=(
+           -M virt -smp 4 -m 4G -nographic -serial stdio
+           -kernel riscv64/build/initrd/boot/vmlinux-6.10.9-riscv64
+           -initrd riscv64/initrd.gz
+           -append "console=ttyS0 root=/dev/vda1 roottype=ext4$APPEND"
+           -chardev socket,id=QEMU,server=on,wait=off,path=QEMU-riscv64
+           -mon chardev=QEMU,mode=readline
+           -device virtio-blk-pci,drive=hd
+           -drive if=none,id=hd,file=$IMG,format=raw
+           -device virtio-net-pci,netdev=unet
+           -netdev vde,sock=/run/vde.ctl,id=unet
+       )
+       ;;
     *)
        echo "unknown \$1=$1" >&2
        exit 1