Minix Hints

This page holds some useful techniques CS 314


To read the man pages

Some commands, such as sleep, are Shell commands (1) as well as API commands (3).

% man -s 3 sleep

On some flavors of Unix, that is spelled

% man 3 sleep


To print a copy of myWork.c

Get a formated IBM floppy disk. Insert in minix machine, (drive fd0).

% fdwrite -a /dev/fd0 output < myWork.c

You now have a version of the file on a DOS disk. You can take this to any PC or Linix machine that can reach a printer.


To Save your work

Get a formated IBM floppy disk. Insert in minix machine, (drive fd0).


# mkfs Create a Minix file system
# df /dev/fd0 Check the amount of inodes and memory on the floppy
# mount /dev/fd0 /mnt Mount the floppy on the /mnt directory
% cd /usr/jdp/usr/src/kernel Move to your workspace. YMMV
% make clean Reduce size of directory
% cd .. Move up
% backup kernel /mnt Backup files onto floppy


To recover from a broken version of the OS

Minix uses the oldest version in the /minix directory to boot from. You should have an old, stable version, and a new flakey version. If you have two flakey versions, you will need to get even more creative.

Boot from a floppy You must have a working boot floppy
/dev/fd0c Response when it asks for the device to mount as /usr
Now login as root
# mount /dev/hd1a /mnt Mount the boot sector of the hard drive on /mnt. YMMV
# cd /mnt/minix; ls -l Look at the boot images on the hard drive
# rm 2.0.0.r6 Remove the oldest versiion. YMMV
# halt Get ready to reboot
> boot hd1 Boot from the harddrive


To kill a runaway process

You can get a listing of the running processes and send a SIGKILL (-9) to the process. It may be the case that the process owns the keyboard, so you cannot run ps, or is spewing so much output that you cannot read the result.

Change to the virtual conole and login under the same id. Run ps -ax, get the process ID, and send a kill -8
% kill -9 123

If you start a process in the background, you are given the PID and you are running in the shell, which makes the task a bit simpler.