That's not meant to take away from this project - it truly is amazing what can be interpreted in the browser now.
Whilst this is nothing like the several orders of magnitude required for more capable interactive behaviour, it does make my load times noticeably faster than those claimed on the page. :)
(I'm Chrome on Linux, i7 4th Gen, incidentally)
If you're interested in this, please do make plenty of noise at me to finish. I've got a flight back to the East coast from Portland on Sunday, so I'm hoping I can get most of the browser code finished by then. After that I'm going to be somewhat distracted through the end of January, as I'm moving from Charleston, SC to Christchurch, New Zealand. I could use a bit of motivation to get this done.
Why? I'm honestly curious since I can't imagine any big advantages over more "classic" setups ...
Ruby's interestingness to performance ratio is not high.
It is a "social" development platform supporting rails, mysql etc.
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
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).
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.
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.14 #44 Tue Oct 15 20:50:15 CEST 2013 i586 GNU/Linux
The first command grabs an '=' from dmesg and sets "eq" to it (without typing '='), and then the second command grabs a '-' from the usage message of uname and sets "dash" to that (without typing '-'). The last shows how to use ${dash} in a command.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 patient will hold it against you the rest of his life (which you saved).
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 " prepoulated. Press delete to erase say, and type "fov 90". So close...
But they disabled the Enter key from working.
So you can get full access to the console, type the command that would fix the FOV, but you're unable to execute it because Enter key does not get sent to the game. You're completely helpless.
Simple defects where a key is being ignored on certain systems are usually quite easy to fix ;)
Also, any plans to implement GPF handling? I tried booting a test environment I have on it (which runs Python as part of the GRUB2 bootloader), but it failed primarily due to lack of support for trapping GPFs. (There are a few other issues I'd have to work around to make it work, but that's a major one that I can't easily work around.)
Regarding GPFs: This is one of the few things that are not completely implemented yet, I'm working on figuring this out.
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')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!
If you want to write one as a learning experience for how the platform you're emulating works and how an emulator could work in principle, you probably want to write an interpreter: find out how the platform boots, build something to start reading and interpreting instructions, start adding emulated hardware devices, and you'll get an increasingly functional interpreter.
For a start, you could ignore emulation of devices, and just write a CPU core that interprets instructions.
If you want to learn how modern (but still non-hardware-assisted) emulation works, read about how qemu's dynamic code translator and other JIT compilers work, and build a CPU emulator based on that.
At the moment I've only uploaded a demo of the Mac Plus emulator (classic 68k mac) but I'll upload IBM PC and Atari ST demos soon also.
IBM PC with Wolfenstein 3d, Civilization, Monkey Island: http://jamesfriend.com.au/pce-js/ibmpc-games/
IBM PC with Windows 3.0: http://jamesfriend.com.au/pce-js/ibmpc-win/
Mac Plus with applications and games: http://jamesfriend.com.au/pce-js/pce-js-apps/
I feel very strongly about the importance of learning from the past, and not making the same mistakes over and over due to lack of historical perspective. I was particularly inspired by Bret Victor's talk at the DBX conference[1]. That's what motivated me to make this available in the most accessible way possible.
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'm aware of the problem with big integers. I'll look into this more closely, thanks for your help.
Regarding workers: I need some restructuring to get this working. I'll also need to figure out the fastest way to exchange the canvas buffer between the worker and the browser.
For the software part, why would you advocate GPLv3+ over permissive licenses like MIT/BSD/Apache?
... Since you're using seabios, I guess its bringup is relatively close to qemu's?
this is great work. would love to see source un-minified.
Not for anything compute-intensive or serious, but for creating very secure very isolated VMs to run web apps or other services in an insecure environment. It could also be a great way to take a LAMP stack app and rapidly deploy it in certain cases.
Again not for high performance, but for... I can think of a few things personally and I'm sure others can too.
(Though honestly performance wouldn't be that bad...)
Then add the ability to go back and forth between client and server, and virtual networking, and you might have a commercial "virtual DOS LAN with nodes in a browser as a service" startup. What for? Supporting legacy DOS crap: point of sale systems, etc. "Run your legacy DOS stuff in your browser with persistence in the cloud." You'd be surprised how much legacy DOS crap is out there.
ReferenceError: requestAnimationFrame is not defined http://copy.sh/v24/v86_all.js Line: 239
You might want to consider re-ordering the font list in the console though. Consolas isn't perfectly fixed-width apparently, and it made Rogue rather puzzling to play.
I assumed something named consolas would be a font suitable for consoles.
Which font do you like to use?
I'm on Linux, so that might also impact something.
Perhaps the line drawing characters are extra-small or something? Fire up Rogue and try it out...
Also, swapping disks during the install might be an issue, I don't see a button...
I have one problem with it though, it doesn't seem to support my keyboard. For example when I try "*", it writes "-".
I'm using a Turkish Q keyboard and Chromium on OS X Mavericks GM.
I declare your x86 emulator similar nonsense, for all the same reasons. I take my hat off to you. Well done indeed!
2. Ship a COPYING file, add a header to your files: https://github.com/osterman/copyright-header
1. I know it is already available via the page, but would you please open-source it so others could contribute?
2. Thought I appreciate the apps being shown in the canvas in the resolution they are supposed to use, a full-screen option would be incredible. That way I could play space invaders the way it was meant to be played, in FreeDOS, in a JS emulator, in Firefox, on a mac. (That's just so wrong, it's right.)
3. Is that your real hair? (Sorry, just had to throw in a Real Genius quote.)
Still, this wins the Nobel Prize for awesome.
(@Eliezer, how's the work going? ;))
On Android.
Then it usually dies for low memory - and I can't enter anything at all without keyboard (which doesn't pop up) - but still. The fact that I can boot up a x86 emulator in javascript in browser on ARM mobile phone is crazy.
In any case, super awesome! Great work :)
EDIT: Whoa, the dos one has games on it! Can you make Wolf3D work? :)
Decompressing Linux... Parsing ELF... done. Booting the kernel. init[1]: segfault at b8e8e089 ip 08071929 sp bfb81b08 error 4 in busybox[8048000 +7c000] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
atkbd serio0: Spurious ACK on isa0060/serio0. Some program might be trying to ac cess hardware directly.
I'm considering writing some articles, just need to find some free time.
No xhr queries detected in firebug and firefox console. Its is done without AJAX? How its working? Thanks.
saw https packets
The trick is in writing a fast and accurate one.
g3 62 days ago | link | parent | on: Show HN: Virtual Machines in the Browser
Just give me one more month, I'm almost there ...
The last month always takes at least 60 days. Strong work![EDIT] - This post doesn't seem to say enough when I look back at it. Wanted to add this:
Seeing posts like this really excites me (and inspires me) about the future of web programming, and programming in general. Anyone that's excited about programming has to get excited about abstraction, and it doesn't get much more abstract that cross-coded/implemented virtualized systems like this. Even if you hate javascript.
Every step people take in blurring lines between systems like this should be exciting, given the large amount of abstraction that had to go into creating something like this.
/% cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 5
model : 1
model name : Pentium 60/66
stepping : 3
cpu MHz : 1.301
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu pse tsc cx8 pge cmov
bogomips : 2.60
clflush size : 32
cache_alignment : 32
address sizes : 32 bits physical, 32 bits virtual
power management:
Heh, 1.3 MHz on a Pentium 60. 125 kB compressed JS
262 kB uncompressed JS
9765 lines of uncompressed JS
Wow. Unimplemented: #GP handler
Execution stopped
[0] http://plan9.bell-labs.com/wiki/plan9/download/My friend, your emulator has that version of Rogue. The kid inside me thanks you greatly.
1. How can we help? How can I support you? 2. Please open source this.
This is the error that I'm getting:
Unimplemented: load system segment descriptor, type = 9 Execution stopped
Here's a screenshot: http://i.imgur.com/DdCt8jX.png
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
sudoku and snake worked really well, but pong seemed to graphically expensive
Btw, this is what I'm working on http://cloud306.com It's kind of similar, but not really.
This is jaw dropping. Imagine next generation javascript.
Still awesome, though!