Commit Graph

1069 Commits

Author SHA1 Message Date
David Greenman
add2e5d0f4 Check for error return from uiomove to prevent looping endlessly in
soreceive(). Closes PR#2114.

Submitted by:	wpaul
1996-11-29 19:03:42 +00:00
Bruce Evans
e6eeb36daf Fixed sigaction() for SIGKILL and SIGSTOP. Reading the old action now
succeeds.  Writing an action now succeeds iff the handler isn't changed.
(POSIX allows attempts to change the handler to be ignored or cause an
error.  Changing other parts of the action is allowed (except attempts
to mask unmaskable signals are silently ignored as usual).)

Found by:	NIST-PCTS
1996-11-29 18:01:55 +00:00
Bruce Evans
63f3c673f6 Help broken d_stop() routines by flushing the output queue before
calling them (as well as after).

Found by:	NIST PCTS
1996-11-29 16:16:47 +00:00
Bruce Evans
8be1cbf1f4 Fixed bugs handling (background) orphaned process groups. tty
writes and tty ioctls by processes in such groups must return
-1/EIO, but they were allowed.  tty reads were handled correctly.

Found by:	NIST PCTS
1996-11-29 15:50:56 +00:00
Bruce Evans
7542ee31b8 Fixed some bugs in BREAK handling. If BRKINT is set, then always flush
the queues and generate a SIGINT.  Previously, this wasn't done if ISIG
was clear or the VINTR character was disabled, and it was done by
converting the BREAK to a VINTR character and sometimes bogusly echoing
this character.

Found by:	NIST-PCTS
1996-11-29 15:23:42 +00:00
Bruce Evans
c02039bc20 Fixed handling of non-POSIX control characters. They must not do
anything special unless IEXTEN is set.

Found by:	NIST-PCTS
1996-11-29 15:06:17 +00:00
John Dyson
71a5742716 Potentially fix a problem, whereby MSDOSFS can request buffers
larger than the vfs layer can provide.  We now automatically support
32K clusters if MSDOSFS is installed, and panic if a filesystem tries
to allocate a buffer larger than MAXBSIZE.

This commit is a result of some "prodding" by BDE.
1996-11-28 04:26:04 +00:00
John Dyson
9970cd3721 Improve the caching of small files like directories, while not
substantially increasing buffer space.  Specifically, we double
the number of buffers, but allocate only half the amount of memory
per buffer.  Note that VDIR files aren't cached unless instantiated
in a buffer.  This will significantly improve caching.
1996-11-17 02:11:01 +00:00
Bruce Evans
b83ddf9c86 Restored writability of kern.maxvnodes. It was broken a year ago in
rev.1.29 of kern_sysctl.c.

Should be in 2.2.
1996-11-12 09:24:31 +00:00
Bill Fenner
82c23eba89 Add the IP_RECVIF socket option, which supplies a packet's incoming interface
using a sockaddr_dl.

Fix the other packet-information socket options (SO_TIMESTAMP, IP_RECVDSTADDR)
to work for multicast UDP and raw sockets as well.  (They previously only
worked for unicast UDP).
1996-11-11 04:56:32 +00:00
John Dyson
2cb544c3c9 Fix an ordering bug -- pmap_remove_pages should be called BEFORE
vm_map_remove, not after...

2.2-RELEASE candidate.
1996-11-09 03:54:25 +00:00
Bruce Evans
fd25850c96 Don't clobber max_ncyls, ending up guessing thetotal number of cylinders as
the number in the 4th slot.

Fixes PR 1893.

Should be in 2.1.5 and 2.2.
1996-11-04 17:40:43 +00:00
Julian Elischer
d13d3630fd Further improved version of hadling a HALT when there is no console. 1996-10-31 00:57:28 +00:00
Satoshi Asami
e30f001135 More merge and update.
(1) deleted #if 0

    pc98/pc98/mse.c

(2) hold per-unit I/O ports in ed_softc

    pc98/pc98/if_ed.c
    pc98/pc98/if_ed98.h

(3) merge more files by segregating changes into headers.

  new file (moved from pc98/pc98):

    i386/isa/aic_98.h

  deleted:

    well, it's already in the commit message so I won't repeat the
    long list here ;)

Submitted by:	The FreeBSD(98) Development Team
1996-10-30 22:41:46 +00:00
Julian Elischer
75680b05c6 if there is no console, cngetc should act like getc and return -1
make callers aware of this in those cases where it can occur.
1996-10-30 21:40:25 +00:00
Bruce Evans
61679f2ba2 Search for labels on all slices whenever any minor for a drive is opened.
If DEVFS is configured, create devfs devices for previously invisible
partitions on the slices.

Fixed an old aliasing bug which caused E=17 errors from DEVFS for
DIOCSDINFO when there were no real slices.
1996-10-29 13:15:30 +00:00
Poul-Henning Kamp
19060a3ad9 init_main.c: pass -d to init if DEVFS_ROOT
kern_conf.c:	gd driver is a disk.
vfs_subr.c:	include opt_devfs.h
1996-10-28 11:34:57 +00:00
Wolfram Schneider
510681905e Move static variable nextpid out from fork1(). Now top(1) can print
last pid value.
1996-10-27 13:29:22 +00:00
Bruce Evans
835bd1ce62 Improved biasing of i586 clock by adjusting for hardclock() latency.
I decided to do this for every hardclock() call instead of lazily
in microtime().  The lazy method is simpler but has more overhead
if microtime() is called a lot.

CPU_THISTICKLEN() is now a no-op and should probably go away.
Previously it did nothing directly but had the side effect of
setting i586_last_tick for CPU_CLOCKUPDATE() and i586_avg_tick for
debugging.  CPU_CLOCKUPDATE() now uses a better method and
i586_avg_tick is too much trouble to maintain.

Reduced nesting of #includes in the usual case.

Increased nesting of #includes when CLOCK_HAIR is defined.  This
is a kludge to get typedefs for inline functions only when the
inline functions are used.  Normally only kern_clock.c defines
this.  kern_clock.c can't include the i386 headers directly.

Removed unused LOCORE support.
1996-10-25 13:01:56 +00:00
Søren Schmidt
d672246bcc Added a missing break, so all static bins would be missed :( 1996-10-24 19:13:00 +00:00
Poul-Henning Kamp
40060a90b9 close bin/1648 libmd not 64bit safe.
if something fails to compile now, you need to add #include <sys/types.h>

Partially Submitted by:	Jason Thorpe <thorpej@nas.nasa.gov>
1996-10-22 16:27:47 +00:00
Alexander Langer
92579404e8 Fix signed/unsigned comparison warnings.
Reviewed by:	bde
1996-10-20 21:01:46 +00:00
David Greenman
8713ad7411 Kill unnecessary test in coredump() that wasn't removed in rev 1.19
when the check for P_SUGID was added.
1996-10-19 01:06:20 +00:00
Bruce Evans
d6b9e17eb5 Improved non-statistical (GUPROF) profiling:
- use a more accurate and more efficient method of compensating for
  overheads.  The old method counted too much time against leaf
  functions.
- normally use the Pentium timestamp counter if available.
  On Pentiums, the times are now accurate to within a couple of cpu
  clock cycles per function call in the (unlikely) event that there
  are no cache misses in or caused by the profiling code.
- optionally use an arbitrary Pentium event counter if available.
- optionally regress to using the i8254 counter.
- scaled the i8254 counter by a factor of 128.  Now the i8254 counters
  overflow slightly faster than the TSC counters for a 150MHz Pentium :-)
  (after about 16 seconds).  This is to avoid fractional overheads.

files.i386:
permon.c temporarily has to be classified as a profiling-routine
because a couple of functions in it may be called from profiling code.

options.i386:
- I586_CTR_GUPROF is currently unused (oops).
- I586_PMC_GUPROF should be something like 0x70000 to enable (but not
  use unless prof_machdep.c is changed) support for Pentium event
  counters.  7 is a control mode and the counter number 0 is somewhere
  in the 0000 bits (see perfmon.h for the encoding).

profile.h:
- added declarations.
- cleaned up separation of user mode declarations.

prof_machdep.c:
Mostly clock-select changes.  The default clock can be changed by
editing kmem.  There should be a sysctl for this.

subr_prof.c:
- added copyright.
- calibrate overheads for the new method.
- documented new method.
- fixed races and and machine dependencies in start/stop code.

mcount.c:
Use the new overhead compensation method.

gmon.h:
- changed GPROF4 counter type from unsigned to int.  Oops, this should
  be machine-dependent and/or int32_t.
- reorganized overhead counters.

Submitted by:	Pentium event counter changes mostly by wollman
1996-10-17 19:32:31 +00:00
Jordan K. Hubbard
0082fb4657 I'm not sure why, but Netcon's TFS filesystem code doesn't want to
add free vnodes back to the freelist.  They must do their own vnode
management.  Anyway, this change is *only* activated with their filesystem
and doesn't affect anyone else.  Whoops, forgot the submitted-by lines
in my previous commits too.. :-(
Submitted-By: Tony Ardolino <tony@netcon.com>
1996-10-17 17:56:07 +00:00
John Dyson
402bcb9621 Fix a problem that could cause msync (or many other things) to deadlock.
The heuristic for managment of memory backing the buffer cache was
nice, but didn't work due to some architectural problems.  Simplify
and improve the algorithm.
1996-10-17 03:04:43 +00:00
John Dyson
a669a6e9a9 Make processes waken up eligible for immediate swap-in. 1996-10-17 02:58:20 +00:00
John Dyson
ad98052216 Clean up the rundown of the object backing a vnode. This should fix
NFS problems associated with forcible dismounts.
1996-10-17 02:49:35 +00:00
Søren Schmidt
717fb679ee Oops forgot to remove a debug printf. 1996-10-16 20:59:08 +00:00
Søren Schmidt
ea5a2b2e00 Prepare kernel to take advantage of "branded" ELF binaries. 1996-10-16 17:51:08 +00:00
Julian Elischer
66478c637b Add support for embedded operation withou console
The boot.c patch is applied only to teh JULIAN_HACK branch
the muted console is controlable by a sysctl variable kern.consmute
1996-10-16 00:19:40 +00:00
Garrett Wollman
67f7ea2d71 Preserve file flags in accept(2).
Submitted by: fredriks@mcs.com in PR#1775 (this implmentaion is different)
1996-10-15 19:28:44 +00:00
John Dyson
bdef8bf092 Undo a mistaken change from splhigh to splvm. Subr_rlist has been
capable of being used for things other than swap space allocation,
and splvm would have been appropriate for only swap space allocation
and other VM things.  My commit broke that (and was actually a mistake.)
1996-10-12 21:37:59 +00:00
John Dyson
9d3fbbb5f4 Performance optimizations. One of which was meant to go in before the
previous snap.  Specifically, kern_exit and kern_exec now makes a
call into the pmap module to do a very fast removal of pages from the
address space.  Additionally, the pmap module now updates the PG_MAPPED
and PG_WRITABLE flags.  This is an optional optimization, but helpful
on the X86.
1996-10-12 21:35:25 +00:00
Paul Traina
a51764a8bf Fix two bugs I accidently put into the syn code at the last minute
(yes I had tested the hell out of this).

I've also temporarily disabled the code so that it behaves as it previously
did (tail drop's the syns) pending discussion with fenner about some socket
state flags that I don't fully understand.

Submitted by:	fenner
1996-10-11 19:26:42 +00:00
John Dyson
f2c832d788 Mostly some fixes from bde to start support for ASYNC I/O (SIGIO).
Submitted by:	bde
1996-10-11 02:27:30 +00:00
Bruce Evans
a0ea75ecbd Don't include "opt_cpu.h" in <machine/clock.h>, since this breaks lkm's.
The change breaks kern_clock.c; fix that temporarily by including
"opt_cpu.h" there.
1996-10-10 10:25:26 +00:00
Bruce Evans
c20b324bb6 Put I*86_CPU defines in opt_cpu.h. 1996-10-09 19:47:44 +00:00
Paul Traina
ebb0cbea75 Increase robustness of FreeBSD against high-rate connection attempt
denial of service attacks.

Reviewed by:	bde,wollman,olah
Inspired by:	vjs@sgi.com
1996-10-07 04:32:42 +00:00
John Dyson
ffe2522e29 Fix 4 problems:
Major: When blocking occurs in allocbuf() for VMIO files,
	       excess wire counts could accumulate.
	Major: Pages are incorrectly accumulated into the physical
	       buffer for clustered reads.  This happens when bogus
	       page is needed.
	Minor: When reclaiming buffers, the async flag on the buffer
	       needs to be zero, or the reclaim is not optimal.
	Minor: The age flag should be cleared, if a buffer is wanted.
1996-10-06 07:50:05 +00:00
Julian Elischer
dd45d8ad18 If we have no console device it is possible to be
1/ session leader
2/ Have a console device vnode (/dev/console)
3/ have  NULL pointer for a consoel tty struct.

fix the only case where the tty struct is referenced without a prior
check for existance.
1996-10-04 23:43:12 +00:00
Peter Wemm
1a7eb2dcab Drop an unused param to unmap_pages(). 1996-10-03 06:14:48 +00:00
Julian Elischer
793dc173fa if we jump the time, we need to check all the process real interval timers. 1996-09-30 19:28:52 +00:00
Bruce Evans
efebc4ab84 Fixed bitrot in the read-only attribute:
- kern.maxfilesperproc was read-only (and thus essentially useless).

Removed unused #includes.  Strength-reduced used #includes.
1996-09-28 16:33:21 +00:00
Bruce Evans
7c1aacb5be Oops, read-only is spelled RD here. 1996-09-28 15:53:30 +00:00
Bruce Evans
501b55314c Fixed bitrot in the read-only attribute:
- kern.maxproc and kern.maxprocperuid were read-only (and thus essentially
  useless.  Apparently no one uses them).
- all the user sysctls were read-write (and thus it was possible for them
  to be inconsistent with the authoritative fixed values in the library).

Removed unused #include.
1996-09-28 15:43:39 +00:00
John Dyson
a8f42fa9a6 Correct vget by removing a window where a vnode can potentially go away. 1996-09-28 03:36:07 +00:00
Peter Wemm
983febf3dc I've been meaning to commit this for months. Implement select()
for /dev/random and /dev/urandom.  Both are always writable, urandom is
always readable, and /dev/random is readable when >= 8 bits are in the
pool.
1996-09-27 13:25:13 +00:00
Peter Wemm
a6fc828816 call srandom() during the boot to start the sequence with a slightly less
predictable seed.
1996-09-23 04:37:54 +00:00
Poul-Henning Kamp
d920a829d4 Remove the extra length field from the utrace entries. It's redundant. 1996-09-22 18:17:51 +00:00