For the best experience on desktop, install the Chrome extension to track your reading on news.ycombinator.com
Hacker Newsnew | past | comments | ask | show | jobs | submit | history | g3's commentsregister

If you're bored (or your code is still compiling), you can also try:

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.


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.


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...


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


It makes for a cool demo (and it's a reference to the recent "wasm in docker" announcement).



Or, if you want to go one level deeper, v86 has a complete Linux environment with both python and sqlite running locally: https://copy.sh/v86/?profile=archlinux&c=python%20-ic%20%27i...


That's pretty trippy, I have my caps lock globally disabled (mapped to ctrl) in X config, but inside that v86 window, caps lock works. And it uses some hardcoded (US) keymap, too.

I'm surprised, I didn't think browsers would receive those detailed keycodes.


`event.key` returns the key with the mappings, e.g. "E"

`event.keyCode` returns the physical key, e.g. "KeyE"


v86 also recompiles machine code to web assembly. The main difference is that v86 is a hobby project (of which I'm the original author, by the way), with much fewer contributors and no (known) commercial users, and is much less sophisticated than this project. On the other hand, v86 is open source, so you could make it sophisticated if you wanted to :-)

I'm not sure what exactly cheerps is used for; v86 is mostly used to demo operating systems (mostly hobby and vintage). We recently got SerenityOS to run: http://copy.sh/v86/?profile=serenity


It's the disk access. In order to open My Computer, Windows reads 6399 disk sectors, which are read using ~150 http requests.



And here is a concise JavaScript tetris (playable: http://copy.sh/tetris/):

    f=[];p=[1];g=h=2;s=0;t=500;for(i=0;23>i;i++)f[i]=j=-16380;f[23]=-1;onkeydown=e;e(e);function e(b,a){(k=b.which)?k-38?k&-3^37||(g+=a=k^37?-1:1):(z=p,v=p[2],c=p[1],p=[2*v&2|4*c&4,p[3]/2&1|v&2|2*c&4|4*p[0]&8,p[3]/4&1|v/2&2|c&4|2*p[0]&8,v/4&2|c/2&4]):s-j&&setTimeout(e,100+t,h++);m=p[0]<<g;l=p[1]<<g;_=p[2]<<g;o=p[3]<<g;f[h+=32==k]&m|f[1+h]&l|f[2+h]&_|f[3+h]&o?a?g-=a:k^38?(f[h]|=l,f[--h]|=m,f[2+h]|=_,f[3+h]|=o,h?(g=6,x=new Date%7*4,p=[h=0,2908739>>x&15,266758006>>x&15],t*=.97):s+=" Game Over!"):p=z:k^32||e(b);for(y=_=o="";24>++y;o+="\n")for(f[y]+4||(f.splice(y,1),f.unshift(j),s+=++_,o="",y=2),x=14;x;q.textContent=o+s)o+=" X"[(f[y]|p[y-h]<<g)>>x--&1]}


Just because you minify and obfuscate this code doesn't somehow make it better or let you win the "contest".

I can walk through the submitter's code and understand what's happening clearly. It's fairly well structured and easy enough to read. This is 20x more valuable than any code that is produced using uncommented edge features for a perceived 5% gain. (Note that I'm making up these numbers to illustrate a point.)


Wait, where did the OP say it was better or won some contest?


I think you're taking this too seriously


It's a fully emulated PC: CPU, memory, hard drive, … The CPU especially took me very long to get right with all the details to run Windows 98.

The code is here: https://github.com/copy/v86


NSA backdoor!

https://github.com/copy/v86/commit/159f565de4dd99bff9b46c45a...

Nope, Windows 98 undefined instruction.



Incredibly impressive. Greetings and high fives from the intertubes.


Do you worry that Microsoft might threaten you for the Windows 98 image? I don't think they make a cent from it anymore, but big companies and common sense aren't common bedmates.


So far Microsoft haven't even sent me a C&D for https://win95.ajf.me/, and that site got media attention!


This is the most impressive part! Well done! So in theory, we can run anything that a real PC can run, albeit a Win98 speced PC. Any takers to get the next generation in the Windows series to run on it. WinXP? I think.

PS: Just came across the HN discussion around the said x86 emulator.

https://news.ycombinator.com/item?id=6567967


This is amazing. Really great work. Thanks for building this.


Thanks for that



Nope, try harder ;)


I got onto the second screen and ragequit.


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

Search:

HN For You