Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: RISC-V Linux Terminal emulated via WASM (cartesi-machine.surge.sh)
5 points by edubart on Aug 27, 2023 | hide | past | favorite | 5 comments
Weekend creation: A Linux terminal on top of a RISC-V emulator running in the browser via WebAssembly, powered by the Cartesi Machine. Check cool commands to experiment in the project page https://github.com/edubart/cartesi-wasm-term



webvm has [Tailscale] sockets-over-WebSockets for networking: https://github.com/leaningtech/webvm and:

> runs an unmodified Debian distribution including many native development toolchains.

> WebVM is powered by the CheerpX virtualization engine, and enables safe, sandboxed client-side execution of x86 binaries on any browser. CheerpX includes an x86-to-WebAssembly JIT compiler, a virtual block-based file system, and a Linux syscall emulator.

How do CheerpX and Cartesi Machine compare?


Main differences in emulation context:

- The Cartesi Machine can run any Linux distribution with RISC-V support, it emulates RISC-V ISA, while CheerpX emulates x86. For instance the Cartesi Machine can run Alpine, Ubuntu, Debian, etc.

- The Cartesi Machine performs a full Linux emulation, while CheerpX emulates only Linux syscalls.

- The Cartesi Machine has no JIT, it only interprets RISC-V instructions, so it is expected to be slower than CheerpX.

- The Cartesi Machine is isolated from the external world and this is intentional, so there is no networking support.

- The Cartesi Machine is a deterministic machine, with the possibility to take a snapshot of the whole machine state so it can be resumed later, CheerpX was not designed for this use case.


Perhaps if it's possible to generate a RISC-V CPU in 5 hours, it's also possible to generate a JIT for RISC-V with a similar approach? https://news.ycombinator.com/item?id=36566578

"Show HN: Tetris, but the blocks are ARM instructions that execute in the browser" (2023) https://news.ycombinator.com/item?id=37086102 ; emu86 supports WASM, MIPS, RISC-V but not yet ARM64/Aarch64

Is there a "Record and replay" or a "Time-travel debugger" at the emulator level or does e.g. rr just work because Cartesi Machine is a complete syscall emulator?


Probably about as fast as a real RISC-V machine too.


Three years ago, yes, or $10 ones now. But the current $80-$200 machines with either 1.85 GHz 3-wide OoO (TH1520: Lichee Pi 4A, Beagle "Ahead", others coming...) or even 1.5 GHz 2-wide in-order (JH7110: VisionFive 2, Star64, others coming...) are several times faster, per core.

And you can shortly get that 1.85 GHz 3-wide OoO in a 64 core chip, on single- and dual-socket motherboards (64 or 128 cores), with quad-socket coming soon. I've been using such a machine via ssh since March, customer deliveries will start in a couple of months.

https://www.crowdsupply.com/milkv/milk-v-pioneer




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: