Live data from Hacker News

Show HN: My x86 emulator written in JavaScript

copy.sh

111–120 of 194 posts

Re: Show HN: My x86 emulator written in JavaScript

#111
post #66
post #49

Earlier quoted context omitted.

Wait how does this differ from JSLinux? Aren't they doing the same thing? Also, this isn't just an x86 emulator, right? If it can boot linux, it's emulating the entire PC platform, not just x86. Very impressive of course. But I am interested in a comparison vs jslinux (also not open source).

Yes, it's very similar to the jslinux project. However, I added more hardware (it can boot a real bios: seabios). Also, I'll make this open source.

great to hear you are opensourcing this!

I had a quick look at the minified source. its pretty hard to decipher (method names have been renamed too), unlike traditional minification which you can recover by just reformatting.

Re: Show HN: My x86 emulator written in JavaScript

#113
post #67
post #50

g3: Probably you have seen my emulator. http://s-macke.github.io/jor1k/ It does more or less the same, but emulates a different CPU. Your emulator is impressive and especially fast. I think it took a long time for you to optimize it. I tried to start TinyCore, but it stops after decompressing the kernel. So still some work to do ;)

I saw the source and I have some tips for you: Avoid the UInt32 Arrays and the >>> operator. They could be transformed by the JIT compiler into doubles and slow everything down. This does not happen with the Int32 Arrays and the >> operator. There is a plug-in called JIT-Inspector which give you this information. Unfortunately it does no longer work in Firefox 24. Firefox 22 was the last working version. Additionally…

Do you have any documentation to support the stuff about UInt32? The old Firefox JIT had some limitations like this but I'm not aware of anything like that in the current one (which has been shipping for multiple versions). Is it a v8 limitation similar to the 31-bit 'small integer' limitation?

Re: Show HN: My x86 emulator written in JavaScript

#114
post #17

Earlier quoted context omitted.

I'll put it online soon. I haven't figured licensing out yet and need to write some technical notes

I would like you to consider GPLv3+. Thanks and congrats on amazing work!

In a case like this, the more important licensing question is that of the x86 instruction set; I do not know what the strict licensing situation would be with that—it's quite possible (probable, actually) that this is technically illegal.

For the software part, why would you advocate GPLv3+ over permissive licenses like MIT/BSD/Apache?

Re: Show HN: My x86 emulator written in JavaScript

#115
I've been waiting ages for this ever since I saw jslinux. This is freaking brilliant.

Looking at the source its been minified. How big is it before that? Are you planning on going open source? Was kind of blown away to see the single js file do all this. Would love to see the method's names to understand how it works

Re: Show HN: My x86 emulator written in JavaScript

#116
post #19
post #16

no network interfaces :( boo. rm -rf or halt -f are fun. this is great work. would love to see source un-minified.

Networking is on the todo list. I couldn't host the traffic, though.

i suppose you could try adding something to do the networking part via webrtc as the channel?

Re: Show HN: My x86 emulator written in JavaScript

#118
My second computer was an IBM XT 8086. That was the first time I played and fell in love with Rogue. Every time I grab a copy of Rogue nowadays for nostalgia's sake I'm left disappointed because I can never find the version of Rogue that I played as a kid.

My friend, your emulator has that version of Rogue. The kid inside me thanks you greatly.

Re: Show HN: My x86 emulator written in JavaScript

#119
post #67

Earlier quoted context omitted.

I saw the source and I have some tips for you: Avoid the UInt32 Arrays and the >>> operator. They could be transformed by the JIT compiler into doubles and slow everything down. This does not happen with the Int32 Arrays and the >> operator. There is a plug-in called JIT-Inspector which give you this information. Unfortunately it does no longer work in Firefox 24. Firefox 22 was the last working version. Additionally…

Do you have any documentation to support the stuff about UInt32? The old Firefox JIT had some limitations like this but I'm not aware of anything like that in the current one (which has been shipping for multiple versions). Is it a v8 limitation similar to the 31-bit 'small integer' limitation?

Indeed at the moment I have nothing to support it. Half a year ago I had dozens of examples. Now it is more or less experience. In v8 I had two weeks ago some strange deoptimizations behavior in my code. It was almost gone after I exchanged two >>> operations. So in my experience it is still better to avoid such cases. No one knows really how the JIT compiler are working. What makes it worse. The behavior is changing every 6 weeks. And don't forget: Out there is more than Firefox and Chrome ;)

Re: Show HN: My x86 emulator written in JavaScript

#120
post #6

This may as well be magic as far as I'm concerned. When I first saw http://bellard.org/jslinux/ I just about shat myself. This is definitely another level of awesome. Well done.

I just ran Bellard's JSLinux (#) on my retina iPad with iOS 7. It works! Booting took 15 sec. Claims 20 bogoMips. And I can type the commands in it and execute them:

First I tap to the edit box on the right, the keyboard rolls in, then I tap in the "console." The commands work. I just don't know how I'd type ctrl-Keys without the physical keyboard.

Copy.sh ends with unimplemented GP handler however for anything I've tried.

#) JSLinux: the PC emulator is written in Javascript with the emulated hardware: 32 bit x86 compatible CPU, 8259 Programmble Interrupt Controller, 8254 Programmble Interrupt Timer, 16450 UART, Real Time Clock, IDE interface and hard disk. http://bellard.org/jslinux/tech.html

Post reply on HN