drorgl / esp32-tinyemu

A fork to Fabrice Bellard's TinyEmu ported to ESP32
MIT License
51 stars 14 forks source link

TinyEMU on ESP32 (and other systems, embedded or otherwise)

This project is based on Fabrice Bellard's TinyEmu RISCV emulator ported to Windows and ESP32.

It uses virtual memory based on files to provide the emulator with desired RAM.

ESP32

IMAGE ALT TEXT HERE

Update 2023-04-13: Reduced by 40%, about 1:50 seconds to get to bash from power up, 12 seconds for ls -l.

Currently there's no support for networking but it should be pretty easy to implement, though I'm not sure how functional its going to be given the above stellar execution time.

Compile and Upload to ESP32

pio run -e esp32 -t upload

Basic Configuration

The arguments for running temu on ESP32 are hardcoded to root-riscv32.cfg on sdcard under emu subfolder, you should put your bbl, kernel and rootfs in the same folder and configure it:

{
    version: 1,
    machine: "riscv32",
    memory_size: 128,
    bios: "bbl32.bin",
    kernel: "kernel32.bin",
    cmdline: "console=hvc0 debug ignore_loglevel earlycon=sbi root=/dev/vda rw",
    drive0: { file: "rootfs32.bin" }
}

How to build your own linux

Please see buildroot-tinyemu

References