-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bsp: qemu-virt64-riscv: update README for booting with rootfs
Now lwext4 is ready, and qemu-virt64-riscv smart can boot with rootfs. Updated README to introduce this. This patch also replace qemu-nographic.sh with run.sh, which has a more simple name and more robust to launch rootfs image binary. TBD: qemu-nographic.bat is not touched, hope some guys from Windows can give a hand. Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
- Loading branch information
Showing
4 changed files
with
219 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
usage () | ||
{ | ||
echo "Usage:" | ||
echo "./run.sh [<path_to_image>]" | ||
echo "Note: if <path_to_image> is not provided, will create a 'sd.bin'" | ||
echo "in the current directory and load it by default." | ||
} | ||
|
||
path_image=${1} | ||
|
||
if [ -z $path_image ]; then | ||
path_image="./sd.bin" | ||
if [ ! -f $path_image ]; then | ||
dd if=/dev/zero of=$path_image bs=1024 count=65536 | ||
mkfs.fat $path_image | ||
fi | ||
fi | ||
|
||
if [ ! -f $path_image ]; then | ||
echo "ERROR: $path_image does not exist!" | ||
usage | ||
exit | ||
fi | ||
|
||
qemu-system-riscv64 -nographic -machine virt -m 256M -kernel rtthread.bin \ | ||
-drive if=none,file=$path_image,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 |