Last active
August 8, 2022 15:14
-
-
Save cconstab/e63ffc14f50aae0279b5dc30d9033cad to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Get Qemu | |
https://www.qemu.org/download/ | |
Get ubuntu for risc v5 - I choose ubuntu-20.04.4-preinstalled-server-riscv64+unmatched.img | |
https://wiki.ubuntu.com/RISC-V | |
Uncompress with xz and give yourself some more space - I did this using a WSL 2 ubuntu shell as it was easier to use the tools from linux | |
xz -dk ubuntu-20.04.4-preinstalled-server-riscv64+unmatched.img.xz | |
qemu-img resize -f raw ubuntu-20.04.4-preinstalled-server-riscv64+unmatched.img + 25G | |
Now you need some firmware and a kernel for risc V which can be downloaded from here | |
https://github.com/riscv-software-src/opensbi | |
Download the latest opensbi release and grab the files you need | |
cp opensbi-1.0-rv-bin/share/opensbi/lp64/generic/firmware/fw_jump.elf fw_jump.elf | |
Download a uboot deb so you can pull out uboot.elf | |
http://ftp.us.debian.org/debian/pool/main/u/u-boot/ | |
u-boot-qemu_2022.04+dfsg-2_all.deb - is what I choose | |
expand it | |
ar -x u-boot-qemu_2022.04+dfsg-2_all.deb | |
xz -dk data.tar.xz | |
tar xvf data.tar | |
cp usr/lib/u-boot/qemu-riscv64_smode/uboot.elf uboot.elf | |
OK ready to roll | |
qemu-system-riscv64 -machine virt -m 4096 -smp 4 -bios fw_jump.elf -kernel uboot.elf -device virtio-net-device,netdev=eth0 -netdev user,id=eth0 -drive file=ubuntu-20.04.4-preinstalled-server-riscv64+unmatched.img,format=raw,if=virtio -cpu rv64 | |
username ubuntu | |
password ubuntu | |
I found the above mentioned deb file here:
http://http.us.debian.org/debian/pool/main/u/u-boot/u-boot-qemu_2022.04+dfsg-2_all.deb
Theo, sorry for being so tardy getting back to you..., I will have a re run through the Gist and update with answers this week... Been very busy with one of my other projects at https://github.com/atsign-foundation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
has it percolated up to 'official' status?
https://packages.debian.org/sid/u-boot-qemu
Package: u-boot-qemu (2022.04+dfsg-2)
A boot loader for qemu
Das U-Boot is a cross-platform bootloader for embedded systems, used as the default boot loader by several board vendors. It is intended to be easy to port and to debug, and runs on many supported architectures, including PPC, ARM, MIPS, x86, m68k, NIOS, and Microblaze.
This package includes boot loaders for qemu/kvm.
Included platforms: qemu-ppce500 qemu-riscv64 qemu-riscv64_smode qemu-x86 qemu-x86_64 qemu_arm qemu_arm64