Re:Show HN: Docker in the browser using x86-to-WASM recompil...
by s-macke on Tuesday November 01, 2022 @02:34PM
(#33425421)
Can you explain in more detail how this recompilation works? When is it triggered? Because your emulator is still very slow, and recompiling doesn't seem to help. A wiki or blog post would be helpful.
Re:Show HN: Docker in the browser using x86-to-WASM recompil...
by g3 on Tuesday November 01, 2022 @04:37PM
(#33427144)
Yes, I should write about v86's internals some day. Meanwhile, the code is right here: https://github.com/copy/v86/tree/master/src/rust
It's much faster with recompilation than without, but I agree that it's slower than expected (compared to, for example, qemu-tcg).
There is still room for improvements (e.g. eflags updates, 16-bit instructions, call/ret optimisations, main loop), but part of the problem is limitations of web assembly (no mmap, only structured control flow) and browser engines (memory blow up on large generated wasm modules, related to control flow).
The webvm folks explain the control flow problem quite well, and seem to be doing a better job than v86: https://medium.com/leaningtech/extreme-webassembly-1-pushing...
Re:Show HN: Docker in the browser using x86-to-WASM recompil...
by mdaniel on Tuesday November 01, 2022 @04:20PM
(#33426934)
And the whole story seems to be here (available via the Exit button from any of those pages): https://copy.sh/v86/ and https://github.com/copy/v86
SerenityOS: http://copy.sh/v86/?profile=serenity (one of their developers contributed PAE support to v86, which is extra cool. I believe it contains their own browser.)
ReactOS: http://copy.sh/v86/?profile=reactos
Haiku: https://copy.sh/v86/?profile=haiku
9front: http://copy.sh/v86/?profile=9front
Android: http://copy.sh/v86/?profile=android
KolibriOS: http://copy.sh/v86/?profile=kolibrios
HelenOS: http://copy.sh/v86/?profile=helenos
Oberon: http://copy.sh/v86/?profile=oberon
QNX: http://copy.sh/v86/?profile=qnx
Windows 95 with IE 3: http://copy.sh/v86/?profile=windows95-boot
Windows 98 with IE 5: http://copy.sh/v86/?profile=windows98 (run networking.bat)
Windows 2000 with IE 6: http://copy.sh/v86/?profile=windows2000 (run networking.bat)
v86 running in v86 (the inner one is running in node): https://copy.sh/v86/?profile=archlinux&c=./v86-in-v86.js
As well as most BSDs and Linuxes, as long as they still have i686 support.