Slashdot Mirror


Java-Based x86 Emulator

jaavaaguru writes "Researchers at Oxford University have produced a Java-based x86 emulator that they hope will be useful in testing applications and learning about viruses without damaging the host, utilizing the robust sandboxing that Java provides. They have an online demo available that boots DOS and has some games to play. Being purely Java, this emulator should be able to run on almost anything, including cell phones." The code is not yet available outside the Oxford community; the developers are said to be working on a suitable general license. In the meantime the code can be licensed on a case-by-case basis.

15 of 263 comments (clear)

  1. Interesting, but by dreamchaser · · Score: 5, Funny

    I can only imagine that this will make even Bochs look fast in comparison!

    Still, I'd love to tinker with this from a 'gee whiz' standpoint.

    1. Re:Interesting, but by Qwertie · · Score: 5, Interesting

      I'd have to agree. Using instruction-by-instruction emulation, a C++ based SNES emulator I wrote around 1998 used at least 150Mhz of processing power to emulate the SNES' 3Mhz processor. When I rewrote it in assembly, it was 5-10 times faster. I expect that some pretty sophisticated techniques would be required to exceed a snail's pace when using Java for emulation, eg "dynamic recompilation": translating sections of x86 machine language to Java bytecode... but getting this to work 100% correctly would be pretty tricky.

      If it's hard to get good emulation speed in C++, it's even harder in Java.

    2. Re:Interesting, but by shaitand · · Score: 5, Funny

      'Java is capable of runtime optimisations not possible with statically compiled languages like C++.'

      And with them it can perform almost as fast as C in some fringe cases.

    3. Re:Interesting, but by Anonymous Coward · · Score: 5, Insightful
      Don't you know, around here:
      • All Java is slow
      • All Perl is unreadable
      • All PHP is insecure
      • All JavaScript is a useless intrusion into your browser
      ... and all comments like those are written by "experts" who've never written one line in the language in question.
  2. So... by mriya3 · · Score: 5, Funny

    ... now we should say: "x86 assembler: write once, run everywhere (slow as molasses in January)" ?

  3. Java x86 emulator speed by christurkel · · Score: 4, Funny

    Java only: snail speed
    Java+DOS: Snail with ball and chain
    Java+DOS on non x86: Snail nailed to the table

    --

    CDE open sourced! https://sourceforge.net/projects/cdesktopenv/
  4. So it runs DOS eh? by ookabooka · · Score: 4, Funny

    But can it run Linux. . .?

    Why did they use Java? It would have been faster in C++.

    I for one welcome our new old x86 overlords.

    Did I miss any?

    --
    If you are about to mod me down, keep in mind that this post was most likely sarcastic.
    1. Re:So it runs DOS eh? by HoosierPeschke · · Score: 4, Funny

      In Soviet Russia x86 emulates Java?

      --
      Mr. Universe: "They can't stop the signal, Mal. They can never stop the signal."
  5. Well for one by brunes69 · · Score: 5, Interesting

    For one this will let you run X86 DOS applications on a SPARC for example.

    I'd like you to point me to the support page for VMWare on SPARC... oh wait that's cause there isn't one. QEMU can't even run most applications on a SPARC.

    And forget about ARM.

    I think this is great. Java is not as slow as people seem to think it is. One thing Java 5 (and 6) have that actually benefits virtualization is dynamic recompilation... the JVM knows the instruction sdequences better than the original author, and in theory can optimize the code paths in ways writing a virtualizer in assembly or C++ can not.

    1. Re:Well for one by daeg · · Score: 5, Informative

      If you are using Firefox with Java and having ridiculous applet startup times, you need to disable your Java Cache. This is Java's fault, not Firefox's (supposedly).

      Under the Java control applet, under the General tab, click "Settings..." under "Temporary Internet Files". Then click "View Applets...". It will take a moment to load (or in my case, 2-3 minutes). Then UNcheck "Enable Caching". Firefox now starts my applets almost instantly. This doesn't affect downloaded Java applications such as Azureus or Eclipse (both of which I use extensively).

      Hope this helps.

  6. can you run java in the x86? by leuk_he · · Score: 5, Interesting

    THe next question would be: can you run java in the x86 emulator that runs an other emulator that runs java, that runs an other emulator.

    Just like the old days when you ran windows real mode under a windows 386 mode windows.

    1. Re:can you run java in the x86? by Citizen+of+Earth · · Score: 4, Funny

      The next question would be: can you run java in the x86 emulator that runs an other emulator that runs java, that runs another emulator.

      ...written in XSLT.

    2. Re:can you run java in the x86? by Cyberax · · Score: 4, Funny

      Yes.

      The next step is to get rid of hardware altogether.

  7. Re:How's the efficiency? by slamb · · Score: 4, Insightful

    More specifically, You can take a virus and run in it a way to compromise the virtual machine without compromising the machine itself. This means your output is not likely to be damaged in any ways as well as you can monitor the activity from a removed setting while maintaining a presence.

    Well, that's great, but you can already do that with VMware, Parallels, QEMU, or other virtualization tools. Sure, virtualization requires the same host and guest architecture, but we all have plenty of x86 machines sitting around, and near-native speeds are necessary to actually boot Windows Vista before the sun goes supernova. So while this is neat software, it's not as suitable for malware researchers as what they are already using. The JPC project needs to find a different niche.

  8. My intepretation by Excelcia · · Score: 4, Funny

    An interpreted language being used to write an opcode interpreter.

    For an encore, perhaps they can write a JVM in BASIC.

    WARNING: Performance implosion imminent due to recursive interpretation.