Bochs on Linux

This article is about setting up and using the Bochs emulator on Linux.

Commands

 * bximage: one way of creating a disk image for Bochs to boot (included in Bochs distribution)
 * dd: standard Linux command which can be used for creating a disk image

Creating a Disk Image
If you are using Bochs to run a disk-based operating system, you will need to create a simulated disk drive, or "disk image", for Bochs to use. You can use either dd or bximage to do this.
 * dd can be used to create a disk image by running this command:
 * dd if=/dev/zero of=filename bs=512 count=sectors
 * sectors = Cylinders * Heads * SectorsPerTrack
 * filename = name of output file, usually (something).img
 * You will need to remember the three figures (cylinders, heads, sectors/track) used to calculate the sectors value; they go in the Bochs configuration file. (Tip: name your file using the actual numbers use for the three figures, e.g. for a 1 GB drive with 2080 cylinders, 16 heads, and 63 sectors per track, name your file myfile-2080cyl-16hds-63sec.img, as a memory aid.)
 * bximage has a user-friendly interactive mode, which you invoke by running it with no command-line parameters.

Setup Notes
I had Bochs working using an .img file as the Windows c:\ drive, and then it mysteriously stopped working (probably due to an Ubuntu upgrade) so I'm taking notes as I rebuild the .img file to (hopefully) fix the problem. The same image worked quite well under Qemu, though.

Some notes I took last time (will explain them when I figure out what they mean): mknod /dev/loop0 modprobe loop /sbin/losetup /dev/loop0 /home/woozle/win98/c.img "Edit /etc/fstab -- set up /dev/loop0 just like D drive" mount /dev/loop0 mknod /dev/tap0 c 36 16 "Next time: try tuntap"