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: cThe 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.
Examples:
file=bios/BIOS-bochs-latest, address=0xf0000You 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.
Examples:
megs: 32 megs: 128Set 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.
Examples:
vgaromimage: bios/VGABIOS-elpin-2.40You 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.
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=insertedFloppya 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.
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=63The 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.
Examples:
cdromd: dev=/dev/cdrom, status=inserted (Unix only) cdromd: dev=e:, status=inserted (Windows only) cdromd: dev=cdromimage.iso, status=insertedThe 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.
Examples:
newharddrivesupport: enabled=1This 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.
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.
Examples:
debug: action=ignore info: action=report error: action=report panic: action=askDuring 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."
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.
midi: The filename is where the midi data is sent. This can be a device or just a file if you want to record the midi data.
midimode:
0 = No data should be output. 1 = output to device (system dependent - midi denotes the device driver). 2 = SMF file output, including headers. 3 = Output the midi data stream to the file (no midi headers and no delta times, just command and data bytes).
wave: This is the device/file where wave output is stored.
wavemode:
0 = no data 1 = output to device (system dependent - wave denotes the device driver). 2 = VOC file output, including headers. 3 = Output the raw wave stream to the file.
log: The file to write the sb16 emulator messages to.
loglevel:
0 = No log. 1 = Only midi program and bank changes. 2 = Severe errors. 3 = All errors. 4 = All errors plus all port accesses. 5 = All errors and port accesses plus a lot of extra information.
dmatimer: Microseconds per second for a DMA cycle. Make it smaller to fix non-continous sound. 750000 is usually a good value. This needs a reasonably correct setting for IPS (see below).
Examples:
vga_update_interval: 250000Video 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.
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.Examples:
floppy_command_delay: 50000Time 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.
Examples:
ips: 1000000Emulated 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].
Examples:
mouse: enabled=1 mouse: enabled=0This 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.
Examples:
private_colormap: enabled=1Requests 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.
[1] | IPS measurements depend on OS and compiler configuration in addition to processor clock speed. |