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.

197 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 saboola · · Score: 1

      If I might ask, what emulator was it? I have been an emulator nut for a little over a decade and would love to know if I used yours.

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

    4. Re:Interesting, but by Victor+Antolini · · Score: 2, Informative

      A little bit of searching brought this

      Btw, here's a Gameboy emulator written in Visual Basic!
      It's quite fast... puzzling.

    5. Re:Interesting, but by void_bips(brain) · · Score: 1

      If it's hard to get good emulation speed in C++, it's even harder in Java.
      No more.
      You got to see (search) comparisons where Java beats C++ in speed.
      Mostly because of JIT producing native code.

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

    7. Re:Interesting, but by Citizen+of+Earth · · Score: 2, Interesting

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

      There is a world of difference between "theoretically capable" and "reliable does". Is there some practical demonstration that compute-intensive tasks like emulation can be reliably executed with Java without sucking?

    8. Re:Interesting, but by Wesley+Felter · · Score: 1

      Sure, an x86 interpreter written in Java is going to be pretty slow, but a JIT written in Java beats a C interpreter (bochs) any day.

    9. Re:Interesting, but by Anonymous Coward · · Score: 1, Informative
      "Dynamic Recompilation" is exactly what this emulator does, which is the reason it's novel.


      The X86 machine code is translated directly into java bytecode, which is then compiled to the target architecture and cached by the JVM.

    10. 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.
    11. 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.
    12. Re:Interesting, but by mrmeval · · Score: 1

      Why Java? Qemu works as does VMWare and others....

      --
      I'd go on a Vegan diet but the delivery time from Vega is too long. --brownkitty
    13. Re:Interesting, but by tomhudson · · Score: 2, Insightful

      Errm... how about trying it out before judging it?

      errm ... how about because the applet failed to load?

      If you go to the site, you'll see their premise is stupid - that game companies will license this to sell old dos games on cell phones, rather than porting them. Of course what they overloook is once you have the emulator, you don't need the game companies - just go through any abandonware site, or your stacks of old floppies.

    14. Re:Interesting, but by ConceptJunkie · · Score: 2, Funny

      Ridiculous! Java can perform NOPs as fast as any compiled language.

      --
      You are in a maze of twisty little passages, all alike.
    15. Re:Interesting, but by mgiuca · · Score: 1

      "dynamic recompilation": translating sections of x86 machine language to Java bytecode...
      Which then gets dynamically recompiled by the Java VM into x86 machine language :)

      (At least, when running on an actual x86).

      Seriously though, this is quite impressive (to have it written in Java). But what are the advantages of this versus QEMU? (Besides a wider range of platforms). I mean... QEMU already offers total sandboxing doesn't it?
    16. Re:Interesting, but by RzUpAnmsCwrds · · Score: 1

      All Java is slow


      Compared to C++, yes, it typically is. But it's usually within 20-30%, sometimes a bit worse, sometiems a bit better. In some rare cases, Java can even beat machine-code compiled languages.

      All Perl is unreadable


      Absolutely not. But Perl culture encourages the kind of programming which leads to unreadable code. And Perl syntax certainly doesn't help either.

      I would much, much rather work on Java code that someone else wrote. It's not that you can't write horrible Java code, it's just that the language syntax and culture discourages it.

      All PHP is insecure


      Certainly not, but as someone who works with PHP code on a daily basis, I think it's fair to say that most PHP code is insecure. Even well-recognized projects like PHPbb frequently experience breaches because of SQL injection or some other stupid vulnerability that shouldn't exist in a decent language.

      Part of it is the language, part of it is the culture. PHP is an absolutely wonderful language in many ways - it's easy to pick up, easy to set up, and remarkably fast for what it is. But it's not J2EE.

      All JavaScript is a useless intrusion into your browser


      You have this point. JavaScript (and Flash) are far too often the targets of scorn. You don't blame C++/C/Assembly for allowing a virus creator to write a virus - why should you blame JavaScript for allowing marketers to make more annoying ads?
    17. Re:Interesting, but by shutdown+-p+now · · Score: 1

      Much faster, actually, thanks to its opportunity to perform runtime optimizations. Why, I've even heard rumours that it can extremely effeciently parallelize particularly long NOP loops!

    18. Re:Interesting, but by LBt1st · · Score: 1

      Tell that to Nintendo.

    19. Re:Interesting, but by TheRaven64 · · Score: 1
      The target market (from the web site) is game publishers wanting to sell old DOS games on a mobile phone. J2ME is the easiest thing to have working across multiple families of mobile phone (it may not be quite write once, run anywhere, but the per-platform tweaks are fairly small compared to using the platform's native SDK).

      For games (or, indeed, any DOS programs), I would suggest DOSBox, rather than QEMU, since DOSBox implements the DOS system calls itself, rather than forcing you to run emulated DOS under your emulated apps. I wouldn't like to be the one to try to port DOSBox to ARM though (although it does run happily on PowerPC, so it wouldn't be too hard...)

      --
      I am TheRaven on Soylent News
    20. Re:Interesting, but by mgiuca · · Score: 1

      This is true (I read this on the website after posting).

      Also, as demonstrated on the website, being able to run it as a browser applet is quite awesome.

    21. Re:Interesting, but by pruss · · Score: 1

      They say the emulated system runs at 10% of the CPU speed of the emulating system. That's not bad at all. With a 1 ghz system, one gets a 100 mhz DOS system, which is more than enough!

    22. Re:Interesting, but by Haeleth · · Score: 1

      how about because the applet failed to load?
      Worked fine for me. It's slightly slow, and I couldn't get it to register the "alt" key, but those are issues that could easily be fixed by tuning it to run on a specific platform.

      Of course what they overloook is once you have the emulator, you don't need the game companies - just go through any abandonware site,
      Um, if someone is selling the game, it isn't abandonware.

      Besides, abandonware is illegal. Many people consider it ethically justifiable, on the grounds that they'd pay for the software if anyone was willing to sell it to them. But that argument kind of falls rather flat the moment there is someone willing to sell it to you, doesn't it?

      or your stacks of old floppies.
      For those who have the old floppies, yes - but many won't have kept them, or will find that they're dead, or simply won't have any hardware that can read them any more - particularly if they bought the 5 1/4" versions.

      And, frankly, given a choice between paying something like $5.99 for a game, or getting it "free" by wasting three hours rummaging through old floppies or trawling through dodgy warez sites, I think I'll pay. My time is worth more than two dollars an hour, thank you very much.
    23. Re:Interesting, but by Haeleth · · Score: 1

      Why Java? Qemu works as does VMWare and others....
      On your phone?
    24. Re:Interesting, but by tomhudson · · Score: 1

      Cartridge-based games aren't the same as ones distributed on floppies (though you can find the ROMs online for most of them - just google for MAME ROM).

    25. Re:Interesting, but by iampiti · · Score: 1

      Dosemu is virtualized and requires an x86 processor to work, dosbox does not. Dosbox actually emulates the hardware and has been compiled on a variety of platforms many not using x86 processors. It has a dynamic recompiler that makes things faster if the host processor is a x86 but on other architectures still works, just more slowly.

    26. Re:Interesting, but by tomhudson · · Score: 1

      "but those are issues that could easily be fixed by tuning it to run on a specific platform."

      Oh yes, java's "write once, run everywhere" ... still doesn't work. Java really needs to be redone from scratch.

      There were a lot of games that were put out as shareware or demoware that are still available. Also, I have 5-1/4 and 3-1/2 floppies that are still readable just fine - I keep an old pentium floating around just in case ...

    27. Re:Interesting, but by The+Spoonman · · Score: 1

      We don't need to have written a line of Java to know the applications that were written in that abomination of a language are SLOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOW.

      --
      Which is more painful? Going to work or gouging your eye out with a spoon? Find out!
      http://www.workorspoon.com
    28. Re:Interesting, but by cryptoluddite · · Score: 1

      All Java is slow Compared to C++, yes, it typically is. But it's usually within 20-30%, sometimes a bit worse, sometiems a bit better. In some rare cases, Java can even beat machine-code compiled languages. Actually currently pretty much all Java programs are faster than equivalent C++ ones. Add array bounds checks on all access, use use only references instead of pointers, and don't allow objects to be used after their memory is free'd and your C++ program will grind to a halt.

      The only time a Java program ever crashes is due to a bug in the JVM. The only time it ever introduces a security bug is when the application's logic is wrong (ie only high-level defects not buffer overflows and stacks).

      A C++ program that is uncrashable and secure will be much slower than the Java equivalent.
    29. Re:Interesting, but by LBt1st · · Score: 1

      My point was, you can easily get old games. Yet Nintendo's making a killing on Wii's Virtual Console.

    30. Re:Interesting, but by tomhudson · · Score: 1

      Of course they are - and I'll be one of their customers, if I ever get around to buying a Wii (which I probably will - it'll be my first console since the SNES, and I think it would be fun to have for when friends visit). However, running a java dos emulator on a mobile phone won't cut it - the screen resolution is wrong, the input devices just aren't there (keyboard, mouse and joystick can't be replaced by a N-S-E-W clicker and a number pad), and if its slow on a 3ghz pc with 2 gig of ram, imagine how slow it'll be on a mobile phone running less than 1/10 the speed, and less than 1/100 the ram?

    31. 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.
    32. Re:Interesting, but by that+this+is+not+und · · Score: 1

      Be careful. They'll all put on their Java rings and pummel you.

    33. Re:Interesting, but by that+this+is+not+und · · Score: 1

      Nintendo is in trouble if the ability to play older-generation Nintendo games on Wii is a big part of their 'making a killing' on the Wii platform. People don't look backwards in anywhere near the volume that people look forwards when choosing a Game console. Lots of people already have the old hardware.

    34. Re:Interesting, but by complete+loony · · Score: 1

      See Jake 2 for an example. Yes, Java can attain speeds similar to C. But you have to think like a C programmer, being very careful about memory allocation and object life cycles.

      --
      09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
    35. Re:Interesting, but by LarsWestergren · · Score: 1

      Yes. At last year's JavaOne Matt Howitt demoed a Playstation 1 emulator written in Java. He ran three or four different games simultaniously without any performance problems, and went through some of the code. And this was with software rendering only, no OpenGL layer. He said he would open source it, but unfortunately no code has appeared yet.

      So running a little x86 emulator should be no problem...

      --

      Being bitter is drinking poison and hoping someone else will die

    36. Re:Interesting, but by Vintermann · · Score: 1

      True. It would be very interesting if anyone had time to take the Shootout C programs, run them though ccured and compare the results. My guess is that we'd see performance in line with the other type-safe, low-level compiled languages (e.g Ada and Eiffel)

      --
      xkcd is not in the sudoers file. This incident will be reported.
    37. Re:Interesting, but by FunkyELF · · Score: 1

      Wow, so you're saying if you think about your code and write it decent it will perform decent?

      I thought you were supposed to get that for free.</sarcasm>

    38. Re:Interesting, but by TopSpin · · Score: 1

      Java is capable of runtime optimisations (sic) not possible with statically compiled languages like C++

      Java VMs can't optimize away the cost of reference counting a garbage collected heap. The inability of Java to allocate objects on the stack (and avoid other costs) for short lived objects is also painful. The need to optimize GC performance leads to a large working set, which limits scalability (20MB hello world, etc.) The real world also tends to find ways of suffering poor startup performance, because a surprising amount of software does not actually work well from within a J2EE container.

      Java isn't as efficient as C or C++. That's the cold, hard truth. I wish it were. I really, really do. It just isn't, and I won't play to its weakness. Instead, I play to its strengths, like this:

      Java provides a Sandbox. That's one of the features Oxford is leveraging for its x86 emulator. Yes, you really can safely run and x86 emulator as an applet inside a browser. DOS inside a browser.

      Java is portable. As of now, anything with a sufficient JVM can emulate x86. You can just take that for granted.

      See? Far more pleasant. Ignore the trolls, use the right tool for the job, and enjoy low blood pressure.

      --
      Lurking at the bottom of the gravity well, getting old
    39. Re:Interesting, but by Lally+Singh · · Score: 1

      Well, there's Just In Time compilation, which is part of the JRE we all use today. It runs a lightweight profiler and compiles the most-used section ("hotspots") to native machine code.

      --
      Care about electronic freedom? Consider donating to the EFF!
    40. Re:Interesting, but by Doctor+Memory · · Score: 1

      compute-intensive tasks like emulation can be reliably executed with Java without sucking? Actually, I would think Java would do pretty well at this. Figure the bulk of the emulator is going to be decoding and executing instructions, and the most commonly-executed instructions are going to be executed millions of times, so the hotspot compiler will tag those code paths and optimize them early on. Plus, memory is probably going to be implemented as a huge linear array, allocated at startup, so there's not going to be a lot of object allocation/freeing, so the GC probably won't be a factor. I/O will probably be a bottleneck, but that's true with any emulator.

      If the implementors are at all clever, there really shouldn't be too much performance loss.
      --
      Just junk food for thought...
    41. Re:Interesting, but by ConceptJunkie · · Score: 1

      Technology rocks! We can do nothing so much faster and more efficiently.

      --
      You are in a maze of twisty little passages, all alike.
  2. So... by mriya3 · · Score: 5, Funny

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

    1. Re:So... by eclectro · · Score: 1

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

      You know what would really be kewl? If you could make an integrated circuit that runs java real fast then you would have a chip that runs x86 assembly.

      --
      Take the cheese to sickbay, the doctor should see it as soon as possible - B'Elanna Torres, "Learning Curve"
    2. Re:So... by shaitand · · Score: 1

      'You know what would really be kewl? If you could make an integrated circuit that runs java real fast then you would have a chip that runs x86 assembly.'

      Why wouldn't you just grab a Pentium 266 and have a chip that runs x86 assembly at twice the speed this thing will on my dual core athlon?

    3. Re:So... by Anonymous Coward · · Score: 1, Informative

      Whoosh!

  3. Re:Struggling to understand... by dreamchaser · · Score: 1

    It is interesting from the standpoint that the emulator itself *should* be fully portable to any platform that runs java. It's probably not useful commercially but from a geek standpoint it could be cool.

  4. How's the efficiency? by lbft · · Score: 2, Interesting

    Whilst this looks like a really interesting project, I'm failing to see how it's useful generally due to the limitations of writing it in Java and making it cross-platform. You would lose a lot of those possible (processor- or platform-specific) optimisations that make the leaders in the virtualisation market as fast as they are.

    On, say, a mobile phone (which is mentioned by the site as a possible use) would there be enough processing grunt to do anything useful? I know Java's not as slow as some people would have you believe, but virtualisation requires as much speed to be squeezed out as possible to be usable.

    On a desktop, what advantage does this have over the existing virtualisation options which don't have to deal with the Java environment?

    1. Re:How's the efficiency? by Anonymous Coward · · Score: 1, Funny

      two words: minesweeper

    2. Re:How's the efficiency? by sumdumass · · Score: 2, Insightful

      I don't think this is meant for a general purpose vitalization application. This is more or less a research on what something does project. 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.

      And this wouldn't be just limited to a virus program either. Suppose we had this around when sony distributed their root kit. The root kit would have likely been found faster seeing how it hides in the OS but not outside the sandbox. Also, take something like WGA. What exactly does it do? Well, we have found more and more about it as time goes on but we never had the ability to discover it all at once.

      But wait, it gets better. Suppose I have a program and are all the sudden getting calls that it doesn't work after update# 2 from some other company pertaining to some other product. I could use this virtual machine to watch how the interactions between my program and this other program or see were the files were changed easily and make adjustments accordingly. This would be exceptionally usefully if some other program is a competing business who wants to blame everything on your bad programing.

      Now some of this can be addressed by existing virtualization and processes already available. But the sand box functioning available with Java makes it less likely the problem can spread somewhere else un noticed.

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

    4. Re:How's the efficiency? by Gromius · · Score: 2, Interesting

      Actually I think it is for general purpose code. In fact I think its main purpose is for running general code on the grid and giving each process its own virtual sandbox, isolating it from the underlining hardware. This means that some random grid user wont be able to hose the machine they happen to be using which should make things easier from a grid admins point of view. Its the only reason I can possibly think of why they made it.

      Incidently when I first heard about this today, I thought it would be the comp sci dept but it turns out its particle physics, which surprised me as I'm a member of the oxford group but on a different experiment. I am still reasonably baffled why they have done this, will have to ask them on monday. This probably explains the current sad state of the ATLAS software as they are all too busy getting Commander Keen to run on their mobile phones :)

    5. Re:How's the efficiency? by shaitand · · Score: 1

      'and near-native speeds are necessary to actually boot Windows Vista before the sun goes supernova'

      near-native? You'd better not only have a native system but a rather fast one to boot Vista in a timely manner. But its all worth it, because you can windows+tab and see a cool 3d cascade of windows. I don't even mind so much that they arbitrarily rearranged all the menus and control panel functions (without adding anything of use) for no apparent reason. All is good just so long as I can see window contents moving when I windows+tab. Clearly this was worth waiting 5 years for even if this is the first time since XP SP1 I have seen good old system freezes return. There is nothing like closing all the applications on your system and then walking away to get a drink and coming back to have your system freeze. This has become a great routine, I have even rearranged things a bit so that I can unplug the cable rather than having to hold down the button for 5 seconds.

    6. Re:How's the efficiency? by poopdeville · · Score: 1

      I run OS X and Linux, and even I found your troll boring.

      NEXT!

      --
      After all, I am strangely colored.
    7. 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);
    8. Re:How's the efficiency? by suckmysav · · Score: 1

      Yes? And? I'm stll waiting for the second word I was promised . . .

      --
      "You can't fight in here, this is the war room!"
    9. Re:How's the efficiency? by slamb · · Score: 1
      Thanks for the correction - an unthinking attempt at hyperbole on my part.

      I'll try again - by the time you boot Vista under this emulation, the Sun will have become a red giant, Earth's seas will have boiled away, and its atmosphere will have escaped into space, or at least you'll feel that way... If you were play back a time-lapse of the boot process so that Vista appeared at normal speed, you would look like the villain in Indiana Jones and the Last Crusade after he drank from a false chalice.

    10. Re:How's the efficiency? by yoyhed · · Score: 1

      I'm sure there's already a Java minesweeper clone...

      --
      WHO NEEDS SHIFT WHEN YOU HAVE CAPSLOCK/ DAMN1
    11. Re:How's the efficiency? by yoyhed · · Score: 1

      Agreed. And to the GP and GGP, nice trolls. Vista boots faster than XP, and both of them boot faster than Linux (and yes, I use all 3).

      --
      WHO NEEDS SHIFT WHEN YOU HAVE CAPSLOCK/ DAMN1
    12. Re: How's the efficiency? by Dolda2000 · · Score: 1

      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.
      I was going to comment on that as well, but then I realized that he probably knew that already, and that that was precisely what he meant. :)
  5. Two great tastes by FatherBusa · · Score: 1

    Talk about gilding the lily!

    What's next? A Windows emulator written in Intercal?

  6. 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/
  7. 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."
    2. Re:So it runs DOS eh? by muftak · · Score: 1

      I tried using a linux boot floppy instead of the dos one, and it just hangs before booting the kernel.

    3. Re:So it runs DOS eh? by terom · · Score: 1

      But can it run Linux...?

      Based on the table at the bottom of this page, dubious. Only real mode (e.g. DOS) is supported properly, the protected mode that any modern OS uses is in "beta" for interpreted stage, and compiled mode is "currently less mature". The cited 10% performance figure is for compiled real mode, and I'm willing to bet that interpreted protected mode would be somewhat slower.

      Also, it doesn't say anything about supporting real graphics (8-bit VGA isn't everything), and something like USB or a CD drive would also be pleasant. What's the performance of the file-based-filesystem it uses?

    4. Re:So it runs DOS eh? by rrohbeck · · Score: 1

      >Did I miss any?

      In Soviet Russia, Java runs x86!

    5. Re:So it runs DOS eh? by Constantine+XVI · · Score: 1

      Just wait for them to implement the friggin laser beams on the x86 emulator

      --
      "I think an etch-a-sketch with an ethernet port would beat IE7 in web standards compliance."
  8. java me is not java se by Billly+Gates · · Score: 1

    It will take some work to port.

    But still cool though.

    1. Re:java me is not java se by pjt33 · · Score: 1

      Java ME isn't a single configuration or profile. It's probably not too hard to port to CDC/PP, but CLDC1.0/MIDP may be trickier.

  9. What do you do when it crashes? by CTho9305 · · Score: 2, Insightful

    I was playing around with DEBUG.COM and ran "OUT 20, AX"...and now it's apparently dead. A lot of things don't seem to work - e.g. "mode 80,20". Even "dir c:" when the current drive is "a:" seems to hang. I wonder how complete the hardware emulation is. Can you run Windows 3.1 on this? How about programs that probe for a joystick?

    1. Re:What do you do when it crashes? by ScrewMaster · · Score: 1

      All I know is, if it can't run Duke Nukem Atomic Edition, Shadow Warrior or Blood it's useless.

      --
      The higher the technology, the sharper that two-edged sword.
    2. Re:What do you do when it crashes? by Eudial · · Score: 1, Funny

      I was playing around with DEBUG.COM and ran "OUT 20, AX"...and now it's apparently dead. A lot of things don't seem to work - e.g. "mode 80,20". Even "dir c:" when the current drive is "a:" seems to hang. I wonder how complete the hardware emulation is. Can you run Windows 3.1 on this? How about programs that probe for a joystick?


      It isn't dead! For crying out loud, it's java! It's still processing the instruction... Come back in September for the result.
      --
      GAAH! MY PRINTER IS ON FIRE!!! PUT IT OUT! PUT IT OUT!
    3. Re:What do you do when it crashes? by jrumney · · Score: 1

      It seems they forgot to emulate the bluescreen.

    4. Re:What do you do when it crashes? by mattoo · · Score: 1

      It hung on me as well while trying to switch the keyboard layout using 'keyb be'...

    5. Re:What do you do when it crashes? by kasperd · · Score: 1

      ran "OUT 20, AX"...and now it's apparently dead.
      You are writing random bytes to the interrupt controler. What did you expect to happen? Just reload the page to reboot the virtual machine. (I'd have tested it on a different emulation as well, but I don't know how to get the disk images they are using).
      --

      Do you care about the security of your wireless mouse?
    6. Re:What do you do when it crashes? by MrPeach · · Score: 1

      I ran FDISK and deleted the C drive.

      Lol.

  10. Re:Comparisons to other emulators? by dreamchaser · · Score: 2, Insightful

    Both of those need to be ported to the target OS that they will be hosted on. A java based emulator doesn't need to be ported.

  11. 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 EvilIdler · · Score: 2, Interesting

      Java isn't all that slow, but the bad rep is because of its startup time and a really unoptimised GUI.
      It's fine for all sorts of things while running, but the two apps I use it for aren't exactly impressive.
      If I leave Azureus up for a while, it's eating 400 megs of memory. It also takes 10+ seconds to show
      its window. The other thing I regularly use Java for is my bank, which insists on using a friggin'
      control in its window. It takes about a minute to show up, even with other Java apps running. It seems
      the startup time is a per-process thing, not the entire loading of libraries and stuff.

      I recently installed Eclipse, and it's a world apart from the slowness of the bank webapp and Azureus.
      Starts up immediately, ready to rock. I may start using it once I figure out how :P

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

    3. Re:Well for one by caseih · · Score: 1

      QEMU is listed as fully supported on SPARC. Both the full hardware emulation (full machine requiring an OS) and Linux-on-Linux mode. The emulated CPU also does dynamic translation so the speed hit shouldn't be nearly as bad as bochs and this java emulator.

      Still, though, your point is taken. This emulator could run x86 software anywhere the JVM is. Of course the primary purpose of it seem to be for research purposes (debugging rootkits, etc). Whether it will metamorphose into something practical remains to be seen.

    4. Re:Well for one by jimmydevice · · Score: 2, Interesting

      I did something even slower in 1973. A Cardiac ( Bell Labs cardboard computer ) emulator written in FORTRAN, running on a FORTRAN emulator written in HP 2000 BASIC running on a HP2100 mini. Cycle time = one instruction / Sec.
      It could play tic-tac-toe, Very slowly.

    5. Re:Well for one by Threni · · Score: 1

      I've not once managed to shut my (xp) machine down having used Azureus without holding the power button in for 5 seconds.

      RE: eclipse - I don't know what Netbeans is written in, but after giving up on the learning curve and slow speed of Eclipse I found it a fast, untuitive breath of fresh air.

    6. Re:Well for one by VGPowerlord · · Score: 1

      Eclipse and NetBeans are both written in Java, albeit with different GUI toolkits. Eclipse uses SWT, while NetBeans uses Swing.

      You'd think that Eclipse would be faster due to SWT interfacing with the native widget set, but I guess this shows that GUI speed isn't everything. As a side note, Azureus also uses SWT.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    7. Re:Well for one by Nasarius · · Score: 1

      For one this will let you run X86 DOS applications on a SPARC for example.
      DOSBox already runs on SPARC, as it's a full emulator.
      --
      LOAD "SIG",8,1
    8. Re:Well for one by Nasarius · · Score: 1

      I recently installed Eclipse, and it's a world apart from the slowness of the bank webapp and Azureus. Starts up immediately, ready to rock. I may start using it once I figure out how :P
      Really? Last time I used Eclipse (3.0M6, I think?), it was just as sluggish as Azureus. A shame, since it's an incredibly powerful Java IDE, and not half bad at C++ and Python. I just wish it used shareable project files, not the .workspace mess.
      --
      LOAD "SIG",8,1
    9. Re:Well for one by wtarreau · · Score: 1

      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.


      In 1995, I used a PC emulator written in pure C which ran well on sparc. I even extended it to emulate 386/486 in real mode. I believe it was called "pcemu". It was fun by that time to be able to do this !

      Willy
    10. Re:Well for one by AdamInParadise · · Score: 1

      Project files (.classpath and .project) in Eclipse are shareable, with a few caveats. If you want to share them across developers, you need to enforce some stricts rules and sometimes it's not worth the shot. Also, do not checkout projects in .workspace.

      --
      Nobox: Only simple products.
    11. Re:Well for one by AdamInParadise · · Score: 1

      This difference in startup times between Azureus and Eclipse is surprising. Both are based on the same framework (RCP) and I will argue that Eclipse is "bigger" than Azureus. On my box, the startup times are similar. How many torrents are you trying to download? Also, are you sure that Azureus is started in a recent JVM (like 1.6) instead of some ancient 1.4?

      Anyway, in Java, each process runs in a different JVM, so there is absolutely no sharing between processes. This is a long-standing issue and Sun is clearly not interested in implementing run-time sharing. However, startup time in 1.5 and 1.6 are much better than in 1.3 and 1.4 (and it's not only because computers are faster these days). Memory use is still an issue.

      --
      Nobox: Only simple products.
    12. Re:Well for one by krelian · · Score: 1

      A little bit off topic but if I take your first paragraph and replace "java" with "firefox" it still makes sense. And firefox is written in c++ AFAIK.

    13. Re:Well for one by AddressException · · Score: 1

      The recent ones use a read-only mmap for thew core classes, so they *do* share things between JVMs on the same machine.

    14. Re:Well for one by RightSaidFred99 · · Score: 1
      Oooh, yeah, the great big "I want to run x86 instructions on SPARC/PA-RISC/Power/etc..." market! That's _huge_ and useful!!!

      OK, sarcasm aside - I find this to be a pointless exercise. Interesting in a very abstract kind of way, but of very, very, very limited usefulness. Java isn't slow in all things, this is true. However, I'm willing to bet this is dirt slow. Using native VM solutions running on x86 are painful enough, especially in terms of IO, this is going to perform horrifyingly bad.

    15. Re:Well for one by Tim+C · · Score: 1

      For Java (1.)6, follow the above but click "Settings" instead of "View...", and uncheck "Keep temporary files on my computer". Not tested, but that's the closest equivalent I could find to the above, and disables the "View..." button.

    16. Re:Well for one by kisielk · · Score: 1

      I'm curious. What's the purpose of the cache if the implementation with the cache is so much slower than without?

  12. on a good Java runtime... by dshk · · Score: 2, Insightful

    if the emulator itself runs on x86 then the just in time compiler of the Java runtime may optimize the code enough that we get back almost the original assembly code... but without any buffer overflows and other security problems - theoretically.

    1. Re:on a good Java runtime... by alphamugwump · · Score: 1

      No. The buffer overflows would still be there, emulated perfectly. Of course, if you ran it in a sandbox, it wouldn't make a difference -- but if it was that restricted, it wouldn't be able to do anything useful.

      I mean, if your copy of windows running on VMWare on linux gets rooted, it still sucks, especially if you're really using that instance of windows. If data gets stolen, it's still stolen. If you get hacked, you're still hacked.

      In a VM, you can revert to a clean image, but you can also revert the actual box to a clean image. It's just harder. It's not like there's some magical thing about emulators or VMs that makes security problems go away.

  13. Oh No by dunezone · · Score: 1

    I accidentally formated my virtual floppy and hard drive.

  14. Molasses - 35mph! by Anonymous Coward · · Score: 3, Interesting
  15. Commander Keen! by IICV · · Score: 1

    Yeah yeah yeah, it's sort of slow, if you screw around with the debugger it dies, but...

    They've got Commander Keen!

    1. Re:Commander Keen! by digitig · · Score: 1

      That was decisive for me -- until I tried playing it. The keyboard handling is broken. Why bother porting games, they ask? Because that way they work. Neat idea, premature release.

      --
      Quidnam Latine loqui modo coepi?
    2. Re:Commander Keen! by BiggyP · · Score: 1

      Hmph, it is indeed CK, but only CK1, i want keen4e!

      actually, i think this emulator is far more suited to alleycat and sopwith2, maybe impact would be playable

      Lemmings and Prince seem like odd choices, arent these cracked versions of commercial titles, i know no one cares thesedays but still.

    3. Re:Commander Keen! by gbjbaanb · · Score: 1

      what you want, me old mucka, is DosBox. And then you can have all of 6 Commander Keen episodess. Here's the first one, enjoy.

  16. Re:Struggling to understand... by alexj33 · · Score: 1, Interesting

    Java without emulation has been promising stuff like this for a long time and hasn't arrived. How long do you thing it'll be before Java+emulation does?

  17. Did you try it? by Ron+Harwood · · Score: 1

    It's not bad - admittedly it's running DOS - but Prince of Persia seems to run nicely.

  18. 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 faragon · · Score: 2, Informative

      Why not? Just you get execution speed and available memory progressively downgraded/shrinked (doing it ad infinitum or ad nauseam , until you're out of memory for the next emulation context) :~P

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

    3. Re:can you run java in the x86? by idonthack · · Score: 1

      ...or would you?
      Linux on emulated hardware can be faster than Linux on real hardware:
      http://linux.slashdot.org/article.pl?sid=06/05/31/ 0641207

      --
      Why is it that when you believe something it's an opinion, but when I believe something it's a manifesto?
    4. Re:can you run java in the x86? by Cyberax · · Score: 4, Funny

      Yes.

      The next step is to get rid of hardware altogether.

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

      It's turtles all the way down, I tell you!

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    6. 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.
    7. Re:can you run java in the x86? by The_Wilschon · · Score: 1

      Oh, I was going to write it for a Turing machine, running in Conway's Game of Life, implemented in Postscript.

      --
      SIGSEGV caught, terminating

      wait... not that kind of sig.
    8. Re:can you run java in the x86? by rabbit78 · · Score: 1

      YES. This shows a DOS inside JPC inside IKVM (Java) inside .NET. :-D

    9. Re:can you run java in the x86? by kasperd · · Score: 1

      Just you get execution speed and available memory progressively downgraded/shrinked
      If you do a full emulation of the instruction set, you are going to get a slowdown which is exponential in the number of layers. OTOH if you want an architecture to emulate itself, it might be possible to virtualize it, such that the actual computations (which should be where you spend most of the CPU time) actually run natively thus no slowdown. However even in that case, there will be some privileged operations, which have to be emulated. I guess they will typically have an exponential slowdown, thus when you start having a few layers, they are going to be so expensive that adding another layer is infeasible. I wonder if it is possible to design an architecture such that it can virtualize itself in a way where no instruction have a cost that is more than linear in the number of layers.

      As for memory usage, you are obviously going to need at least a constant amount for each layer, thus there will be a linear overhead in the number of layers. But is it going to be worse? Are page tables going to cause an exponential overhead in memory usage as well? (And is the base going to be large enough for that to matter? 1.001^n isn't that bad a complexity).
      --

      Do you care about the security of your wireless mouse?
    10. Re:can you run java in the x86? by faragon · · Score: 1

      That is because we're assuming one-way-forward interlayer knowledge, i.e., layer 0 emulates layer 1, layer 1 emulates layer 2, but layer 0 knows nothing about layer(s) at level 2. Allowing layer-mixing/inference via abstraction, could increase performance, as soon as higher level I/O bottleneck or CPU stall analysis could allow better instruction mixing or let other layer continue on execution while the conflictive is rescheduled. For me it is likely to how a OS works, but change the basic unit (thread/process) by a virtual machine. Current "hypervisors" do profiling for both CPU and I/O balancing, to maximize throughput, latency, or other exotic profiles.

    11. Re:can you run java in the x86? by kasperd · · Score: 1

      but layer 0 knows nothing about layer(s) at level 2.
      In general I'd say that is a good thing. Knowledge about more layers is going to make the implementation more complicated, and we'd rather have emulators be simpler than more complicated. A lot of the complexity in emulators is due to the history of the architecture they are emulating. (The PC is a nasty mess of patches rather than a well designed system). But the simpler the emulation can be made, the more reliable I'd expect it to be.

      What I'd like to see is not really a system where each layer has knowledge about a lot of layers below, but rather one where the designer has the knowledge. Figure out what the cost of multiple layers of your own virtualization is going to be, and improve on that without assuming that you are necesarilly going to be running under your own virtualization in the end.

      Current "hypervisors" ...
      Current hypervisors are not really designed for running under themselves, in fact the architecture is not even designed with virtualization in mind. There are attempts to improve on this, but I haven't yet had the oppertunity to play with any of those. Of course being able to virtualize yourself is the first step, only then can you start considering performance.
      --

      Do you care about the security of your wireless mouse?
    12. Re:can you run java in the x86? by faragon · · Score: 1

      You're right; current hypervisors are not really designed for running under themselves nor, in most cases, for running other supervisors, quite primitive everything. I was mostly figuring hypothesis, don't take me seriously :-)

    13. Re:can you run java in the x86? by that+this+is+not+und · · Score: 1

      That's cool, because I have a large collection of all the weird variants of 386/486 processors from 'back in that ugly era' when everybody was looking for cheaper ways to run Windoze 3 in enhanced mode. This means that someday this sort of perpetual motion will make my collection very VERY valuable on eBay.

      1 MHz 12-bit CMOS microprocessors are already selling for more than Pentium D processors on eBay, by the way.

    14. Re:can you run java in the x86? by that+this+is+not+und · · Score: 1

      Getting rid of it by using up as much as possible for the most mundane tasks possible?

  19. Java isn't slow anymore by Ranx · · Score: 1, Interesting

    The first ten reactions are about how slow Java is. Wake up! It's 2007, NOT 1997. The world has changed. Don't you keep your knowledge up to date? Are you amateurs? And no, a benchmark from 2001 doesn't count too.

    --

    Me
    1. Re:Java isn't slow anymore by wtarreau · · Score: 1

      The first ten reactions are about how slow Java is. Wake up! It's 2007, NOT 1997. The world has changed. Don't you keep your knowledge up to date? Are you amateurs? And no, a benchmark from 2001 doesn't count too.


      No of course it isn't, and that's why BEA does not mind proposing you only a few hundreds of CPUs and as many gigs of RAM to port to weblogic an application which has been running well in pure C on at least a few tens of CPUs...

      This must be because they don't know java yet, not because the technology is horribly slow.

      It always gets me nervous to read what people can write on those technos. It looks like they have never seen them in use in enterprise. Maybe on your PC to print "hello world" it looks as fast as C, but stop being naive and look how many kilowatts are burnt by machines running java in enterprises. Then you may reconsider your statement.

      Willy.
    2. Re:Java isn't slow anymore by pommiekiwifruit · · Score: 1

      Surely the point is that printing "hello world" on a fast PC takes several seconds in Java, whereas it takes a fraction of a second in almost any other language, let alone a compiled one. Mind you, Microsoft has risen to the challenge of Hollywood Movie operating systems with Windows XP so it can take several seconds now to do anything for the first time (e.g. the first time you delete a file after a reboot), so perhaps they have something to do with Java's startup times.

    3. Re:Java isn't slow anymore by pommiekiwifruit · · Score: 1
      Hmm, I have downloaded the latest JDK version now (over 50 megabytes, phew!) and it seems that PCs have got faster over the last ten years. Apart from the first time you run a java program (several seconds) the startup time for "hello world" has got down to 0.3 seconds on my fast PC, which compares to 0.1 seconds for a decent sized (2Mbyte) C++ program or 0.03 seconds for a small C++ program.

      So it is now practical to be used in batch files/as part of a build process from a makefile - only ten times slower than a native program but PCs are at least ten times faster than when Java was introduced.

      For long running programs obviously startup time is less important, but monolithic kitchen sink programs are not "the unix way" which /. espouses allegedly :-). Of course this has not much to do with perceived slowness in the GUI, which has nothing to do with the Java language.

  20. Re:Ah, a Java-based x86 emulator... by gravis777 · · Score: 2, Informative

    Since when did emulators become news on slashdot? Its still buggy too. No mouse support (makes playing Lemmings a pain), graphic corruption in some places in Lemmings, arrow keys get effed up when playing Prince of Persia, no sound support, and, well, its kinda slow. Some lagging in Prince of Persia, and I am on a p4. Now, did the original post say that they wanted to use this to test viruses? Please tell me they are not planning on installing windows on this thing.

    Although I would smile if they installed Windows 3.1 and the thing dropped into dosshell when you exited. Of course many licensing things there. I guess there is no licensing issues showing off a product you are trying to license with shareware titles, is there?

  21. Re:On a phone? by Xymor · · Score: 1

    They claim 10% native speed, which is somewhat fast in terms of emulation.

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

  23. Re:Comparisons to other emulators? by bluefoxlucid · · Score: 1

    Because emulators are special. Now P2P clients on the other hand.. well, LimeWire Windows, LimeWire OSX, LimeWire OS9... hey at least LimeWire has a single port for BSD *and* Linux, no need to port there.

  24. Java isn't really slow... by Belial6 · · Score: 1

    Java isn't really slow when you consider that it is an emulator. As emulators go, Java is down right zippy. Of course everyone seems to forget that it IS an emulator.

  25. Keyboard Layout change hangs by jawtheshark · · Score: 1

    The first thing I typed at the prompt was "keyb sf" and it hangs... Great...

    I can use the US layout, that's not it, but I prefer to see the letters on my keyboard when I type.

    --
    Ahhh...the great dumpster continuum. Many a free computer will be found there. -- sowth (748135)
    1. Re:Keyboard Layout change hangs by kasperd · · Score: 1

      The first thing I typed at the prompt was "keyb sf" and it hangs... Great...
      That is kind of interesting. At some point I wrote a PC emulator myself (using virtual 86 mode), I found it easier to get KEYB working than to implement the full keyboard handling normally provided by the BIOS. Though I did find that the MS DOS version of KEYB does require all the nasty details of interrupt handling to be working. I don't know if the FreeDOS version of KEYB is better or worse in that respect, I never got FreeDOS booting on my own emulator.
      --

      Do you care about the security of your wireless mouse?
  26. Re:Comparisons to other emulators? by bluefoxlucid · · Score: 1

    Most of Sun's JVM is in Java. It's like Minix: Kernel is in low-level kernel mode, while services are in user mode and use an interface to the kernel, and other services in user mode use those services, and userspace apps utilize those services. In Java, though, you're abstracting away from the hardware rather than from other software; so some part of Java (the JIT) is in a mix of C and assembly; while some other part of Java is in Java; while some other part of Java uses that part of Java and is written in Java; and the Java application along with most of Java get JIT'd into this big program. That's also why Java is slow. (Note: Minix is all C, or I guess you could write services in C++ if you really wanted.. or java.. but point is, it doesn't abstract from a lower-level language and create more fluff and more levels of abstraction to run through to exponentially increase the length of the code path, it just linearly lengthens the message passing path).

  27. Lemmings without a mouse by tepples · · Score: 1

    No mouse support (makes playing Lemmings a pain) I've read that Lemmings is a pain on the PSP too, and for the same reason. The only reason Lemmings came out on the PSP is because Sony bought Psygnosis. Any other publisher would have put it out on the DS, on Windows Mobile, or both.

    Although I would smile if they installed Windows 3.1 and the thing dropped into dosshell when you exited. I've always wondered why "DOSS Hell" was spelled with two S's.
    1. Re:Lemmings without a mouse by gravis777 · · Score: 1

      I've read that Lemmings is a pain on the PSP too, and for the same reason. The only reason Lemmings came out on the PSP is because Sony bought Psygnosis. Any other publisher would have put it out on the DS, on Windows Mobile, or both. Actually, Lemmings on the PS3 is remarkably well done. Good play control, redesigned levels, and they sell the thing for like $5.
  28. Re:Can I conclude: Survive /. effect = robust by animaal · · Score: 2, Insightful

    If this webapp. survives a lot of geeks messing and hacking about in that virtual machine I'd be very tempted to label this as a very interesting experience when it comes to the Java robustness factor. There's no danger to the virtual machine. The emulator and disc images are all run within the browser. So each browser receives its own emulated memory space and fresh disc images. No processing occurs on the server (except for serving the application code and disc images to the browser).
  29. Compared to what? by alienmole · · Score: 2, Insightful

    You're missing something here. Sure, Java is faster than some languages like Python or Ruby or PHP, but that doesn't necessarily put it in the realm of languages that are a good choice for implementing hardware emulators. There are many other languages that would be faster and, at the same time, more high-level than Java. (The ML family comes to mind.) The Java sandbox argument they use in this case is rather bogus - if you're writing an emulator, you can easily build sandbox functionality into it. In short, the choice of Java for this project is nowhere near as rational as the authors would have you believe. They probably chose it because that's what they were familiar with, or because it helped them get funding.

    1. Re:Compared to what? by ToasterMonkey · · Score: 1

      Why is writing this emulator in Java a bad idea? It seems to have acceptable performance. The fact that it can play games at a decent clip suggests it could perform just fine with most other applications (of the same era as these games at least.) Games are generally much more resource intensive than other types of applications. It's even runs on any system with a Java platform, that's not something to shrug at. I'm typing this on a Mac, and it loaded just fine in my browser.

      You seem to be missing something here, you have no good reasons NOT to write this emulator in Java.

      -Steve

    2. Re:Compared to what? by alienmole · · Score: 1

      If the purpose of this emulator is just to run DOS, DOS programs, and programs of similar size, then perhaps implementing it in Java is "acceptable", as you say. However, DOS ran happily in 640KB of memory or less, on CPUs that started from 4.77 MHz. That's why it's possible to emulate it successfully on modern hardware, because the hardware now has clock speeds nearly 1,000 times faster and memories more than a thousand time larger. To emulate more demanding systems, better performance would be needed, and Java would become a handicap.

      My other point is that the sandbox features of Java are really not that significant if you're writing your own emulator. Finally, of course, there's the fact that Java is a rather inexpressive and unnecessarily verbose language, with a relatively primitive yet complex type system.

    3. Re:Compared to what? by dsmall · · Score: 1

      Previous post said "if you're writing an emulator, you can easily build sandbox functionality into it."

      Well, that's not necessarily true. The word "easily" gets used too much. To add a sandbox can clobber performance in software-only emulation. In those emulators you have to keep the fetch-dispatch loop down to the bare minimum (no code at all would be nice, but difficult to attain). Anytime you're adding range checks the performance drops very quickly.

      In the case of the PC you can sometimes confine the range checks to the emulated BIOS (which you can rewrite in the target language and thus make very quick) and the emulated hardware for that fun I/O stuff. There's a great deal of bookkeeping in emulating PC hardware.

      I'd be rather hesitant to trust the range-checks of a rewritten BIOS against all viruses. Bugs happen. People are creative, although fortunately creativity doesn't seem to happen to virus writers much.

      -- thanks,

      Dave Small

  30. Re:Struggling to understand... by 7ex · · Score: 1

    Because it's new!

    --
    http://blog.gauner.org - just a blog
  31. 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.

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

    1. Re:My intepretation by batkiwi · · Score: 1

      I know you're being funny, but Java isn't interpeted any more than C is. Both are compiled to produce machine code (one meant to be run on a virtual machine, one by a native one, but nothing's preventing someone from making a hardware JVM).

    2. Re:My intepretation by batkiwi · · Score: 1

      Fine then, according to YOUR comments C is an interpreted language. C compiles to assembly, which is then INTERPRETED into machine code.
      Also, your point of "It's to illustrate that Java and JVMs were a step back technologically, just like .NET" shows quite a bit of ignorance. In an enterprise environment, which is more expensive: Developer time, or more/faster servers?

    3. Re:My intepretation by Excelcia · · Score: 1

      Where is the win in the situation? Native programs you maintain just the program. VM programs you maintain the program and the VM. The ignorance is people who convince enterprise management that this is a good thing.

    4. Re:My intepretation by metamatic · · Score: 1

      While it's true that nothing is stopping someone from making a hardware Java bytecode running solution, the fact that it's possible doesn't make Java a non-interpreted language, any more than the fact that it's theoretically possible to create a hardware BASIC solution makes BASIC a non-interpreted language.

      Hardware CPUs that run Java bytecode directly already exist and have done for years.

      So Java is no more "interpreted" than C, which was designed for a specific architecture (the PDP), and is also available in interpreted forms and used to compile code which is run as bytecode. You can even compile C to Java bytecode.

      Whether something is compiled or interpreted is not a function of the language, nor is it defined based on which CPU instruction set happens to be most popular at the moment.

      --
      GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
  33. license by pmsyyz · · Score: 1

    Do me a favor and don't pimp software until we can be sure it is non-proprietary.

    --
    Phillip
    1. Re:license by mohjlir · · Score: 2, Insightful

      So should we just run OSS news? Then all the MS trolls would have to get jobs! Seriously, this is news no matter what the copyright holders intend to do (or charge) for the software.

    2. Re:license by mohjlir · · Score: 1

      It is news because unlike bochs, this is written in java. It will run on your mobile phone, for instance, without *any* modification (provided it has jvm). Think retro arcade games on your mobile...

  34. Why not Simics? by Anonymous Coward · · Score: 2, Informative

    I can get Simics for free if I am an academic and Simics gives over 300 MIPS on 2GHz AMD64s (and probaly a lot more on the Core 2 CPU). I really fail to see the use of something that probably is dog slow, written in Java, and probably cannot do reverse execution. Oh, btw, Simics does x86, x86-64, SPARC V8/V9, PPC32/64, MIPS32/64, ARM and perhaps some more.

    Can someone explain the advantages of the Java based x86-emu in TFA over something like Simics?

    1. Re:Why not Simics? by ToasterMonkey · · Score: 1

      Given the requirements of Simics, and that the Java x86 emulator in question can run inside a BROWSER, I'd say it's quite clear what the advantages are.

      from http://www.virtutech.com/products/product-faqs.htm l

      Q: What is required to run Simics?

      Simics currently supports 32-bit IA32 hosts running Windows (2000 and XP) or Linux, AMD64 and EM64T hosts running Linux, and 64-bit SPARC hosts running Solaris. Minimum requirements to run Simics includes: Pentium 4 processor (for Windows or Linux host) processor, 512MB of RAM, and 500MB of available disk space.

  35. I tried the demo, but it didn't work by Master+of+Transhuman · · Score: 1

    via my Firefox on Kubuntu using the Java 1.5 plugin.

    The demo started up okay, booting and getting to an A: prompt. But it wouldn't accept keyboard focus so I couldn't enter any instructions to run any of the games.

    I contacted the project to let them know. They responded that I probably need to upgrade to Java 1.6 to insure keyboard focus. It's also possible that one of my Firefox extensions might have interfered. They said they have tested JPC with Firefox and Linux but not with Kubuntu specifically.

    I was surprised that the startup worked fairly well. There is a very long delay while the Java applet loads and I thought Firefox had frozen, but eventually it started up rather well.

    --
    Richard Steven Hack - This sig is TOO GODDAMN SHORT TO DO ANYTHING USEFUL WITH! MORONS!
    1. Re:I tried the demo, but it didn't work by Nasarius · · Score: 1

      I got the same problem with Konqueror and Java 1.6. No keyboard focus. *shrug*

      --
      LOAD "SIG",8,1
    2. Re:I tried the demo, but it didn't work by gkhan1 · · Score: 1

      It did that to me at first to (I'm running Firefox under Ubuntu), but after reloading the page a couple of times, and making sure that the applet was the first thing I clicked, it worked fine

      A bigger problem for me is that I use a non-US keyboard which means that it I couldn't do anything because I couldn't change the locale so when I typed ":" it entered ">". Meaning I couldn't do anything since I couldn't change the drive to c :) Anyone got a fix for this?

    3. Re:I tried the demo, but it didn't work by cecom · · Score: 1

      Same problem here with Firefox and JDK 1.5. Shrug.

    4. Re:I tried the demo, but it didn't work by normuser · · Score: 1

      to make it work you have to download the http://www.physics.ox.ac.uk/jpc/JPCAppletObfs.jar file. extract it to a folder (I put it in ~/jpc/) then make an html file in your jpc folder with an object (be sure to specify the width and heigth you want) with three param tags. the first one name CODE value "org.jpc.j2se.JPCApplet" the second one name type value "application/x-java-applet;version=1.5" and the third one name scriptable value "false". then just run your html file. At that point you can also play with the .img files. they are just dd dumps.

      --
      09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
      XXX#######
    5. Re:I tried the demo, but it didn't work by jaavaaguru · · Score: 1

      I also use a non-US keyboard (a UK one) and haven't had any keyboard problems. Are you using a non-qwerty keyboard?

    6. Re:I tried the demo, but it didn't work by gkhan1 · · Score: 1

      No, it is a qwerty one but it's Swedish so I have a few extra keys ("å","ä" and "ö") and everything else is slightly moved around. This often happens the first time I use a new OS if I didn't set the locale during start-up or sometimes with dumb computer that don't expect that they might be played by more people than occupy North America.

    7. Re:I tried the demo, but it didn't work by Master+of+Transhuman · · Score: 1


      Ah, that worked for me, too.

      However, the games are so dumb (I never played games back in the DOS era, either), that after proving it worked and climbing three levels in Kong, I stopped playing it.

      Cool project, though. It will be interesting to see where it ends up.

      --
      Richard Steven Hack - This sig is TOO GODDAMN SHORT TO DO ANYTHING USEFUL WITH! MORONS!
    8. Re:I tried the demo, but it didn't work by normuser · · Score: 1

      been playing with this alitle more. the hd image is a sparse image made with bximage.

      --
      09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
      XXX#######
  36. Why Java ? by DrYak · · Score: 1

    I do understand the reasons they chose the language


    I don't. What does Java has to offer that some standard C emulator doesn't ?
    Some of the current emulators provides special hooks so the emulated code can ask the emulator to perform some task for acceleration (like some emulators provide special graphic and network drivers for the emulated Windows).
    But if you cut them, there are no differences between the emulator and a real machine from the virus' point of view.

    If the emulator is well done enough there won't be any exploit that the virus could use to make the emulators's host run arbitrary code.
    Or are they using Java just because they want not to need to do extra efforts to be sure the virus won't easily escalate out of the emulator ?
    --
    "Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
    1. Re:Why Java ? by suckmysav · · Score: 1

      "What does Java has to offer that some standard C emulator doesn't?"

      Can you compile C apps to run on your phone? I know I can't.

      --
      "You can't fight in here, this is the war room!"
  37. Java is fine for emulation by tezza · · Score: 1

    [1995] When I was at university on Java 1.0, we were taught operating systems on emulated Minix. It was fine then, no reason x86 won't be fine now.

    Just give this project time. Everybody is queuing up to knock it down, but it should be fine. They're not planning to put Vista on it, just emulate some DOS data entry applications.

    --
    [% slash_sig_val.text %]
    1. Re:Java is fine for emulation by jsight · · Score: 1

      What? Where would you get an emulated Minix that runs on Java?

  38. Re:Struggling to understand... by Anonymous Coward · · Score: 1, Interesting

    Both have arrived, that's not the problem. The problem is that now that we can run a 1995 application as fast as it was running in 1995, no one is interested in running those applications anymore.

  39. What is the point? by chrysalis · · Score: 1

    Sorry, but I don't get the point.

    Viruses also need OS system calls to do the job. Unless there's also a full Windows emulation in Java (including the Windows bugs and vulnerabilities viruses depend on), how could this be used to analyze how viruses are working? And even if it was the case, what would be the point over QEmu?

    If you need to understand what some piece of code is doing, there are tools called debuggers.

    --
    {{.sig}}
    1. Re:What is the point? by JustNiz · · Score: 1

      Do you realise Windows isn't the only (x86) OS in the world? Actually there are far better ones out there....

    2. Re:What is the point? by jilles · · Score: 1

      The point would be that it can be done. They're academics.

      Having proven that it can be done and having proven that it can be done properly, they effectively prove you and other nay sayers wrong. They are claiming that it works and that it works with acceptable performance (for an emulator). A little out of the box thinking sometimes produces nice results. Why bother with C based emulators if you can do the job in the much more developer friendly Java? As I said, they're academics and probably have better things to do than wrestle with C when they can do the job a lot faster in Java.

      As for useful applications of this technology. It requires further out of the box thinking. Of course the whole point of emulation is to run legacy stuff. Some examples: running a dos emulator in CDC java to emulate good old games without having to deploy native code to the phone. Embedding a dos emulator in a J2EE environment to run some legacy x86 server software (e.g. dbase). Both cases are examples where you wouldn't want the emulator to have exploitable memory leaks or drag the OS with it when it crashes. Java based emulators provide that feature, C based emulators don't.

      Then, if it can be done for x86, it should be doable for other legacy CPUs as well. Unlike C based emulators, maintenance of this code base is probably a lot more straightforward.

      --

      Jilles
    3. Re:What is the point? by chrysalis · · Score: 1

      The topic is about viruses.

      There are viruses on Atari ST, too, but this is a x86 emulator, not a m68K emulator.

      --
      {{.sig}}
    4. Re:What is the point? by DragonWriter · · Score: 1

      Viruses also need OS system calls to do the job. Unless there's also a full Windows emulation in Java (including the Windows bugs and vulnerabilities viruses depend on), how could this be used to analyze how viruses are working?


      If you emulate the machine in Java well enough, you don't have to "emulate" Windows in Java, you just install a regular x86 version of Windows onto the emulated x86 machine running on the JVM, and, bang, you've got Windows (with all its bugs and vulnerabilities!) running under your JVM.

  40. Re:Ah, a Java-based x86 emulator... by Anonymous Coward · · Score: 1, Insightful

    "Since when did emulators become news on slashdot?"

    Sadly it's not just slashdot. I seem to encounter lots of sensational sounding studies by nonspecific "researchers at [Cambridge|Oxford]" performing miraculously mundane feats in the news. In scotland it's also fairly bad with the BBC local news often reporting about research at Glasgow University which is often, quite frankly, fucking laughable.

  41. Wait for the lawsuits... by DigitAl56K · · Score: 1

    How much of the x86 instruction set has patents attached to it?

    You probably wouldn't see the likes of Intel suing x86 emulators running on x86 (e.g. virtual machines), but it might be a different story if people start using x86 emulators on other CPU architectures through a Java VM because that cuts into their business.

    1. Re:Wait for the lawsuits... by frogstar_robot · · Score: 1

      DOSBOX has been around for awhile and uses an emulated CPU. It works well enough to run DOS games and Windows 3.1.

    2. Re:Wait for the lawsuits... by DigitAl56K · · Score: 1

      Nearly every distribution of DOSBOX is for x86 hosts. The point is that a Java emulator will have more widespread application.

    3. Re:Wait for the lawsuits... by halovaa · · Score: 1

      Don't patents only last about 20 years? So any patents attached to the 286 should already have run out and the original 386 (which was released in 1986) should be just about free, if its not already. Unless of course, patents for it were filed/granted exceedingly late. Besides, other non-Intel processors implement most of the x86 instructions already, don't they? As far as I know, they're not licensed from Intel. Intel would have to justify to a court why they let them do it for so long and were only bothering enforcing the patents now. Maybe if people re-implemented the Core 2 Duo on a Java emulator they would bother....but by the time THAT emulator could produce anything usable...

  42. Not fully functional by AsmCoder8088 · · Score: 1

    It doesn't seem to emulate everything well. I tried running the "Debug" command and it froze up when trying to executing INT 21 (a common DOS interrupt): > Debug -A MOV AH, 2A INT 21 JMP 100 -R -T (crashes at this point) this interrupt basically gets the system time, so there's no reason for it to freeze up like that.

  43. Slow by andreyw · · Score: 1

    Slow by definition. I wonder if you can use JIT techniques with java at all, but in the end, it still would have to be converted to native code.

    Also, for something that's is apparently non-FOSS, they seem to be using both the BOCHS BIOS and the VGA ROM BIOS.... Now the VGA code is AFAIK LGPLd, so they should be okay unless they modified it (a possibility) but I'm pretty sure they had to modify the stock Bochs BIOS, unless they emulated Bochs. In either case, the Bochs BIOS is GPLd.

  44. Run using your own floppy/hd images... by Anonymous Coward · · Score: 1, Informative

    I was able to run it manually, outside of the applet framework, by doing the following:

    (1) Download jar from "http://www.physics.ox.ac.uk/jpc/JPCAppletObfs.jar "

    (2) Execute using the following java command line:

    > java -classpath JPCAppletObfs.jar org.jpc.j2se.PCMonitor

    Also the jar archive contains the floppy and HD images, so you can replace them with your own:

    > unzip -l JPCAppletObfs.jar
    . . .
            38400 03-16-07 16:07 vgabios.bin
            65536 03-16-07 16:07 bios.bin
      10485760 03-16-07 16:07 dosgames.img
        1474560 03-16-07 16:07 floppy.img
    . . .
      13756027 285 files

    I tried replacing the floppy.img with a freesco.org linux image, but it failed to boot complaining about missing instructions. I'm guessing it only does the 8086 ISA.

  45. Virtual Machine Advantages by CustomDesigned · · Score: 1
    There are a lot of applications that are not CPU bound, including business and accounting, but have a *lot* of code. We have used virtual machine code since the 1970s. When upgrading the hardware and/or OS (from Series/1 to 286 AT Xenix to Motorola 68020 to Motorola PPC to AIX to Linux), we just copy the applications and data. No mess, no fuss.

    I can also think of a lot of applications that are *not* appropriate for virtual machines because of CPU performance demands. The right tool for the job and all that.

  46. Cool thing. by drolli · · Score: 1

    Ok i now need a faster processor, but this is definitely cool. Why? Because it means that, as long as there is Hardware executing Java around, Dos programs can be used. Could make the transition and archiving of existing data easier.

  47. Won't accept all keystrokes by harmonica · · Score: 1

    Renders my entering : as a > character (German system). Any other way to change to the c: volume?

  48. The next step by Myria · · Score: 1

    The next step will be for Microsoft to embrace-extend-exterminate the design for .NET, then use it to run legacy applications on a new OS that locks out native code and unsigned code.

    (This is cynicism - I'm not being too serious.)

    --
    "Screw Sun, cross-platform will never work. Let's move on and steal the Java language." - Visual J++ Product Manager
  49. Quite interesting by Orion+Blastar · · Score: 1

    Because this means non-X86 systems can finally run X86 code. Even if it is slow, it is better than not running X86 code at all. I assume it is a virtual X86 CPU in much the same way that MAME and MESS emulate CPUs via software.

    I understand that until they are able to fully emulate certain hardware than this could be limited to just DOS programs. I think they at least out to be able to emulate a S3 Virge video card, Sound Blaster 16, Intel Chipset network card, and maybe serial ports with a Hayes compatible modem in order to run some older Windows operating systems in it using a virtual hard drive. Yet until they can at least do some of the GeForce or ATI Radeon virtual graphics cards, it will be hard to do XP and Vista and modern video games.

    Just like the old Mac OS (Pre OSX) emulated a 680X0 CPU in software it took a while before PowerMac hardware caught up to allow the 680X0 emulation to be at a decent speed. A pity the same cannot be done to Intel Macs to emulate PowerPC and 680X0 cpus in software because of the big-endian little-endian differences. Although ARDI tried the 680X0 software CPU emulation in Executor they found that trying to do the same for a PowerPC CPU emulation was not as fast.

    Still a Java based X86 emulator opens up a lot of possibilities, due to the fact that Java uses a sandbox and if the Java X86 virtual machine gets infected, chances are the host OS won't get infected even if it is a X86 system itself. It could be a good way to study viruses, without risking the host machine.

    --
    Remember, Slashdot does not have a -1 disagree moderation, and no, troll, flamebait, and overrated are not substitutes.
  50. Is Java slow? by Zx-man · · Score: 1

    All you people saying how Java is slow may find it pretty amusing that this emulator in fact runs faster than DOSBOX on my G4 Mac Mini. Haven't tried it on a PC yet, though.

  51. worked well on winxp + firefox + java6 by Baki · · Score: 1

    Was playing mario and space invaders, at normal speed as if I had an early 80s PC in front of me. Impressive demo.

  52. Yes I can. by DrYak · · Score: 1

    Can you compile C apps to run on your phone? I know I can't.


    I happen to use Palm OS, so yes, I could.

    And I don't see the point of running a x86 emulator on a phone.
    - It's not a useful platform for debugging/analyzing code.
    - It's not good for playing old skool DOS games (most smart phone lack the screen resolution)
    --
    "Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
    1. Re:Yes I can. by suckmysav · · Score: 1

      "And I don't see the point of running a x86 emulator on a phone."

      Because we are geeks, and we can, that's why. :-)

      --
      "You can't fight in here, this is the war room!"
  53. Re:lame description by antiZ · · Score: 1

    Cool stuff Joris! And the source is there too!

  54. Re:Ah, a Java-based x86 emulator... by Haeleth · · Score: 1

    Since when did emulators become news on slashdot?
    Since many Slashdotters started being interested in emulation, perhaps?
  55. This is... by jrothwell97 · · Score: 1

    in theory something that could revolutionise WebOSes. Instead of using a fixed OS system, users could install whatever OS they want, customise it to their heart's content, and be able to access it anywhere.

    --
    Those using pirated Tinysoft signatures(TM) are a real threat to society and should all be thrown in jail.
  56. This really shows that FLASH is slow... by Dwedit · · Score: 1

    You know something is seriously wrong with Flash when an X86 emulator running within Java outperforms Flash.

  57. Flamebait?? by Weaselmancer · · Score: 2, Insightful

    Hey mod, I'm serious and I'm making a serious point.

    Porting the JVM somewhere is about as much effort as porting a word processor, or any other 100 meg application. But if you port the JVM, all the applications you have in Java are ported by proxy. It's a one-time task.

    So if your 100 meg word processor is in Java, once you port the JVM you get the word processor for free. And all of your other Java applications. You don't have to port them seperately. It's one porting task and then you're done.

    And now that the JVM is open source, you can expect that to happen more often. It's part of the beauty of running VM based languages.

    --
    Weaselmancer
    rediculous.
  58. Re:On a phone? by bWareiWare.co.uk · · Score: 1

    And I claim to be God!

    I get a 1Mhz 8086 on a AMD64 X2 4400+.

  59. Licence - Lemmings etc. by bWareiWare.co.uk · · Score: 1

    I am also working on a licence that allows me to distribute commecial video games for fee. Do we really think that Sony considers Lemmings abandonware? - cool work though.

  60. It could be useful . . . by sanitycrumbling · · Score: 1

    I see this as being useful under one condition only. When you ABSOLUTLY MUST have x86 emulation on a non-x86 platform for whatever reason. Like sparc or power. Much cheaper than those drop-in cards sun sells that let you run windows. (At least I assume it will be) Probably a lot slower though.

  61. Typical Oxford NIH? by lysse · · Score: 1

    "the developers are said to be working on a suitable general license"

    So as usual, if it hasn't been fiddled with by Oxonians, it doesn't exist yet... but then they write their own dictionary too, you know.

  62. Java is like XML... by Schraegstrichpunkt · · Score: 1

    ... which is like violence; If it doesn't solve the problem, use more.