boot(7) - Unix First Edition Manual Page
11/3/71BOOT PROCEDURES

(VII)
NAME bos, maki, rom, vcboot, msys, et al
SYNOPSIS
DESCRIPTION On the RF disk, the highest 16K words are reserved forstand--alone programs. These 16K words are allocated as


follows:


bos (1K)Warm UNIX (6K) Cold UNIX (6K)unassigned (3K)


The UNIX read only memory (ROM) is home cut with 2 programsof 16 words each. The first (address 173700) reads bos from the RF disk into core location 54000 and transfers to 54000.The other ROM program (address 173740) reads a DECtape sitting in the end--zone on drive 0 into core location 0 andtransfers to 0. This latter operation is compatible with part of DEC's standard ROM. The disassembled code for theUNIX ROM follows:


173700: mov $177472,r0 12700;177472mov $3,--(r0) 12740;3


mov $140000,--(r0) 12740;140000mov $54000,--(r0) 12740;54000 mov $--2000,--(r0) 12740;176000mov $5,--(r0) 12740;5 tstb (r0) 105710bge .--2 2376 jmp *$5400Q 137;54000 173740: mov $177350,r0 12700;177350clr --(r0) 5040


mov r0,--(r0) 10040mov $3,--(r0) 12740;3 tstb (r0) 105710bge .--2 2376 tst *$177350 5737;177350bne . 1377 movb $5,(r0) 112710;5tstb (r0) 105710 bge .--2 2376clr pc 5007


The program bos (Bootstrap Operating System) examines theconsole switchs and executes one of several internal programs depending on the setting. If no setting isrecognizable, bos loops waiting for a recognizable setting. The following settings are currently recognized:


17370073700 Will read Warm UNIX from the RF into core location 0 and transfer to 400.


11/3/71BOOT PROCEDURES

(VII)


1 Will read Cold UNIX from the RF into core location0 and transfer to 400. 2 Will read the unassigned 3K program into corelocation 0 and transfer to 400. 10 Will dump 12K words of memory from core location 0onto DECtape drive 7. 0 Will load a standard UNIX binary paper tape intocore location 0 and transfer to 0.


57500 Will load the standard DEC absolute and binaryloaders and transfer to 57500. Thus we come to the UNIX warm boot procedure: put 173700into the switches, push load address and then push start. The alternate switch setting of 73700 that will load warmUNIX is used as a signal to bring up a single user system for special purposes. See /etc/init. Cold boots can be accomplished with the Cold UNIX program,but they're not. Thus the Cold UNIX slot on the RF may have any program desired. This slot is, however, used during acold boot. Mount the UNIX INIT DECtape on drive 0 positioned in the end--zone. Put 173740 into the switches. Push loadaddress. Put 1 into the switches. Push start. This reads a program called vcboot from the tape into core location 0 andtransfers to it. vcboot then reads 16K words from the DECtape (blocks 1--32) and copies the data to the highest 16Kwords of the RF. Thus this initializes the read--only part of the RF. vcboot then reads in bos and executes it. bos thenreads in Cold UNIX and executes that. Cold UNIX halts for a last chance before it completely initializes the RF filesystem. Push continue, and Cold UNIX will initialize the RF. It then sets into execution a user program that reads theDECtape for initialization files starting from block 33. When this is done, the program executes /etc/init whichshould have been on the tape.


The INIT tape is made by the program maki running underUNIX. maki writes vcboot on block 0 of /dev/tap7 It then copies the RF 16K words (using /dev/rf0) onto blocks 1 thru32. It has internally a list of files to be copied from block 33 on. This list follows:


/etc/init/bin/chmod


11/3/71BOOT PROCEDURES

(VII)


/bin/chown/bin/cp /bin/1n/bin/ls /bin/mkdir/bin/mv /bin/rm/bin/rmdir /bin/sh/bin/stat /bin/tap Thus this is the set of programs available after a coldboot. /etc/init and /bin/sh are mandatory. /bin/tap and /bin/mkdir are used to load up the file system. The rest ofthe programs are frosting. As soon as possible, an sdate should be done. The last link in this incestuous daisy chain is the programmsys


msys char file will copy the file file onto the RF read only slot specifiedby the characacter char. Char is taken from the following set:


b bosu Warm UNIX 1 Cold UNIX2 unassigned


Due to their rarity of use, and msys are maintained offlineand must be reassembled before used.
FILES /dev/rf0, /dev/tapn
SEE_ALSO /etc/init, /bin/tap, /bin/sh, /bin/mkdir, bppt format
DIAGNOSTICS
BUGS The files /bin/mount, /bin/sdate, and /bin/date should beincluded in the initialization list of maki.


OWNER ken



11/3/71 /ETC/BRT1, BRT2 (VII)
NAME brtl, brt2 -- B runtime routines
SYNOPSIS
DESCRIPTION The first of these routines must be loaded first in anexecutable B program; the second must be loaded last, after


all other routines. They are not in /etc/bilib only becausehaving them separate is the easiest way to assure the order of loading.
FILES
SEE_ALSO b command, bilib
DIAGNOSTICS
BUGS
OWNER ken



11/3/71 /ETC/F1, F2, F3, F4 (VII)
NAME f1, f2; f3, f4 -- Fortran compiler
SYNOPSIS
DESCRIPTION These programs represent the four phases of a Fortrancompilation:


f1: specification statementsf2: common and equivalence allocation f3: executable statementsf4: cleanup


Each exec's the next; the first is called by the forcommand.
FILES f.tmpl, f.tmp2, f.tmp3
SEE_ALSO for
DIAGNOSTICS
BUGS Besides the fact that there is a good deal of the Fortranlanguage missing, there is no for command; Fortran is


invoked via a command file.
OWNER ken, dmr



11/3/71 /ETC/GLOB (VII)
NAME glob -- global
SYNOPSIS
DESCRIPTION glob is used to expand arguments to the shell containing "*"or "?". It is passed the argument list containing the


metacharacters; glob expands the list and calls the commanditself.


FILES
SEE_ALSO sh
DIAGNOSTICS "No match", "no command"


BUGS glob will only load a command from /bin. Also if any "*" or"?" argument fails to generate matches, "No match is typed


and the command is not executed.
OWNER dmr



11/3/71 /ETC/INIT (VII)
NAME init -- process initialization
SYNOPSIS
DESCRIPTION init is invoked inside UNIX as the last step in the bootprocedure. It first carries out several housekeeping duties:


it must change the modes of the tape files and the RK diskfile to 17, because if the system crashed while a tap or rk command was in progress, these files would be inaccessible;it also truncates the file /tmp/utmp, which contains a list of UNIX users, again as a recovery measure in case of acrash. Directory usr is assigned via sys mount as resident on the RK disk. init then forks several times so as to create one processfor each typewriter channel on which a user may log in. Each process changes the mode of its typewriter to 15 (read/writeowner, write--only non--owner; this guards against random users stealing input) and the owner to the super--user. Thenthe typewriter is opened for reading and writing. Since these opens are for the first files open in the process,they receive the file descriptors 0 and 1, the standard input and output file descriptors. It is likely that no oneis dialled in when the read open takes place; therefore the process waits until someone calls. At this point, init typesits "login: message and reads the response, which is looked up in the password file. The password file contains eachuser's name, password, numerical user ID, default working directory, and default shell. If the lookup is successfuland the user can supply his password, the owner of the typewriter is changed to the appropriate user ID. An entryis made in /tmp/utmp for this user to maintain an up--to--date list of users. Then the user ID of the process is changedappropriately, the current directory is set, and the appropriate program to be used as the Shell is executed. At some point the process will terminate, either because thelogin was successful but the user has now logged out, or because the login was unsuccessful. The parent routine ofall the children of init has meanwhile been waiting for such an event. When return takes place from the sys init simplyforks again, and the child process again awaits a user.


There is a fine point involved in reading the login message.UNIX is presently set up to handle automatically two types of terminals: 150 baud, full duplex terminals with the line--feed



11/3/71 /ETC/INIT (VII)


function (typically, the Model 37 Teletype terminal), and300 baud, full duplex terminals with only the line--space function (typically the GE TermiNet terminal). The lattertype identifies itself by sending a line--break (long space) signal at login time. Therefore, if a null character isreceived during reading of the login line, the typewriter mode is set to accommodate this terminal and the "login:"message is typed again (because it was garbled the first time). Init, upon first entry, checks the switches for 73700. Ifthis combination is set, will open /dev/tty as standard input and output and directly execute /bin/sh. In thismanner, UNIX can be brought up with a minimum of hardware and software.
FILES /tmp/utmp, /dev/ttyO ... /dev/ttyn
SEE_ALSO sh
DIAGNOSTICS "No directory", "No shell". There are also some halts ifbasic I/O files cannot be found in /dev.


BUGS
OWNER ken, dmr



11/3/71 /ETC/KBD (VII)
NAME kbd -- keyboard map
SYNOPSIS cat /etc/kbd
DESCRIPTION kbd contains a map to the keyboard for model 37 Teletypeterminals with the extended character set feature. If kbd is


printed on such a terminal, the following will appear: <[1234567890--_]^\ >qwertyuiop@ asdfghjkl;: zxcvbnm,./


... [ rest deleted --DMR 1998 ]
FILES
SEE_ALSO
DIAGNOSTICS

BUGS
OWNER jfo



11/3/71 /ETC/LIBA.A (VII)
NAME liba.a -- assembly language library
SYNOPSIS
DESCRIPTION This library is the standard location for assembly--languagesubroutines of general use. A section of this manual is


devoted to its contents. This library is searched when the link editor ld encountersthe "--l" argument.


FILES
SEE_ALSO ld; library manual

DIAGNOSTICS


BUGS
OWNER dmr, ken



11/3/71 /ETC/LIBB.A (VII)
NAME libb.a. -- B library
SYNOPSIS
DESCRIPTION This library contains all B--callable subroutines of generalutility. Its contents are detailed in the library sectionof


the B manual. At present its contents are:


chargetchr putchrexit printfseek


setuidstat timeunlink waitlchar chdirchmod chownclose createxecl execvfork. fstatgetuid intr1ink makdiropen readwrite ctime
FILES
SEE_ALSO b
DIAGNOSTICS

BUGS
OWNER ken, dmr