Commit Graph

226 Commits

Author SHA1 Message Date
Garrett Wollman 23f6ed01aa Actually enable NTP kernel PLL. (Oops!)
Noticed by Pete Carah.
1994-12-14 17:57:47 +00:00
Bruce Evans 20989d2d64 Obtained from: my fix for 1.1.5
Remove compatibility hack so that dup(fd) isn't interpreted as
dup2(fd & 0x3f, random_junk_on_stack_fd) when (fd & 0x3f) != 0.
1994-12-12 12:27:39 +00:00
Bruce Evans 6976af69e8 Obtained from: my old fix for 1.1.5
Improve hzto():

Round up instead of down and then add 1 tick.  This fixes sleep(1)
sometimes sleeping for < 1 second and usleep(10000) sometimes sleeping
for as little as 1 usec + syscall time.

Don't do all the calculations at splhigh().

Don't depend on `tick' being a multiple of 1000.

Don't lose accuracy for `sec' between 0x7fffffff / 1000 - 1000 and
0x7fffffff / hz.

Don't assume that longs are 32 bits or that ints have the same size as
longs.
1994-12-12 11:58:46 +00:00
David Greenman e8cdac9bfd Don't mess with already freed structures when a process is being run
down.
1994-12-12 06:04:27 +00:00
Bruce Evans 0300a965c8 diskslice_machdep.c implements reading and checking of DOS slice tables.
It will eventually replace readMBR.c.
1994-12-12 00:22:30 +00:00
Bruce Evans d1f35d579f subr_diskslice.c implements everything related to slices and labels except
reading and writing the slice tables and labels.

subr_dkbad.c implements everything related to bad sector remapping using
the bad144 format.
1994-12-12 00:20:34 +00:00
Bruce Evans a81b757af0 Don't allow negative limits at all. Convert them to RLIM_INFINITY instead
of returning EINVAL since something may depend on them being broken.
Allowing negative limits caused bugs almost everywhere.  The recent
fixes for MAXSSIZ checked the limits too late to stop anyone defeating
limits set by root...
1994-12-06 22:53:37 +00:00
Poul-Henning Kamp 54213fd84a Implemented a "TEXT_SET" called 'cleanup_set' which will be called before
the reboot takes place (if not RB_NOSYNC that is).  The vn driver needs this.
Other places might benefit too.
1994-12-04 19:58:43 +00:00
Andrey A. Chernov cdbbd9cfaf don't allow ctty to be set to ctty - infinite kernel recursion
Obtained from: 1.1.5.1
1994-12-04 01:46:13 +00:00
Andrey A. Chernov 73a361245d Call d_stop in ttyflush not only for WRITE but for READ too
Obtained from: 1.1.5.1
1994-12-04 01:01:45 +00:00
Andreas Schulz 06935b59e5 Add one forgotten u_quad_t typecast in dosetrlimit. 1994-12-02 23:00:40 +00:00
Andreas Schulz a7d72265c4 The values for setrlimit in the data size and stack size case are
used as an address value. Then all comparisons should be done unsigned
and not signed. Fix it with a typecast of u_quad_t.
Error can be demonstrated with the current bash in port, do a
ulimit -s unlimited and the machine hangs. bash delivers through
an internal error a large negative value for the stacksize, the
comparison saw this smaller than MAXSSIZ and then tried to expand
the stack to this size.
1994-12-01 20:20:21 +00:00
Bruce Evans d1a795a280 Fix cblock starvation bugs by reserving enough cblocks for minimal
operation of each clist.  Limit the growth of each clist.  Clists
can only grow larger than the reserved minimum if there are free
cblocks in a shared pool.  The size of this pool is now fixed
(this could be improved).  The reserved and maximum sizes are more
carefully allocated for slip and ppp, depending on the mtu.  A maximum
MTU of 16384 is now enforced for ppp.
1994-11-26 19:24:13 +00:00
Bruce Evans ba77d4e47b Don't block for output in non-blocking mode if clists run out.
Remove an unnecessary test (if the output queue is above high water
then it is nonempty).
1994-11-26 18:54:25 +00:00
David Greenman eadf9e27cd These changes fix a couple of lingering VM problems:
1.	The pageout daemon used to block under certain
	circumstances, and we needed to add new functionality
	that would cause the pageout daemon to block more often.
	Now, the pageout daemon mostly just gets rid of pages
	and kills processes when the system is out of swap.
	The swapping, rss limiting and object cache trimming
	have been folded into a new daemon called "vmdaemon".
	This new daemon does things that need to be done for
	the VM system, but can block.  For example, if the
	vmdaemon blocks for memory, the pageout daemon
	can take care of it.  If the pageout daemon had
	blocked for memory, it was difficult to handle
	the situation correctly (and in some cases, was
	impossible).

2.	The collapse problem has now been entirely fixed.
	It now appears to be impossible to accumulate unnecessary
	vm objects.  The object collapsing now occurs when ref counts
	drop to one (where it is more likely to be more simple anyway
	because less pages would be out on disk.)  The original
	fixes were incomplete in that pathological circumstances
	could still be contrived to cause uncontrolled growth
	of swap.  Also, the old code still, under steady state
	conditions, used more swap space than necessary.  When
	using the new code, users will generally notice a
	significant decrease in swap space usage, and theoretically,
	the system should be leaving fewer unused pages around
	competing for memory.

Submitted by:	John Dyson
1994-11-25 07:58:29 +00:00
Bruce Evans 6124ac44aa Move declarations of public functions to <sys/sysctl.h>.
Make some private data static.

Comment about MAXPATHLEN bytes of bloat for the kernel name.
1994-11-14 13:58:30 +00:00
Poul-Henning Kamp e113d7633d Make a kernel sans FFS possible. 1994-11-12 01:47:43 +00:00
Andreas Schulz 94e6bbfc64 pick up the changes from a makesyscall.sh run. The multiple lkmnosys
declarations should now be gone.
1994-11-10 23:59:47 +00:00
Poul-Henning Kamp 4385de1699 Added "const" to the arguments here and there. 1994-11-07 20:48:35 +00:00
Andreas Schulz f0e1ab7bc7 Put a small hack into a large hack named makeyscall.sh. Generate only
one lkmnosys() entry in init_sysent.c.
1994-11-06 21:57:16 +00:00
Andrey A. Chernov 08ee5d13ae Security nitpicking: don't make *.core world readable 1994-11-06 11:13:02 +00:00
David Greenman cf17350a73 Added support for starting the experimental "vmdaemon" system process.
Enabled via REL2_1.

Submitted by:	John Dyson
1994-11-06 05:01:58 +00:00
David Greenman c4a7b7e10c From tim@cs.city.ac.uk (Tim Wilkinson):
Find enclosed a short bugfix to get the union filesystem up and running
in FreeBSD-current.  We don't think we've got all the problems yet but
these fixes sort out the major ones (which mostly concert bad locking
of vnodes), no doubt we'll post others as necessary.  Known problems
include the inability of the umount command (not the system call) to unmount
unions in certain circumstances (this is due the way "realpath" works),
and the failure of direntries to always get all available files in
unioned subdirectories.  We are, as they say, working on it.

Submitted by:	tim@cs.city.ac.uk (Tim Wilkinson)
1994-11-04 14:41:46 +00:00
Bruce Evans e8b7f39747 Return immediately from ttwrite() if the ttysleep()s that wait for
a clist return with an error.  There are some clist starvation/deadlock
bugs elsewhere and killing clist hogs didn't help because the breaks
only exited from the inner loops.
1994-11-01 22:23:29 +00:00
Joerg Wunsch 0cdf7aff6d Added hooks for an easy drop-in of the pcvt concole driver.
Don't panic:-), this is simple stuff just doing exactly the same as for syscons.
(files.i386 did already contain the necessary stuff.)
1994-10-31 17:20:15 +00:00
Bruce Evans ab4bc4b293 Fix selector arg to match the (missing) prototype for sdtossd().
Cosmetic.

Return from trap() if trap_fatal() returns.  trap_fatal() isn't
fatal if you have ddb.  Returning from trap() is usually the right
thing to do and much better than falling through.
1994-10-30 20:25:21 +00:00
Bruce Evans a6a21d9edf Don't attempt to free null cblocks. There may be less to free than
normal due to cblock resource starvation or malloc() failing when
the device is opened.
1994-10-30 19:43:49 +00:00
Andrey A. Chernov 934051e5c5 write ptys use _the_same_ tsleep/wakeup address as read ptys due to
mistype, fixed.
1994-10-29 23:59:48 +00:00
Jordan K. Hubbard 54c7241bd3 Julian Elischer's disklabel fixes. 1994-10-27 20:45:13 +00:00
Poul-Henning Kamp 5f7bd355f0 Fix the panic message if init dies to show the exit status. 1994-10-27 05:21:39 +00:00
Poul-Henning Kamp 2257b745d1 When all else fails, try to use "/stand/sysinstall" as "init" process. The
new installation procedure needs this.
1994-10-26 03:34:20 +00:00
David Greenman f15b8850dd Changed some variable names in lf_addblock to make the code both
understandable and conform to other conventions used in the file.
1994-10-25 11:27:51 +00:00
Garrett Wollman fb5a05599e Don't do suser() check; it's already done in __sysctl(). 1994-10-23 23:01:03 +00:00
Garrett Wollman 2f86936a07 Finished device configuration database work for all ISA devices (except `ze')
and all SCSI devices (except that it's not done quite the way I want).  New
information added includes:

-	A text description of the device
-	A ``state''---unknown, unconfigured, idle, or busy
-	A generic parent device (with support in the m.i. code)
-	An interrupt mask type field (which will hopefully go away) so that
.	  ``doconfig'' can be written

This requires a new version of the `lsdev' program as well (next commit).
1994-10-23 21:28:03 +00:00
David Greenman e03b612d87 Only VM_WAIT if curproc != pageproc. A deadlock can occur otherwise.
Submitted by:	John Dyson
1994-10-23 20:52:11 +00:00
David Greenman 26305b211a Round down instead of up in 'kerninfo'/ctrl-T stats code. Incorrect output
can result otherwise.

Submitted by:	John Dyson
1994-10-23 06:18:13 +00:00
Poul-Henning Kamp 8963028c59 Make the diagnostics a little more useful.
A word of wisdom, don't do this:

|	cd /usr/bin
|	for i in *
|	do
|		cp $i /tmp/a
|		gzip -9 < /tmp/a > $i
|	done

It will compress files with multiple links several times.  do it this way:

|	cd /usr/bin
|	for i in *
|	do
|		gunzip -f < $i > /tmp/a
|		gzip -9 < /tmp/a > $i
|	done
1994-10-22 11:55:16 +00:00
Poul-Henning Kamp 6aafb7e048 I belive imgact_gzip is finally reentrant. It is also a whole lot more
readable.

inflate is now much more general, and is there if anybody feels like making
a uncompressing filesystem or something like that (hint hint !)
1994-10-22 11:40:38 +00:00
Garrett Wollman 091b0456f4 Make my ALLDEVS kernel compile (basically, LINT minus a lot of options).
This involves fixing a few things I broke last time.
1994-10-21 01:19:28 +00:00
Garrett Wollman 09f7992adf Make my ALLDEVS kernel compile (basically, LINT minus a lot of options). 1994-10-21 01:18:38 +00:00
Garrett Wollman 03a6294027 Actually implement the functionality documented in sysctl.h for type CTL_FS.
(Namely, call a filesystem-dependent sysctl function analogous to how it works
for networking and (now) physical devices.)
1994-10-20 00:48:28 +00:00
Poul-Henning Kamp 953ca71d9d Peter Dufaults comconsole changes.
Submitted by:	Peter Dufault
1994-10-20 00:08:31 +00:00
Garrett Wollman f1d8109335 Add support for devconf to a large number of device drivers, and do
the right thing in dev_goawayall() when kdc_goaway is null.
1994-10-19 01:59:11 +00:00
Garrett Wollman 299b48a4da Use a static length for externalized data, rather than calling a function. 1994-10-19 00:08:48 +00:00
David Greenman 08d7d166b8 Removed references to bclnlist which we don't use/support/need. 1994-10-18 06:55:57 +00:00
Poul-Henning Kamp 1be9232f73 This basically allows you to stick a disklabel on any partition.
For it to be useful, you must stick your disklabel on the partition which
starts where the MBR says FreeBSD lives.  If you don't do that, you might
get a bad day.

Oh, that probably also means that putting swap there is a bad idea...
1994-10-17 02:31:33 +00:00
Garrett Wollman 8478cabaea kern_clock.c: define dk_names[][].
kern_sysctl.c: call dev_sysctl for hw.devconf mib subtree
kern_devconf.c: sysctl-accessible device-configuration and -management
	interface
1994-10-16 03:52:14 +00:00
Andrey A. Chernov 61181d7df2 ttywait: check conditions again right after oproc
Obtained from: (I know, but can't say :-)
1994-10-15 17:59:02 +00:00
Poul-Henning Kamp 17b9f9f4a1 Fix the problem with panics when mounting on nonexistant directories. Probably
my fault in the first place...
1994-10-15 02:53:26 +00:00
Søren Schmidt 2b101991d4 Damn, check in the wrong version, fixed.
Reviewed by:
Submitted by:
Obtained from:
1994-10-13 21:41:36 +00:00