This is still very green, but I have managed to get my modem working.
Lots of work still to do, but now at least we can commit it. /phk
Reviewed by: phk
Submitted by: Andrew McRae <andrew@mega.com.au>
This change forces the controller drivers to allocate a scsibus_data struct
via a call to scsi_alloc_bus(), fill in the adapter_link field, and optionally
modify any other fields of the struct. Scsi_alloc_bus() initializes all fields
to the default, so the changes in most drivers are very minimal. For drivers
that support Wide controllers, the maxtarg field will have to be updated to
allow probing of all targets (for an example, look at the aic7xxx driver).
Scsi_attachdevs() now takes a scsibus_data* as its argument instead of an
sc_link*. This allows us to expand the role of the scsibus_data struct for
other bus level configuration setings (max number of transactions, current
transaction opennings, etc for better tagged queuing support).
Reviewed by: Rodney Grimes <rgrimes>, Peter Dufault <dufault>, Julian Elischer <julian>
Change some leading spaces to tabs.
This change forces the controller drivers to allocate a scsibus_data struct
via a call to scsi_alloc_bus(), fill in the adapter_link field, and optionally
modify any other fields of the struct. Scsi_alloc_bus() initializes all fields
to the default, so the changes in most drivers are very minimal. For drivers
that support Wide controllers, the maxtarg field will have to be updated to
allow probing of all targets (for an example, look at the aic7xxx driver).
Scsi_attachdevs() now takes a scsibus_data* as its argument instead of an
sc_link*. This allows us to expand the role of the scsibus_data struct for
other bus level configuration setings (max number of transactions, current
transaction opennings, etc for better tagged queuing support).
Reviewed by: Rodney Grimes <rgrimes>, Peter Dufault <dufault>, Julian Elischer <julian>
Implement the slip/ppp "hotchar" detection to improve latency
Debug the L_RINT bypass code..
Fix an interesting feature that caused 8-bit chars to loose their top bit
in some circumstances..
This finishes the remaining outstanding problems that I'm aware of, with
the exception of efficiency... Optimizing can come later after it's fully
debugged.
Claim the major numbers (before sombedoy else jumps in again and
claims the slots for his foocd driver :-), install all the hooks that
are required.
While i've been at this, i've cleaned up some of the routines at the
end of i386/conf.c; all the importers of the latest CDROM drivers
forgot to fill in the appropriate information. The `ata' driver
(vapourware?) does only occupy a slot in the bdevsw[] array, btw.
The actual import of the code does require a minor change in the SCSI
subsystem, and i want to have this reviewed by Peter first, so it will
be deferred for some days. The driver is already working for me
though.
Submitted by: akiyama@kme.mei.co.jp (Shunsuke Akiyama)
Note, I tested this on a NEC Versa, IBM 750C, and a IBM 755CX w/out
problems. The card still works fine in TP mode.
Submitted by: schwarz@alpharel.com (Steve Schwarz)
Reviewed by: jleppek@suw2k.ess.harris.com (James Leppek)
actually a timeout only. The existing behaviour caused a
mcd0: timeout getreply
at halt/reboot time.
Submitted by: graichen@sirius.physik.fu-berlin.de (Thomas Graichen)
traps occurred. This also helps ddb backtrace through trap frames.
Backtracing through syscall and interrupt frames still doesn't work
but it is relatively unimportant and more expensive to fix.
moved to the driver proper, so that <machine/si.h> can be #included by user
programs without needing to include stuff from /sys/i386/isa..
Various (now) redundant features removed, eg: the locks on IXANY and HWFLOW
as these are now done with the "initial" and "lock" termios devices.
Note that it still (for reasons unknown) appears to be masking data to
7-bit with ppp - hence the cleanup to support the debugging via 'sicontrol'
This was originally ported to BSDI by Andy Rutter <andy@acronym.co.uk>.
At the end of the day, this code has very little in common with Andy's
version, or the Specialix SYSV version. Essentially it has been gradually
and almost completely rewritten, with LOTS of advice and inspiration from
Bruce Evans. There are a couple of missing bits still, but they are minor.
The user-mode "sicontrol" program is in sad shape and will come in soon.
Transparent printing died a timely death.. Maybe later..
Jeremy Rolls @ Specialix (Development directory) has confirmed this is OK
to distribute, and Andy personally sent me his version that I started from.
Although this driver stood up to a nasty stress-test in this form, I am not
confident that there are no nasty bugs lurking.
People are welcome to try it, but dont go out and buy one just yet.. :-)
And *DONT* use it on a mission-critical machine... This is ALPHA QUALITY!
of "__volatile". Note also that the original mods that were submitted
by me were as a result of a discussion between various FreeBSD contributors.
Submitted by: peter@haywire.dialix.com (Peter Wemm)
for return values. It just so happens that in the cases where it is likely
to fail, it is okay to change the M_NOWAIT to M_WAITOK -- and all will
be well. This problem was manfest as a panic very regularly on a 4MB
system right after bootup.
hardware. Set the sleep-on flag for the address so there is more
than a small chance that the sleep address is actually used (this
used to work by timing out). Don't bother clearing the sleep-on
flag after a timeout here or elsewhere since leaving it set just
generates a few null calls to wakeup().
Introduce TS_CONNECTED and TS_ZOMBIE states. TS_CONNECTED is set
while a connection is established. It is set while (TS_CARR_ON or
CLOCAL is set) and TS_ZOMBIE is clear. TS_ZOMBIE is set for on to
off transitions of TS_CARR_ON that occur when CLOCAL is clear and
is cleared for off to on transitions of CLOCAL. I/o can only occur
while TS_CONNECTED is set. TS_ZOMBIE prevents further i/o.
Split the input-event sleep address TSA_CARR_ON(tp) into TSA_CARR_ON(tp)
and TSA_HUP_OR_INPUT(tp). The former address is now used only for
off to on carrier transitions and equivalent CLOCAL transitions.
The latter is used for all input events, all carrier transitions
and certain CLOCAL transitions. There are some harmless extra
wakeups for rare connection- related events. Previously there were
too many extra wakeups for non-rare input events.
Drivers now call l_modem() instead of setting TS_CARR_ON directly
to handle even the initial off to on transition of carrier. They
should always have done this. l_modem() now handles TS_CONNECTED
and TS_ZOMBIE as well as TS_CARR_ON.
gnu/isdn/iitty.c:
Set TS_CONNECTED for first open ourself to go with bogusly setting
CLOCAL.
i386/isa/syscons.c, i386/isa/pcvt/pcvt_drv.c:
We fake carrier, so don't also fake CLOCAL.
kern/tty.c:
Testing TS_CONNECTED instead of TS_CARR_ON fixes TIOCCONS forgetting to
test CLOCAL. TS_ISOPEN was tested instead, but that broke when we disabled
the clearing of TS_ISOPEN for certain transitions of CLOCAL.
Testing TS_CONNECTED fixes ttyselect() returning false success for output
to devices in state !TS_CARR_ON && !CLOCAL.
Optimize the other selwakeup() call (this is not related to the other
changes).
kern/tty_pty.c:
ptcopen() can be declared in traditional C now that dev_t isn't short.
Use input buffer watermarks of TTYHOG-512 (high) and (high)*7/8
(low) instead of TTYHOG/2 (high) and TTYHOG/5 (low) to agree with
some drivers. 512 is magic and some things depended on TTYHOG/2
>= TTYHOG-512 to work; now they depend on the 512 magic not changing
and TTYHOG-512 being significantly larger than 0. This should be
handled in ttsetwater().
Separate the decision about whether to do input flow control from
doing it. ttyblock() now just starts input flow control (hardware
and/or software) and there is a new function ttyunblock() to stop
it. The decisions are the same except for the watermark changes
and allowing for input expansion for PARMRK.
When flushing input, try harder at first to send a start character
if required, but give up if the first attempt fails.
cy.c, rc.c, sio.c:
Simplify: let ttyinput() handle input flow control if it is not
being bypassed. Use ttyblock() to start flow control otherwise.
rc.c:
Use same input flow control test as elsewhere: test in a more
efficient order and start flow control at >= highwater instead of
at > highwater.
BUS DEVICE RESET followed by BUS RESET failure recovery strategy including
the necesary renegotiation of sync/wide transfers after recovery completes.
Clean up debugging code to make it more finely selectable. Reset code
debugging is enabled for now so I can get more feedback on how this
code behaves in real life.
essential when I fix excessive wakeups for output-below-low-water.
In cy.c and sio.c, wake up via the driver start routine to also
eliminate duplicated code involving the clearing of TS_TTSTOP.
Always (except in code to be replaced soon) call driver start
routine directly instead of going through ttstart().
Amancio. There is some SoundSource support here that is primitive and
probably doesn't work, but I'll let the two submitters let me know
how my integration of that was since I don't have this card to test.
I've only tested this on my GUS MAX since it's all I have.
This all probably needs to be re-done anyway since we're widely variant
from the original VOXWARE source in the current layout.
Submitted by: Amancio Hasty and Jim Lowe
Obtained from: Hannu Savolainen
floppy DMA buffers...use avail_start not "first". Removed duplicate
(and wrong) declaration of phys_avail[].
Submitted by: Bruce Evans, but fixed differently by me.
This finishes making the kernel compile without -O.
The "optimized" asm version of the function being inlined
(translate_bytes()) uses slow instructions. On a 486, assuming
everything is in the cache (unlikely), it is 21/15 times slower
than the dumb C version and 21/3 times slower than the best
possible bytewise method.
didn't work are somewhat bogusly optimized away before the constraint
is checked. We still expect constants passed to inline functions to
remain constant, but if the compiler ever decides that they aren't
constant then it will just generate slightly slower code instead of
an error.
Declare `cheat' as static. It was bogusly shared between the aha1742 and
ultrastor drivers.
Even static variables should have unique names so that they can be
debugged, but fixing them can wait.
ttwwakeup(). The conditions for doing the wakeup will soon become
more complicated and I don't want them duplicated in all drivers.
It's probably not worth making ttwwakeup() a macro or an inline
function. The cost of the function call is relatively small when
there is a process to wake up. There is usually a process to wake
up for large writes and the system call overhead dwarfs the function
call overhead for small writes.
Temporarily nuke TS_WOPEN. It was only used for the obscure MDMBUF
flow control option in the kernel and for informational purposes
in `pstat -t'. The latter worked properly only for ptys. In
general there may be multiple processes sleeping in open() and
multiple processes that successfully opened the tty by opening it
in O_NONBLOCK mode or during a window when CLOCAL was set. tty.c
doesn't have enough information to maintain the flag but always
cleared it in ttyopen().
TS_WOPEN should be restored someday just so that `pstat -t' can
display it (MDMBUF is already fixed). Fixing it requires counting
of processes sleeping in open() in too many serial drivers.
buses on multi-bus controllers. Currently only affects the 274xT controllers.
Reviewed by: Peter Dufault(dufault@hda.com), Rod Grimes(rgrimes@FreeBSD.org)
emul code when compiling with "options KTRACE".
ktrsyscall() was expecting an array of integers, this was passing the
address of a structure containing an array of integers..
The cosmetic problem was that it was calling the "enter syscall"
trace hook twice - this looks like a cut/paste error/typo.
Submitted by: Andrew McRae <andrew@mega.com.au>
Some initial commits from the pcmcia stuff, to make life easier for the
testers.
We will use the name "pccard" since that is really the buzzword at present.
notebooks where a powerfail condition (external power drop; battery
state low) is signalled by an NMI. Makes it beep instead of panicing.
Reviewed by: davidg
Future Domain TMC-885 controllers. These beasts were just different enough in
a number of perverse ways to be recognised but not work with the seagate
stuff. I also whacked in blind transfers for DATAIN and DATAOUT phases - this
more than doubles my throughput. If you're dubious about that, comment out the
definition of SEA_BLINDTRANSFER. Anyway if you're running an ST01 or TMC-950
controller, please give this a go, I'd like to see if anything's broken for
those beasts.
Submitted by: Stephen Hocking <sysseh@devetir.qld.gov.au>
proc or any VM system structure will have to be rebuilt!!!
Much needed overhaul of the VM system. Included in this first round of
changes:
1) Improved pager interfaces: init, alloc, dealloc, getpages, putpages,
haspage, and sync operations are supported. The haspage interface now
provides information about clusterability. All pager routines now take
struct vm_object's instead of "pagers".
2) Improved data structures. In the previous paradigm, there is constant
confusion caused by pagers being both a data structure ("allocate a
pager") and a collection of routines. The idea of a pager structure has
escentially been eliminated. Objects now have types, and this type is
used to index the appropriate pager. In most cases, items in the pager
structure were duplicated in the object data structure and thus were
unnecessary. In the few cases that remained, a un_pager structure union
was created in the object to contain these items.
3) Because of the cleanup of #1 & #2, a lot of unnecessary layering can now
be removed. For instance, vm_object_enter(), vm_object_lookup(),
vm_object_remove(), and the associated object hash list were some of the
things that were removed.
4) simple_lock's removed. Discussion with several people reveals that the
SMP locking primitives used in the VM system aren't likely the mechanism
that we'll be adopting. Even if it were, the locking that was in the code
was very inadequate and would have to be mostly re-done anyway. The
locking in a uni-processor kernel was a no-op but went a long way toward
making the code difficult to read and debug.
5) Places that attempted to kludge-up the fact that we don't have kernel
thread support have been fixed to reflect the reality that we are really
dealing with processes, not threads. The VM system didn't have complete
thread support, so the comments and mis-named routines were just wrong.
We now use tsleep and wakeup directly in the lock routines, for instance.
6) Where appropriate, the pagers have been improved, especially in the
pager_alloc routines. Most of the pager_allocs have been rewritten and
are now faster and easier to maintain.
7) The pagedaemon pageout clustering algorithm has been rewritten and
now tries harder to output an even number of pages before and after
the requested page. This is sort of the reverse of the ideal pagein
algorithm and should provide better overall performance.
8) Unnecessary (incorrect) casts to caddr_t in calls to tsleep & wakeup
have been removed. Some other unnecessary casts have also been removed.
9) Some almost useless debugging code removed.
10) Terminology of shadow objects vs. backing objects straightened out.
The fact that the vm_object data structure escentially had this
backwards really confused things. The use of "shadow" and "backing
object" throughout the code is now internally consistent and correct
in the Mach terminology.
11) Several minor bug fixes, including one in the vm daemon that caused
0 RSS objects to not get purged as intended.
12) A "default pager" has now been created which cleans up the transition
of objects to the "swap" type. The previous checks throughout the code
for swp->pg_data != NULL were really ugly. This change also provides
the rudiments for future backing of "anonymous" memory by something
other than the swap pager (via the vnode pager, for example), and it
allows the decision about which of these pagers to use to be made
dynamically (although will need some additional decision code to do
this, of course).
13) (dyson) MAP_COPY has been deprecated and the corresponding "copy
object" code has been removed. MAP_COPY was undocumented and non-
standard. It was furthermore broken in several ways which caused its
behavior to degrade to MAP_PRIVATE. Binaries that use MAP_COPY will
continue to work correctly, but via the slightly different semantics
of MAP_PRIVATE.
14) (dyson) Sharing maps have been removed. It's marginal usefulness in a
threads design can be worked around in other ways. Both #12 and #13
were done to simplify the code and improve readability and maintain-
ability. (As were most all of these changes)
TODO:
1) Rewrite most of the vnode pager to use VOP_GETPAGES/PUTPAGES. Doing
this will reduce the vnode pager to a mere fraction of its current size.
2) Rewrite vm_fault and the swap/vnode pagers to use the clustering
information provided by the new haspage pager interface. This will
substantially reduce the overhead by eliminating a large number of
VOP_BMAP() calls. The VOP_BMAP() filesystem interface should be
improved to provide both a "behind" and "ahead" indication of
contiguousness.
3) Implement the extended features of pager_haspage in swap_pager_haspage().
It currently just says 0 pages ahead/behind.
4) Re-implement the swap device (swstrategy) in a more elegant way, perhaps
via a much more general mechanism that could also be used for disk
striping of regular filesystems.
5) Do something to improve the architecture of vm_object_collapse(). The
fact that it makes calls into the swap pager and knows too much about
how the swap pager operates really bothers me. It also doesn't allow
for collapsing of non-swap pager objects ("unnamed" objects backed by
other pagers).
were two races:
- q_to_b() might unexpectedly return 0 (e.g, after a keyboard signal
flushes the output queue and isn't echoed). ansi_put() interprets
0 bytes as 4GB...
- more output (e.g. for echoes) might arrive afer q_to_b() returns 0.
Then scstart() returns presumably and the new output might not be
handled for a long time.
Remove unused function scxint().
Fix prototypes (foo() isn't a prototype).
syscons' output is now only about 4-5 times slower than I want.
It loses a factor of 2 for scrolling output by unnecessarily copying
the screen buffer, a factor of 4/3 for dumb OPOST processing, and
a factor of 3/2 for clist processing.
Adds support for non-Sound Blaster host adapters, including those
distributed by Reveal, Lasermate, IBM, Media Vision, Crystal and others.
The driver automatically senses the correct adapter type and you can
have both in the system at the same time.
(This change should eliminate a few complaints.)
Corrected bit-masking problem that prevented use on SB Vibra-16 boards.
Declared some internal data and functions static that should have been
that way all along.
Documentation changes reflect the new hardware support and change the
appearance version to 2.0.5 (was 2.1). Nice and tidy. :-)
Beta testers have verified functionality on SB16, Vibra-16, Media Vision
and Reveal adapters. -Wall still shows no warnings.
Frank Durda IV
uhclem%nemesis@fw.ast.com
Submitted by: Frank Durda IV <uhclem%nemesis@fw.ast.com>
- use pseudo-dma
- provide the same features and interface as sio
- support multiple boards
- fix bugs.
Some compile-time configuration constants are set to support higher
speeds and Cyclom-16Y's at a 30% relative cost in efficiency.
Cyclom-16Y support is untested.
form to do this than it is relying on individual subroutines (the logic
in epioctl is itself very minimal). Ideally, unnecessary splimp()'s should
now be removed if they exist; I'll leave this for a later date (a complete
code review of the driver needs to be done). Fixes a bug I noticed that
would show up when ifconfig'ing the interface down.
optimizations I have been working on yet, but does bring in some bug fixes
and performance improvments that were easy to regression test:
Setup the data fifo threshold and bus off timing correctly for 27/284x cards.
Users of these adapters with fast periferals (greater than 5MB/s) will notice
a big performance difference. (Sometimes as large as going from 3.7->8.3MB/s).
Fix handling of the active target flags. Some of the outbs where missing
the base offset in the abort code. The abort code still needs lots of work.
Support 3940 controllers, but only with 16 SCBs for now. Eventually I'll
add support for all 255, but I need to find a tester for the code first since
we have to enable the cards external SRAM to do this.
Add Dan Eischen's serial eeprom reading facilities. This allows the 2940
adapters to pull additional information left over from SCSI-Select right out
out of the configuration seeprom.
If the BIOS is disabled on 274x controllers, reset all target parameters
to there defaults since you can't rely on what is stored in scratch ram.
Report motherboard controllers as such.
Stick the first SG address and count into the SCB data and count areas for
all transfers in preparation of a later sequencer optimization.
Keep track of which targets can are allowed to have the disconnection
priveledge since this will be handled by the kernel driver in the future.
If a target issues a message reject in response to a tagged message,
disable tagged queuing for that target. Some seagates say they can do
tagged queuing, but lie, and its a shame to have to disable tagged queuing
on all devices just because you have one that can't cope.
fail on new hardware (Compaq Prolinea and Compaq Prosignea), and that
doesn't erroneously identify old mech. 2 chip sets as using mech. 1.
(See section 3.6.4.1.1 of the PCI bus specs rev. 2.0)
a related bug in some of the new 'foo'boot bootstrap code that has been
added over the past months. This change makes it no longer necessary
for the bootstrap to fix up the path (i.e. it can be removed).
include/signal.h:
There was massive namespace pollution from including <sys/types.h>.
POSIX functions were declared even when _ANSI_SOURCE is defined.
sys.sys/signal.h:
NSIG was declared even if _ANSI_SOURCE or _POSIX_SOURCE is defined.
sig_atomic_t wasn't declared if _POSIX_SOURCE is defined.
Declare a typedef for signal handling functions and use it to
unobfuscate declarations and to avoid half-baked function types
that cause unwanted compiler warnings at certain warning levels.
Fix confusing comment about SA_RESTART.
sys/i386/include/signal.h:
This has to be included to get the declaration of sig_atomic_t even
when _ANSI_SOURCE is defined, so be more careful about polluting
the ANSI namespace.
Uniformize idempotency ifdefs.
of the typedefs off_t and pid_t when use of the latter would cause
namespace pollution. These macros are used like _BSD_VA_LIST_ and
aren't #undef'ed when the corresponding typedef is declared.
off_t is very machine-dependent and should never have been decided
in <sys/types.h> (its declaration is compiler-dependent). pid_t
isn't very machine-dependent, but this might change. `long' is
a wasteful type for it if longs are longer than ints.
Move the definition of _BSD_VA_LIST_ away from the comment that
suggests that it is #undefed when va_list is declared.
when syscons stops mapping the console to minor MAXCONS. There is
usually no corresponding device in /dev, and the correct device has
minor 0.
cons.c:
Initialize cn_tty properly, so that CPU_CONSDEV can work.
Comment about too many variants of the console tty pointer.
machdep.c:
Return device NODEV and not error EFAULT when there is no console device.
clearer. The "informational message" almost looks like an instruction to
the user to change settings on the card....
It's cosmetic, but...
Submitted by: peter@haywire.dialix.com
This first shot only incorporaties so much functionality that DOOM
can run (the X version), signal handling is VERY weak, so is many
other things. But it meets my milestone number one (you guessed it
- running DOOM).
Uses /compat/linux as prefix for loading shared libs, so it won't
conflict with our own libs.
Kernel must be compiled with "options COMPAT_LINUX" for this to work.
user has entered a bogus kernel name in the first place).
Also fix the broken #ifdef FORCE_COMCONSOLE, it has been disabled by
accident. (NB: the keyboard probe remains disabled however.)
Few cosmetic fixes (declare functions to be void instead of int),
while i've been at this.
Pointed out by: wosch@cs.tu-berlin.de (Wolfram Schneider), for the init bug
explicitly advise the users to reset the machine in case they have
done bogus things (to prevent `dset' from merging the changes into
/kernel), and it's also useful for machines with serial consoles that
are physically in another place.
no ports are active, provided there are no polled ports and no
`LOSESOUTINTS' ports. Do a little more in the interrupt handler instead.
This is a little less efficient if there are are many active ports but
a little more efficient otherwise. Polled ports are ones with no irq
specified (as before). `LOSESOUTINTS' ports are ones with 0x08 set in
their config flags. Unless this flag is set, it will now take up to one
second to recover from lost output interrupts, if any. Some 8250s and
16450s lose output interrupts.
Improve output buffering: copy the clist buffer to 2 linear buffers if
necessary and possible instead of to 1. Handle an arbitrary queue of
buffers in the interrupt handler. Check for waking up sleepers after
copying characters out of the clist buffer instead of before.
Delay translation of TIOCM_DTR to MCR_DTR etc. so that the top level
routines are more machine independent.
Fix bogus device register in unused code.
Fix one such THING in code to match comment.
Sort IO_GSC* into numeric order and update comments about the gaps.
Sort common SCSI addresses into alphabetical order.
Remove bogus comments about com ports having i/o size 4.
Uniformize whitespace.
Uniformize case in hex digits.
This file is very incomplete. In particular, it doesn't mention any
network cards. This doesn't matter much for the base addresses, but
it means that the comments about which addresses are free are mostly
bogus. The i/o sizes are unreliable because of split address ranges
for many devices (VGA, wd). The i/o sizes are incomplete. In
particular, there are no sizes for SCSI controllers. The bt driver
still returns a truth value instead of a size.
- the major number wasn't checked, so accesses beyond the end of bdevsw[]
were possible. Bogus major numbers are easy to get because `sysctl -w'
doesn't handle dev_t's reasonably - it doesn't convert names to dev_t's
and it converts the number 1025 to the dev_t 0x35323031.
- Driver d_psize() functions return -1 to indicate error ENXIO or ENODEV
(the interface is too braindamaged to say which). -1 was interpreted
as a size and resulted in the bogus error ENOSPC.
- it was possible to set the dumpdev for devices without a d_psize()
function. This is equivalent to setting the dumpdev to NODEV except
it confuses sysctl.
- change a 512 to DEV_BSIZE. There is an official macro dtoc() for
converting "pages" to disk blocks but it is never used in /usr/src/sys.
There is much confusion between PAGE_SIZE sized pages and NBPG sized
pages. Maxmem consists of both.
Not fixed:
- there is nothing to invalidate the dumpdev if the media goes away.
This reduces the benefits of the early calculation of dumplo. Bounds
checking in the dump routines is relied on to reduce the risk of
damage and little would be lost by relying on the dump routines to
calculate dumplo.
- no attempt is made to stay away from the start of the device to
avoid clobbering labels.
Fix wrong && anachronistic comment about the type of bootdev.
Reviewed by: davidg
Submitted by: Bruce Evans
LINT talks about about 2.1. I changed that to 2.0.5,
and clarified why certain devices need "at scbus?".
There is still a crazy "PCVT=210" which shouldn't be there,
but corrected comment as it is needed for 2.0.5.
- option DODUMP no longer exists (remove all references to it).
- directive `swap on' is now a no-op (don't bother documenting it; remove
comment to match code).
- directive `dumps on' still works (restore code to match comment; deprecate
it in comment).
Reviewed by: Poul-Henning Kamp, and me
Submitted by: Bruce Evans
in machdep.c (it should use the global nmbclusters). Moved the calculation
of nmbclusters into conf/param.c (same place where nmbclusters has always
been assigned), and made the calculation include an extra amount based
on "maxusers". NMBCLUSTERS can still be overrided in the kernel config
file as always, but this change will make that generally unnecessary. This
fixes the "bug" reports from people who have misconfigured kernels seeing
the network hang when the mbuf cluster pool runs out.
Reviewed by: John Dyson
the National Semiconductor InfoMover PCMCIA cards also. In tests on a
NE4100 on Jordan's laptop here, the ze driver works fine with that
card.
Reviewed by: Jordan Hubbard, Rod Grimes, and me
Submitted by: Gary Palmer
serial_putchar() always hung if it was called and the serial port existed,
so booting with -h hung when the above bug was fixed. Previously, setting
-h did nothing but -h was sometimes the default due to the stack garbage
bug.
Submitted by: DI. Christian Gusenbauer <cg@scotty.edvz.uni-linz.ac.at>
The `howto' arg to boot() was not supplied, so it was stack garbage (actually
the return address in the boot program). I didn't use the submitted fix.
1) If a target initiated a sync negotiation with us and happened to chose a
value above 15, the old code inadvertantly truncated it with an "& 0x0f".
If the periferal picked something really bad like 0x32, you'd end up with
an offset of 2 which would hang the drive since it didn't expect to ever
get something so low. We now do a MIN(maxoffset, given_offset).
2) In the case of Wide cards, we were turning on sync transfers after a
sucessfull wide negotiation. Now we leave the offset alone in the per
target scratch space (which implies asyncronous transfers since we initialize
it that way) until a syncronous negotation occurs.
3) We were advertizing a max offset of 15 instead of 8 for wide devices.
4) If the upper level SCSI code sent down a "SCSI_RESET", it would hang the
system because we would end up sending a null command to the sequencer. Now
we handle SCSI_RESET correctly by having the sequencer interrupt us when it
is about to fill the message buffer so that we can fill it in ourselves.
The sequencer will also "simulate" a command complete for these "message only"
SCBs so that the kernel driver can finish up properly. The cdplay utility
will send a "SCSI_REST" to the cdplayer if you use the reset command.
5) The code that handles SCSIINTs was broken in that if more than one type
of error was true at once, we'd do outbs without the card being paused.
The else clause after the busfree case was also an accident waiting to
happen. I've now turned this into an if, else if, else type of thing, since
in most cases when we handle one type of error, it should be okay to ignore
the rest (ie if we have a SELTO, who cares if there was a parity error on
the transaction?), but the section should really be rewritten after 2.0.5.
This fix was the least obtrusive way to patch the problem.
6) Only tag either SDTR or WDTR negotiation on an SCB. The real problem is
that I don't account for the case when an SCB that is tagged to do a particular
type of negotiation completes or SELTOs (selection timeout) without the
negotiation taking place, so the accounting of sdtrpending and wdtrpending
gets screwed up. In the wide case, if we tag it to do both wdtr and sdtr,
it only performs wdtr (since wdtr must occur first and we spread out the
negotiation over two commands) so we always have sdtrpending set for that
target and we never do a real SDTR. I fill properly fix the accounting
after 2.0.5 goes out the door, but this works (as confirmed by Dan) on
wide targets.
Other stuff that is also included:
1) Don't do a bzero when recycling SCBs. The only thing that must explicitly
be set to zero is the scb control byte which is done in ahc_get_scb. We also
need to set the SG_list_pointer and SG_list_count to 0 for commands that do
not transfer data.
2) Mask the interrupt type printout for the aic7870 case. The bit we were
using to determine interrupt type is only valid for the aic7770.
Submitted by: Justin Gibbs
the 802.3 frames generated by the DC21040 (which does automatic padding
of less-than-minimum frames) and the frames generated by the 'ed'
driver, I've found that there is indeed a bug in the size of "ETHER_MIN_LEN"
as reported by several people, John Hay being the most recent. The driver
was actually setting the length to 6+6+2+50 (64 bytes), which when adding
in the CRC (which is automatically appended to the frame and not included
in the length), the minimum frame is 4 bytes larger than it is supposed to
be. All of this is confirmed by tcpdump showing 50 bytes of data for
minimum frames from the 'ed' cards and 46 bytes from 'de' cards. This
analysis has also revealed that there is garbage in the un-filled in
portion at the end of the minimum frames from the 'ed' driver; I don't
plan to fix this.
require specific partitions be mentioned in the kernel config
file ("swap on foo" is now obsolete).
From Poul-Henning:
The visible effect is this:
As default, unless
options "NSWAPDEV=23"
is in your config, you will have four swap-devices.
You can swapon(2) any block device you feel like, it doesn't have
to be in the kernel config.
There is a performance/resource win available by getting the NSWAPDEV right
(but only if you have just one swap-device ??), but using that as default
would be too restrictive.
The invisible effect is that:
Swap-handling disappears from the $arch part of the kernel.
It gets a lot simpler (-145 lines) and cleaner.
Reviewed by: John Dyson, David Greenman
Submitted by: Poul-Henning Kamp, with minor changes by me.
A phone call from Manfred quickly pointed up the fact that I got the conflict
check backwards. NOW we implement the conflict checking correctly! Wheesh!
- Do the right thing when booting in NFS diskless mode, which is nothing.
Make the default unconfigured entries for swdevt[0] and dumplo something
that swapconf() will ignore and not choke on (the swap setup is done
in nfs_vfsops.c when booting diskless).
to access it. setdelayed() actually ORs the bits in `idelayed' into
`ipending' and clears `idelayed'.
Call setdelayed() every (normal) clock tick to convert delayed
interrupts into pending ones.
Drivers can set bits in `idelayed' at any time to schedule an interrupt
at the next clock tick. This is more efficient than calling timeout().
Currently only software interrupts can be scheduled.
boot diskless with it, you get a panic because setconf() is only
called for mountroot == ffs_mountroot. It really needs to be called
no matter what manner of rootfs we have. I can't really say if
swapgeneric will work with a CD-ROM though. (I get the feeling I'm
the only one who uses swapgeneric these days anyway.)
there may even be LKMs.) Also, change the internal name of `unixdomain'
to `localdomain' since AF_LOCAL is now the preferred name of this family.
Declare netisr correctly and in the right place.
It closed the wrong device (usually the B partition instead of the C
partition).
It closed a device without having opened it.
It didn't open a device often enough. This caused swap partitions on
slices other than the first slice looked at to be unavailable for swapping.
It didn't check the device number sufficiently.
Remove silly "Naffy, the Wonder Porpoise" attribution and add more
justifiable (and overdue) attribution to Bruce Evans. Look at it
as a delete and add operation batched together, not a substitution. :-)
notice, performed all of the structural changes necessary to get this thing
to work with the unidirectional-DMA version of voxware.
This work is -not- complete, but it's in far better shape than it was, and
I may not touch it again for another few months.
The ``flags 1'' in the fdc line is now only needed for owners of an
Insight tape (perhaps there aren't any? Mine is disfunctional). All
other probes are safe wrt. to the motor-control line of floppy disk
drives. Document the flag in LINT finally.
as side-effect, removed some legacy code that was necessary
when we called vm_fault inside of vm_fault_quick instead of using
the kernel/user space byte move routines.
algorithm is used on aic7770 Rev E or higher chips to improve perfomance.
This required a hardware change but we don't know exactly what (most
likely some special register to do fast SCB indexing into host memory),
and we are not at all sure that there are more than 4 SCBs on these
chips. This probe will still classify the revision of the aic7xxx, but
we now default to 4 SCBs (at least until we know more of what was done).
This also fixes a bug in the timeout routine where we cleared a flag
too soon making it imposible to enter one section of the routine.
Submitted by: Timeout bug - Dan Eischen <deischen@iworks.InterWorks.org>
interrupts to zero to start with. This is the value we return in
most cases. The sense code then outbs the apropriate value to cause
sense retrieval. The return value was uninitialized before this
change (something that was an okay thing with the old sequencer code,
but not with the semantics of the new).
This problem caused us to always retrieve sense upon recieving a non
zero status byte. This is exactly what was happening for the "target
busy" status returned by exabyte tape drives when they rewind or
power on with a tape installed. The request sense proved fatal.
This should fix the tape problems.
It is the kernel driver's responsibility to do the list manipulation whenever
a selection timeout or a request sense occurs.
Print out the interrupt type that the device has been set to. It seems that
one of the Asus motherboards botches this and David thought a diagnostic would
be nice.
Fix a bug in my diagnostic code that David found.
Reviewed by: Wcarchive and David Greenman
to be `int' or smaller and some functions returned `int' instead
of `void'. The first bug was detected when console functions were
defined in a place central enough for type checking to actually
work and the second bug was introduced when the interface was
changed to match what the console functions in other drivers actually
return.
through the use of the config file flags as opposed to the option
"NSECS_MULTI". "NSECS_MULTI" has been removed from the driver.
The new capability allows boot-time modification of the config.
I made the changes I sent you before. In the interests of cleanliness, I made
modifications to /sys/i386/isa/tw.c to kill the warnings and make it compile
clean. While I was at it, I also made a bunch of internal functions static.
Submitted by: Gene Stark <gene@starkhome.cs.sunysb.edu>
higher level scsi code.
Spls should never be conditionalized, so don't do so here.
Restructure the get_scb routine so that we can't get into an infinite
loop if the ccbs are exhausted and we are are called with SCSI_NOSLEEP set.
Other driver maintainer's that based their scb allocation routines on Julian's
code should look at these changes and implement them for their driver.
The aic7xxx driver inspired these changes because early revs of the
aic7770 chips have so few SCBs that you can actually run out. If you
have a rev C or aic7770 (as is reported by the driver probe) and had more
than 2 drives, you could get into an infinite loop when using up all of
the SCBs. Since the driver will only allow two SCBs per device and I
only had two devices, I never saw this problem on my Rev C card.
Bzero only 19 bytes of the scb instead of 2k (ack!). This was a hold
over from when a struct SCB only contained the information downloaded
to the board, but we now store kernel driver data in there as well. This
greatly lowers the overhead for small transactions (I get ~1MB/sec for
dds with a 512 byte block size).
Submitted by: John Dyson with the aic7xxx specific optimization by me
higher level scsi code.
Spls should never be conditionalized, so don't do so here.
Restructure the get_ccb routine so that we can't get into an infinite
loop if the ccbs are exhausted and we are are called with SCSI_NOSLEEP set.
Other driver maintainer's that based their ccb allocation routines on Julian's
code should look at these changes and implement them for their driver.
Submitted by: John Dyson
don't expect this to work yet.. but at least they're here..
(hey this cvs stuff is fun!)
activate with a line exactly like the isa line in the config file,
(but specifying eisa :)
patches to come..
Change the interfaces of these functions to save space. The code
that takes the least amount of space is often the opposite to what
you might expect. E.g., it helps to waste a few bytes passing
pointers so that the compiler can't see that certain addresses
are identical (gcc likes to waste space by reloading fat constants
even when the constant is already in a register).
Rewrite getbootdev() to save 80 bytes of space and to make it less
ugly. 32 bytes were saved simply by omitting the continue statements
in the pseudo-switch.
recently introduced bloat in just 2 calls to biosread(), although
very little in calls to putc() and serial_putc(). Gcc produces
amazingly bad code for unnecessary conversions. E.g., if it has
`int x' in register %edx and wants to pass a char, then it could
simply push %edx and access only one byte in the callee. Instead,
it sometimes unnecessarily spills %edx; it always sign extends
%edx and pushes the result.
Remove useless `extern' in function prototypes.
Remove unused declaration of `end'.
Declare pbzero() and pcpy() like the library bzero and bcopy().
Declare printf() properly.
do fit, and beeping in case of an overflow.
. Drop a comment about the ``FORCE_COMCONSOLE'' option into
README.serial.
. Increase the name buffer for the root directory from 100 bytes
to 8 KB; this is in no way ideal, but (IMHO) the best that can
be done by now. People did encounter problems with their root
dir name listing overflowing the allocated buffer space. Once
we've got the three-stage boot, we should implement some basic
malloc(). Swap space is already getting tight now, perhaps the
swap should go into another 64 KB segment instead.
. Make the keyboard probe less paranoid. It should not give up in
case of a keyboard that's continuously demanding RESEND's. Even
though the keyboard reset apparently has not been reported to be
complete, it's at the very least proven that there IS something
like a keyboard available.
This solves problems with the ``Gateway-2000 AllKey programmable''
(sp?) keyboard, that experienced a total hang with the previous
probe.
Thanks goes to Scott Blachowicz <scott@statsci.com> for his
extensive testing of my various interim (debugging) bootblocks
to get this working.