1: /* 2: * System parameters. 3: * 4: * This file is copied into each directory where we compile 5: * the kernel; it should be modified there to suit local taste 6: * if necessary. 7: * 8: */ 9: #include "param.h" 10: #include <sys/systm.h> 11: #include <sys/buf.h> 12: #include <sys/tty.h> 13: #include <sys/conf.h> 14: #include <sys/proc.h> 15: #include <sys/text.h> 16: #include <sys/dir.h> 17: #include <sys/user.h> 18: #include <sys/file.h> 19: #include <sys/inode.h> 20: #include <sys/filsys.h> 21: #include <sys/mount.h> 22: #include <sys/callout.h> 23: #include <sys/acct.h> 24: #include <sys/map.h> 25: #include <sys/seg.h> 26: 27: #define HZ 60 /* Ticks/second of the clock */ 28: #define TIMEZONE (%TIMEZONE% * 60) /* Minutes westward from Greenwich */ 29: #define DSTFLAG %DST% /* Daylight Saving Time applies here */ 30: 31: #define NBUF (12 + (2 * MAXUSERS)) /* size of buffer cache, must be <=256*/ 32: #define NMOUNT 5 /* number of mountable file systems */ 33: 34: #ifdef UCB_CLIST 35: # ifdef UNIBUS_MAP 36: # define NCLIST 500 /* number of clists, must be <= 512 */ 37: # else 38: # define NCLIST 200 /* number of clists */ 39: # endif 40: #else UCB_CLIST 41: # define NCLIST 100 /* number of clists */ 42: #endif UCB_CLIST 43: 44: #define NPROC (10 + (7 * MAXUSERS)) /* max number of processes */ 45: #define NTEXT (20 + ((3*MAXUSERS) / 2)) /* max number of pure texts */ 46: #define NINODE (NPROC + 20 + (2 * MAXUSERS)) /* number of in-core inodes */ 47: #define NFILE ((8 * NINODE/10) + 5) /* number of file structures */ 48: #define NCALL (4 + MAXUSERS) /* max simultaneous time callouts */ 49: #define NDISK 3 /* number of disks to monitor */ 50: 51: #ifndef UNIBUS_MAP 52: # define CMAPSIZ NPROC /* size of core allocation map */ 53: # define SMAPSIZ (NPROC+(5*NTEXT/10)) /* size of swap allocation map */ 54: #else 55: # define CMAPSIZ (NPROC+(8*NTEXT/10)) /* size of core allocation map */ 56: # define SMAPSIZ (NPROC+(8*NTEXT/10)) /* size of swap allocation map */ 57: #endif 58: 59: int maxusers = MAXUSERS; 60: int hz = HZ; 61: int timezone = TIMEZONE; 62: bool_t dstflag = DSTFLAG; 63: int nmount = NMOUNT; 64: int nfile = NFILE; 65: int ninode = NINODE; 66: int nproc = NPROC; 67: int ntext = NTEXT; 68: int nbuf = NBUF; 69: int nclist = NCLIST; 70: int ncallout = NCALL; 71: int ndisk = NDISK; 72: int cmapsiz = CMAPSIZ; 73: int smapsiz = SMAPSIZ; 74: 75: struct mount mount[NMOUNT]; 76: struct inode inode[NINODE]; 77: struct buf buf[NBUF]; 78: struct callout callout[NCALL + 1]; /* last one used as a delimiter */ 79: struct buf bfreelist; 80: #ifndef UCB_CLIST 81: struct cblock cfree[NCLIST]; 82: #else 83: unsigned clstdesc = ((((btoc(NCLIST*sizeof(struct cblock)))-1) << 8) | RW); 84: #endif 85: long dk_time[1 << (NDISK)]; 86: long dk_numb[NDISK]; 87: long dk_wds[NDISK]; 88: 89: struct mapent _coremap[CMAPSIZ]; 90: struct map coremap[1] = { 91: _coremap, 92: &_coremap[CMAPSIZ], 93: "coremap" 94: }; 95: 96: struct mapent _swapmap[SMAPSIZ]; 97: struct map swapmap[1] = { 98: _swapmap, 99: &_swapmap[SMAPSIZ], 100: "swapmap" 101: }; 102: 103: struct mount *mountNMOUNT = &mount[NMOUNT]; 104: struct file *fileNFILE = &file[NFILE]; 105: struct inode *inodeNINODE = &inode[NINODE]; 106: struct proc *procNPROC = &proc[NPROC]; 107: struct text *textNTEXT = &text[NTEXT]; 108: /* callNCALL points to the last slot, which must be a terminator */ 109: struct callout *callNCALL = &callout[NCALL]; 110: 111: #ifdef UCB_METER 112: char counted[NTEXT]; 113: #endif 114: 115: int bsize = BSIZE + BSLOP; /* size of buffers */ 116: 117: #ifdef ACCT 118: struct acct acctbuf; 119: struct inode *acctp; 120: #endif 121: 122: char msgbuf[MSGBUFS] = {"\0"}; 123: 124: /* 125: * Declarations of structures loaded last and allowed to 126: * reside in the 0120000-140000 range (where buffers and clists are 127: * mapped). These structures must be extern everywhere else, 128: * and the asm output of cc is edited to move these structures 129: * from comm to bss (which is last) (see the script :comm-to-bss). 130: */ 131: int remap_area; /* start of possibly mapped area; must be first */ 132: struct proc proc[NPROC]; 133: struct file file[NFILE]; 134: struct text text[NTEXT];