![]() |
![]() HP OpenVMS Systems Documentation |
![]() | OpenVMS I/O User's Reference Manual
2.4.3 Sense ModeSense mode operations obtain current disk device-dependentcharacteristics that are returned to the caller in the second longwordof the I/O status block (see Figure 2-8). The operating systemprovides the following function codes:
IO$_SENSEMODE is a logical function. IO$_SENSECHAR is a physical I/Ofunction and requires the access privilege necessary to performphysical I/O. No device- or function-dependent arguments are used witheither function. The set density function assigns a new density to an entire RX02 floppydiskette. The diskette is also reformatted: new data address marks arewritten (single or double density) and all data fields are zeroed. Setdensity is a physical I/O function and requires the access privilegenecessary to perform physical I/O. The following function code isprovided: IO$_FORMAT IO$_FORMAT takes the following function-dependent argument: P1---The density at which the diskette is reformatted:0 = single density (default) The set density operation should not be interrupted before it iscompleted (about 15 seconds). If the operation is interrupted, theresulting diskette might contain illegal data address marks in bothdensities. The diskette must then be completely reformatted and thefunction reissued. The search function positions a TU58 magnetic tape to the blockspecified. Search is a physical I/O function and requires the accessprivilege necessary to perform physical I/O. The operating systemprovides a single function code: IO$_SEARCH This function code takes the following function-dependent argument: P1---Specifies the block where the read/write head will be positioned. The low byte contains the sector number in the range 0 to 127; the high byte contains the track number in the range 0 to 3. IO$_SEARCH can save time between read and write operations. Forexample, nearly 30 seconds are required to completely rewind a tape. Ifthe last read or write operation is near the end of the tape and thenext operation is near the beginning of the tape, the search operationcan begin after the last operation completes, and the tape will rewindwhile the process is otherwise occupied. (The search QIO is notcompleted until the search is completed. Consequently, if a $QIOWsystem service request is issued, the process will be held up until thesearch is completed.) The pack acknowledge function sets the volume valid bit for all diskdevices. Pack acknowledge is a physical I/O function and requires theaccess privilege to perform physical I/O. If directed to an RX02 disk,pack acknowledge also determines the diskette density and updates thedevice-dependent information returned by $GETDVI item codesDVI$_CYLINDERS, DVI$_TRACKS, DVI$_SECTORS, DVI$_DEVTYPE, DVI$_CLASS,and DVI$_MAXBLOCK. If directed to a DSA disk, pack acknowledge alsosends the online packet to the controller. The following function codeis provided: IO$_PACKACK This function code takes no function-dependent arguments. IO$_PACKACK must be the first function issued when a volume (pack,cartridge, or diskette) is placed in a disk drive. IO$_PACKACK isissued automatically when the DCL commands INITIALIZE or MOUNT areissued. For DSA disks, the IO$_PACKACK function locks the drive's port selectoron the port that initiated the pack acknowledge function. In addition, the IO$_PACKACK function updates device-dependentinformation about DSA disks returned by $GETDVI. The unload function clears the volume valid bit for all disk drives,makes DSA disks available, and issues an unload command to the drive(spins down the volume). The unload function reverses the functionperformed by pack acknowledge (see Section 2.4.6). The followingfunction code is provided: IO$_UNLOAD This function takes no function-dependent arguments. The available function clears the volume valid bit for all disk drives;that is, it reverses the function performed by pack acknowledge (seeSection 2.4.6). No unload function is issued to the drive. Therefore,those drives capable of spinning down do not spin down. The followingfunction code is provided: IO$_AVAILABLE This function takes no function-dependent arguments. The seek function directs the read/write heads to move to the cylinderspecified in the P1 argument (see Sections 2.2.8 and2.4, and Figure 2-6). The write check function verifies that data was written to diskcorrectly. The data to be checked is addressed using physical diskaddressing (sector, track, and cylinder) (see Figure 2-5). If therequest is directed to a DSA disk, you must specify a logical blocknumber, even though IO$_WRITECHECK is a physical I/O function. Thefollowing function code is provided: IO$_WRITECHECK A write QIO must be used to write data to disk before you enter thiscommand. IO$_WRITECHECK then reads the same block of data and comparesit with the data in the specified buffer. Three function-dependentarguments are used with this code: P1, P2, and P3. These arguments aredescribed in Section 2.4. IO$_WRITECHECK is similar to the IO$M_DATACHECK function modifier forwrite QIOs, except that IO$_WRITECHECK does not write the data to disk;it is specified after data is written by a separate write QIO.Nonprivileged processes can use the IO$M_DATACHECK modifier withIO$_WRITEVBLK (which does not require access privilege) to determinewhether data is written correctly. The RX01 and RX02 drivers do notsupport the write check function. The write check function and the data check function modifier to a TU58canreturn six error codes in the I/O status block: SS$_NORMAL,SS$_CTRLERR, SS$_DRVERR, SS$_MEDOFL, SS$_NONEXDRV, and SS$_WRTLCK. The set preferred path function specifies a preferred path for DSAdisks. This includes RA-series disks and disks accessed through theMSCP server. If a preferred path is specified for a disk, the MSCP diskclass drivers (DUDRIVER and DSDRIVER) use the path as their firstattempt to locate the disk and bring it on line as a result of a DCLcommand MOUNT or failover of an already mounted disk. In addition, youcan initiate failover of a mounted disk in order to force the disk tothe preferred path, or to use load-balancing information for disksaccessed through MSCP servers. The function code is: IO$_SETPRFPATH The following is the function modifier: IO$M_FORCEPATH---Causes the disk class driver to select the server path with the highest load available rating. The P1 parameter contains the address of a counted ASCII string(.ASCIC). This string is the node name of the HSC or system that is thepreferred path. The node name must match an existing node that is knownto the local node and if the node is a VAX or Alpha system, it must berunning the MSCP server. This function does not move the disk to thepreferred path. The PHYS_IO privilege is required for IO$_SETPRFPATH and IO$M_FORCEPATH. The following example shows the use of IO$_SETPRFPATH:
This updates the local node I/O database to indicate that node HSC001is the preferred path for DUA48. You can move a disk that is already mounted to its preferred path byspecifying the IO$M_FORCEPATH modifier. If a preferred path has notbeen specified for a disk that is accessed through the MSCP server, theIO$M_FORCEPATH function causes the disk class driver to useload-balancing information to select the server path with thehighest-load-available rating. IO$M_FORCEPATH does not accept any arguments. If you intend to move adisk to its preferred path, you must specify the preferred path in aseparate $QIO function. The following example shows use of the IO$M_FORCEPATH function modifier:
Note that forcing a path change places the disk in mount verification.New I/O requests are suspended until mount verification is complete. You can use the IO$_SETPRFPATH and IO$M_FORCEPATH functions to loadbalance disks that are dual-pathed between HSCs. The IO$M_FORCEPATHfunction initiates failover of the disk on all nodes that have itmounted and that have a direct path to the HSCs. Since the node thatissues the IO$M_FORCEPATH might not be the first one to attemptfailover of the disk, it is essential that all nodes with directconnections to the HSCs specify the same preferred path for the disk.Only one node should issue the IO$M_FORCEPATH request. You can use IO$M_FORCEPATH to load balance RA-series disks that aredual-pathed between systems running the MSCP server. Both serving nodesshould specify the same preferred path. In order to move the diskbetween systems, the system that currently has the disk on line throughits local controller should issue the IO$M_FORCEPATH request. The diskmust be mounted on both serving nodes. You can specify a preferred path for disks that are accessed throughMSCP servers. However, this specification overrides any load-balancingdecisions. Note that if a disk can be accessed through both HSC and MSCP servers,you need not specify the HSC as a preferred path. HSC paths are alwayspreferred to server paths. Using IO$M_FORCEPATH without a preferred path causes the disk classdriver to move the disk to the server with the highest availablecapacity. You can specify IO$_SETPRFPATH for shadow set members, but not forvirtual units. IO$M_FORCEPATH is not supported for shadow set membersor virtual units. IO$_SETPRFPATH and IO$M_FORCEPATH are supported for shadow set membersbut not for virtual units. Figure 2-7 shows the I/O status block (IOSB) for all disk device QIOfunctions except sense mode. Figure 2-8 shows the I/O status blockfor the sense mode function. Appendix A lists the status messagesfor all functions and devices. (The OpenVMS system messagesdocumentation provides explanations and suggested user actions forthese messages.) Figure 2-7 IOSB Contents ![]() The byte count is a 32-bit integer that gives the actual number ofbytes transferred to or from the process buffer. Figure 2-8 IOSB Contents for the Sense Mode Function ![]() The second longword of the I/O status block for the sense mode functionreturns information about the cylinder, track, and sectorconfigurations for the particular device. A sample VAX MACRO disk driver program, DISK_DRIVER.MAR, is shown inExample 2-1. This sample program provides an example of optimizingaccess time to a disk file. The program creates a file using RecordManagement Services (RMS), stores information concerning the file, andcloses the file. The program then accesses the file and reads andwrites to the file using the Queue I/O ($QIO) system service.
|