I want to write an emulator as a learning experience. Any tips how should I start?
I recently posted about emulating the NES with JavaScript. http://blog.alexanderdickson.com/javascript-nes-emulator-par... Part 2 will be posted when it's done. :) If you want to get something done much quicker, have a go at emulating the Chip-8 VM. I also have a post, but it's less hand-holding than the first. http://blog.alexanderdickson.com/javascript-chip-8-emulator Good luck!
Show HN: My x86 emulator written in JavaScript
121–130 of 194 posts
Re: Show HN: My x86 emulator written in JavaScript
#122Earlier quoted context omitted.
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
#123Is there a non minified version of the javascript emulator file that is publicly available?
I'll put it online soon. I haven't figured licensing out yet and need to write some technical notes
... Since you're using seabios, I guess its bringup is relatively close to qemu's?
Re: Show HN: My x86 emulator written in JavaScript
#124Very impressive. Interesting bug: I can't seem to type '-', '=', '+', or '_' into the Linux image. Missing '-' in particular makes it hard to run commands with options. Elaborate workaround: /root% eval eq$(dmesg | grep 'e820 update' | sed 's/.*) \(.\).*/\1\1/') /root% echo $eq = /root% eval dash$eq$(uname bad 2>&1 | grep Usage: | sed 's/.*\[\(.\).*/\1/') /root% echo $dash - /root% uname ${dash}a Linux (none) 2.6.34.…
I found that bug too. First thing I did was think, "a system restore is a page refresh away and I've always wanted to test the effects of this", then I attempted to type "rm -r /*".
Re: Show HN: My x86 emulator written in JavaScript
#125Earlier quoted context omitted.
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.
AFAIK most of minificators also shortened variable / function names - are there any that don't do this? (take a look at minified jquery.js for instance)
Re: Show HN: My x86 emulator written in JavaScript
#126Earlier quoted context omitted.
I recently posted about emulating the NES with JavaScript. http://blog.alexanderdickson.com/javascript-nes-emulator-par... Part 2 will be posted when it's done. :) If you want to get something done much quicker, have a go at emulating the Chip-8 VM. I also have a post, but it's less hand-holding than the first. http://blog.alexanderdickson.com/javascript-chip-8-emulator Good luck!
I really like your tutorial. I been trying to learn assembly and your tutorial is really helping me put the big picture together. I hope you continue to work on making it better.
Re: Show HN: My x86 emulator written in JavaScript
#127This 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.
This really is extremely well done [and I'd like to see the unminified source]. The next feature I'd want to see is networking support. I love the idea to be able to run my entire dev setup in an emulated browser session [e.g. ruby, rails, redis]. That would be a game changer on how I'd develop.
Why? I'm honestly curious since I can't imagine any big advantages over more "classic" setups ...
Re: Show HN: My x86 emulator written in JavaScript
#128Very impressive. Interesting bug: I can't seem to type '-', '=', '+', or '_' into the Linux image. Missing '-' in particular makes it hard to run commands with options. Elaborate workaround: /root% eval eq$(dmesg | grep 'e820 update' | sed 's/.*) \(.\).*/\1\1/') /root% echo $eq = /root% eval dash$eq$(uname bad 2>&1 | grep Usage: | sed 's/.*\[\(.\).*/\1/') /root% echo $dash - /root% uname ${dash}a Linux (none) 2.6.34.…
printf '\055'
returns -
Just change 055 for 075 (=), 053 (+) or 137 (_).eg your $eq code can be written like this:
eval eq$(printf '\075\075')Re: Show HN: My x86 emulator written in JavaScript
#129Earlier quoted context omitted.
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…
V8 has special support for uint32 values in optimized frames to avoid converting them to doubles when they flow into truncating operations. If that support somehow became broken that would be unfortunate. (and it's actually only >>> 0 that is problematic from the optimization point of view. as long as you shift by non zero result is within Int32 range).
Re: Show HN: My x86 emulator written in JavaScript
#130Earlier quoted context omitted.
This is the most soul-crushing category of bug, the kind which keeps me up all night, drinking. Build a skyscraper, and lock the keys inside for the ribbon cutting. Sorry pal you lost your funding Land on Mars, see an alien, but your camera is out of batteries and everybody back on Earth thinks you're a quack. Successfully perform open-heart surgery on a desert island, but muck up the stitches and cause a scar. Your…
Luckily, he was able to come up with a workaround. Here's a soul-crushing situation that doesn't have a workaround, as far as I can tell. You can play the original Deus Ex on OnLive. By default, it sets the fov to a very low number. It's only possible to change it in the console (there is no UI for it). But the console is disabled. However, you can get around that by pressing T, which creates a mini console with "say…