1*61599Sbostic.\" Copyright (c) 1983, 1991, 1993 2*61599Sbostic.\" The Regents of the University of California. All rights reserved. 320742Smckusick.\" 447674Scael.\" %sccs.include.redist.man% 520742Smckusick.\" 6*61599Sbostic.\" @(#)rx.4 8.1 (Berkeley) 06/05/93 747674Scael.\" 847674Scael.Dd 947674Scael.Dt RX 4 vax 1047674Scael.Os BSD 4.2 1147674Scael.Sh NAME 1247674Scael.Nm rx 1347674Scael.Nd 1447674Scael.Tn DEC 1547674Scael.Tn RX02 1647674Scaelfloppy disk interface 1747674Scael.Sh SYNOPSIS 1847674Scael.Cd "controller fx0 at uba0 csr 0177170 vector rxintr" 1947674Scael.Cd "disk rx0 at fx0 drive 0" 2047674Scael.Cd "disk rx1 at fx0 drive 1" 2147674Scael.Sh DESCRIPTION 2220742SmckusickThe 2347674Scael.Nm rx 2447674Scaeldevice provides access to a 2547674Scael.Tn DEC 2647674Scael.Tn RX02 2747674Scaelfloppy disk 2847674Scaelunit with M8256 interface module 2947674Scael.Pf ( Tn RX211 3047674Scaelconfiguration). 3147674ScaelThe 3247674Scael.Tn RX02 3347674Scaeluses 8-inch, single-sided, soft-sectored floppy 3420742Smckusickdisks (with pre-formatted industry-standard headers) in 3520742Smckusickeither single or double density. 3647674Scael.Pp 3747674ScaelFloppy disks handled by the 3847674Scael.Tn RX02 3947674Scaelcontain 77 tracks, each with 26 4020742Smckusicksectors (for a total of 2,002 sectors). The sector size is 128 4120742Smckusickbytes for single density, 256 bytes for double density. Single 4247674Scaeldensity disks are compatible with the 4347674Scael.Tn RX01 4447674Scaelfloppy disk unit and with 4547674Scael.Tn IBM 4647674Scael3740 Series Diskette 1 systems. 4747674Scael.Pp 4847674ScaelIn addition to normal (`block' and `raw') 4947674Scael.Tn I/O , 5047674Scaelthe driver supports 5120742Smckusickformatting of disks for either density and 5220742Smckusickthe ability to invoke a 2 for 1 interleaved sector mapping 5347674Scaelcompatible with the 5447674Scael.Tn DEC 5547674Scaeloperating system 5647674Scael.Tn RT-11 . 5747674Scael.Pp 5820742SmckusickThe minor device number is interpreted as follows: 5947674Scael.Pp 6047674Scael.Bl -column Otherx -offset indent 6147674Scael.Sy Bit Description 6220742Smckusick0 Sector interleaving (1 disables interleaving) 6320742Smckusick1 Logical sector 1 is on track 1 (0 no, 1 yes) 6420742Smckusick2 Not used, reserved 6520742SmckusickOther Drive number 6647674Scael.El 6747674Scael.Pp 6847674ScaelThe two drives in a single 6947674Scael.Tn RX02 7047674Scaelunit are treated as 7120742Smckusicktwo disks attached to a single controller. Thus, if there are two 7247674Scael.Tn RX02 Ns 's 7347674Scaelon a system, the drives on the first 7447674Scael.Tn RX02 7547674Scaelare 7647674Scael.Dq Li rx0 7747674Scaeland 7847674Scael.Dq Li rx1 , 7947674Scaelwhile the drives on the second are 8047674Scael.Dq Li rx2 8147674Scaeland 8247674Scael.Dq Li rx3 . 8347674Scael.Pp 8420742SmckusickWhen the device is opened, the density of the disk 8520742Smckusickcurrently in the drive is automatically determined. If there 8620742Smckusickis no floppy in the device, open will fail. 8747674Scael.Pp 8820742SmckusickThe interleaving parameters are represented in raw device 8947674Scaelnames by the letters 9047674Scael.Ql a 9147674Scaelthrough 9247674Scael.Ql d . 9347674ScaelThus, unit 0, drive 0 is 9420742Smckusickcalled by one of the following names: 9547674Scael.Pp 9647674Scael.Bl -column interleavedxx "Device namexx" "Starting Track" -offset indent 9747674Scael.Sy Mapping Device name Starting track 9820742Smckusickinterleaved /dev/rrx0a 0 9920742Smckusickdirect /dev/rrx0b 0 10020742Smckusickinterleaved /dev/rrx0c 1 10120742Smckusickdirect /dev/rrx0d 1 10247674Scael.El 10347674Scael.Pp 10447674ScaelThe mapping used on the 10547674Scael.Ql c 10647674Scaeldevice is compatible with the 10747674Scael.Tn DEC 10847674Scaeloperating system 10947674Scael.Tn RT-11 . 11047674ScaelThe 11147674Scael.Ql b 11247674Scaeldevice accesses the 11320742Smckusicksectors of the disk in strictly sequential order. 11447674ScaelThe 11547674Scael.Ql a 11647674Scaeldevice is the most efficient for disk-to-disk copying. 11720743SmckusickThis mapping is always used by the block device. 11847674Scael.Pp 11947674Scael.Tn I/O 12047674Scaelrequests must start on a sector boundary, involve an integral 12120742Smckusicknumber of complete sectors, and not go off the end of the disk. 12247674Scael.Sh NOTES 12320742SmckusickEven though the storage capacity on a floppy disk is quite 12420742Smckusicksmall, it is possible to make filesystems on 12520742Smckusickdouble density disks. 12620742SmckusickFor example, the command 12747674Scael.Bd -literal -offset indent 12820742Smckusick% mkfs /dev/rx0 1001 13 1 4096 512 32 0 4 12947674Scael.Ed 13047674Scael.Pp 13120742Smckusickmakes a file system on the double density disk in rx0 with 13220742Smckusick436 kbytes available for file storage. 13347674ScaelUsing 13447674Scael.Xr tar 1 13547674Scaelgives a more efficient utilization of the available 13620742Smckusickspace for file storage. 13720742SmckusickSingle density diskettes do not provide sufficient storage capacity to 13820742Smckusickhold file systems. 13947674Scael.Pp 14047674ScaelA number of 14147674Scael.Xr ioctl 2 14247674Scaelcalls apply to the rx devices, and 14320742Smckusickhave the form 14447674Scael.Bd -literal -offset indent 14520742Smckusick#include <vaxuba/rxreg.h> 14620742Smckusickioctl(fildes, code, arg) 14720742Smckusickint *arg; 14847674Scael.Ed 14947674Scael.Pp 15020742SmckusickThe applicable codes are: 15147674Scael.Bl -tag -width RXIOC_GETDENS 15247674Scael.It Dv RXIOC_FORMAT 15320742SmckusickFormat the diskette. The density to use is specified 15420742Smckusickby the 15547674Scael.Ar arg 15620743Smckusickargument, zero gives single density while non-zero 15720742Smckusickgives double density. 15847674Scael.It Dv RXIOC_GETDENS 15920743SmckusickReturn the density of the diskette (zero or non-zero as above). 16047674Scael.It Dv RXIOC_WDDMK 16147674ScaelOn the next write, include a 16247674Scael.Em deleted data address mark 16347674Scaelin 16420742Smckusickthe header of the first sector. 16547674Scael.It Dv RXIOC_RDDMK 16620742SmckusickReturn non-zero if the last sector read contained a 16747674Scael.Em deleted data address mark 16847674Scaelin its header, otherwise 16920742Smckusickreturn 0. 17047674Scael.El 17147674Scael.Sh FILES 17247674Scael.Bl -tag -width /dev/rx?xx -compact 17347674Scael.It Pa /dev/rx? 17447674Scael.It Pa /dev/rrx?[a-d] 17547674Scael.El 17647674Scael.Sh DIAGNOSTICS 17747674Scael.Bl -diag 17847674Scael.It "rx%d: hard error, trk %d psec %d cs=%b, db=%b, err=%x, %x, %x, %x." 17947674ScaelAn unrecoverable error was encountered. The 18047674Scaeltrack and physical sector numbers, the device registers and the 18147674Scaelextended error status are displayed. 18247674Scael.Pp 18347674Scael.It rx%d: state %d (reset). 18447674ScaelThe driver entered a bogus state. This should not happen. 18547674Scael.El 18647674Scael.Sh ERRORS 18720743SmckusickThe following errors may be returned by the driver: 18847674Scael.Bl -tag -width [ENODEV] 18947674Scael.It Bq Er ENODEV 19020742SmckusickDrive not ready; usually because no disk is in the drive or 19120742Smckusickthe drive door is open. 19247674Scael.It Bq Er ENXIO 19320742SmckusickNonexistent drive (on open); 19420742Smckusickoffset is too large or not on a sector boundary or 19520742Smckusickbyte count is not a multiple of the sector size (on read or write); 19620742Smckusickor bad (undefined) ioctl code. 19747674Scael.It Bq Er EIO 19820742SmckusickA physical error other than ``not ready'', probably bad media or 19920742Smckusickunknown format. 20047674Scael.It Bq Er EBUSY 20120742SmckusickDrive has been opened for exclusive access. 20247674Scael.It Bq Er EBADF 20320742SmckusickNo write access (on format), or wrong density; the latter 20420743Smckusickcan only happen if the disk is changed without 20547674Scael.Em closing 20620743Smckusickthe device 20747674Scael(i.e., calling 20847674Scael.Xr close 2 ) . 20947674Scael.El 21047674Scael.Sh SEE ALSO 21147674Scael.Xr rxformat 8 , 21247674Scael.Xr newfs 8 , 21347674Scael.Xr mkfs 8 , 21447674Scael.Xr tar 1 , 21547674Scael.Xr arff 8 21647674Scael.Sh HISTORY 21747674ScaelThe 21847674Scael.Nm 21947674Scaeldriver appeared in 22047674Scael.Bx 4.2 . 22147674Scael.Sh BUGS 22220742SmckusickA floppy may not be formatted if the 22320742Smckusickheader info on sector 1, track 0 has been damaged. Hence, it is not 22420742Smckusickpossible to format completely degaussed disks or disks with other 22520742Smckusickformats than the two known by the hardware. 22647674Scael.Pp 22720742SmckusickIf the drive subsystem is powered down when the machine is booted, the 22820742Smckusickcontroller won't interrupt. 229