Getting Started with Minix on Bochs on Mac OS

modified: 20 Feb 2003

This is a step-by-step account of how I set up Minix on Bochs on a 333 Mhz iMac (new in 1999) with Mac OS 8.6. My iMac has 160M of RAM and uses 158M of the hard disk for virtual memory. I have 5 GB free on a 6 GB hard disk.

I haven't used Macs a lot, so I will go in some detail into things that may be obvious to experienced Mac users, but that were not so obvious to me with my experience with Unix and Windows systems.

I started by going to the Bochs project home page at http://bochs.sourceforge.net/. The Bochs site is confusing -- on the top level page it was stated that Bochs 2.0.2 for the Mac OS was not yet available, but somehow I found the Bochs x86 PC emulator File List page at http://sourceforge.net/project/showfiles.php?group_id=12580&release_id=135273. There I found bochs-2.0.2.ppc-macos.sit with other Bochs 2.0.2 files dated 21 Jan 2003. On the same page I also found a disk image for Minix, minix203.tar.gz, dated 2 October 2002. I downloaded both.

These files are fairly large, and I still have just a 56K modem connection at home, so I downloaded them to a PC at work, and brought them home on a Zip disk to transfer them to the iMac. The Bochs file is 2.9 MB and the Minix image is 6.4 MB.

First I installed Bochs. I copied the .sit file to the Mac hard disk. The .sit file is opened by Stuffit Expander; it created a bochs-2.0.2 directory. Current Bochs releases include a small version of Linux, DLX Linux, and inside the boch-2.0.2 directory I found a dlxlinux directory containing a 10 MB DLX Linux disk image, and a Readme file that tells how to start Bochs and load DLX Linux. The bochsrc.dlx file is located in the main boch-2.0.2 directory. I recommend using DLX Linux on Bochs to get familiar with the system before attempting to run Minix under Bochs.

On to Minix -- I copied minix203.tar.gz to the Mac hard disk. When I clicked on it a window opened saying the application that created the file could not be found, and offering to try Stuffit Expander to open the file. That worked, and the result was a minix203 directory containing 3 files: a 64 MB Minix disk image, a readme.txt, and bochsrc.txt. I moved that directory into the bochs-2.0.2 directory.

For reference I kept the original bochsrc.txt unaltered and made a copy which I renamed bochsrc.minix and moved to the top level bochs-2.0.2 directory, so the structure for Minix is parallel to that for DLX Linux, with the disk image file in a subdirectory and the working bochsrc in the main directory with the MacBochs executable. I attempted to start Bochs according to the procedure that worked with the DLX Linux image: run MacBochs, select 2, type in "bochsrc.minix", and select 5. I wasn't terribly surprised when this didn't work. The next step was to look more closely at bochsrc.minix.

The error message on the first attempt was: ">>PANIC<< could not look up environment variable 'BXSHARE'." Using the Mac SimpleText editor, I compared bochsrc.minix with bochsrc.dlx. The first non-comment line in each bochsrc was:

dlx:   romimage: file=:bios:BIOS-bochs-latest, address=0xf0000 
minix: romimage: file=$BXSHARE/BIOS-bochs-latest, address=0xf0000

The explanation of the PANIC was clear: the Minix file, originally created for a Unix or Windows environment, depended upon a $BXSHARE environment variable having been previously defined. This would not work on the Mac. Another thing was obvious, for the Mac the separator for directory path elements is a colon, not a slash.

Editing my bochsrc.minix for use on the Mac resulted in lines like this for file references:

romimage: file=:bios:BIOS-bochs-latest, address=0xf0000
vgaromimage: :bios:VGABIOS-elpin-2.40
diskc: file=":minix203:minix203.img", cylinders=940, heads=6, spt=17

I thought I was done now, but I wasn't. The message when I tried to run was now: ">>PANIC<< bochsrc.minix: diskc directive malformed."

The bochsrc.dlx file is heavily commented, and looking at it again I saw that the "diskc" parameter is deprecated. I suspect that this comment was written before the release of Bochs 2.0; deprecated normally means "discouraged but still allowed" but it seems that with Bochs 2.0.2 use of diskc is not allowed at all. Instead, for each disk two ata* parameters are required. Again, the bochsrc.dlx file provided a model for this. Also, the boot parameter is changed. My final bochsrc.minix file looks like this (with the new lines following the commented old lines):

romimage: file=:bios:BIOS-bochs-latest, address=0xf0000
megs: 64
vgaromimage: :bios:VGABIOS-elpin-2.40
# diskc: file=":minix203:minix203.img", cylinders=940, heads=6, spt=17
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=disk, path=":minix203:minix203.img", cylinders=940, heads=6, spt=17
# boot: c
boot: disk
log: bochsout.txt
panic: action=ask
error: action=report
info: action=report
debug: action=ignore
ips: 1000000
mouse: enabled=0

Bochs accepted this configuration file without complaint, but when I then tried to run the simulation a few preliminary messages appeared, and then -- nothing.

One more change did the trick. Here my familiarity with Minix helped me out. Like Minix, Mac OS versions prior to OS X assign a fixed amount of memory to each executable, and that memory allocation cannot be exceeded at run time. Highlighting the MacBochs executable and going to the File: Get Info: menu and selecting the Memory tab, I saw that the MacBochs executable was assigned only16 MB of memory. This is enough to load the 10 MB simulated disk for DLX Linux, but the simulated disk for Minix is 64 MB. Guessing that 8 MB should be more than enough for Bochs itself, I increased the preferred memory size for the program to 72 MB (73728 KB). And ... success! When I next started MacBochs and specified the bochsrc.minix file a window opened with the familiar "Press = to start Minix" message.

This document is called "Getting Started..." and that's how far I have come -- I have started. I have Minix running on Bochs on my iMac. I tried a few commands, they seem to work as expected. Response is a little sluggish, But not too bad. The date command seems to work correctly, so the simulated time stays close to the real time, not like the case with Minix on Bochs on Windows 2000. I think to be useful I'll need some way to transfer information in and out of Bochs, and I don't yet know a way to do that. The iMac has a built-in ethernet adapter, but ethernet support is not compiled into the Mac OS binary; I presume because it doesn't work. The iMac has a serial port, but I haven't tried to access it yet. The iMac does not have a floppy drive built in, but USB floppy and Zip drives are available. A way to read and write files to the iMac hard disk would also be useful.

Update -- Henry Umansky <hmust2@pitt.edu> reports:

I got it to work following those directions for my iMac OS 9.2.2 w/ 192MB of memory.


Mail comments on this page to: Al Woodhull <awoodhull@hampshire.edu>

[Valid HTML 4.0!]