Subject: kernel 'config', autoconfig, documentation changes (#97, 9 of 12) Index: sys,doc,etc,pdpif,.../many 2.11BSD Description: This is part 9 of 12. Updates #89 thru #100 are parts 1 thru 12 respectively. If you have tired of reading the notes in the "Repeat-By:" section please skip to the "Fix:" section for notes and instructions about this patch file (list of files updated, etc). Repeat-By: This section is repeated in each patch file. Specific directions for the individual patches are included in the "Fix:" section. Several problem areas are addressed by this series of updates. 1) The kernel configuration problems are best noticed by maintaining kernels for a variety of systems and forgetting to copy 'localopts.h' to ../h before compiling. This at best would cause compile time problems, at worst resulting in a kernel that was unusable. MANY of the changes described below are aimed at the reduction of 'localopts.h' to almost nothing. 2) There were several kernel config options which were either known not to work, have not been used within recent memory or were obsolete. UCB_FRCSWAP (to force a swap on program expansion) is a good example of an option which has been removed. The list of things which have been options at one time or another in the system's life has been removed. Many of them dated back to V7, the modules which they affected are not even present in the system any longer. Two options have been moved to the end of the 'config' script. Neither is known to work (CGL_RTP and FPSIM) and are always left NO. 3) A couple of kernel config options should not have been options so that the kernel could automatically adapt to whatever machine it found itself running on. The UNIBUS_MAP and Q22 options are good examples of this. Usage of the UNIBUS_MAP option was inconsistent, some of the drivers in the system "#ifdef"d references to the Unibus map allocation routine while other drivers did not. Since the system knows whether a Unibus Map is present or not the correct behaviour is to either test 'ubmap' or simply call 'mapalloc' (which will do the test for you). In the case of GENERIC or Unibus based kernels there is _no_ penalty (since UNIBUS_MAP was defined), in the case of Qbus systems there is about 900 bytes of code that simply never gets used (and 40 bytes or so of D space). The Q22 defined was used incorrectly in a couple of drivers to either distinquish between Digital and 3rd party controllers (DH-11 vs Emulex CS02) or to indicate whether the system was Qbus or Unibus based. The references to Q22 in dh.c were changed to CS02 (a new option in the device selection area of the config files), deleted, or replaced with tests of 'ubmap'. UCB_RUSAGE has been made standard because several applications (iostat, vmstat, etc) use the statistics and because the getrusage(2) call uses them. UCB_METER has been left as an option and will be placed in the Makefile as "-DUCB_METER" in the DEFS line. References to UCB_RUSAGE have been removed from the kernel. NONFP has been removed. Hardware floating point is mandatory for two reasons: the simulator doesn't work, and FP is very inexpensive (or standard on KDJ-11 systems). VIRUS_VFORK has been removed. Nothing depended on it in the applications and VIRUS_VFORK has never been anything but YES. 4) NSWAP has gone away. It was too easy to either forget to change it or to pick a wrong number (by guessing). Borrowing yet another concept from 4.3BSD the system now determines the amount of swap space dynamically after booting. This is done by calling a partition size routine which each disc driver provides. The bdevsw[] table (in pdp/conf.c) has been expanded to include a "d_psize" member for each device. NOTE: this change requires that 'a' and 'b' be the root and swap partitions. All drivers except the RK06/7 (hk.c) and RM02/3 (xp.c) observed this rule. Changes were made to the RK06/7 and RM02/3 partition tables (and /etc/disktab). The previous practice of using the 'e' or 'f' partitions to overlap the old 'a'+'b' partitions has gone away. THE new 'a' partition is the same size as the 'e' or 'f' partitions used to be, so there is ROOT FILESYSTEM compatibility (the system will still boot). Best to back the system up (if using RK07 or RM02 drives) before applying these changes. 5) SWAPLO has gone away. It has never been anything but 0 within recent memory (and would have resulted in filesystem corruption if an inappropriate value were chosen). The only device which possibly would need to use it (the RL02) is required to be used in pairs. Deleting SWAPLO removed a number of long word adds scattered around the kernel. One sector (.5kb) of swap space is "lost"/discarded. The previous practice was to decrement 'swplo' in compensation for entering 1 as the first swap block. Since 'swplo' has gone away, the number of blocks available ('nswap') is simply decremented by 1 and the swapmap initialized starting at block 1. This change affects a couple of the applications ('ps', 'pstat', etc.) which were looking for 'swplo'. These programs have been updated. 6) 'autoconfig' and programmable vector devices (MSCP, TMSCP, etc) have never gotten along very well. The drivers had vectors hardcoded (either via #define statments or code which allocated vectors from a base vector) into them. Changing /etc/dtab would have no effect (at best) or the system would crash (at worst) because 'autoconfig' would allocate/initialize a vector different than that assumed by the driver. Networking drivers which support programmable vectors (DEQNA for example) previously had their vectors hardcoded into them AND into pdp/net_scb.s. Changing one but forgetting to change the other was one way to generate an inoperable system! This has been fixed _at last_! There are two methods used. One for kernel devices configured by 'autoconfig' and a second used by the both 'autoconfig' and the networking drivers (which are not handled by 'autoconfig' because the networking is already running by the time 'init' starts 'autoconfig'). If a driver defines a routine "xxxVec" (where xxx is 'ra', 'tms', etc) then 'autoconfig' will call the driver with two parameters: the controller number and the vector from /etc/dtab. If the driver lacks a 'xxxVec' routine then 'autoconfig' functions as it always has. The second method is used when dynamic allocation of vectors is desired for programmable vector devices. The networking drivers (DEQNA, DEQTA, etc) use this method. In the kernel there is a location ('lastiv') which contains the next vector to assign. Usage is to decrement 'lastiv' by 4 and use the new value. If multiple vectors are needed then a multiple of 4 is subtracted ('autoconfig' counts how many "handlers" it needs for a device). To make use of this feature (second or third MSCP controllers for example) put a 0 (zero) in the vector field in /etc/dtab. NOTE: It is an error to specify a 0 vector (dynamic allocation) and not have a 'xxxVec' routine for 'autoconfig' to call. 'autoconfig' will print an error and leave the device unattached. If 'xxxVec' is used by 'autoconfig' the driver should return success (0) or failure (non-0). 'autoconfig' will print "vectorset" if a programmable vector is successfully installed. Networking drivers access 'lastiv' via the "mfkd" and "mtkd" (move from kernel data, move to kernel data) routines. The hardwired vector (400 for the DEQNA) has been removed from scb.s., NOTE: the handlers for networking devices are still present in net_scb.s, the drivers initialize the allocated vector by means of a small (1 instruction) assembly language routine (see the changes to pdpif/if_qe.c). This 'asm' routine is needed for the driver to access the handle name which does not have a leading (underscore) prepended to it. 7) The logic in the DHV-11 driver to attempt forcing a fuller silo (by turning off and on the receive interrupt enable) was removed since it did not work (for very long). After 2 silo overruns or 90% full silos the logic would disable itself by decrementing the number of delay ticks to 0. The only real fix for the DHV-11's silo handling problem is to replace the DHV-11 with a DHQ-11. 8) The kernel option UCB_NET has been renamed to INET (as 4.3BSD does). The TCP_COMPAT_42 option has been made "standard" by removing the ifdef in netinet/tcp_var.h. 9) The MAXMEM option has been moved to param.h. It is (almost) never changed and was yet one more thing to accidentally get wrong when configuring a kernel. Thought was given to removing MAXMEM entirely but it was put in with the other "never changed without a great deal of thought" parameters in param.h 10) The setup and installation documents have been revised to reflect the new kernel configuration process and to remove references to 'xpunix', 'raunix', etc (not needed now that the generic kernel adapts automatically). 11) The drivers in the OTHERS directory have been lightly edited to change UCB_NET to INET, remove UNIBUS_MAP usage, etc. No attempt has been made to port or fix the drivers. 12) Last, but by no means least, the 'config' script (/sys/conf/config) and the conf/Make.{nsunix,unix,sunix} files have been totally redone. Borrowing still another idea from 4.3BSD (not a whole lot left to 'steal' ;-)) the 'config' script now places a line: DEFS="-DKERNEL -Doption1 -Doption2 ..." at the front of the main Makefile. The CFLAGS statement has been modified to include ${DEFS}, thus the configuration options are passed thru to the secondary makefiles Make.pdp, Make.pdpuba, etc. The GENERIC config file has been redone. You should make note of your present device complement and then re-config your kernels by making a copy of GENERIC and editing it. NOTE: The PDP11 line is now only used to select the appropriate inlining method for the 'spl' instruction. You may safely set PDP11 to GENERIC, no references to PDP11 are now made anywhere in the kernel. You should only set the IDENT line to GENERIC if you either know what you are doing, or if you really are making a distribution kernel. Setting IDENT to GENERIC causes the kernel at boot time to: a) override "swapdev". A GENERIC kernel automatically assigns the 'b' partition of the booted device to be "swapdev" b) override "rootdev". A GENERIC kernel automatically assigns the 'a' partition of the booted device to be "rootdev" and "pipedev". The /GENALLSYS script is obsolete and has been removed from the system. For a GENERIC system /unix will now adapt to the bootstrapped drive and automatically determine the amount of swap space. The only change made to the secondary makefiles was to add a new ethernet driver (not yet working) to Make.net. The DEQTA driver (if_qt.c) is still being debugged, a future update will be forthcoming. Since if_qt.c does not exist, the "patch" is the whole file (the same applies to if_qtreg.h). You will need to create two 0 length files in pdpif ("touch /sys/pdpif/if_qt.c /sys/pdpif/if_qtreg.h") before applying the 'pdpif' update kit. A reminder will be placed in the part containing that patch. NOTE: localopts.h has exactly _TWO_ (2) definitions in it now: EXTERNALITIMES (mapped out time values from the inodes) and LINEHZ. The default for EXTERNALITIMES is now YES. It is recommended that this not be changed, if it is changed then applications which look at the kernel incore inode table (pstat for example) will need to be recompiled. Unless either of these two defines change you never need to worry about copying localopts.h again! Fix: The following files are modified: /usr/src/sys/pdpdist/disktab /usr/src/sys/pdpdist/netstart /usr/src/sys/pdpdist/rc /usr/src/sys/pdpdist/rc.local The 'disktab' file had the RK06/7 and RM02/3 entries changed to conform to the convention that 'a' is the root filesystem and 'b' is the swap partition. These two disk types were the only two not following the convention. It is now necessary to follow the convention for purposes of dynamically determining the amount of swap space at boot time. In the remaining files references to UCB_NET were replaced with INET. *** /usr/src/sys/pdpdist/disktab.old Sun Jul 12 00:04:08 1992 --- /usr/src/sys/pdpdist/disktab Fri Jan 1 17:53:02 1993 *************** *** 31,46 **** # Drives on xp # rm02|RM02|rm03|RM03|DEC RM02/03:\ :ty=removable:ns#32:nt#5:nc#823:sf:\ :b0=/mdec/rm03uboot:\ ! :pa#4800:ba#1024:fa#1024:\ ! :pb#4800:bb#1024:fb#1024:\ ! :pc#121922:bc#1024:fc#1024:\ ! :pd#62720:bd#1024:fd#1024:\ ! :pe#59202:be#1024:fe#1024:\ ! :pf#9600:bf#1024:ff#1024:\ ! :ph#131522:bh#1024:fh#1024: # RM05: rm05|RM05|cdc9766|CDC9766|9766|DEC RM05, CDC 9766:\ --- 31,48 ---- # Drives on xp # + # RM02/03 - 'c' and 'h' partitions are both whole drive except bad sector track. + # 'e' used to overlap 'a+b'. + # rm02|RM02|rm03|RM03|DEC RM02/03:\ :ty=removable:ns#32:nt#5:nc#823:sf:\ :b0=/mdec/rm03uboot:\ ! :pa#9600:ba#1024:fa#1024:\ ! :pb#9600:bb#1024:fb#1024:\ ! :pc#131520:bc#1024:fc#1024:\ ! :pf#121920:bh#1024:fh#1024: ! :pg#112320:bh#1024:fh#1024: ! :ph#131520:bh#1024:fh#1024: # RM05: rm05|RM05|cdc9766|CDC9766|9766|DEC RM05, CDC 9766:\ *************** *** 156,176 **** rk06|RK06|DEC RK06:\ :ty=removable:ns#22:nt#3:nc#411:sf:\ :b0=/mdec/hkuboot:\ ! :pa#5940:ba#1024:fa#1024:\ ! :pb#2376:bb#1024:fb#1024:\ ! :pd#18662:bd#1024:fd#1024:\ ! :pe#8316:be#1024:fe#1024:\ ! :pg#26978:bg#1024:fg#1024: rk07|RK07|DEC RK07:\ :ty=removable:ns#22:nt#3:nc#815:sf:bt=hkuboot:\ :b0=/mdec/hkuboot:\ ! :pa#5940:ba#1024:fa#1024:\ ! :pb#2376:bb#1024:fb#1024:\ ! :pc#45326:bc#1024:fc#1024:\ ! :pd#18662:bd#1024:fd#1024:\ ! :pe#8316:be#1024:fe#1024:\ ! :pg#26978:bg#1024:fg#1024:\ ! :ph#53642:bh#1024:fh#1024: rl01|RL01|DEC RL01:\ :ty=removable:se#256:ns#40:nt#2:nc#256:\ --- 158,176 ---- rk06|RK06|DEC RK06:\ :ty=removable:ns#22:nt#3:nc#411:sf:\ :b0=/mdec/hkuboot:\ ! :pa#8316:ba#1024:fa#1024:\ ! :pb#8316:bb#1024:fb#1024:\ ! :pc#27126:bg#1024:fg#1024: ! :pg#10428:bg#1024:fg#1024: ! :ph#27060:bg#1024:fg#1024: rk07|RK07|DEC RK07:\ :ty=removable:ns#22:nt#3:nc#815:sf:bt=hkuboot:\ :b0=/mdec/hkuboot:\ ! :pa#8316:ba#1024:fa#1024:\ ! :pb#8316:bb#1024:fb#1024:\ ! :pc#53790:bc#1024:fc#1024:\ ! :pg#37092:bg#1024:fg#1024:\ ! :ph#53724:bh#1024:fh#1024: rl01|RL01|DEC RL01:\ :ty=removable:se#256:ns#40:nt#2:nc#256:\ *** /usr/src/sys/pdpdist/netstart.old Mon Aug 27 14:23:49 1990 --- /usr/src/sys/pdpdist/netstart Thu Dec 24 18:21:36 1992 *************** *** 2,14 **** # @(#)netstart 5.2 (Berkeley) 7/16/88 ! UCB_NET=`/etc/testnet` ! if [ $UCB_NET = YES ]; then echo Assuming NETWORKING system ... >/dev/console 2>&1 else echo Assuming non-networking system ... >/dev/console 2>&1 fi ! export UCB_NET # DON'T EVEN THINK ABOUT RUNNING ROUTED ON A PDP-11!!! Just set routedflags # to "NO" and set up a default gateway below. --- 2,14 ---- # @(#)netstart 5.2 (Berkeley) 7/16/88 ! INET=`/etc/testnet` ! if [ $INET = YES ]; then echo Assuming NETWORKING system ... >/dev/console 2>&1 else echo Assuming non-networking system ... >/dev/console 2>&1 fi ! export INET # DON'T EVEN THINK ABOUT RUNNING ROUTED ON A PDP-11!!! Just set routedflags # to "NO" and set up a default gateway below. *************** *** 30,36 **** hostname $hostname >/dev/console 2>&1 hostid $hostname >/dev/console 2>&1 ! if [ $UCB_NET = YES ]; then # /etc/ifconfig imp0 inet netmask $netmask $hostname broadcast $broadcast up -trailers >/dev/console 2>&1 # /etc/ifconfig en0 inet netmask $netmask $hostname broadcast $broadcast up -trailers >/dev/console 2>&1 # /etc/ifconfig il0 inet netmask $netmask $hostname broadcast $broadcast up -trailers >/dev/console 2>&1 --- 30,36 ---- hostname $hostname >/dev/console 2>&1 hostid $hostname >/dev/console 2>&1 ! if [ $INET = YES ]; then # /etc/ifconfig imp0 inet netmask $netmask $hostname broadcast $broadcast up -trailers >/dev/console 2>&1 # /etc/ifconfig en0 inet netmask $netmask $hostname broadcast $broadcast up -trailers >/dev/console 2>&1 # /etc/ifconfig il0 inet netmask $netmask $hostname broadcast $broadcast up -trailers >/dev/console 2>&1 *** /usr/src/sys/pdpdist/rc.old Mon Aug 27 14:28:09 1990 --- /usr/src/sys/pdpdist/rc Thu Dec 24 18:21:55 1992 *************** *** 87,96 **** rm -f /usr/spool/uucp/STST/* chmod 666 /dev/tty[pqrs]* ! # set hostname and UCB_NET, turn on network . /etc/netstart ! if [ $UCB_NET = YES ]; then echo 'starting system logger' >/dev/console 2>&1 rm -f /dev/log syslogd --- 87,96 ---- rm -f /usr/spool/uucp/STST/* chmod 666 /dev/tty[pqrs]* ! # set hostname and INET, turn on network . /etc/netstart ! if [ $INET = YES ]; then echo 'starting system logger' >/dev/console 2>&1 rm -f /dev/log syslogd *************** *** 114,120 **** accton /usr/adm/acct; echo -n ' accounting' >/dev/console 2>&1 echo '.' >/dev/console 2>&1 ! if [ $UCB_NET = YES ]; then echo -n starting network daemons: >/dev/console 2>&1 # $routedflags is imported from /etc/netstart; --- 114,120 ---- accton /usr/adm/acct; echo -n ' accounting' >/dev/console 2>&1 echo '.' >/dev/console 2>&1 ! if [ $INET = YES ]; then echo -n starting network daemons: >/dev/console 2>&1 # $routedflags is imported from /etc/netstart; *** /usr/src/sys/pdpdist/rc.local.old Sun Nov 18 14:21:11 1990 --- /usr/src/sys/pdpdist/rc.local Thu Dec 24 18:22:07 1992 *************** *** 7,18 **** chmod 666 /etc/motd echo -n starting local daemons: >/dev/console 2>&1 ! #if [ $UCB_NET = YES -a -f /etc/timed ]; then # timed & echo -n ' timed' >/dev/console 2>&1 #fi if [ -f /usr/lib/sendmail ]; then (cd /usr/spool/mqueue; rm -f lf*) ! if [ $UCB_NET = YES ]; then /usr/lib/sendmail -bd -q30m; echo -n ' sendmail'>/dev/console 2>&1 else /usr/lib/sendmail -q30m; echo -n ' sendmail' >/dev/console 2>&1 --- 7,18 ---- chmod 666 /etc/motd echo -n starting local daemons: >/dev/console 2>&1 ! #if [ $INET = YES -a -f /etc/timed ]; then # timed & echo -n ' timed' >/dev/console 2>&1 #fi if [ -f /usr/lib/sendmail ]; then (cd /usr/spool/mqueue; rm -f lf*) ! if [ $INET = YES ]; then /usr/lib/sendmail -bd -q30m; echo -n ' sendmail'>/dev/console 2>&1 else /usr/lib/sendmail -q30m; echo -n ' sendmail' >/dev/console 2>&1