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.

23 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 chorltonian · · Score: 3, Insightful

      Errm... how about trying it out before judging it? As has been covered god knows how many times before, Java is capable of runtime optimisations not possible with statically compiled languages like C++.

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

    4. 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.
    5. Re:Interesting, but by MobyTurbo · · Score: 3, Insightful

      Errm... how about trying it out before judging it? As has been covered god knows how many times before, Java is capable of runtime optimisations not possible with statically compiled languages like C++. Maybe so, but it is running much slower than DOSEMU or DOSBOX does in Linux here, which are probably written in C or C++, with possibly some assembly; and can do emulation of all the games it emulates. Java is indeed capable of certain optimizations that are not done in a non-JIT compiler, but that simply is because it needs them. Anyone who tells you that Java operating system emulators typically run faster than C operating system emulators has been smoking SUNW crack. That having been said, there are reasons for choosing Java over C. One of them is built-in security sandboxing, which was obviously the reason for the choice.
    6. Re:Interesting, but by heinousjay · · Score: 3, Insightful

      Awesome, you've successfully combined unnecessary anger, anecdotal evidence, the arrogant assumption that only your opinion matters, a Slashdot meme, and a bunch of insults into one post. I think you get some kind of award for that.

      --
      Slashdot - where whining about luck is the new way to make the world you want.
  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. Molasses - 35mph! by Anonymous Coward · · Score: 3, Interesting
  7. 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.

    3. Re:can you run java in the x86? by timeOday · · Score: 3, Funny

      Linux on emulated hardware can be faster than Linux on real hardware:
      There you go, a perpetual speedup machine. Run enough layers of Java on X86 on Java on X86 and supercomputers will be replaced by Cyrix 386s.
  8. Re:Comparisons to other emulators? by badfish99 · · Score: 3, Funny

    A java based emulator doesn't need to be ported.
    That's the huge advantage of java. Just port the 100 meg or so of JVM, throw in a faster processor and a few more gigs of memory, and it'll run on anything.

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

  10. Other projects doing the same/faster thing.. by Boj · · Score: 3, Informative

    There are at least 2 solutions doing a similar thing. The open source binarytranslator.org/PearColator offers x86 and PowerPC emulation:
    http://binarytranslator.org/
    There are attempts to integrate this into the JNode open source Java OS to make a JNode/GNU stack.

    There is also the VEELS/JXEmu system:
    http://nil.ics.uci.edu/~gal/?page=VEELS
    which appears not to be publicly available.

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

  12. Re:How's the efficiency? by kestasjk · · Score: 3, Informative

    near-native speeds are necessary to actually boot Windows Vista before the sun goes supernova.
    The sun isn't close to large enough to end in a supernova; it'll be a red giant, then end as a white dwarf.
    --
    // MD_Update(&m,buf,j);