Preparation
Cygwin
Download and install the Cygwin distribution. There is really nothing more to it.
Bochs
Download and install Bochs, configure it to your taste, but the defaults are fine.
Minix
Download the four files above. The rest of the tutorial will describe setting Minix up in Bochs.
Getting Started
Requirements met, preparation done. It is time to begin in earnest.
Create directory
Create a directory to contain the working files.
mkdir minix-2.0.4
Create image
Create an Empty 40 Megabyte Disk Image.
Run the Bochs Disk Image Creation Tool to create a hard disk image to host the Minix system. The tool can be started in one of two ways, from the command prompt in the Bochs program directory:
bximage
or from the Start menu:
Start->Programs->Bochs 2.1.1->Disk Image Creation Tool
Enter the commands as shown to create a 40MB empty disk image:
=============================================================
bximage
Disk Image Creation Tool for Bochs
$Id: MinixOnBochsOnWindows-revised.html,\
v 1.3 2004/05/31 01:17:39 wsenn Exp $
=============================================================
Do you want to create a floppy disk image or a hard disk image?
Please type hd or fd. [hd]
What kind of image should I create?
Please type flat, sparse or growing. [flat]
Enter the hard disk size in megabytes, between 1 and 32255
[10] 40
I will create a 'flat' hard disk image with
cyl=81
heads=16
sectors per track=63
total sectors=81648
total size=39.87 megabytes
What should I name the image?
[c.img] Minix-2.0.4-emptyHD.img
Writing: [] Done.
I wrote 41803776 bytes to (null).
The following line should appear in your Bochsrc:
ata0-master: type=disk, path="Minix-2.0.4-emptyHD.img",\
mode=flat, cylinders=8
1, heads=16, spt=63
Press any key to continue
It is important that you write down the line that begins ata0-master. This is the settings line that will be used to configure Bochs to recognize your hard disk image.
Copy image
The image will be placed into the Bochs program directory. Copy it from there into the working directory:
cp Minix-2.0.4-emptyHD.img d:\workarea\minix-2.0.4
Backup image
Throughout this tutorial, I will advise that the image be backed up at various stages of its life. It is critical that you do this. Backing up the image is accomplished by zipping it up with your favorite archiving utility - mine is WinRar, but there are plenty to choose from at CNET Downloads and Cygwin comes with gzip, which also works and is used below.
Backup up the image now. It is in a pristine state and can be used in a variety of situations in its current state.
gzip -9 minix-2.0.4-emptyHD.img
This will create a gzip file that is about 40K. Store the zip file somewhere safe:
cp minix-2.0.4-emptyHD.img.gz somewheresafe
gzip -9 minix-2.0.4-emptyHD.img.gz
Initialize Minix
Initialize Minix on the 40 Megabyte Disk Image.
In order to boot Minix on Bochs, a ROOT image, USR image, empty hard disk image, and a bochsrc file is needed. ROOT and USR were downloaded in the Preparation stage and the 40 Megabyte empty hard disk image was created in the previous step. The Bochs emulator uses a text configuration file to control how it runs. In the so-called, bochsrc file, all of the information needed to run the Minix environment will be placed, specifically, how much memory, which BIOS, which VGA ROM, disks, mice, etc. Here is a reasonable bochsrc for installing Minix on the empty hard disk. It will boot from floppy whereas the final version will boot from the hard disk. Save it to a file called Minix-2.0.4-prep.bxrc (bxrc files are associated with Bochs by its install script):
megs: 8
romimage: file=$BXSHARE/BIOS-Bochs-latest, address=0xf0000
vgaromimage: $BXSHARE/VGABIOS-elpin-2.40
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=disk, path="Minix-2.0.4-emptyHD.img",\
mode=flat, cylinders=81, heads=16, spt=63
floppya: 1_44=ROOT
floppyb: 1_44=USR
boot: floppy
log: Minix-2.0.4-prep.log
mouse: enabled=0
Pay particular interest to the lines:
ata0-master - this is where the hard disk is defined, the line came from the image creation tool
floppya - specifies the ROOT image for booting the new system
floppyb - specifies the USR image which contains the /usr file system
boot - tell Bochs to boot from the first floppy it finds (a)
Boot Minix using ROOT
This is where the fun begins:
1. Double Click the Minix-2.0.4-prep.bxrc file to start Bochs and boot Minix off the ROOT floppy.
2. Press = when the Minix boot monitor appears, to boot Minix.
3. Type fd1 when asked to: Finish the name of the device to mount as /usr: /dev/.
4. Login as root at the prompt:
noname login: root
5. Press F3 to turn on Software scrolling (may be needed if text disappears).6. Type setup to begin the actual setup script.
# setup
7. Press enter at the : prompt to continue.8. Press enter to accept the keyboard selection:
us-std
9. Press enter at the : prompt to continue.10. Configure the empty hard drive /dev/hd0.
10.1. Arrow-Down (you will see Active flag at the top left) and probably something like:
/dev/hd0: Invalid partition table (reset), ignore the error -\
it's just Minix's way of telling you that the empty image \
is not partitioned.
10.2. Right-Arrow (you will see Hex partition type at the top left).10.3. Type 81 to change the Type of the partition to Minix.
10.4. Right-Arrow three times (you will see Start head).
10.5. Type '+' to increase the Head count to 1.
10.6. Right-Arrow seven times (you will see Size in kilobytes at the top left).
10.7. Type 'm' three times to maximize the size and kb column values to the detected values. You should now see the following line:
1* hd1 81 MINIX 0 1 0 80 15 62 63 81585 40792
10.8. Type 'w' and 'y' to write the partition table to the image.10.9. Type 'q' to exit the partition program, part.
10.10. Type 'hd1' when asked to finish the name of the primary partition /dev/.
10.11. Press enter to accept the default layout.
10.12. Wait for Minix to scan the image.
10.13. Press enter to accept the default location of the ROOT floppy - 0.
10.14. Press enter to accept the default memory size of the system [4096 or more].
10.15. Type 'halt' to stop the current instance of Minix, when prompted.
10.16. Type 'boot hd1' at the fd0> to test out the hard drive instance:
boot hd1
11. Press = to start Minix on the hard disk image.12. Login as root:
noname login: root
13. type 'shutdown -h now' at the # prompt to stop the instance:
shutdown -h now
14. Press the Power button in the Bochs Toolbar to shut down Bochs.
Backup the image
The hard disk image now contains a bootable hard disk with a tiny root file system on it. Make a backup copy of the image in this state.
cp minix-2.0.4-emptyHD.img minix-2.0.4-rootonlyHD.img
gzip -9 minix-2.0.4-rootonlyHD.img
cp minix-2.0.4-rootonlyHD.img.gz someplacesafe
gzip -d minix-2.0.4-rootonlyHD.img.gz
Create a Bochsrc for the new image
Now that there is a Minix bootable hard disk image, a new bochsrc file is needed. Here it is - name it Minix-2.0.4-rootonlyHD.bxrc:
megs: 8
romimage: file=$BXSHARE/BIOS-Bochs-latest, address=0xf0000
vgaromimage: $BXSHARE/VGABIOS-elpin-2.40
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=disk, path="Minix-2.0.4-rootonlyHD.img",\
mode=flat, cylinders=81, heads=16, spt=63
floppya: 1_44=floppya.img
floppyb: 1_44=floppyb.img
boot: disk
log: Minix-2.0.4-rootonly.log
mouse: enabled=0
The relevant new lines are:
ata0-master - now points to our bootable Minix imagefloppya and floppyb - now point to non-existent image files, this allows us to insert floppy images at will, without actually initializing with a floppy in the drive (quirky, but effective, if you don't specify a floppy the emulator seems to disable the floppy - at least on my machine)
- "Minix, Page 1/4"
- "Minix, Page 2/4"
- "Minix, Page 3/4"
- "Minix, Page 4/4"



