Javascript PC! / Linux in a browser!

That’s right.  Fabrice Bellard, has done it again, he’s given us such great things like TCC, Qemacs, and of course, Qemu.  But now he’s written a x86 emulator in javascript.

Thats right, javascript.

Behold jslinux (works in Chrome 11 & Firefox 4).

I must say, it’s fast.  A lot faster than I would have ever expected.

The hardware is a basic CPU, clock chip, and a UART.  however it’ll run things like vi just fine.  If you have either browser, give it a shot, it’s nothing short of amazing.

CP/M & Zork in Java Script!!!

Yes, it’s finally happened!!!!

This morning, I got an email from Stefan Tramm, informing me of his work.. Basically he’s combined ShellInABox’s vt100 commands, js8080’s Intel 8080 emulator, along with z80pack’s disk format, and CP/M port to provide a CP/M emulator that works in Java Script!!!

YES.

It is that cool.

Now the emulator is one of these new fancy HTML5 applications, which means you’ll need either Google Chrome 5, or Safari 5.. I would imagine Internet Explorer 9 and a later Firefox ought to work….

One thing that you’ll want to do is configure your popup blocker to allow the domain tramm.li to open up popup windows, as that is how you mount disk images into the VM..

To get going though it’s real simple. Just click http://www.tramm.li/i8080/ and hit the “Start Emu8080” link, and you’ll get to the console.

Next you’ll have to download a copy of CP/M 2.2 from the server into your local browser datastore by type in:

 

CPM-1

r 0 cpma

Then load in the bootsector…

CPM2

 

b

Then start executing at 0

CPM3

 

g 0

 

Then you’ll be in CP/M

All running in a browser!

So taking it one step further, I downloaded and built the Cpmtools 2.13 on OS X, used the cpma.cpm disk image as a template, deleted it’s contents and then inserted the ZORK 1 data & program into the disk image… Giving you a zork1.cpm.

So if you’ve turned off the popup blocker on Chrome, you can type in the ‘dsk’ command before you boot up CP/M. This way you can load it into the disk 1 position (B:) then boot up CP/M and play….

CP-M Zork1 on Javascript

 

All and all, I have to say this is really impressive for something like javascript to actually be somewhat usable… Naturally a 3Ghz+ CPU makes it all possible…. lol GWBasic users back on the 4Mhz machines ought to cringe every time thinking about the level of speed required to pull this off…!!!!

And thanks to Stefan for emailing me about this!

— edit

Stefan has added the zork1 disk image onto his server, so you can now simply load it via:

r 1 zork1

And that’ll place Zork 1 into the ‘B:’ drive.

NES emulator written in JAVASCRIPT.

Well I guess we have officially crossed the bridge, where multiple Ghz machines can run scripts that can emulate a 1.8Mhz 6502 in realtime.

behold JNES.

And frankly the bigger thing to behold is just how FAST Google chrome is at java script. On my Intel Centrino laptop the google benchmark (http://v8.googlecode.com/svn/data/benchmarks/v5/run.html) scores 105 in Internet Explorer 8, while Google Chrome scores 3330.

That’s not a typo, Google Chrome is more then 31x faster than IE at executing Java Script.

I’ve got to find out where that whole NaCL thing went to, and where it is.

But seriously, go check it out! Mario in a browser without flash!