rearrange for kirk
[unix-history] / usr / src / sys / kern / init_main.c
index d21b297..61df8e3 100644 (file)
@@ -1,4 +1,4 @@
-/*     init_main.c     4.14    81/04/23        */
+/*     init_main.c     4.27    82/03/14        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -20,6 +20,9 @@
 #include "../h/text.h"
 #include "../h/vlimit.h"
 #include "../h/clist.h"
 #include "../h/text.h"
 #include "../h/vlimit.h"
 #include "../h/clist.h"
+#ifdef INET
+#include "../h/protosw.h"
+#endif
 
 /*
  * Initialization code.
 
 /*
  * Initialization code.
@@ -44,6 +47,7 @@ main(firstaddr)
        register struct proc *p;
 
        rqinit();
        register struct proc *p;
 
        rqinit();
+#include "loop.h"
        startup(firstaddr);
 
        /*
        startup(firstaddr);
 
        /*
@@ -76,13 +80,19 @@ main(firstaddr)
        clkstart();
 
        /*
        clkstart();
 
        /*
-        * Initialize devices and
-        * set up 'known' i-nodes
+        * Initialize tables, protocols, and set up well-known inodes.
         */
         */
-
+       mbinit();
+       cinit();                        /* needed by dmc-11 driver */
+#ifdef INET
+       pfinit();
+#if NLOOP > 0
+       loattach();                     /* XXX */
+#endif
+       ifinit();
+#endif
        ihinit();
        bhinit();
        ihinit();
        bhinit();
-       cinit();
        binit();
        bswinit();
        iinit();
        binit();
        bswinit();
        iinit();
@@ -105,7 +115,6 @@ main(firstaddr)
         * table so that it can map dirty pages into
         * its address space during asychronous pushes.
         */
         * table so that it can map dirty pages into
         * its address space during asychronous pushes.
         */
-
        mpid = 1;
        proc[0].p_szpt = clrnd(ctopt(nswbuf*CLSIZE*KLMAX + UPAGES));
        proc[1].p_stat = SZOMB;         /* force it to be in proc slot 2 */
        mpid = 1;
        proc[0].p_szpt = clrnd(ctopt(nswbuf*CLSIZE*KLMAX + UPAGES));
        proc[1].p_stat = SZOMB;         /* force it to be in proc slot 2 */
@@ -214,6 +223,8 @@ binit()
                nswdev++;
        if (nswdev == 0)
                panic("binit");
                nswdev++;
        if (nswdev == 0)
                panic("binit");
+       if (nswdev > 1)
+               nswap = (nswap/DMMAX)*DMMAX;
        nswap *= nswdev;
        maxpgio *= nswdev;
        swfree(0);
        nswap *= nswdev;
        maxpgio *= nswdev;
        swfree(0);