JavaScript-Based OpenRISC Emulator Can Run Linux, GCC, Wayland 89
An anonymous reader writes "The jor1k is an interesting open-source toy emulator project to emulate a 32-bit OpenRISC OR1000 processor, 63MB of RAM, ocfb frame-buffer, and ATA-hard drive ... all in JavaScript. Though JavaScript based, there are asm.js optimizations and the performance seems to be quite decent in modern web browsers. The jor1k OpenRISC emulator can do a lot, even handle running the Linux kernel, GCC compiler, ScummVM Monkey Island, and the Wayland/Weston compositor, all from within the web browser."
Re: (Score:1)
Honestly, admit that you didn't know what to do with ALL that CPU cycles in the first place!
The end is nigh (Score:2, Funny)
Students still have too much time on their hands.
Re:The end is nigh (Score:5, Funny)
Students still have too much time on their hands.
If they're doing all this emulation in JavaScript - they're going to need all that time...
Re: (Score:1)
Students still have too much time on their hands.
When a JavaScript compiler comes, I plan on stocking water, food and ammo and head for the hills.
A get a sandwich board that reads "It's the END OF DAYS! JavaScript can be compiled into native code! REPENT!!
Revelations 666:666
Re: (Score:2)
The classic student project used to be: "Design your own language, and write a compiler for it."
Now it's: "Take something that is not written in JavaScript, and write it in JavaScript."
Re: (Score:2)
Re: (Score:2)
I once wrote a Basic interpreter in Basic to annoy a friend.
Re: (Score:3)
I did the same on a VIC-20 my uncle loaned me. It was functional enough to have subroutines, variables, GOTO and simple IO. My uncle thought the whole thing was utterly idiotic, but it taught me a helluva lot about tokens, string handling, stacks, program counters and the like. It was probably the first project where I "got" programming and decided to become a programmer, way back in the early 1980s.
Re: (Score:2)
I believe that is still the number 1 reason for writing anything in BASIC.
Re:The end is nigh (Score:4, Funny)
Obviously they need to write JavaScript in JavaScript.
So I can wait for code to run while I wait for code to run?
Web applications don't need App Store approval (Score:5, Interesting)
Re: (Score:2)
Web applications run fine, but anything else requires the platform owner's digital signature.
I'm still trying to figure out what magic there is in JavaScript that makes it an acceptably safe way to run unsigned code. Yes, it's an interpreted language running in a sandbox, but then so is Java, and Java applets (seemingly) went from "perfectly safe to run in your web browser" to "disabled by default because they're a big security hole" in the span of about a year. What's to stop something similar from happening to JavaScript (and really, to any Turing-complete language that becomes popular enough f
Re: (Score:2)
There haven't been as many pure Javascript/HTML/CSS security bugs, in comparison, it's almost always plugins.
Also browsers (atleast Firefox ans Chrome) get frequent updates.
The installed base of ChromeOS isn't miniscule anymore. Supposedly 1 in 5 of US schools districts now have ChromeOS as their primary digital student device.
So it will be interesting to watch ChromeOS security track record in the coming years.
Also: A platform that does not have an Internet connection and a browser is a dead platform. Java
Re: (Score:1)
The installed base of ChromeOS isn't miniscule anymore. Supposedly 1 in 5 of US schools districts now have ChromeOS as their primary digital student device.
I live in the technology center of the east coast. We have a Google presence here ... There are no school districts in the state that I'm aware of using ChromeOS.
1 in 5 must not include the same US as the one I live in.
A platform that does not have an Internet connection and a browser is a dead platform.
Sigh, okay, if you can't imagine a use case that doesn't fit your narrow view of the world, one must not exist.
Re: (Score:2)
I meant, what end user operating system or would not include a browser (or a webruntime) these days ?
Probably suicide for a device operating system if you want want any traction in the marketplace.
Currently, for many people the TV and the car do not yet include a browser or webruntime, but that is changing. An example is Automotive grade Linux. The user-facing applications are HTML5-apps.
Re: (Score:2)
Java applets (seemingly) went from "perfectly safe to run in your web browser" to "disabled by default because they're a big security hole" in the span of about a year. What's to stop something similar from happening to JavaScript
For one thing, Chrome runs JavaScript in what amounts to a sandbox within a sandbox. For another, lack of Oracle.
Re: (Score:2)
jor1k Demo Pages (Score:1)
Running the demo in the Chrome browser on Linux pegged one of my 8 CPUs at 100% non-stop. Free memory stayed steady though.
Re: (Score:1, Informative)
Safari, Mac OS X, Mac mini: basically killed my machine, all programs stopped responding and it took minutes to click "Force Quit" the browser.
Re: (Score:3)
What sort of Mac Mini are you using, an original G4 model or someting? I ran the demo just fine in Firefox 24.0 and Safari 6.0.5 on Mac OS 10.7.5 using a MacBook Pro from 2009. Here's a screenshot of Safari running jor1k [palegray.net].
When you say something doesn't work, you should probably include details on what you're trying to run the thing on. Mod parent down.
But does it run Lin- (Score:1)
Oh. I um. I guess it does.
triple threat (Score:5, Funny)
So it's a virtual machine running on a virtual machine running on a virtual machine. Nice.
Re: (Score:2, Funny)
It looks like virtual machines all the way down.
Re: (Score:2)
Re: (Score:2)
and if the universe is actually a turning complete computer that would mean that the physical computer is actually a virtual machine.
Re: (Score:2)
Really, if the universe is Turing complete, I think that's strong evidence that the universe itself is a virtual machine.
Re: (Score:2)
Right, but it's only just gained keyboard support, so up until now it was a fairly boring text-demo.
Re: (Score:3)
Who cares about a hardware simulator running in a web browser?
I do.
Re: (Score:2)
I have zero use for it, but it is still neat and cool.
Kudos to the coder.
But can it run a web browser? (Score:3)
(I heard you like Javascript and Linux, so I put a Linux inside your Javascript inside your Linux inside your Javascript inside your Linux.)
Re: (Score:2)
oh...
oh god.
Can't tell if awesome or horrifying.
Re: (Score:2)
I think my brain just did a div-by-zero. Thank you for making/ruining my day.
Misapprehension (Score:2)
"The machine is big endian machine, but the typed array from Javascript work with little endian. "
I'm already not impressed.
Same for x86 (Score:3, Insightful)
Well, I guess everyone has read about the Javascript PC emulator :
http://bellard.org/jslinux/index.html
Just Stop. Please. It's Time to Stop. (Score:3, Insightful)
Remaking EVERYTHING in JS is a total, complete waste of time. There's a saying that everything that can be written in C will eventually be written in C. This makes sense because once it's in C, it's going to run really quickly. That little whatever that was re-written in C, even partially, is just about as good as it gets when it comes to responsive, low-overhead, user-space tools. JS will never get appreciably better than it is now without those improvements affecting all other dynamic languages in turn, and JS is not regarded as a mogul of excellent syntax, language features, or any of the other notable strengths of other languages. Anything written in JS will eventually need a re-write. Using Node for little async, concurrent server communication relatively a niche. Just stop. This JS nonsense is way out of hand.
Re: (Score:2)
There's a saying that everything that can be written in C will eventually be written in C. This makes sense because once it's in C, it's going to run really quickly.
Or not run at all if it doesn't get digitally signed. You often need permission from a platform's curator to use C on that platform. You don't need anyone's permission to use JavaScript.
Re: (Score:2)
That can change.
Re: (Score:2)
Re: (Score:2)
sure, on the day that webpages either stop using js for everything OR the machine in question becomes so locked up that you can't browse the web with it.
Re: (Score:1)
Or not run at all if it doesn't get digitally signed.
Then you shouldn't be writing a emulator in JS. Not our fault if the system is a walled-garden. Plus I'd imagine that once this gets popular enough, EULAs and Developer Agreements will be rewritten to forbid it. If they don't already.
The greatest thing we have when it comes to IT is the ability to run what we (the owner of the physical device) want to, and the clueless and ignorant willingly hand over control in exchange for it being an appliance.
It will be a sad day indeed when the only way to run what you
Re: (Score:1)
Because they can.
Off topic, what happened to my slashdot, where this post would get modded down.. :(
Re: (Score:2)
The Javascript version of Facebook may have felt unresponsive on an iPhone 4 or 4S, but those days are history.
Nitpicking a bit - the JS engine used in Safari has seen much improvement in the past few years. But if you make a HTML5-based app with something like Cordova, it will use the old JS engine which is markedly slower. Sure, faster processor helps, but it would be nice if Apple would enable the newer JS engine on HTML5-based apps instead of just Safari.
Re: (Score:1)
Re: (Score:1)
You have it backwards—developers will hate the move to JS, and users won't notice. It's exactly the opposite of what you describe.
Developers won't do it willingly, but their clients and/or employers will demand it. It's strictly financial.
Re: (Score:2)
You are missing a major point. It's not just about being able to write a machine emulator in javascript, although that is a very impressive feat. Javascript has one major feature that no other language has: it runs natively, with no plugins required, in every modern Web browser. Javascript is realizing the dream that java aspired to: it runs on every modern computing platform.
As evidenced by the success of Google's Chromebooks, the Web browser is becoming, in and of itself, an operating system. There's
Re: (Score:2)
It's almost like forbidding people to write books in Japanese because the good ones eventually get translated to English.
People do what they like. Deal with it.
Re: (Score:2)
Oh STFU. If you come out with a neat piece of software that runs in a browser, you can post a link to it (like this one) and millions of people can run it in a single click because it's so damn easy. If your software is written in anything else but JavaScript, people have to screw around downloading runtimes and saving and executing binaries, and at best 5% as many people will bother trying it. Sure, an app store simplifies that, but now you have to build multiple app versions, iOS, Android, and whatever th
Javascript is a language - can write stuff in it! (Score:2)
News at 11.
Although TBH I like all these demonstrations of just how far we've regressed. "Remember doing this in the mid-'80s on an 8MHz 8086? Remember finding it a bit slow, then being so happy when you upgraded to that 286? Relive the original experience once again with feeling on a 2.6GHz desktop... in a browser window! And when the latest Fuckbuster Javascript engine is released, it'll be like a 286 again."
Re: (Score:3)
You must have had an *awesome* 8 MHz 8086 if it could do this: http://www.unrealengine.com/html5/ [unrealengine.com]
Re: (Score:2)
This is WebGL, which is a wrapper round OpenGL, which is an API making use of...
Re: (Score:2)
The point here is that emscripten can get within 1/2 native speed when the resulting code is put on a modern JavaScript engine. You're not regressing 25 years; you're regressing about 18 months.
Doesn't run in IE 6 (Score:2)
Therefore it can't be a real serious enterprise ready product.
Just ask any beancounter
Cool (Score:3)
We have a way to run Wayland apps inside a network-aware display app.
63MB of RAM (Score:2)
63MB of RAM?!
Not quite there yet on Android (Score:4, Informative)
I tried the demo on my Nexus 7 using Chrome. The OS boots up, but there doesn't seem to be any way to activate the on-screen keyboard, so no way to send input to the window. Still, very impressive that it (mostly) works on Windows AND Android!
Lack of imagination (Score:2)
Practical use of jor1k (Score:3)
All developers should have to test their software in jor1k. If it runs too slow or consumes too much RAM the defects must be fixed prior to release.
So JS is an HDL now? (Score:2)
From what I know, OpenRISC is an open sourced (I believe GPL'ed) MIPS CPU that exists in terms of HDL models, and can be implemented in any fab. So one could take the models, program it into an FPGA, and then one would have a functional OpenRISC CPU. What about a pure OpenRISC CPU? Well, get in the market & the volumes, and a company could start doing design and/or fabs, and you'd have a CPU. Given the costs incurred in designing it, the volumes have to be high enough to justify it.
So now they're s
Adding Value with WebRTC (Score:1)
Under the name of Atomic OS, I've been playing around with related ideas (on and off) for nearly a decade now.
Although I have a number of others, my primary suggestion would be to add WebRTC-based network devices in jor1k or JS/Linux. This would allow SPAs (Single Page Applications) to provide an interface into new censorship-resistant networks.
Yes it's putting tubes in your tubes but I think it'll happen and likely sooner than you think. There's at least one project out there (name withheld by request of