rdsk(7) DG/UX 5.4.2 rdsk(7)
NAME
rdsk - character special disk interface
DESCRIPTION
This character special device provides direct access to a logical or
physical disk in a slightly different manner from dsk(7). In this
case, the disk should be considered to be an array of 512-byte disk
blocks numbered from 0 to N-1, where N is the number of blocks in the
disk.
The rdsk device is typically implemented so that requests for large
amounts of data (say, an entire track of the disk) can be serviced
with far fewer explicit requests to the physical disk than can the
dsk device. Efficiency improves because of restrictions in the way
rdsk may be used, as described below.
The open system call performs device-specific operations to
initialize the disk. Except for errors that may be reported because
of controller or unit failures, user-visible functionality is the
same as for an ordinary disk file.
For the close system call, user-visible functionality is the same as
for an ordinary disk file.
The read system call must begin and end on a 512-byte boundary; i.e.,
the starting address and the length of the read must be multiples of
512. Reads on other boundaries and of other sizes will return the
error EINVAL. Reading data that has "never been written" returns
whatever happens to be there, in contrast to an ordinary disk file
which returns zero. A read request that extends past the end of the
disk returns the error ENXIO and an implementation-specific amount of
data.
The write system call must begin and end on a 512-byte boundary;
i.e., the starting address and the length of the write must be
multiples of 512. Write on other boundaries and of other sizes will
return the error EINVAL. Also, the data is guaranteed to have been
physically written to the disk upon completion of the write system
call. A write request that extends past the end of the disk returns
the error ENXIO and writes an implementation-specific amount of data.
The only disk specific ioctl is DSKIOCGET, which returns information
about the characteristics of a disk. The command and structure for
this ioctl is defined in <sys/ioctl.h>.
A pointer to the structure dskget is the parameter that is passed on
the system call.
struct dskget
{
unsigned long totalsectors;
unsigned short bytespersector;
unsigned short controllerid;
};
Licensed material--property of copyright holder(s) 1
rdsk(7) DG/UX 5.4.2 rdsk(7)
The total_sectors field is the number of sectors available on the
disk. The sectors have addresses 0 through "total_sectors" - 1.
This value does not include sectors that are normally inaccessible
because they are used for controller remapping, for diagnostic
tracks, or for controller firmware. Some of the sector blocks may be
not be useable because of media flaws. The bytes_per_sector field
indicates the size, in bytes, of each sector. The controller_id
field is a controller unique identifier reported by the disk
controller. A returned value of 0 indicates that the controller
does not report an id.
Select always returns READY for both read and write operations.
FILES
/dev/rdsk/* Logical disk device names for character
special access
/dev/rpdsk/* Physical disk device names for character
special access
/usr/include/sys/ioctl.h Ioctl definitions
SEE ALSO
cied(7), cimd(7), cird(7), sd(7), da(7), intro(7).
Licensed material--property of copyright holder(s) 2