dsk(7) DG/UX 5.4.2 dsk(7)
NAME
dsk - block special disk interface
DESCRIPTION
This block special device provides direct access to a logical or
physical disk. With respect to the I/O system calls, the disk may be
considered to be the same as an ordinary disk file of size N*512
bytes, when N is the number of blocks in the disk. The size is,
however, only an attribute of the device; the file system considers
all block-special devices to have size zero.
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.
User visible functionality for the close system call is the same as
for an ordinary disk file.
The read system call may read any portion of the disk on any byte
boundary for any number of bytes, without regard for disk block
boundaries. The file pointer associated with the descriptor used in
the read system call is used to determine the location of the data to
be read; hence the lseek system call works the same as for an
ordinary disk file. Reading data that has "never been written"
returns whatever happens to be there, in contrast to an ordinary disk
file which returns zeros. 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 works in the same way as read, without regard
for block boundaries. Note that as for an ordinary disk file, the
physical I/O to the physical disk is not guaranteed to have been
completed when the write system call completes unless the OSYNC flag
has been set on the file descriptor. 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;
};
The total_sectors field is the number of 512 byte blocks available on
the disk. The blocks have addresses 0 through "total_sectors" - 1.
Licensed material--property of copyright holder(s) 1
dsk(7) DG/UX 5.4.2 dsk(7)
This value does not include blocks that are normally inaccessible
because they are used for controller remapping, for diagnostic
tracks, or for controller firmware. Some of the blocks may not be
usable 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/dsk/* Logical disk device names for block special
access
/dev/pdsk/* Physical disk device names for block special
access
/usr/include/sys/ioctl.h Ioctl definitions
SEE ALSO
cied(7), cimd(7), cird(7) ,sd(7), intro(7).
Licensed material--property of copyright holder(s) 2