From a53ab6ba2b80fa9be5728ab150e9ef32ae26ad96 Mon Sep 17 00:00:00 2001 From: Bill Joy Date: Wed, 27 Aug 1980 15:36:27 -0800 Subject: [PATCH] buffers allocated in sysmap SCCS-vsn: sys/vax/vax/machdep.c 3.14 SCCS-vsn: sys/kern/init_main.c 3.11 SCCS-vsn: sys/vax/vax/locore.s 3.13 --- usr/src/sys/kern/init_main.c | 7 ++++--- usr/src/sys/vax/vax/locore.s | 16 ++++++++-------- usr/src/sys/vax/vax/machdep.c | 24 ++++++++++++++++++++---- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/usr/src/sys/kern/init_main.c b/usr/src/sys/kern/init_main.c index 4e0ce69f82..a96849b334 100644 --- a/usr/src/sys/kern/init_main.c +++ b/usr/src/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* init_main.c 3.10 %G% */ +/* init_main.c 3.11 %G% */ #include "../h/param.h" #include "../h/systm.h" @@ -170,14 +170,15 @@ iinit() * as arguments to the I/O routines to describe * I/O to be done-- e.g. swap headers swbuf[] for * swapping. + * + * These are actually allocated kernel map slots and space is + * allocated in locore.s for them. */ char buffers[NBUF][BSIZE]; /* * Initialize the buffer I/O system by freeing * all buffers and setting all device buffer lists to empty. - * - * SHOULD USE MEMALL HERE!!! */ binit() { diff --git a/usr/src/sys/vax/vax/locore.s b/usr/src/sys/vax/vax/locore.s index ece34d5428..2a4166c0bb 100644 --- a/usr/src/sys/vax/vax/locore.s +++ b/usr/src/sys/vax/vax/locore.s @@ -1,7 +1,7 @@ # # Machine Language Assist for UC Berkeley Virtual Vax/Unix # -# locore.s 3.12 %G% +# locore.s 3.13 %G% # .set HIGH,31 # mask for total disable @@ -542,6 +542,12 @@ _mmap: .globl _vmmap .set _vmmap,((_mmap-_Sysmap)/4)*NBPG+0x80000000 + .globl _bufmap +_bufmap: + .space 4*NBUF*CLSIZE + .globl _buffers + .set _buffers,((_bufmap-_Sysmap)/4)*NBPG+0x80000000 + .globl eSysmap eSysmap: .set Syssize,(eSysmap-_Sysmap)/4 .text @@ -813,7 +819,7 @@ start: movab _mcrmap,r2 bisl3 $PG_V|PG_KW,r1,(r2) # -# Initialize I/O space page table entries +# Initialize UNIBUS page table entries # movl $PHYSUBA/NBPG,r1 # page frame number for uba movab UBA0map,r2 # page table address @@ -1353,12 +1359,6 @@ ZERmsg: .asciz "ZERO VECTOR " # Junk. # -# these should be memall'ed - .data - .globl _buffers - .align PGSHIFT -_buffers: .space NBUF*BSIZE - # # This is needed when running old-style switch code. # Be sure to enable setting of idleflag in interrupt code above also. diff --git a/usr/src/sys/vax/vax/machdep.c b/usr/src/sys/vax/vax/machdep.c index 477dcec6b8..26fd34232e 100644 --- a/usr/src/sys/vax/vax/machdep.c +++ b/usr/src/sys/vax/vax/machdep.c @@ -1,4 +1,5 @@ -/* machdep.c 3.13 %G% */ +/* machdep.c 3.14 %G% */ +extern cmap,ecmap; #include "../h/param.h" #include "../h/systm.h" @@ -14,7 +15,7 @@ #include "../h/psl.h" #include "../h/uba.h" -char version[] = "VM/UNIX (Berkeley Version 3.13) %H% \n"; +char version[] = "VM/UNIX (Berkeley Version 3.14) %H% \n"; int icode[] = { 0x9f19af9f, /* pushab [&"init.vm",0]; pushab */ @@ -36,6 +37,8 @@ int memchk(); startup(firstaddr) { register int unixsize; + register int i; + register struct pte *pte; /* * Good {morning,afternoon,evening,night}. @@ -45,17 +48,30 @@ startup(firstaddr) printf("real mem = %d\n", ctob(maxmem)); /* - * Allow for the u. area of process 0. + * Allow for the u. area of process 0 and its (single) + * page of page tables. */ + printf("firstaddr %X unixsize %X, cmap %X, ecmap %X\n", firstaddr, unixsize, cmap, ecmap); unixsize = (firstaddr+UPAGES+1); + + /* + * Initialze buffers + */ + pte = bufmap; + for (i = 0; i < NBUF * CLSIZE; i++) + *(int *)pte++ = PG_V | PG_KW | unixsize++; + mtpr(TBIA, 1); + +#ifdef ERNIE if (coresw) maxmem = 4096; +#endif /* * Initialize maps. */ meminit(unixsize, maxmem); - maxmem -= (unixsize+1); + maxmem = freemem; printf("avail mem = %d\n", ctob(maxmem)); mfree(kernelmap, USRPTSIZE, 1); ubainit(); -- 2.20.1