Linux Kernel Running In JavaScript Emulator With Graphics and Network Support
New submitter warmflatsprite writes "It seems that there have been a rash of JavaScript virtual machines running Linux lately (or maybe I just travel in really weird circles). However until now none of them had network support, so they weren't too terribly useful. Sebastian Macke's jor1k project uses asm.js to produce a very fast emulation of the OpenCores OpenRISC processor (or1k) along with a HTML5 canvas framebuffer for graphics support. Recently Ben Burns contributed an emulated OpenCores ethmac ethernet adapter to the project. This sends ethernet frames to a gateway server via websocket where they are switched and/or piped into TAP virtual ethernet adapter. With this you can build whatever kind of network appliance you'd like for the myriad of fast, sandboxed VMs running in your users' browsers. For the live demo all VMs connect to a single private LAN (subnet 10.5.0.0/16). The websocket gateway also NATs traffic from that LAN out to the open Internet."
The change of name from LiveScript to JavaScript roughly coincided with Netscape adding support for Java technology in its Netscape Navigator web browser. The final choice of name caused confusion, giving the impression that the language was a spin-off of the Java programming language, and the choice has been characterized by many as a marketing ploy by Netscape to give JavaScript the cachet of what was then the hot new web programming language.
20 characters max for the password? How will I use my favorite poems as passwords?
A lack of network support was what was holding back a JavaScript VM running Linux from being useful. No other reason whatsoever.
As a component of a Beowulf cluster, obviously.
No kidding!!! What do you say at this point?
JavaScript faster than Java? No. It's not. Not even close. Java has fantastic performance when used correctly. It just happens to be a common intro-course language, so lowest-common-denominator sorts of programmers write a lot of crap code with it. The HotSpot VM JIT is basically magic, and the garbage collection beats out everything else.
It lets you be a VPS provider, using nothing other than a copy of Chromium. No need for fancy processors and virtualizing instructions, no hypervisors, no containers, whatever.
Scales beautifully: Got a new customer? Just open another tab!
As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
It's amazing to me that "tech for the sake of tech" posts like this elicit much the same responses I would expect from a non-nerdy audience. At what point did slashdotters become mostly a group of curmudgeonly old-men who care only about what use can be made of new things and who find NO INTEREST what-so-ever in new and different ideas?
THIS is why it takes that ex-jock-turned-business man to make money on technology. Somebody who isn't an old-fart slashdotter who "ho-hum"s everything new. This community is SUCH a disappointment.
What does one use this for?
The same thing we do every night, Pinky - try to take over the world!
From my OpenRISC ORK Javascript Emulator Running With Network Support
i.imgur.com/zJPsjCT.png
I wonder how useful it would be for security sensitive applications. For example, even though it sounds goofy to run a Web browser in a Linux kernel running in a window, the difficulity for malware to get out of rings of context (including multiple instruction sets) would be enormous. Not impossible, but highly unlikely.
Something like this would provide a decent defense against browser-based (or browser add-ons) attacks (which is a significant vector for malware these days.)
A year ago, when I started the project it was simply interest in learning Javascript. I was fascinated by the emulator from Fabrice Bellard http://www.bellard.org/jslinux/
:)
I am a programmer focused on simulations/emulations and performance. I was also interested in learning the internals of how a computer nowadays works. The x86 CPU is way to compilcated. You lose the clear sight for stupid details like the A20 gate. The OpenRISC project is perfect. It is a CPU with a very easy and clear CPU. Nothing historic. It has even some similarities with byte code, which makes it very fast if you emulate it properly. I optimized especially for running Linux violating the specification a bit.
The whole CPU with MMU fits in around 1000 lines of code. During that day I never expected to get that far. Now with all three cores and devices it needs around 7000 lines of code.
I have a list of useful things you can do with it:
1. Use it as an education system of the Linux system or other tools. For example you could write a git tutorial with live examples.
2. This emulator provides an alternative way to port old software to run on modern systems. In direct comparison to the project Emscripten it is slow, but the porting could be much easier. For terminal applications probably no porting is neccessary at all (e. g. Frotz).
3. The emulated OpenRISC CPU is very easy and contains around 1000 lines of code. So it is the perfect example to learn how emulation works.
4. With network support it allows you to access other computers within the Web Browser providing ready to use tools. (Even an encrypted chat is possible if you run the sshd daemon)
5. Use it as a speedtest for Javascript engines.
6. It is an advertisement for the OpenRISC project.
You can also read the motivation of Ben Burns in his Blog: http://www.benjamincburns.com/2013/11/10/jor1k-ethmac-support.html
And I have to admit that I did the wayland support last time only to get some news.