====== Running on Bochs ======
This page describes the process of installing MINIX 3 on Bochs.
===== Preliminaries =====
Please install [[http://bochs.sourceforge.net/|bochs]]. Bochs binaries can be downloaded from their webpage. If you're running a Linux distribution, you can install Bochs via the package manager.
=== Windows specifics ===
If you're running Windows, in order to use networking, you are invited to also install [[http://www.winpcap.org/install/default.htm|WinPCap]]; unlike Bochs itself, this package requires Administrator's privilege to install it; it also requires Administrator's privilege once after each boot (see [[http://www.winpcap.org/misc/faq.htm#Q-7|WinPcap FAQ]] or [[http://wiki.wireshark.org/CaptureSetup/CapturePrivileges|Wireshark wiki]] for detailed explanations); after the first use, you can use it as a normal user.
Then, you will need to learn the system identifier for the network adapter. From the Bochs package, type
C> niclist
Now, we will get a notification that looks something like (//flowed here to look nicer; remember ''^'' is the Windows escaping character//):
1: Broadcom NetXtreme Gigabit Ethernet Driver
Device: \Device\NPF_{21E03ED5-DF15-4BA5-BEC0-22BBC44A8C23}
Example config for bochsrc:
ne2k: ioaddr=0x300, irq=3, mac=b0:c4:20:00:00:00, ethmod=win32, ^
ethdev=\Device\NPF_{21E03ED5-DF15-4BA5-BEC0-22BBC44A8C23}
Make sure you write down the identifier between braces (also known as a //GUID//), because we will need it later.
===== Virtual Machine Setup =====
Before you install MINIX 3, you will need to create a new virtual machine configuration. The VM configuration specifies the parameters of your Virtual machine, e.g., how much memory you want the VM to use, which file you want the virtual hard disk to be, etc.
Type
# bximage
- Type ''1'' (in recent versions of Bochs) to select the creation of an image.
- Type ''hd''.
- Type ''flat''.
- Type ''8000'', which equals to 8 GB of disk space.
- Type ''minix.img''.
Now, we will get a notification that looks something like:
The following line should appear in your bochsrc:
ata0-master: type=disk, path="minix.img", mode=flat
Make sure you write down these values, because we will need them later.
You might also copy the VGA and BIOS rom images that were included in the Bochs installation, to the current directory. Depending on the Linux Distribution you use, the image are either under ''/usr/share/bochs'' or ''/usr/local/share/bochs''
cp /usr/share/bochs/BIOS-bochs-latest BIOS-bochs-latest
cp /usr/share/bochs/VGABIOS-elpin-2.40 VGABIOS-elpin-2.40
With recent versions of Bochs, after installation, these files can be reached automatically through the $BXSHARE alias, and then copying is not required.
Next, we have to create a file called ''bochsrc.txt''. You can use any editor you like for doing this.
vim bochsrc.txt
Copy in the file the following
megs: 1024
romimage: file=$BXSHARE/BIOS-bochs-latest
# if you copied the file in the local directory, use instead
#romimage: file=BIOS-bochs-latest
vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest
# if you copied the 2.40 file in the local directory, use instead
#vgaromimage: file=VGABIOS-elpin-2.40
boot: disk, cdrom
floppya: 1_44=floppy.img, status=ejected
ata0-master: type=disk, path="minix.img", mode=flat
ata1-master: type=cdrom, path="minix_R3.3.0-588a35b.iso", status=inserted
log: out.bochs
mouse: enabled=0
com1: enabled=1, mode=file, dev="serial.out"
# On FreeBSD, add something like
e1000: enabled=1, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=xn0
# On Windows, add
e1000: enabled=1, mac=52:54:00:0E:10:00, ethmod=win32, ethdev=\Device\NPF_{guidguid-guid-guid-guid-guidguidguid}
Make sure that line 10 is exactly the same as the notification you got earlier after creating the disk image, and that the path in line 11 exactly matches the filename of the MINIX image you downloaded or will download.
===== Installation =====
Assuming you have downloaded and decompressed a MINIX 3 ISO image from the [[http://www.minix3.org/download|download page]], you can now run bochs and install MINIX.
In order to do that, type
bochs -q
(The ''-q'' option skips the graphical interactive setup menu.) MINIX 3 will now boot from the CD-ROM (since the default hard disk is not bootable.)
Then you can follow the [[.:doinginstallation#runningsetup|normal installation instructions]]. Except perhaps for the keyboard type, you can keep the default answer to all questions; unless of course you know better!
===== Booting MINIX 3 =====
Now you have installed MINIX 3 on the virtual machine. Since //disk// has preference in the boot order, just type
bochs -q
to boot MINIX 3.
===== Post-install Configuration =====
You should read [[.:postinstallation|Post Installation]] for some configuration tips.
===== Examples =====
==== FreeBSD ====
Here you find can some additional details on how to setup bochs under freebsd.
You might want to install bochs with the --with-term option ( Use text-only gui with curses library ). As most probably you won't have X installed.
In my case I disabled the X and enabled term:
/usr/ports/emulators/bochs]# make config
In the menu I have this ( you can check other options as you like of course):
...
[X] TERM Use text only, console based interface
...
[ ] X11 Use X11 display interface
...
bochsrc.txt Config details (of an earlier version of MINIX and of Bochs; please adapt to the above settings to stay up-to-date):
[pomelo@brain /mnt/storage2/minix]$ cat bochsrc.txt
romimage: file=BIOS-bochs-latest
megs: 64
vgaromimage: file=VGABIOS-elpin-2.40
floppya: 1_44=floppy.img, status=inserted
ata0-slave: type=cdrom, path=./minix.iso, status=inserted
ata0-master: type=disk, path="minix.img", mode=flat, cylinders=4112, heads=16, spt=63
log: out.bochs
mouse: enabled=0
cpu: ips=15000000
boot: disk
ne2k: ioaddr=0x300, irq=7, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=xn0
###END###
Since I only have TERM compiled as display option it will use it by default.