Commit Graph

2554 Commits

Author SHA1 Message Date
Jordan K. Hubbard
e886e3bd22 Add libdisk back to alpha build. 1998-10-01 14:49:57 +00:00
Jordan K. Hubbard
55ff249dd5 Eliminate unaligned access on Alpha and also neaten up this code a little.
Submitted by:	dfr
1998-09-30 21:40:51 +00:00
Dmitrij Tejblum
60abf62bfa Debug when an environment variable set, no when it is unset. 1998-09-30 19:17:51 +00:00
John Birrell
cffdbf7096 Revise test code for sigwait and add test code for sigsuspend.
Submitted by: Daniel M. Eischen <eischen@vigrid.com>
1998-09-30 07:14:02 +00:00
John Birrell
058716097d Revise test code for sigwait and add test code for sigsuspend.
Submitted by: Daniel M. Eischen <eischen@vigrid.com>
1998-09-30 07:08:09 +00:00
John Birrell
f51ea46d24 Fix a comment. 1998-09-30 06:42:29 +00:00
John Birrell
d3bb66886d Cosmetic cleansing. This code requires extra work to keep the garbage
collector thread running after a fork.
1998-09-30 06:41:16 +00:00
John Birrell
dc3a8b52c0 Move the cleanup code that frees memory allocated for a dead thread from
the thread kernel into a garbage collector thread which is started when
the fisrt thread is created (other than the initial thread). This
removes the window of opportunity where a context switch will cause a
thread that has locked the malloc spinlock, to enter the thread kernel,
find there is a dead thread and try to free memory, therefore trying
to lock the malloc spinlock against itself.

The garbage collector thread acts just like any other thread, so
instead of having a spinlock to control accesses to the dead thread
list, it uses a mutex and a condition variable so that it can happily
wait to be signalled when a thread exists.
1998-09-30 06:36:56 +00:00
John Birrell
05f3e91279 Use snprintf instead of sprintf to avoid long source file paths from
launching an application into space when someone tries to debug it.

The dead thread list now has it's own link pointer, so use that when
reporting the grateful dead.
1998-09-30 06:29:54 +00:00
John Birrell
54059e9f3f Implementation of an additional state called SIGWAIT (with the previous
one renamed to SIGSUSPEND) to fix sigwait().

Submitted by: Daniel M. Eischen <eischen@vigrid.com>
1998-09-30 06:27:31 +00:00
John Birrell
92ce833722 NULL a pointer after it is freed to avoid trying to free it again. 1998-09-30 06:24:57 +00:00
John Birrell
a247f83316 - Fix the debug macros.
-  Add support of a thread being listed in the dead thread list as well
   as the thread list.
-  Add a new thread state to make sigwait work properly. (Submitted by
   Daniel M. Eischen <eischen@vigrid.com>)
-  Add global variable for the garbage collector mutex and condition
   variable.
-  Delete a couple of prototypes that are no longer required.
-  Add a prototype for the garbage collector thread.
1998-09-30 06:22:07 +00:00
John Birrell
a0aa389007 Delete the XXX comments that refer to spinlock recursion. The malloc/free/
realloc functions check for recursion within the malloc code itself. In
a thread-safe library, the single spinlock ensures that no two threads
go inside the protected code at the same time. The thread implementation
is responsible for ensuring that the spinlock does in fact protect malloc.
There was a window of opportunity in which this was not the case. I'll fix
that with a commit RSN.
1998-09-30 06:13:59 +00:00
Joseph Koshy
7669e9013b `kern.maxproc' is not changeable from sysctl(8).
Reminded by:	Bruce Evans <bde@zeta.org.au>
1998-09-29 05:16:45 +00:00
Jordan K. Hubbard
7998601706 Allow minigzip to be invoked more like gzip, checking to see
if we're being called as gunzip as well as dealing with the -c
flag.
Submitted by:	jhay
1998-09-29 04:56:30 +00:00
Eivind Eklund
8bd4c21699 Document that we will core-dump on getting a NULL pointer. 1998-09-28 15:34:24 +00:00
Dag-Erling Smørgrav
db5f8ceb40 Bring the man page more or less up to date with the code. 1998-09-26 20:42:44 +00:00
Doug Rabson
f0a3692000 Don't cast int pointers to long pointers when reading labels from
/etc/disktab.
1998-09-26 14:44:06 +00:00
Jordan K. Hubbard
e96d0b23ba /usr/lib/compat -> /usr/lib/compat/aout
This change will need to be reviewed just as soon as we start generating
ELF compat libs, but for now it does the right thing for a.out libs.
1998-09-26 11:54:02 +00:00
Doug Rabson
f069bf5a2c * Enable old UFS compatibility code for booting from Digital Unix formatted
disks.
* Fix a whole raft of warnings, printf and otherwise.
* Make zalloc work for alpha (just a case of using the right typedef).
* Add some (disabled) malloc debug printing to stand.h.
1998-09-26 10:48:50 +00:00
Matthew Dillon
f69e7cfc4d Fixed setting of mp_End in zextendPool(). A case was missing and mp_Size
no longer reflects the mp_End - mp_Base equivalent.
1998-09-26 03:24:14 +00:00
Mike Smith
95b50c2be3 Replace the old and extremely icky Mach/NetBSD allocator with a similarly
compact and much better one donated by Matt Dillon.  Implement a simple
sbrk() which uses the existing setheap() api.

Remove the custom allocator from the UFS code.  It wasn't working quite
right, and it shouldn't be needed with the new allocator.

Fix a serious problem with changing the value of already-existent
environment variables.  Don't attempt to modify the supposedly-const
argument to putenv()

Fix an off-by-one sizing error in the zipfs code detected by the new
allocator.

Submitted by:	zmalloc from Matt Dillon <dillon@backplane.com>
1998-09-26 01:42:40 +00:00
David E. O'Brien
5846581c2e Apply patch to properly sscanf(3) when there is whitespace in the format
string.  From the submitted patch:

Credit for patch:	Chris Torek <torek@bsdi.com>
			Tod Miller  <millert@openbsd.org>

This makes us in line with SunOS 4.1.3_U1, Solaris 2.6, OpenBSD 2.3,
HP-UX 10.20, Irix 5.3.  The previous behavior was in line with Ultrix 4.4.

PR:		bin/7970
Submitted by:	Niall Smart nialls@euristix.ie
1998-09-25 12:20:27 +00:00
Doug Rabson
f7506f876c Use unsigned chars instead of signed chars when extracting bits of the
inet address.
1998-09-23 21:35:40 +00:00
Doug Rabson
cea1d019fe Use 8k pagesize on alpha, not 4k. 1998-09-23 21:26:04 +00:00
Jordan K. Hubbard
0b3c226f0e Include "stand.h", not <stand.h>. 1998-09-21 06:07:34 +00:00
Doug Rabson
02c40feecd Allocate disk buffers using a custom allocator. The standard allocator fragments
extremely badly if disk buffers are freed back into the main heap and the alpha
bootstrap has a restricted address space which just ran out :-(.
1998-09-20 21:42:20 +00:00
Doug Rabson
b554c7492a Use a simple version of inet_ntoa(). The libc one uses inet_ntop which is too
complicated.
1998-09-20 21:40:28 +00:00
Alexander Langer
d988805a1f Back out part of previous commit (even though it's technically correct).
Our spinlock implementation allows a particular thread to obtain a lock
multiple times, but release the lock with a single unlock call.  Since
we're detecting recursion, we know the lock is already owned by the
current thread in a previous call and must not be released in the
current call.  This is really far too dependent on this particular
spinlock implementation, so I've added commented out calls to
THREAD_UNLOCK in the appropriate places.  We can activate this code when
spinlock is taught to count each lock operation.
1998-09-20 01:07:50 +00:00
Kenneth D. Merry
bcc6a3da92 Change the devstat generation number from an int to a long. The int-sized
generation was causing unaligned access faults on the Alpha.

I have incremented the devstat version number, since this is an interface
change.  You'll need to recompile libdevstat, systat, iostat, vmstat and
rpc.rstatd along with your kernel.

Partially Submitted by:	Andrew Gallatin <gallatin@cs.duke.edu>
1998-09-20 00:11:23 +00:00
Alexander Langer
366248e086 Correctly back out of free if a recursive call into malloc.c is detected.
Set malloc_func *after* grabbing the thread lock.

Noticed by:	Simon Coggins <simon@oz.org>
1998-09-19 20:55:36 +00:00
Mike Smith
ec5cd5b130 Nuke prototype for strerror, consumers get it from <string.h>
Fix overlooked nullopen() implementation.
1998-09-18 23:00:57 +00:00
Mike Smith
4ce36a791b Path arguments to *_open functions should be const, but we were mangling
them.

Submitted by:	write-protected text segment in BTX
1998-09-18 22:58:01 +00:00
Kenneth D. Merry
71bf9f8a93 Remove scsi_da.c from the list of things compiled into the CAM library.
The functions that were being compiled into the library have been moved to
scsi_all.c.

One warning:  Any programs using scsi_start_stop() or scsi_read_write()
              that included scsi_da.h but not scsi_all.h will need to be
              changed to include scsi_all.h.  This doesn't affect
              camcontrol, and I don't think it affects any ports, but you
              never know.

PR:		kern/7969
Reviewed by:	gibbs
1998-09-18 22:29:35 +00:00
Luoqi Chen
ae45749a50 Simplify implementation and eliminate a register preservation problem.
Reviewed by:	Bruce Evans <bde@zeta.org.au>
1998-09-18 05:50:52 +00:00
Kenneth D. Merry
eded794a13 Fix some error message format problems in checkversion() and getversion().
Reported By: bde
1998-09-18 02:35:25 +00:00
Poul-Henning Kamp
8d54281ce7 s/yellow pages/NIS/
PR:		7949
Reviewed by:	phk
Submitted by:	Norihiro Kumagai <kuma@jp.freebsd.org>
1998-09-17 08:29:16 +00:00
Justin T. Gibbs
c3deaba902 libscsi is obsoleted by CAM. 1998-09-17 03:56:23 +00:00
Kenneth D. Merry
53398df2a8 Fix some Alpha portability problems, and add some belt-and-suspenders
checking in some functions.

Submitted by:	dfr
Modified by:	ken
1998-09-16 20:42:19 +00:00
Doug Rabson
4fab6203a9 Adjust the declarations of kvm_read and kvm_write to match reality a little
closer.
1998-09-16 09:30:14 +00:00
Doug Rabson
1624bd7303 Change to a code sequence which is more likely to work on SMP systems.
Now all I need is an alpha SMP box to port FreeBSD to :-)
1998-09-16 09:27:05 +00:00
Joseph Koshy
0a843f2afb Sort table and descriptions.
Pointed out by: bde
1998-09-16 07:25:34 +00:00
Warner Losh
e8420087b0 Replace memory leaking instances of realloc with non-leaking reallocf.
In some cases replace if (a == null) a = malloc(x); else a =
realloc(a, x); with simple reallocf(a, x).  Per ANSI-C, this is
guaranteed to be the same thing.

I've been running these on my system here w/o ill effects for some
time.  However, the CTM-express is at part 6 of 34 for the CAM
changes, so I've not been able to do a build world with the CAM in the
tree with these changes.  Shouldn't impact anything, but...
1998-09-16 04:17:47 +00:00
Warner Losh
e70c6df958 o Don't reference non-existant function freealloc.
o Properly order things

Pointed out by: bde
1998-09-16 04:07:31 +00:00
Warner Losh
9a5722f2e8 Fix style problems noted by Bruce:
o No copyright on reallocf.
	o Order makefile list correctly.
	o indent reallocf properly.
1998-09-16 03:16:06 +00:00
Bill Fenner
27d941cbbf Bump minor version number and add version.c to update to version 0.4
PR:		bin/7877
1998-09-15 19:34:01 +00:00
Dmitrij Tejblum
b5acd0014e Don't initialize NIS until it is really necessary. Now, in case of network
or NIS server problems, local user can login without a pause.

Also, -Wsomething cleanup.
1998-09-15 16:22:30 +00:00
Poul-Henning Kamp
3f8c45065e (this is an extract from src/share/examples/atm/README)
===================================
                HARP  |  Host ATM Research Platform
                ===================================

                              HARP 3

What is this stuff?
-------------------
The Advanced Networking Group (ANG) at the Minnesota Supercomputer Center,
Inc. (MSCI), as part of its work on the MAGIC Gigabit Testbed, developed
the Host ATM Research Platform (HARP) software, which allows IP hosts to
communicate over ATM networks using standard protocols.  It is intended to
be a high-quality platform for IP/ATM research.

HARP provides a way for IP hosts to connect to ATM networks.  It supports
standard methods of communication using IP over ATM.  A host's standard IP
software sends and receives datagrams via a HARP ATM interface.  HARP provides
functionality similar to (and typically replaces) vendor-provided ATM device
driver software.

HARP includes full source code, making it possible for researchers to
experiment with different approaches to running IP over ATM.  HARP is
self-contained; it requires no other licenses or commercial software packages.

HARP implements support for the IETF Classical IP model for using IP over ATM
networks, including:

   o IETF ATMARP address resolution client
   o IETF ATMARP address resolution server
   o IETF SCSP/ATMARP server
   o UNI 3.1 and 3.0 signalling protocols
   o Fore Systems's SPANS signalling protocol

What's supported
----------------
The following are supported by HARP 3:

   o ATM Host Interfaces
        - FORE Systems, Inc. SBA-200 and SBA-200E ATM SBus Adapters
        - FORE Systems, Inc. PCA-200E ATM PCI Adapters
        - Efficient Networks, Inc. ENI-155p ATM PCI Adapters

   o ATM Signalling Protocols
        - The ATM Forum UNI 3.1 signalling protocol
        - The ATM Forum UNI 3.0 signalling protocol
        - The ATM Forum ILMI address registration
        - FORE Systems's proprietary SPANS signalling protocol
        - Permanent Virtual Channels (PVCs)

   o IETF "Classical IP and ARP over ATM" model
        - RFC 1483, "Multiprotocol Encapsulation over ATM Adaptation Layer 5"
        - RFC 1577, "Classical IP and ARP over ATM"
        - RFC 1626, "Default IP MTU for use over ATM AAL5"
        - RFC 1755, "ATM Signaling Support for IP over ATM"
        - RFC 2225, "Classical IP and ARP over ATM"
        - RFC 2334, "Server Cache Synchronization Protocol (SCSP)"
        - Internet Draft draft-ietf-ion-scsp-atmarp-00.txt,
                "A Distributed ATMARP Service Using SCSP"

   o ATM Sockets interface
        - The file atm-sockets.txt contains further information

What's not supported
--------------------
The following major features of the above list are not currently supported:

        o UNI point-to-multipoint support
        o Driver support for Traffic Control/Quality of Service
        o SPANS multicast and MPP support
        o SPANS signalling using Efficient adapters

This software was developed under the sponsorship of the Defense Advanced
Research Projects Agency (DARPA).

Reviewed (lightly) by:	phk
Submitted by:	Network Computing Services, Inc.
1998-09-15 11:44:44 +00:00
Joseph Koshy
61a4defd54 Turn off replies to ICMP echo requests for broadcast and multicast
addresses by default.

Add a knob "icmp_bmcastecho" to "rc.network" to allow this
behaviour to be controlled from "rc.conf".

Document the controlling sysctl variable "net.inet.icmp.bmcastecho"
in sysctl(3).

Reviewed by: dg, jkh
Reminded on -hackers by: Steinar Haug <sthaug@nethelp.no>
1998-09-15 10:49:03 +00:00
Justin T. Gibbs
d02ee3ee3e Remove references to the "od" device. 1998-09-15 10:23:17 +00:00