NAME
gyptazy.ch

OPTIONS

CONTENT
FreeBSD 14 RISCV64 Build Box Image for QEMU (2024-02-02):
A RISCV64 based QEMU image offers versatility by enabling the emulation of RISCV64 architecture on various hardware platforms. This flexibility allows developers to create native RISCV64 binaries across different architectures like ARM64 or AMD64. The benefits extend to streamlined cross-compilation, fostering a more accessible and collaborative development environment without installing any developer packages on production system. Moreover, deploying these packages on native RISCV64 boards enhances performance and ensures seamless integration, empowering developers to harness the advantages of RISCV in diverse computing environments. My personal motivation was to not bloat my Vision Five 2 board when compiling binaries that should later be served and run on this board. Attached you will find everything you need to quickly setup your own FreeBSD 14.0 RISCV64 build environment.

Download(s)
* Image: riscv/freebsd/FreeBSD-14.0-RISCV64-Build-Box-Image-QEMU.raw.xz

Credentials
root  password1
builder  builder1

Usage
This image can be used on almost every hardware architecture and does not need any native RISCV64 system. With QEMU you are able to emulate any hardware architecture including RISCV64. While emulating other hardware architectures you may of course encounter a slower performance. Please make sure to have qemu-system-riscv64 in place for your system. Afterwards, you can just spawn up the build image by running:

    qemu-system-riscv64 -machine virt \
      -cpu rv64 \
      -m 4G \
      -device virtio-blk-device,drive=hd \
      -drive file=FreeBSD-14.0-RISCV64-Build-Box-Image-QEMU.raw,if=none,id=hd \
      -device virtio-net-device,netdev=net \
      -netdev user,id=net,hostfwd=tcp::2222-:22 \
      -bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf \
      -kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \
      -object rng-random,filename=/dev/urandom,id=rng \
      -device virtio-rng-device,rng=rng \
      -append "root=LABEL=rootfs console=ttyS0" \
      -nographic


Please make sure to change the path to the location where your downloaded image is located. Afterwards, you are able to connect to the system by ssh by running ssh -p 2222 root@localhost.

Links
* Chat: #riscv64:bsd.cafe (Matrix)
* RISCV64 on BSD Cafe
* Switching from ARM64 to the open-source RISC-V hardware architecture
* Collection of Images and Information for the RISCV64 based Vision Five2 Board