bochsrc

Bochs uses a configuration file called a bochsrc to know where to look for disk images, how the Bochs emulation layer should work, etc. When you first start up Bochs, it looks around for its configuration file, and parses it. Here are a few lines from a sample file:

  diskc: file="30M.sample", cyl=615, heads=6, spt=17
  boot: c
The format is very strict, so be sure to put the right number of spaces and use lowercase letters. As you can see, most lines have a keyword telling what is being configured, followed by a colon, followed by a few variable=value pairs, separated by commas. For very simple options, sometimes just a single value is needed. The source and binary distributions come with a sample bochsrc, so you can just copy the sample file and edit the settings you need to change.

The section below lists all the supported bochsrc options.

romimage

Examples:

  file=bios/BIOS-bochs-latest, address=0xf0000
You need to load a ROM BIOS into addresses 0xf0000-0xfffff. The BIOS controls what the PC does when it first powers on. Normally, you can use a precompiled BIOS in the source or binary distribution called BIOS-bochs-latest.

megs

Examples:

  megs: 32
  megs: 128
Set this to the default number of megabytes of memory you want to emulate. The default is 32, since most operating systems won't need more than that.

vgaromimage

Examples:

  vgaromimage: bios/VGABIOS-elpin-2.40
You also need to load a VGA ROM BIOS at 0xC0000. A VGA BIOS file from Elpin Systems, Inc. is provided in the source and binary distributions.

floppya/floppyb

Examples:

2.88M 3.5" Floppy:
  floppya: 2_88=a:, status=inserted
1.44M 3.5" Floppy:
  floppya: 1_44=floppya.img, status=inserted
1.2M  5.25" Floppy:
  floppyb: 1_2=/dev/fd0, status=inserted
720K  3.5" Floppy:
  floppya: 720k=/usr/local/bochs/images/win95.img, status=inserted
Floppya is the first drive, and floppyb is the second drive. If you're booting from a floppy, floppya should point to a bootable disk. To read from a disk image, write the name of the image file. In many operating systems Bochs can read directly from a raw floppy drive. For raw disk access, use the device name (Unix systems) or the drive letter and a colon (Windows systems). You can set the initial status of the media to ejected or inserted. Usually you will want to use inserted. In fact Bryce can't think of any reason to ever write ejected in your bochsrc.

diskc/diskd

Examples:

  diskc: file=10M.img, cyl=306, heads=4, spt=17
  diskc: file=112M.img, cyl=900, heads=15, spt=17
  diskd: file=483.img, cyl=1024, heads=15, spt=63
The diskc/diskd lines tell Bochs what disk image file to use as the constants of the emulated hard drive, and what geometry it should have. Diskc is the first hard drive, and diskd is the second hard drive. At present, using a raw hard drive is NOT SUPPORTED and dangerous to your data. The file should be a disk image file, which must be exactly 512*cyl*heads*spt bytes long. The geometry settings are cylinder (cyl), heads, and sectors per track (spt). If you use bximage to create the image, it will give you the required cyl, head, and spt information.

Note: You cannot use both diskd and cdromd together.

cdromd

Examples:

  cdromd: dev=/dev/cdrom, status=inserted         (Unix only)
  cdromd: dev=e:, status=inserted                 (Windows only)
  cdromd: dev=cdromimage.iso, status=inserted
The cdromd line tells Bochs to emulate a CD-ROM device. You cannot have both a diskd and a cdromd, and there is no cdromc option.

Note: You cannot use both diskd and cdromd together.

newharddrivesupport

Examples:

  newharddrivesupport: enabled=1
This setting enables support for large hard disks, better CD recognition, and various other useful functions. You can set it to "enabled=1" (on) or "enabled=0" (off). It is recommended that this setting is left on unless you are having trouble with it.

boot

Examples:

  boot: a
  boot: c
This defines your boot drive. You can either boot from 'a' or 'c'.

log

Examples:

  log: bochs.out
  log: /dev/tty               (unix only)
  log: /dev/null              (unix only)
Give the path of the log file you'd like Bochs debug and misc. verbage to be written to. If you really don't want it, make it /dev/null.

debug/info/error/panic

Examples:

  debug: action=ignore
  info: action=report
  error: action=report
  panic: action=ask
During simulation, Bochs encounters certain events that the user might want to know about. These events are divided into four levels of importance: debug, info, error, and panic. Debug messages are usually only useful when writing Bochs code or when trying to locate a problem. There may be thousands of debug messages per second, so be careful before turning them on. Info messages tell about interesting events that don't happen that frequently. Bochs produces an "error" message when it finds a condition that really shouldn't happen, but doesn't endanger the simulation. An example of an error might be if the emulated software produces an illegal disk command. Panic messages mean that Bochs cannot simulate correctly and should probably shut down. A panic can be a configuration problem (like a misspelled bochsrc line) or an emulation problem (like an unsupported video mode).

The debug, info, error, and panic lines in the bochsrc control what Bochs will do when it encounters each type of event. The allowed actions are: fatal (terminate bochs), ask (ask the user what to do), report (print information to the console or log file), or ignore (do nothing). The recommended settings are listed in the sample above.

Tip: The safest action for panics is "fatal" or "ask". If you are getting lots of panics and get tired of telling it to continue each time, you can try action=report instead. If you allow Bochs to continue after a panic, don't be surprised if you get strange behavior or crashes after a panic occurs. Please report panic messages to the bochs-developers mailing list unless it is just a configuration problem like "could not find hard drive image."

sb16

Examples:

  sb16: midimode=1, midi=/dev/midi00, wavemode=1, wave=/dev/dsp, 
        loglevel=2, log=sb16.log, dmatimer=600000

Note: The example is wrapped onto several lines for formatting reasons, but it should all be on one line in the actual bochsrc file.

The sb16 line defines Sound Blaster 16 emulation. It can have several of the following properties. All properties are in the usual "property=value" format.

vga_update_interval

Examples:

  vga_update_interval: 250000
Video memory is scanned for updates and screen updated every so many virtual seconds. The default is 300000, about 3Hz. This is generally plenty. Keep in mind that you must tweak the 'ips:' directive to be as close to the number of emulated instructions-per-second your workstation can do, for this to be accurate.

keyboard_serial_delay

Example: keyboard_serial_delay: 200


Approximate time in microseconds that it takes one character to be
transfered from the keyboard to controller over the serial path.

floppy_command_delay

Examples:

  floppy_command_delay: 50000
Time in microseconds to wait before completing some floppy commands such as read, write, seek, etc., which normally have a delay associated. This was once hardwired to 50000 but now you can adjust it.

ips

Examples:

  ips: 1000000
Emulated Instructions Per Second. This is the number of IPS that bochs is capable of running on your machine. You can recompile Bochs, using instructions included in config.h (in the source code), to find your workstation's capability.

IPS is used to calibrate many time-dependent events within the bochs simulation. For example, changing IPS affects the frequency of VGA updates, the duration of time before a key starts to autorepeat, and the measurement of BogoMips and other benchmarks. The table below lists some typical IPS settings for different machines[1].

Table 4-1. Example IPS Settings

SpeedMachineTypical IPS
650MhzAthlon K-7 with Linux 2.4.x 2 to 2.5
400MhzPentium II with Linux 2.0.x 1 to 1.8
166Mhz64bit Sparc with Solaris 2.x 0.75
200MhzPentium with Linux 2.x 0.5

mouse

Examples:

  mouse: enabled=1
  mouse: enabled=0
This option prevents Bochs from creating mouse "events" unless a mouse is enabled. The hardware emulation itself is not disabled by this. You can turn the mouse on by setting enabled to 1, or turn it off by setting enabled to 0. Unless you have a particular reason for enabling the mouse by default, it is recommended that you leave it off.

private_colormap

Examples:

  private_colormap: enabled=1
Requests that the GUI create and use it's own non-shared colormap. This colormap will be used when in the bochs window. If not enabled, a shared colormap scheme may be used. Once again, enabled=1 turns on this feature and 0 turns it off.

Notes

[1]

IPS measurements depend on OS and compiler configuration in addition to processor clock speed.