2022-12-03 12:07:44 +08:00
|
|
|
if [ ! -f "sd.bin" ]; then
|
|
|
|
dd if=/dev/zero of=sd.bin bs=1024 count=65536
|
2023-09-26 10:22:35 +08:00
|
|
|
mkfs.fat sd.bin
|
2022-12-03 12:07:44 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
qemu-system-riscv64 -nographic -machine virt -m 256M -kernel rtthread.bin \
|
|
|
|
-drive if=none,file=sd.bin,format=raw,id=blk0 -device virtio-blk-device,drive=blk0,bus=virtio-mmio-bus.0 \
|
|
|
|
-netdev user,id=tap0 -device virtio-net-device,netdev=tap0,bus=virtio-mmio-bus.1 \
|
|
|
|
-device virtio-serial-device -chardev socket,host=127.0.0.1,port=4321,server=on,wait=off,telnet=on,id=console0 -device virtserialport,chardev=console0
|