Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Graphics Emulation (Games)

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."
This discussion has been archived. No new comments can be posted.

JavaScript-Based OpenRISC Emulator Can Run Linux, GCC, Wayland

Comments Filter:
  • by 32771 ( 906153 )

    Students still have too much time on their hands.

    • by 93 Escort Wagon ( 326346 ) on Saturday October 12, 2013 @04:12PM (#45110485)

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

    • by Anonymous Coward

      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

    • 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."

      • by qbast ( 1265706 )
        Obviously they need to write JavaScript in JavaScript.
        • by narcc ( 412956 )

          I once wrote a Basic interpreter in Basic to annoy a friend.

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

          • "I once wrote a Basic interpreter in Basic to annoy a friend."

            I believe that is still the number 1 reason for writing anything in BASIC.

        • by gmhowell ( 26755 ) <gmhowell@gmail.com> on Saturday October 12, 2013 @07:29PM (#45111373) Homepage Journal

          Obviously they need to write JavaScript in JavaScript.

          So I can wait for code to run while I wait for code to run?

      • I wonder if this fad of porting everything to JavaScript has something to do with preparing for an imagined day when popular home computing platforms will become as locked down as iOS and the game consoles are today. Web applications run fine, but anything else requires the platform owner's digital signature. And for a long time, getting such a signature from console makers has required establishment of a corporation or LLC, the payment of a substantial entry fee, an additional computer for running the development environment, and a team of developers who have had to move hundreds of miles just to get the required "relevant industry experience" working for a well-known software company.
        • by Jeremi ( 14640 )

          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

          • by Lennie ( 16154 )

            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

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

              • by Lennie ( 16154 )

                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.

          • by tepples ( 727027 )

            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.

  • by Anonymous Coward

    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)

      by Anonymous Coward

      Safari, Mac OS X, Mac mini: basically killed my machine, all programs stopped responding and it took minutes to click "Force Quit" the browser.

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

  • by Anonymous Coward

    Oh. I um. I guess it does.

  • by Sneftel ( 15416 ) on Saturday October 12, 2013 @04:23PM (#45110541)

    ScummVM

    So it's a virtual machine running on a virtual machine running on a virtual machine. Nice.

    • Re: (Score:2, Funny)

      by Anonymous Coward

      It looks like virtual machines all the way down.

    • I'm surprised it wasn't written in C++ and compiled to JavaScript...
    • and if the universe is actually a turning complete computer that would mean that the physical computer is actually a virtual machine.

      • by Sneftel ( 15416 )

        Really, if the universe is Turing complete, I think that's strong evidence that the universe itself is a virtual machine.

  • (I heard you like Javascript and Linux, so I put a Linux inside your Javascript inside your Linux inside your Javascript inside your Linux.)

  • "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)

    by Anonymous Coward on Saturday October 12, 2013 @04:53PM (#45110679)

    Well, I guess everyone has read about the Javascript PC emulator :
    http://bellard.org/jslinux/index.html

  • by Anonymous Coward on Saturday October 12, 2013 @05:49PM (#45110883)

    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.

    • by tepples ( 727027 )

      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.

      • That can change.

        • by tepples ( 727027 )
          Would it change in the "more open" direction, with more platforms allowing use of unsigned native code? Or would it change in the "more closed" direction, with devices enforcing a no-script policy on web sites that haven't paid to be on the platform's whitelist?
        • by gl4ss ( 559668 )

          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.

      • by Anonymous Coward

        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

    • by gangien ( 151940 )

      Because they can.

      Off topic, what happened to my slashdot, where this post would get modded down.. :(

    • 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

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

    • by spage ( 73271 )

      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

  • 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."

  • Therefore it can't be a real serious enterprise ready product.

    Just ask any beancounter

  • by PPH ( 736903 ) on Saturday October 12, 2013 @08:57PM (#45111765)

    We have a way to run Wayland apps inside a network-aware display app.

  • 63MB of RAM?!

  • by Tony Isaac ( 1301187 ) on Sunday October 13, 2013 @12:24AM (#45112463) Homepage

    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!

  • The author of the bzip2 decompression code [github.com] seems to have gotten a little bored writing the comments.
  • by WaffleMonster ( 969671 ) on Sunday October 13, 2013 @12:27PM (#45114819)

    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.

  • 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

  • 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

news: gotcha

Working...