1) check va before clearing the page clean flag. Not doing so was
causing the vnode pager error 5 messages when paging from
NFS. (pmap.c)
2) put back interrupt protection in idle_loop. Bruce didn't think
it was necessary, John insists that it is (and I agree). (swtch.s)
3) various improvements to the clustering code (vm_machdep.c). It's
now enabled/used by default.
4) bad disk blocks are now handled properly when doing clustered IOs.
(wd.c, vm_machdep.c)
5) bogus bad block handling fixed in wd.c.
6) algorithm improvements to the pageout/pagescan daemons. It's amazing
how well 4MB machines work now.
finally have the f**king documentation!):
1) Changed all the numeric register offsets to symbolic ones (it should
have been this way originally).
2) If 16 bit, disable the shared memory when not using it. Apparantly
switching between 8/16bit mode makes the Ultra unhappy unless
this is done (i.e. it trashes the bus).
- ansi prototypes in lpt.c
- a bit of tidying in lpt.c
- ioctl in lpt.c for switching between polling and using interrupts
- added lpt.h - needed for ioctl to allow switching between polling
and interrupt-driven modes.
1) fixed some bugs related to the bounce buffer code
2) vnode pager now supports clustered pageouts
3) experimental code for clustering all I/O via a new "cldisksort"
4) added >16MB check to Bustek driver
5) made some experimental algorithmic changes to the pageout daemon
6) fixed bugs in truncating mapped files (esp when mapped via NFS)
7) reorganized vnode pager I/O code
---
This list of changes is in approximately chronological order (oldest first).
o Many cosmetic changes - renamed comintr1 -> siointr1, moved
things around and fixed whitespace.
o Reduced SLIP latency (FRAME_END hack) from 20-30 ms to 16 ms
at 115200 bps (you won't notice the average 10 ms improvement
on slow lines). ppp seems to use only counted transfers so
there's no similar hack available. It's too hard for the
driver to know the count.
o Temporary #ifdefs for new and old interrupt handling
(OLD_INTERRUPT_HANDLING decided by setsofttty() not being
externally defined.
o Don't test for the IIR_NOPEND bit being set - test for the
non-fifo part of the iir equalling it like the docs say to.
States with other IIR_NOPEND set in combination with the
other iir bits are undefined. The docs may be stupid - the
old test would not have broken when the fifo bits were
introduced.
o Noted more problems with DTR wait.
o Rewrote console stuff. Still some initialization and state
preservation problems. Same for kgdb stuff. The driver
doesn't do anything about the console close bug. It needs
to be fixed entirely in i386/cons.c. I like chmr's version
where the the console driver revectors the device open and
close routines.
o Temporary (?) #ifdefs for references to tty buffers.
o Noted further things to do in (2 comments about 3 places) for
phk's change to not touch RTS unless it is being used for flow
control.
o Temporary #ifdefs for timestamp handling. It needs fixing.
The microtime() call breaks the first rule of writing fast
interrupt handlers: NO calls to functions that might do slow
and bad things. microtime() enables interrupts. This turns
out to be only moderately harmful. Also, I want the timestamp
copy outside of the normal interrupt handler.
o Don't init com->tp early for the !DONT_MALLOC_TTYS case -
both sides are NULL.
o Worry about com->tp == NULL in siopoll. I don't see how you
survived the (incc <= 0 || !(tp->state & TS_ISOPEN)) test.
Perhaps early sttys or comcontrols set up the tp's for _all_
the ports before this code is reached.
list of changes, I've made the following additional changes:
1) i386/include/ipl.h renamed to spl.h as the name conflicts with the
file of the same name in i386/isa/ipl.h.
2) changed all use of *mask (i.e. netmask, biomask, ttymask, etc) to
*_imask (net_imask, etc).
3) changed vestige of splnet use in if_is to splimp.
4) got rid of "impmask" completely (Bruce had gotten rid of netmask),
and are now using net_imask instead.
5) dozens of minor cruft to glue in Bruce's changes.
These require changes I made to config(8) as well, and thus it must
be rebuilt.
-DG
from Bruce Evans:
sio:
o No diff is supplied. Remove the define of setsofttty(). I hope
that is enough.
*.s:
o i386/isa/debug.h no longer exists. The event counters became too
much trouble to maintain. All function call entry and exception
entry counters can be recovered by using profiling kernel (the new
profiling supports all entry points; however, it is too slow to
leave enabled all the time; it also). Only BDBTRAP() from debug.h
is now used. That is moved to exception.s. It might be worth
preserving SHOW_BITS() and calling it from _mcount() (if enabled).
o T_ASTFLT is now only set just before calling trap().
o All exception handlers set SWI_AST_MASK in cpl as soon as possible
after entry and arrange for _doreti to restore it atomically with
exiting. It is not possible to set it atomically with entering
the kernel, so it must be checked against the user mode bits in
the trap frame before committing to using it. There is no place
to store the old value of cpl for syscalls or traps, so there are
some complications restoring it.
Profiling stuff (mostly in *.s):
o Changes to kern/subr_mcount.c, gcc and gprof are not supplied yet.
o All interesting labels `foo' are renamed `_foo' and all
uninteresting labels `_bar' are renamed `bar'. A small change
to gprof allows ignoring labels not starting with underscores.
o MCOUNT_LABEL() is to provide names for counters for times spent
in exception handlers.
o FAKE_MCOUNT() is a version of MCOUNT() suitable for exception
handlers. Its arg is the pc where the exception occurred. The
new mcount() pretends that this was a call from that pc to a
suitable MCOUNT_LABEL().
o MEXITCOUNT is to turn off any timer started by MCOUNT().
/usr/src/sys/i386/i386/exception.s:
o The non-BDB BPTTRAP() macros were doing a sti even when interrupts
were disabled when the trap occurred. The sti (fixed) sti is
actually a no-op unless you have my changes to machdep.c that make
the debugger trap gates interrupt gates, but fixing that would
make the ifdefs messier. ddb seems to be unharmed by both
interrupts always disabled and always enabled (I had the branch in
the fix back to front for some time :-().
o There is no known pushal bug.
o tf_err can be left as garbage for syscalls.
/usr/src/sys/i386/i386/locore.s:
o Fix and update BDE_DEBUGGER support.
o ENTRY(btext) before initialization was dangerous.
o Warm boot shot was longer than intended.
/usr/src/sys/i386/i386/machdep.c:
o DON'T APPLY ALL OF THIS DIFF. It's what I'm using, but may require
other changes.
Use the following:
o Remove aston() and setsoftclock().
Maybe use the following:
o No netisr.h.
o Spelling fix.
o Delay to read the Rebooting message.
o Fix for vm system unmapping a reduced area of memory
after bounds_check_with_label() reduces the size of
a physical i/o for a partition boundary. A similar
fix is required in kern_physio.c.
o Correct use of __CONCAT. It never worked here for non-
ANSI cpp's. Is it time to drop support for non-ANSI?
o gdt_segs init. 0xffffffffUL is bogus because ssd_limit
is not 32 bits. The replacement may have the same
value :-), but is more natural.
o physmem was one page too low. Confusing variable names.
Don't use the following:
o Better numbers of buffers. Each 8K page requires up to
16 buffer headers. On my system, this results in 5576
buffers containing [up to] 2854912 bytes of memory.
The usual allocation of about 384 buffers only holds
192K of disk if you use it on an fs with a block size
of 512.
o gdt changes for bdb.
o *TGT -> *IDT changes for bdb.
o #ifdefed changes for bdb.
/usr/src/sys/i386/i386/microtime.s:
o Use the correct asm macros. I think asm.h was copied from Mach
just for microtime and isn't used now. It certainly doesn't
belong in <sys>. Various macros are also duplicated in
sys/i386/boot.h and libc/i386/*.h.
o Don't switch to and from the IRR; it is guaranteed to be selected
(default after ICU init and explicitly selected in isa.c too, and
never changed until the old microtime clobbered it).
/usr/src/sys/i386/i386/support.s:
o Non-essential changes (none related to spls or profiling).
o Removed slow loads of %gs again. The LDT support may require
not relying on %gs, but loading it is not the way to fix it!
Some places (copyin ...) forgot to load it. Loading it clobbers
the user %gs. trap() still loads it after certain types of
faults so that fuword() etc can rely on it without loading it
explicitly. Exception handlers don't restore it. If we want
to preserve the user %gs, then the fastest method is to not
touch it except for context switches. Comparing with
VM_MAXUSER_ADDRESS and branching takes only 2 or 4 cycles on
a 486, while loading %gs takes 9 cycles and using it takes
another.
o Fixed a signed branch to unsigned.
/usr/src/sys/i386/i386/swtch.s:
o Move spl0() outside of idle loop.
o Remove cli/sti from idle loop. sw1 does a cli, and in the
unlikely event of an interrupt occurring and whichqs becoming
zero, sw1 will just jump back to _idle.
o There's no spl0() function in asm any more, so use splz().
o swtch() doesn't need to be superaligned, at least with the
new mcounting.
o Fixed a signed branch to unsigned.
o Removed astoff().
/usr/src/sys/i386/i386/trap.c:
o The decentralized extern decls were inconsistent, of course.
o Fixed typo MATH_EMULTATE in comments. */
o Removed unused variables.
o Old netmask is now impmask; print it instead. Perhaps we
should print some of the new masks.
o BTW, trap() should not print anything for normal debugger
traps.
/usr/src/sys/i386/include/asmacros.h:
o DON'T APPLY ALL OF THIS DIFF. Just use some of the null macros
as necessary.
/usr/src/sys/i386/include/cpu.h:
o CLKF_BASEPRI() changes since cpl == SWI_AST_MASK is now normal
while the kernel is running.
o Don't use var++ to set boolean variables. It fails after a mere
4G times :-) and is slower than storing a constant on [3-4]86s.
/usr/src/sys/i386/include/cpufunc.h:
o DON'T APPLY ALL OF THIS DIFF. You need mainly the include of
<machine/ipl.h>. Unfortunately, <machine/ipl.h> is needed by
almost everything for the inlines.
/usr/src/sys/i386/include/ipl.h:
o New file. Defines spl inlines and SWI macros and declares most
variables related to hard and soft interrupt masks.
/usr/src/sys/i386/isa/icu.h:
o Moved definitions to <machine/ipl.h>
/usr/src/sys/i386/isa/icu.s:
o Software interrupts (SWIs) and delayed hardware interrupts (HWIs)
are now handled uniformally, and dispatching them from splx() is
more like dispatching them from _doreti. The dispatcher is
essentially *(handler[ffs(ipending & ~cpl)]().
o More care (not quite enough) is taken to avoid unbounded nesting
of interrupts.
o The interface to softclock() is changed so that a trap frame is
not required.
o Fast interrupt handlers are now handled more uniformally.
Configuration is still too early (new handlers would require
bits in <machine/ipl.h> and functions to vector.s).
o splnnn() and splx() are no longer here; they are inline functions
(could be macros for other compilers). splz() is the nontrivial
part of the old splx().
/usr/src/sys/i386/isa/ipl.h
o New file. Supposed to have only bus-dependent stuff. Perhaps
the h/w masks should be declared here.
/usr/src/sys/i386/isa/isa.c:
o DON'T APPLY ALL OF THIS DIFF. You need only things involving
*mask and *MASK and comments about them. netmask is now a pure
software mask. It works like the softclock mask.
/usr/src/sys/i386/isa/vector.s:
o Reorganize AUTO_EOI* macros.
o Option FAST_INTR_HANDLER_USERS_ES for people who don't trust
fastintr handlers.
o fastintr handlers need to metamorphose into ordinary interrupt
handlers if their SWI bit has become set. Previously, sio had
unintended latency for handling output completions and input
of SLIP framing characters because this was not done.
/usr/src/sys/net/netisr.h:
o The machine-dependent stuff is now imported from <machine/ipl.h>.
/usr/src/sys/sys/systm.h
o DON'T APPLY ALL OF THIS DIFF. You need mainly the different
splx() prototype. The spl*() prototypes are duplicated as
inlines in <machine/ipl.h> but they need to be duplicated here
in case there are no inlines. I sent systm.h and cpufunc.h
to Garrett. We agree that spl0 should be replaced by splnone
and not the other way around like I've done.
/usr/src/sys/kern/kern_clock.c
o splsoftclock() now lowers cpl so the direct call to softclock()
works as intended.
o softclock() interface changed to avoid passing the whole frame
(some machines may need another change for profile_tick()).
o profiling renamed _profiling to avoid ANSI namespace pollution.
(I had to improve the mcount() interface and may as well fix it.)
The GUPROF variant doesn't actually reference profiling here,
but the 'U' in GUPROF should mean to select the microtimer
mcount() and not change the interface.
/dev/mcd0a instead of /dev/mcd0d. This is more conforming to the /dev/cd0a
for the SCSI cdrom drives. It breaks the convention d the whole drive.
But the question is, do we really need partitions on cdrom drives ?
1) tty.c: gather all the info about the processes before calling ttyprintf
(which may block).
2) syscons.c: handle asynchronous output properly (data structures may
be corrupted otherwise).
Example:
Application use port cua01
Getty open ttyd1 (allocates rawq,outq,etc) and waits while application
done
Application quits, sioclose issued, ttyfree issued (getty calls revoke)
Getty awakes and goes to panic into initrb (NULL rawq)
now HUPCL set only in bidir case for callin lines
(this prevents set HUPCL on mouse)
comhardclose:
in addition to HUPCL case now DTR dropped for bidir case
if line was active in and no carrier present now.
(this prevents DTR sleep on mouse)
Subject: Re: Bugs with floppy drives
Date: Tue, 8 Mar 94 9:11:54 CST
The transfer speed was only set in the retry after error, not when
switching drives.
it still looks a little suspicious that so many of the status codes are missing
so I'm not going to adopt all of the existing ones yet. Try to be more
descriptive in the use of hex constants.
Changes _only_ take effect if `options LAPTOP' is set.
Note: This one is distinctly dodgy. When my IDE drive spins back up from sleep
mode, it generates this `extra interrupt' condition by spinning back up and
generating an intr, though without any particular action required. This
message coming out every time is rather annoying, and thus disabled.
However, what I'm not at all sure of is whether or not all IDE drives will
behave in the same way, or if perhaps it needs to be done in a more complicated
fashion by detecting this more involved "I've spun up and am just saying hi"
condition. This is a simple change and easy to back out/ammend if anybody has
any better ideas.
hack in the moment for testing purposes and to get the drive going
again.
0x20 means empty drive.
0x30 means closed drive with CDROM inserted.
0x80 means drive pulled out, but door closed.
0xa0 means drive pulled out and door open.
Luckily none of these values are the same as that reported for Ethernet
cards ( 0 for WD8003E, 0x40 for WD8013EPC, 0x60 for NE2000).
The bad part is, the probe code gets the WD8003E so hosed, that it is
no longer usable after it. No problem with the WD8013EPC.
my previous fix too (using wdp_heads controller value) and check
0 heads case too.
Other fixes from Bruce:
2) Fix dk_timeout from 2 to about 4 seconds.
3) wdcontrol not retried on internal error.
4) wdwait return check changed ( "!=0" to "<0" into wdsetctlr,
"<0" to "!=0" into wdgetctlr).
This inetrface should be used from now on.
pseudo device pty xx still keeps its meaning: a maximum of
xx ptys is allowed.
A ringbuffer is now 2040 bytes long, per Garrett Wollman's request.
The changes are inspired by the way NetBSD did it (thanks for that!),
though I made it slihghtly different, including the interface so
at least 75% of the allocated space is deallocated when the tty is
closed.
Note further that it is easy to modify the ringbuffer length runtime.
This will have to wait untill some later date...
-Guido
Subject: Bugfix for SB16 with DSP version 4 and above
No description sent, but it appears to fix a major number problem
with certain models of the SB16.
Small hack, if heads > 16, output a warning and then set the head
count to 16. This stops the infinite loop on this error and allows
people to later fix the DOS parameter table later with fdisk.
run Exabyte 8505 on 1742's. This may not be the final solution, but it
makes it work. It may be better to change the DELAY(10) to DELAY(30)
inside the loop instead of increasing the loop count from 100 to 300.
Subject: Bug Fix for ft.c - please commit
Date: Mon, 14 Feb 94 10:22:54 CST
This fixes a bug where the system can crash if the tape is used
after the floppy has been used.
When the keyboard is probed, the LED's blink quickly and
"Keyboard reset failed" is printed on the console. The
init routine keeps trying endlessly with the same behavior
as above.
I got the latest -current sup sources (06-Feb-94 12:00 GMT) to work using the
old syscons.c. The following patch makes the new syscons work:
2) Make SNAKE_SAVER like default, if no saver specified in "options"
3) Remove #ifdef STAR_SAVER before line /* make screensaver happy */
this code needed in any case.
Subject: syscons-1.3
Date: Sat, 29 Jan 94 23:33:50 MET
But here is the (hopefully) final syscons-1.3....
....
I've changed sgetc so it works as the pccons parallel
(it now uses a scgetc internally).
[
There were a couple changes that Bruce Evans sent me that were applied
to this version along with some changes that S'ren didn't incorporate
into the final version. There will be only minor changes if anything
from this version to his final release.
]
o merged and fixed timeout code from sos.
o merged DOS partition support from sos.
o fixed "extra" interrupts.
o check if malloc retuns NULL :-(.
o print drive size as in NetBSD
o after an error, return the residual count, not 0.
o give up early for > 16 heads.
o cleaned up the old-drive detection in wdgetctlr().
o rewrote wddump(). I'd been putting this off because
I'd had the dump disabled since 0.0 and had no idea
if even the standard version worked. It didn't:
(0) syscons' sgetc() interface broke some keyboard
stuff.
(1) CADDR1 is mapped using pmap() and pmap got a NULL
pointer trap (at least when I got to wddump() using
call diediedie from ddb) because the pte for CADDR1
is only supposed to be hacked on directly (e.g. in
physcopyseg()).
(2) bad144 handling was not done.
(3) it was slooow (3600 sectors/minute) because my
controller doesn't cache writes.
o miscellaneous other cleanups, e.g., removed scattered
patchkit/terry dates.
o lots of reformatting.
To be done:
o Merge/fix TIH/NetBSD bad144 code (doesn't belong in any
particular driver. Why aren't we using i386/dkbad.c?).
o Merge/fix Dyson/NetBSD clustering code (large parts
should be shared).
o Fix/extend the partition in use bits. Support extended
partitions. This should be shared by all disk drivers. Swap
to a DOS partition so that the swap space can be shared with
linux.
o Don't use polling except for initialization. Need to
reorganise the state machine. Then "extra" interrupts
shouldn't happen (except maybe one for initialization).
o Fix disklabel, boot and driver inconsistencies with
bad144 in standard versions.
o Look at latest linux clustering methods. Our disksort()
gets in the way of clustering.
o cleaned up the ATA changes (needs more work. I think
the ATA specs say that the only thing really wrong with
the original version of wx is that there was no test
for drive-ready before some commands. 400 nsec delay
suffices for almost everything and 400 nsec delay is
usually "free").
netmask or impmask.
2) Fixes from Bruce:
o Changed name of schedsoftcom() to setsofttty() to match
setsoftclock()
o Bool_t isn't used.
o tx_fifo_size is 1 for chips without fifos, 16 for 16550's, to
help to output more efficiently for 16550's (LSR_TXRDY means
that the fifo is empty, not that it has space for one char).
o Changed name of softsio1() to siopoll() and merged compoll()
into siopoll().
o The probe forgot to clear com_mcr after it failed. This is
harmful for 4 single serial ports on 2 interrupts. It makes
partial misconfigurations worse.
o Don't bother initializing static variables that are 0 (bidir
stuff).
o Only initialize t_oflag to TTYDEF_OFLAG if unit == COMCONSOLE,
not if COMCONSOLE is defined.
o Don't call siointr() from comparam() if there is no output in
progress. For the call from sioopen(), there's no output in
progress, and siointr() often saw silo overflows for stale
input because it was called before sioopen() discarded the
input.
o Let ttselect() do the work for select(), so that the fixes for
ttselect() don't have to be duplicated in zillions of drivers.
Yes, I know that IFADDR ioctl is supposed to be deprecated... Note
that the patch was modified by me to fit better into the driver. -DG
...
While porting CAP to 386bsd/pk0.2.4 and now to FreeBSD Release 1.0
I found a couple of bugs associated with the packet filter. Here
are the fixes. I'm posting them here because they apply to
FreeBSD and 386bsd/pk0.2.4 and possibly to other *BSD.
The first occurs when using the packet filter to write raw
ethernet packets. The header consisting of the sender and
destination addresses and the protocol is removed and later
added back on, but with the byte order of the protocol reversed.
The fix ensures that the byte order in the protocol field is
swapped when it is removed.
The second fix ensures that SIOCGIFADDR works for BPF as claimed
in the man pages, by adding it to the ed driver. Similar fixes
will be needed for other ethernet drivers.
Dave Matthews.
file override to disable fifo on 16550s:
I bought a board with two 16550's, but one of those ports has a mouse
on it. The sio driver always enables the fifo, which is a bad thing
for mice and X. The mouse is jerky and hard to use. The simple thing
is be to treat one of the ports as a non-fifo'ed UART, and I use the
flags option in my config file.
So, my config file has:
device sio0 at isa? port "IO_COM1" tty irq 4 flags 0x2 vector siointr
device sio1 at isa? port "IO_COM2" tty irq 3 vector siointr
(patch deleted)
Cuddle { braces up where possible on if statements
Add missing splx(s) calls before some returns.
Remove extra semicolon that was keeping uha_init from returning
before the timeout occured. This should speed probing up quite
a bit!
0) FreeBSD additional include files additions
1) Rod's arpacom changes
2) Function type and return code cleanup, and all functions have correct
casting to the correct data types
3) Bugfix where driver would not function due to missing structure not
given a value.
4) General cleanup. (Theo did a lot already, I just did some more)
Date: Mon, 17 Jan 94 20:52:14 PST
As reported on the -bugs list by some one, and confirmed by Julian:
> I increased AHA_RESET_TIMEOUT in aha1542.c from 1000 to 10000
> and now my 1542C is found everytime.
Changed the output of the isa probe routine, that only devices, that
have an IO address and are smaller than 0x100 to be on the motherboard.
The seagate SCSI adapter is an example of a card, that doesn't have
an IO address and works only memory mapped.
Choose older MULTIPORT version, because lastest bde version
not worked.
Don't force HUPCL for bidirectional case.
From bde:
Use bit (1 << (16 + 4)) in schedsoftcom() to avoid clash with
non-serial h/w on IRQ4.
Allow FIFO_TRIGGER in config.
Clear com->mcr_image when clearing mcr for init of 4port. The
usual value MCR_IENABLE should have broken 4ports unless
something happened to clear it later.
Turn off interrupts as well as DTR after an error waiting for
carrier (bidir dialin case).
Drain fifo more carefully.
Don't hang up if debugging.
Rearrange siointr() -> siointr1() for multiport case for speed,
lower latency and clarity.
Use suser() to check perms.
Provide missing splx() after failed perms checks.
c_ispeed == 0 means c_ispeed = c_ospeed (POSIX).
Set parameters (except speed) for c_ospeed == 0 as well as
hanging up.
Better initialization for console (fifo stuff...).
Misc. cleanups.
Fix dead hang if modem power is off.
problems in the moment are stray intr's in the ifconfig up/down.
No way to select all three interfaces on a combo card with
AUI/BNC/UTP interfaces and the performance doesn't look good.
Only tested with a ISA AUI/BNC card yet.
Added it to the list of known boards and put it into the the list for
the mailbox unlock. Maybe all board-ids over 0x42 should be in the
mailbox unlock part ?
enough tests to be considered more stable than current driver.
Lots of work by Bruce, David G., and Guido have gone into this version, and
more is to come in the future.
Support for multiple controllers is in, but doesn't work correctly with
different controllers (IDE AND MFM), but multiple alike controllers appears
to work.
Most of the stray interrupts problems should be fixed, although you will
get a couple 'extra interrupts' when disklabeling and on startup.
can actually write a sane netif device to support one of these. Note that it
was necessary to steal a netisr bit from another protocol; I took the one for
PF_DATAKIT (no great loss).
a binary link-kit. Make all non-optional options (pagers, procfs) standard,
and update LINT to reflect new symtab requirements.
NB: -Wtraditional will henceforth be forgotten. This editing pass was
primarily intended to detect any constructions where the old code might
have been relying on traditional C semantics or syntax. These were all
fixed, and the result of fixing some of them means that -Wall is now a
realistic possibility within a few weeks.
Entries for 800 and 820 fixed.
From vak@kiae.su:
incorporate Joerg Wunsch formatting code
correct handle timeouted operations
fixed entry for 720 media
GAP values changed suitable for possible format code addition.
Read/write GAP always 2 now.
Interleave parameter added for possible format code addition.
Many logical formats added.
720K physical drive added.
Problems: still can't read 720..820 media in 1.44 drive.
800K in HD 5.25in (maximum for DD diskettes)
1.44M in HD 5.25in (for easy distributions)
1.46M in HD 5.25in (maximum for 5.25)
Some cosmetique changes.
Now minor looks like UU DDDDDD, UU - unit, DDDDDD - density.
If density == 0, CMOS-detect format assumed.
Fix attach code for correct work with unknown CMOS
floppy types.
Trick diskerr to handle new minor.
1.722M floppy in 1.44M drive popular format added.
from:
Sergey Ryzhkov, Serge Vakulenko
E-mail: <sir@kiae.su>, <vak@zebub.msk.su>
This is the streamer tape driver for 386bsd and FreeBSD, which
supports Wangtek and Archive compatible QIC-02/QIC-36 controllers.
It was developed as a replacement of the old Wangtek tape driver from CMU.
In comparison with the CMU driver, this version has the following enhancements:
1) Support for Archive SC402 and SC499 tape controllers added.
2) Support for up to three tape controllers on the same machine.
3) Support for BSD-style ioctls MTIOCGET, MTIOCTOP.
Mt command now works adequately with this driver.
2) Asynchronous REWIND and FSF operations, close() will not wait
until they finish. The next open() will wait for it instead.
4) Use of WTQICMD ioctl is limited to ERASE and RETENS operations.
This prevents the user from locking the tape driver by strange
tape operations.
5) Tape density switching added.
6) The status of the process, blocked on the tape operation,
is displayed at the WCHAN column of the `ps' command as:
wtread reading data from the tape
wtwrite writing data to the tape
wtrfm reading the tape marker
wtwfm writing the tape marker
wtrew rewinding the tape
wterase doing WTQICMD ERASE operation
wtretens doing WTQICMD RETENS operation
wtorew doing MTIOCTOP REW/OFFL operation
wtorfm doing MTIOCTOP FSF operation
wtowfm doing MTIOCTOP WEOF operation
7) It's possible to use the tape with "default density",
useful for devices which don't support density switching
or do automatic format determination.
8) Some controllers support only 1024 block length.
Setting WT_BSIZE bit in device minor number turns on this mode.
Minor number structure:
0bfffuuu
Fields:
uuu - Unit number. It's possible to install
up to three tape controllers on the same machine,
using DRQs 1..3. Hence, unit number can lie
in range 0..2.
fff - Tape format number:
0 - /dev/rwt0 - default density (auto select)
1 - /dev/rwt0a - QIC 11 (obsolete)
2 - /dev/rwt0b - QIC 24 (60 megabytes)
3 - /dev/rwt0c - QIC 120 (120 megabytes)
4 - /dev/rwt0d - QIC 150 (150 megabytes)
5 - /dev/rwt0e - QIC 300 (300 megabytes?)
6 - /dev/rwt0f - QIC 600 (600 megabytes?)
b - Long block size flag. With this bit set,
the driver will perform all i/o operations
with the controller using 1024-byte
blocks, instead of 512 ones.
Some controllers need it (CMS for example).
If you Wangtek controller does not stream well,
you can try to use /dev/rWt0 device instead
of /dev/rwt0 (uncomment needed lines in /dev/MAKEDEV
to create it).
Block interface (writing blocks less than 2048 bytes) is not functioning
pwoperly. Use raw interface instead.
Thanks to all who helped to test it on the following hardware:
Controller Drive Volume Interface Thanks to
---------------------------------------------------------------------------
Archive SC-499 Archive 2150L 150 Meg QIC-02 KIAE
CMS? ? 150 Meg QIC-02 KIAE
Everex EV 831/833 ? ? QIC-36 Joergen Haegg
Wangtek ASSY Wangtek 60 Meg QIC-02 Ken Whedbee
Tecmar QT150i? Wangtek 5150EQ ? QIC-02? Marko Teiste
? Wangtek 5099EK 60 Meg QIC-36 Robert Shien
Archive SC400S ? 60 Meg ? Warren Toomey
possible end-user errors.
Now:
1) on physical 1.2 can open logical 1.2, 720, 360H
2) on physical 1.44 can open logical 1.44, 720
3) on physical 360 can open logical 360
All other variants refused.
C-style improved in this check, multiply if's changed to switch.
More work to add 720K floppy support.
Restore good old dependance of device and floppy type.
Now:
fd?a == 1.44
fd?b == 1.2
fd?c == 720
fd?d == 360 in HD
fd?e == 360
Add more strict size check in Fdopen, not it refuse:
1) Attempt to open any type expect fd?e, if you have only 360K drive.
2) Attempt to open fd?a if you have only 1.2 drive.
added to probe.
2) Force CLOCAL=on for outgoing ports and CLOCAL=off for
incoming ports into open in bidirectional case.
3) Add DELAY after writing to com_ier for fifo drain into probe.
From: <dec@lazarus.nrtc.northrop.com>
Changes between EPSILON and RELEASE of FreeBSD have again caused
the kernel to not see my floppy disk drives. I don't know what happened,
'cause I don't see any changes to fd.c, but here is an old fix that
I have applied to the probe routine which will solve the problem (at
least for me). Since this is a rather brute-force solution - I understand
if you want to ignore it...
[Upgrading to pre-Beta FreeBSD caused this on my system. -AM]
* merged in Garrett Wollman's strict prototype changes
*
* Revision 2.15 1993/11/29 16:32:58 davidg
* From Thomas Sandford <t.d.g.sandford@comp.brad.ac.uk>
* Add support for the 8013W board type
From: Geoff Rehmet <g89r4222@braae.ru.ac.za>
Description:
On bootup, probe of wd drives fails (CP30104), and kernel panics
- cannot mount root
It appears that the device probe just times out.
Increasing the timeout back to its old value fixes the problem.
Repeat-By:
SUP FreBSD-current, Find a CP30104 ..... (ok ok ok)
Basically - Soren's changes barf my disk.
---
From: sos@login.dkuug.dk (S|ren Schmidt)
Subject: IDE-disk hangs - solution/patches NetBSD/FreeBSD
Summary: fixes for lost interrupts with IDE disks
Keywords: hanging-disk, IDE-disk, lost-interrupt
Due to "popular" demand I'm posting these patches to NetBSD/FreeBSD
instead of mailing them around the world :-)
As many have found out there is a problem when using IDE disks on
FreeBSD. Following is a patch that fixes the problem with lost intterrupts.
Both fixes is based on a patch posted here some month ago by
Stefan Behrens?? (sorry I've lost the original article). But anyway it
works (for me :-).
Basically it does a timeout on lost interrupts, starting the operation
again and logging and error message on the console.
It additionally makes the allready present while loop timeouts
independent of CPU speed, and adds minor numbers for easy access to
dos partitions.
* change all splnet's to splimp's
*
* Revision 2.13 1993/11/22 10:53:52 davidg
* patch to add support for SMC8216 (Elite-Ultra) boards
* from Glen H. Lowe
*
* Revision 2.12 1993/11/07 18:04:13 davidg
* fix from Garrett Wollman:
* add a return(0) at the end of ed_probe so that if the various device
* specific probes fail that we just don't fall of the end of the function.
when the machine panics.
i386/i386/locore.s:
1) got rid of most .set directives that were being used like
#define's, and replaced them with appropriate #define's in
the appropriate header files (accessed via genassym).
2) added comments to header inclusions and global definitions,
and global variables
3) replaced some hardcoded constants with cpp defines (such as
PDESIZE and others)
4) aligned all comments to the same column to make them easier to
read
5) moved macro definitions for ENTRY, ALIGN, NOP, etc. to
/sys/i386/include/asmacros.h
6) added #ifdef BDE_DEBUGGER around all of Bruce's debugger code
7) added new global '_KERNend' to store last location+1 of kernel
8) cleaned up zeroing of bss so that only bss is zeroed
9) fix zeroing of page tables so that it really does zero them all
- not just if they follow the bss.
10) rewrote page table initialization code so that 1) works correctly
and 2) write protects the kernel text by default
11) properly initialize the kernel page directory, upages, p0stack PT,
and page tables. The previous scheme was more than a bit
screwy.
12) change allocation of virtual area of IO hole so that it is
fixed at KERNBASE + 0xa0000. The previous scheme put it
right after the kernel page tables and then later expected
it to be at KERNBASE +0xa0000
13) change multiple bogus settings of user read/write of various
areas of kernel VM - including the IO hole; we should never
be accessing the IO hole in user mode through the kernel
page tables
14) split kernel support routines such as bcopy, bzero, copyin,
copyout, etc. into a seperate file 'support.s'
15) split swtch and related routines into a seperate 'swtch.s'
16) split routines related to traps, syscalls, and interrupts
into a seperate file 'exception.s'
17) remove some unused global variables from locore that got
inserted by Garrett when he pulled them out of some .h
files.
i386/isa/icu.s:
1) clean up global variable declarations
2) move in declaration of astpending and netisr
i386/i386/pmap.c:
1) fix calculation of virtual_avail. It previously was calculated
to be right in the middle of the kernel page tables - not
a good place to start allocating kernel VM.
2) properly allocate kernel page dir/tables etc out of kernel map
- previously only took out 2 pages.
i386/i386/machdep.c:
1) modify boot() to print a warning that the system will reboot in
PANIC_REBOOT_WAIT_TIME amount of seconds, and let the user
abort with a key on the console. The machine will wait for
ever if a key is typed before the reboot. The default is
15 seconds, but can be set to 0 to mean don't wait at all,
-1 to mean wait forever, or any positive value to wait for
that many seconds.
2) print "Rebooting..." just before doing it.
kern/subr_prf.c:
1) remove PANICWAIT as it is deprecated by the change to machdep.c
i386/i386/trap.c:
1) add table of trap type strings and use it to print a real trap/
panic message rather than just a number. Lot's of work to
be done here, but this is the first step. Symbolic traceback
is in the TODO.
i386/i386/Makefile.i386:
1) add support in to build support.s, exception.s and swtch.s
...and various changes to various header files to make all of the
above happen.
set when extended translation is turned on, thus we need to do the mailbox
unlock command no matter what value is in the extended bios flag byte as
the other extensions (ie, > 2 drive support) cause the same problems.
The code has been changed to ALWAYS unlock the mailbox interface on ALL
1542C class boards.
called once when card is attached. Solved problem with driver
getting hosed when a reset takes place.
Removed init_block array -- now part of malloced memory. No more
static declarations left.
Added code so that debug ioctl actually does something.
ifconfig is0 debug will now switch on debugging code.
Other general cleanups.
* Novell probe changed to be invasive because of too many complaints
* about some clone boards not being reset properly and thus not
* found on a warmboot. Yuck.
*
* Revision 2.10 1993/10/23 04:07:12 davidg
* increment output errors if the device times out (done via watchdog)
*
* Revision 2.9 1993/10/23 04:01:45 davidg
* increment input error counter if a packet with a bad length is
* detected.
(rick@snowhite.cis.uoguelph.ca). I am currently using it with a Microsoft
InPort busmouse, under FreeBSD Epsilon. I hadn't planned on supporting it,
but I have patched it a few times, and I guess this is now the de facto
reference version, so send me any problems or improvements.
- Gene Stark
stark@cs.sunysb.edu
October 9, 1993
Date: Tue, 19 Oct 1993 02:22:41 -40962758 (WST)
As the subject line says:
I can;t believe this typo is still here.
Has NOBODY used the isa_dmastart() routine for 16bit DMA?
I know I just hit the dma regs directly for the AHA1542,
and it appears that either everybody else does as well, or
they only use 8bit DMA (e.g. floppy)
Editors Note:
The definition of DMA2_CHN was incorrectly using IO_DMA1!
* increase maximum time to wait for transmit DMA to complete to 120us.
* call ed_reset() if the time limit is reached instead of trying
* to abort the remote DMA.
*
* Revision 2.7 1993/10/15 10:49:10 davidg
* minor change to way the mbuf pointer temp variable is assigned in
* ed_start (slightly improves code readability)
*
* Revision 2.6 93/10/02 01:12:20 davidg
* use ETHER_ADDR_LEN in NE probe rather than '6'.
then use that information to fix the enhancemode features of the
1542C/CF boards by turning them off.
When doing this I found that the Buslogic 545S does NOT properly
mimic the 1542 families AHA_INQUIRE command. It only returns 1
byte of information, when the adaptec manual clearly states that 4
bytes are to be returned. I added a printf that explains the error
when we see a 545S for now, I tried to come up with a better solution,
but it involved to much work for now.
Removed patch kit headers and rcsid strings, add $Id$.
isa.c:
Removed old #ifdef notyet isa_configure code, since it will never be
used, and I have done 90% of what it attempted to.
Add conflict checking code that searchs back through the devtab's looking
for any device that has already been found that may conflict with what
we are about to probe. Checks are mode for I/O address, memory address,
IRQ, and DRQ. This should stop the screwing up of any device that has
alread been found by other device probes.
Print out messages when we are not going to probe a device due to
a conflict so the user knows WHY something was not found. For example:
aha0 not probed due to irq conflict with ahb0 at 11
Now print out a message when a device is not found so the user knows
that it was probed for, but could not be found. For example:
ed1 not found at 0x320
For devices that have I/O address < 0x100 say that they are on the
motherboard, not on isa! The 0x100 magic number is per ISA spec. It
may seem funny that pc0 and sc0 report as being on the motherboard, but
this is due to the fact that the I/O address used is that of the keyboard
controller which IS on the motherboard. We really need to split the
keyboard probe from the display probe. It is completly legal to build
a pc with out one or the other, or even with out both!
npx.c:
Return -1 from the probe routine if we are using the Emulator so
that the i/o addresses are not printed, this is the same trick used
for 486's.
Do not print the ``Errors reported via Exception 16'', and
``Errors reported via IRQ 13'' messages any more, since these just lead
to more user confusion that anything. It still prints the message
``Error reporting broken, using 387 emulator'' so that the person is
aware that there mother board is ill.
> code. As this memcpy generation is done by the compiler it doesn't
> work to have memcpy a macro. Instead I made it a static function that
> calls bcopy.
Okay, I tracked down the d*mn thing that is causing the memcpy to be
emmitted by gcc2. In the following patch is a fix to eliminate the
one place that was causing gcc to do the memcpy in function ie_readframe
for the ie_recv_frame_desc rfd = *(ie->rframes[num]) structure copy.
I also fixed the code so that the NS (XNS) support would compile with
out error and removed the cruft #define ns_* stuff from the softc
structures (I did this a while back for all the other either drivers)
Removed the $Log$ and all of the old log stuff, that is all kept in
the cvs tree, no need to duplicate it in the file... I'll copy it
into my commit message so that it is all retained, except the
revision numbers are going to get screwed up.
It now compiles cleanly under my LINT kernel...
> I have not yet tested this on the AT&T fiver cards yet. But, Wollman
> has used it on various other AT&T cards. I'm pretty sure Terry also
> uses this driver.
$Log$ stuff from Garretts original file
* $Log$
* Revision 1.32 1993/06/20 15:56:15 wollman
* Fixed warning message.
*
* Revision 1.31 93/06/20 15:52:28 wollman
* More compilation lint.
*
* Revision 1.30 93/06/20 15:48:16 wollman
* Commented all the rest of the cast-qual warnings. Might be
* fixed someday by changing the prototypes of bcopy(), bzero(), etc.
*
* Revision 1.29 93/06/20 15:40:13 wollman
* Started fixing some of the cast-qual warnings (most just commented).
*
* Revision 1.28 93/06/12 20:39:14 wollman
* Changed definition of MK_24 to silence -Wcast-qual.
*
* Revision 1.27 93/06/08 17:05:57 wollman
* Attach routine now returns void.
*
* Revision 1.26 93/06/08 16:31:21 wollman
* Deleted attempt to set watchdog timer, since we don't use it.
*
* Revision 1.25 93/04/16 22:15:31 wollman
* Fixed infinite loop in iestart() which would cause the transmitter
* to constantly step on the Ethernet, sending the same two packets over
* and over again. This crashes the router (really!) and makes other
* network users very angry.
*
* Revision 1.24 93/04/14 23:57:47 wollman
* Increased transmit buffer size from 1504 to 1512, just in case I don't
* understand how the MTU is used.
*
* Revision 1.23 93/04/14 23:16:19 wollman
* Fix iestart() so that it only tries to execute a command if one was
* queued up (oops...).
*
* Revision 1.22 93/04/14 23:02:16 wollman
* Unknown changes.
*
* Revision 1.21 93/04/12 18:29:33 wollman
* Added multiple transmit commands. Note that they are always queued in
* pairs (there are only two to begin with), and the I flag is only set
* on the second one. This should decrease interrupt activity somewhat.
*
* Revision 1.20 93/04/12 15:36:05 wollman
* Changed setup of config block to take into account difference between
* StarLAN (10BASE-T) and Ethernet: StarLAN is Manchester, Ethernet is NRZ.
*
* Revision 1.19 93/03/23 18:58:44 wollman
* Raised count of receive buffers from 32 to 48 and included analysis of
* memory usage in a comment near that definition.
*
* Revision 1.18 93/03/18 03:59:53 wollman
* Last try to get large TCP windows to work...
*
* Revision 1.17 93/03/18 03:54:10 wollman
* Added RNR processing as a part of receive interrupts. Hopefully this
* will make everything Just Work now.
*
* Revision 1.16 93/03/18 03:23:24 wollman
* Still having problems with RNR conditions. Basic problem: say we
* set TCP window to 16k, which is a semsible value. Then smart
* partners will blast 16k to us, of which we can fit 8k minus a bit
* into our buffers. (Need to look at that memory map..) So, we get
* an RNR interrupt. The problem is, what do we need to do in this case?
* The original code doesn't work, but it doesn't hang the system either.
*
* Revision 1.15 93/03/18 02:37:00 wollman
* Disabled watchdog timer. This gets called from a timeout somewhere,
* which is running up at softclock. This is at a higher priority than
* we are, so we can get interrupted in the process of receiving something
* by the timer expiration, which is not a nice thing to have happen.
* Question: how can we keep this functionality, but do it in sync with
* our interrupts? (Ugh!)
*
* Revision 1.14 93/03/18 02:35:46 wollman
* Fixed some more problems with receive code---it works!
*
* Revision 1.13 93/03/17 20:15:59 wollman
* Think we fixed the serious (showstopper) bugs in 1.12.
*
* Revision 1.12 93/03/15 17:45:39 wollman
* Changed filtering logic dramatically to avoid the unnecessary copyin
* for BPF or multicast routing when the packet is not for us. (We
* have to run in promiscuous mode in this case.) We still need to
* deal with the problem of allocating one mbuf per receive buffer;
* we should be able to get away with a single mbuf for all reasonable
* incoming packets, and using an mbuf cluster will help avoid unnecessary
* copying of data.
*
* Revision 1.11 93/01/30 20:23:15 wollman
* Fiddled with reset code to hopefully make it work better when the
* watchdog timer expires. Question: why does it make a difference that
* we do the same thing through ieioctl() as we were doing before. The
* old code, when iereset() was called, the receive unit would completely
* die. But, a cycle of ifconfig ie0 down ; ifconfig ie0 up' would bring
* things back to normal. So, we try to mimic that now. Grrr...
*
* Revision 1.10 93/01/29 17:26:50 wollman
* Finally fixed multicast routing/BPF mb_map full problem!!!!
* It turned out that, when we received a packet not for us, we
* would just return from ie_readframe(), *WITHOUT* freeing the
* mbuf that the packet was in. So, when running in promiscuous
* mode (i.e., multicast routing or BPF without -p), we would have
* (on our extremely busy subnet 4) a memory leak of epic proportions.
*
* We now hold on to a single mbuf chain allocated in this way,
* and the next time a packet is read, we free it. Also, the
* next time a packet is transmitted, we free it. This way,
* we never lose more than 6 mbufs total (and on average more like
* 3).
*
* Revision 1.9 93/01/23 14:22:21 wollman
* Added some StarLAN Fiber modifications from L. Jonas Olsson.
*
* Revision 1.8 93/01/23 14:02:34 wollman
* Added support for IP multicasting.
*
* Revision 1.7 92/11/21 17:51:59 wollman
* Added StarLAN Fiber version point to my driver.
*
* Revision 1.6 92/11/20 18:21:45 wollman
* Fixed documentation, made out-of-mbuf condition an error.
*
* Revision 1.5 92/11/20 18:14:02 wollman
* Move change of ethertype to host byte order so that it's after
* bpf_mtap. Hopefully, this will allow us to listen to incoming
* IP packets.
*
* Revision 1.4 92/11/20 18:11:00 wollman
* Added code to drop packets when we run out of mbufs rather than
* panicking. This should alleviate the problems observed when using tcpdump.
*
* Revision 1.3 92/11/14 14:12:40 wollman
* Added BPF support code.
*
* Revision 1.2 92/11/14 13:30:26 wollman
* Added RCS keywords
*
* patch from vak@zebub.msk.su (Serge V.Vakulenko) to work around
* a hardware bug in cheap WD clone boards where the PROM checksum
* byte is always zero
Date: Thu, 30 Sep 1993 15:13:17 +0300
Description:
Old wt driver is too incomplete and buggy.
It does not support Archive controllers, BSD-like
tape ioctls, multiple tape controllers, different
tape density etc.
Fix:
This driver is a replacement of the old one.
It was not tested on different controllers, though.
This is the streamer tape driver for 386bsd and FreeBSD,
which supports Wangtek and Archive controllers.
It was developed as a replacement of the old Wangtek
tape driver from CMU.
In comparison with the CMU driver, this version has the following enhancements:
1) Support for Archive SC402 and SC499 tape controllers added.
2) Support for up to three tape controllers on the same machine.
3) Support for BSD-style ioctls MTIOCGET, MTIOCTOP.
Mt command now works adequately with this driver.
4) Asynchronous REWIND and FSF operations, close() will not wait
until they finish. The next open() will wait for it instead.
5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations.
This prevents the user from locking the tape driver by strange
tape operations.
6) Tape density switching added.
7) The status of the process, blocked on the tape operation,
is displayed at the WCHAN column of the `ps' command as:
wtread reading data from the tape
wtwrite writing data to the tape
wtrfm reading the tape marker
wtwfm writing the tape marker
wtrew rewinding the tape
wterase doing WTQICMD ERASE operation
wtretens doing WTQICMD RETENS operation
wtorew doing MTIOCTOP REW/OFFL operation
wtorfm doing MTIOCTOP FSF operation
wtowfm doing MTIOCTOP WEOF operation
Block interface (writing blocks less than 2048 bytes) is not functioning
pwoperly. Use raw interface instead.
* Added software NIC reset in NE probe to work around a problem
* with some NE boards where the 8390 doesn't reset properly on
* power-up. Remove initialization of IMR/ISR in the NE probe
* because this is inherent in the reset.
* added no multi-buffer override for 3c503
*
* Revision 2.1 93/09/29 12:32:12 davidg
* changed multi-buffer count for 16bit 3c503's from 5 to 2 after
* noticing that the transmitter becomes idle because of so many
* packets to load.
*
* Revision 2.0 93/09/29 00:00:19 davidg
* many changes, rewrites, additions, etc. Now supports the
* NE1000, NE2000, WD8003, WD8013, 3C503, 16bit 3C503, and
* a variety of similar clones. 16bit 3c503 now does multi
* transmit buffers. Nearly every part of the driver has
* changed in some way since rev 1.30.
Date: Wed, 29 Sep 1993 01:54:53 +0300
To bring this error try to make two swap partitons on one disk:
one of the partitions will be not recognized.
Fix is simple: set uninitialized val variable.