pb [Thu, 18 Nov 1999 10:20:45 +0000 (10:20 +0000)]
Make last commit bde-compliant:
- correct indentation
- change data types for consistency with the rest of ping.c
- create new variable separate from "answer" for clarity
peter [Thu, 18 Nov 1999 09:54:11 +0000 (09:54 +0000)]
Hack: comment out the pull-in of src/sys/../share/mk/bsd.kern.mk as
that breaks if you try and compile a kernel before building world, as
is presently required to get past the signal changes. I don't
particularly like doing this, but at least it will mean that a 'make world'
will activate the gcc 2.95.2-specific option in bsd.kern.mk.
peter [Thu, 18 Nov 1999 08:58:37 +0000 (08:58 +0000)]
If we have found pci devices via pci_cfgopen(), but don't find a
host->pci bridge specifically, then add a pcib0 device on the motherboard
for the pci bus to hang off.
Requested by: Anders Andersson <anders@sanyusan.se>
Obtained from: dfr
sheldonh [Thu, 18 Nov 1999 08:13:21 +0000 (08:13 +0000)]
Follow-up on mdoc fixes in rev 1.35; this includes things that I missed
in that revision as well as things I broke in that revision. A note-
worthy instance of the latter case was the inversion of -E and -V in the
subsection on Commandline Editing.
peter [Thu, 18 Nov 1999 07:22:41 +0000 (07:22 +0000)]
Merge some typo fixes from dev/sio/sio.c (siostop -> comstop)
Remove EXTRA_SIO/NSIOTOT and make it fully dynamic (from dev/sio/sio.c)
Make sio work for pccard here - pccardd doesn't activate interrupts
until after prove has succeeded.
Mark the initial reset of likely sio ports as broken as it depended on
config supplying a list of locations to probe, devices are now proved
standalone.
Optimize a bit of COM_NOAST4() logic.
Use bus_get_resource_start() etc rather than using isa-centric calls.
Reactivate the IIR_TXRDYBUG test, I've got a card here with it.
Try to be a bit smarter about activating interrupts (ie: don't panic
if polled)
Fix some style bugs that have crept in over time (there are still more).
peter [Thu, 18 Nov 1999 06:55:40 +0000 (06:55 +0000)]
Remove the non-functional "swap device" userland front-end to the
multiplexed underlying swap devices (/dev/drum). The only thing it did
was to allow root to open /dev/drum, but not do anything with it.
Various utilities used to grovel around in here, but Matt has written
a much nicer (and clean) front-end to this for libkvm, and nothing uses
the old system any more.
The VM system was calling VOP_STRATEGY() on the vp of the first underlying
swap device (not the /dev/drum one, the first real device), and using
the VOP system to indirectly (and only) call swstrategy() to choose
an underlying device and enqueue it on that device. I have changed it
to avoid diverting through the VOP system and to call the only possible
target directly, saving a little bit of time and some complexity.
In all, nothing much changes, except some scaffolding to support the
roundabout way of calling swstrategy() is gone.
Matt gave me the ok to do this some time ago, and I apologize for taking
so long to get around to it.
imp [Thu, 18 Nov 1999 06:54:19 +0000 (06:54 +0000)]
Hijack old, broken, obsolete, unsupported pcic module for the NEWCARD
code. You can now build the newcard's pcic driver as a module for all
the joy that will bring you, which currently isn't so much joy as it
is pain.
The old pccard module will never be made to work again, so I think
this is OK. Note, it still remains disabled in sys/modules/Makefile
on purpose.
peter [Thu, 18 Nov 1999 06:41:30 +0000 (06:41 +0000)]
Remove cdevsw_add() as the make_dev()'s are done in a clone-like fashion.
(ie: the next device is created with make_dev as the first is opened
and so on)
peter [Thu, 18 Nov 1999 06:39:47 +0000 (06:39 +0000)]
Remove cdevsw_add() - the make_dev() calls are already there.
Don't '#if NSNP > 0' around the thing as it's silly and not required.
config(8) only causes it to be compiled if NSNP is > 0 by definition.
peter [Thu, 18 Nov 1999 05:44:56 +0000 (05:44 +0000)]
Convert smb to use make_dev() rather than cdevsw_add(). This stops the
annoying 'smb is usurping smb's cdevsw' type messages. (Yes, there are
other ways to fix cdevsw_add(), but that is a doomed api)
peter [Thu, 18 Nov 1999 05:43:32 +0000 (05:43 +0000)]
Convert iic to use make_dev() rather than cdevsw_add(). This stops the
annoying 'iic is usurping iic's cdevsw' type messages. (Yes, there are
other ways to fix cdevsw_add(), but that is a doomed api)
peter [Thu, 18 Nov 1999 05:15:09 +0000 (05:15 +0000)]
Tidy up a few loose ends in the fifo setup code.
Don't use NFDC as an arbitary limit, it is not required and goes against
using PnP fdc devices (eg: when PNPBIOS is turned on, the motherboard
devices (sio, fdc, etc etc) are detected via PnP, not config(8).)
peter [Thu, 18 Nov 1999 04:31:31 +0000 (04:31 +0000)]
Use a common MAKEDEV between the Alpha and i386 - the only differences
of significance were due to the Alpha version going stale. We use common
device numbering for devices. Hopefully, this file's days are numbered.
jdp [Thu, 18 Nov 1999 03:01:06 +0000 (03:01 +0000)]
For the TCP transport, put the listening socket in non-blocking
mode. This addresses a well-known race condition that can cause
servers to hang in accept(). The relevant case is when somebody
connects to the server and then immediately kills the connection
by sending a TCP reset. On the server this causes select to report
a ready condition on the socket, after which the accept call blocks
because there is no longer any pending connection to accept.
In -current there is already a work-around for this in the kernel.
It was merged into -stable some time ago, but then David Greenman
reverted it because it seemed to be causing a socket leak in some
cases. (See uipc_socket.c revision 1.51.2.3.) Hence this userland
fix is needed in -stable, and I plan to merge it into that branch
soon because it fixes a potential DoS attack. It may also be needed
in -current if the suspected socket leak turns out to be real. In
any case, after thinking it over I believe the fix belongs in
userland. An application shouldn't assume that a ready return from
select guarantees that the subsequent I/O operation cannot block.
A lot can happen between the select and the accept.
A similar fix should most likely be applied to the Unix domain
socket transport too.
imp [Wed, 17 Nov 1999 23:54:39 +0000 (23:54 +0000)]
o Remove #if XXX from around the probe code.
o Rewrite probe code to work in the newbus world.
o Add preliminary pnp support. I have no clue what the pnp ids for
the older ISA machines/cards. I don't have any of these cards/machines
so I'll have to rely on the user community to give me help.
o Minor code reformatting.
Attach hasn't been touched, and there may be some config issues that
we need to deal with as well. These will follow in time.
ache [Wed, 17 Nov 1999 22:38:02 +0000 (22:38 +0000)]
Add network pass4 - after all local (/usr/local/etc/rc.d f.e.)
daemons started. Move log_in_vain option there. It is needed to avoid
lot of connections to port 80 logged on production WWW server prior
Apache started from /usr/local/etc/rc.d
n_hibma [Wed, 17 Nov 1999 22:33:51 +0000 (22:33 +0000)]
Synchronisation with NetBSD as of 1999/11/16:
Cleaning up the code:
- Declare many functions static
- Change variable names to make them more self explanatory
- Change usbd_request_handle -> usbd_xfer_handle
- Syntactical changes
- Remove some unused code
- Other KNF changes
Interrupt context handling
- Change delay to usbd_delay_ms were possible (takes polling mode into
account)
- Change detection mechanism for interrupt context
Add support for pre-allocation DMA-able memory by device driver
Add preliminary support for isochronous to the UHCI driver (not for OHCI
yet).
usb.c, uhci.c, ohci.c
- Initial attempt at detachable USB host controllers
- Handle the use_polling flag with a lttle more care and only set it if
we are cold booting.
usb.c, uhci.c ohci.c, usbdi.c usbdi_util.c usb_subr.c
- Make sure an aborted pipe is marked as not running.
- Start queued request in the right order.
- Insert some more DIAGNOSTIC sanity checks.
- Remove (almost) unused definitions USBD_XFER_OUT and USBD_XFER_IN.
usb.c, usb_subr.c
- Add an event mechanism so that a userland process can watch devices
come and go.
ohci.c
- Handle the case when a USB transfer is so long that it crosses two
page (4K) boundaries. OHCI cannot do that with a single TD so we make
a chain.
ulpt.c
- Use a bigger buffer when transferring data.
- Pre-allocate the DMA buffer. This makes the driver slightly more
efficient.
- Comment out the GET_DEVICE_ID code, because for some unknown reason it
causes printing to fail sometimes.
usb.h
- Add a macro to extract the isoc type.
- Add a macro to check whether the routine has been entered after splusb
and if not, complain.
usbdi.c
- Fix a glitch in dequeueing and aborting requests on interrupt pipes.
- Add a flag in the request to determine if the data copying is done by
the driver or the usbdi layer.
ache [Wed, 17 Nov 1999 19:11:51 +0000 (19:11 +0000)]
Merge with OpenBSD whois (with bugfixes missed there)
New features are:
Automatic lookup using *.whois-servers.net
Recursive lookup using Registrar's name
Fallback to InterNIC for non-domains
-m for RADB database
-Q to turn recursion/fallback off
cracauer [Wed, 17 Nov 1999 16:53:34 +0000 (16:53 +0000)]
The pipleline problem introduced in version 1.22 wasn't fully fixed in
1.23. This revision should work for long pipes both in
here-documents/backquote and in normal cases.
davidn [Wed, 17 Nov 1999 16:31:51 +0000 (16:31 +0000)]
Reduce max length of user names to 15 characters to reflect reality.
This also prevents the line-wrap and messed up display that occurs
when there happens to be one or more names with 15 chars.
peter [Wed, 17 Nov 1999 15:28:45 +0000 (15:28 +0000)]
Use the same technique as ps(1) to avoid the need for setgid. (ie: use
/dev/null as the default kernel and /dev/mem filenames, but still allow
the usual overrides)
peter [Wed, 17 Nov 1999 13:37:30 +0000 (13:37 +0000)]
I'm probably jumping the gun, but what the heck, this is -current.
Turn off setgid-kmem for /bin/ps, it's now quite functional without it.
ps no longer needs /dev/*mem or /proc. (It will still use some /proc
files if they are available for -e, but it's not required, so it'll
happily run in a jail or chroot).
The proc stats are now part of eproc (obtained via sysctl) and no longer
needs to beat up the u-page reading code and the problems with that.
This also has the side effect of disabling 'ps -e' for normal users
*EXCEPT* when looking at their own processes. ie: they can see
environments in processes with their uid, enforced by the ownership of
/proc/*/mem. Root can still see them all, as it can open all /proc/*/mem.
peter [Wed, 17 Nov 1999 12:49:22 +0000 (12:49 +0000)]
Add e_stats (p->p_stats, from struct user->u_stats) to eproc so it's
fetchable via sysctl. This saves ps having to read the u-area for stats.
Be sure to recompile libkvm, ps, w, top and the usual suspects.
mjacob [Wed, 17 Nov 1999 06:05:09 +0000 (06:05 +0000)]
Fix for 11815 (at mount time do a throwaway read of the front of the
tape to force the drive to do a media access so it knows what media
may be inserted).
peter [Wed, 17 Nov 1999 03:32:05 +0000 (03:32 +0000)]
Put the listening socket into non-blocking mode before doing an
accept(2). This is a not really problem on -current as the accept race
is fixed, however it is a MFC candidate for -stable.
This could possibly be slightly more efficient and leave the listening
socket permanently in non-blocking mode, but I wasn't certain that I
could catch all the stream/wait (not nowait) mode implications.
bde [Wed, 17 Nov 1999 03:25:54 +0000 (03:25 +0000)]
Fixed sorting on time. On i386's, time differences of more than 2147
seconds caused overflow. Use a type-safe but slightly slower comparison.
Comparisons for other fields are still fragile.
Fixed rounding of cputime (don't do extra work to get it slightly wrong
by first converting without rounding to milliseconds).
jdp [Wed, 17 Nov 1999 01:54:17 +0000 (01:54 +0000)]
Fix a bug in the hack that protects against FTP bounce attacks.
It used to loop back up to the accept() call and block there,
shutting out all other transports until a new connection came in.
Now it returns instead after dropping the connection. That will
take it back to the select() loop where all transports can be
serviced. I intend to MFC this within a day or two since it
fixes a DoS vulnerability.
brian [Tue, 16 Nov 1999 21:57:48 +0000 (21:57 +0000)]
Remove some extraneous ifdefs, and don't try to put the socket in
O_NONBLOCK. The select() is the best best as I don't want to muck
about with the send/receive thresholds.
phk [Tue, 16 Nov 1999 20:31:58 +0000 (20:31 +0000)]
Introduce commandline caching in the kernel.
This fixes some nasty procfs problems for SMP, makes ps(1) run much faster,
and makes ps(1) even less dependent on /proc which will aid chroot and
jails alike.
To disable this facility and revert to previous behaviour:
sysctl -w kern.ps_arg_cache_limit=0
For full details see the current@FreeBSD.org mail-archives.