Subject: kernel 'config', autoconfig, documentation changes (#94, 6 of 12) Index: sys,doc,etc,pdpif,.../many 2.11BSD Description: This is part 6 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/h/conf.h /usr/src/sys/h/kernel.h /usr/src/sys/h/map.h /usr/src/sys/h/param.h /usr/src/sys/h/protosw.h /usr/src/sys/h/quota.h /usr/src/sys/h/systm.h /usr/src/sys/h/text.h /usr/src/sys/h/uba.h in 'conf.h' a new member is added to the bdevsw[] table for determining partition sizes of discs at boot time. In all .h files references to UNIBUS_MAP have been removed because support for the Unibus Map is now a standard feature. References to UCB_FRCSWAP have been removed because the feature has been deleted. References to UCB_NET have been replaced with INET. MAXMEM has been moved to param.h *** /usr/src/sys/h/conf.h.old Sun Sep 22 07:48:39 1991 --- /usr/src/sys/h/conf.h Wed Dec 23 20:17:35 1992 *************** *** 3,9 **** * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)conf.h 1.2 (2.11BSD Berkeley) 9/22/91 */ /* --- 3,9 ---- * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)conf.h 1.3 (2.11BSD Berkeley) 12/23/92 */ /* *************** *** 21,26 **** --- 21,27 ---- int (*d_close)(); int (*d_strategy)(); int (*d_root)(); /* XXX root attach routine */ + daddr_t (*d_psize)(); int d_flags; }; *** /usr/src/sys/h/kernel.h.old Sat Dec 24 20:23:35 1988 --- /usr/src/sys/h/kernel.h Thu Dec 24 15:56:05 1992 *************** *** 3,9 **** * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)kernel.h 1.1 (2.10BSD Berkeley) 12/1/86 */ /* --- 3,9 ---- * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)kernel.h 1.2 (2.11BSD GTE) 12/24/92 */ /* *************** *** 33,41 **** #ifdef CGL_RTP int wantrtp; /* set when the real-time process is runnable */ - #endif - #ifdef UCB_FRCSWAP - int idleflg; /* if set, allow incore forks and expands */ - /* set before idle(), cleared per second by clock */ #endif #endif --- 33,37 ---- *** /usr/src/sys/h/map.h.old Mon Jul 4 12:06:33 1988 --- /usr/src/sys/h/map.h Sun Jan 3 00:44:06 1993 *************** *** 38,44 **** #ifdef KERNEL extern struct map coremap[1]; /* space for core allocation */ extern struct map swapmap[1]; /* space for swap allocation */ - #ifdef UNIBUS_MAP extern struct map ub_map[1]; /* space for UNIBUS allocation */ - #endif #endif --- 38,42 ---- *** /usr/src/sys/h/param.h.old Thu Dec 26 23:31:54 1991 --- /usr/src/sys/h/param.h Sat Dec 26 16:32:37 1992 *************** *** 3,9 **** * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)param.h 1.1 (2.10BSD Berkeley) 12/1/86 */ #define BSD 210 /* 2.10 * 10, as cpp doesn't do floats */ --- 3,9 ---- * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)param.h 1.2 (2.11BSD GTE) 12/24/92 */ #define BSD 210 /* 2.10 * 10, as cpp doesn't do floats */ *************** *** 137,142 **** */ #define MAXHOSTNAMELEN 64 ! #if defined(KERNEL) && defined(UCB_NET) #include "../machine/net_mac.h" #endif --- 137,147 ---- */ #define MAXHOSTNAMELEN 64 ! #if defined(KERNEL) && defined(INET) #include "../machine/net_mac.h" #endif + + /* + * MAXMEM is the maximum core per process is allowed. First number is Kb. + */ + #define MAXMEM (300*16) *** /usr/src/sys/h/protosw.h.old Wed Apr 27 09:01:07 1988 --- /usr/src/sys/h/protosw.h Thu Dec 24 16:42:53 1992 *************** *** 184,189 **** }; #endif ! #if defined(KERNEL) && defined(UCB_NET) && defined(SUPERVISOR) extern struct protosw *pffindproto(), *pffindtype(); #endif --- 184,189 ---- }; #endif ! #if defined(KERNEL) && defined(INET) && defined(SUPERVISOR) extern struct protosw *pffindproto(), *pffindtype(); #endif *** /usr/src/sys/h/quota.h.old Fri Apr 29 21:33:42 1988 --- /usr/src/sys/h/quota.h Thu Dec 24 16:44:47 1992 *************** *** 143,149 **** u_char dw_iwarn; }; ! #if defined(KERNEL) && defined(QUOTA) && defined(BSD2_10) && !defined(SUPERVISOR) #include "../machine/seg.h" struct qhash { --- 143,149 ---- u_char dw_iwarn; }; ! #if defined(KERNEL) && defined(QUOTA) && !defined(SUPERVISOR) #include "../machine/seg.h" struct qhash { *** /usr/src/sys/h/systm.h.old Fri Apr 29 21:33:49 1988 --- /usr/src/sys/h/systm.h Thu Dec 24 00:51:07 1992 *************** *** 33,39 **** u_int maxmem; /* actual max memory per process */ ! int nswap; /* size of swap space */ int updlock; /* lock for sync */ daddr_t rablock; /* block to be read ahead */ dev_t rootdev; /* device of the root */ --- 33,39 ---- u_int maxmem; /* actual max memory per process */ ! u_int nswap; /* size of swap space */ int updlock; /* lock for sync */ daddr_t rablock; /* block to be read ahead */ dev_t rootdev; /* device of the root */ *************** *** 40,52 **** dev_t dumpdev; /* device to take dumps on */ long dumplo; /* offset into dumpdev */ dev_t swapdev; /* swapping device */ - daddr_t swplo; /* block number of swap space */ dev_t pipedev; /* pipe device */ - #ifdef BSD2_10 extern int icode[]; /* user init code */ extern int szicode; /* its size */ - #endif daddr_t bmap(); --- 40,49 ---- *************** *** 76,80 **** extern bool_t sep_id; /* separate I/D */ extern char regloc[]; /* offsets of saved user registers (trap.c) */ - extern int bsize; /* size of buffers */ #endif --- 73,76 ---- *** /usr/src/sys/h/text.h.old Fri Apr 29 21:33:55 1988 --- /usr/src/sys/h/text.h Thu Dec 24 00:45:47 1992 *************** *** 16,22 **** { struct text *x_forw; /* forward link in free list */ struct text **x_back; /* backward link in free list */ ! short x_daddr; /* segment's disk address (relative to swplo) */ short x_caddr; /* core address, if loaded */ size_t x_size; /* size (clicks) */ struct inode *x_iptr; /* inode of prototype */ --- 16,22 ---- { struct text *x_forw; /* forward link in free list */ struct text **x_back; /* backward link in free list */ ! short x_daddr; /* segment's disk address */ short x_caddr; /* core address, if loaded */ size_t x_size; /* size (clicks) */ struct inode *x_iptr; /* inode of prototype */ *** /usr/src/sys/h/uba.h.old Sat Apr 6 00:06:21 1991 --- /usr/src/sys/h/uba.h Sun Jan 3 00:43:24 1993 *************** *** 3,9 **** * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)uba.h 1.1 (2.10BSD Berkeley) 12/1/86 */ /* --- 3,9 ---- * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)uba.h 1.2 (2.11BSD GTE) 1/3/93 */ /* *************** *** 72,79 **** #ifdef KERNEL extern short ubmap; /* Do we have UNIBUS registers? */ extern memaddr bpaddr; /* physical click-address of buffers */ - #ifdef UNIBUS_MAP extern struct map ub_map[]; extern int ub_wantmr; - #endif #endif --- 72,77 ----