Monday, August 2, 2010

Installing Bochs

Start at the Beginning
Table of Contents

Bochs is a PC "emulator" - software that does what hardware inside a PC normally does. Explaining what exactly an emulator is and how it works is outside the scope of this book - but by the time you get to the end of it, not only will you understand much of the principles of emulation without me even needing to explain them to you, you'll probably have some ideas on how to write an emulator yourself.

Using Bochs, we're going to have a virtual PC running on top of your real computer. It'll have virtual floppy disk drives, a virtual hard disk, and you'll have have to virtually boot it up. When the virtual PC crashes, it only virtually crashes; it won't crash your actual computer - something you'll quickly grow to be thankful for, believe me.

No matter if you have a Windows PC, or a Mac, or even a Linux box, Bochs can run on your computer and create a virtual DOS machine on your desktop. This is another perk of using Bochs.

The only downside is that Bochs is slow - it has to take care of in software what the physical hardware of the PC normally does instantaneously. When a program would normally be telling the CPU to add two numbers together, Bochs instead has to intercept and interpret that message, then tell the real CPU to do it, then report the result back to the program. You're adding a layer of indirection.

This is okay though, because we're pretending that we're developing for a slow computer anyways. Bochs is still more than fast enough for our needs, and because of how low-tech the software on our Bochs machine is, it'll still probably be more responsive than a modern desktop. DOS only takes a couple of seconds to start up, for instance.

Unfortunately, setting up Bochs is tricky on a Mac, and I don't have one right now. The following directions are for Windows PC only. Hopefully I'll have Mac directions up soon. If you're on Linux, the installation process varies depending on the distribution you're running; but Bochs should be in your repositories - and if you're on Linux, you probably don't need me to tell you what that means.

To download Bochs, go to the Bochs website and click on 'See All Releases' in the menu on the left. When I wrote this, I used the latest version of Bochs, 2.4.5. Even if, by the time you read this, newer releases of Bochs are available, I recommend you use 2.4.5 - otherwise, no guarantee on how well my disk images and configuration files will work.

The file you want should be called Bochs-2.4.5.exe. If you're reading this in the
present day, it'll be under Newest Files. If you're from the future, you might need to scroll down and click on the 2.4.5 folder first.

Download the install file and run it. First, it will ask you if you agree to the license Bochs is published under. Legally, I'm obligated to tell you to read it before you click 'I Agree'. There's nothing bad in there, don't worry. If you don't agree to the terms, you can't use Bochs - and if you can't use Bochs, you can't follow along with this book, so a lot is riding on it!

Next, you'll need to choose what components you install. Frankly, it doesn't really matter - even a full install is tiny on a modern computer, and even the most minimal set up will work for our purposes. Here are my recommended settings:



Bochs will then ask you for an install location. The default should work, but feel free to change it if you'd like. If you do change it, be sure to make a note of where you change it to. Once you've set the install location to your liking, click 'Install'.

When the install completes, click the 'Close' button. The Bochs installer will ask you if you want to see a list of changes - if you're curious, go ahead and click 'Yes' - but really, there's no need. Nor do you need to read the README, which it'll ask you about in the next message box. Click 'OK' at the "Thank You" message, and you'll be finished installing Bochs.

No comments:

Post a Comment