# To unbundle, run this file echo boot.8 sed 's/.//' >boot.8 <<'//GO.SYSIN DD boot.8' -.TH BOOT 8 -.SH NAME -boot \- startup procedures -.SH DESCRIPTION -A PDP11/45 and PDP11/70 UNIX system is started by -a two-stage process. -The first is a primary bootstrap -which is able to read in relatively small stand-alone programs; -the second (called -.IR boot ) -is used to read in the system itself. -.PP -The primary bootstrap must reside -in the otherwise unused block zero of the boot device. -It can be read in and started by the standard ROM -programs, -or if necessary by keying in a small startup routine. -This program is capable of loading type 407 executable -files (not shared, not separate I&D). -The user types on the system console -the name of the program wished, in this case -.IR boot , -followed by a carriage return; -the named program is retrieved from the file system -that starts at block 0 of drive 0 of the boot device. -No prompt is given, -no diagnostic results if the file cannot be found, and no -provision is made for correcting typographical errors. -.PP -The second step, called -.I boot, -actually brings in the system. -When read into location 0 and executed, -.I boot -sets up memory management, relocates itself into -high memory, and types a `:' on the console. -Then it -reads from the console -a device specification (see below) followed immediately by -a pathname. -.I Boot -finds the corresponding file on the given device, -loads that file into memory location zero, -sets up memory management as required, -and calls the program by executing a `trap' instruction. -Normal -line editing characters can be used. -.PP -Conventionally, the name of the secondary boot program -is `/boot' and the name of the current version of the system -is `/unix'. -Then, the recipe is: -.TP -1) -Load block 0 of the boot device by fiddling with the -console keys as appropriate for your hardware. -If you have no appropriate ROM, some programs suitable -for manual use are given below. -.TP -2) -Type -.IR boot . -.TP -3) -When the prompt is given, type -.br - hp(0,0)unix -.br -or -.br - rp(0,0)unix -.br -depending on whether you are loading from an RP04/5/6 or an RP03 -respectively. -The first 0 indicates the physical unit number; -the second indicates -the block number of the beginning of the logical file -system to be searched. -(See below). -.PP -When the system is running, it types a `#' prompt. -After doing any file system checks and setting the date -.RI ( date (8)) -a multi-user system is brought up by typing an EOT -(control-d) -in response to the `#' prompt. -.PP -.B Device specifications. -A device specification has the following form: -.IP " " -device(unit,offset) -.LP -where -.I device -is the type of the device to be searched, -.I unit -is the unit number of the device, -and -.I offset -is the block offset of the file system on the device. -.I Device -is one of the following -.br -.nf - rp RP03 - hp RP04/5/6 - rk RK05 -.fi -For example, the specification -.IP " " -hp(1,7000) -.LP -indicates an RP03 disk, unit 1, and the file system found -starting at block 7000 (cylinder 35). -.PP -.SM -.B ROM -.B programs. -The following programs to call the primary bootstrap -may be installed in read-only memories -or manually keyed into main -memory. -Each program is position-independent -but should be placed well above location 0 -so it will not be overwritten. -Each reads a block from the -beginning of a device into core location -zero. -The octal words constituting the program are -listed on the left. -.PP -.ne 5 -.nf -.if n .ta 3 11 15 23 38 -.if t .ta .3i 1i 1.4i 2i 3.5i -RK (drive 0): - 012700 mov $rkda,r0 - 177412 - 005040 clr \-(r0) / rkda cleared by start - 010040 mov r0,\-(r0) - 012740 mov $5,\-(r0) - 000005 - 105710 1: tstb (r0) - 002376 bge 1b - 005007 clr pc -.PP -.ne 11 -RP (drive 0) - 012700 mov $rpmr,r0 - 176726 - 005040 clr \-(r0) - 005040 clr \-(r0) - 005040 clr \-(r0) - 010040 mov r0,\-(r0) - 012740 mov $5,\-(r0) - 000005 - 105710 1: tstb (r0) - 002376 bge 1b - 005007 clr pc -.DT -.SH FILES -/unix \- system code -.br -/usr/mdec/rpuboot, /usr/mdec/hpuboot \- copies of primary bootstrap -.br -/boot \- second stage bootstrap -.SH "SEE ALSO" -init(8) //GO.SYSIN DD boot.8 echo crash.8 sed 's/.//' >crash.8 <<'//GO.SYSIN DD crash.8' -.TH CRASH 8 -.SH NAME -crash \- what to do when the system crashes -.SH DESCRIPTION -This section gives at least a few clues about how to proceed if the -system crashes. -It can't pretend to be complete. -.PP -.I Bringing it back up. -If the reason for the crash is not evident -(see below for guidance on `evident') -you may want to try to dump the system if you feel up to -debugging. -At the moment a dump can be taken only on magtape. -With a tape mounted and ready, -stop the machine, load address 44, and start. -This should write a copy of all of core -on the tape with an EOF mark. -Caution: -Any error is taken to mean the end of core has been reached. -This means that you must be sure the ring is in, -the tape is ready, and the tape is clean and new. -If the dump fails, you can try again, -but some of the registers will be lost. -See below for what to do with the tape. -.PP -In restarting after a crash, -always bring up the system single-user. -This is accomplished by following the directions in -.IR boot (8) -as modified for your particular installation; -a single-user system is indicated by having a particular value -in the switches (173030 unless you've changed -.I init) -as the system starts executing. -When it is running, -perform a -.I dcheck -and -.IR icheck (1) -on all file systems which could have been in use at the time -of the crash. -If any serious file system problems are found, they should be repaired. -When you are satisfied with the health of your disks, -check and set the date if necessary, -then come up multi-user. -This is most easily accomplished by changing the -single-user value in the switches to something else, -then logging out -by typing an EOT. -.PP -To even boot \s8UNIX\s10 at all, -three files (and the directories leading to them) -must be intact. -First, -the initialization program -.I /etc/init -must be present and executable. -If it is not, -the CPU will loop in user mode at location 6. -For -.I init -to work correctly, -.I /dev/tty8 -and -.I /bin/sh -must be present. -If either does not exist, -the symptom is best described -as thrashing. -.I Init -will go into a -.I fork/exec -loop trying to create a -Shell with proper standard input and output. -.PP -If you cannot get the system to boot, -a runnable system must be obtained from -a backup medium. -The root file system may then be doctored as -a mounted file system as described below. -If there are any problems with the root -file system, -it is probably prudent to go to a -backup system to avoid working on a -mounted file system. -.PP -.I Repairing disks. -The first rule to keep in mind is that an addled disk -should be treated gently; -it shouldn't be mounted unless necessary, -and if it is very valuable yet -in quite bad shape, perhaps it should be dumped before -trying surgery on it. -This is an area where experience and informed courage count for much. -.PP -The problems reported by -.I icheck -typically fall into two kinds. -There can be -problems with the free list: -duplicates in the free list, or free blocks also in files. -These can be cured easily with an -.I icheck \-s. -If the same block appears in more than one file -or if a file contains bad blocks, -the files should be deleted, and the free list reconstructed. -The best way to delete such a file is to use -.IR clri (1), -then remove its directory entries. -If any of the affected files is really precious, -you can try to copy it to another device -first. -.PP -.I Dcheck -may report files which -have more directory entries than links. -Such situations are potentially dangerous; -.I clri -discusses a special case of the problem. -All the directory entries for the file should be removed. -If on the other hand there are more links than directory entries, -there is no danger of spreading infection, but merely some disk space -that is lost for use. -It is sufficient to copy the file (if it has any entries and is useful) -then use -.I clri -on its inode and remove any directory -entries that do exist. -.PP -Finally, -there may be inodes reported by -.I dcheck -that have 0 links and 0 entries. -These occur on the root device when the system is stopped -with pipes open, and on other file systems when the system -stops with files that have been deleted while still open. -A -.I clri -will free the inode, and an -.I icheck -s -will -recover any missing blocks. -.PP -.I Why did it crash? -UNIX types a message -on the console typewriter when it voluntarily crashes. -Here is the current list of such messages, -with enough information to provide -a hope at least of the remedy. -The message has the form `panic: ...', -possibly accompanied by other information. -Left unstated in all cases -is the possibility that hardware or software -error produced the message in some unexpected way. -.HP 5 -blkdev -.br -The -.I getblk -routine was called with a nonexistent major device as argument. -Definitely hardware or software error. -.HP 5 -devtab -.br -Null device table entry for the major device used as argument to -.I getblk. -Definitely hardware or software error. -.HP 5 -iinit -.br -An I/O error reading the super-block for the root file system -during initialization. -.HP 5 -out of inodes -.br -A mounted file system has no more i-nodes when creating a file. -Sorry, the device isn't available; -the -.I icheck -should tell you. -.HP 5 -no fs -.br -A device has disappeared from the mounted-device table. -Definitely hardware or software error. -.HP 5 -no imt -.br -Like `no fs', but produced elsewhere. -.HP 5 -no inodes -.br -The in-core inode table is full. -Try increasing NINODE in param.h. -Shouldn't be a panic, just a user error. -.HP 5 -no clock -.br -During initialization, -neither the line nor programmable clock was found to exist. -.HP 5 -swap error -.br -An unrecoverable I/O error during a swap. -Really shouldn't be a panic, -but it is hard to fix. -.HP 5 -unlink \- iget -.br -The directory containing a file being deleted can't be found. -Hardware or software. -.HP 5 -out of swap space -.br -A program needs to be swapped out, and there is no more swap space. -It has to be increased. -This really shouldn't be a panic, but there is no easy fix. -.HP 5 -out of text -.br -A pure procedure program is being executed, -and the table for such things is full. -This shouldn't be a panic. -.HP 5 -trap -.br -An unexpected trap has occurred within the system. -This is accompanied by three numbers: -a `ka6', which is the contents of the segmentation -register for the area in which the system's stack is kept; -`aps', which is the location where the hardware stored -the program status word during the trap; -and a `trap type' which encodes -which trap occurred. -The trap types are: -.TP 10 -0 -bus error -.br -.ns -.TP 10 -1 -illegal instruction -.br -.ns -.TP 10 -2 -BPT/trace -.br -.ns -.TP 10 -3 -IOT -.br -.ns -.TP 10 -4 -power fail -.br -.ns -.TP 10 -5 -EMT -.br -.ns -.TP 10 -6 -recursive system call (TRAP instruction) -.br -.ns -.TP 10 -7 -11/70 cache parity, or programmed interrupt -.br -.ns -.TP 10 -10 -floating point trap -.br -.ns -.TP 10 -11 -segmentation violation -.PP -In some of these cases it is -possible for octal 20 to be added into the trap type; -this indicates that the processor was in user mode when the trap occurred. -If you wish to examine the stack after such a trap, -either dump the system, or use the console switches to examine core; -the required address mapping is described below. -.PP -.I Interpreting dumps. -All file system problems -should be taken care of before attempting to look at dumps. -The dump should be read into the file -.I /usr/sys/core; -.IR cp (1) -will do. -At this point, you should execute -.I ps \-alxk -and -.I who -to print the process table and the users who were on -at the time of the crash. -You should dump ( -.IR od (1)) -the first 30 bytes of -.I /usr/sys/core. -Starting at location 4, -the registers R0, R1, R2, R3, R4, R5, SP -and KDSA6 (KISA6 for 11/40s) are stored. -If the dump had to be restarted, -R0 will not be correct. -Next, take the value of KA6 (location 022(8) in the dump) -multiplied by 0100(8) and dump 01000(8) bytes starting from there. -This is the per-process data associated with the process running -at the time of the crash. -Relabel -the addresses 140000 to 141776. -R5 is C's frame or display pointer. -Stored at (R5) is the old R5 pointing to the previous -stack frame. -At (R5)+2 -is the saved PC of the calling procedure. -Trace -this calling chain until -you obtain an R5 value of 141756, which -is where the user's R5 is stored. -If the chain is broken, -you have to look for a plausible -R5, PC pair and continue from there. -Each PC should be looked up in the system's name list -using -.IR adb (1) -and its `:' command, -to get a reverse calling order. -In most cases this procedure will give -an idea of what is wrong. -A more complete discussion -of system debugging is impossible here. -.SH SEE ALSO -clri(1), icheck(1), dcheck(1), boot(8) //GO.SYSIN DD crash.8 echo cron.8 sed 's/.//' >cron.8 <<'//GO.SYSIN DD cron.8' -.TH CRON 8 -.SH NAME -cron \- clock daemon -.SH SYNOPSIS -.B /etc/cron -.SH DESCRIPTION -.I Cron -executes commands at specified dates and times -according to the instructions in the file -/usr/lib/crontab. -Since -.I cron -never exits, -it should only be executed once. -This is best done by running -.I cron -from the initialization -process through the file -/etc/rc; -see -.IR init (8). -.PP -Crontab -consists of lines of six fields each. -The fields are separated by spaces or tabs. -The first five are integer patterns to -specify the -minute (0-59), -hour (0-23), -day of the month (1-31), -month of the year (1-12), -and day of the week (1-7 with 1=monday). -Each of these patterns may -contain a number in the range above; -two numbers separated by -a minus -meaning a range inclusive; -a list of numbers separated by -commas meaning any of the numbers; -or an asterisk meaning all legal values. -The sixth field is a string -that is executed by the Shell at the -specified times. -A percent character -in this field is translated to a new-line -character. -Only the first line (up to a % or end of line) -of the command field is executed by the Shell. -The other lines are made available to the -command as standard input. -.PP -Crontab is examined by -.I cron -every minute. -.SH FILES -/usr/lib/crontab //GO.SYSIN DD cron.8 echo getty.8 sed 's/.//' >getty.8 <<'//GO.SYSIN DD getty.8' -.TH GETTY 8 -.SH NAME -getty \- set typewriter mode -.SH SYNOPSIS -.B /etc/getty -[ char ] -.SH DESCRIPTION -.I Getty -is invoked -by -.IR init (8) -immediately after a typewriter is opened -following a dial-up. -It reads the user's login name and calls -.IR login (1) -with the name as argument. -While reading the name -.I getty -attempts to adapt the system to the speed and type of terminal -being used. -.PP -.I Init -calls -.I getty -with a single character argument taken from -the -.IR ttys (5) -file entry for the terminal line. -This argument determines a sequence of line speeds through which -.I getty -cycles, and also the `login:' greeting message, -which can contain character sequences to put various kinds of -terminals in useful states. -.PP -The user's name is terminated by a new-line or -carriage-return character. -In the second case CRMOD mode is set -(see -.IR ioctl (2)). -.PP -The name is scanned to see if -it contains any lower-case alphabetic characters; if not, -and if the name is nonempty, the -system is told to map any future upper-case characters -into the corresponding lower-case characters. -.PP -If the terminal's `break' key is depressed, -.I getty -cycles to the next speed appropriate to the type of line -and prints the greeting message again. -.PP -Finally, login is called with the user's name as argument. -.PP -The following arguments from the -.I ttys -file are understood. -.TP -0 -Cycles through 300-1200-150-110 baud. -Useful as a default for dialup lines accessed by a variety -of terminals. -.TP -\- -Intended for an on-line Teletype model 33, for example -an operator's console. -.TP -1 -Optimized for a 150-baud Teletype model 37. -.TP -2 -Intended for an on-line 9600-baud terminal, for example -the Textronix 4104. -.TP -3 -Starts at 1200 baud, cycles to 300 and back. -Useful with 212 datasets where most terminals -run at 1200 speed. -.TP -5 -Same as `3' but starts at 300. -.TP -4 -Useful for on-line console DECwriter (LA36). -.SH "SEE ALSO" -init(8), login(1), ioctl(2), ttys(5) //GO.SYSIN DD getty.8 echo init.8 sed 's/.//' >init.8 <<'//GO.SYSIN DD init.8' -.TH INIT 8 -.SH NAME -init, rc \- process control initialization -.SH SYNOPSIS -.B /etc/init -.br -.B /etc/rc -.SH DESCRIPTION -.I Init -is invoked as the last step of the boot procedure (see -.IR boot (8)). -Generally its role is to create a process for each -typewriter on which a user may log in. -.PP -When -.I init -first is executed -the console typewriter -.I /dev/console. -is opened for reading -and writing and the shell is invoked immediately. -This feature is used to bring up a single-user system. -If the shell terminates, -.I init -comes up multi-user and the process described below is started. -.PP -When -.I init -comes up multiuser, -it -invokes a shell, with input taken from the -file -.I /etc/rc. -This command file -performs housekeeping -like removing temporary files, -mounting file systems, and starting -daemons. -.PP -Then -.I init -reads the file -.I /etc/ttys -and -forks several times to create a process -for each typewriter specified in the file. -Each of these processes opens the appropriate typewriter -for reading and writing. These channels thus -receive file descriptors 0, 1 and 2, the standard input, -output and error files. -Opening the typewriter will usually involve a delay, -since the -.IR open "" -is not completed until someone -is dialed up and carrier established on the channel. -Then -.I /etc/getty -is called with argument as specified by the last character of -the -.I ttys -file line. -.I Getty -reads the user's name and invokes -.IR login (1) -to log in the user and execute the shell. -.PP -Ultimately the shell will terminate -because of an end-of-file either -typed explicitly or generated as a result of hanging up. -The main path of -.IR init , -which has been waiting -for such an event, -wakes up and removes the appropriate entry from the -file -.IR utmp , -which records current users, and -makes an entry in -.IR /usr/adm/wtmp , -which maintains a history -of logins and logouts. -Then the appropriate typewriter is reopened and -.I getty -is -reinvoked. -.PP -.I Init -catches the -hangup signal SIGHUP and interprets it to mean that -the -system should be brought from multi user to single -user. -Use `kill -1 1' to send the hangup signal. -.SH FILES -/dev/tty?, /etc/utmp, /usr/adm/wtmp, /etc/ttys, /etc/rc -.SH "SEE ALSO" -login(1), kill(1), sh(1), ttys(5), getty(8) //GO.SYSIN DD init.8 echo makekey.8 sed 's/.//' >makekey.8 <<'//GO.SYSIN DD makekey.8' -.TH MAKEKEY 8 -.SH NAME -makekey \- generate encryption key -.SH SYNOPSIS -.B /usr/lib/makekey -.SH DESCRIPTION -.I Makekey -improves the usefulness of encryption schemes -depending on a key by increasing the amount of time required to -search the key space. -It reads 10 bytes from its standard input, -and writes 13 bytes on its standard output. -The output depends on the input in a way intended -to be difficult to compute (i.e. to require a substantial -fraction of a second). -.PP -The first eight input bytes -(the -.IR "input key" ) -can be arbitrary ASCII characters. -The last -two (the -.IR salt ) -are best chosen from the set of digits, upper- and lower-case -letters, and `.' and `/'. -The salt characters are repeated as the first two characters of the output. -The remaining 11 output characters are chosen from the same set as the salt -and constitute the -.I "output key." -.PP -The transformation performed is essentially the following: -the salt is used to select one of 4096 cryptographic -machines all based on the National Bureau of Standards -DES algorithm, but modified in 4096 different ways. -Using the input key as key, -a constant string is fed into the machine and recirculated -a number of times. -The 64 bits that come out are distributed into the -66 useful key bits in the result. -.PP -.I Makekey -is intended for programs that perform encryption -(e.g. -.I ed -and -.IR crypt (1)). -Usually its input and output will be pipes. -.SH SEE ALSO -crypt(1), ed(1) //GO.SYSIN DD makekey.8 echo update.8 sed 's/.//' >update.8 <<'//GO.SYSIN DD update.8' -.TH UPDATE 8 -.SH NAME -update \- periodically update the super block -.SH SYNOPSIS -.B /etc/update -.SH DESCRIPTION -.I Update -is a program that executes -the -.IR sync (2) -primitive every 30 seconds. -This insures that the file system -is fairly up to date in case of a crash. -This command should not be executed directly, -but should be executed out of the -initialization shell command file. -.SH "SEE ALSO" -sync(2), sync(1), init(8) -.SH BUGS -With -.I update -running, -if the CPU is -halted just as -the -.I sync -is executed, -a file system can be damaged. -This is partially due to DEC hardware that -writes zeros when NPR requests fail. -A fix would be to have -.IR sync (1) -temporarily increment the system time by at -least 30 seconds to trigger the execution of -.I update. -This would give 30 seconds grace to halt the CPU. //GO.SYSIN DD update.8