BOOT(HW) UNIX System V
Name
boot - UNIX boot program
Description
boot is an interactive program used to load and execute
stand-alone UNIX programs. It is used primarily for loading
and executing the UNIX kernel, but can load and execute any
other programs that are linked for stand-alone execution.
boot is a required part of the Operating System and must be
present in the root directory of the root filesystem to
ensure successful loading of the UNIX kernel.
The boot program is invoked by the system each time the
computer is started. To restart the system without going
through lengthy shutdown procedures, you can use the reboot
command. This causes the system to reboot after shutting
down without waiting for keyboard input. See haltsys(ADM)
for more information.
For diskette boot, the procedure has three stages:
1. The ROMs load the boot block from sector 0 of the
floppy, where sector 0 of the disk is the same as
sector 0 of the filesystem.
2. The boot block loads boot from the floppy filesystem.
3. boot executes and prompts the user.
For fixed-disk boot, the procedure has five stages:
1. The ROMs load in the masterboot block from sector 0 on
the hard disk.
2. The masterboot block then loads the partition boot
block (boot0) from sector 0 of the active partition
(see fdisk(ADM)).
3. Then, assuming the UNIX partition is active, boot1 is
loaded from 1K into the active partition. Boot1 spans
20 physically contiguous 1K blocks on the disk.
4. boot1 loads boot from the UNIX filesystem.
5. boot executes and prompts the user.
/boot and /unix may lie on tracks that have been mapped by
badtrk(ADM). masterboot, boot0, and boot1 cannot lie on bad
tracks.
The fixed-disk boot procedure is invoked if the diskette
drive is empty.
When first invoked, boot prompts for the location of a
program to load by displaying the message:
UNIX System V
Boot
:
To specify the location of a program, a device and filename
must be given. The filename must include the full pathname
of the file containing the stand-alone program. You can
display a list of the current allowable device names by
typing a question mark (?).
The format for the device and pathname is as follows:
xx(m,o)filename
or
xx(m)filename
where:
xx = device name
(`hd' for the hard disk or `fd' for diskette device)
m = minor device number
(40 for the root filesystem on the hard disk)
o = offset in the partition (usually 0). This is optional.
filename = standard UNIX pathname. Must start with a
slash if the program is not in the root directory.
All numbers are in decimal. See the manual pages for hd(HW)
and fd(HW) for minor device numbers of these devices.
Specifying the offset is optional. The location of the
program to be loaded must always be entered first on the
command line and be present if other boot options are
specified either on the command line or in
/etc/default/boot.
If you want boot to pause and wait for a RETURN before
executing the program that it loads, enter the word
``prompt'' on the command line. For example, if you enter
``prompt'' and press RETURN boot prints the following
message and waits for you to press the RETURN key again:
Loaded, press <RETURN>.
The prompt can be changed to another string as in this
example:
prompt="change diskettes now"
boot loads unix from the diskette, prints the message
``change diskettes now'', and waits for RETURN to be
pressed. No other characters can appear between ``prompt'',
the ``='' sign, and the prompt string, although string may
contain spaces. When you press RETURN unix begins
execution. ``Prompt'' can be set either on the command line
or in /etc/default/boot. If a prompt is not specified, boot
executes the loaded program without pausing.
If you have just loaded the boot program from the
distribution diskette, simply press <RETURN> and boot
defaults to the correct values.
To load from a hard disk, enter:
hd(40,0)unix
To use the default bootstring specified in
/etc/default/boot, simply press <RETURN> when the system
displays the boot prompt, and boot uses the values specified
by DEFBOOTSTR in /etc/default/boot.
If nothing is typed after a short while and AUTOBOOT is set
to YES in the default root filesystem's /etc/default/boot
file, boot times out and behaves as though a <RETURN> had
been pressed, except that an ``auto'' is added to the boot
string. (If, in addition to AUTOBOOT=YES, TIMEOUT=n is
defined, boot waits n seconds before timing out.) boot
proceeds through the boot procedure, and init(M) is passed a
-a flag with no ``prompt''.
If you wish to install DOS on the hard disk, it is
recommended that you do so before you install the Operating
System. See the manual page for dos(C). However, once you
install DOS, you can boot it at the UNIX boot prompt by
entering ``dos''.
During installation, a custom masterboot is placed on the
hard disk. If a non-standard disk is specified, its
parameters are stored and enabled in this masterboot.
Configuring the Kernel
boot passes any bootstring typed at the boot prompt to the
kernel, except for the ``prompt'' string.
The kernel reads the bootstring to determine which
peripherals are the root, pipe, and swap devices. If no
devices are specified in either the /etc/default/boot
description or on the command line, the default devices
compiled into the kernel are used.
Additional arguments in the bootstring can alter this
default action. These arguments have the form:
dev=xx(m,o)
or
dev=xx(m)
where:
dev = the desired system device (root[dev], pipe[dev],
or swap[dev])
xx, m, o = same as for the boot device
If any combination of root, pipe, or swap is specified, then
those system devices will reside on that device, with the
unspecified system devices using the defaults compiled in
the kernel. Setting one device does not affect the default
values for the other system devices.
Selecting the System Console
You can select the system console at boot time either by
entering the command systty=x at the boot prompt, or by
placing the keyword SYSTTY=x in the file /etc/default/boot.
The letter x represents either a number or a string
parameter.
If you use the systty=x command at boot time, boot uses the
string parameter x to pass the selected console device to
the kernel. The values of the bootstring parameter systty
are:
sio Serial port COM1
scrn Display adapter
For example, to assign the system console to the serial port
at COM1, enter this command at the boot prompt:
systty=sio
If you do not specifically set the system console at boot
time, the boot program follows these steps to determine the
system console:
- boot reads /etc/default/boot and looks for the keyword
SYSTTY=x, where x is a number that specifies the system
console device.
1 indicates the serial adapter at COM1
0 indicates the display adapter
- If SYSTTY is not found or /etc/default/boot is
unreadable, boot checks for a display adapter and
assigns it as the system console.
- If no display adapter is found, boot looks for COM1,
sets the serial port to 9600 baud, 8 data bits, 1 stop
bit, and no parity, and uses it as the system console.
Thus, to have boot automatically set the system console to
the serial port at COM1, enter this line in
/etc/default/boot:
SYSTTY=1
Aliasing
A set of system devices can be aliased to a single keyword
by defining the keyword in the file /etc/default/boot. This
keyword can then be entered on the ``Boot'' command line and
the boot program then reads the corresponding system devices
from /etc/default/boot and pass them to the kernel. An
alias has the following form:
key=file [root=xx(m) pipe=xx(m) swap=xx(m) prompt[="string"]]
In all cases, the device specification can also have the
format dev=xx(m,o), where o is the offset.
For example, if you have a root file system on a second hard
disk and want to use it, but want to boot using the unix
located on the first hard disk, enter the following line
into the /etc/default/boot description:
disk2=hd(40,0)unix root=hd(104,0) \
prompt="Using second disk"
The next time you boot the system from the first hard disk,
enter ``disk2'' in response to the ``Boot'' prompt. unix
will be loaded from the first hard disk, and when you see
the message, ``Using second disk'', press RETURN unix will
now boot and use the root filesystem on the second hard
disk. Note that you must edit the /etc/default/boot file in
the root filesystem on the device from which boot will be
read, in this case the first hard disk.
Another example: suppose you want to boot off the second
drive (hd10) and use the root filesystem and swap space of
the second drive. At the boot prompt, use the following
bootstring:
hd(104)unix root=hd(104) pipe=hd(104) \
swap=hd(105)
Once booted, you must create the device nodes for the second
drive for use by the utilities:
fixperm -c -dHD1 /usr/lib/mkdev/perms/HD
Boot Options
Boot options can be changed via keywords in
/etc/default/boot. The following keywords are recognized by
boot:
AUTOBOOT=YES If YES, boot automatically loads
UNIX after a delay time
specified by the TIMEOUT
parameter. The default value is
60 seconds.
DEFBOOTSTR=string string is used as the default
bootstring for timeouts or when
only a <RETURN> is entered at
the boot prompt. There can be
no white space between
DEFBOOTSTR, the ``='' sign and
string.
SYSTTY=x If x is 1, the system console
device is set to the serial
adapter at COM1. If x is 0 the
system console is set to the
main display adapter.
RONLYROOT=NO Whether or not the root
filesystem is to be mounted
readonly. This should only be
set to YES during installation.
FSCKFIX=YES or NO Whether or not fsck(ADM) fixes
any root system problems by
itself. If the variable is set
to YES, then fsck is run on the
root filesystem with the -rr
flag.
MULTIUSER=YES or NO Whether or not init(M) invokes
sulogin or proceeds to multiuser
mode.
PANICBOOT=YES or NO Whether or not the system
reboots after a panic(). This
variable is read from
/etc/default/boot by init.
TIMEOUT=n n is the number of seconds to
wait at the boot prompt before
timing out and booting the
kernel (if AUTOBOOT is set to
YES).
The following special boot options are for intended for use
applications with a special need to alter init's tolerance
for processes that need to be restarted.
SPAWN_INTERVAL
The number of seconds over which "init" will try
to respawn a process SPAWN_LIMIT times before it
gets mad. The default value is 120.
SPAWN_LIMIT
The number of respawns "init" will attempt in
SPANW_INTERVAL seconds it generates an error
message and inhibits further tries for INHIBIT
seconds. The default value is 10.
SLEEPTIME Sets the time (in seconds) between calls to sync.
INHIBIT
The number of seconds "init" ignores an entry it
had trouble spawning unless a "telinit Q" is
received. The default value is 300.
Diagnostics
If an error occurs, masterboot displays an error message,
and locks the system. The following is a list of the most
common messages and their meanings:
IO ERR
An error occurred when masterboot tried to read in the
partition boot of the active operating system.
BAD TBL
The bootable partition indicator of at least one of the
operating systems in the fdisk table contains an
unrecognizable code.
NO OS
There was an unrecoverable error that prevented the
active operating system's partition boot from
executing.
When boot displays error messages, it returns to the
``Boot'' prompt. The following is a list of the most common
messages and their meanings:
bad magic number
The given file is not an executable program.
can't open <pathname>
The supplied pathname does not correspond to an
existing file, or the device is unknown.
Stage 1 boot failure
The bootstrap loader cannot find or read the boot file.
You must restart the computer and supply a filesystem
disk with the boot file in the root directory.
not a directory
The specified area on the device does not contain a
valid UNIX filesystem.
zero length directory
Although an otherwise valid filesystem was found, it
contains a directory of apparently zero length. This
most often occurs when a pre- System V UNIX filesystem
(with incorrect, or incompatible word ordering) is in
the specified area.
fload:read(x)=y
An attempted read of x bytes of the file returned only
y bytes. This is probably due to a premature end-of-
file. It could also be caused by a corrupted file, or
incorrect word ordering in the header.
Files
/boot
/etc/default/boot
/etc/masterboot
/etc/hdboot0
/etc/hdboot1
See Also
autoboot(ADM), badtrk(ADM), fd(HW), fdisk(ADM), fsck(ADM),
haltsys(ADM), hd(HW), init(M), sulogin(ADM)
Notes
The computer tries to boot off any diskette in the drive.
If the diskette does not contain a valid bootstrap program,
errors occur.
The boot program cannot be used to load programs that have
not been linked for stand-alone execution. To create
stand-alone programs, the -A option of the UNIX linker
(ld(CP)) and special stand-alone libraries must be used.
Stand-alone programs can operate in real or protected mode,
but they must not be large or huge models. Programs in real
mode can use the input/output routines of the computer's
startup ROM.
RONLYROOT should only be set to YES for installation. If it
is set to YES during day-to-day operations, it will prevent
your making changes to the root filesystem. You will then
be required to boot from the floppy drive, edit the
/etc/default/boot file, and reboot.
Value Added
boot is an extension of AT&T System V provided by the Santa
Cruz Operation.
(printed 8/30/89) BOOT(HW)