unix-history/.git
30 years agoac(8), from NetBSD, FreeBSD smoothing by Michael Reifenberger
Geoff Rehmet [Wed, 18 May 1994 08:00:45 +0000 (08:00 +0000)]
ac(8), from NetBSD, FreeBSD smoothing by Michael Reifenberger

30 years agoThe multicast router. Stick it next to routed and XNSrouted since that
Jordan K. Hubbard [Tue, 17 May 1994 20:59:34 +0000 (20:59 +0000)]
The multicast router.  Stick it next to routed and XNSrouted since that
seems the logical place (though /usr/sbin is more my taste).

30 years agoPort readline lib into gnu system tree.
Andrey Chernov [Mon, 9 May 1994 15:59:10 +0000 (15:59 +0000)]
Port readline lib into gnu system tree.
Really we don't need copy of this library into each program
(gdb f.e.)

P.S. it is much cleaner port than /usr/ports version and based
on /usr/ports version. /usr/ports version will be removed.

30 years agoptx: permuted index generator
Andrew Moore [Fri, 6 May 1994 07:54:54 +0000 (07:54 +0000)]
ptx: permuted index generator

30 years agoImport of SUN's libm. From NetBSD-current.
Gary Clark II [Fri, 6 May 1994 00:20:14 +0000 (00:20 +0000)]
Import of SUN's libm.  From NetBSD-current.
Makefile needs some cleaning up.

30 years agoxntp3.3s from UDel
Garrett Wollman [Thu, 21 Apr 1994 00:33:33 +0000 (00:33 +0000)]
xntp3.3s from UDel

30 years agoManctl utility:
Geoff Rehmet [Sun, 17 Apr 1994 21:26:21 +0000 (21:26 +0000)]
Manctl utility:
compresses man pages
uncompresses man pages
purges old formatted man pages (not implemented yet)

currently still under development, but worth trying out (IMHO)
a man page ;-) must still be written for manctl - to follow shortly

30 years agocap_mkdb from ftp.uu.net
Andrew Moore [Sun, 17 Apr 1994 10:21:26 +0000 (10:21 +0000)]
cap_mkdb from ftp.uu.net

30 years agoThis is the md5 program from cert.org, no changes made yet.
Poul-Henning Kamp [Wed, 13 Apr 1994 21:50:46 +0000 (21:50 +0000)]
This is the md5 program from cert.org, no changes made yet.

30 years agoAdded lptcontrol(1):
Geoff Rehmet [Wed, 6 Apr 1994 19:38:45 +0000 (19:38 +0000)]
Added lptcontrol(1):
used to change lpt driver between polling/interrupt driven mode

30 years agoxntp 3.3p from Delaware
Garrett Wollman [Sun, 3 Apr 1994 19:50:51 +0000 (19:50 +0000)]
xntp 3.3p from Delaware

30 years agoImported the means for migrating to gcc-2.5.8 when we feel the urge and
Poul-Henning Kamp [Sun, 27 Feb 1994 14:23:52 +0000 (14:23 +0000)]
Imported the means for migrating to gcc-2.5.8 when we feel the urge and
need for it.  Read the README for information.  This should *NOT* be
included in the Makefile above.

30 years agoKerberos version 4 from the Net/2 tape.
Garrett Wollman [Fri, 25 Feb 1994 01:14:51 +0000 (01:14 +0000)]
Kerberos version 4 from the Net/2 tape.
WARNING: Contains export-restricted software.

30 years agoAdd floppy tape support
Andrew Moore [Mon, 7 Feb 1994 05:03:05 +0000 (05:03 +0000)]
Add floppy tape support

30 years agoimport floppy tape controller
Andrew Moore [Mon, 7 Feb 1994 04:36:09 +0000 (04:36 +0000)]
import floppy tape controller

30 years agoSpeaker test script
Andrey Chernov [Sat, 5 Feb 1994 07:51:04 +0000 (07:51 +0000)]
Speaker test script

30 years agoTimezone compiler to mach new data files from ADO
Garrett Wollman [Fri, 4 Feb 1994 00:22:30 +0000 (00:22 +0000)]
Timezone compiler to mach new data files from ADO

30 years agoNew timezone files from Arthur Olson and Paul Eggert
Garrett Wollman [Fri, 4 Feb 1994 00:00:46 +0000 (00:00 +0000)]
New timezone files from Arthur Olson and Paul Eggert

30 years agoxntpd version 3.3z from UDel
Garrett Wollman [Thu, 3 Feb 1994 22:09:07 +0000 (22:09 +0000)]
xntpd version 3.3z from UDel

30 years agoHenry Spencer's REGEX package modified for vi (bug fixes)
Nate Willams [Sat, 29 Jan 1994 19:54:04 +0000 (19:54 +0000)]
Henry Spencer's REGEX package modified for vi (bug fixes)

30 years agoWe got now floppy formatter
Andrey Chernov [Wed, 26 Jan 1994 23:44:34 +0000 (23:44 +0000)]
We got now floppy formatter

30 years agoThis is `nvi' (tweaked to install as vi), version 1.01.
Jordan K. Hubbard [Mon, 24 Jan 1994 01:14:16 +0000 (01:14 +0000)]
This is `nvi' (tweaked to install as vi), version 1.01.

30 years agoCombined f2c library
Wiljo Heinen [Wed, 5 Jan 1994 03:50:04 +0000 (03:50 +0000)]
Combined f2c library

30 years agof2c libI77 from netlib.att.com Jan 4 1994
Wiljo Heinen [Wed, 5 Jan 1994 02:55:25 +0000 (02:55 +0000)]
f2c libI77 from netlib.att.com Jan 4 1994

30 years agof2c libF77 from netlib.att.com Jan 4 1994
Wiljo Heinen [Wed, 5 Jan 1994 02:54:34 +0000 (02:54 +0000)]
f2c libF77 from netlib.att.com Jan 4 1994

30 years agof2c from netlib.att.com Jan 4 1994
Wiljo Heinen [Wed, 5 Jan 1994 02:53:40 +0000 (02:53 +0000)]
f2c from netlib.att.com Jan 4 1994

30 years agoxntpd 3.3b from UDel
Garrett Wollman [Tue, 21 Dec 1993 18:36:48 +0000 (18:36 +0000)]
xntpd 3.3b from UDel

30 years agoAttempt to import adjkerntz...
Andrey Chernov [Thu, 16 Dec 1993 18:44:40 +0000 (18:44 +0000)]
Attempt to import adjkerntz...

30 years agoFall 93 release from Arthur David Olson (as a vendor branch)
Garrett Wollman [Wed, 10 Nov 1993 04:43:35 +0000 (04:43 +0000)]
Fall 93 release from Arthur David Olson (as a vendor branch)

30 years agoImport yp binaries from NetBSD.
Paul Richards [Sun, 31 Oct 1993 06:14:55 +0000 (06:14 +0000)]
Import yp binaries from NetBSD.

30 years agoAdd domainname command to set yp domain.
Paul Richards [Sun, 24 Oct 1993 06:31:48 +0000 (06:31 +0000)]
Add domainname command to set yp domain.

30 years agoadding GNU dc ("desk calculator")
Andrew Moore [Sat, 31 Jul 1993 01:10:24 +0000 (01:10 +0000)]
adding GNU dc ("desk calculator")

30 years agoadding bdes(1) - 4.4BSD's crypt(1)
Andrew Moore [Fri, 30 Jul 1993 21:32:41 +0000 (21:32 +0000)]
adding bdes(1) - 4.4BSD's crypt(1)

30 years agoNewer new man page reader.
Jordan K. Hubbard [Wed, 7 Jul 1993 23:07:02 +0000 (23:07 +0000)]
Newer new man page reader.

31 years agoGNU3 Diff 2.3
Nate Willams [Tue, 29 Jun 1993 08:19:28 +0000 (08:19 +0000)]
GNU3 Diff 2.3

31 years agoGNU Diff 2.3
Nate Willams [Tue, 29 Jun 1993 08:13:44 +0000 (08:13 +0000)]
GNU Diff 2.3

31 years agoGnu e?grep 1.6
Nate Willams [Tue, 29 Jun 1993 06:04:45 +0000 (06:04 +0000)]
Gnu e?grep 1.6

31 years agoGNU Textutils-1.6
Nate Willams [Tue, 29 Jun 1993 05:21:43 +0000 (05:21 +0000)]
GNU Textutils-1.6

31 years agoFrom Textutils-1.6
Nate Willams [Tue, 29 Jun 1993 04:58:06 +0000 (04:58 +0000)]
From Textutils-1.6

31 years agoFrom old net posting
Nate Willams [Tue, 29 Jun 1993 01:55:53 +0000 (01:55 +0000)]
From old net posting

31 years agogcc-2.4.3.1 subdirectories
Paul Richards [Sun, 20 Jun 1993 21:39:55 +0000 (21:39 +0000)]
gcc-2.4.3.1 subdirectories

31 years agoInitial import of 386BSD 0.1 othersrc/etc
Rod Grimes [Sun, 20 Jun 1993 13:41:45 +0000 (13:41 +0000)]
Initial import of 386BSD 0.1 othersrc/etc

31 years agob-maked patch-2.10
Paul Richards [Sat, 19 Jun 1993 14:21:53 +0000 (14:21 +0000)]
b-maked patch-2.10

31 years agoNew bc-1.02 bmake sources
Paul Richards [Sat, 19 Jun 1993 00:26:18 +0000 (00:26 +0000)]
New bc-1.02 bmake sources

31 years agoGzip 1.1
Nate Willams [Fri, 18 Jun 1993 18:39:41 +0000 (18:39 +0000)]
Gzip 1.1

31 years agoNew ref program from elvis 1.7 that implements ctags.
Andrew Moore [Fri, 18 Jun 1993 13:08:09 +0000 (13:08 +0000)]
New ref program from elvis 1.7 that implements ctags.

31 years agoPOSIX ed version 0.6 by Andrew Moore (alm@netcom.com).
Andrew Moore [Fri, 18 Jun 1993 13:00:14 +0000 (13:00 +0000)]
POSIX ed version 0.6 by Andrew Moore (alm@netcom.com).

31 years agoUpdated CVS
Jordan K. Hubbard [Fri, 18 Jun 1993 05:46:17 +0000 (05:46 +0000)]
Updated CVS

31 years agoUpdated GNU utilities
Jordan K. Hubbard [Fri, 18 Jun 1993 04:22:21 +0000 (04:22 +0000)]
Updated GNU utilities

31 years agoInitial import, 0.1 + pk 0.2.4-B1
Rod Grimes [Sat, 12 Jun 1993 14:58:18 +0000 (14:58 +0000)]
Initial import, 0.1 + pk 0.2.4-B1

31 years agoStart development on FreeBSD-release/1.0 origin/FreeBSD-release/1.0-Import
Diomidis Spinellis [Wed, 9 Jun 1993 21:00:00 +0000 (21:00 +0000)]
Start development on FreeBSD-release/1.0
Create reference copy of all prior development files

Synthesized-from: freebsd-early.git/

31 years agoFix /dev/MAKEDEV so that a MAKEDEV all does not create the codrv files origin/386BSD-0.1-patchkit
Holger Veit [Sun, 20 Jun 1993 00:00:00 +0000 (00:00 +0000)]
Fix /dev/MAKEDEV so that a MAKEDEV all does not create the codrv files

A sh /dev/MAKDEV all created both pc0 and co0 in that order, thus
if you had a pccons kernel you would have lots of problems.  I removed the
co0 entry from all so by default the pc cons devices are built.  If you
are running a codrv kernel, make sure that you make the correct devices
if you run /dev/MAKDEV all.

The entry for kbd under co*) was making kbd as minor 128 when it
should have been minor 0.  (Holger)

Added new README documentation for codrv.

AUTHOR: Jordan K. Hubbard, Rodney W. Grimes (rgrimes@cdrom.com)
AUTHOR: Holger Viet
386BSD-Patchkit: patch00170

31 years agoFix dangling pointer in lockf structure
Paul Kranenburg [Fri, 4 Jun 1993 00:00:00 +0000 (00:00 +0000)]
Fix dangling pointer in lockf structure

>The problem is a dangling pointer left in the lockf structure belonging to
>the current lock holder. The offending process frees its lock structure
>after breaking out of sleep() as a result of a signal. Possible fix:
>scan the list of waiting locks to remove the lock that isn't going to be
>used.

Unfortunately, the fix that went with it was totally bogus. This one might
do a better job:

Date: Mon, 26 Apr 1993 17:05:01 GMT

AUTHOR: Paul Kranenburg (pk@cs.few.eur.nl)
386BSD-Patchkit: patch00169

31 years agoMany fixes to ash (/bin/sh)
Jim Wilson [Fri, 4 Jun 1993 00:00:00 +0000 (00:00 +0000)]
Many fixes to ash (/bin/sh)

I have been fixing /bin/sh (aka ash) bugs.  If you know of shell
bugs that aren't fixed by this patch, or have problems with this patch,
send me a bug report and I will try to fix it.

This patch fixes 7 bugs:
1) correct handling of \ within backquotes
2) don't require \n or ; before do in `for var do'
3) accept redir before (non-simple) command
4) don't expand regexps as case pattern if inside string
5) for a background command, don't redirect stdin to /dev/null if stdin has
   been previously redirected
6) set exitstatus for backquoted commands
7) correctly expand $n inside quotes

This patch should fix all problems with C-news.
It also fixes some problems with the SPEC benchmark suite, groff 1.07, etc.

I have test cases for each of these patches for anyone who is interested
in seeing them.

Jim Wilson
wilson@moria.cygnus.com

Date: Mon, 19 Apr 1993 07:06:52 GMT

AUTHOR: Jim Wilson (wilson@moria.cygnus.com)
386BSD-Patchkit: patch00168

31 years agoFixed multiple devices configured on the same irq.
Bruce Evans [Fri, 4 Jun 1993 00:00:00 +0000 (00:00 +0000)]
Fixed multiple devices configured on the same irq.

The intr stuff is all OK except icu.s which has some big problems with
irq_num vs id_num.  There's no way to go from a bit in ipending to an
id_num (i.e., and irq_num) if there are multiple devices per irq.
Code like

testb $1 << 3,%al
jne handle_id_num_6
testb $1 << 3,%al
jne handle_id_num_22

is generated if devices 6 and 22 both use irq3.  This always sends
unpended irq3's to the device 6 handler and fails if device 6 doesn't
exist and device 22 exists.

I've fixed this for ordinary intrs by storing the resume address (Vretry)
in a vector.  The diffs are large because I nuked all BUILD_VECTOR's
in icu.s and rearranged the code and comments.  Gross kludges are used
for fastintr's to get softcom1() called instead of comintr() (softcom
is like the net wakeup routines and not like a h/w unpend but we don't
want to hard-code it like the net stuff).  In vector.s, I added the
mask counters to the stats and changed some counter names as well as
initializing Vresume.  The `stray' arg to INTR is now unused.  Perhaps
some of the args to BUILD_VECTOR are now unused.  Perhaps vector.s
ought to be merged into icu.s (except neither has much to do with ICU's.
ic.s (for interrupt control) would be better).

Bruce

Date: Tue, 25 May 1993 16:14:05 +1000

AUTHOR: Bruce Evans
386BSD-Patchkit: patch00167

31 years agoMake default MCLSHIFT=11 and MCLBYTES=2048
Rodney W. Grimes [Fri, 4 Jun 1993 00:00:00 +0000 (00:00 +0000)]
Make default MCLSHIFT=11 and MCLBYTES=2048

For best network performance (both local and remote) the size
MCLBYTES should be greater than MTU for the interfaces, thus I have
increased the DEFAULT value for MCLBYTES to 2048.  If you do not like
this you can override it in your kernel config file with a options MCLSHIFT=10.

Rod Grimes
Date: Fri Jun  4 07:03:36 PDT 1993

AUTHOR: Rodney W. Grimes
386BSD-Patchkit: patch00166

31 years agoPatch00146 was half done... this fixes one more case of VTEXT exec.
Chris G. Demetriou [Tue, 1 Jun 1993 00:00:00 +0000 (00:00 +0000)]
Patch00146 was half done... this fixes one more case of VTEXT exec.

Patch00146 was half baked; that only took into account one case, i.e.
mark text busy when it's running; the other case is when a binary is
*already* open for writing.

chris

Date: Mon, 24 May 93 05:58:35 -0700

AUTHOR: Chris Demetriou (cdg@sun-lamp.cs.berkeley.edu)
386BSD-Patchkit: patch00165

31 years agoFix lp{t,c}_port_test routine to have a time out spin loop
Rodney W. Grimes [Tue, 1 Jun 1993 00:00:00 +0000 (00:00 +0000)]
Fix lp{t,c}_port_test routine to have a time out spin loop

It seems that some printer ports take a while for the data port to
settle down.  I added a 100 count spin loop to wait for the data to stabalize
in the port to the lpx_port_test routine in both lpa.c and lpt.c.

lpflag was being used by both the lpt and lpa drivers.  Now unique.

Date: Tue Jun  1 13:54:30 PDT 1993

AUTHOR: Rodney W. Grimes
386BSD-Patchkit: patch00164

31 years agoNew high speed fast interrupt com port driver (sio.c)
Andrey A. Chernov [Thu, 27 May 1993 00:00:00 +0000 (00:00 +0000)]
New high speed fast interrupt com port driver (sio.c)

This is the new fast interrupt com port driver (sio.c) that uses
the new interrupt mechanism to achive high speed serial line operation
without silo over flows.

Included is Andrew Chernov's tty compatibility fixes as edited
by Bruce Evans,  along with Guido van Rooij's enhancements to Bruce's
com driver based upon Chris Demetriou's com driver.

I munged all of this work to make it go in as sio.c, made it possible
to compile either com based or sio based kernels, etc, etc...

Rod Grimes
Date: Sat May 29 15:35:17 PDT 1993

> --------------------- Bruce's README ---------------------------------------
> This is the third version of my com driver for 386BSD.  Not much has
> changed except the packaging since the last version (com-0.1, 28 Sep
> 1992).  General kernel changes have been split off from the com driver
> into the packages npx-0.4.tar.Z and intr-0.0.tar.Z but are still required
> for this driver.  Standard patches from the patch kits are duplicated
> here if necessary.
>
> The main point to this com driver is that it is fast.  On a 486/33, the
> kernel changes in intr-0.0.tar.Z give a maximum interrupt latency for
> "fast" interrupts of about
>  5 usec + (total latency of all fast interrupt handlers).
> The fast interrupt handler in this driver adds about 10-20 usec maximum
> latency per non-FIFO line.  This allows the com driver to easily support
> several dumb 8250 UARTs at 115200 bps on a 486/33.  Even a slow 386SX
> can support one.  (I get 9500 cps through slip from a 486/33 to a 386/20.
> This takes about 30% of the 486 and 100% of the 386.  The slip layers
> and the upper layers of the tty driver are still very inefficient.)
>
> The latency is up to 16 times more for lines with FIFOs.  If this becomes
> a problem then the latency can be reduced by polling all fast devices in
> a good order whenever one of them interrupts.
>
> ------------
> Installation
> ------------
> 0. Install npx-0.4.tar.Z and intr-0.0.tar.Z.
>
> 1. Change to some harmless directory (like /var/tmp) and untar this
> package into the sys subdirectory and the files com.diff, tip.diff
> and another copy of this README.
>
> 2. Put pure-0.1 copies of all the files to be patched into appropriate
> subdirectories of sys.  Already-patched files will NOT work.
>
> 3. Apply the patches in com.diff, remove or save old files, back up
> files to be overwritten, and copy all the files in subdirectories of
> sys to corresponding subdirectories of /sys.
>
> 4. Run the new config on your usual configuration file.
>
> 5. Run "make clean; make depend; make" on the new kernel.
>
> 6. Boot the new kernel and test it, especially the com driver.
>
> 7. (Optional.)  Apply the patch to tip to get support for speed 115200.
> Similar patches might work for getty and slattach.  But these old
> programs should be fixed to use termios instead of hacked to support
> undefined speeds.
>
> ---
> Use
> ---
> 1. The com numbering is 0-based but everything works if you have only
> com01, com02, ... (actually you will have edit com.c to add more softcom
> routines for com03 up).
>
> 2. RTS/CTS flow control is not the default.  All lines start up in clocal
> mode so stty can be used to change the mode.  I change it in /etc/netstart:
>
>     nohup slattach /dev/com01 38400 >/dev/null
>     stty 115200 crtscts </dev/com01 # slattach doesn't support 115200
>     stty 2400 crtscts </dev/com02
>
> -------
> Changes
> -------
> sys/i386/i386/conf.c (diffs):
>  o The com driver now requires use of the device-stop switch entry.
> sys/i386/isa/com.c:
>  o This now works at 115200 bps with about 15% load on a 486/33.
>    With RTS/CTS flow control it still works at 115200 bps when the
>    486/33 is slowed down by a factor of 20 (but throughput is then
>    reduced to about 3000 cps).  RTS/CTS flow control is NOT the
>    default.  Use "stty crtscts </dev/com1" in /etc/rc to get it.
>  o The minor numbers are as in 0.1 (1 = com1 etc.).
>  o Too many other changes to list.
> sys/i386/isa/ztodo:
>  o To-do list for com driver.
> sys/kern/tty.c (diffs):
>  o Sign extension fix for TIOCSTI off the net.
>  o Kludge to hook in RTS/CTS flow control.
>  o Avoid sleeping on lbolt, it slows down output unnecessarily.
> sys/kern/tty_compat.c (diffs):
>  o Make it agree with the com driver on what (high) speeds are
>    supported (the speed tables are duplicated too much).
>  o Chernov's fixes off the net (edited).  Compatibility is still
>    not good enough.
> sys/kern/tty_ring.c (diffs):
>  o New function rb_write() to copy from linear buffers to linear
>    buffers.
> sys/kern/tty_tb.c (diffs):
>  o Another compatibility fix by Chernov.
> sys/net/if_sl.c, sys/net/if_slvar.h (diffs):
>  o Mostly standard patches from the patch kit, without the extra
>    return in the patch kit, mainly to handle errors better.  The
>    patch to rip_usrreq() in sys/netinet/raw_ip.c is also important
>    but is not supplied here (just delete the `rights' argument).
> sys/sys/tty.h (diffs):
>  o Standard patch from the patch kit (actually the bug was missing
>    in 0.0, and was never in my version 8-).
>  o The buffer sizes and watermarks may now be stupid.
> usr/src/usr.bin/tip/tip.c (diffs):
>  o Support more speeds (still limited by crufty sgttyb interface).
> --------------------- Guido's README ---------------------------------------
> WHAT IS IT, AND FOR WHO?
>
> This package contains patches to Bruce's comdriver to make it
> support multi-com boards and have bidirectional capabilities. It
> is a kind of mixture of Chris's and Bruce's driver.
>
> This is still beta software.
>
> In order to run it you must have installed:
> 1) npx-0.4 and intr-0.0. IF NOT, I STRONGLY DISCOURAGE THIS SOFTWARES
> USAGE AS FOR NOW. If you still want to give it a try, you should know
> that as far as I know, npx-0.4 only works well on 486 systems.
> 2) The current patchkit.
>
> MULTI-COMPORT CARDS
>
> IMPORTANT: please read this well, since it contains a bit more
> information then in Chris's driver, including hints on what to
> change when it didn't work for your card.
>
>
> It is important to know that there are different kinds of multi-comport
> cards.
> 1) AST multiport cards like KW-531A, where there is a master
>    controller that is able to control the complete boards behaviour.
> 2) Cards like a HOSTESS 550 or DigiBoard DigiCHANNEL PC/x, that do
>    not have such a thing. (though perhaps they have special registers
>    that tell you on which port to look for the interrupt just given
>    (DigiBoard), or to enable/disable complete ports (HOSTESS)).
>    These cards just share the IRQ but behave like separate comports.
>
> The original driver from cgd was meant for the first type. In a later
> stadium it could handle the second type, though it didn't mention it
> specificly.
>
> If you have a type-1 board, just follow the instructions below. If
> it doesn't work for you, you have to consult your boards specifications
> and change the parts in the driver marked with YYY. If you do so,
> could you please mail me what board you have and how you fixed it?
> That information will be included in future releases of this package.
> At the end of this file, I included a patch once posted to the net
> in order to be able to use a RT 4-port card with cgd's driver.
>
> If you own a type-2 card, just put options COM_MULTIPORT (see below)
> in your config file plus lines for each separate comport, BUT DO
> NOT SPECIFY any flags for these ports. You will not see it is a multiport
> card at bootup, because it actually just isn't one. It is just the
> same as a couple of separate boards.
>
> NOTE: in the same way as a type-2 card you can use different single
> (or double) port cards, sharing an irq, e.g. com0 and com2 on irq4
> IF YOUR HARDWARE supports sharing of irq's (the interrupt lines on
> the com boards should not be connected directly to the irq line on
> the pc's bus, though with an open-collector output (?)) SO USE IT
> AT YOUR OWN RISK!
>
>
> HOW TO INSTALL
>
> First get bde's com-0.2 package and install it.
>
> The patches to apply are in the file 'diffs'. It contains:
> 1) Patches to the driver itsself (sys/i386/com.c).
> 2) A patch to /sys/sys/ioctl.h to support a few extra ioctl callsi,
>    needed for comcontrol to function.
> 3) A patch to tty_compat.c fixing a bug introduced by bde's patch
>    to this file. (/sys/kern/tty_compat.c) The patch is discussable,
>    but it works: without it, the following piece of code might
>    actually changes the tty settings!!!
> 4) A patch to isa.c and iss_device.h adding a function and prototype.
>
>     ioctl(file, TIOCGETP, &tty);
>     ioctl(file, TIOCSETP, &tty);
>
>    As soon as a decent solution has been found to correct this in
>    better way, I'll make sure patches or posted.
>
> Copy the files to patch to some harmless directory, and apply the
> diffs.  After that, install them in the appropriate directory, or
> flame me if it didn't succeed (at least drop me an email ;-)).
>
> cd to / and untar comcontrol.tar
> (This places the sources for the "comcontrol" program
> in /usr/src/sbin.)
> Apply the comcontrol.diff to the Makefile in /usr/src/sbin.
> (don't apply this patch if you don't want it in /usr/src/sbin!)
>
> cd /usr/src/sbin/comcontrol ; make ; make install clean
> (or whereever you placed the thing)
>
> Modify your kernel config file to support the things you want. See
> below for an explanation on how that is done. See also the example
> config file.
>
> Further, you should know that bde's driver sets the default flags
> not to the TTYDEF_?FLAG values. See the source.
>
> Make a new kernel. At this point you may discover that com.c doesn't
> compile. If so, you probably didn't prototype all kernel functions,
> and/or don't have a typedef for timeout_func_t. The following patch
> may help you:
>
> *** com.c~ Wed Apr  7 22:28:48 1993
> --- com.c Wed Apr  7 22:29:07 1993
> ***************
> *** 1070,1075 ****
> --- 1070,1076 ----
>    struct com_s *com;
>    int s;
>    int unit;
> +  extern ttyinput();
>
>    if (com_events == 0)
>    return;
> ***************
> *** 1493,1499 ****
>    struct com_s *com;
>    int unit;
>
> !  timeout((timeout_func_t) comwakeup, (caddr_t) NULL, 1);
>    if (com_events != 0)
>    /* schedule compoll() to run when the cpl allows */
>    schedsoftcom();
> --- 1494,1500 ----
>    struct com_s *com;
>    int unit;
>
> !  timeout((int (*)()) comwakeup, (caddr_t) NULL, 1);
>    if (com_events != 0)
>    /* schedule compoll() to run when the cpl allows */
>    schedsoftcom();
> -------------
>
>
> (What follows now is almost literally copied from Chris's readme
> in his compackage, but *please* read it)
>
>
> WHAT TO DO NEXT:
>
>  Here's where it gets tricky; depends on what *you* want to do.
>  You'll probably have to do at least the following:
>
>  (1) make some new device nodes for "callout" devices
>  (see "MAKING DEVICE NODES" below)
>  (2) set up ports as bidirectional, by adding a few lines to
>  /etc/rc.local (see "USING comcontrol" below)
>
>  if you're familiar with SunOS's bidirectional serial ports,
>  you'll get this fairly quickly.  otherwise, here's a general
>  explanation:
>
>  Serial ports are useful, and modems are too.  Sometimes you
>  only own one modem, but want to use it for both calling out
>  *and* receiving incoming calls.  Normally, that'd be hard
>  to do, but with bidirectional serial ports, it becomes easy.
>  To do this, you'd simply set the port to be bidirectional,
>  and set up /etc/ttys to put a getty on that port's "incoming"
>  side.  The getty would not actually become "active" until
>  it received a signal that a carrier was detected by the
>  modem on the port.  If the getty is not active, then you
>  can use "tip" or another dialout program to get out through
>  the ports "callout" side.  Each of these "sides" is a different
>  device in /dev, and coordination among the two "sides" of
>  the port is handled in the driver.
>
> MAKING DEVICE NODES:
>
>  The important info:
>  character device
>  major number 8
>  minor number 0..127 for "incoming" sides of ports,
>  or for use when bidirectionality is disabled
>  minor numbers 128..255 for the corresponding "callout"
>  sides of the ports, but only when bidirectionality
>  is enabled.
>
>  I suggest the naming be as follows:
>
>  incoming ports: ttyd0, ttyd1, ttyd2, etc.
>  callout ports:  cua00, cua01, cua02, etc.
>
>  If you use those names for the incoming ports, ps and other
>  related utils work right, otherwise they don't work in the
>  way one would expect. Login will pass messages like:
>  Apr  6 17:10:46 gvr login: DIALUP ttyd0, guido
>  to the syslog daemon. If you don't use the 'd' in ttyd0
>  but another letter or number, that is still free.
>
>  to do this the commands you want are like:
>
>  mknod c 8 0 /dev/ttyd0
>  mknod c 8 1 /dev/ttyd1
>  mknod c 8 2 /dev/ttyd2
>  .
>  .
>  .
>
>  mknod c 8 128 /dev/cua00
>  mknod c 8 129 /dev/cua01
>  mknod c 8 130 /dev/cua02
>  .
>  .
>  .
>
> USING comcontrol:
>
>  comcontrol works as follows:
>
>  if you want info about the bidirectional status of
>  a port, you say:
>
>  comcontrol <dev name>
>
>  where <dev name> is the name of the device node for the incoming
>  side of the port.
>
>  if you want to set the bidirectional status of the port,
>  you say:
>
>  comcontrol <dev name> bidir
>
>  to enable bidirectionality, or
>
>  comcontrol <dev name> -bidir
>
>  to disable it.  Again, <dev name> is the name of the device
>  node for the incoming side of the port.  It is strongly recommended
>  that you do *not* change the bidirectional status of a port
>  while there are programs using the port... (read that as:
>  if you do, and it breaks, don't yell at me; that's a really
>  weird thing to do.)
>
>  All users with read access to the port device node can
>  use comcontrol to get the port's status.  Only root
>  can set a port's status.
>
>  The standard way to use comcontrol is to put invocations of it
>  in the /etc/rc.local startup script.
>
>  For instance, for the machine described by the SAMPLE.CONFIG
>  file, the following lines are in the rc.local:
>
> #/sbin/comcontrol /dev/ttyd0 bidir # mouse -- unidirectional
> #/sbin/comcontrol /dev/ttyd1 bidir # terminal -- unidirectional
> /sbin/comcontrol /dev/ttyd2 bidir # printer -- bidir, in case i'm bored
> /sbin/comcontrol /dev/ttyd3 bidir # modem 1
> /sbin/comcontrol /dev/ttyd4 bidir # modem 2
>
>  note that ports default to unidirectional.
>
> KERNEL CONFIG OPTIONS:
>
>  COM_MULTIPORT:
>
>  Use this to enable multiport serial board handling.
>  This option also affects the way that serial interrupts
>  are processed, and I'd recommend that it always be
>  defined when using this driver.
>
>  COM_BIDIR:
>
>  Enable the bidirectional port features of the serial
>  driver.  If you don't include this option in your
>  kernel config, "comcontrol" is a waste of time;
>  w/o this option, the ports *can't* be bidirectional.
>  With this option enabled, ports default to being
>  unidirectional, but comcontrol can change that.
>  Without this option, you'll see a *slight* performance
>  boost, but this boost is so slight (i.e. just a few
>  instructions, that is, not noticable) that I'd
>  reccomend that you leave it enabled unless you've
>  good reason not to.
>
>
> BUGS
>
> There probably are. I don't have multi-port cards. However in working
> with few of them, and working with cgd's comdriver I gained a good
> understanding in what is going on in his driver, and how it should
> be put into bde's comdriver. Still, the only thing i can assure you
> is that it compiles. BUT:
> If you still have problems, please tell me as soon as possible so
> I can help you and others out.
>
> TODO
>
> Maybe add dtrwait as present in cgd's driver?
> Certainly modify this readme...now it's just a bunch
> of unorganised lines.
>
> THANKS TO
>
> Bruce Evans, bde@runx.oz.au for npx, intr and his *fast* comdriver
> Chris Demetriou, cgd@agate.berkeley.edu for adding bidir and multiport
>            facilities to the comdriver.
> All others, that I don't know of, that contributed.
>
>
> -Guido, guido@gvr.win.tue.nl
>
> PATCHES FOR SPECIFIC MULTI-COM CARDS:
>
> Board: RT 4-port card
> Provided by: dmuntz@eecs.umich.edu
> Patch: Was provided for cgd's driver, is not updated (yet)
>  for this driver.
>
> *** /usr/sys/i386/isa/com.c.cgd Tue Jan 26 11:31:15 1993
> --- /usr/sys/i386/isa/com.c Tue Jan 26 11:32:44 1993
> ***************
> *** 163,168 ****
> --- 163,185 ----
>   int comprobe(dev)
>   struct isa_device *dev;
>   {
> +  /* reset interrupts if we're an RT card (only once per card) */
> +  if ((dev->id_iobase >= 0x1230) &&
> +  ((dev->id_iobase & 0x00000fff) == 0x00000230)) {
> +  switch (ffs(dev->id_irq)-1) {
> +  case  9: outb(0x2f2,0);
> +   printf("resetting irq 9\n");
> +   break;
> +  case 10: outb(0x6f2,0);
> +   printf("resetting irq 10\n");
> +   break;
> +  case 11: outb(0x6f3,0);
> +   printf("resetting irq 11\n");
> +   break;
> +  default: printf("irq unsupported by RT card\n");
> +  }
> +  }
> +
>    /* force access to id reg */
>    outb(dev->id_iobase+com_cfcr, 0);
>    outb(dev->id_iobase+com_iir, 0);
> ***************
> *** 575,580 ****
> --- 592,605 ----
>    register int i,j;
>    register u_char code;
>    register char possiblymoreirqs;
> +
> +  /* reset interrupt 9,10,11 if that's the origin of this one */
> +  switch (ffs(com_irq[unit])-1) {
> +  case  9: outb(0x2f2,0); break;
> +  case 10: outb(0x6f2,0); break;
> +  case 11: outb(0x6f3,0); break;
> +  default: ;
> +  }
>
>   /* printf ("%d\n",unit); XXX */
>    do {

AUTHOR: Bruce Evans (bde@runx.oz.au)
AUTHOR: Andrew A. Chernov (ache@astral.msk.su) (POSIX fixes for tty_compat.c)
AUTHOR: Guido van Rooij (guido@gvr.win.tue.nl) (com driver enhancements)
AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com) (intergrate, and cleanup)
386BSD-Patchkit: patch00163

31 years agoNew console driver - codrv
Holger Veit [Wed, 26 May 1993 00:00:00 +0000 (00:00 +0000)]
New console driver - codrv

This is the new codrv console driver it is based upon
the codrv-0.1.2-110593.tar.z release of the codrv from Holger.

Below is the original README file from the release of codrv.  Some of
it is no longer applicable as most of the work has been done for you by the
patching software.

----------------------------- README ---------------------------------------
This is codrv-0.1.2.

The structure of this distribution has been modified to
allow a more simple installation.

Don't even think to install this code if you do not have
386bsd patchkit-0.2.3 installed. (for NetBSD-0.8 there may be some
minor modifications, and for 386bsd-0.2 there will be a separate
distribution).

Probably you have now test-unpacked the tar file into the tmp directory
and found two subtrees:

/tmp/usr and
/tmp/dev

This tar file may be unpacked as root from the / directory.
It will install several files in the correct places.
Some files have an extension .hv. These files are versions of existing
versions that have been patched by me to integrate codrv.
The original files are are still in place.
Make a diff to check which changes are necessary for you and
if it is okay apply the diff as a patch or replace the original
file with the corresponding .hv file. WARNING:
Don't remove the original file entirely; you will need it for
the next patchkit.
The files have been modified based on patchkit-0.2.3 files.

They are:

./dev/MAKEDEV.hv
changes the mode to create the codrv devices

./usr/share/misc/termcap.hv
added special entries for the codrv terminal emulation.
If you had a alpha version of codrv-0.1.2, you already have
thes entries.

./usr/src/sys.386bsd/i386/isa/kbd.h.hv
added some 8042 defines

./usr/src/sys.386bsd/i386/i386/conf.c.hv
added the codrv devices in slot 21

./usr/src/sys.386bsd/i386/conf/files.i386.hv
added the codrv source files

./usr/src/sys.386bsd/kern/init_main.c.hv
./usr/src/sys.386bsd/i386/isa/pccons.c.hv
these two fix a bad coding in init_main: init_main
contains a printf with an ESC[3;15x escape sequence.
This does not allow proper exchange of the terminal
emulation code. This ESC code is for instance used
in a vt100 emulator for returning status information
and may crash the system here.
The fix introduces two new service functions
cons_highlight/cons_normal which must be implemented
in the console driver independently from a terminal
emulation.

1. Once you have all these files analyzed and changed, you might try
   to build a kernel with codrv.
   See /sys/i386/conf/CODRV for a reference. You might of course choose
   to add your own devices in addition to codrv.
   You may also have a look into the config file MINITERM.
   This builds a kernel with many features of codrv removed which
   is smaller (though not very much). Such a kernel can be used as a
   basis for a installation diskette.

2. Also build the keymap utility which resides in /usr/src/sbin/keymap
   and will be installed in /sbin.

3. See /usr/share/misc/fonts/* for a list of fonts that can be loaded
   into the system.

4. See /usr/share/misc/keycap for a number of keymaps that are
   already available. See the various man pages in the /usr/src/sbin/keymap
   directories for reference. If you create a new keymap or find
   bugs in an existing entry, please send it to the address below
   for integration in the next version.

5. If you find any bugs or have questions, don't fear to contact me
   at the address below. I don't bite (well almost...).

6. For the hacker:
   The interesting files are /sys/sys/ioctl_pc.h for a reference of
   the ioctls, and /sys/i386/isa/codrv/co_hdr.h for some switches.
   If you don't like the blue boot messages, you find the color
   variables in /sys/i386/isa/codrv/co_hdr.h.

Have fun

Holger

--
Holger.Veit@gmd.de

AUTHOR: Holger Viet (Holget.Veit@gmd.de)
386BSD-Patchkit: patch00162

31 years agoAdd misc to /usr/src/share so codrv can install keycap correctly
Rodney W. Grimes [Wed, 2 Jun 1993 00:00:00 +0000 (00:00 +0000)]
Add misc to /usr/src/share so codrv can install keycap correctly

This adds misc to /usr/othersrc/share.

AUTHOR: Rodney W. Grimes
386BSD-Patchkit: patch00161

31 years agoNew device support patch, if_ed, sio, tw, codrv
Holger Veit [Wed, 26 May 1993 00:00:00 +0000 (00:00 +0000)]
New device support patch, if_ed, sio, tw, codrv

Add support for more drivers to the conf.c, files.i386, and MAKEDEV
files.  Note that this patch does not add the actual drivers, it just adds
support for them.

NOTE:  We are patching an installed file (/dev/MAKEDEV), this will need to
be propogated to /usr/src/etc when that patch is done.

AUTHOR: Holger Veit (holger.veit@gmd.de) (codrv support)
AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com)
386BSD-Patchkit: patch00160

31 years agoFix to boot block memory size detection
Rodney W. Grimes [Sun, 23 May 1993 00:00:00 +0000 (00:00 +0000)]
Fix to boot block memory size detection

Locore.s expects to allocate 28K of space in the bss which
must fit below the 640K limit.  This space was not accounted for in
the new boot blocks.  This patch corrects that.  Without this patch
a kernel that was >612K bytes in size would have certain data allocated
in the video memory and would lead to some real strange panics.

Date: Sun May 23 04:30:28 PDT 1993

AUTHOR: Rodney W. Grimes
386BSD-Patchkit: patch00159

30 years agoComplete rewrite of the interrupt and spl code (speed improvement)
Bruce Evans [Sun, 8 Aug 1993 00:00:00 +0000 (00:00 +0000)]
Complete rewrite of the interrupt and spl code (speed improvement)

Way more than what could be put here.  This is a complete rewrite
of the interrupt handling code and the spl mechanisms.  This code is much
faster and should completly eliminate silo over flows for speeds up to
19200 on even the slowest of machines.  The only other part needed to
completly eliminate the silo over flows is a new com driver that is
provided in a later patch.

I have reworked some of Bruce Evans code to enhance certain areas
that were not functional in the code provided by Bruce, which include the
ability to build and run the GENERICISA kernel.
Rod Grimes

AUTHOR: Bruce Evans (bde@runx.oz.au)
AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com) (intergrate, and cleanup)
386BSD-Patchkit: patch00158

31 years agoFix bsd.lib.mk so that sh args are not overflowed
Rodney W. Grimes [Tue, 27 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Fix bsd.lib.mk so that sh args are not overflowed

The number of arguments to the shell during a make cleandir in
some of the libraries was too many.  This splits the rm's up into 2
parts, making it easier for the shell to handle.

AUTHOR: Rodney W. Grimes
386BSD-Patchkit: patch00157

31 years agoA real termcap entry for pc3
Bruce Evans [Tue, 27 Apr 1993 00:00:00 +0000 (00:00 +0000)]
A real termcap entry for pc3

This puts a real termcap entry for pc3 in
/usr/src/share/termcap/termcap.src.

AUTHOR: Bruce Evans
386BSD-Patchkit: patch00156

31 years agoBadblock reporting and timeout fixes for wd.c, interm hacks.
Brett Lymn [Mon, 17 May 1993 00:00:00 +0000 (00:00 +0000)]
Badblock reporting and timeout fixes for wd.c, interm hacks.

Right now, if the user executes dd if=/dev/rwd0c of=/dev/null
bs=conv,noerror, the kernel will not report any bad blocks it encounters.
The version of bad144 by Jim Bevier will not work without this patch.

Looking at the affected code, it seems that the wd driver should only
be turning off kernel error messages on partition d (WDRAW is 3), but that is
not the case.  My guess is that the kernel is calling wdopen on partition d
even if one is trying to dd from wd0a.  Actually, can you think of any valid
cases where the DKFL_QUIET flag should be set?  It seems to me that the user
would always want to know when an umapped bad block is encountered.  Because
checking the DKFL_QUIET flag does take some cycles, we might as well remove it
complete from wd.c if we think we would always want error messages enabled.  If
you think that is a good idea, then I can produce another patch to do that.

Terry
Date: Tue, 6 Apr 1993 13:05:03 -0500

The Problem:
        On my 486/25 with a DTC controller and Seagate Wren ESDI disk
I would sometimes experience a system lockup where the computer would
just sit there with the disk controller led on all the time.  This
lock up would occur usually when I was doing some disk intensive
activity like making /usr/src or committing things to CVS.

The Fix:
        In wd.c there is a function called wdstart that has three
while loops that loop waiting for the controller/disk to come ready.
In my case the disk sometimes would never become ready so the system
would hang in wdstart.  I have inserted timeout code into all the
while loops in wdstart so that if the controller or disk are busy for
too long then the controller is reset and the command is restarted.
The code is written so that you can override the default timeout by
putting the WDCTIMEOUT option in the kernel config file with the
approriate number.

Brett Lymn                              | "Hey, you can't do that here"
Date: Sat, 10 Apr 1993 16:35:34 +0930 (CST)

Additional fixes:
There where still several spin wait loops that used a hard
coded constant of 1000000, these have been replaced with WDCTIMEOUT.
I also increased WDCTIMEOUT to 10000000 per Bruce Evans as now that
the spl code is so fast it seems to be needed.

Rod Grimes
Date: Mon May 17 10:01:50 PDT 1993

AUTHOR: Terry Lee <terry@uivlsisd.csl.uiuc.edu>
AUTHOR: Brett Lymn (blymn@mulga.awadi.com.AU)
AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com)
386BSD-Patchkit: patch00155

31 years agoMajor rewrite of npx code (npx-0.5 + 2 patches to it)
Bruce Evans [Sun, 23 May 1993 00:00:00 +0000 (00:00 +0000)]
Major rewrite of npx code (npx-0.5 + 2 patches to it)

This is version 0.5 of Bruce Evans wonderful npx code.  He
supplied 2 more patches to me after shipping me the initial 0.5 release,
they have been applied to this code.  I have also added a small change
to the npx.c file that causes the probe information to report the correct
number of registers.

There were also some small changes to the original diffs by Bruce
to make this install on top of a 0.2.3 patch kit source tree.

It includes fixes that now allow this code to work on 386+387 machines!

Date: Wed Apr 21 06:41:47 PDT 1993

AUTHOR: Bruce Evans (???)
386BSD-Patchkit: patch00154

31 years agoRewritten floppy driver
Julian Elischer [Tue, 20 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Rewritten floppy driver

This is a rewritten floppy drive, you will need to read the
source to see all the changes.  They are massive.

AUTHOR: Julian Elischer (???)
386BSD-Patchkit: patch00153

30 years agoINCREASED tcp_sendpace AND tcp_recvspace TO 16K BYTES
David Greenman [Fri, 20 Aug 1993 00:00:00 +0000 (00:00 +0000)]
INCREASED tcp_sendpace AND tcp_recvspace TO 16K BYTES

This is a experimental patch, it should increase the performance of
TCP/IP, but may actually slow it down when talking to certain
implementations of TCP/IP.

PLEASE report any problems with this patch to rgrimes@agora.rain.com,
as we need feedback.  If it seems to really help, we would be interested
in that too.

This patch has been revised, most people should now install this patch,
if it creates a problem for you please let us know.  You can work
around this by adding an options "TCP_SMALLSPACE" to you kernel config
file.

AUTHOR: David Greenman (davidg@implode.rain.com)
AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com)
386BSD-Patchkit: patch00152

31 years agoAdds NFS support for isofs filesystem code.
Jagane D Sundar [Fri, 23 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Adds NFS support for isofs filesystem code.

This patch provides the functions fhtovp and vptofh required for NFS
support of the isofs filesystems. After applying this patch you can NFS export
isofs mounted filesystems.

Date: Fri, 12 Mar 93 12:36:53 -0800

AUTHOR: Jagane D Sundar ( jagane@netcom.com )
386BSD-Patchkit: patch00151

31 years ago57600 and 115200 baud kernel, includes tip, and uucp support
David Greenman [Thu, 22 Apr 1993 00:00:00 +0000 (00:00 +0000)]
57600 and 115200 baud kernel, includes tip, and uucp support

   The following patches add support for 57600 and 115200 baud in the kernel,
include files, tip, and uucp.

Date: Thu, 22 Apr 93 02:23:34 -0700

AUTHOR: davidg@implode.rain.com (David Greenman)
AUTHOR: rgrimes@agora.rain.com (Rodney W. Grimes)
386BSD-Patchkit: patch00150

31 years agoFixed error reported in new scsi code, cd.c and sd.c, st.c was okay
Julian Elischer [Sun, 23 May 1993 00:00:00 +0000 (00:00 +0000)]
Fixed error reported in new scsi code, cd.c and sd.c, st.c was okay

The block number when an error occured was not properly reported due
to extra commas (,) in some printfs.

Added support for the Pioneer DRM-600 cdrom changer which uses logical
unit number to change cdroms.  This is simply an add to the table in scsiconf.c
Rod Grimes

AUTHOR: Julian Elischer (???)
AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com)
386BSD-Patchkit: patch00149

31 years agoImproved expr
J.T. Conklin [Tue, 20 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Improved expr

expr did not handle: parens, string expressions that happen
to be numeric, division by zero, or regular expression error
messages.  This patch fixes all of those bugs, plus makes
some performance / memory use enhancements.

Regression Tests:
$ expr \( 2 + 3 \) \* 5 $ expr '0000001' : '.*\(.....\)$'
25 00001
$ expr 0123 $ expr 0123 = 123
0123 1
$ expr '0001' : '.*\(' $ expr '0001' : '[abc'
expr: unmatched () expr: unmatched []
$ expr 1 / 0 $ expr 1 % 0
expr: devision by zero expr: devision by zero
$ expr 0; echo $? $ expr 1; echo $?
0 1
1 0

Date: Tue, 23 Mar 93 11:38:57 PST

AUTHOR: J.T. Conklin <conklin@talisman.kaleida.com>
386BSD-Patchkit: patch00148

31 years agoDetect and prevent kernel deadlocks in VM system
Paul Kranenburg [Tue, 20 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Detect and prevent kernel deadlocks in VM system

Both deadlocks result from VM objects with dirty pages entering the object
cache. Objects enter the object cache if their reference count drops to
zero and they have the 'can_persist' bit set. Normally, the persist bit
is turned off when the object is going to be written to. But there appear
to be circumstances under which the bit is not cleared when it ought to be.
One such case arises when one of the objects' resident pages is written
behind the VM system's back (eg. by exploiting another bug such as running
"main{} { read(0, 0, 1); }"). Another example (see code below) involves
mmap()ing a file read only, and then using mprotect() to enable writing
on the mapped addresses.

Let's consider the first case. The program's text is mapped read only by
the execve(2) system call. The program bug causes a protection violation,
the kernel bug causes it to missed (the read() completes, modifying the
text segment). The program exits, the text object's refcount goes to zero
and the object enters the object cache. All of the objects pages are
put on the inactive list, during which the pmap module is consulted. The
hardware has noticed the inadvertent write to one of the pages, so this
page's clean bit is now turned off. This dirty page now hangs around
on the inactive list for a bit, until the pageout daemon decides it is
time for this page to recycled. Since the page is not clean, a pager
(in this case the vnode pager) is called upon to write the page's contents
to its proper backing store. The VFS write routine is called to do the dirty
work. This routine decides that the associated VM object can no longer
be cached and notifies the VM object layer of this fact. Since the refcount
was already zero the object gets destroyed here and now. But it then it is
noticed that a paging operation is in progress on this object (this is
in vm_object_terminate()) and the current process is put to sleep waiting
the pageout to finish. Remember that all this takes place in the context
of the pager process. The result is a paging daemon that will sleep forever.

In the second case, a similar sequence of events lead to a deadlock on an
IO buffer. I'll be brief this time:

mmap(..., PROT_READ, ...) marks the VM object as cacheable

next mprotect(.., PROT_WRITE) fails to undo that

at process exit, the object enters the cache with dirty pages

another process comes along, opens the same file and writes it

VOP_WRITE() wants to uncache the object still associated with the
vnode. Unfortunately, ufs_write() does so only after acquiring an
IO buffer with balloc().

vm_object_terminate() wants to clean the dirty pages of the object,
so it calls the pager's put routine, which in turn calls VOP_WRITE()

ufs_write() is called again (recursively) and wants the IO buffer
again, which is now locked.

process is put to sleep in bread(), never to wake up again.

The first case clearly demonstrates that you need only one misbehaving
process to bring the pageout daemon to its knees. After that, it won't
take very long before you're left gazing at a not-so-responsive screen.

What can be done about this? I propose the patch to vm/vm_object.c below
as a safe-guard against dirty objects that want to go in the object
cache. Other than this, the kernel code must be carefully screened so
that the 'can_persist' field gets turned off in a timely manner whenever
an object looses its read-only status (vm_map_protect() is a candidate, as is
vm_fault()).

I've also changed ufs_write() to take care not to call vnode_uncache()
while it has buffers locked.

-pk

-----------------------------------------------------------------------
This program demonstrates 'case 2', run it twice in a row and watch
its ps(1) status go to 'D'.

#include <sys/types.h>
#include <sys/mman.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <fcntl.h>

#define SIZE 4096

struct stat statbuf;

main()
{
        char *ad;
        int i, j;
int fd;

fd = open("xxx", O_RDWR|O_CREAT, 0666);
if (fd == -1) {
perror("open");
exit(1);
}
#if 0
if (ftruncate(fd, SIZE) < 0)
perror("ftruncate");
#else
if (lseek(fd, SIZE-1, 0) < 0)
perror("lseek");
if (write(fd, "", 1) != 1)
perror("write");
#endif

if (fstat(fd, &statbuf) < 0)
perror("stat");

printf("statbuf.st_size = %d\n", statbuf.st_size);

ad = mmap(0, SIZE, PROT_READ, MAP_FILE|MAP_SHARED, fd, 0);
if ((int)ad == -1) {
perror("mmap");
exit(0);
}

if (mprotect(ad, SIZE, PROT_READ|PROT_WRITE) < 0)
perror("mprotect");

for (j = 0; j< SIZE; j++)
ad[j] = 1;

/*
munmap(ad, SIZE);
*/
printf("Done\n");
return 0;
}

Date: Tue, 20 Apr 93 09:49:06 +0200

AUTHOR: Paul Kranenburg <pk@cs.few.eur.nl>
386BSD-Patchkit: patch00147

30 years agoDo not allow execution of a file that is open for write access
Mark Tinguely [Tue, 10 Aug 1993 00:00:00 +0000 (00:00 +0000)]
Do not allow execution of a file that is open for write access

This patch fixes the system to not allow you to execute a file that is open
for writting.

AUTHOR: markie (tinguely@hookie.cs.ndsu.NoDak.edu)
386BSD-Patchkit: patch00146

31 years agostddef.h patch for XFree86
Richard Murphey [Tue, 20 Apr 1993 00:00:00 +0000 (00:00 +0000)]
stddef.h patch for XFree86

This patch was required for /usr/include/stdlib.h when building
XFree86 with gcc 1.39.  Untill we get rid of gcc 1.39 completely it
will be useful to those who might build X with gcc 1.39.

Date: Wed, 14 Apr 93 01:05:43 CDT

AUTHOR: Richard Murphey (rich@omicron.rice.edu)
386BSD-Patchkit: patch00145

31 years agoPatch for compress.c max file name length bug
Julian Stacey [Tue, 20 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Patch for compress.c max file name length bug

Patch for compress.c max file name length bug

Index: usr.bin/compress 386BSD-0.1

AUTHOR: Julian Stacey <stacey@guug.de> (fallback: <julian@meepmeep.pcs.com>)
386BSD-Patchkit: patch00144

31 years agoNew default 'whois' server address
Steven M. Schultz [Tue, 20 Apr 1993 00:00:00 +0000 (00:00 +0000)]
New default 'whois' server address

Starting on April 1 1993 the NIC whois server changed from
nic.ddn.mil to whois.internic.net.

Repeat-By:
Refer to RFC1400

Index:  usr.bin/whois.c 386BSD-0.1

AUTHOR: Unknown, obtained from comp.unix.2bsd
386BSD-Patchkit: patch00143

31 years agocut -f1 outputs a field separator before the first field.
Simon J Gerraty [Tue, 20 Apr 1993 00:00:00 +0000 (00:00 +0000)]
cut -f1 outputs a field separator before the first field.

cut -f1 outputs a field separator before the first field.

Date: Fri, 2 Apr 1993 01:29:04 +1000
Index: usr.bin/cut 386BSD-0.1

AUTHOR: Simon J Gerraty <sjg@melb.bull.oz.au> <sjg@zen.void.oz.au>
386BSD-Patchkit: patch00142

31 years agoThere are *two* bugs in the 386BSD fifo code
Jay Fenlason [Tue, 20 Apr 1993 00:00:00 +0000 (00:00 +0000)]
There are *two* bugs in the 386BSD fifo code

1: the fi_readers and fi_writers fields of the fifoinfo structure were not being
initialized to 0.  This caused the driver to not sleep the first process to
open the fifo--it thought there was already another process to talk to
(most of the time.)

2: fifo_open() was calling tsleep() without unlocking the inode of the fifo
file.  This caused *any* subsequent access to the file (even an ls (!)) to
hang forever.  Note that this bug was usually masked by bug #1 above.

Note that this patch is suspect:  I think this may result in both the
fifo-reader and the fifo-writer locking the inode at the same time (a no-no).
The kernel might panic if -DDIAGNOSTIC was used (I haven't checked).  I don't
know kernel internals well enough to tell.

Also note that the structure fifo_vnodeops is completely unused (replaced by
the structure fifo_inodeops in ufs/ufs_vnops.c).  The same applies to the
functions fifo_lock() and fifo_unlock().

Date: Wed, 31 Mar 93 17:06:01 EST
Index: sys.386bsd/kern 386BSD-0.1

AUTHOR: Jay Fenlason <hack@datacube.com>
386BSD-Patchkit: patch00141

31 years agodd.c patch to silence compile warnings...
Dave Burgess [Tue, 20 Apr 1993 00:00:00 +0000 (00:00 +0000)]
dd.c patch to silence compile warnings...

Enclosed is a patch to dd.c that silences the warnings that come up
during build.

Index: bin/dd 386BSD-0.1

AUTHOR: Dave Burgess <burgess@hrd769.brooks.af.mil>
386BSD-Patchkit: patch00140

30 years agoBetter errors and fixed UUCP TAYLOR locking in tip
Peter da Silva [Thu, 19 Aug 1993 00:00:00 +0000 (00:00 +0000)]
Better errors and fixed UUCP TAYLOR locking in tip

Handle extra result codes, and obey the Taylor UUCP lock convention.
You also get better error messages.

AUTHOR: Peter da Silva (peter@taronga.com)
386BSD-Patchkit: patch00139

31 years agoTwo fixes to allow NOPROFILE to work from the top level
Rodney W. Grimes [Sun, 11 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Two fixes to allow NOPROFILE to work from the top level

The make files for libterm and the lex lib had unconditionally
added links for profiled libraries, if the profiled libraries are not
build these would fail.  This has been fixed by adding .if !defined(NOPROFILE)
to the Makefiles.

AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com)
386BSD-Patchkit: patch00138

30 years agoMany fixes to the vm system by Yuval Yarom and Bruce Evans
Bruce Evans [Tue, 10 Aug 1993 00:00:00 +0000 (00:00 +0000)]
Many fixes to the vm system by Yuval Yarom and Bruce Evans
Mark VTEXT executables so that install does not cream them

   The following patches were provided by Yuval Yarom and fix the following
problems:

David Greenman:
(Descriptions are in his words. The patches were originally for BSDI, but are
applicable to 386BSD, modified by me when necessary. Patches appear here for
incorporation into 386BSD with his permission. -David Greenman)

1) The page daemon calls vm_map_entry_create to create entries in pager_map.
This call might block waiting for memory.

2) On rare combinations of memory and kernel sizes the system may fault when
allocating the page map structures.  The cause of this is that the estimation
of the number of pages is too low, and the map entry for the additional page
does not fit in the allocated page maps space.  For example if start is
0x10a000 and end is 0x7fe000, the initial estimation is 1755 pages, while
after allocating the required page map space the system finds out there are
1756 pages free.  When attempting to initialize the 1756'th page map entry
the system faults.

3)   Munmap(2) fails to ensure the user does not deallocates parts of
the kernel context of the process, allowing programs like
main(){munmap(0xfdbfe000,8192);} to crash the system with a double
fault.  A similar problem occurs with /dev/vga ioctl VGAIOCUNMAP.

4)   Mmap(2) fails to ensure the user does not maps on parts of the kernel
context of the process, allowing programs like
  #include <sys/types.h>
  #include <sys/mman.h>
  main(){mmap(0xfdbfe000,8192,PROT_READ,MAP_ANON|MAP_FIXED|MAP_PRIVATE,0,0);}
to crash the system with a double fault, and providing a great opportunity
for attaining super user privileges.

Yuval:
The cause of this problem is that, due to a bug in vm_mmap, unnamed
anonymous memory objects are marked as persistant, and remain in the
object cache.  The following patch fixes the problem.

Bruce Evans:
Here are patches to stop ptrace from accessing various inaccessible areas,
to stop direct access to various inaccessible areas from crashing the system,
and a test program.  The patch to sys_process.c requires patch00011 from
the patchkit.

Interesting inaccessible areas include:

1. Unmapped pages below the user area: trap.c faults in a page table just to
   check these.  Up to about 4M of page tables per process may be wasted.
   Not fixed.

2. User area.  Can be read and written using ptrace.  Overwriting the user
   stack and some other items can crash the system.  There may be security
   problems.  Not fixed.

3. User page tables.  Could be read and written using ptrace.  Fixed.

4. Kernel memory.  Could be read and written using ptrace.  Fixed.

5. Last 8M of memory (2 page tables worth).  The top 2 page tables are
   special and must not be used for mapping.  But ptracing to high addresses
   used them and caused panic("pmap_enter: already in pv_tab") on the
   second access.  Fixed.

Bruce

AUTHOR: Yoval Yarom (???), fwd by David Greenman (davidg@implode.rain.com)
AUTHOR: Bruce Evans (???), fwd by David Greenman (davidg@implode.rain.com)
AUTHOR: Paul Kranenburg (pk@cs.few.eur.nl) (trap.c add counter for vmstat)
386BSD-Patchkit: patch00137

30 years agoFixes to allow ps(1) and w(1) to get process command line args
Paul Kranenburg [Sun, 8 Aug 1993 00:00:00 +0000 (00:00 +0000)]
Fixes to allow ps(1) and w(1) to get process command line args

Below is a patch to lib/libutil/kvm.c which allows ps(1) and w(1) to lay
their hands on process command line arguments. Thanks to David Greenman
who taught me about VM shadow objects.

To the best of my knowledge, the diffs are relative to kvm.c.pl2 from the
previous patchkits.

-pk

AUTHOR: Paul Kranenburg (pk@cs.few.eur.nl)
386BSD-Patchkit: patch00136

31 years agoMajor new device support patch, if_ix, com3, com4, speaker, dcfclock
Rodney W. Grimes [Thu, 8 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Major new device support patch, if_ix, com3, com4, speaker, dcfclock

Major rework of GENERICISA, converted to Julians SCSI code, added
devices com3, com4, lpt0, lpa0, lpa1 and pseudo-device speaker.

Major rework of /dev/MAKEDEV, fixed up chown and chmod commands,
added all as an option to build all the most common devices.  Added new
device support.

Fix the error from patch00097 with respect to NLPT should have been
NLPA in the second occurance in conf.c.  Added speaker support.

NOTE:  We are patching an installed file (/dev/MAKEDEV), this will need to
be propogated to /usr/src/etc when that patch is done.

AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com)
386BSD-Patchkit: patch00135

31 years agoMore diagnostics for kmem_malloc panics, gaurd band on NKMEMCLUSTERS,
Andrew Herbert [Thu, 8 Apr 1993 00:00:00 +0000 (00:00 +0000)]
More diagnostics for kmem_malloc panics, gaurd band on NKMEMCLUSTERS,
make param.h more tunable with respect to MCLSHIFT

KMEM_MALLOC:
I solved this problem by ensuring that the buffer cache, which likes doing
malloc(x, M_TEMP) calls and turns out to be by far the main user (spacewise)
of kmem_map, is never able to consume all of the memory available in this
map.

On my 16MB machine, I set NKMEMCLUSTERS to (3072*1024/CLBYTES) in
/sys/i386/include/param.h and changed wfj's /sys/i386/i386/machdep.c
bufpages fix from: [Editor: this part of this patch was moved to patch00113
to reduce .pl levels]

bufpages = min(NKMEMCLUSTERS/2, bufpages);
to
bufpages = min(NKMEMCLUSTERS*2/5, bufpages);

No doubt this is more conservative than is required to avoid the panics, but
it certainly works 100% for me.

Chris:
Panic if kmem_malloc is called with buffer_map as an argument.

VM_MAP_SIMPLIFY:
These 2 additional calls in /sys/i386/vm/vm_kern.c should reduce
fragementation of the vm_map.

MCLSHIFT:
I added some ifndefs so that you can tune the size of mbufs and
mclusters in a kernel config file.  Fixed so that MCLBYTES is dependent
on MCLSHIFT.  Use MCLSHIFT in a kernel config file for tuning the size
of m_buf clusters.  The default size is to small to allow UDP protocols
to use full size ethernet packets, MCLSHIFT=11 -> MCLBYTES=2048 is much
more proper, but this may break other code I have not tested.

AUTHOR: Andrew Herbert (andrew@werple.apana.org.au) (kmem_malloc)
AUTHOR: Chris G. Demetrio (cdg@sun-lamp.cs.berkeley.edu) (kmem_alloc)
AUTHOR: John Dyson - (formerly dyson@ref.tfs.com) (vm_map_simplify)
AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com) (tunable MCLSHIFT)
386BSD-Patchkit: patch00134

31 years agoMajor line printer fixes, and new driver lpa
Andy Valencia [Tue, 6 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Major line printer fixes, and new driver lpa

This is the major patch to make line printer support a reality finally.
It is a mix of a lot of different work.

Eric Haug's initial fixes for the extra comment, and the miss ordered
include files, but not his DOSism change to make the unit number unit-1, we
have learned from the com ports that doing that is a very bad idea.

  Andy Valencia: Slight cleanup and reorganization, try to handle
restarted syscalls.

AUTHOR: Eric J. Haug (ejh@slustl.slu.edu) (Fixed comments and includes) (lpt)
AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com) (New lpt probe)
AUTHOR: Wolfgang Stanglmeier (wolf@dentaro.GUN.de) (lpa code)
AUTHOR: Andy Valencia (jtk@netcom.com) (lpa code fixes)
386BSD-Patchkit: patch00133

31 years agoFixes for locates updatedb.csh script, remove -T from sort
Geoff Rehmet [Sun, 4 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Fixes for locates updatedb.csh script, remove -T from sort

The shell script from locate updatedb.csh had -T options on
all the sort commands, gnu sort does not support the -T option so these
have been removed.

AUTHOR: Geoff Rehmet (csgr@alpha.ru.ac.za)
386BSD-Patchkit: patch00132

31 years agoFixes for crontab and crond
Adam Glass [Tue, 6 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Fixes for crontab and crond

/usr/src/libexec/crond fixed such that it compiles quitely, many
type casts cleaned up and/or added.

/usr/usr/usr.bin/crontab fixed such that it compiles quitely, installs
with the correct permissions, installs both manual pages,

Updated crontab.386bsd to be a pseudo model crontab much more suited
to 386bsd.

AUTHOR: Adam Glass (glass@postgres.berkeley.edu)
386BSD-Patchkit: patch00131

31 years agoFixes for several manual page errors
Sascha Wildner [Sun, 4 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Fixes for several manual page errors

Many small fixes to seven manual pages: sh.1, fread.3, ftp.1,
make.1, awk.1, chpass.1 and csh.1.

AUTHOR: Sascha Wildner (swildner@channelz.GUN.de)
386BSD-Patchkit: patch00130

31 years agoAdd the source code for the pcfs package
James Jegers [Fri, 2 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Add the source code for the pcfs package

This patch adds the source code for pcfs to /sys and patches
the other files that need fixed to support PCFS.

Ralf Friedl provided the fixes that makes PCFS work with nfs and
some performance improvements.

James Jegers submitted a completely patches version of PCFS with
nfs support in it to the patchkit coordinator, and fixes the bug that was
caused by all that patching.

To use the PCFS filesystem you need to add an options PCFS to
your kernel file and rebuild your kernel.

AUTHOR: Paul Popelka (paulp@uts.amdahl.com)
AUTHOR: Ralf Friedl (friedl@informatik.uni-kl.de) (nfs fixes)
AUTHOR: James Jegers (jimj@miller.cs.uwm.edu) (patchkit submission)
386BSD-Patchkit: patch00129

31 years agoFix the top level /usr/src make file, add contrib, games and share
Rodney W. Grimes [Sun, 4 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Fix the top level /usr/src make file, add contrib, games and share

This patch adds the contrib, games and share targets to the
/usr/src/Makefile.

AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com)
386BSD-Patchkit: patch00128

31 years agoAdd the dummy make files for /usr/src/games from the etcdist
Rodney W. Grimes [Fri, 2 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Add the dummy make files for /usr/src/games from the etcdist

This patch adds Makefile and Makefile.inc to /usr/src/games.
These are dummy place holders, if you wish the games, you must get the
optional 90000 series patch to install them.  Note that the 90000 series
patch supercedes what is in the 0.1 etcdist.

AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com)
386BSD-Patchkit: patch00127

31 years agoAdd the header files for netccitt, netiso and netns to /sys
Rodney W. Grimes [Fri, 2 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Add the header files for netccitt, netiso and netns to /sys

This patch adds the header files for netccitt, netiso and netns
from the Net/2 release tape.

AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com)
386BSD-Patchkit: patch00126

31 years agoAdd the source code for /usr/src/usr.sbin from the Net/2 tape
Rodney W. Grimes [Wed, 3 Mar 1993 00:00:00 +0000 (00:00 +0000)]
Add the source code for /usr/src/usr.sbin from the Net/2 tape

This patch adds the source code for the /usr/src/usr.sbin from
the Net/2 release tape.  It adds the following programs:

accton edquota flcopy gettable
htable iostat kgmon quotaon
repquota trpt trsp

AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com)
386BSD-Patchkit: patch00125

31 years agoAdd the source code for /usr/src/usr.bin from the Net/2 tape
Kevin Lahey [Sun, 4 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Add the source code for /usr/src/usr.bin from the Net/2 tape

This patch adds the source code for the /usr/src/usr.bin from
the Net/2 release tape.  It adds the following programs:

error fpr fsplit gprof indent lastcomm
look mt quota sccs tcopy tset
vgrind vmstat window

Kevin Lahey provided the fixes for most of the memory counters
in vmstat, his work was based upon the work by Warren Toomey who wrote
vstat.  Rodney Grimes provided the interrupt counters and other fixes.

It also includes the arnej patch for tset.

AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com)
AUTHOR: arnej ???  (tset fixes)
AUTHOR: Kevin Lahey (kml%rokkaku.UUCP@mathcs.emory.edu) (vmstat memory counters)
AUTHOR: Paul Kranenburg (pk@cs.few.eur.nl) vmstat dk_stat fix
386BSD-Patchkit: patch00124

31 years agoMakefile clean up for include, add netccitt and vm
Rodney W. Grimes [Sun, 4 Apr 1993 00:00:00 +0000 (00:00 +0000)]
Makefile clean up for include, add netccitt and vm

The Makefile for /usr/src/include did not install links or directories
for netccitt or vm.

AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com)
386BSD-Patchkit: patch00123

31 years agoMakefile clean up for rcs it was still using old non .mk syntax
Rodney W. Grimes [Tue, 30 Mar 1993 00:00:00 +0000 (00:00 +0000)]
Makefile clean up for rcs it was still using old non .mk syntax

Rewrote the toplevel Makefile for rcs so that it works with the .mk
syntax and fixed the other to work correctly.

AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com)
386BSD-Patchkit: patch00122