Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror

Slashdot videos: Now with more Slashdot!

  • View

  • Discuss

  • Share

We've improved Slashdot's video section; now you can view our video interviews, product close-ups and site visits with all the usual Slashdot options to comment, share, etc. No more walled garden! It's a work in progress -- we hope you'll check it out (Learn more about the recent updates).

×
Networking Emulation (Games) Virtualization Linux Hardware

Linux Kernel Running In JavaScript Emulator With Graphics and Network Support 177

Posted by timothy
from the ascii-art dept.
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."
This discussion has been archived. No new comments can be posted.

Linux Kernel Running In JavaScript Emulator With Graphics and Network Support

Comments Filter:
  • Re:So...? (Score:3, Interesting)

    by DragonDru (984185) on Tuesday November 12, 2013 @12:42PM (#45401879)
    Infect Windows with Linux Viruses?
    Make firefox faster?
    Simpler BotNet design?

    It was likely a learning project, and is kind of cool. But it is more reason to run NoScript and similar.
  • by OlivierB (709839) on Tuesday November 12, 2013 @12:58PM (#45402107)

    The most incredible thing is the speed at which it runs: 11.5 MIPS.

    My desktop dual-core Xeon W3503@2.40Ghz barely manages 40 MIPS in Chrome.

    The iPhone 5s is crazy fast by most standards

  • by elfprince13 (1521333) on Tuesday November 12, 2013 @01:03PM (#45402169) Homepage
    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.
  • by Anonymous Coward on Tuesday November 12, 2013 @01:11PM (#45402261)

    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.

  • First post! (Score:5, Interesting)

    by Fwipp (1473271) on Tuesday November 12, 2013 @01:18PM (#45402337)

    From my OpenRISC ORK Javascript Emulator Running With Network Support

    i.imgur.com/zJPsjCT.png

  • Re:So...? (Score:5, Interesting)

    by mlts (1038732) * on Tuesday November 12, 2013 @01:27PM (#45402501)

    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.)

  • by erikkemperman (252014) on Tuesday November 12, 2013 @01:50PM (#45402867)

    JavaScript != Java indeed. I'm still amazed at the silliness of the choice.

    I've actually seen a newbie developer paste a snippet of one into the other... Finally I had an occasion to use the phrase "that's not even wrong" in an actual conversation.

    The dev didn't last at our company.

  • Re:So...? (Score:5, Interesting)

    by s-macke (3429555) on Tuesday November 12, 2013 @02:10PM (#45403173) Homepage
    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/ [bellard.org]
    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 [benjamincburns.com]
    And I have to admit that I did the wayland support last time only to get some news. :)
  • by narcc (412956) on Tuesday November 12, 2013 @03:07PM (#45403877) Journal

    I'm puzzled how one makes it "fast". When my highly active programs run in a browser they tend to glitch and halt after a while if they have been doing lots and lots of quick object instantiation and destruction.

    You've almost figured it out!

    Recycle your objects. Enjoy instant performance improvements. (While this is not just true for JavaScript, it's obviously the advice you need.)

    Oh, and try learning the language. It's not like Java and C#. If you try to treat it that way, you'll end up writing crap. You can break yourself out of that easily enough by working through The Little Schemer in JS instead of Scheme.

  • Re:So...? (Score:2, Interesting)

    by Anonymous Coward on Tuesday November 12, 2013 @05:09PM (#45405319)

    A nerd rides up to his friend on a shiny new bike.
    His friend asks, "where'd you get the bicycle?"
    The first nerd relates, "a beautiful woman came up to me, dropped the bike to the ground, tore off her clothes and said "take anything you want!", so I took the bike."
    His friend insightfully notes, "yeah, the clothes probably wouldn't fit you."

"No job too big; no fee too big!" -- Dr. Peter Venkman, "Ghost-busters"

Working...