Bochs: Installation & Setup

See also: Debugging with Bochs and gdb

Obtaining Bochs

You will find the latest version by going to
Bochs' website, select See All Releases , and expanding the bochs package .

Lab 010

Bochs is already installed as /usr/bin/bochs, /u/318/bin/bochsdbg, and /u/318/bin/bochs-gdb. The PATH variable is set to the first one, which is the non-debugging version (faster emulation). The second version has an internal debugger, allowing you to step through your code in assembly. The third version is configured to use the gdb debugger;
refer here for instructions.

Linux

Download the source distribution. Modify .conf.linux to fit your needs, run sh .conf.linux, then make.

If you are having problems running bochs, you should try removing --enable-plugins from .conf.linux by uncommenting which_config=normal and commenting out which_config=plugins.

To enable the internal debugger, add --enable-disasm and --enable-debugger to the configuration. Enable debugging via gdb by adding --enable-gdb-stub instead of --enable-debugger and --enable-disasm (they are mutually exclusive).

You may optionally finish off by invoking make install. Otherwise, you may need to manually set the environment variable BXSHARE to the directory in which the bios files are stored, which is in the bios folder in your build directory. Rather than setting BXSHARE, you can also hardcode the full path in your bochsrc file.

Invoke bochs from your project directory.

Mac OS X

Follow the
linux instructions, but use .conf.macos instead of .conf.linux.

Windows

Download and run the pre-built installer. This will install bochs and bochsdbg , under C:\Program Files. The first does not support debugging and the latter, bochsdbg, has an internal debugger.

You may be able to run bochs and select the bochsrc file to read (provided with the project code template) immediately. If this does not work, however, you should try setting up the environment variables and running bochs from the command line. Set BXSHARE to point to the BIOS images, such as BIOS-bochs-latest, located in the install folder (ex: C:\Program Files\Bochs-2.3.7. See: http://linux.die.net/man/5/bochsrc for more information on this process. From the same directory as your code (as bochsrs), run bochs or bochdbg.

Another option is to install bochs using cygwin.