Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cied(7)

cimd(7)

cird(7)

,sd(7)

da(7)

nvrd(7)

vdm*(7)

intro(7)



dsk(7)                         DG/UX R4.11MU05                        dsk(7)


NAME
       dsk - block special disk interface

DESCRIPTION
       This block special device provides direct access to a virtual 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 zero as the number of bytes read to indicate that
       a read past EOF has been attempted.

       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 O_SYNC 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 DSKIOCGET ioctl command returns information about the
       characteristics of a disk.  The command and structure for this ioctl
       are 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   total_sectors;
               unsigned short  bytes_per_sector;
               unsigned short  controller_id;
               };

       The total_sectors field is the number of 512 byte blocks available on
       the disk.   The blocks have addresses 0 through "total_sectors" - 1.
       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.

       The DSKIOCUSAGE ioctl command returns usage information about the
       disk. The command and structure for this ioctl are defined in
       <sys/ioctl.h>.

       A pointer to the structure dskusage is the parameter that is passed
       on the system call.

       struct dskusage
            {
            unsigned long  read_block_count;
            unsigned long  write_block_count;
            unsigned long  read_request_count;
            unsigned long  write_request_count;
            struct timeval busy_time;
            struct timeval response_time;
            };

       The read_block_count field is the number of 512-byte blocks that have
       been read from the disk unit.  The write_block_count is the number of
       512-byte blocks that have been written to the disk unit. The
       read_request_count is the total number of read requests that have
       been handled.  The write_request_count is the total number of write
       requests that have been handled.  The busy_time file is the total
       amount of time since system boot time that the disk unit has been
       busy working on requests.  The response_time field is the total
       amount of time since system boot time that requests to the unit have
       spent waiting to be completed.  This includes time spent on various
       queues.

       Select always returns READY for both read and write operations.

FILES
       /dev/dsk/*               Virtual 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), da(7), nvrd(7), vdm*(7), intro(7).


Licensed material--property of copyright holder(s)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026