V8/usr/man/man4/ra.4

Compare this file to the similar file:
Show the results in this format:

.TH RA 4 
.SH NAME
ra \- DEC MSCP disks (RA60, RA80, RA81)
.SH DESCRIPTION
.IR Ra \(**
refer to disk drives conforming to
DEC's Mass Storage Control Protocol standard:
drives such as the RA81
connected via controllers such as the UDA50.
Files with minor device numbers 0 through 7
refer to various portions of drive 0,
minor devices 8 through 16 refer to drive 1,
and so on up to 63.
These files have a blocksize
of 1K bytes;
if 64 is added to the minor device number,
the resulting file has 4K byte blocks,
and if used as a filesystem,
a slightly different structure.
.PP
The range and size of the pseudo-drives for each drive
are as follows.
Sizes are measured in hardware sectors (512 bytes).
.PP
.nf
.ta .5i +\w'000000    'u +\w'000000    'u
	disk	start	length
	0	0	10240
	1	10240	20480
	2	30720	249848
	3	280568	249848
	4	530416	249848
	5	780264	110808
	6	30720	749544
	7	0	arbitrarily large
.DT
.fi
.PP
Partition 7
covers the entire disk:
891072 sectors on an RA81.
.PP
The
.I ra
files
discussed above access the disk via the system's normal
buffering mechanism
and may be read and written without regard to
physical disk records.
There is also a `raw' interface
which provides for direct transmission between the disk
and the user's read or write buffer.
A single read or write call results in exactly one I/O operation
and therefore raw I/O is considerably more efficient when
many words are transmitted.
The names of the raw RA files
begin with
.I rra
and end with a number which selects the same disk
as the corresponding
.I ra
file.
.PP
In raw I/O the buffer must begin on a word boundary,
and counts should be a multiple of 512 bytes
(a disk block).
Likewise
.IR lseek (2)
calls should specify a multiple of 512 bytes.
.PP
Several
.IR ioctl (2)
calls
apply to the raw devices.
They are probably useful
only for bad block handling.
.TP 1i
UIOCHAR
The third argument to
.I ioctl
is a pointer to a
.IR "struct ud_unit" :
.nf
.ta .5i 2i
struct ud_unit {
	daddr_t radsize;	/* size of the disk */
	daddr_t rctsize;	/* size of the RCT, including pad */
	long medium;
	short tracksz;
	short groupsz;
	short cylsz;
	char rbns;
	char copies;
};
.fi
.DT
which the system fills with
geometry parameters for the drive.
.TP
UIORRCT
The third argument points to a
.IR "struct ud_rctbuf" :
.nf
struct ud_rctbuf {
	caddr_t	buf;
	int	lbn;
};
.fi
.IP
.I Buf
points to a 512-byte buffer,
into which block
.I lbn
of the replacement and caching table
(RCT)
is read.
As many copies of the RCT
as necessary
are examined to find a readable copy
of the block.
.TP
UIOWRCT
The third argument points to a
.IR "struct ud_rctbuf" ;
block
.I lbn
of the RCT is written
in all copies.
.TP
UIOREPL
The third argument points to a
.I "struct ud_repl" :
.nf
.ta .5i 2i
struct ud_repl {
	daddr_t replbn;	/* good block */
	daddr_t lbn;	/* bad block */
	short prim;	/* nonzero if primary replacement */
};
.fi
.IP
A REPLACE command
is sent to the controller,
requesting that attempts to access logical block
.I lbn
henceforth be revectored to replacement block
.IR replbn .
.I Prim
should be set nonzero
if and only if
.I replbn
is the primary replacement block for
.IR lbn .
.SH FILES
/dev/ra*, /dev/rra*
.SH SEE ALSO
rarepl(8)
.br
MSCP Basic Disk Functions Manual
.br
DEC Standard Disk Format Specification
.SH BUGS
In raw I/O
.I read
and
.IR write (2)
truncate file offsets to 512-byte block boundaries,
and
.I write
scribbles on the tail of incomplete blocks.
Thus,
in programs that are likely to access raw devices,
.I read, write
and
.IR lseek (2)
should always deal in 512-byte multiples.
.PP
UIORRCT
and
UIOWRCT
will misbehave if invoked on a partition
that doesn't start
at the beginning of the disk.
Partition 7
(the whole disk)
is the best choice.
.PP
This driver should be split into a generic
disk driver
and a port driver,
which communicate by exchanging MSCP packets.