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.
John Dyson to make it reliably work under FreeBSD.
2) Added and enabled PROCFS in the GENERICxx and LINT kernels.
3) New execve() from me. Still work to be done here, but this version
works well and is needed before other changes can be made. For
a description of the design behind this, see freebsd-arch or
ask me.
4) Rewrote stack fault code; made user stack VM grow as needed rather
than all up front; improves performance a little and reduces
process memory requirements.
5) Incorporated fix from Gene Stark to fault/wire a user page table
page to fix a problem in copyout. This is a temporary fix and
is not appropriate for pageable page tables. For a description
of the problem, see Gene's post to the freebsd-hackers mailing
list.
6) Tighten up vm_page struct to reduce memory requirements for it. ifdef
pager page lock code as it's not being used currently.
7) Introduced new element to vmspace struct - vm_minsaddr; initial
(minimum) stack address. Compliment to vm_maxsaddr.
8) Added a panic if the allocation for process u-pages fails.
9) Improve performance and accuracy of kernel profiling by putting in
a little inline assembly instead of spl().
10) Made serial console with sio driver work. Still has problems with
serial input, but is almost useable.
11) Added -Bstatic to SYSTEM_LD in Makefile.i386 so that kernels will
build properly with the new ld.
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.
The following patch adds the addr argument to signal handlers.
The kernel with the patch is no more and no less in compliance or in
violation of POSIX and ANSI C than the kernel before the patch.
The added functionality this addr argument provides is quite useful. It
enables an entire class of algorithms which use mprotect to trace memory
references. Beside garbage collectors, I have heard of this technique being
applied to debuggers and profilers. The only benchmarking I've performed is
using akcl to compile maxima: without the kernel patch, it takes 7 hours to
compile maxima, while with stratified garbage collection, it only takes 50
minutes.
Basically, I can't think of a reason not to add the addr argument and there
is a compelling need for it.
If you find the patch acceptable, please let me know so I can send my
FreeBSD akcl config files to wfs for inclusion in the core akcl release.
The old 386BSD config files there won't work on either NetBSD or FreeBSD.
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
Subject: Page fault in PTE area fails in copyout
Index: sys/i386/i386/trap.c FreeBSD-1.0.2
Description:
Reading files of several megabytes into Emacs, or many small
files all at once, would fail with "IO error - bad address".
Repeat-By:
The bug can be exercised by a test program that malloc()'s
a 5MB chunk of memory, and then, without accessing the memory
first, filling it with data from a file using read().
(I read 64k chunks from /dev/wd0d into successive 64k regions
of the 5MB chunk.) The read() will fail with EFAULT at the first
virtual address boundary that is a multiple of 0x400000.
Fix:
The problem was code in sys/i386/i386/trap.c that tries to
figure out what kind of trap occurred and to handle it appropriately.
It was interpreting any page fault with virtual address
>= vm->vm_maxsaddr as being a user stack segment fault.
In fact, addresses >= USRSTACK are in the user structure/PTE area,
and if they are handled as stack faults, the proper PTE will
not be paged in when it is supposed to be. This situation comes
up in copyout() and copyoutstr(), if PTE's are accessed for the
first time ever. The page fault on accessing the nonexistent PTE
is mishandled as a stack fault, and then the fault that occurs on
the subsequent access to the page itself causes copyout to fail
with EFAULT.
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.
Change movl %es: -2(reg) to use a subl $2,reg when fixing up the IDT
entries for bdb. This seems to be the best way to go.
Some day soon #ifdef BDB all of Bruces debugger code.
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.