summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* Pay attention to *all* errors from copyinstr(). This patch fixes a bugdg1994-08-241-8/+16
| | | | | that causes a no-panic instant reboot when bogus argv/envvs are fed to execve().
* Initialized v_writecount.dg1994-08-242-4/+6
|
* print "BUSY" instead of error number if filesystem was busy duringdg1994-08-222-10/+26
| | | | | vfs_unmountall() - this is the most common case. If it was a different error, then print the error number.
* Implemented filesystem clean bit via:dg1994-08-206-14/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | machdep.c: Changed printf's a little and call vfs_unmountall() if the sync was successful. cd9660_vfsops.c, ffs_vfsops.c, nfs_vfsops.c, lfs_vfsops.c: Allow dismount of root FS. It is now disallowed at a higher level. vfs_conf.c: Removed unused rootfs global. vfs_subr.c: Added new routines vfs_unmountall and vfs_unmountroot. Filesystems are now dismounted if the machine is properly rebooted. ffs_vfsops.c: Toggle clean bit at the appropriate places. Print warning if an unclean FS is mounted. ffs_vfsops.c, lfs_vfsops.c: Fix bug in selecting proper flags for VOP_CLOSE(). vfs_syscalls.c: Disallow dismounting root FS via umount syscall.
* 1) cleaned up after Garrett - fixed more redundant declarations, changeddg1994-08-202-4/+3
| | | | | | | | use of timeout_t -> timeout_func_t in aha1542 and aha1742 drivers. 2) fix a bug in the portalfs that was uncovered by better prototyping - specifically, the time must be converted from timeval to timespec before storing in va_atime. 3) fixed/added some miscellaneous prototypes
* Terry Lambert's loadable kernel module support w/improvements from thedg1994-08-195-7/+983
| | | | NetBSD group.
* Fix up some sloppy coding practices:wollman1994-08-1820-52/+107
| | | | | | | | | | | | - Delete redundant declarations. - Add -Wredundant-declarations to Makefile.i386 so they don't come back. - Delete sloppy COMMON-style declarations of uninitialized data in header files. - Add a few prototypes. - Clean up warnings resulting from the above. NB: ioconf.c will still generate a redundant-declaration warning, which is unavoidable unless somebody volunteers to make `config' smarter.
* Added support for TIOCSTAT ioctl. This allows shells that use raw/cbreakdg1994-08-181-1/+5
| | | | tty modes to process a control-T and do the right thing.
* Moved over my fix for vnode lossage when multiple TIOCSCTTY ioctls aredg1994-08-181-1/+10
| | | | | | done. This patch was extended to also include a suggested change by Kirk McKusick which allows the control tty to be reasigned to a different tty without losing a vnode.
* Made the kernel compile cleanly with gcc 2.6.0. Thanks go to Brucedg1994-08-131-3/+2
| | | | Evans for suggesting a method to detect various versions of gcc.
* Change all #includes to follow the current Berkeley style. Some of thesewollman1994-08-134-30/+30
| | | | | | | | | | | | | | | | | | | | | ``changes'' are actually not changes at all, but CVS sometimes has trouble telling the difference. This also includes support for second-directory compiles. This is not quite complete yet, as `config' doesn't yet do the right thing. You can still make it work trivially, however, by doing the following: rm /sys/compile mkdir /usr/obj/sys/compile ln -s M-. /sys/compile cd /sys/i386/conf config MYKERNEL cd ../../compile/MYKERNEL ln -s /sys @ rm machine ln -s @/i386/include machine make depend make
* Make it easier for programs to figure out what revision of FreeBSD theywollman1994-08-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | are running under. Here's how to bootstrap (order is important): 1) Re-compile gcc (just the driver is all you need). 2) Re-compile libc. 3) Re-compile your kernel. Reboot. 4) cd /usr/src/include; make install You can now detect the compilation environment with the following code: #if !defined(__FreeBSD__) #define __FreeBSD_version 199401 #elif __FreeBSD__ == 1 #define __FreeBSD_version 199405 #else #include <osreldate.h> #endif You can determine the run-time environment by calling the new C library function getosreldate(), or by examining the MIB variable kern.osreldate. For the time being, the release date is defined as 199409, which we have already established as our target.
* Handle NMI's in accordance with data in van Gilluwe book.wollman1994-08-101-2/+2
|
* Change default security level to -1, so that users don't get bitten bywollman1994-08-101-2/+2
| | | | upcoming makefile change.
* Made lockf advisory locking code generic (rather than ufs specific), anddg1994-08-081-0/+797
| | | | | | | use it in NFS. This is required both for diskless support and for POSIX compliance. Note: the support in NFS is only for the local node. Submitted by: based on work originally done by Yuval Yurom
* Run-time configuration of VFS update interval. Old UPDATE_INTERVALwollman1994-08-082-6/+16
| | | | configuration option is no longer supported.
* Detect the "EOF" condition. Specifically, end of partition.dg1994-08-081-1/+4
| | | | Submitted by: Bruce Evans
* Process tracing code. Written by Sean Eric Fagan.dg1994-08-081-30/+317
| | | | Submitted by: Sean Eric Fagan
* Changed B_AGE policy to work correctly in a world with relatively largedg1994-08-081-2/+2
| | | | buffer caches. The old policy generally ended up caching nothing.
* Define a sysctl MIB variable for the YP domain name.wollman1994-08-082-4/+12
|
* Made pmap_kenter "TLB safe". ...and then removed all the pmap_updates thatdg1994-08-071-3/+1
| | | | are no longer needed because of this.
* Provide support for upcoming merged VM/buffer cache, and fixed a few bugsdg1994-08-071-1/+5
| | | | | | that haven't appeared to manifest themselves (yet). Submitted by: John Dyson
* Incorporated post 1.1.5 work from John Dyson. This includes performancedg1994-08-062-34/+45
| | | | | | | | | improvements via the new routines pmap_qenter/pmap_qremove and pmap_kenter/ pmap_kremove. These routine allow fast mapping of pages for those architectures that have "normal" MMUs. Also included is a fix to the pageout daemon to properly check a queue end condition. Submitted by: John Dyson
* Implemented support for the "ps_strings" structure (grrrr...) for use indg1994-08-061-3/+19
| | | | the userland library libkvm.
* Process scheduling changes - adapted from FreeBSD 1.1.5. Basically,dg1994-08-062-2/+12
| | | | | | | | charge scheduling CPU of child process to the parent and have child inherit scheduling CPU from parent on fork. Makes a **big** difference in the feel of the system to interactive users. Submitted by: John Dyson
* Fixed bug that would cause free memory reserves to be depleted and cause adg1994-08-041-1/+5
| | | | | panic in some cases. Submitted by: John Dyson
* Added $Id$dg1994-08-0265-2/+77
|
* Removed all code related to the pagescan daemon, and changed 'act_count'dg1994-08-012-18/+5
| | | | adjustments to compensate for a world without the pagescan daemon.
* Allow for output processing routine to handle entire character bufferdg1994-08-011-2/+4
| | | | | | and thus not require a sleep/wakeup. Reviewed by: Submitted by:
* This commit was generated by cvs2svn to compensate for changes in r1802,phk1994-07-241-0/+310
|\ | | | | | | which included commits to RCS files with non-trunk default branches.
| * Reviewed by: phkphk1994-07-241-0/+310
| | | | | | | Imported libmd. This library contains MD2, MD4 and MD5. These three boggers pop up all over the place all of the time, so I decided we needed a library with them. In general they are used for security checks, so if you use them you want to link them static.
* Added code to allocate and deallocate a number of cblocks on open/close ofdg1994-07-061-0/+15
| | | | | | | | | a tty. Note that this might conflict with the collateral use of TS_WOPEN, but for the moment I can find no problems associated with this. (TS_WOPEN will likely go away in the future anyway). This should be looked at again in the future (the potential problem is that the cblock pool may either run out or accumulate too many cblocks).
* Fixed minor spelling error.dg1994-06-111-1/+1
|
* trap.c:dg1994-06-061-410/+383
| | | | | | | | | | Vastly improved trap.c from me. This rewritten version has a variety of features, amoung them: higher performance and much higher code quality. support.s, cpufunc.h: No longer use gs override to enforce range limits - compare directly against VM_MAXUSER_ADDRESS instead. The old way caused problems in preserving the gs selector...and this method is just as fast or faster.
* Don't panic if we can't malloc a cblock...just print a console messagedg1994-05-292-4/+8
| | | | and be happy.
* Changed mbuf allocation policy to get a cluster if size > MINCLSIZE. Makesdg1994-05-291-12/+3
| | | | a BIG difference in socket performance.
* Completed version of my clist management code. Requires hooks in tty.cdg1994-05-272-142/+498
| | | | | for adding and removing cblocks from the cfreelist queue (to give them back to malloc). I'll add those tomorrow.
* Moved header definitions to buf.h, and added missing splx() - founddg1994-05-261-52/+30
| | | | by Johannes Helander.
* The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.rgrimes1994-05-2560-700/+2899
| | | | | Reviewed by: Rodney W. Grimes Submitted by: John Dyson and David Greenman
* This commit was generated by cvs2svn to compensate for changes in r1541,rgrimes1994-05-2459-0/+28026
|\ | | | | | | which included commits to RCS files with non-trunk default branches.
| * BSD 4.4 Lite Kernel Sourcesrgrimes1994-05-2459-0/+28026
|
* BSD 4.4 Lite Kernel Sourcesrgrimes1994-05-2410-0/+6601
|
* Added ifdef for GPL_MATH_EMULATE to keep the sytem from panicing whengclarkii1994-04-291-4/+4
| | | | using it.
* Make Bruce happy: silently enter ddb on a BPT or trace trap if ddb isdg1994-04-071-1/+19
| | | | configured in the kernel.
* New interrupt code from Bruce Evans. In additional to Bruce's attacheddg1994-04-021-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | list of changes, I've made the following additional changes: 1) i386/include/ipl.h renamed to spl.h as the name conflicts with the file of the same name in i386/isa/ipl.h. 2) changed all use of *mask (i.e. netmask, biomask, ttymask, etc) to *_imask (net_imask, etc). 3) changed vestige of splnet use in if_is to splimp. 4) got rid of "impmask" completely (Bruce had gotten rid of netmask), and are now using net_imask instead. 5) dozens of minor cruft to glue in Bruce's changes. These require changes I made to config(8) as well, and thus it must be rebuilt. -DG from Bruce Evans: sio: o No diff is supplied. Remove the define of setsofttty(). I hope that is enough. *.s: o i386/isa/debug.h no longer exists. The event counters became too much trouble to maintain. All function call entry and exception entry counters can be recovered by using profiling kernel (the new profiling supports all entry points; however, it is too slow to leave enabled all the time; it also). Only BDBTRAP() from debug.h is now used. That is moved to exception.s. It might be worth preserving SHOW_BITS() and calling it from _mcount() (if enabled). o T_ASTFLT is now only set just before calling trap(). o All exception handlers set SWI_AST_MASK in cpl as soon as possible after entry and arrange for _doreti to restore it atomically with exiting. It is not possible to set it atomically with entering the kernel, so it must be checked against the user mode bits in the trap frame before committing to using it. There is no place to store the old value of cpl for syscalls or traps, so there are some complications restoring it. Profiling stuff (mostly in *.s): o Changes to kern/subr_mcount.c, gcc and gprof are not supplied yet. o All interesting labels `foo' are renamed `_foo' and all uninteresting labels `_bar' are renamed `bar'. A small change to gprof allows ignoring labels not starting with underscores. o MCOUNT_LABEL() is to provide names for counters for times spent in exception handlers. o FAKE_MCOUNT() is a version of MCOUNT() suitable for exception handlers. Its arg is the pc where the exception occurred. The new mcount() pretends that this was a call from that pc to a suitable MCOUNT_LABEL(). o MEXITCOUNT is to turn off any timer started by MCOUNT(). /usr/src/sys/i386/i386/exception.s: o The non-BDB BPTTRAP() macros were doing a sti even when interrupts were disabled when the trap occurred. The sti (fixed) sti is actually a no-op unless you have my changes to machdep.c that make the debugger trap gates interrupt gates, but fixing that would make the ifdefs messier. ddb seems to be unharmed by both interrupts always disabled and always enabled (I had the branch in the fix back to front for some time :-(). o There is no known pushal bug. o tf_err can be left as garbage for syscalls. /usr/src/sys/i386/i386/locore.s: o Fix and update BDE_DEBUGGER support. o ENTRY(btext) before initialization was dangerous. o Warm boot shot was longer than intended. /usr/src/sys/i386/i386/machdep.c: o DON'T APPLY ALL OF THIS DIFF. It's what I'm using, but may require other changes. Use the following: o Remove aston() and setsoftclock(). Maybe use the following: o No netisr.h. o Spelling fix. o Delay to read the Rebooting message. o Fix for vm system unmapping a reduced area of memory after bounds_check_with_label() reduces the size of a physical i/o for a partition boundary. A similar fix is required in kern_physio.c. o Correct use of __CONCAT. It never worked here for non- ANSI cpp's. Is it time to drop support for non-ANSI? o gdt_segs init. 0xffffffffUL is bogus because ssd_limit is not 32 bits. The replacement may have the same value :-), but is more natural. o physmem was one page too low. Confusing variable names. Don't use the following: o Better numbers of buffers. Each 8K page requires up to 16 buffer headers. On my system, this results in 5576 buffers containing [up to] 2854912 bytes of memory. The usual allocation of about 384 buffers only holds 192K of disk if you use it on an fs with a block size of 512. o gdt changes for bdb. o *TGT -> *IDT changes for bdb. o #ifdefed changes for bdb. /usr/src/sys/i386/i386/microtime.s: o Use the correct asm macros. I think asm.h was copied from Mach just for microtime and isn't used now. It certainly doesn't belong in <sys>. Various macros are also duplicated in sys/i386/boot.h and libc/i386/*.h. o Don't switch to and from the IRR; it is guaranteed to be selected (default after ICU init and explicitly selected in isa.c too, and never changed until the old microtime clobbered it). /usr/src/sys/i386/i386/support.s: o Non-essential changes (none related to spls or profiling). o Removed slow loads of %gs again. The LDT support may require not relying on %gs, but loading it is not the way to fix it! Some places (copyin ...) forgot to load it. Loading it clobbers the user %gs. trap() still loads it after certain types of faults so that fuword() etc can rely on it without loading it explicitly. Exception handlers don't restore it. If we want to preserve the user %gs, then the fastest method is to not touch it except for context switches. Comparing with VM_MAXUSER_ADDRESS and branching takes only 2 or 4 cycles on a 486, while loading %gs takes 9 cycles and using it takes another. o Fixed a signed branch to unsigned. /usr/src/sys/i386/i386/swtch.s: o Move spl0() outside of idle loop. o Remove cli/sti from idle loop. sw1 does a cli, and in the unlikely event of an interrupt occurring and whichqs becoming zero, sw1 will just jump back to _idle. o There's no spl0() function in asm any more, so use splz(). o swtch() doesn't need to be superaligned, at least with the new mcounting. o Fixed a signed branch to unsigned. o Removed astoff(). /usr/src/sys/i386/i386/trap.c: o The decentralized extern decls were inconsistent, of course. o Fixed typo MATH_EMULTATE in comments. */ o Removed unused variables. o Old netmask is now impmask; print it instead. Perhaps we should print some of the new masks. o BTW, trap() should not print anything for normal debugger traps. /usr/src/sys/i386/include/asmacros.h: o DON'T APPLY ALL OF THIS DIFF. Just use some of the null macros as necessary. /usr/src/sys/i386/include/cpu.h: o CLKF_BASEPRI() changes since cpl == SWI_AST_MASK is now normal while the kernel is running. o Don't use var++ to set boolean variables. It fails after a mere 4G times :-) and is slower than storing a constant on [3-4]86s. /usr/src/sys/i386/include/cpufunc.h: o DON'T APPLY ALL OF THIS DIFF. You need mainly the include of <machine/ipl.h>. Unfortunately, <machine/ipl.h> is needed by almost everything for the inlines. /usr/src/sys/i386/include/ipl.h: o New file. Defines spl inlines and SWI macros and declares most variables related to hard and soft interrupt masks. /usr/src/sys/i386/isa/icu.h: o Moved definitions to <machine/ipl.h> /usr/src/sys/i386/isa/icu.s: o Software interrupts (SWIs) and delayed hardware interrupts (HWIs) are now handled uniformally, and dispatching them from splx() is more like dispatching them from _doreti. The dispatcher is essentially *(handler[ffs(ipending & ~cpl)](). o More care (not quite enough) is taken to avoid unbounded nesting of interrupts. o The interface to softclock() is changed so that a trap frame is not required. o Fast interrupt handlers are now handled more uniformally. Configuration is still too early (new handlers would require bits in <machine/ipl.h> and functions to vector.s). o splnnn() and splx() are no longer here; they are inline functions (could be macros for other compilers). splz() is the nontrivial part of the old splx(). /usr/src/sys/i386/isa/ipl.h o New file. Supposed to have only bus-dependent stuff. Perhaps the h/w masks should be declared here. /usr/src/sys/i386/isa/isa.c: o DON'T APPLY ALL OF THIS DIFF. You need only things involving *mask and *MASK and comments about them. netmask is now a pure software mask. It works like the softclock mask. /usr/src/sys/i386/isa/vector.s: o Reorganize AUTO_EOI* macros. o Option FAST_INTR_HANDLER_USERS_ES for people who don't trust fastintr handlers. o fastintr handlers need to metamorphose into ordinary interrupt handlers if their SWI bit has become set. Previously, sio had unintended latency for handling output completions and input of SLIP framing characters because this was not done. /usr/src/sys/net/netisr.h: o The machine-dependent stuff is now imported from <machine/ipl.h>. /usr/src/sys/sys/systm.h o DON'T APPLY ALL OF THIS DIFF. You need mainly the different splx() prototype. The spl*() prototypes are duplicated as inlines in <machine/ipl.h> but they need to be duplicated here in case there are no inlines. I sent systm.h and cpufunc.h to Garrett. We agree that spl0 should be replaced by splnone and not the other way around like I've done. /usr/src/sys/kern/kern_clock.c o splsoftclock() now lowers cpl so the direct call to softclock() works as intended. o softclock() interface changed to avoid passing the whole frame (some machines may need another change for profile_tick()). o profiling renamed _profiling to avoid ANSI namespace pollution. (I had to improve the mcount() interface and may as well fix it.) The GUPROF variant doesn't actually reference profiling here, but the 'U' in GUPROF should mean to select the microtimer mcount() and not change the interface.
* From John Dyson: performance improvements to the new bounce bufferdg1994-03-241-5/+19
| | | | code.
* Increased maximum protection for data segment to VM_PROT_ALL becausedg1994-03-171-4/+2
| | | | some (lisp) programs try to execute code out of it.
* Performance improvements from John Dyson.dg1994-03-141-3/+3
| | | | | | | | | | 1) A new mechanism has been added to prevent pages from being paged out called "vm_page_hold". Similar to vm_page_wire, but much lower overhead. 2) Scheduling algorithm has been changed to improve interactive performance. 3) Paging algorithm improved. 4) Some vnode and swap pager bugs fixed.
* 1) "Pre-faulting" in of pages into process address spacedg1994-03-071-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eliminates vm_fault overhead on process startup and mmap referenced data for in-memory pages. (process startup time using in-memory segments *much* faster) 2) Even more efficient pmap code. Code partially cleaned up. More comments yet to follow. (generally more efficient pte management) 3) Pageout clustering ( in addition to the FreeBSD V1.1 pagein clustering.) (much faster paging performance on non-write behind disk subsystems, slightly faster performance on other systems.) 4) Slightly changed vm_pageout code for more efficiency and better statistics. Also, resist swapout a little more. (less likely to pageout a recently used page) 5) Slight improvement to the page table page trap efficiency. (generally faster system VM fault performance) 6) Defer creation of unnamed anonymous regions pager until needed. (speeds up shared memory bss creation) 7) Remove possible deadlock from swap_pager initialization. 8) Enhanced procfs to provide "vminfo" about vm objects and user pmaps. 9) Increased MCLSHIFT/MCLBYTES from 2K to 4K to improve net & socket performance and to prepare for things to come. John Dyson dyson@implode.root.com David Greenman davidg@root.com
* Fixed bugs in stack grow code, and moved it back into a seperate functiondg1994-02-081-171/+73
| | | | | like it was originally. Also added back call to "grow" in sendsig now that this routine actually works.
OpenPOWER on IntegriCloud