riscv64¶
Necessary artifacts
└── riscv64 ├── lmp-factory-image-qemuriscv64.wic.gz └── fw_payload.elf
Booting in QEMU¶
Warning
These instructions require QEMU 5.2 or later.
List available Targets and decide on which to boot:
fioctl targets list
Note
Make sure to set the FIOCTL_FACTORY environment variable:
export FIOCTL_FACTORY=<factory>
Make a directory to store the artifacts and
cd
into it.mkdir -p lmp-qemu/riscv64 cd lmp-qemu/riscv64
Download the necessary artifacts for riscv64, replace
<target_number>
with the target you would like to boot# Download and extract the Factory image fioctl targets artifacts <target_number> qemuriscv64/lmp-factory-image-qemuriscv64.wic.gz | gunzip > lmp-factory-image-qemuriscv64.wic # Download OpenSBI Firmware fioctl targets artifacts <target_number> qemuriscv64/fw_payload.elf > fw_payload.elf
The directory tree should now look like this
lmp-qemu/ └── riscv64 ├── lmp-factory-image-qemuriscv64.wic └── fw_payload.elf
Run the QEMU script below against the artifacts inside of
lmp-qemu/
. You may want to save this asrun.sh
inside the directory for convenience
Booting Graphically¶
In order to boot QEMU with an OpenGL capable virtual GPU inside (required for Wayland/Weston), the following flags need to be added to the QEMU CLI:
-display gtk,gl=on -device virtio-gpu-pci
The -nographic
flag must also be removed from the QEMU CLI.
Warning
qemu-system-riscv64 does not currently support this functionality.
https://patchwork.kernel.org/project/qemu-devel/cover/cover.1538683492.git.alistair.francis@wdc.com/
QEMU CLI¶
qemu-system-riscv64 -machine virt -m 1024 \
-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon \
-device virtio-net-device,netdev=usernet \
-netdev user,id=usernet,hostfwd=tcp::22222-:22 \
-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-device,rng=rng0 \
-bios fw_payload.elf \
-monitor null \
-drive file=lmp-factory-image-qemuriscv64.wic,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 \
-nographic