xref: /original-bsd/usr.sbin/config/SMM.doc/b.t (revision c3e32dec)
Copyright (c) 1983, 1993
The Regents of the University of California. All rights reserved.

%sccs.include.redist.roff%

@(#)b.t 8.1 (Berkeley) 06/08/93

.ds RH "Device Defaulting Rules
.bp

APPENDIX B. RULES FOR DEFAULTING SYSTEM DEVICES .R

When config processes a ``config'' rule which does not fully specify the location of the root file system, paging area(s), device for system dumps, and device for argument list processing it applies a set of rules to define those values left unspecified. The following list of rules are used in defaulting system devices.

1) 3
If a root device is not specified, the swap specification must indicate a ``generic'' system is to be built.
2) 3
If the root device does not specify a unit number, it defaults to unit 0.
3) 3
If the root device does not include a partition specification, it defaults to the ``a'' partition.
4) 3
If no swap area is specified, it defaults to the ``b'' partition of the root device.
5) 3
If no device is specified for processing argument lists, the first swap partition is selected.
6) 3
If no device is chosen for system dumps, the first swap partition is selected (see below to find out where dumps are placed within the partition).

The following table summarizes the default partitions selected when a device specification is incomplete, e.g. ``hp0''.

Type Partition
root ``a''
swap ``b''
args ``b''
dumps ``b''
Multiple swap/paging areas

When multiple swap partitions are specified, the system treats the first specified as a ``primary'' swap area which is always used. The remaining partitions are then interleaved into the paging system at the time a swapon (2) system call is made. This is normally done at boot time with a call to swapon (8) from the /etc/rc file.

System dumps

System dumps are automatically taken after a system crash, provided the device driver for the ``dumps'' device supports this. The dump contains the contents of memory, but not the swap areas. Normally the dump device is a disk in which case the information is copied to a location at the back of the partition. The dump is placed in the back of the partition because the primary swap and dump device are commonly the same device and this allows the system to be rebooted without immediately overwriting the saved information. When a dump has occurred, the system variable dumpsize is set to a non-zero value indicating the size (in bytes) of the dump. The savecore\|(8) program then copies the information from the dump partition to a file in a ``crash'' directory and also makes a copy of the system which was running at the time of the crash (usually ``/vmunix''). The offset to the system dump is defined in the system variable dumplo (a sector offset from the front of the dump partition). The savecore program operates by reading the contents of dumplo, dumpdev, and dumpmagic from /dev/kmem, then comparing the value of dumpmagic read from /dev/kmem to that located in corresponding location in the dump area of the dump partition. If a match is found, savecore assumes a crash occurred and reads dumpsize from the dump area of the dump partition. This value is then used in copying the system dump. Refer to savecore\|(8) for more information about its operation.

The value dumplo is calculated to be dumpdev-size - memsize where dumpdev-size is the size of the disk partition where system dumps are to be placed, and memsize is the size of physical memory. If the disk partition is not large enough to hold a full dump, dumplo is set to 0 (the start of the partition).