1: /* 2: * Copyright (c) 1986 Regents of the University of California. 3: * All rights reserved. The Berkeley software License Agreement 4: * specifies the terms and conditions for redistribution. 5: * 6: * @(#)systm.h 1.3 (2.11BSD GTE) 1996/5/9 7: */ 8: 9: #ifndef SUPERVISOR 10: 11: /* 12: * The `securelevel' variable controls the security level of the system. 13: * It can only be decreased by process 1 (/sbin/init). 14: * 15: * Security levels are as follows: 16: * -1 permannently insecure mode - always run system in level 0 mode. 17: * 0 insecure mode - immutable and append-only flags make be turned off. 18: * All devices may be read or written subject to permission modes. 19: * 1 secure mode - immutable and append-only flags may not be changed; 20: * raw disks of mounted filesystems, /dev/mem, and /dev/kmem are 21: * read-only. 22: * 2 highly secure mode - same as (1) plus raw disks are always 23: * read-only whether mounted or not. This level precludes tampering 24: * with filesystems by unmounting them, but also inhibits running 25: * newfs while the system is secured. 26: * 27: * In normal operation, the system runs in level 0 mode while single user 28: * and in level 1 mode while multiuser. If level 2 mode is desired while 29: * running multiuser, it can be set in the multiuser startup script 30: * (/etc/rc.local) using sysctl(8). If it is desired to run the system 31: * in level 0 mode while multiuser, initialize the variable securelevel 32: * in /sys/kern/kern_sysctl.c to -1. Note that it is NOT initialized to 33: * zero as that would allow the vmunix binary to be patched to -1. 34: * Without initialization, securelevel loads in the BSS area which only 35: * comes into existence when the kernel is loaded and hence cannot be 36: * patched by a stalking hacker. 37: */ 38: extern int securelevel; /* system security level */ 39: 40: extern char version[]; /* system version */ 41: 42: /* 43: * Nblkdev is the number of entries (rows) in the block switch. 44: * Used in bounds checking on major device numbers. 45: */ 46: int nblkdev; 47: 48: /* 49: * Number of character switch entries. 50: */ 51: int nchrdev; 52: 53: int mpid; /* generic for unique process id's */ 54: char runin; /* scheduling flag */ 55: char runout; /* scheduling flag */ 56: int runrun; /* scheduling flag */ 57: char curpri; /* more scheduling */ 58: 59: u_int maxmem; /* actual max memory per process */ 60: 61: u_int nswap; /* size of swap space */ 62: int updlock; /* lock for sync */ 63: daddr_t rablock; /* block to be read ahead */ 64: dev_t rootdev; /* device of the root */ 65: dev_t dumpdev; /* device to take dumps on */ 66: long dumplo; /* offset into dumpdev */ 67: dev_t swapdev; /* swapping device */ 68: dev_t pipedev; /* pipe device */ 69: int nodev(); /* no device function used in bdevsw/cdevsw */ 70: 71: extern int icode[]; /* user init code */ 72: extern int szicode; /* its size */ 73: 74: daddr_t bmap(); 75: 76: ubadr_t clstaddr; /* UNIBUS virtual address of clists */ 77: 78: extern int cputype; /* type of cpu = 40, 44, 45, 60, or 70 */ 79: 80: /* 81: * Structure of the system-entry table 82: */ 83: extern struct sysent 84: { 85: char sy_narg; /* total number of arguments */ 86: int (*sy_call)(); /* handler */ 87: } sysent[]; 88: 89: int noproc; /* no one is running just now */ 90: char *panicstr; 91: int boothowto; /* reboot flags, from boot */ 92: int selwait; 93: 94: /* casts to keep lint happy */ 95: #ifdef lint 96: #define insque(q,p) _insque((caddr_t)q,(caddr_t)p) 97: #define remque(q) _remque((caddr_t)q) 98: #endif 99: 100: extern bool_t sep_id; /* separate I/D */ 101: extern char regloc[]; /* offsets of saved user registers (trap.c) */ 102: #endif