Description

There are already numerous ways to run Linux and some programs through emulation in a web browser (e.g. x86 and riscv64 on https://bellard.org/jslinux/), but none use WebGL/WebGPU to run the emulation on the GPU.

I already made a PoC of an AArch64 (64-bit Arm) emulator in OpenCL which is unfortunately hindered by a multitude of OpenCL compiler bugs on all platforms (Intel with beignet or the new compute runtime and AMD with Mesa Clover and rusticl). With more widespread and thus less broken GLSL vs. OpenCL and the less complex implementation requirements for RV32 (especially 32bit integers instead of 64bit), that should not be a major problem anymore.

Goals

Write an RISC-V system emulator in GLSL that is capable of booting Linux and run some userspace programs interactively. Ideally it is small enough to work on online test platforms like Shaderoo with a custom texture that contains bootstrap code, kernel and initrd.

Minimum:

riscv32 without FPU (RV32 IMA) and MMU (µClinux), running Linux in M-mode and userspace in U-mode.

Stretch goals:

FPU support, S-Mode support with MMU, SMP. Custom web frontend with more possibilities for I/O (disk image, network?).

Resources

RISC-V ISA Specifications
Shaderoo
OpenGL 4.5 Quick Reference Card

Looking for hackers with the skills:

Nothing? Add some keywords!

This project is part of:

Hack Week 24

Activity

  • about 18 hours ago: jfkw liked this project.
  • 9 days ago: mwilck liked this project.
  • 11 days ago: horon liked this project.
  • 12 days ago: wfrisch liked this project.
  • 12 days ago: mbrugger liked this project.
  • 17 days ago: vliaskovitis liked this project.
  • 23 days ago: mfriedrich liked this project.
  • 23 days ago: mfriedrich joined this project.
  • 23 days ago: favogt started this project.
  • 23 days ago: favogt originated this project.

  • Comments

    • wfrisch
      12 days ago by wfrisch | Reply

      Impressive! Godspeed with that project.

    Similar Projects

    This project is one of its kind!