Document revision date: 30 March 2001
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]
OpenVMS I/O User's Reference Manual

OpenVMS I/O User's Reference Manual

Order Number: AA--PV6SD--TK


April 2001

This manual contains the information necessary to interface directly with the I/O device drivers supplied as part of the Compaq OpenVMS operating system. Several examples of programming techniques are included. This document does not contain information on I/O operations using the OpenVMS Record Management Services.

Revision/Update Information: This manual supersedes the OpenVMS I/O User's Reference Manual, OpenVMS Alpha Version 7.2, OpenVMS VAX Version 7.2

Software Version: OpenVMS Alpha Version 7.3 OpenVMS VAX Version 7.3




Compaq Computer Corporation
Houston, Texas


© 2001 Compaq Computer Corporation

Compaq, VAX, VMS, and the Compaq logo Registered in U.S. Patent and Trademark Office.

OpenVMS and Tru64 are trademarks of Compaq Information Technologies Group, L.P in the United States and other countries.

Microsoft, MS-DOS, Visual C++, Windows, and Windows NT are trademarks of Microsoft Corporation in the United States and other countries.

Intel, Intel Inside, and Pentium are trademarks of Intel Corporation in the United States and other countries.

Motif, OSF/1, and UNIX are trademarks of The Open Group in the United States and other countries.

All other product names mentioned herein may be trademarks of their respective companies.

Confidential computer software. Valid license from Compaq required for possession, use, or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license.

Compaq shall not be liable for technical or editorial errors or omissions contained herein. The information in this document is provided "as is" without warranty of any kind and is subject to change without notice. The warranties for Compaq products are set forth in the express limited warranty statements accompanying such products. Nothing herein should be construed as constituting an additional warranty.

ZK6136

The Compaq OpenVMS documentation set is available on CD-ROM.

Contents Index


Preface

Intended Audience

This manual is intended for system programmers who want to take advantage of the time and space savings that result from direct use of I/O drivers. OpenVMS users who do not require such detailed knowledge of I/O drivers can use the device-independent services described in the OpenVMS Record Management Services Reference Manual.

Document Structure

This manual is organized into the following chapters and appendixes:

Device Driver Support for OpenVMS Alpha 64-Bit Addressing

The OpenVMS Alpha operating system provides support for 64-bit virtual memory addressing, which makes the 64-bit virtual address space defined by the Alpha architecture available to the OpenVMS Alpha operating system and to application programs. In the 64-bit virtual address space, both process-private and system virtual address space extend beyond 2 GB. By using 64-bit addressing features, programmers can create images that map and access data beyond the limits of 32-bit virtual addresses.

Input and output operations can be performed directly to and from the 64-bit addressable space by means of RMS services, the $QIO system service, and most of the device drivers supplied with OpenVMS Alpha systems. A device driver declares support for 64-bit addresses individually by I/O function code. Disk and tape device drivers support 64-bit addresses for data transfers to and from disk and tape devices on the virtual, logical, and physical read and write functions. For example, the OpenVMS SCSI disk class driver, SYS$DKDRIVER, supports 64-bit addresses on the IO$_READVBLK and IO$_WRITEVBLK functions, but not on the IO$_AUDIO function. The device drivers, function codes, and $QIO arguments that support 64-bit addressing are indicated in the appropriate chapters of this manual.

For more information about the OpenVMS Alpha device drivers that support 64-bit addressing, refer to the OpenVMS Programming Concepts Manual. To find out how to modify a customer-written device driver to support 64-bit addressing, see the OpenVMS Alpha Guide to Upgrading Privileged-Code Applications.

Related Documents

The following manuals provide additional information that relates to the topics covered in this book:

Important Note

For updated hardware information, refer to the most recent Software Product Description for the OpenVMS Operating System for Alpha and VAX.

For additional information about the Compaq OpenVMS products and services, access the Compaq website at the following location:


http://www.openvms.compaq.com/ 

Reader's Comments

Compaq welcomes your comments on this manual. Please send comments to either of the following addresses:
Internet openvmsdoc@compaq.com
Mail Compaq Computer Corporation
OSSG Documentation Group, ZKO3-4/U08
110 Spit Brook Rd.
Nashua, NH 03062-2698

How To Order Additional Documentation

Visit the following World Wide Web address for information about how to order additional documentation:


http://www.openvms.compaq.com/ 

If you need help deciding which documentation best meets your needs, call 800-282-6672.

Conventions

VMScluster systems are now referred to as OpenVMS Cluster systems. Unless otherwise specified, references to OpenVMS Clusters or clusters in this document are synonymous with VMSclusters.

In this manual, every use of DECwindows and DECwindows Motif refers to DECwindows Motif for OpenVMS software.

The following conventions are also used in this manual:
Ctrl/ x A sequence such as Ctrl/ x indicates that you must hold down the key labeled Ctrl while you press another key or a pointing device button.
PF1 x A sequence such as PF1 x indicates that you must first press and release the key labeled PF1 and then press and release another key or a pointing device button.
[Return] In examples, a key name enclosed in a box indicates that you press a key on the keyboard. (In text, a key name is not enclosed in a box.)

In the HTML version of this document, this convention appears as brackets, rather than a box.

... A horizontal ellipsis in examples indicate one of the following possibilities:
  • Additional optional arguments in a statement have been omitted.
  • The preceding item or items can be repeated one or more times.
  • Additional parameters, values, or other information can be entered.
.
.
.
A vertical ellipsis indicate the omission of items from a code example or command format; the items are omitted because they are not important to the topic being discussed.
( ) In command format descriptions, parentheses indicate that you must enclose the options in parentheses if you choose more than one.
[ ] In command format descriptions, brackets indicate optional elements. You can choose one, none, or all of the options. (Brackets are not optional, however, in the syntax of a directory name in an OpenVMS file specification or in the syntax of a substring specification in an assignment statement.)
[|] In command format descriptions, vertical bars separating items inside brackets indicate that you choose one, none, or more than one of the options.
{ } In command format descriptions, braces indicate required elements; you must choose one of the options listed.
bold text This text style represents the introduction of a new term or the name of an argument, an attribute, or a reason.
italic text Italic text indicates important information, complete titles of manuals, or variables. Variables include information that varies in system output (Internal error number), in command lines (/PRODUCER= name), and in command parameters in text (where dd represents the predefined code for the device type).
UPPERCASE TEXT Uppercase text indicates a command, the name of a routine, the name of a file, or the abbreviation for a system privilege.
Monospace text Monospace type indicates code examples and interactive screen displays.

In the C programming language, monospace type in text identifies the following elements: keywords, the names of independently compiled external functions and files, syntax summaries, and references to variables or identifiers introduced in an example.

- A hyphen at the end of a command format description, command line, or code line indicates that the command or statement continues on the following line.
numbers All numbers in text are assumed to be decimal unless otherwise noted. Nondecimal radixes---binary, octal, or hexadecimal---are explicitly indicated.


Chapter 1
ACP--QIO Interface

An ancillary control process (ACP) is a process that interfaces between the user process and the driver, and performs functions that supplement the driver's functions. Virtual I/O operations involving file-structured devices (disks and magnetic tapes) often require ACP intervention. In most cases, ACP intervention is requested by OpenVMS Record Management Services (RMS) and is transparent to the user process. However, user processes can request ACP functions directly by issuing a Queue I/O (QIO) request and specifying an ACP function code, as shown in Figure 1-1.

Executing physical and logical input/output (I/O) operations on a device that is managed by a file ACP interferes with the operation of the ACP, and can result in such unpredictable consequences as system failure.

In addition to the ACP, the XQP (extended QIO processor) facility supplements the QIO driver's functions when performing virtual I/O operations on file-structured devices. However, rather than being a separate process, the XQP executes as a kernel-mode thread in the process of its caller.

An XQP is provided to support Files-11 ODS-2 (On-Disk Structure Level 2) disks as the base file system, and an ACP is provided for ANSI standard X3.27 magnetic tapes.

On VAX systems, an ACP is provided for supporting Files-11 ODS-1 (On-Disk Structure Level 1) disks.

There are also ACPs to support the ISO 9660 CD-ROM disk structure (Files-11 C) and High Sierra CD-ROM disk structure (Files-11 D). Collectively, these ACPs are called Files-11 C/D.

Note

On Alpha systems using OpenVMS Version 7.2, there is support for ODS-5 (On-Disk Structure Level 5) disks. For more information about ODS-5 support, refer to the OpenVMS Guide to Extended File Specifications.

This chapter describes the QIO interface to ACPs for disk and magnetic tape devices (file system ACPs). The sample program in Chapter 3 performs QIO operations to the magnetic tape ACP.

Figure 1-1 ACP--QIO Interface


This section also describes a number of structures and field names of the form xxx$name. A MACRO program can define symbols of this form by invoking the $xxxDEF macro.

The following macros are available in SYS$LIBRARY:STARLET.MLB:

$IODEF
$FIBDEF
$ATRDEF
$SBKDEF

The following macros are available in SYS$LIBRARY:LIB.MLB:

$FATDEF
$DQFDEF
$FCHDEF

Programs written in BLISS-32 can use these symbols by referencing them and including the correct library, SYS$LIBRARY:STARLET.L32 (for the macros listed under SYS$LIBRARY:STARLET.MLB), and SYS$LIBRARY:LIB.L32 (for the macros listed under SYS$LIBRARY:LIB.MLB).

References to ANSI refer to the American National Standard Magnetic Tape Labels and File Structures for Information Interchange, ANSI X3.27--1978.

1.1 ACP Functions and Encoding

ACP functions can be expressed using seven function codes and four function modifiers. The function codes are:

The function modifiers are:

In addition to the function codes and modifiers, ACPs take five device- or function-dependent arguments, as shown in Figure 1-2. The first argument, P1, is the address of the file information block (FIB) descriptor. Section 1.2 describes the FIB in detail.

The second argument, P2, is an optional argument used in directory operations. It specifies the address of the descriptor for the file name string to be entered in the directory.

Argument P3 is the address of a word to receive the resultant file name string length. The resultant string is not padded. The actual length is returned in P3. Argument P4 is the address of a descriptor for a buffer to receive the resultant file name string. Both of these arguments are optional.

Figure 1-2 ACP Device- or Function-Dependent Arguments


The fifth argument, P5, is an optional argument containing the address of the attribute control block. Section 1.3.5 describes the attribute control block in detail.

All areas of memory specified by the descriptors must be capable of being read or written to.

Figure 1-3 shows the format for the descriptors. The count field is the length in bytes of the item described.

Figure 1-3 ACP Device/Function Argument Descriptor Format


1.2 File Information Block (FIB)

The file information block (FIB) contains much of the information that is exchanged between the user process and the ACP. Figure 1-4 shows the format of the FIB. The FIB must be writable. Because the FIB is passed by a descriptor (see Figure 1-3), its length can vary. Thus, a short FIB can be used in ACP calls that do not need arguments near the end of the FIB. The ACP treats the omitted portion of the FIB as if it were 0. Figure 1-5 shows the format of a typical short FIB that would be used to open an existing file. Table 1-1 gives a brief description of each of the FIB fields. More detailed descriptions are provided in Sections 1.3 and 1.6.

Figure 1-4 FIB Format


Figure 1-5 Typical Short FIB


Table 1-1 Contents of the FIB
Field Subfields Meaning
FIB$L_ACCTL   Contains flag bits that control the access to the file. Sections 1.3.1.1, 1.3.2.1, 1.6.1.1, 1.6.4.1, and 1.6.5 describe the FIB$L_ACCTL field flag bits.
FIB$B_WSIZE   Controls the size of the file window used to map a disk file. If a window size of 255 is specified, the file is completely mapped by using segmented windows.
FIB$W_FID   Specifies the file identification. You supply the file identifier when it is known; the ACP returns the file identifier when it becomes known; for example, as a result of a create or directory lookup. A 0 file identifier can be specified when an operation is performed on a file that is already open on a particular channel. The ACP returns the file identifier of the open file.

For Files-11 On-Disk Structure Level 1 and Level 2, the following subfields are defined:

  FIB$W_FID_NUM File number.
  FIB$W_FID_SEQ File sequence number.
  FIB$W_FID_RVN Relative volume number (only for magnetic tape devices).
  FIB$B_FID_RVN Relative volume number (only for disk devices).
  FIB$B_FID_NMX File number extension (only for disk devices).
FIB$W_DID   Contains the file identifier of the directory file.

For Files-11 On-Disk Structure Level 1 and Level 2, the following subfields are defined:

  FIB$W_DID_NUM File number.
  FIB$W_DID_SEQ File sequence number.
  FIB$W_DID_RVN Relative volume number (only for magnetic tape devices).
  FIB$B_DID_RVN Relative volume number (only for disk devices).
  FIB$B_DID_NMX File number extension (only for disk devices).
FIB$L_WCC   Maintains position context when processing wildcard directory operations.
FIB$W_NMCTL   Contains flag bits that control the processing of a name string in a directory operation. Sections 1.3.1.1 and 1.6.1.1 describe the FIB$W_NMCTL field flag bits.
FIB$W_EXCTL   Contains flag bits that specify extend control for disk devices. Sections 1.3.3.1 and 1.3.4.1 describe the FIB$W_EXCTL field flag bits.
FIB$W_CNTRLFUNC   In an IO$_ACPCONTROL function, this field contains the code that specifies which ACP control function is to be performed (see Section 1.6.8). This field overlays FIB$W_EXCTL.
FIB$L_EXSZ   Specifies the number of blocks to be allocated in an extend operation on a disk file.
FIB$L_CNTRLVAL   Contains a control function value used in an IO$_ACPCONTROL function (see Section 1.6.8). The interpretation of the value depends on the control function specified in FIB$W_CNTRLFUNC. This field overlays FIB$L_EXSZ.
FIB$L_EXVBN   Specifies the starting disk file virtual block number at which a file is to be truncated.
FIB$B_ALOPTS   Contains option bits that control the placement of allocated blocks. Section 1.3.3.1 describes the FIB$B_ALOPTS field flag bits.
FIB$B_ALALIGN   Contains the interpretation mode of the allocation (FIB$W_ALLOC) field.
FIB$W_ALLOC   Contains the desired physical location of the blocks being allocated. Interpretation of the field is controlled by the FIB$B_ALALIGN field. The following subfields are defined:
  FIB$W_LOC_FID Three-word related file ID for RFI placement.
  FIB$W_LOC_NUM Related file number.
  FIB$W_LOC_SEQ Related file sequence number.
  FIB$B_LOC_RVN Related file relative volume number (RVN) or placement RVN.
  FIB$B_LOC_NMX Related file number extension.
  FIB$L_LOC_ADDR Placement logical block number (LBN), cylinder, or virtual block number (VBN).
FIB$W_VERLIMIT   Contains the version limit of the directory entry.
FIB$L_ACLCTX   Maintains position context when processing ACL attributes from the attribute (P5) list.
FIB$L_ACL_STATUS   Status of the requested ACL attribute operation, if any. The ACL attributes are included in Table 1-7. If no ACL attributes are given, SS$_NORMAL is returned here.
FIB$L_STATUS   Access status. Applies to all major functions. The following bits are supported:
  FIB$V_ALT_REQ Set to indicate whether the alternate access bit is required for the current operation. If not set, the alternate access bit is optional.
  FIB$V_ALT_GRANTED If FIB$V_ALT_REQ = 0, the FIB bit returned from the file system is set if the alternate access check succeeded.
FIB$L_ALT_ACCESS   A 32-bit mask that represents an access mask to check against file protection; for example, opens a file for read access and checks whether it can be deleted. The mask has the same configuration as the standard protection mask.


Next Contents Index

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement  
6136PRO.HTML