Our RISC-V emulator PasRISCV
Our emulator PasRISCV is built for the game SEEDS, which features a fully emulated Linux system that allows players to access various tools through a program selector. This emulator is powered by our in-house PasRISCV project, an open-source software created in Object Pascal, available for everyone to examine and potentially utilize. PasRISCV and its frontend companion pasriscvemu are licensed under the zlib license.
To implement the emulation, we chose to emulate a complete virtual machine, including display and storage devices, interrupts, and other components, making the running kernel perceive it as a fully functional hardware system. PasRISCV uses the 64-bit RISC-V instruction set architecture (ISA), which is an open standard and allows hardware devices to be built based on it without incurring any royalties for using the RISC-V ISA.
The system supports SMP/MultiHART, RV64GC, and RVA23, along with Hypervisor and Vector extensions, as well as additional scalar and vector cryptography extensions. The CPU is emulated using a hybrid approach, combining an interpreter with a tracing JIT compiler, which is currently limited to x86-64 hosts. However, about 99% of the instructions are supported by this JIT compiler.
Floating-point operations can be handled directly by the host FPU, while stricter behavior can be achieved using an optional software floating-point mode.
During game setup, the emulator booted the system through a U-Boot chain, allowing a normal Linux kernel to be used with disk images residing in the initramfs. These images can be attached as VirtIO Block devices or emulated NVMe hardware over PCIe, operating in read-write or read-only modes. Host directories can be made accessible inside the guest through VirtIO-9P or VirtIO-FS, which is particularly useful for development purposes.
Our game uses a modified version of Alpine Linux v3.23.6 together with a custom kernel build. PasRISCV provides several virtual graphics adapters, with the simple framebuffer display being particularly useful for our game, as it is fast and allows processing of its output with custom shaders, adding retro visual effects. PasRISCV also supports various audio emulation, including retro sound cards, Intel HDA, VirtIO sound, and more, which contribute to the overall gaming experience.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.