BOOT(8) Minix Programmer's Manual BOOT(8) NAME boot - from power on to the login prompt DESCRIPTION At power on the machine reads the first sector of the boot device into memory and executes it. This bootstrap code loads /boot, the Minix Boot Monitor. The monitor loads the kernel binaries from /minix, or the newest file in /minix if it is a directory. The Minix system is now running, the different tasks initialize themselves and control is transferred to the last one, init.stub. All init.stub does is call /sbin/init, or the program named by the init boot variable. Init is the grandparent of all Minix processes, it is responsible for starting login processes on each terminal, but first it runs /etc/rc. /etc/rc checks the state of the system and starts daemons. First it sets the keyboard translation to the mapping in /etc/keymap if present, then it reads the time zone from /etc/timeinfo followed by a call to readclock(8) to set Minix time from the hardware clock. Next the virtual disk devices are configured, the file systems are checked, the root file system remounted read-write and the file systems mentioned in /etc/fstab mounted. The system is now ready for multiuser startup, /etc/rc calls /usr/etc/rc that cleans out /tmp, /usr/tmp, and resets or cycles log files by running /usr/etc/daily, starts the update(8) and cron(8) daemons, and initializes the network services. /etc/rc finally runs the rc files found in /opt/*/etc, /usr/local/etc, and /var/etc to initialize the system in a site or host dependent way. Init reads /etc/ttytab and starts a getty(8) for each enabled terminal line to allow a user to log in. OPTIONS bootopts=-s The value of the boot variable bootopts is passed to /etc/rc. If it contains -s then the system will run a single user shell before continuing with multiuser startup. (Note that one normally uses boot -s instead of setting bootopts.) bootopts=-a This flag tells that /etc/fstab must be ignored. The system asks for a device to use as /usr instead. This will also be done if the root device is not as mentioned in /etc/fstab. 1 BOOT(8) Minix Programmer's Manual BOOT(8) bootopts=-f Ignore the clean flag on file systems, force a full check. (Do this once in a while to be sure about the state of the file systems.) bootopts=-n Do not check the file systems. A special flag for kernel hackers with a special talent to crash the system repeatedly. One needs to trust the crash robustness of the file system, which is quite good actually. servers=program[,program...] Names the special servers that must be started in /usr/etc/rc. The setting servers=inet will start the TCP/IP server. BOOT ENVIRONMENT Many features of the drivers inside the kernel are controlled by settings in the boot environment, like bootopts above does for /etc/rc. The values of these variables are usually colon or comma separated numbers configuring the driver. DPETH0 = 300:10 tells the ethernet driver to use I/O address 0x300, interrupt request 10, and the default memory address (0xD0000, values may be omitted) for the first ethernet board. (Note that IRQ 2 is redirected to IRQ 9 on AT's and PS/2's, so use 9 if a device is jumpered for 2.) Variables that are special to both the monitor and the kernel are described in monitor(8). This section lists extra variables or variable settings: hd = at | bios | esdi Choose the driver that is to be used for the hard disk, in order: IBM/AT (classic AT or newer IDE), BIOS (any disk), or ESDI (some PS/2's). By default the first of these drivers that is enabled is used. All drivers are present in the kernel as distributed, but may be taken out by modifying config.h in the kernel directory. The BIOS driver can not be used if the system is booted from MS-DOS with dosboot.com. (Well, it can, but it is slower than a floppy...) SERIALn = on | off Turn serial line n on or off. There are 4 serial lines supported, of which only line 0 is enabled by default. The other three may be turned on if you wish, but note that lines 1 and 3 use the same IRQ as the first Western Digital ethernet board uses by default. Both cannot be on at the same time. There is also some doubt whether both the even and both the odd serial lines (also sharing IRQ's) can be used at the same time without losing interrupts. Blame the shoddy ISA bus design. SERIALn = I/O-addr:irq Set the I/O address (hex) and IRQ (decimal) of the n-th serial line and turn it on. By default they are configured as 3F8:4, 2F8:3, 2 BOOT(8) Minix Programmer's Manual BOOT(8) 3E8:4 and 2E8:3. DPETHn = on | off Turn an ethernet board on or off. The driver is by default in "sink" mode for all boards. The sink mode allows one to use the driver without an ethernet board installed. The driver will play /dev/null for that device, i.e. nothing comes in, and anything send out is dropped on the floor. If the board is turned on then the driver will use it to send out packets, if it is turned off then the driver will fail for that board. DPETHn = I/O-addr:irq:mem_addr:mem_size Set the I/O address (hex), IRQ (decimal), memory address (hex) and memory size (hex) of the n-th ethernet board and turn it on. By default they are configured as 280:3:D0000 and 300:5:CC000 with the memory size set to 2000, 4000, or 8000 depending on the type of board found. The memory address and size have no meaning for the Novell ethernet boards, but the address may be explicitly set to zero to indicate that the board is a Novell ethernet board. You do not need to specify the IRQ with modern Western Digital 8013 compatible ethernet cards, the driver asks the board what its IRQ is. The SMC EtherEZ board, a WD8013 successor, has only 8K memory. This confuses the driver, so you need to explicitly specify the board size as being 2000. DPETHn_EA = e0:e1:e2:e3:e4:e5 Set the ethernet address of the n-th ethernet board. The address is normally obtained from the ethernet board, so only in exceptional circumstances is this setting ever needed. (Use the address of the main server if you want a career change.) at-hdn = sleep-time:max-sector:multiple Configure the AT disk n (n is multiple of 5, corresponding to the whole hard disk device.) The first number lets the drive spin down after being idle for sleep-time minutes (if it can). You can specify 0 to 60 minutes, where 0 means "don't spin down". I/O requests to the drive may be limited to max-sector sectors (1 to 256). You may need to limit I/O to a few sectors per request with lesser quality drives when you see the message "at-hdn: timeout" appear. Newer drives may support new I/O requests that transfer sectors in groups of size multiple before bothering the CPU with an interrupt. The value 8 is likely to produce the best results, but don't expect too much of it. The largest value of 255 is truncated to the maximum the drive can handle. Set debug=1 while experimenting. Multiple may also be set to 0 to indicate that the drive is stupid and that no advanced features may be used even though it claims it can. (Some ESDI drives fall in this category.) The default value of at-hdn is 15:256:1. 3 BOOT(8) Minix Programmer's Manual BOOT(8) AHA0 = I/O-addr:bus-on:bus-off:tr-speed Configure the Adaptec 154xA SCSI host adapter to use the given I/O address (hex), Bus-on time (decimal), Bus-off time (decimal) and transfer speed (hex). The default is 330:15:1:00. The default transfer speed is always 5.0 Mb/s (code 00) ignoring the jumper settings. sdn = sleep-time:target,lun Program SCSI disk sdn to spin down after being idle for sleep-time minutes like for the AT disk. The next two values may be given to change the target and logical unit number used for the device. The target and lun of a tape or other SCSI device may be changed by setting the sdn variable that would be used had it been a disk. So tape device st7 can be set to target 4, lun 1 with sd35=:4,1. console = mode,limit:softscroll:blanktime The monitor sets the BIOS video mode to mode before calling Minix. The extra fields further define the console. Limit (decimal) sets the maximum number of columns to use on the screen. At that column a vertical bar is drawn and the rest is unused. Softscroll is 0 or 1 to set hardware or software scrolling. (Some buggy video cards have trouble with hardware scrolling.) Blanktime is the number of minutes to wait after the last keypress to blank a VGA screen, by default 10 minutes. A timeout of 0 disables the screen blank. MCD = I/O-addr:irq I/O address (hex) and IRQ (decimal) of the Mitsumi CD-ROM driver, by default 300:10. dosdn = partition:file Tells the virtual disk driver for device dosdn (n is 0 or 5) to use an MS-DOS file found on the given primary partition as a disk. See dosd(4). fpu = on | off The kernel will normally test if a floating point unit is present. The fpu variable will override this. Some shoddy system boards may hang if the FPU is probed unless fpu=off is specified. reboot_delay = off | minutes If the system crashes due to a panic then it will reboot in 5 minutes. Setting reboot_delay changes this timeout. Use off to disable the timeout. TZ = GMT This sets the time zone the hardware clock is running in. Readclock uses this to correctly obtain the time of the clock. The timezone of the system is set in /etc/timeinfo. This boot variable is normally not set, only a few UNIX die-hards who don't care about DOS time and don't want to change the clock twice a year for daylight 4 BOOT(8) Minix Programmer's Manual BOOT(8) savings use this option. NR_BUFS = n The size of the file system cache is set at boot time to 1/16 of free memory. You can change this by setting NR_BUFS to the number of kilobytes you want the cache size to be. XCACHE = n MM sets aside an amount of memory to keep frequently used executables in core, so they can be rapidly executed. The size of this cache in megabytes is equal to the square root of the number of megabytes of the virtual memory. With the XCACHE variable you can set the size of the cache in kilobytes. You may want to increase the default size if you do a lot of compilations and all the passes do not fit, or decrease it if the system starts to swap a lot. The cache size is set by mount(1), because it influences virtual memory when it adds or removes swap space. debug = n Sets the debug flag to the hexadecimal value n. Nice for kernel hackers who can use the debug variable to control their debugging output. Some of the drivers will print extra messages that are useful when configuring the system. Some drivers may crash on conditions they would otherwise try to overcome. TCP/IP CONFIGURATION To use TCP/IP you need to run the inet server, and unless you are running standalone you have to enable the ethernet driver. See the servers and DPETHn boot variables above. The driver supports these ethernet cards: Western Digital 8003, Western Digital 8013, SMC Elite Ultra 16, Novell NE1000, Novell NE2000. Many newer variants of the WD8013, now under the SMC brand, are also supported. You are likely to use TCP/IP in one of three situations: Standalone with no connection to a network. In a small network with no support from a "big" host. Connected to a large network with address and name servers. In each situation you need a different set of configuration files. Standalone If rarpd notices that there is no connection to the outside world then it will configure the default network to address 10.0.0.1. You need to create one file, /etc/hosts, that should look like this (using the name "flotsam" as the example name of the machine): 5 BOOT(8) Minix Programmer's Manual BOOT(8) 127.0.0.1 localhost 10.0.0.1 flotsam Small Network In a network where the Minix machine can't obtain its IP address and name from a different host you need specify the ethernet address to host name translation in the /etc/ethers file for use by rarpd. Suppose your machine is to be named "flotsam", and another machine in the network is named "jetsam". The file /etc/ethers should at least contain an entry for flotsam: 0:0:c0:a:77:23 flotsam Use hostaddr -e to find out what the six octet ethernet address of a host is. Use the address as printed: lowercase hex digits, no leading zeros. The /etc/hosts file shows all IP addresses of the machines flotsam needs to know about: 127.0.0.1 localhost 10.0.0.1 flotsam 10.0.0.2 jetsam Warning! Do not add ethernet addresses of diskless workstations to your ethers file. A Sun for instance has the stupid habit of booting from the first RARP server that answers, probably your Minix machine... Large Network In a network with a central network administration your machine's IP address and name are given by the RARP and name services of the special servers on the network. For a new machine you need to apply for an IP address and host name with your network administrator supplying the ethernet address of your machine. You don't need any configuration files now, the irdpd and nonamed daemons automatically find a router and a name server. Note that no knowledge of the IP address or hostname of the Minix machine itself is necessary, it all comes from the RARP and name servers. A series of Minix machines can therefore set up identically. Even if you have no RARP or name servers you can still set them up identically if you list all the Minix hosts in the hosts and ethers files. Simpler configuration tools The rarpd, irdpd and nonamed daemons are complex little programs that try to obtain information about their surroundings automatically to tell the machine what its place in the network is. It should come as no surprise that there are simpler utilities to configure a machine. On a memory starved machine it may even be wise to configure a machine statically to get rid of the daemons. The first daemon, rarpd, can be replaced by: 6 BOOT(8) Minix Programmer's Manual BOOT(8) ifconfig -h host-IP-address to set the IP address of the machine. Note that this is only necessary if there is no external RARP service. The second daemon irdpd can be replaced by setting a static route: add_route -g router-IP-address (if there is a router.) The last daemon, nonamed, can be replaced by an entry in /etc/resolv.conf that specifies an external name daemon: nameserver nameserver-IP-address The ifconfig and add_route calls can be placed in the file /etc/rc.net. Check /usr/etc/rc to see how /etc/rc.net can be used to override running the normal series of network deamons. Note that /etc/rc.net is sourced, so you can use the same variables and functions that /usr/etc/rc uses. Note that these changes undo all the efforts to make Minix TCP/IP autoconfigurable. Make very sure that all the IP addresses are correct, and that the IP address of your machine is unique. (Mistakenly using the address of a main server will make all other machines look at your machine, and will make all the users of all other machines look at you.) FILES /boot Minix Boot Monitor. /minix Kernel image, or directory containing them. /etc/rc Basic system initialization. /usr/etc/rc Complete system initialization. /etc/rc.net Specialized network initialization. /opt/*/etc/rc Per package initialization. /opt/local/etc/rc Per site initialization. /var/etc/rc Per host initialization. /etc/hosts Name to IP address mapping. /etc/ethers Name to ethernet address mapping. /etc/resolv.conf Name resolver configuration. 7 BOOT(8) Minix Programmer's Manual BOOT(8) SEE ALSO monitor(8), init(8), inet(8), loadkeys(8), readclock(8), fsck(1), fstab(5), update(8), cron(8), ttytab(5), getty(8), hostaddr(1), ifconfig(8), irdpd(8), nonamed(8), rarpd(8), hosts(5), ethers(5), resolv.conf(5), set_net_default(8). DIAGNOSTICS Checking File Systems. When fsck is called for all file systems. Mounted device fixed, rebooting The root file system is found to be bad, this means that the system has something bad mounted, so it is rebooted. Please run fsck manually, reboot if / is bad. Really bad errors, time to become nervous. Run fsck and hope for the best. Finish the name of device to mount as /usr: /dev/ The prompt for the -a option, you can type a device name, say fd0. Single user. The -s option. Multiuser startup in progress. System state is ok, multiuser initialization can proceed. hostaddr: unable to fetch IP address TCP/IP misconfiguration. The RARP may have failed because the ethernet address of the machine is not entered in either the remote or the local ethers file. Either talk to your Network Administrator, or make an ethers and a hosts file. 1.2.3.4 login: If you see an IP address instead of a host name then the system failed to translate the IP address. Either talk to your Network Administrator to have the reverse address translation tables fixed, or make a hosts file. (Do not make a hosts file if the machine is Internet connected!) NOTES The 10.*.*.* addresses can be used for private networks. This address range is often blocked at routers. BUGS Indefinite hangs are possible if I/O addresses or IRQ's are wrong. A driver may babble about addresses and IRQ's, but that does not mean that what it says is true, it may just be configured that way. It is very difficult to find peripherals on a PC automatically, and Minix doesn't 8 BOOT(8) Minix Programmer's Manual BOOT(8) even try. Rarpd should learn to also speak the BOOTP and DHCP protocols. AUTHOR Kees J. Bot (kjb@cs.vu.nl) 9