📄 setup
字号:
c.c created above.This is the majordevice switch of each device class (block and character).There is one line for each device configured in your systemand a null line for place holding for those devicesnot configured.The essential block special files were installed above;for any new devices,the major device number is selected by counting theline number (from zero)of the device's entry in the block configuration table.Thus the first entry in the table bdevsw would bemajor device zero.This number is also printed in the table along the right margin..PPThe minor device is the drive number,unit number or partition as describedunder each device in section 4 of the manual.For tapes where the unit is dial selectable,a special file may be made for each possibleselection.You can also add entries for other disk drives..PPIn reality, device names are arbitrary. It is usuallyconvenient to have a system for deriving names, but it doesn'thave to be the one presented above..PPSome further notes on minor device numbers.The hp driver uses the 0100 bit of the minor device number toindicate whether or not to interleave a file system acrossmore than one physical device. See hp(4) for more detail.The tm and ht drivers use the 0200 bit to indicate whetheror not to rewind the tape when it is closed. The0100 bit indicates the density of the tape on TU16 drives.By convention, tape special files with the 0200 bit on have an `n'prepended to their name, as in /dev/nmt0 or /dev/nrmt1.Again, see tm(4) or ht(4)..PPThe naming of character devices is similar to block devices.Here the names are even more arbitrary except thatdevices meant to be usedfor teletype access should (to avoid confusion, no other reason) be named/dev/ttyX, where X is some string (as in `00' or `library').The files console, mem, kmem, and null arealready correctly configured..PPThe disk and magtape drivers provide a `raw' interfaceto the device which provides direct transmissionbetween the user's core and the device and allowsreading or writing large records.The raw device counts as a character device,and should have the name of the correspondingstandard block special file with `r' prepended.(The `n' for no rewind tapes violates this rule.)Thus the raw magtapefiles would be called /dev/rmtX.These special files should be made..PPWhen all the special files have been created,care should be taken to changethe access modes (chmod(1))on these files to appropriate values (probably 600 or 644)..SHFloating Point.PPUNIX only supports (and really expects to have) the FP11-B/Cfloating point unit.For machines without this hardware,there is a user subroutineavailable that will catch illegal instructiontraps and interpret floating point operations.(See fptrap(3).)To install this subroutine in the library, change to /usr/src/libfpsimand execute the shell files.DS compall mklib.DEThe system as delivered does not have this code includedin any command,although the operating system adapts automatically to thepresence or absence of the FP11..PPNext, a floating-point version ofthe C compiler in /usr/src/cmd/cshould be compiled using the commands:.DScd /usr/src/cmd/cmake fc1mv fc1 /lib/fc1.DEThis allows programs with floating point constantsto be compiled.To compile floating point programs use the `\-f'flag to cc(1). This flag ensures that the floatingpoint interpreter is loaded with the program and thatthe floating point version of `cc' is used..SHTime Conversion.PPIf your machine is not in the Eastern time zone,you must edit (ed(1)) the file/usr/sys/h/param.hto reflect your local time.The manifest `TIMEZONE' should be changedto reflect the time difference between local time and GMT in minutes.For EST, this is 5*60; for PST it would be 8*60.Finally, there is a `DSTFLAG'manifest;when it is 1 it causes thetime to shift to Daylight Savings automaticallybetween the last Sundays in April and October(or other algorithms in 1974 and 1975).Normally this will not have to be reset.When the needed changes are done, recompile and load thesystem usingmake(1)and install it.(As a general rule, when a system header file is changed,the entire system should be recompiled.As it happens, the only uses of these flags are in/usr/sys/sys/sys4.c, so if this is all that was changed italone needs to be recompiled.).PPYou may also want to look at timezone(3)(/usr/src/libc/gen/timezone.c) to seeif the name of your timezone is in its internal table.If needed, edit the changes in.After timezone.c has been editedit should be compiled and installed inits library.(See /usr/src/libc/(mklib and compall))Then you should(at your leisure)recompile and reinstallall programs that use it (such as date(1))..SHDisk Layout.PPIfthere are to be more file systems mounted than just the rootand /usr,use mkfs(1) to create any new file system andput its mounting in the file /etc/rc (see init(8) and mount(1)).(You might look at /etc/rc anyway tosee what has been provided for you.).PPThere are two considerations in deciding how to adjust the arrangementof things on your disks:the most important is making sure there is adequate spacefor what is required;secondarily, throughput should be maximized.Swap space is a critical parameter.The systemas distributed has 8778 (hpunix) or 2000 (rpunix) blocks for swap space.This should be large enough so running out of swap space neveroccurs.You may want to change these if local wisdom indicates otherwise..PPThe system as distributed has all of the binaries in /bin.Most ofthem should be moved to /usr/bin, leaving only the ones required forsystem maintenance (such as icheck, dcheck, cc, ed, restor, etc.) and the mostheavily used in /bin.This will speed things up a bit if you have only one disk, and also freeup space on the root file system for temporary files. (See below)..PPMany common system programs (C, the editor, the assembler etc.)create intermediate files in the /tmp directory,so the file system where this is stored also should be madelarge enough to accommodatemost high-water marks.If you leave the root file system as distributed(except as discussed above) thereshould be no problem.All the programs that create files in /tmp takecare to delete them, but most are not immune toevents like being hung up upon, and can leave dregs.The directory should be examined every so often and the oldfiles deleted..PPExhaustion of user-file space is certain to occurnow and then;the only mechanisms for controlling this phenomenonare occasional use of du(1), df(1), quot(1), threateningmessages of the day, and personal letters..PPThe efficiency with which UNIX is able to use the CPUis largely dictated by the configuration of disk controllers.For general time-sharing applications,the best strategy is to try to split user files,the root directory (including the /tmp directory)and the swap area among three controllers..PPOnce you have decided how to make best useof your hardware, the question is how to initialize it.If you have the equipment,the best way to move a file systemis to dump it (dump(1)) to magtape,use mkfs(1) to create the new file system,and restore (restor(1)) the tape.If for some reason you don't want to use magtape,dump accepts an argument telling where to put the dump;you might use another disk.Sometimes a file system has to be increased in logical sizewithout copying.The super-block of the device has a wordgiving the highest address which can be allocated.For relatively small increases, this word can be patchedusing the debugger (adb(1))and the free list reconstructed using icheck(1).The size should not be increased very greatlyby this technique, however,since although the allocatable space will increasethe maximum number of files will not (that is, the i-listsize can't be changed).Read and understand the description given in file system(5)before playing around in this way.You may want tosee section rp(4) for some suggestionson how to lay out the information on RP disks..PPIf you have to merge a file system into another, existing one,the best bet is touse tar(1).If you must shrink a file system, the best bet is to dumpthe original and restor it onto the new filesystem.However, this might not work if the i-list on the smaller filesystemis smaller than the maximum allocated inode on the larger.If this is the case, reconstruct the filesystem from scratchon another filesystem (perhaps using tar(1)) and then dump it.If youare playing with the root file system and only have one drivethe procedure is more complicated. What you do is the following:.IP 1.GET A SECOND PACK!!!!.IP 2.Dump the current root filesystem (or the reconstructed one) using dump(1)..IP 3.Bring the system down and mount the new pack..IP 4.Retrieve the WECo distribution tape and perform steps 1 through5 at the beginning of this document,substituting the desired file system size instead of 5000when asked for `file system size'..IP 5.Perform step 6 above up to the point where the `tape'question is asked. At this point mount the tapeyou made just a few minutes ago. Continue with step 6 above substitutinga 0 (zero) for the 5..SHNew Users.PPInstall new users by editing the password file/etc/passwd (passwd(5)).This procedure should be done once multi-user mode is entered(see init(8)).You'll have to make a current directory for each new userand change its owner to thenewly installed name.Login as each user to make sure the passwordfile is correctly edited.For example:.DSed /etc/passwd$ajoe::10:1::/usr/joe:.li.wqmkdir /usr/joechown joe /usr/joelogin joels \-lalogin root.DEThis will make a new login entry for joe,who should be encouraged to use passwd(1)to give himself a password.His default current directory is/usr/joewhich has been created.The delivered password filehas the user.Ibin.Rin it to be used as a prototype..SHMultiple Users.PPIf UNIX is to support simultaneousaccess from more than just the console terminal,the file /etc/ttys (ttys(5)) has to be edited.To add a new terminal be sure the device is configuredand the special file exists, then setthe first character of the appropriate line of /etc/ttys to 1(or add a new line).Note that init.c will have to be recompiled if there are to bemore than 100 terminals.Also note that if the special file is inaccessible when init tries to create a processfor it, the system will thrash trying and retrying to open it..SHFile System Health.PPPeriodically (say every day or so) and always after a crash,you should check all the file systems for consistency(icheck, dcheck(1)).It is quite important to execute sync (8)before rebooting or taking the machine down.This is done automatically every 30 seconds by the updateprogram (8) when a multiple-user system is running,but you should do it anyway to make sure..PPDumping of the file system should be done regularly,since once the system is going it is very easy tobecome complacent.Complete and incremental dumps are easily done withdump(1).Dumping of files by name is best done bytar(1) but the number of files is somewhat limited.Finally if there are enough drives entiredisks can be copied using cp(1), or preferably withdd(1) using the raw special files and an appropriateblock size..SHConverting Sixth Edition Filesystems.PPThe best way to convert file systems from 6thedition (V6) to 7th edition (V7) formatis to use tar(1). However, a special version of tar mustbe preparedto run on V6.The following steps will do this:.IP 1.change directories to /usr/src/cmd/tar.IP 2.At the shell prompt respond.DSmake v6tar.DEThis will leave an executable binary named `v6tar'..IP 3.Mount a scratch tape..IP 4.Use tp(1) to put `v6tar' on the scratchtape..IP 5.Bring down V7 and bring up V6..IP 6.Use tp (on V6) to read in `v6tar'. Put it in/bin or /usr/bin (or perhaps some other preferred location)..IP 7.Use v6tar to make tapes of all that you wish to convert.You may want to read the manual section on tar(1) tosee whether you want to use blocking or not.Try to avoid using full pathnames when making the tapes. Thiswill simplify moving the hierarchy to some other place on V7 if desired. For example.DSchdir /usr/kenv6tar c ..DEis preferable to.DSv6tar c /usr/ken.DE.IP 8.After all of the desired tapes are made, bringdown V6 and reboot V7. Usetar(1) to read in the tapes just made..SHOdds and Ends.PPThe programsdump,icheck, quot, dcheck, ncheck, and df(source in /usr/source/cmd)should be changed toreflect your default mounted file system devices.Print the first few lines of theseprograms and the changes will be obvious.Tar should be changed to reflect your desireddefault tape drive..sp 3.in 4iGood Luck.sp 1Charles B. Haley.brDennis M. Ritchie
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -