forget difference between big and small commands - obsolete with vm.
[minix.git] / man / man8 / usage.8
blob797cdc9cfeb866b62c41357ba5974991f1d321ed
1 .TH USAGE 8
2 .SH NAME
3 usage \- installing and using MINIX
4 .SH DESCRIPTION
5 .de SP
6 .if t .sp 0.4
7 .if n .sp
8 ..
9 .de XB  \" An example in bold print.
10 .RS
11 .nf
12 .ft B
13 \&\\$1
14 .ft R
15 .fi
16 .RE
18 .de 3A  \" Three Letter Acronym at 1 point size smaller.
19 \&\\$3\s-1\\$1\s+1\\$2
21 .de 3B  \" TLA in bold.
22 \&\\$3\fB\s-1\\$1\s+1\fR\\$2
24 This manual page describes the installation and use of MINIX from a
25 System Administrators point of view.  It contains an installation guide,
26 instructions on how to do the initial configuration and some other info.
27 Please read this document entirely before attempting to install MINIX.
28 The installation steps are in the proper order, but not all the
29 information you may need is presented at the right moment.
30 Other detailed information that may be useful can be found in
31 .BR boot (8),
32 .BR hier (7),
33 and in
34 .BR dosminix (8)
35 if you run MINIX under DOS.
36 .SS "1. MINIX UNDER DOS"
37 Installation of MINIX to run under DOS is a nonevent.  Chances are, you are
38 reading this manual page from an already running MINIX system, but if not
39 then the setup goes like this:
40 .PP
41 Unpack the DOSMINIX.ZIP file using one of the popular ZIP utilities, such as
42 PKZIP or WinZIP.  Next reboot Windows and hit F8 just when you see the
43 "Booting Windows" message.  From the menu that appears choose "Command
44 prompt only", or if that doesn't work "Safe mode command prompt only".  Under
45 Windows Me you can use a startup disk to boot the PC into DOS.  Move
46 to the directory containing the MINIX files and type:
47 .PP
48 .XB "boot minix.mnx"
49 .PP
50 Type '=' and presto, you are running MINIX.  Most of the rest of this manual,
51 which deals mainly with running MINIX in a true hard disk partition, does
52 not apply to you.  Your system is already installed completely, with all
53 binaries and sources present, so all the talk about getting MINIX on your
54 disk can be skimmed over.  Pay attention again when the focus shifts to the
55 configuration of the system.  Section 9 is where this happens first.  (The
56 main challange to a DOS installation is to figure out which parts of the
57 installation manual do not apply.)
58 .SS "2. REQUIREMENTS"
59 The minimum system MINIX can be installed on comfortably is an IBM PC/AT
60 or PS/2 with a 286 processor, 2 MB memory, a 720 kb diskette drive, and 35
61 MB free space on an AT,
62 ESDI, or SCSI hard disk (the latter controlled by an Adaptec 1540.)  MINIX
63 for the 386 (MINIX-386 for short) can be installed on a machine with at
64 least a 386sx processor, 3 MB memory and at least 35 MB of disk space.
65 .PP
66 The minimum system MINIX can be installed on
67 .BR un comfortably
68 is an IBM PC/XT with 640 kb memory.  MINIX-386 can more or less run in 2
69 MB memory.  See sections 16 and 17 on "low memory" issues.
70 .SS "3. MINIX INSTALLATION BACKGROUND"
71 The objective of the installation is to create a partition on your disk
72 and to put MINIX into it.  MINIX really requires three partitions
73 however, so the single "primary" partition is split into three subpartitions.
74 The
75 .B s0
76 subpartition will contain the root file system, the
77 .B s1
78 subpartition will contain the
79 .B /home
80 file system, and the
81 .B s2
82 subpartition will contain the
83 .B /usr
84 file system.  What Windows calls
85 "drives", i.e C:, D:, E:, MINIX calls "file systems".  MINIX does not use
86 drive letters, but requires that one file system is made a part of another
87 file system by "mounting" one on the other.  The "root" file system is
88 always present and starts with the directory "/", the root of the directory
89 tree.  The root file system contains a few programs in
90 .BR /bin ,
91 device files in
92 .BR /dev ,
93 and configuration files in
94 .BR /etc .
95 This is just enough to get the system started.  MINIX will soon extend
96 its directory tree by mounting a file system on the
97 .B /usr
98 directory.  What is henceforth known as the /usr file system contains all
99 MINIX programs in
100 .BR /usr/bin ,
101 file system sources in
102 .BR /usr/src ,
103 etc, etc.
104 The \s-2ROOT.MNX\s+2 image contains the complete MINIX root file system, but
105 \s-2USR\s+2 contains just a small subset of the /usr file system, with just
106 enough utilities to install MINIX.  The complete /usr file system is
107 split up into the \s-2USR.TAZ\s+2, \s-2SYS.TAZ\s+2 and \s-2CMD.TAZ\s+2
108 archives that are installed later to fill /usr.
110 Let's suppose your first hard disk, which has
111 device name
112 .BR /dev/c0d0 ,
113 has Windows already present in the first primary partition
114 .RB ( /dev/c0d0p0 ),
115 and some free space left after that.  After MINIX is installed in that
116 free space the disk will look like this:
119 .in +4n
120 .ta +\w'/dev/c0d0p1s0mmmm'u
121 /dev/c0d0       Whole hard disk #0
122 /dev/c0d0p0     Windows C: drive
123 /dev/c0d0p1     MINIX primary partition
124 /dev/c0d0p1s0   MINIX root partition
125 /dev/c0d0p1s1   MINIX /home partition
126 /dev/c0d0p1s2   MINIX /usr partition
127 .in -8n
130 /dev/c0d0 is the sum of a partition table, /dev/c0d0p0 and /dev/c0d0p1.
131 Likewise is /dev/c0d0p1 the sum of a subpartition table, /dev/c0d0p1s0,
132 /dev/c0d0p1s1, and /dev/c0d0p1s2.
133 Read the "DEVICES" sections for more information on MINIX devices.
134 .SS "4. INSTALLATION"
135 .ig \" Only relevant when on CD-ROM.
136 If you have not already copied MINIX to floppy disks, please read
137 the README.TXT file in the MINIX directory now, for it tells how to do this.
138 You should also print out EXAMPLE.TXT and read it in parallel with this
139 document.  This one tells you what to do; that one shows you what the
140 screen is supposed to look like at each step, so you can see if everything
141 is OK.
144 You can install MINIX automatically or manually as described in the sections
145 below.  The end result is the same, but manual installation allows
146 one to deviate from the preconfigured choices.  You may wish to read the
147 manual pages of the programs used below before you start.  You may especially
148 want to read
149 .BR boot (8)
150 if your machine is different from what the majority buys, because you
151 may need to set a few boot parameters to configure drivers.  To do this type
152 .B ESC
153 to get to the Boot Monitor prompt, set the appropriate variables, use
154 .B save
155 to store the settings and
156 .B menu
157 to continue where you left off.
159 To install the system you need two diskettes: a bootable root diskette and a
160 diskette full of binaries to use as
161 .BR /usr .
162 These diskettes are named
163 .B \s-2ROOT\s+2
165 .BR \s-2USR\s+2 .
166 These two diskettes may also be combined on a single high density diskette.
167 In that case the \s-2USR\s+2 part is on the
168 .B p2
169 partition.
171 Insert the \s-2ROOT\s+2 diskette, boot the machine and type '=' to the menu.
172 The MINIX kernel is loaded and takes control when you see the copyright
173 banner.  After loading the root diskette into the RAM disk you will be asked
174 to finish the name of the device to mount on
175 .BR /usr .
176 Type
177 .BR fd0p2
178 for a diskette that contains both \s-2ROOT\s+2 and \s-2USR\s+2, otherwise
179 replace \s-2ROOT\s+2 by \s-2USR\s+2 and type
180 .BR fd0 .
181 Login as
182 .BR root .
183 .SS "5. AUTOMATIC INSTALLATION"
184 Before starting the installation, you must either have a free partition
185 available or have at least 35 MB not in any partition so you can create
186 a MINIX partition.
188 Type
189 .B setup
190 to start the installation script.  First it offers to install a national
191 keyboard map.  The names should be clear, except for
192 .BR us-swap ,
193 which swaps the CTRL and CAPS LOCK keys of a standard US style keyboard
194 for people who believe that the natural place of CTRL is next to A.
195 The default suggested between [ and ] is the US standard keyboard.
197 The next thing to do is to make a partition, for this you are placed in a
198 partition table editor named
199 .BR part .
200 This partition table editor is very easy to use (in the author's opinion),
201 but you will probably hate it.  You can move all over the place with the
202 arrow keys, change values, and make a mess of your partition table real quick.
203 So if you get into trouble, type 'q' to quit, 'n' to not write the table,
204 and RETURN to start over.  Use the '?' key to get help.
206 With the '+' and '\-' keys you can select the disk device to install on,
207 probably
208 .BR /dev/c0d0 ,
209 the first hard disk.  Type 'r' to load the partition table of the selected
210 disk.  Either create one new partition by modifying a partition marked
211 "None", or reuse an existing partition by changing its type to "MINIX" (hex
212 code 81).  DO NOT use part to shrink an existing partition!  It will destroy
213 all data in that partition.  MINIX needs a partition of at least 20 MB, but
214 not larger than 128 MB (MINIX-86) or 1 GB (MINIX-386).  The system needs 35
215 MB in compiled state.
217 The script then wants to know the name of the partition you've created.  The
218 partition name is probably still visible on the screen.  Combined with the
219 drive name you have to type c0d0p1, c0d2p0 or something.
221 The next question is the size of the /home partition that you want.  There
222 will be a suggested value based on the amount of disk space available.
224 The new partition table is reloaded into the disk driver, and the
225 new MINIX partition is carved up into two or three subpartitions, a
226 root, the chosen amount for /home, and the rest for /usr.
228 After making /usr, it is immediately put to use to replace the installation
229 /usr file system so that you can remove the \s-2USR\s+2 diskette and insert
230 the \s-2ROOT\s+2 diskette (unless they are one and the same).  The root file
231 system is filled with the contents of the \s-2ROOT\s+2 diskette and slightly
232 patched up to work on the hard disk (/etc/fstab.)
234 You can now skip the next section and move to "TESTING", but it may be
235 instructive to read it anyway.
236 .SS "6. MANUAL INSTALLATION"
237 The instructions that follow are at a very low level and require you to be
238 very careful.  The big advantage is that you know precisely what
239 tools have been used and how everything works.  The disadvantage is that
240 you may easily make a mistake that either forces you to start over if you
241 are lucky, or wipes out the contents of your hard disk if you are not.
242 Only if you really want to do something different should you use a manual
243 installation.  Slavishly following the steps shown below will only make
244 you end up with the same result as an automatic installation.
247 .B part
248 to make partitions to load the system into.  The best thing to do is to make
249 one large primary partition of type "MINIX" and to carve this partition up
250 into three subpartitions for root, /home, and /usr.  The assumption is that you
251 will use the second partition on the first hard disk,
252 .BR /dev/c0d0p1 ,
253 and that
254 .B c0d0p1s0
255 is the root subpartition,
256 .B c0d0p1s1
257 is /home, and
258 .B c0d0p1s2
259 is /usr.  If you want to use the first partition on
260 the second hard disk for instance, then substitute c0d1p0 and c0d1p0s[012] for
261 the above.  See the section on devices below, and the manual
262 pages of
263 .BR part (8)
265 .BR controller (4).
266 Start
267 .B part
268 and select the disk that you
269 want to install MINIX onto.  In our example it will be
270 .BR /dev/c0d0 .
273 .B part
274 to make a single partition in the primary partition table of type "MINIX",
275 then hit '>' on this new partition to make a subpartition table.
277 For the root subpartition you are advised to use 1440 kb exactly.  You can
278 make it larger if you want to, but it is advisable never to let the contents
279 outgrow a floppy.  (The \s-2ROOT\s+2 diskette is a copy of a root file
280 system, and will be used to fill your root subpartition.)
282 The second subpartition is for the /home subpartition.  You may choose to store
283 your personal files there.
285 Use the rest of the partition for
286 .BR s2 ,
287 the /usr subpartition.
289 When you are done check that /dev/c0d0p1s0 is active (the * after the partition
290 number) so you can boot from it later.
292 After making the partitions you do not have to reboot.  The disk driver
293 reloads the partition tables on the next access if the disk is not in use.
294 (Open or mounted.)
296 To be able to boot from /dev/c0d0p1s0 you must place a master bootstrap in
297 /dev/c0d0p1.  It has been placed there by
298 .B part
299 if it told you that it was creating a new partition table, but
301 .XB "installboot\0\-m\0/dev/c0d0p1\0/usr/mdec/masterboot"
304 will put it there for sure.
306 Next make a file system for on-disk /home.  Leave it empty for now.
308 .XB "mkfs\0/dev/c0d0p1s1"
310 Next make a file system for on-disk /usr and copy the floppy /usr on to it.
312 .XB "mkfs\0/dev/c0d0p1s2"
313 .XB "readall\0\-b\0/dev/c0d0p1s2 | sh"
314 .XB "mount\0/dev/c0d0p1s2\0/mnt"
315 .XB "cpdir\0\-v\0/usr\0/mnt"
317 This will create a file system on /dev/c0d0p1s2, mount it on /mnt, and copy the
318 contents of the \s-2USR\s+2 floppy onto it.  The call to
319 .B readall
320 marks bad blocks on the file system as unusable, you can omit this on a
321 drive known to be spotless (\s-2IDE\s+2 or \s-2SCSI\s+2.)
323 You can now use the new /usr in place of the \s-2USR\s+2 floppy:
325 .XB "umount\0/dev/c0d0p1s2"
326 .XB "umount\0/dev/fd0\0\0\0\0\0\0\0\0\0# fd0p2 if combined"
327 .XB "mount\0/dev/c0d0p1s2\0/usr"
329 This little dance has freed up your floppy drive, so please remove the
330 \s-2USR\s+2 diskette and replace it by the \s-2ROOT\s+2 diskette.  Make a
331 file system for the root with at least 512 inodes (files), and
332 fill it from the floppy:
334 .XB "mkfs\0\-i\0512\0/dev/c0d0p1s0"
335 .XB "mount\0/dev/fd0\0/fd0"
336 .XB "mount\0/dev/c0d0p1s0\0/mnt"
337 .XB "cpdir\0\-v\0/fd0\0/mnt"
338 .XB "umount\0/dev/fd0"
340 Remove
341 .B /mnt/etc/issue
342 to get rid of the "use setup" message that greets you when you boot, and
343 edit the file
344 .B /mnt/etc/fstab
345 to name the devices MINIX has been installed on.  In our example it
346 should look like this:
348 .XB "root=/dev/c0d0p1s0"
349 .XB "home=/dev/c0d0p1s1"
350 .XB "usr=/dev/c0d0p1s2"
352 Unmount the new root:
354 .XB "umount\0/dev/c0d0p1s0"
356 Make it bootable:
358 .XB "installboot\0\-d\0/dev/c0d0p1s0\0/usr/mdec/bootblock\0boot"
360 The automatic script would now set the
361 .B rootdev
363 .B ramimagedev
364 boot variables.  You can do this now using the
365 .B edparams
366 command, but it is easier to postpone it until the testing phase.  The
367 settings should be:
369 .XB "rootdev=c0d0p1s0"
370 .XB "ramimagedev=c0d0p1s0"
371 .SS "7. TESTING"
372 By now a new MINIX system is present on your hard disk.  Time to see if
373 it works.  Leave the \s-2ROOT\s+2 diskette in the drive and type
374 .BR halt .
375 You are now going to use the power of the Boot Monitor on the diskette to
376 boot the MINIX partition on the hard disk.  Use the monitor command
377 .B boot c0d0p1
378 to boot the primary partition MINIX has been installed in.  (It is "c0d0p1" in
379 our example.)
381 The hard disk bootstrap is now showing the menu again.  You can type '='
382 to start MINIX, but you probably want to change the boot parameters.
384 .B ESC
385 once more to get to the command prompt.  The command
386 .B set
387 shows what the current parameters are.  Here is an example that shows how
388 to make a menu to either start MINIX or boot Windows:
390 .XB "minix(=,Minix)\0boot"
391 .XB "win(w,Windows)\0boot\0c0d0p0"
392 .XB "save"
394 Windows is assumed to be in the first partition in the example above (c0d0p0).
395 When finished type
396 .B menu
397 to see if the menu looks right.  If so hit '=' to start MINIX.  Log in as
398 root.
399 .SS "8. ADDING PROGRAMS AND SOURCES TO /usr"
401 .B setup
402 command can also be used to add files from floppy sets to the system.  The
403 .B \s-2USR.TAZ\s+2
404 (programs and stuff),
405 .B \s-2SYS.TAZ\s+2
406 (system sources), and
407 .B \s-2CMD.TAZ\s+2
408 (commands sources)
409 are all installed relative to the
410 .B /usr
411 directory, so the command to use three times is
413 .XB setup\0/usr
415 .B Setup
416 will ask for the size of data on the floppies, which is by default simply
417 the entire floppy.  You will see some "Cannot make directory" errors
418 while extracting, as some directories already exist.  Ignore these messages.
419 You need the
420 .B \s-2USR.TAZ\s+2
421 set if you want a working MINIX system,
422 .B \s-2SYS.TAZ\s+2
423 if you want recompile the system or study it, and
424 .B \s-2CMD.TAZ\s+2
425 if you also want the sources of the commands.  On a disk space
426 starved machine you could opt to do without the commands sources, as they
427 are not absolutely necessary to understand MINIX.
429 If your machine does not have enough memory to run
430 .B setup\0/usr
431 then type these commands manually:
433 .XB "cd\0/usr"
434 .XB "vol\0/dev/fd0 | zcat | tar\0xvfp\0\-"
437 .3B USR.TAZ
438 is already present on the hard disk in an
439 .3A DOS
440 or Windows partition, then this command can be used under MINIX-386 to
441 extract it to avoid the floppy detour:
443 .XB "cd\0/usr"
444 .XB "mtools\0copy\0c0d0p0:USR.TAZ\0\- | setup\0/usr"
446 In 16-bit mode you don't have mtools, but maybe dosread will work:
448 .XB "cd\0/usr"
449 .XB "dosread\0c0d0p0\0USR.TAZ | setup\0/usr"
451 The file doesn't have to be in the root directory of
452 .BR c0d0p0 ,
453 of course,
454 .B "c0d1p0:/TMP/USR.TAZ"
455 would name a file on the first partition of the second hard disk in the
456 directory
457 .BR \eTMP .
459 The /usr file system can also be filled through a network from a remote host
460 if MINIX if you can get networking going with the NET.TAZ supplement.  Use
461 .B "setup\0/"
462 to install NET.TAZ (note that it goes into / instead of /usr), then
463 follow the instructions in
464 .BR boot (8)
465 to configure TCP/IP and boot MINIX.  There are now two ways to fill
466 /usr.  One is to add the host name and login name of a remote host and a
467 remote user to
468 .BR /.rhosts ,
469 as root, and to use the following command on the remote host:
471 .XB "rsh\0\-l\0root\0\fIminix-box\fP\0setup\0/usr\0< USR.TAZ"
473 Two is to use
474 .B urlget
475 to copy the data directly from a Web or FTP site by using these
476 commands under MINIX:
478 .XB "cd\0/usr"
479 .XB "urlget\0\fIurl\fP.../USR.TAZ | setup\0/usr"
481 The sources may be installed using exactly the same commands, but with
482 .3B USR.TAZ
483 replaced by
484 .3B SRC.TAZ .
485 Note that this means that the sources must also be extracted relative to
486 .BR /usr .
487 .SS "9. NAMES"
488 A standalone machine will have to be given a name.  As
489 .B root
490 type
492 .XB "echo\0\fIname\fB\0>/etc/hostname.file"
494 to change the host name of your machine to
495 .IR name .
496 .SS "10. ACTIVE ON BOOT"
497 You may want to make the MINIX partition active so that it is automatically
498 booted.  With Windows
499 .B fdisk
500 or MINIX
501 .BR part ,
502 mark the primary partition that contains MINIX active.  Using the menu you
503 made earlier you can boot either MINIX or Windows at a keypress.  You can even
504 set timeouts.  To boot MINIX automatically after 5 seconds:
506 .XB "main()\0{trap\05000\0minix;\0menu}"
509 .BR monitor (8)
510 for all the details on the monitor.
512 If you don't trust this then you can rig up a diskette that boots the MINIX
513 partition when left in the drive:
515 .XB "installboot\0\-m\0/dev/fd0\0/usr/mdec/jumpboot\0010"
517 The numbers 010 indicate the device (disk or partition) that must be booted,
518 i.e.
519 .B /dev/c0d0p1s0
520 in this example.  Take the name of the device, and use the disk, partition
521 and subpartition numbers, or less.  So c0d1p2s0 -> 120, c0d3 -> 3,
522 c0d2p0 -> 20.)
523 .SS "11. DEVICES"
524 A crash course on the MINIX devices in
525 .BR /dev :
526 The first two hard disks are named
527 .BR c0d0
529 .BR c0d1 .
530 These devices address the entire hard disk, from the
531 first to the last byte.  Each disk has four partitions, for disk 0 they are
532 .BR c0d0p0 ,
533 .BR c0d0p1 ,
534 .BR c0d0p2 ,
536 .BR c0d0p3 .
537 And for disk 1 they are named
538 .BR c0d1p0
540 .BR c0d1p3 .
541 These partitions may contain file systems,
542 .B c0d0p0
543 often contains the
544 .3A MS-DOS
545 or Windows "C:" file system.  MINIX can use these partitions
546 for file systems too, but you can also partition one of these "primary
547 partitions" into four so-called "subpartitions".  The subpartitions of
548 .B c0d0p0
549 are named
550 .BR c0d0p0s0 ,
551 .BR c0d0p0s1 ,
552 .BR c0d0p0s2 ,
554 .BR c0d0p0s3 .
555 The other partitions may have four subpartitions that are named in the same
556 way.  See
557 .BR controller (4)
558 for an elaborate description.
560 You may need to add devices to
561 .BR /dev ,
562 because not all devices are present to keep down the clutter.
563 The command
564 .3B MAKEDEV
565 knows how to make devices, and
566 .3B DESCRIBE
567 can tell you what an unknown device may be, or even what all devices in
568 .B /dev
569 may be if called without arguments.  Devices are described in
570 .BR dev (4),
571 with pointers to more specific pages.
572 .SS "12. EDITORS"
573 The editors available are
574 .B elvis
576 .B vi
577 clone),
578 .B elle
579 (a simple
580 .B emacs
581 clone),
582 and the old MINIX
583 .B mined
584 editor.  Of these editors only elvis can recover your file after a system
585 crash.  Only
586 .B mined
587 is available at installation time.  (All you need to know about mined right
588 now is that CTRL-X gets you out of it.)
589 .SS "13. BOOT MONITOR VS. MINIX"
590 The Boot Monitor uses the
591 .3A BIOS
592 to address disks, so it has no idea of controllers, it just lumps everything
593 together and ignores controller numbers.  So what the monitor thinks are
594 .BR d0 ,
595 .BR d1 ,
597 .BR d2 ,
598 may be
599 .BR c0d0
600 (IDE primary master),
601 .BR c0d2
602 (IDE secondary master), and
603 .BR c1d3
604 (SCSI disk at target 3).
605 One must keep this in mind when MINIX is installed on a disk other than the
606 very first.  So if MINIX is installed in the third partition of the SCSI disk,
607 then
608 .B "boot d2p2"
609 will boot it, and
610 .B "rootdev=c1d3p2s0"
611 will tell MINIX where its root file system is.
612 .SS "14. NATIONAL KEYBOARDS"
613 The directory
614 .B /usr/lib/keymaps
615 contains keymap tables for several national keyboards.  If you have a German
616 keyboard for instance, then
618 .XB "loadkeys\0/usr/lib/keymaps/german.map"
620 will load the German key translation table into the keyboard driver.  Copy
621 the map to
622 .B /etc/keymap
623 once MINIX is installed on the hard disk, because having to type a key
624 sequence like one of these:
626 .XB "loadkezs\0\-usr\-lib\-kezmaps\-german.map"
627 .XB "loqdkeys\0=usr=lib=key,qps=french.,qp"
629 on a reboot gets a bit annoying after a while.  Send corrections and new
630 keymaps to the person named below.  (Do not send a Dutch keymap, buy
631 yourself a real keyboard instead.)
632 .SH SUGGESTIONS
633 Below are a few useful suggestions.  Some of the information can be of use
634 in other situations than described here.
635 .SS "15. VIRTUAL CONSOLES"
636 Hold down the ALT key and press the left or right arrow key, F1, or F2.
637 This switches the console between two login sessions.  (Unless you have
638 an old mono adapter, because virtual consoles sit in video memory, and
639 a mono adapter only has memory for one.)
641 Note that kernel messages, including function key output, only appear on
642 the first console.  This may be confusing, but it keeps the other consoles
643 clean.
644 .SS "16. LOW ON MEMORY"
645 The normal installation requires that you have enough memory for a large RAM
646 disk.  You can still install MINIX normally if you either have a high density
647 diskette drive for a combined root+usr floppy, or you have two floppy drives
648 of at least 720 kb.  Before booting you have to set the variable
649 .B rootdev
650 to the same value as
651 .BR ramimagedev .
652 This is slower then a RAM disk, but saves a lot of memory.
654 The automatic installation script knows how to handle this new situation.
655 If you install manually then you have to use
657 .XB "cpdir\0\-vx\0/\0/mnt"
659 to copy the root device to disk.  When it is time to fill /usr and you only
660 have one floppy drive then hit DEL to get out of the installation script and
661 reboot as described in "TESTING".  You can then finish the installation
662 manually.
664 See the XT640K.TXT file for more advice on small machines.
666 .SS "17. LOW ON MEMORY AND ONLY ONE 720 KB FLOPPY DRIVE"
667 If you only have one 720 kb floppy drive and your system is low on memory
668 then you can use the \s-2TINYROOT.MNX\s+2 boot image.  This image contains a
669 small kernel with only the BIOS disk driver, and a small root file system.
670 You can use this disk to boot your machine.  Use the normal \s-2ROOT.MNX\s+2 to
671 install the root file system.  Keep booting your machine with
672 \s-2TINYROOT\s+2 until you have compiled a small kernel for your system.
673 Use the
674 .B rootdev
675 boot variable to select the hard disk root file system.  Do
676 .B not
677 use \s-2TINYROOT\s+2 for anything other than booting, always use
678 \s-2ROOT\s+2 when mentioned.
679 .SS "18. FLOPPY DRIVE 1 IS A HIGH DENSITY DRIVE"
680 If you would like to install from floppy drive 1 then you need to copy at
681 least one sector from the \s-2USR\s+2 image onto a diskette for drive 0.
682 The \s-2USR\s+2 bootstrap has been rigged to boot the other drive.
683 .SS "19. INSTALLING ON A SECOND HARD DISK"
684 MINIX doesn't care if it is installed on the second disk of a system with
685 two disks.  The only problem is to get it booted.  You can either rig up
686 a diskette to boot MINIX as shown earlier, or you can use the same trick
687 on the first disk.  The command
689 .XB "installboot\0\-m\0/dev/c0d0\0/usr/mdec/jumpboot\01"
691 will lock the first disk into booting the second disk.  Note that this
692 command modifies the disk outside a MINIX partition, overwriting a bit of
693 code that has likely been put there by Windows fdisk.  First verify that the
694 Boot Monitor can boot a Windows partition, because then the MINIX master
695 bootstrap can do it too.
696 .SS "20. LOTS OF MEMORY ON A 286"
697 You will have a hard time making MINIX use up 3 MB memory.  Memory you
698 can spare can be used for a "second level block cache" on the RAM disk.  The
699 File System uses the second level cache to store copies of disk blocks that
700 are pushed out of the normal (primary) block cache.  The size of the primary
701 cache is compiled into the FS server, but the size of the second level cache
702 can be set with the
703 .B ramsize
704 boot variable.  Set it to a number between 0 and 512.  512 kilobytes is
705 enough to keep most of the compiler cached.
706 .SS "21. LOTS OF MEMORY ON A 386+"
707 Processes can be as big as you would like on a 386, but in practice 4 MB is
708 a lot, and 8 MB is infinite.
709 The installation script sets up a second level cache for MINIX-386
710 of up to 1024 kilobytes.  This is because the default file system cache
711 is only 80 kb.  Your first point of call is to get rid of the poorly
712 performing second level cache by setting
713 .B ENABLE_CACHE2
714 to 0 and to assign the memory used by it to the
715 normal block cache by enlarging the appropriate
716 .B NR_BUFS
718 .B NR_BUF_HASH
719 constants in <minix/config.h> with as much as you can spare.  (1024 for
720 NR_BUFS is the minimum to keep
721 .B "cc \-c"
722 cached.  2048 is then a nice value for NR_BUF_HASH.)
723 Disable the second level cache, compile a new kernel, reboot and set
724 .B ramsize
725 to 0.
726 .SS "22. LOTS OF DISK SPACE"
727 The maximum file system size is 1 GB for MINIX-386 and 128 MB for
728 MINIX-86.  (MINIX-86 can handle larger file systems, but
729 .B fsck
730 can't check them.)  Note that a MINIX file system can only contain 65535
731 inodes (files), so the average file should be 16 kb to completely fill it.
732 It may be better to make two smaller file systems.  Besides, fsck takes
733 forever on a large file system.
734 .SH SYSTEM ADMINISTRATION
735 The system has been set up with the idea that working as root is a bad thing
736 to do.  As root you are in no way protected from doing stupid things.  So
737 don't do development as root, but work as
738 .BR bin !
739 Only in exceptional cases do you want to become root.  Being root is fun for
740 wannabe hackers; administrators know better.
742 To make life easier for bin, some programs like
743 .BR su (1),
744 .BR install (1)
746 .BR shutdown (8)
747 treat bin and other members of the operator group as special and allow them
748 the privileges of root.  (One is an operator if one's
749 group id is zero.)  Operators should share the shadow password of root by
750 having
751 .B ##root
752 in their password field.  This way they all have one face (password)
753 to the outside world, forming no greater security risk than root alone.
755 The home directory of bin contains one important Makefile.  You can use it
756 to recompile all the commands and libraries of the system.  Type
757 .B make
758 to see the usage message.  If you want to compile just one command then you
759 can simply type
760 .B make
761 to do so.  To put it in its proper place you have to type
762 .BR "make install" .
763 Read the Makefiles in the
764 .B commands
766 .B lib
767 subdirectories to understand how everything is put together.  If you are
768 tight on memory then
769 .B make
770 may fail to traverse down the source tree and also compile things.  You will
771 have to type
772 .B make
773 in each subdirectory.  You can run make in /usr/src at the end to see if
774 you've missed something or not.
776 The shell used by MINIX is a minimal version of
777 .BR ash ,
778 the BSD shell.  It has been modified to offer simple line editing using the
779 .BR editline (3)
780 library.
782 The kernel is not compiled from the master Makefile.  To make a new kernel
783 you have to step into the
784 .B tools
785 directory.  There you can run four different make commands:
788 .B make
789 This makes all the different kernel parts and combines them in the file
790 named
791 .BR image .
793 .B make fdboot
794 As above and then makes a boot floppy that you can use to restart your
795 system with.  You are prompted for the floppy device name.
797 .B make hdboot
798 First makes the image file and then copies it into the directory
799 .BR /minix .
800 If there are already two images in that directory then the newest image will
801 be removed to make space for this newer image.  It is assumed that the
802 oldest image is the most stable system image, one that always works, and
803 that the newest image is experimental.  Check beforehand what
804 .B /minix
805 contains before you run
806 .BR "make hdboot" .
807 Remove the oldest image if you want another image to become the stable
808 image.  The Boot Monitor chooses the newest image in
809 .B /minix
810 to boot.  You can use the monitor command
811 .B ls minix
812 to view the images present, and set the
813 .B image
814 variable to the full name of the image you want to use instead if the newest
815 doesn't work.  The images in
816 .B /minix
817 are named using the MINIX release and version numbers with an extra revision
818 number added to distinguish the images.
820 The first new kernel you would like to make is one configured for your
821 system.  The kernel you are running now contains several drivers
822 you don't need, or may be missing drivers that you might want.
823 In <minix/config.h> you can find a number of
824 .BI ENABLE_ XXX
825 variables that can be set to
826 .B 0
827 to exclude, or
828 .B 1
829 to include a particular driver.  The full list of configurable parameters
830 and what they do are described in
831 .BR config (8).
832 It is invaluable in figuring out what to change and how in <minix/config.h>.
834 Configuring a new kernel is sometimes not enough to enable new devices, you
835 sometimes need to use the
836 .B MAKEDEV
837 command to make new device files in
838 .BR /dev .
839 For pseudo-ttys you also have to check if
840 .B /etc/ttytab
841 mentiones the new devices.
843 New additions to the system can be made in the
844 .B /usr/local
845 tree.  An empty directory tree has been set up for you and binaries and
846 manual pages are already in the search paths.  You can make a new user entry
847 with the
848 .B adduser
849 command.
852 .B TZ
853 variable in
854 .B /etc/profile
855 tells the time zone offset from the wall clock time to GMT.  You have to
856 change it for your time zone.  (See
857 .BR TZ (5).)
859 The function keys produce debug dumps, showing various interesting data
860 about the system.  F1 lists processes and F5 shows ethernet stats, which
861 may be of use now.  Read
862 .BR console (4)
863 to know all the details of the screen and keyboard.
864 .SS "23. SYSTEM SHUTDOWN"
865 You can't just turn a MINIX system off.  MINIX must be told to flush the
866 modified data in the file system cache first.  The following
867 commands/keystrokes can be used to exit MINIX properly:
869 .B shutdown
870 First alert all users and then all processes of the impending shutdown
871 then halt or reboot the system in one of various ways.  See
872 .BR shutdown (8).
874 .B reboot / halt
875 Alert all processes of the system shutdown then reboot or halt.
877 .B \s-2CTRL\-ALT\-DEL\s+2
878 Halt the system by running
879 .BR "shutdown \-h now" .
881 MINIX halts by returning to the Boot Monitor, MINIX reboots by instructing
882 the monitor to reboot MINIX.  (MINIX is just a subprocess to the monitor.)
883 Either halt MINIX and use monitor commands to escape MINIX, or use
884 .B shutdown \-R
885 to reset the system.
887 When exiting MINIX running under DOS the Boot Monitor's
888 .B exit
889 command will return you to the DOS prompt.  The Boot Monitor and MINIX
890 are together just a pretty big DOS program as far DOS is concerned.
891 .SH FILES
892 .TP 12
893 .B /usr/ast
894 Honorary home directory of Andrew S. Tanenbaum.  Doubles as the place where
895 the default setup for a new user is found.
896 .SH "SEE ALSO"
897 .BR dosminix (8),
898 .BR monitor (8),
899 .BR boot (8),
900 .BR part (8),
901 .BR mkfs (1),
902 .BR mount (8),
903 .BR M (8),
904 .BR fstab (5),
905 .BR hier (7),
906 .BR config (8),
907 .BR console (4),
908 .BR dev (4),
909 .BR adduser (8),
910 .BR TZ (5),
911 .BR mkdist (8),
912 .BR shutdown (8).
914 "Operating Systems \- Design and Implementation 2/e" by Andrew S. Tanenbaum
915 and Albert S. Woodhull.
916 .SH NOTES
917 The notation
918 .BI < file .h>
919 refers to a C language include file in /usr/include.
921 .B Root
923 .B bin
924 do not have the current directory in their program search path to avoid
925 executing programs left around by malicious people.  This means that to run
926 .B foo
927 from the current directory,
928 .B ./foo
929 must be typed.
930 .SH BUGS
931 There are many PS/2 models, all different.  Some will run MINIX, some won't,
932 some crippled if you lie to MINIX by setting
933 .B processor
935 .BR 86 .
936 Almost no PS/2 has a standard disk, so setting
937 .B c0
939 .B esdi
941 .B bios
942 will be necessary.
944 Except for the floppy driver, none of the DMA based drivers know about DMA
945 being limited to a 24 bits address, i.e. the first 16 MB.  So under MINIX-386
946 you run a slight risk that a
947 .B tar
949 .B dd
950 command may use a buffer above 16 MB for reading or writing to a character
951 device.  This only happens if the low 16 MB is taken by some huge processes,
952 and you have more than 16 MB, of course.
953 .SH AUTHOR
954 Kees J. Bot <kjb@cs.vu.nl>