\\$1
Unpack the DOSMINIX.ZIP file using one of the popular ZIP utilities, such as PKZIP or WinZIP. Next reboot Windows and hit F8 just when you see the "Booting Windows" message. From the menu that appears choose "Command prompt only", or if that doesn't work "Safe mode command prompt only". Under Windows Me you can use a startup disk to boot the PC into DOS. Move to the directory containing the MINIX files and type:
.XB "boot minix.mnx"
Type '=' and presto, you are running MINIX. Most of the rest of this manual, which deals mainly with running MINIX in a true hard disk partition, does not apply to you. Your system is already installed completely, with all binaries and sources present, so all the talk about getting MINIX on your disk can be skimmed over. Pay attention again when the focus shifts to the configuration of the system. Section 9 is where this happens first. (The main challange to a DOS installation is to figure out which parts of the installation manual do not apply.)
The minimum system MINIX can be installed on un comfortably is an IBM PC/XT with 640 kb memory. MINIX-386 can more or less run in 2 MB memory. See sections 16 and 17 on "low memory" issues.
Let's suppose your first hard disk, which has device name /dev/c0d0 , has Windows already present in the first primary partition ( /dev/c0d0p0 ), and some free space left after that. After MINIX is installed in that free space the disk will look like this:
/dev/c0d0 Whole hard disk #0 /dev/c0d0p0 Windows C: drive /dev/c0d0p1 MINIX primary partition /dev/c0d0p1s0 MINIX root partition /dev/c0d0p1s1 MINIX /home partition /dev/c0d0p1s2 MINIX /usr partition
/dev/c0d0 is the sum of a partition table, /dev/c0d0p0 and /dev/c0d0p1. Likewise is /dev/c0d0p1 the sum of a subpartition table, /dev/c0d0p1s0, /dev/c0d0p1s1, and /dev/c0d0p1s2. Read the "DEVICES" sections for more information on MINIX devices.
.. You can install MINIX automatically or manually as described in the sections below. The end result is the same, but manual installation allows one to deviate from the preconfigured choices. You may wish to read the manual pages of the programs used below before you start. You may especially want to read boot (8) if your machine is different from what the majority buys, because you may need to set a few boot parameters to configure drivers. To do this type ESC to get to the Boot Monitor prompt, set the appropriate variables, use save to store the settings and menu to continue where you left off.
To install the system you need two diskettes: a bootable root diskette and a diskette full of binaries to use as /usr . These diskettes are named \s-2ROOT\s+2 and \s-2USR\s+2 . These two diskettes may also be combined on a single high density diskette. In that case the \s-2USR\s+2 part is on the p2 partition.
Insert the \s-2ROOT\s+2 diskette, boot the machine and type '=' to the menu. The MINIX kernel is loaded and takes control when you see the copyright banner. After loading the root diskette into the RAM disk you will be asked to finish the name of the device to mount on /usr . Type fd0p2 for a diskette that contains both \s-2ROOT\s+2 and \s-2USR\s+2, otherwise replace \s-2ROOT\s+2 by \s-2USR\s+2 and type fd0 . Login as root .
Type setup to start the installation script. First it offers to install a national keyboard map. The names should be clear, except for us-swap , which swaps the CTRL and CAPS LOCK keys of a standard US style keyboard for people who believe that the natural place of CTRL is next to A. The default suggested between [ and ] is the US standard keyboard.
The next thing to do is to make a partition, for this you are placed in a partition table editor named part . This partition table editor is very easy to use (in the author's opinion), but you will probably hate it. You can move all over the place with the arrow keys, change values, and make a mess of your partition table real quick. So if you get into trouble, type 'q' to quit, 'n' to not write the table, and RETURN to start over. Use the '?' key to get help.
With the '+' and '-' keys you can select the disk device to install on, probably /dev/c0d0 , the first hard disk. Type 'r' to load the partition table of the selected disk. Either create one new partition by modifying a partition marked "None", or reuse an existing partition by changing its type to "MINIX" (hex code 81). DO NOT use part to shrink an existing partition! It will destroy all data in that partition. MINIX needs a partition of at least 20 MB, but not larger than 128 MB (MINIX-86) or 1 GB (MINIX-386). The system needs 35 MB in compiled state.
The script then wants to know the name of the partition you've created. The partition name is probably still visible on the screen. Combined with the drive name you have to type c0d0p1, c0d2p0 or something.
The next question is the size of the /home partition that you want. There will be a suggested value based on the amount of disk space available.
The new partition table is reloaded into the disk driver, and the new MINIX partition is carved up into two or three subpartitions, a root, the chosen amount for /home, and the rest for /usr.
After making /usr, it is immediately put to use to replace the installation /usr file system so that you can remove the \s-2USR\s+2 diskette and insert the \s-2ROOT\s+2 diskette (unless they are one and the same). The root file system is filled with the contents of the \s-2ROOT\s+2 diskette and slightly patched up to work on the hard disk (/etc/fstab.)
You can now skip the next section and move to "TESTING", but it may be instructive to read it anyway.
Run part to make partitions to load the system into. The best thing to do is to make one large primary partition of type "MINIX" and to carve this partition up into three subpartitions for root, /home, and /usr. The assumption is that you will use the second partition on the first hard disk, /dev/c0d0p1 , and that c0d0p1s0 is the root subpartition, c0d0p1s1 is /home, and c0d0p1s2 is /usr. If you want to use the first partition on the second hard disk for instance, then substitute c0d1p0 and c0d1p0s[012] for the above. See the section on devices below, and the manual pages of part (8) and controller (4). Start part and select the disk that you want to install MINIX onto. In our example it will be /dev/c0d0 .
Use part to make a single partition in the primary partition table of type "MINIX", then hit '>' on this new partition to make a subpartition table.
For the root subpartition you are advised to use 1440 kb exactly. You can make it larger if you want to, but it is advisable never to let the contents outgrow a floppy. (The \s-2ROOT\s+2 diskette is a copy of a root file system, and will be used to fill your root subpartition.)
The second subpartition is for the /home subpartition. You may choose to store your personal files there.
Use the rest of the partition for s2 , the /usr subpartition.
When you are done check that /dev/c0d0p1s0 is active (the * after the partition number) so you can boot from it later.
After making the partitions you do not have to reboot. The disk driver reloads the partition tables on the next access if the disk is not in use. (Open or mounted.)
To be able to boot from /dev/c0d0p1s0 you must place a master bootstrap in /dev/c0d0p1. It has been placed there by part if it told you that it was creating a new partition table, but
.XB "installboot\0-m\0/dev/c0d0p1\0/usr/mdec/masterboot"
will put it there for sure.
Next make a file system for on-disk /home. Leave it empty for now.
Next make a file system for on-disk /usr and copy the floppy /usr on to it.
.XB "mkfs\0/dev/c0d0p1s2" .XB "mount\0/dev/c0d0p1s2\0/mnt" .XB "pax -rw -pe\0-v\0/usr\0/mnt"
This will create a file system on /dev/c0d0p1s2, mount it on /mnt, and copy the contents of the \s-2USR\s+2 floppy onto it.
You can now use the new /usr in place of the \s-2USR\s+2 floppy:
.XB "umount\0/dev/c0d0p1s2" .XB "umount\0/dev/fd0\0\0\0\0\0\0\0\0\0# fd0p2 if combined" .XB "mount\0/dev/c0d0p1s2\0/usr"
This little dance has freed up your floppy drive, so please remove the \s-2USR\s+2 diskette and replace it by the \s-2ROOT\s+2 diskette. Make a file system for the root with at least 512 inodes (files), and fill it from the floppy:
.XB "mkfs\0-i\0512\0/dev/c0d0p1s0" .XB "mount\0/dev/fd0\0/fd0" .XB "mount\0/dev/c0d0p1s0\0/mnt" .XB "pax -rw -pe\0-v\0/fd0\0/mnt" .XB "umount\0/dev/fd0"
Remove /mnt/etc/issue to get rid of the "use setup" message that greets you when you boot, and edit the file /mnt/etc/fstab to name the devices MINIX has been installed on. In our example it should look like this:
.XB "root=/dev/c0d0p1s0" .XB "home=/dev/c0d0p1s1" .XB "usr=/dev/c0d0p1s2"
Unmount the new root:
Make it bootable:
.XB "installboot\0-d\0/dev/c0d0p1s0\0/usr/mdec/bootblock\0boot"
The automatic script would now set the rootdev and ramimagedev boot variables. You can do this now using the edparams command, but it is easier to postpone it until the testing phase. The settings should be:
.XB "rootdev=c0d0p1s0" .XB "ramimagedev=c0d0p1s0"
The hard disk bootstrap is now showing the menu again. You can type '=' to start MINIX, but you probably want to change the boot parameters. Hit ESC once more to get to the command prompt. The command set shows what the current parameters are. Here is an example that shows how to make a menu to either start MINIX or boot Windows:
.XB "minix(=,Minix)\0boot" .XB "win(w,Windows)\0boot\0c0d0p0" .XB "save"
Windows is assumed to be in the first partition in the example above (c0d0p0). When finished type menu to see if the menu looks right. If so hit '=' to start MINIX. Log in as root.
.XB setup\0/usr
Setup will ask for the size of data on the floppies, which is by default simply the entire floppy. You will see some "Cannot make directory" errors while extracting, as some directories already exist. Ignore these messages. You need the \s-2USR.TAZ\s+2 set if you want a working MINIX system, \s-2SYS.TAZ\s+2 if you want recompile the system or study it, and \s-2CMD.TAZ\s+2 if you also want the sources of the commands. On a disk space starved machine you could opt to do without the commands sources, as they are not absolutely necessary to understand MINIX.
If your machine does not have enough memory to run setup\0/usr then type these commands manually:
.XB "cd\0/usr" .XB "vol\0/dev/fd0 | zcat | tar\0xvfp\0-"
If .3B USR.TAZ is already present on the hard disk in an .3A DOS or Windows partition, then this command can be used under MINIX-386 to extract it to avoid the floppy detour:
.XB "cd\0/usr" .XB "mtools\0copy\0c0d0p0:USR.TAZ\0- | setup\0/usr"
In 16-bit mode you don't have mtools, but maybe dosread will work:
.XB "cd\0/usr" .XB "dosread\0c0d0p0\0USR.TAZ | setup\0/usr"
The file doesn't have to be in the root directory of c0d0p0 , of course, "c0d1p0:/TMP/USR.TAZ" would name a file on the first partition of the second hard disk in the directory \eTMP .
The /usr file system can also be filled through a network from a remote host if MINIX if you can get networking going with the NET.TAZ supplement. Use "setup\0/" to install NET.TAZ (note that it goes into / instead of /usr), then follow the instructions in boot (8) to configure TCP/IP and boot MINIX. There are now two ways to fill /usr. One is to add the host name and login name of a remote host and a remote user to /.rhosts , as root, and to use the following command on the remote host:
.XB "rsh\0-l\0root\0minix-box\0setup\0/usr\0< USR.TAZ"
Two is to use fetch to copy the data directly from a Web or FTP site by using these commands under MINIX:
.XB "cd\0/usr" .XB "fetch\0-q\0-o\0-\0url.../USR.TAZ | setup\0/usr"
The sources may be installed using exactly the same commands, but with .3B USR.TAZ replaced by .3B SRC.TAZ . Note that this means that the sources must also be extracted relative to /usr .
.XB "echo\0name\0>/etc/hostname.file"
to change the host name of your machine to name .
.XB "main()\0{trap\05000\0minix;\0menu}"
See monitor (8) for all the details on the monitor.
If you don't trust this then you can rig up a diskette that boots the MINIX partition when left in the drive:
.XB "installboot\0-m\0/dev/fd0\0/usr/mdec/jumpboot\0010"
The numbers 010 indicate the device (disk or partition) that must be booted, i.e. /dev/c0d0p1s0 in this example. Take the name of the device, and use the disk, partition and subpartition numbers, or less. So c0d1p2s0 -> 120, c0d3 -> 3, c0d2p0 -> 20.)
You may need to add devices to /dev , because not all devices are present to keep down the clutter. The command .3B MAKEDEV knows how to make devices, and .3B DESCRIBE can tell you what an unknown device may be, or even what all devices in /dev may be if called without arguments. Devices are described in dev (4), with pointers to more specific pages.
.XB "loadkeys\0/usr/lib/keymaps/german.map"
will load the German key translation table into the keyboard driver. Copy the map to /etc/keymap once MINIX is installed on the hard disk, because having to type a key sequence like one of these:
.XB "loadkezs\0-usr-lib-kezmaps-german.map" .XB "loqdkeys\0=usr=lib=key,qps=french.,qp"
on a reboot gets a bit annoying after a while. Send corrections and new keymaps to the person named below. (Do not send a Dutch keymap, buy yourself a real keyboard instead.)
Note that kernel messages, including function key output, only appear on the first console. This may be confusing, but it keeps the other consoles clean.
The automatic installation script knows how to handle this new situation. If you install manually then you have to use
.XB "pax -rw -pe\0-vx\0/\0/mnt"
to copy the root device to disk. When it is time to fill /usr and you only have one floppy drive then hit DEL to get out of the installation script and reboot as described in "TESTING". You can then finish the installation manually. See the XT640K.TXT file for more advice on small machines. ..
.XB "installboot\0-m\0/dev/c0d0\0/usr/mdec/jumpboot\01"
will lock the first disk into booting the second disk. Note that this command modifies the disk outside a MINIX partition, overwriting a bit of code that has likely been put there by Windows fdisk. First verify that the Boot Monitor can boot a Windows partition, because then the MINIX master bootstrap can do it too.
To make life easier for bin, some programs like su (1), install (1) and shutdown (8) treat bin and other members of the operator group as special and allow them the privileges of root. (One is an operator if one's group id is zero.) Operators should share the shadow password of root by having ##root in their password field. This way they all have one face (password) to the outside world, forming no greater security risk than root alone.
The home directory of bin contains one important Makefile. You can use it to recompile all the commands and libraries of the system. Type make to see the usage message. If you want to compile just one command then you can simply type make to do so. To put it in its proper place you have to type "make install" . Read the Makefiles in the commands and lib subdirectories to understand how everything is put together. If you are tight on memory then make may fail to traverse down the source tree and also compile things. You will have to type make in each subdirectory. You can run make in /usr/src at the end to see if you've missed something or not.
The shell used by MINIX is a minimal version of ash , the BSD shell. It has been modified to offer simple line editing using the editline (3) library.
The kernel is not compiled from the master Makefile. To make a new kernel you have to step into the tools directory. There you can run four different make commands:
make This makes all the different kernel parts and combines them in the file named image .
make hdboot First makes the image file and then copies it into the directory /minix . If there are already two images in that directory then the newest image will be removed to make space for this newer image. It is assumed that the oldest image is the most stable system image, one that always works, and that the newest image is experimental. Check beforehand what /minix contains before you run "make hdboot" . Remove the oldest image if you want another image to become the stable image. The Boot Monitor chooses the newest image in /minix to boot. You can use the monitor command ls minix to view the images present, and set the image variable to the full name of the image you want to use instead if the newest doesn't work. The images in /minix are named using the MINIX release and version numbers with an extra revision number added to distinguish the images.
The first new kernel you would like to make is one configured for your system. The kernel you are running now contains several drivers you don't need, or may be missing drivers that you might want. In <minix/config.h> you can find a number of ENABLE_ XXX variables that can be set to 0 to exclude, or 1 to include a particular driver. The full list of configurable parameters and what they do are described in config (8). It is invaluable in figuring out what to change and how in <minix/config.h>.
Configuring a new kernel is sometimes not enough to enable new devices, you sometimes need to use the MAKEDEV command to make new device files in /dev . For pseudo-ttys you also have to check if /etc/ttytab mentiones the new devices.
New additions to the system can be made in the /usr/local tree. An empty directory tree has been set up for you and binaries and manual pages are already in the search paths. You can make a new user entry with the adduser command.
The TZ variable in /etc/profile tells the time zone offset from the wall clock time to GMT. You have to change it for your time zone. (See TZ (5).)
The function keys produce debug dumps, showing various interesting data about the system. F1 lists processes and F5 shows ethernet stats, which may be of use now. Read console (4) to know all the details of the screen and keyboard.
shutdown First alert all users and then all processes of the impending shutdown then halt or reboot the system in one of various ways. See shutdown (8).
reboot / halt Alert all processes of the system shutdown then reboot or halt.
\s-2CTRL-ALT-DEL\s+2 Halt the system by running "shutdown -h now" .
MINIX halts by returning to the Boot Monitor, MINIX reboots by instructing the monitor to reboot MINIX. (MINIX is just a subprocess to the monitor.) Either halt MINIX and use monitor commands to escape MINIX, or use shutdown -R to reset the system.
When exiting MINIX running under DOS the Boot Monitor's exit command will return you to the DOS prompt. The Boot Monitor and MINIX are together just a pretty big DOS program as far DOS is concerned.
"Operating Systems - Design and Implementation 2/e" by Andrew S. Tanenbaum and Albert S. Woodhull.
Root and bin do not have the current directory in their program search path to avoid executing programs left around by malicious people. This means that to run foo from the current directory, ./foo must be typed.
Except for the floppy driver, none of the DMA based drivers know about DMA being limited to a 24 bits address, i.e. the first 16 MB. So under MINIX-386 you run a slight risk that a tar or dd command may use a buffer above 16 MB for reading or writing to a character device. This only happens if the low 16 MB is taken by some huge processes, and you have more than 16 MB, of course.