Subject: Re: NetBSD-VAX tape non-rewinding funzies
To: None <port-vax@netbsd.org>
From: Carl Lowenstein <cdl@mpl.ucsd.edu>
List: port-vax
Date: 11/07/2000 22:14:36
> Date: Tue, 7 Nov 2000 23:20:57 +0100 (CET)
> From: jkunz@unixag-kl.fh-kl.de
> Subject: Re: NetBSD-VAX tape non-rewinding funzies
> To: nbsdbob@weedcon1.cropsci.ncsu.edu
> 
> On  7 Nov, NetBSD Bob wrote:
> 
> > I just got a pointer to delete my *st* devices and remake them
> > (I'm running 1.5B1 currently), in case some minor numbers are
> > off.  I will try that tonight.
> Hmmm? Hmmmmmm??? Lets have a look at the tape device nodes... tape
> _block_ devices [deleting them] ... so we have:
> ---
> [root@Zimbo root]$ l /dev/*st[0-9]*  
> crw-rw----  1 root  operator  60,  4 Nov  7 22:16 /dev/nrst0
> crw-rw----  1 root  operator  60,  5 Sep 27 20:10 /dev/nrst1
> crw-rw----  1 root  operator  60, 12 Sep 27 20:10 /dev/nrst8
> crw-rw----  1 root  operator  60, 13 Sep 27 20:10 /dev/nrst9
> crw-rw----  1 root  operator  60,  0 Sep 27 20:10 /dev/rst0
> crw-rw----  1 root  operator  60,  1 Sep 27 20:11 /dev/rst1
> crw-rw----  1 root  operator  60, 12 Sep 27 20:10 /dev/rst12
> crw-rw----  1 root  operator  60, 13 Sep 27 20:11 /dev/rst13
> crw-rw----  1 root  operator  60,  4 Sep 27 20:10 /dev/rst4
> crw-rw----  1 root  operator  60,  5 Sep 27 20:11 /dev/rst5
> crw-rw----  1 root  operator  60,  8 Sep 27 20:10 /dev/rst8
> crw-rw----  1 root  operator  60,  9 Sep 27 20:11 /dev/rst9
> ---
> /dev/nrst0 == /dev/rst4 ???
> I think we have a buggy MAKEDEV. Can anyone point to the correct minor
> device numbers? 

I don't have my 4.3BSD manual set at home to check against.  But
there is bit overload in the device numbers.  "No computer should
have more than two tape drives" and they are numbered 0 and 1.
Higher order bits in the minor device number are used to code
other properties of the device, like tape density and no-rewind.

So /dev/nrst0 is /dev/rst0 with the 4-bit set, maybe meaning no-rewind,
and thus becomes equivalent to /dev/rst4.

/dev/rst8 is /dev/rst0 with the 8-bit set, maybe meaning higher density.
/dev/nrst8 is /dev/rst8 with the 4-bit set, thus equivalent to /dev/rst12.
Add 1 to get the other tape drive.

I seem to remember that the 2-bit was used to code something else.
My fingertips remember /dev/rst8 as 1600BPI density rather than 800,
in the days when you could actually select the tape density by
software.

A visit to the manual page is called for, followed by a visit to the
source code for the driver.

> > One fellow suggested letting it rewind then fsf'ing to the end and
> > continuing.  

That was me.  (cdl)

> Hmmm. I think this might not work, because every time you use mt(1) the
> divice will be opened and closed. close on device => tape rewinds. 

Isn't the whole point of the non-rewind device that the tape does
not rewind on close.  It certainly has worked that way in the past
on real reel magtapes, and works that way now on SCSI DAT tapes,
on a variety of OS's that I have at my fingertips.  But none of
them is 4.? BSD.

    carl
-- 
        carl lowenstein         marine physical lab     u.c. san diego
        {decvax|ucbvax} !ucsd!mpl!cdl                 cdl@mpl.ucsd.edu
                                                  clowenstein@ucsd.edu