.de pg .sp .. .ce SETTING UP UNIX .pg Enclosed are: .nf 1. "UNIX Time Sharing System" 2. "UNIX Assembler Reference Manual" 3. "C Reference Manual" 4. "UNIX Programmer's Manual" 5. "ED Tutorial" 6. "Regenerating System Software" 7. The UNIX software on magtape or disk pack. .pg .fi If your system is on magtape, perform the following bootstrap procedure to obtain a disk pack. .nf 1. Mount magtape on drive 0 at load point. 2. Mount formatted disk pack on drive 0. 3. Key in and execute at 100000 012700 172526 010040 012740 060003 000777 The tape should move and the CPU loop. (This is not___ the DEC bulk ROM for tape.) 4. Halt and restart the CPU at 0. The tape should rewind. The console should type '='. 5. Copy the magtape to disk by the following: = (machine) mcopy< (you) (< is CR or LF) p for RP; k for RK< (machine) p (you) (or k as the case may be) disk offset< (machine) 0< (you) tape offset< (m) 75< (y) (the tape should move) count< (m) 4000< (y) (the tape moves more) = (m) .pg .fi If you have a UNIX disk and want to extract and execute UNIX from it, key in and execute the following program at location 100000 .nf RP RK 012700 012700 176726 177414 005040 005040 005040 005040 005040 010040 010040 012740 012740 000005 000005 105710 105710 002376 002376 005007 005007 .fi NOTE: These programs correspond to the DEC bulk ROM for RP and RK resp. The CPU should loop. At this point type p for RP or k for RK. A CR will be echoed. Now type usr/sys/unix followed by a CR. After a delay, UNIX will come up by announcing .nf mem = xxx :login: .fi The mem message gives user available memory in .1K units. The number should be 120 (for 12K) or larger for UNIX to fully support all of its software. .pg UNIX is now running. The "UNIX Programmer's manual" now applies. (Below references to section X entitled Y of the programmer's manual are given (Y-X).) The only valid user names are root and bin. The root is the super-user and bin is the owner of nearly every file in the file system. .pg Before UNIX is turned up completely, a few configuration dependent exercises must be performed. First login (login-I) as root. .pg FLOATING POINT .br If your machine does not have the 11/45 floating point option, (this includes all 11/40 systems) you must execute the following command .pg sh /usr/sys/conf/flrc .pg This sequence recompiles the C compiler and the debugger not to use floating point. It also installs the floating point interpreter in the standard library and reloads basic, and fortran to have their floating point interpreted. The execution should take about 3.5 minutes and produce various roman and arabic digits. .pg TIME CONVERSION .br If your machine is not in the eastern time zone, you must edit (ed-I) the subroutine /usr/source/s4/ctime.c to reflect your local time. The variable timezone should be changed to reflect the time difference between local time and GMT. For EST, this is 5*60*60; for PST it would be 8*60*60. For example to convert to pacific time: .pg ed /usr/source/s4/ctime.c .br /5\\*/s//8*/ .pg Three lines farther, is the name of the standard time zone. It should be changed to reflect local standard time. Thus continuing the above example .pg .3s/\\e/\\p/ .pg The next line is the daylight time zone name, if any. .pg .nf .1s//\\p/ w q .pg .fi NOTE that these two names are in upper case and will have to be edited using escapes (dc-IV) as shown above. Two lines farther is the daylight flag. It has the value 1 which causes the time to shift to daylight savings automatically between the last Sundays in April and October. Normally this will not have to be reset. The line after that is the Nixon flag. If set, the time conversion will reflect daylight savings time all year. If the Nixon flag is set, the daylight flag has no effect. After ctime.c has been edited (make sure it is rewritten), execute the following command. .pg sh /usr/sys/conf/tmrc .pg This will recompile all the programs that use the local time conversion. This execution takes about 7 minutes, and requires that the floating point corrections have been installed if needed. If the editing of ctime.c was botched, there will be diagnostics from its compilation. .pg Set the current date (date-I). .pg SPECIAL FILES .br At this point, it would be wise to read all of the manuals and to augment this reading with hand to hand combat. It might be instructive to examine the shell command files for floating point and time conversions. The rest of the conversion assumes that sections I, IV, V, VII, and VIII of the programmer's manual have been read. .pg Next you must put in all of the special files in the directory /dev using mknod-VIII. Print the configuration file .pg cat /usr/sys/conf/conf.c .pg This is the major device switch of each device class (block and character). There is one line for each device configured in your system. The block special devices are put in first by executing the following generic command for each disk or tape drive. .pg /etc/mknod /dev/NAME b MAJOR MINOR .pg The NAME is selected from the following list: .pg .nf conf.c NAME device rf rf0 RS/RF fixed head disk tc tap0 TC/TU DECtape rk rk0 RK moving head disk tm mt0 TM/TU magtape rp rp0 RP moving head disk .pg .fi The MAJOR device number is selected by counting the line number (from zero) of the device's entry in the block configuration table. Thus the first entry in the table bdevsw would be major device zero. .pg The minor device is the drive number, unit number or partition as described under each device in section IV. The last digit of the name (all given as 0 in the table above) should reflect the minor device number. For tapes where the unit is dial selectable, a special file may be made for each possible selection. If the configuration table had entries for RP, RK, TC and TM (in that order), then the following special files might be created. .pg .nf /etc/mknod /dev/rp0 b 0 0 /etc/mknod /dev/rp1 b 0 1 /etc/mknod /dev/rk0 b 1 0 /etc/mknod /dev/rk1 b 1 1 /etc/mknod /dev/tap0 b 2 0 ... /etc/mknod /dev/tap7 b 2 7 /etc/mknod /dev/mt0 b 3 0 ... /etc/mknod /dev/mt7 b 3 7 .pg .fi This sets up file rp0 and rp1 each as a half of one RP03 drive. Files rk0 and rk1 correspond to two RK03/RK05 drives. The tape files will handle up to eight handlers dialed to any unit. .pg The same goes for the character devices. Here the names are arbitrary except that devices meant to be used for teletype access should be names /dev/ttyX, where X is any character. The console is already in as: .pg /etc/mknod /dev/tty8 c 0 0 .pg MOUNTED FILE SYSTEMS .br If there are to be more file systems mounted than just the root, use mkfs-VIII to create the new file system and put its mounting in the file /etc/rc (see init-VII and mount-VIII). For example, to set up a second RK as a mounted file system. .pg .nf /etc/mkfs /dev/rk1 4872 /etc/mount /dev/rk1 /mnt ed /etc/rc $a /etc/mount /dev/rk1 /mnt . w q .pg .fi NEW USERS .br Install new users by editing the password file /etc/passwd (passwd-V). You'll have to make current directories for the new users in either /usr or /mnt and change their owners to the newly installed name. Login as each user to make sure the password file is correctly edited. For example: .pg .nf ed /etc/passwd $a joe::10::/mnt/joe: . w q mkdir /mnt/joe chown joe /mnt/joe login joe ls -la login root .pg .fi This will make a new login entry for joe. His default current directory is /mnt/joe which has been created. .pg ODDS AND ENDS .br If UNIX is to support simultaneous access from more than just the console teletype, the program /etc/init (source /usr/source/s1/init.c) must be recompiled. Each additional character device teletype interface must be created in /dev with a name of the form /dev/ttyX. The source of /etc/init has a table of these names. Currently, only the name '8' (for /dev/tty8) is in this table. The following sequence will recompile init to add the names tty0 and tty1. (It is assumed that these files already exist.) .pg .nf chdir /usr/source/s1 ed init.c /'8'/a '0', 0, '1', 0, . w cc -n init.c strip a.out cp a.out /etc/init rm a.out .pg .fi This program is the most sensitive in the whole system. If a bad version is installed, its all over. If this table is botched, it might be possible to come up single user and repair the damage. (see init-VII) .pg The programs dump, check and df (source check.c, dump.c, and df.c all in /usr/source/s1) /usr/source/s1/df.c) have to be changed to reflect your default mounted file system devices. Print the first few lines of these programs and the changes will be obvious. .pg Once running, you should use check to check your file systems often to insure consistency. Never stop your machine without first executing sync. Dumping is done by copying (cp-I) file systems to backup devices. Restoring can be done with cp or with the standalone program mcopy. .pg The following programs out of the programmer's manual are not provided: catsim(I), man(I), nroff(I), opr(I), plot(I), speak(I), troff(I), tss(I), gerts(III), vt(III), azel(VI), m6(VI), maze(VI), ov(VI), sky(VI), spline(VI), tmg(VI), yacc(VI), dpd(VII), tmheader(VII), vs(VII), 20boot(VIII) and update(VIII). .pg The source of the following programs from the manual is not provided: cref(I), proof(I), bj(VI), chess(VI), cubic(VI), moo(VI), ttt(VI) and wump(VI). .pg The source that is provided on the file system is quite space consuming. You will want to probably dump it offline (with dump-VIII, tp-I or cp-I as above) and remove it. Care should be exercised in deleting any files in the following directories: /bin, /etc, /lib, /usr/bin, /usr/lib, /usr/games. Also the following files should not be deleted: /usr/fort/fc1, /usr/sys/unix, /dev/tty8. .pg The source of the system proper is kept in /usr/sys. Most of the subsystem source is kept in /usr/source. for a complete list of the file system, use check-VIII or du-I (with -l flag). .pg If you would like to share any UNIX compatible software with others, please let us know about it. If you find bugs in the software or the documentation, again let us know. And finally if you need any help that we can provide we'll do all we can. We expect to have a UNIX seminar early in 1974. .pg Good luck. .br Ken Thompson .br Dennis Ritchie .br Bell Telephone Labs .br Murray Hill, NJ 07974