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.
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.
... now we should say: "x86 assembler: write once, run everywhere (slow as molasses in January)" ?
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.
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?
Talk about gilding the lily!
What's next? A Windows emulator written in Intercal?
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/
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.
It will take some work to port.
But still cool though.
http://saveie6.com/
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?
My server
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.
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.
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.
I accidentally formated my virtual floppy and hard drive.
not that slow if there's enough of it!
Yeah yeah yeah, it's sort of slow, if you screw around with the debugger it dies, but...
They've got Commander Keen!
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?
It's not bad - admittedly it's running DOS - but Prince of Persia seems to run nicely.
BlackNova Traders
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.
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
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?
They claim 10% native speed, which is somewhat fast in terms of emulation.
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.
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.
Support my political activism on Patreon.
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.
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)
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).
Support my political activism on Patreon.
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.
Because it's new!
http://blog.gauner.org - just a blog
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.
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.
Do me a favor and don't pimp software until we can be sure it is non-proprietary.
Phillip
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?
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!
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 ]
[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 %]
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.
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}}
"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.
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.
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.
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.
I was able to run it manually, outside of the applet framework, by doing the following:
r "
(1) Download jar from "http://www.physics.ox.ac.uk/jpc/JPCAppletObfs.ja
(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.
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.
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.
Renders my entering : as a > character (German system). Any other way to change to the c: volume?
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
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.
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.
Was playing mario and space invaders, at normal speed as if I had an early 80s PC in front of me. Impressive demo.
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 ]
Cool stuff Joris! And the source is there too!
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.
You know something is seriously wrong with Flash when an X86 emulator running within Java outperforms Flash.
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.
And I claim to be God!
I get a 1Mhz 8086 on a AMD64 X2 4400+.
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.
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.
"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.
... which is like violence; If it doesn't solve the problem, use more.
http://outcampaign.org/