|
|
1.1 ! root 1: .\" Copyright (c) 1986 Regents of the University of California. ! 2: .\" All rights reserved. The Berkeley software License Agreement ! 3: .\" specifies the terms and conditions for redistribution. ! 4: .\" ! 5: .\" @(#)sys.t 1.7 (Berkeley) 4/11/86 ! 6: .\" ! 7: .NH ! 8: Changes in the kernel proper ! 9: .PP ! 10: The next several sections describe changes in the parts of the kernel ! 11: that reside in \fB/sys/sys\fP. ! 12: This section summarizes several of the changes that impact ! 13: several different areas. ! 14: .NH 2 ! 15: Process table management ! 16: .PP ! 17: Although the process table has grown considerably since its original ! 18: design, its use was largely the same as in its first incarnation. ! 19: Several parts of the system used a linear search of the entire ! 20: table to locate a process, a group of processes, or group of processes ! 21: in a certain state. ! 22: 4.2BSD maintained linkages between the children of each parent process, ! 23: but made no use of these pointers. ! 24: In order to reduce the time spent examining the process table, ! 25: several changes have been made. ! 26: The first is to place all process table entries onto one of three ! 27: doubly-linked lists, ! 28: one each for entries in use by existing processes (\fIallproc\fP), ! 29: entries for zombie processes (\fIzombproc\fP), and free entries ! 30: (\fIfreeproc\fP). ! 31: This allows the scheduler and other facilities that must examine all ! 32: existing processes to limit their search to those entries actually in use. ! 33: Other searches are avoided by using the linkage among the children ! 34: of each process and by noting a range of usable process ID's when searching ! 35: for a new unique ID. ! 36: .NH 2 ! 37: Signals ! 38: .PP ! 39: One of the major incompatibilities introduced in 4.2BSD ! 40: was that system calls interrupted by a caught signal were restarted. ! 41: This facility, while necessary for many programs that use signals to drive ! 42: background activities without disrupting the foreground processing, ! 43: caused problems for other, more naive, programs. ! 44: In order to resolve this difficulty, the 4.2BSD signal model has been ! 45: extended to allow signal handlers to specify whether or not the signal ! 46: is to abort or to resume interrupted system calls. ! 47: This option is specified with the \fIsigvec\fP call used to specify the handler. ! 48: The \fIsv_onstack\fP field has been usurped for a flag field, ! 49: with flags available to indicate whether the handler should be invoked ! 50: on the signal stack and whether it should interrupt pending system calls ! 51: on its return. ! 52: As a result of this change, those system calls that may be restarted ! 53: and that therefore take control over system call interruptions ! 54: must be modified to support this new behavior. ! 55: The calls affected in 4.3BSD are \fIopen\fP, \fIread\fP/\fIwrite\fP, ! 56: \fIioctl\fP, \fIflock\fP and \fIwait\fP. ! 57: .PP ! 58: Another change in signal usage in 4.3BSD affects fewer programs ! 59: and less kernel code. ! 60: In 4.2BSD, invocation of a signal handler on the signal stack caused ! 61: some of the saved status to be pushed onto the normal stack before ! 62: switching to the signal stack to build the call frame. ! 63: The status information on the normal stack included the saved PC and PSL; ! 64: this allowed a user-mode \fIrei\fP instruction to be used in implementing ! 65: the return to the interrupted context. ! 66: In order to avoid changes to the normal runtime stack when switching to ! 67: the signal stack, the return procedure has been changed. ! 68: As the return mechanism requires a special system call for restoring ! 69: the signal state, that system call was replaced with a new call, ! 70: \fIsigreturn\fP, that implements the complete return to the previous context. ! 71: The old call, number 139, remains in 4.3BSD for binary compatibility with ! 72: the 4.2BSD version of \fIlongjmp\fP. ! 73: .NH 2 ! 74: Open file handling ! 75: .PP ! 76: Previous versions of ! 77: .UX ! 78: have traditionally limited each process ! 79: to at most 20 files open simultaneously. ! 80: In 4.2BSD, that limit could not be increased past 30, ! 81: as a 5-bit field in the page table entry was used to specify ! 82: either a file number or the reserved values PGTEXT or PGZERO ! 83: (fill from text file or zero fill). ! 84: However, the file mapping facility that previously used this field ! 85: no longer existed, and its replacement is unlikely to require this low ! 86: limit. ! 87: Accordingly, the internal virtual memory system support for mapped files ! 88: has been removed and the number of open files increased. ! 89: The standard limit is 64, but this may easily be increased if sufficient ! 90: memory for the user structure is provided. ! 91: In order to avoid searching through this longer list of open files ! 92: when the actual number in use is small, ! 93: the index of the last used open file slot is maintained in the field ! 94: \fIu.u_lastfile\fP. ! 95: The routines that implement open and close or implicit close (\fIexit\fP ! 96: and \fIexec\fP) maintain this field, and it is used whenever ! 97: the open file array \fIu.u_ofile\fP is scanned. ! 98: .NH 2 ! 99: Niceness ! 100: .PP ! 101: The values for \fInice\fP used in 4.2BSD and previous systems ! 102: ranged from 0 though 39. ! 103: Each use of this scheduling parameter offset the actual value by the default, ! 104: NZERO (20). ! 105: This has been changed in 4.3BSD to use a range of -20 to 20, ! 106: with NZERO redefined as zero. ! 107: .NH 2 ! 108: Software interrupts and terminal multiplexors ! 109: .PP ! 110: The DH11 and DZ11 terminal multiplexor handlers had been modified ! 111: to use the hardware's received-character silo ! 112: when those devices were used by the Berknet network. ! 113: In order to avoid stagnation of input characters and slow response to input ! 114: during periods of reduced input, ! 115: the low-level software clock interrupt handler had been made to call ! 116: the terminal drivers to drain input. ! 117: When the clock rate was increased in 4.2BSD, the overhead of checking ! 118: the input silos with each clock tick was increased, ! 119: and the use of specialized network hardware reduced the need for this ! 120: optimization. ! 121: Therefore, the terminal multiplexors in 4.3BSD use per-character ! 122: interrupts during periods of low input rate, and enable the silos ! 123: only during periods of high-speed input. ! 124: While the silo is enabled, the routine to drain it runs less ! 125: frequently than every clock tick; it is scheduled ! 126: using the standard timeout mechanism. ! 127: As a result, the software clock service routine ! 128: need not to be invoked on every clock tick, but only when timeouts or ! 129: profiling require service.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.