Slashdot Mirror


Bochs x86 IA-32 Emulator 2.1 Released

Asmodeus writes "Just noticed that the 2.1 release of the Bochs IA-32 emulator is out at the Bochs home page For those not in the know, Bochs is an open source implementation of the x86 instruction set(s) and a virtual PC (al la VMWare) which is capable of booting FreeDOS and Linux under the host control of another OS."

28 of 216 comments (clear)

  1. Re:WINE for OS X by Thargok · · Score: 1, Informative

    It would be, if darWINE actually used Bochs...

  2. Bochs is not like VMWare by enosys · · Score: 5, Informative
    Bochs is not like VMWare.

    Bochs emulates the IA-32 instruction set and enables you to run IA-32 software on any sort of hardware that you can compile Bochs on. (eg. I once ran it on a MicroVAX at an incredibly slow speed)

    VMWare requires IA-32 hardware. Most of the instructions are executed natively and only some of the priviledged operations are emulated so that whatever is run under VMWare can work as if it has full control over the CPU while in fact being an un-priviledged task.

    1. Re:Bochs is not like VMWare by Anonymous Coward · · Score: 1, Informative

      Bochs emulates the IA-32 instruction set..

      It can emulate X86-64, too. Useful for debugging all those X86-64 operating system ports..

  3. capable of running serious OSes as well by Anonymous Coward · · Score: 5, Informative

    Bochs isn't just capable of running DOS clones:

    Operating Systems inside the emulation including Linux, Windows(R) 95, DOS, and Windows(R) NT 4

    It can also run Windows 2000 - and probably XP as well if product activation works.

    1. Re:capable of running serious OSes as well by mikefoley · · Score: 2, Informative

      It was NT-only. It was called FX!32. Google that and you'll find out more info than can be explained here.

      --
      What's my Karma Mr. Burns? "Excellent"
  4. Re:Yay. by antoinjapan · · Score: 2, Informative

    unfortunately having tried both bochs and vmware recently I can tell you its orders of magnitude slower than vmware due to it emulating everything whereas vmware uses the actual processor in the machine.

  5. Re:WINE for OS X by Anonymous Coward · · Score: 1, Informative

    Darwine is going to use QEMU

  6. Bochs is painfuly slow by exp(pi*sqrt(163)) · · Score: 5, Informative

    But if it's retro DOS games you're after check out dosbox which runs pretty fast and runs on many platforms.

    --
    Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
  7. Windows 98 doesn't even work on it by Neo-Rio-101 · · Score: 2, Informative

    I tried bochs a while ago, thinking I could get a virtual Windows 98 running on top of Linux.

    I was wrong.

    It was hard to install, and even when it did (after waiting for 2 hours + on a 2.4Ghz machine), it crashed BAD.

    Serves me right I guess.

    --
    READY.
    PRINT ""+-0
  8. Bochs vs. VMWare vs. Plex86 background by arrianus · · Score: 5, Informative

    This post has no point. It just provides some general (hopefully interesting) background info.

    As many people pointed out, Bochs is an x86 emulator, rather than a virtualization system like VMWare. Emulation means that you have a representation of an x86 machine in memory, look at each instruction, and change the representation appropriately. Virtualization means the code runs on the actual CPU natively, and uses 386 ninja powers to intercept all I/O calls and reroute them to the base OS.

    As a result, Bochs will run on any platform. VMWare will only run on x86. Bochs is slow enough to be useless for most common uses (a bit over a 100x hit in speed). VMWare has almost no hit in speed.

    However, the free software community did have a project that attempted to reimplement VMWare. That project was called Plex86 (http://plex86.sourceforge.net/). For reasons that I do not know, Plex86 recently reinvented itself not to do full hardware virtualization -- rather, it does not implement the I/O layer, and instead provides special drivers for Linux to talk to its I/O layer. As a result, it can only run Linux (although it claims to run it reasonably well). They may implement drivers for other platforms, but I would be fairly sceptical of any real Windows support anytime soon. That seems a lot less useful now...

    The Plex86 project, however, claims the possibility of using their virtualization technology in conjunction with Bochs to make a useable system: "There is the potential to use plex86 as an accelerator for bochs, as was demonstrated some time ago." (source: Plex86 FAQ). Likewise, it seems that if Bochs was more intelligently implemented, they could use just-in-time recompliation, a la Java or Transmeta, since they are effectively treating the x86 ISA as bytecode. That would be in the very, very distant future, but if either of these is implemented, the Bochs project is not as hopeless for end-user use as it may at first seem... Either or both of these technologies ought to give reasonable performance.

    One problem is that VMWare is creating a patent minefield in front of Plex86 and Bochs. I am not familiar with all of the patents, but from what I've heard, they've got a pretty wide field of IP cut out. I'm not sure how hard they'll exploit it, since the people working there seem like nice guys, and understand the whole open/Linux/GNU/free/etc. thing. On the other hand, so did Caldera a few years back, and VMWare is definitely getting those patents for a reason....

    One final point -- properly used, emulators like Bochs can provide amazingly powerful debugging tools. You can run a full x86 machine (admittedly at very slow speeds), but grab snapshots of the system memory at different points. You can then roll back, use a capture of all inputs to roll forward, etc.

    1. Re:Bochs vs. VMWare vs. Plex86 background by MyFourthAccount · · Score: 3, Informative

      Two additional (useless) trivia:

      1) Bochs & Plex86 are written by the same guy (well, the main developer of both is the same guy).

      2) Plex86 used to be called FreeMWare.

  9. Re:Behind the times by LnxAddct · · Score: 3, Informative

    I recently needed native windows support for a small project at the firm. (WINE wasn't doing it for me) and I fired up windows 98 in bochs. It was rather nice, had a 2 gig img and 128 megs RAM dedicated to it and it ran fairly smooth. Granted I could only boot it in this thing called "safe mode" or something like that. I did with it what I needed to do and then deleted the .img and .bochsrc. I never had to make any permanent changes to my computer. I must admit that Linux ( Unix in general) runs much better under bochs, but Windows was holding its own when IPS (instructions per second) was set to 5 million. I don't know if Windows was lagging as compared to Linux because of code quality or if bochs is geared towards linux more, or if that "safe mode" thing runs slower, so I'm not putting Windows down, just saying it doesn't seem to perform as well to me (Although I give Redmond an A+ for gui design).
    Regards,
    Steve

    P.S.Way to go bochs team! Keep up the awesome work.

  10. sorry, forgot to include proof... by LnxAddct · · Score: 4, Informative

    On their main page in the first paragraph it says ,"Bochs can be compiled to emulate a 386, 486, Pentium, Pentium Pro or AMD64 CPU, including optional MMX, SSE, SSE2 and 3DNow instructions."
    Regards,
    Steve

  11. Bochs DOES do 64-bit! by Hoser+McMoose · · Score: 4, Informative

    Uhh, did you bother to read the link? Ohh wait, this is /.

    If you HAD bothered to go to the BOCHS site you would notice that it DOES do 64-bit emulation. More specifically, it emulates the AMD64 instruction set (aka x86-64). This is rather nifty in that it allows developers to test out code for AMD64 without having to purchase the hardware. Obviously not an ideal development platform, but it could be useful for some.

  12. Virtualization... by fnord123 · · Score: 5, Informative
    Bochs isn't meant to be a high performance virtualization, as other posters have already clarified.

    Plex86 (and Xen, VMware, and Connectix, and Ensim, and others) are the things people should look at if they want fast virtualization of x86. The trouble all these technologies run into is that IO has to go through the "host" OS (the one actually running on the metal) - often popping into userspace to do it (read: context & ring switches --> slow!). This is necessary in order to allow multiple virtualized OS's to share the IO devices. This causes stuff that is IO intensive (games, compilers, databases, etc.) take a fairly serious performance hit. Interestingly enough, Intel is working on building this sort of capability in the chips directly - check out Vanderpool for instance. I don't know if AMD is doing anything similar, anybody heard anything?

  13. Re:If you want free VMWare check out Xen by Anonymous Coward · · Score: 2, Informative

    Plex86 also has been quite stale for the last couple of years.

  14. The main reason a PPC emulator doesn't exist by Sycraft-fu · · Score: 4, Informative

    Is lack of demand. Registers aren't relivant. It is a fact of a turing machine that any one can emulate any other. An x86 chip is perfectly capable of emulating a PPC chip. Now it might end up being slow (due to registeres needing to be in memory), but it would work fine. I actually have a feeling you could get it working pretty well. The 32 "general purpose" registers on a PPC actually aren't, many of them have specific tasks, and the number of registers actually on an x86 chip is not related to the number exposed by the ISA.

    However, regardless, you can make an emulator. You can make an emulator in 100% C or Perl or Java if you like, and one that is portable to any platform. It needn't be anything low level. It'd be slow, but it'd work just fine.

    Basically what it comes down to, is who wants a PPC emulator? I mean if you want a PPC system, get one. There are plenty available from IBM for reasonable prices. If it's Mac emulation you are looking at, well that's a problem. The Mac ROMs are not available outside of Mac hardware, nor is the OS, and without those, it is useless. So to run the emulator, someone would need a legit copy of the ROMs and OS, meaning they'd need to own a Mac. Well if you own the hardware an emulator is worthless.

    x86 emulation on the Mac is of much more intrest. First off, it's actually feasable to do. PC BIOS is easy to license from a number of manufacturers, and MS is happy to sell copies of Windows, even for virtual machines. Also there are cases where you have a Mac and 99% of what you do is done natively but there is the ONE app that you need for something that is Windows only. So you get an emulator. Well the only Mac only apps I can think of are things like Final Cut Pro, which would run like shit in an emulator, so you'll have native hardware if you want to use it.

    1. Re:The main reason a PPC emulator doesn't exist by Anonymous Coward · · Score: 1, Informative

      Actually it's not really needed to have Mac ROMS anymore, since MacOS 9.1 (Maybe eve earlier versions) and later Apple included software roms as the OS was running on machines with very old roms which didn't support anything newer. With MacOS X there isn't any need for ROM support at all as it's all in the OS.

      What you need is a licensed OS from Apple, that's all...

    2. Re:The main reason a PPC emulator doesn't exist by Anonymous Coward · · Score: 2, Informative
      The 32 "general purpose" registers on a PPC actually aren't, many of them have specific tasks, and the number of registers actually on an x86 chip is not related to the number exposed by the ISA.

      I'd like to know which are not general purpose among the register son PPC. From the hardware point of view, register 0 is a bit special since it can't be used as a base register for addressing (and related instruction like effective address computation) but all the other are identical, i.e., the instruction set is quite orthogonal.

      Now from a software point of view, there are other conventions, like the fact that register 1 used as a stack pointer in all the ABIs that I know. Some other registers (r2, r11, r12 and r13 mostly) are reserved for specific tasks depending on the ABI. And then registers from r13 or r14 to r31 are preserved by subroutines while r0 and r3 to r12 or r13 do not need to be, r3 being used to return function results.

      But all of this only depends on the ABI, that you are using. An emulator has no business knowing it, since it is purely a software convention (again, except for register 0). Furthermore, assembler programmers and the best compilers (and perhaps even soon GCC with unit-at-a-time) are allowed to break the ABI when they know all points from which a subroutine may be called (especially for leaf subroutines). In C this essentially means static functions whose address is never taken.

      Please stop your FUD. Even with the most register-hungry ABI, you still have something like 16 absolutely orthogonal registers on PPC, and eight more between function calls for a total of at least 24. That's with the worst options, i.e., position independent code in functions that use dynamic stack allocation (alloca()) and therefore can't eliminate the frame pointer. On Intel you are left with 2 registers preserved across function calls (ESI and EDI) and 3 more destroyed by function calls (EBP is the frame pointer and EBX the PIC relocation register).

    3. Re:The main reason a PPC emulator doesn't exist by Anonymous Coward · · Score: 1, Informative

      An x86 based PowerPC emulator does exist. look here
      runs in x86 Linux but requires a new world mac rom image to run.

      Screenshots are here

      Downloadable source here

  15. DOSEMU by hsa · · Score: 2, Informative

    Now that you mention it, http://dosemu.sourceforge.net/stable/announce-1.2. 0.html is out. It's the PC Emulator for x86 based Linux.

  16. Yeah by Crazy+Eight · · Score: 3, Informative

    Plex86 is the VMware alternative.

  17. Not really by mcc · · Score: 4, Informative

    It is a fact of a turing machine that any one can emulate any other

    It is a fact that they can. However that does not mean that it will be easy.

    It'd be slow, but it'd work just fine.

    This is exactly the problem: it would be slow. And up until a certain point, it's slow enough you might as well not do it at all. No, there's no commercial demand for PPC emulation on x86; there
    doesn't really need to be. People write emulators just because they can. Do you think there is any "demand" for an emulator for the Amstrad CPC? In the meantime, there's some hobbyist demand from people who are "curious" about OS X; there's the guarantee of instant infamy for anyone who succeeds. People have really tried, put a lot of effort into trying to, emulate the PPC on an x86. I've never seen anyone succeed. As it turns out, though, writing a PPC emulator that runs on the x86 just happens to be unbelievably difficult to do with anything even remotely approaching an acceptable speed of emulation due to the neatly mismatching design philosophies of the two instruction sets. Yeah, if there was a real commercial *NEED* for someone to emulate, an acceptable emulator could probably be created. But the issue is a little more complicated than "oh, no one wants it".

    If it's Mac emulation you are looking at, well that's a problem. The Mac ROMs are not available outside of Mac hardware, nor is the OS, and without those, it is useless. So to run the emulator, someone would need a legit copy of the ROMs and OS, meaning they'd need to own a Mac. Well if you own the hardware an emulator is worthless.

    Not only is this not the hard part, this is the part that has already been solved. Modern macintoshes no longer have anything significant in ROM. The ROM is just a tiny kickstart thing and the OS is booted entirely using the openly documented Open Firmware protocol. This part is a non-issue.

    Since the internals of an apple machine aren't that public, virtualizing the hardware might be a little bit difficult.. but, well, not that difficult, as practically all of the work has already been done for you in the form of the mac-on-linux project, a VMWare-like virtual machine for macintosh hardware that will let you boot OS X within a virtual machine on top of Linux. I am uncertain how much extra work needs to be done on top of that when emulating on the PC platform since I don't know what the internals of mac-on-linux look like. However, at the very least, the hardest and most voodoo-y part, actually getting it to boot, has already been done.

    As far as the OS goes, you can buy a copy of the Mac OS without buying an actual mac. As in, you can go to a store and buy a copy of Mac OS X 10.3 in a box. This is not unrealistic; just because someone is emulating doesn't mean they aren't willing to actually buy the OS. Case in point, everyone who emulates Windows on the Mac does in fact actually have to buy a copy of Windows.

    BTW, just out of curiousity, where are these PPC systems which you say are "available from IBM for reasonable prices"? I may just be going about it wrong, but I'm looking at IBM's website and the cheapest POWER-based system I can find is nearly $6000.

  18. Re:Bochs needs to be re-boxed. by McDutchie · · Score: 2, Informative

    I'm runnig dosbox just fine on my iBook, so evidently it's platform-independent.

  19. darWINE's planned x86 emulator by brion · · Score: 2, Informative
    "The second phase is to then integrate in WINE the QEMU binary translator."

    Of course either way it's speculation at this point.

    --

    Chu vi parolas Vikipedion?

  20. Boch CAN run Windows XP as a guest OS by rcb1974 · · Score: 5, Informative

    I got bochs v2.1 to run Windows XP without any problems. The trick is to configure bochs with --enable-cpu-level=5 --disable-sse.

    Here are some screenshots and a howto

  21. Win98 on qemu by brion · · Score: 3, Informative
    I gave a whirl at installing Win98 Second Edition into qemu 0.5.2 (x86 binary) on my Linux box (Fedora Core 1 on an old Pentium II).
    • Create a hard disk image:
      dd if=/dev/zero of=win98.img bs=1M count=1024
    • Stick in your win98 install CD and go!
      qemu -cdrom /dev/cdrom -hda win98.img -boot d
    • At the boot menu select boot to DOS option. Run FDISK and create a primary DOS partition. Exit qemu.
    • Start up qemu again, this time go into Windows setup. Should be fairly standard.
    • At some point it may give an odd error message or two. For me it complains about being unable to allocate memory for the device manager. A bit later it said it couldn't load explorer.exe and that I'd have to reinstall Windows; just rebooting (exit, restart qemu) got it going again.
    • At some point after one of the reboots it'll try to install some networking stuff. For some reason I can't get Win98 to access the CD-ROM, so it can't install this and won't boot up in non-safe mode. You may want to perform this next step earlier:
    • Boot off the CD into DOS w/ CD-ROM support. Copy the *.CAB files from d:\win98 into c:\windows\system\precopy. Reboot and if necessary go into safe mode and fiddle with the networking control panel to get it to finish installing things.
    • Voila! It sort of works.
    Some caveats; I haven't been at it long but here's my problems so far:
    • Video is VGA 16-color only, and on every boot it wants me to look for a better video driver.
    • Can't access CD-ROM from windows.
    • At least on an old Pentium II, the animated menus are _really_ slow. Turn them off!
    • I haven't gotten networking working yet.
    • Hardware detection wizard crashes reliably.
    • Sometimes the keyboard & mouse get locked up.

    However it gets that far, which is impressive. :) And while the performance isn't super in absolute terms, it runs much faster on an old Pentium II than I ever got Bochs to run on my 2 GHz Athlon. I'm expecting good things in the future...

    --

    Chu vi parolas Vikipedion?

  22. Don't forget Dosbox by SuiteSisterMary · · Score: 2, Informative

    DosBox is, of course, the other option.

    --
    Vintage computer games and RPG books available. Email me if you're interested.