|
|
Log in / Subscribe / Register

The Bochs x86 PC Emulator

Bochs (pronounced box) is cross-platform PC emulator that was written by Kevin Lawton:

Bochs is a highly portable open source IA-32 (x86) PC emulator written in C++, that runs on most popular platforms. It includes emulation of the Intel x86 CPU, common I/O devices, and a custom BIOS. Currently, Bochs can be compiled to emulate a 386, 486, Pentium, Pentium Pro or AMD64 CPU, including optional MMX, SSE, SSE2 and 3DNow instructions. Bochs is capable of running most Operating Systems inside the emulation including Linux, Windows 95, DOS, and Windows NT 4

[Bochs] Bochs features emulation for the standard PC i/o ports, keyboard, mouse, hard drive, floppy drive, and CDROM. It also features emulation for a Sound Blaster audio card and NE2000 ethernet device. See this list of supported devices for details.

The project includes disk images for various pre-configured operating systems:

We are trying to collect a minimal hard disk or floppy disk image for all free supported operating systems that Bochs can run. Each TAR file contains everything you need to try out the operating system, including a .bochsrc, BIOS and VGA BIOS. The goal is to make it very easy for anyone to try out a disk image.

Currently, the list of pre-packaged free operating systems includes Linux, DLX Linux, Pragma Linux, Debian 3.0r0, Debian 2.2r5, FreeDOS, NetBSD, OpenBSD, and PicoBSD. Other supported operating systems include Minix, and GNU/Hurd.

The screenshots page shows Bochs running many different operating systems from within various host platforms. Due to the x86 instruction set emulation used by Bochs, performance of emulated applications may not be especially speedy.

Version 2.1 of Bochs was released recently. "We have improved the accuracy of the simulation in many ways, notably in the cpu, fpu, and vga areas; 3DNow! and PNI instructions are now supported, and Bochs includes a new disassembler that supports all IA-32 instruction sets; On the I/O devices side, Bochs now provides experimental PCI VGA and USB cards, 16550A uarts and gameport emulation; New types of disk image can be used as harddisks: stackable, commitable or growing."

Bochs is licensed under the GNU LGPL, the source code is available here.

See the project documentation and faq for more information.


to post comments

The Bochs x86 PC Emulator

Posted Jan 22, 2004 6:28 UTC (Thu) by danshearer (guest, #18686) [Link] (3 responses)

> Due to the x86 instruction set emulation used by Bochs, performance of
> emulated applications may not be especially speedy.

More specifically, Bochs is a fully synthetic simulation(*) environment, which means that there is no reliance on the architecture of the host. There is a piece of C++ for each CPU instruction that is implemented, and this code is run for every occurance of that instruction in object code being run on the simulated computer. Even if the same instruction could be run in a flash just by doing a quick call to the host processor, they don't. Not only is that cheating for this type of simulator, but there's a lot of good reasons why this would be bad and unexpected behaviour for the users.

This class of simulators have a maximum performance of something like -75 times the real hardware (that's *minus* 75x) and most of the time Bochs doesn't get anywhere near that. In addition, Bochs has very slow I/O. So Bochs isn't ever fast, but you don't run a full-system simulator for speed even though many people do run them for real-world workloads. (Sometimes, simulators like Bochs are much faster than real life overall because of the possibilities with checkpointing. However Bochs doesn't have support for that.)

--
Dan Shearer
dan@shearer.org

(*) inasmuch as the word "simulated" has meaning anymore, having been confused with "virtualised" until I'm not sure anyone can pick the difference

The Bochs x86 PC Emulator

Posted Jan 22, 2004 18:45 UTC (Thu) by eludias (guest, #4058) [Link] (2 responses)

For a better performing CPU emulator (but currently also less complete), see also QEMU: http://fabrice.bellard.free.fr/qemu/ . Reported speeds are ~10% of real computer (with cheats).

The Bochs x86 PC Emulator

Posted Jan 24, 2004 9:10 UTC (Sat) by danshearer (guest, #18686) [Link] (1 responses)

Agreed!

QEMU also has a modular, pluggable design that improves a lot on Bochs. It can emulate architectures other than x86.

Unfortunately it doesn't abstract out architecture descriptions well (no open source emulators do.) See some PowerPC implementation at
http://savannah.nongnu.org/cgi-bin/viewcvs/qemu/qemu/target-ppc/op.c?rev=HEAD&content-type=text/vnd.viewcvs-markup
as an example. What is required is a grammar so that there can be one canonical description for an architecture used by all sorts of emulators.

Many such grammars exist but there are no free implementations I know of. There is also no interest to use them among the people who develop emulators :-(

--
Dan Shearer
dan@shearer.org

The Bochs x86 PC Emulator

Posted Jan 24, 2004 10:01 UTC (Sat) by danshearer (guest, #18686) [Link]

This was actually a bit strong:

> There is also no interest...

Because I haven't tried all that hard to elicit any.

Dan


Copyright © 2004, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds