Ovms 731 Io User
Ovms 731 Io User
Manual
Order Number: AAPV6SETK
June 2002
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:
Software Version:
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xix
1 ACPQIO Interface
1.1
1.2
1.3
1.3.1
1.3.1.1
1.3.1.2
1.3.1.3
1.3.2
1.3.2.1
1.3.2.2
1.3.3
1.3.3.1
1.3.3.2
1.3.4
1.3.4.1
1.3.4.2
1.3.5
1.3.5.1
1.3.5.2
1.4
1.5
1.6
1.6.1
1.6.1.1
1.6.1.2
1.6.1.3
1.6.1.4
1.6.2
1.6.2.1
1.6.2.2
1.6.3
1.6.3.1
1.6.3.2
1.6.4
1.6.4.1
1.6.4.2
1.6.5
1.6.5.1
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
12
13
16
17
17
18
19
110
110
111
111
111
113
113
113
113
114
114
119
121
122
124
125
125
126
127
127
127
128
128
129
129
129
129
130
130
130
131
iii
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
131
131
132
134
135
135
135
136
136
137
139
2.1
Supported Disk Devices and Controllers . . . . . . . . . . . . . . . . . .
2.1.1
UDA50 UNIBUS Disk Adapter . . . . . . . . . . . . . . . . . . . . . .
2.1.2
KDA50 Disk Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.3
KDB50 Disk Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.4
HSC40, HSC50, and HSC70 Controllers . . . . . . . . . . . . . . .
2.1.5
SII Integral Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.6
KFQSA Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.7
RQDX3 Disk Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.8
RA70 and RA90 Disk Drives . . . . . . . . . . . . . . . . . . . . . . . .
2.1.9
RA60 Disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.10
RA80/RB80/RM80 and RA81 Fixed-Media Disks . . . . . . . . .
2.1.11
RB02 and RL02 Cartridge Disk (VAX Only) . . . . . . . . . . . . .
2.1.12
RC25 Disk (VAX Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.13
RD53 and RD54 Disks (VAX Only) . . . . . . . . . . . . . . . . . . . .
2.1.14
RF30 and RF71 Disks . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.15
RK06 and RK07 Cartridge Disks (VAX Only) . . . . . . . . . . .
2.1.16
RM03 and RM05 Pack Disks (VAX Only) . . . . . . . . . . . . . . .
2.1.17
RP05 and RP06 Disk (VAX Only) . . . . . . . . . . . . . . . . . . . . .
2.1.18
RP07 Fixed-Media Disk (VAX Only) . . . . . . . . . . . . . . . . . . .
2.1.19
RRD40 and RRD50 Read-Only Memory (CD-ROM) . . . . . . .
2.1.20
RX01 Console Disk (VAX Only) . . . . . . . . . . . . . . . . . . . . . .
2.1.21
RX02 Disk (VAX Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.22
RX23 (VAX Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.23
RX33 (VAX Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.24
RX50 (VAX Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.25
RZ22, RZ23, and RZ55 Disks . . . . . . . . . . . . . . . . . . . . . . . .
2.1.26
TU58 Magnetic Tape (DECtape II) . . . . . . . . . . . . . . . . . . . .
2.2
Driver Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.1
Dual-Pathed Disks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.2
Dual Porting MASSBUS Disks . . . . . . . . . . . . . . . . . . . . . .
2.2.2.1
Port Selection and Access Modes . . . . . . . . . . . . . . . . . .
2.2.2.2
Disk Use and Restrictions . . . . . . . . . . . . . . . . . . . . . . .
2.2.2.3
Restriction on Dual-Ported Non-DSA Disks in a Cluster
2.2.3
Dual-Pathed DSA Disks . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.4
Dual-Porting HSC Disks . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.5
Dual-Pathed RF-Series Disks . . . . . . . . . . . . . . . . . . . . . . . .
2.2.6
Data Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.7
Effects of a Failure During an I/O Write Operation . . . . . . .
2.2.8
Overlapped Seeks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
21
21
22
22
22
23
23
23
23
23
24
24
24
24
25
25
25
25
25
25
26
26
27
27
27
27
27
28
28
29
29
210
210
211
211
211
212
213
213
1.6.6
1.6.6.1
1.6.6.2
1.6.6.3
1.6.7
1.6.8
1.6.8.1
1.6.8.2
1.6.8.3
1.6.8.4
1.7
I/O
Movefile Subfunction . . . . . . . . . . . . . . . .
Calling the Movefile Subfunction . . . .
Input Parameters . . . . . . . . . . . . . . . .
Operation . . . . . . . . . . . . . . . . . . . . . .
Mount . . . . . . . . . . . . . . . . . . . . . . . . . . .
ACP Control . . . . . . . . . . . . . . . . . . . . . . .
Input Parameters . . . . . . . . . . . . . . . .
Magnetic Tape Control Functions . . .
Miscellaneous Disk Control Functions
Disk Quotas . . . . . . . . . . . . . . . . . . . .
Status Block . . . . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2 Disk Drivers
iv
Error Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Skip Sectoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Logical-to-Physical Translation (RX01 and RX02) . . . . . . . . . . . . . .
DIGITAL Storage Architecture (DSA) Devices . . . . . . . . . . . . . . . . .
Bad Block Replacement and Forced Errors for DSA Disks . . . . .
VAXstation 2000 and MicroVAX 2000 Disk Driver . . . . . . . . . . . . . .
SCSI Disk Class Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Audio Extensions to the SCSI Disk Class Driver . . . . . . . . . . . . . . .
$QIO Interface to Audio Functionality of the SCSI Disk Class
Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.14.2
Defining an Audio Control Block (AUCB) . . . . . . . . . . . . . . . . .
2.2.14.3
Error Handling in Applications Using SCSI Audio Functions . .
2.2.14.4
Using CD-ROM to Store Both Data and Audio Information . . . .
2.2.14.5
Programming Audio Applications . . . . . . . . . . . . . . . . . . . . . . . .
2.2.14.6
Application Program Example Using SCSI Audio Capabilities
(VAX only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3
Disk Driver Device Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4
Disk Function Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.1
Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.2
Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.3
Sense Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.4
Set Density . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.5
Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.6
Pack Acknowledge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.7
Unload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.8
Available . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.9
Seek . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.10
Write Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.11
Set Preferred Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.11.1
Forcing a Path Change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.11.2
Using IO$_SETPRFPATH with Disks Dual-Pathed Between
HSCs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.11.3
Using IO$_SETPRFPATH with Disks Dual-Pathed Between
Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.11.4
Using IO$_SETPRFPATH with Disks Accessed Through MSCP
Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4.11.5
Using IO$_SETPRFPATH with Phase I Volume Shadowing . . .
2.4.11.6
Using IO$_SETPRFPATH with Phase II Volume Shadowing . . .
2.5
I/O Status Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.6
Disk Driver Programming Example . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.9
2.2.9.1
2.2.10
2.2.11
2.2.11.1
2.2.12
2.2.13
2.2.14
2.2.14.1
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
214
214
215
216
217
218
218
219
.
.
.
.
.
.
.
.
.
.
220
220
223
225
226
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
226
226
228
233
234
235
235
235
236
236
236
236
236
237
238
..
238
..
239
.
.
.
.
.
.
.
.
.
.
239
239
239
239
240
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
31
31
31
31
31
32
32
32
32
32
33
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
3.1.11
3.1.12
3.1.13
3.2
3.2.1
3.2.2
3.2.3
3.2.4
3.2.5
3.2.6
3.2.7
3.3
3.4
3.4.1
3.4.2
3.4.3
3.4.4
3.4.5
3.4.5.1
3.4.6
3.4.7
3.4.8
3.4.9
3.4.10
3.4.11
3.4.12
3.4.13
3.4.14
3.4.15
3.4.16
3.5
3.6
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
33
33
33
34
35
35
35
36
36
37
37
38
310
314
316
316
317
318
318
319
319
319
319
320
323
324
324
325
325
325
325
326
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
41
41
43
44
44
44
45
45
49
411
411
414
414
415
415
417
4 Mailbox Driver
4.1
4.1.1
4.1.2
4.1.3
4.1.4
4.2
4.3
4.3.1
4.3.2
4.3.3
4.3.4
4.3.5
4.3.6
4.3.7
4.4
4.5
vi
Mailbox Operations . . . . . . . . . . . . . . . .
Creating Mailboxes . . . . . . . . . . . . .
Deleting Mailboxes . . . . . . . . . . . . . .
Mailbox Message Format . . . . . . . . .
Mailbox Protection . . . . . . . . . . . . . .
Mailbox Driver Device Information . . . .
Mailbox Function Codes . . . . . . . . . . . . .
Read . . . . . . . . . . . . . . . . . . . . . . . . .
Write . . . . . . . . . . . . . . . . . . . . . . . .
Write End-of-File Message . . . . . . . .
Set Attention AST . . . . . . . . . . . . . .
Wait for Writer/Reader . . . . . . . . . . .
Set Protection . . . . . . . . . . . . . . . . .
Get Mailbox Information . . . . . . . . .
I/O Status Block . . . . . . . . . . . . . . . . . . .
Mailbox Driver Programming Examples
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5 Terminal Driver
5.1
5.2
5.2.1
5.2.1.1
5.2.1.2
5.2.1.3
5.2.1.4
5.2.1.5
5.2.1.6
5.2.1.7
5.2.2
5.2.2.1
5.2.2.2
5.2.2.3
5.2.3
5.2.3.1
5.2.3.2
5.2.3.3
5.2.4
5.2.5
5.2.6
5.3
5.3.1
5.4
5.4.1
5.4.1.1
5.4.1.2
5.4.1.3
5.4.1.4
5.4.2
5.4.2.1
5.4.2.2
5.4.3
5.4.3.1
5.4.3.2
5.4.3.3
5.4.3.4
5.4.3.5
5.4.3.6
5.4.4
5.4.4.1
5.4.4.2
5.4.4.3
5.4.4.4
5.4.4.5
5.4.4.6
5.4.4.7
5.4.4.8
5.4.4.9
5.4.5
5.4.5.1
5.4.5.2
5.4.5.3
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
51
52
53
53
54
57
57
59
510
510
510
510
511
511
513
513
517
517
518
519
520
520
526
527
528
529
530
531
537
538
539
539
541
545
545
546
548
549
550
550
551
552
552
560
575
577
577
578
579
579
580
580
582
vii
5.5
5.6
582
586
6 Pseudoterminal Driver
6.1
6.1.1
6.1.2
6.1.3
6.2
6.3
6.4
6.5
6.5.1
6.5.2
6.5.3
6.5.4
6.5.5
6.5.5.1
6.5.5.2
6.5.5.3
6.5.5.4
6.5.5.5
6.5.5.6
6.6
6.6.1
Pseudoterminal Operations . . . . . . . . . . . . . . .
Creating a Pseudoterminal . . . . . . . . . . . .
Canceling a Request . . . . . . . . . . . . . . . . . .
Deleting a Pseudoterminal . . . . . . . . . . . . .
Pseudoterminal Driver Features . . . . . . . . . . .
Pseudoterminal Driver Device Information . . .
I/O Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pseudoterminal Functions . . . . . . . . . . . . . . . .
Reading Data . . . . . . . . . . . . . . . . . . . . . . .
Writing Data . . . . . . . . . . . . . . . . . . . . . . .
Using Write with Echo . . . . . . . . . . . . . . . .
Flow Control . . . . . . . . . . . . . . . . . . . . . . .
Event Notification . . . . . . . . . . . . . . . . . . .
Input Flow Control . . . . . . . . . . . . . . . .
Output Stop . . . . . . . . . . . . . . . . . . . . .
Output Resume . . . . . . . . . . . . . . . . . .
Characteristics Changed . . . . . . . . . . .
Output Abort . . . . . . . . . . . . . . . . . . . .
Terminal Driver Read Events . . . . . . . .
Pseudoterminal Driver Programming Example
Design Overview . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
61
61
62
62
63
63
63
64
64
65
65
65
66
66
66
66
66
66
67
67
67
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
71
72
72
72
72
73
74
Overview of SCSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
OpenVMS SCSI Class/Port Architecture . . . . . . . . . . . . . . . . . . . .
Overview of the OpenVMS Generic SCSI Class Driver . . . . . . . . .
Accessing the OpenVMS Generic SCSI Class Driver . . . . . . . . . . .
SCSI Port Features Under Application Control . . . . . . . . . . . . . . .
Setting the Data Transfer Mode . . . . . . . . . . . . . . . . . . . . . . . .
Enabling Disconnection and Reselection . . . . . . . . . . . . . . . . .
Disabling Command Retry . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting Command Timeouts . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring a Device Using the Generic Class Driver . . . . . . . . . .
Disabling the Autoconfiguration of a SCSI Device (VAX Only) .
Assigning a Channel to GKDRIVER . . . . . . . . . . . . . . . . . . . . . . .
Issuing a $QIO Request to the Generic Class Driver . . . . . . . . . . .
Generic SCSI Class Driver Device Information . . . . . . . . . . . . . . .
Call a Generic SCSI Class Driver . . . . . . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
81
82
83
84
86
86
87
87
88
88
89
89
810
813
814
Introduction . . . . . . . . . . . . . . . . . . . . . . .
Configurations . . . . . . . . . . . . . . . . . . . . .
Supported Hardware . . . . . . . . . . . . .
Compatible Disk Drives and Volumes
Driver Functions . . . . . . . . . . . . . . . . . . .
Read and Write Functions . . . . . . . . .
Error Processing . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
viii
91
91
92
92
94
95
96
96
97
97
98
98
98
911
912
915
917
917
918
918
919
921
921
922
922
925
926
926
927
928
929
929
930
930
931
932
932
932
933
934
934
935
935
936
936
936
937
938
939
939
939
940
940
ix
9.13.5
Token Ring Functional Address Mapping . . . . . . . . . . . . . . . . . . . . . . .
9.14
Configuring ISA Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.14.1
OpenVMS LAN Devices Requiring Configuration . . . . . . . . . . . . . . . .
9.14.1.1
DE203 Ethernet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.14.1.2
DW110 Token Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.15
Configuring the Ethernet Media Type from the Console . . . . . . . . . . . . . .
9.16
Frame Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.16.1
CSMA/CD Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.16.2
FDDI Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.16.3
Token Ring Frames (Alpha Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.16.4
ATM ELAN Frames (Alpha Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.16.5
802.2/802.1 Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.16.6
Token Ring Source Routing Header (Alpha Only) . . . . . . . . . . . . . . . .
9.17
Format Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.18
Features of Packet Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.18.1
Ethernet Packet Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.18.1.1
Ethernet Protocol Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.18.1.2
Ethernet Packet Padding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.18.1.3
Protocol Type Sharing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.18.2
IEEE 802 Packet Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.18.2.1
Class I Service Packet Format . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.18.2.2
User-Supplied Service Header Format . . . . . . . . . . . . . . . . . . . . . .
9.18.2.3
Service Access Point (SAP) Use and Restrictions . . . . . . . . . . . . . .
9.18.3
IEEE 802 Extended Packet Format . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.18.3.1
Protocol Type PID Sharing (Alpha Only) . . . . . . . . . . . . . . . . . . . .
9.19
LAN Device Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.20
LAN Function Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.20.1
Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.20.2
Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.20.3
Set Mode and Set Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.20.3.1
Set Controller Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.20.3.2
Set Mode Parameters for Packet Formats . . . . . . . . . . . . . . . . . . .
9.20.3.3
Set Mode Parameter Validation . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.20.3.4
Shutdown Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.20.3.5
Enable Attention AST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.20.3.6
IO$M_SET_MAC Functional Modifier to IO$M_SETMODE . . . . .
9.20.3.7
IO$M_UPDATE_MAP Functional Modifier to IO$_SETMODE . . .
9.20.3.8
IO$M_ROUTE Functional Modifier to IO$_SETMODE . . . . . . . . .
9.20.4
Sense Mode and Sense Characteristics . . . . . . . . . . . . . . . . . . . . . . . .
9.20.4.1
IO$M_SENSE_MAC Functional Modifier to
IO$_SENSEMODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.20.4.2
IO$M_SHOW_MAP Functional Modifier to IO$_SENSMODE . . . .
9.20.4.3
IO$M_SHOW_ROUTE Functional Modifier to
IO$_SENSEMODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.21
I/O Status Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.22
Application Programming Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.22.1
Promiscuous Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.22.2
Local Area Network Programming Examples . . . . . . . . . . . . . . . . . . .
9.23
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
941
943
943
943
944
944
945
946
948
948
948
949
950
950
953
954
954
954
955
956
956
957
958
958
959
960
961
962
966
968
969
979
980
981
981
982
984
986
987
989
991
991
993
994
994
994
9101
101
102
102
103
104
104
105
105
106
106
106
106
107
107
108
109
109
1010
1012
1013
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
A1
A2
A3
A5
A6
A8
A8
A9
C1
C9
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
D2
D3
D6
D7
D9
D10
D13
xi
Index
Examples
21
31
32
33
34
41
42
43
51
52
53
54
61
81
91
92
93
94
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
240
314
326
327
328
418
420
422
586
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5100
5109
5113
68
814
944
944
995
998
13
13
14
114
121
123
139
139
26
29
221
Figures
11
12
13
14
15
16
17
18
21
22
23
24
25
26
27
28
31
32
33
34
xii
224
232
233
239
240
317
318
320
321
35
36
41
42
43
44
45
46
47
48
49
410
411
51
52
53
54
55
56
57
58
59
510
511
512
513
514
515
516
517
518
61
81
82
83
91
92
93
94
95
96
97
98
99
910
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
322
325
42
47
48
410
412
413
415
416
416
416
416
515
519
531
532
539
542
543
547
548
554
580
580
581
582
583
583
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
584
584
64
82
85
810
934
938
946
947
947
948
948
...
...
...
949
949
950
xiii
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
B1
B2
D1
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
950
950
951
952
953
956
957
958
959
960
964
967
969
985
986
988
989
991
992
993
B2
B3
D4
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
14
17
110
111
113
114
115
118
121
124
125
128
132
135
136
137
138
219
221
...
225
Tables
11
12
13
14
15
16
17
18
19
110
111
112
113
114
115
116
117
21
22
23
xiv
24
25
31
32
33
34
35
36
41
51
52
53
54
55
56
57
58
59
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
71
91
92
93
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
227
229
38
39
310
311
322
323
44
51
55
516
521
521
523
529
532
539
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
540
541
550
555
558
559
559
562
564
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
564
565
567
568
568
570
570
571
572
573
575
576
583
584
73
92
93
96
xv
94
95
96
97
98
99
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
xvi
DE500 Adapters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DE600 Adapters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Gigabit Ethernet Cabling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DEGPA Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DEGPA Status and Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MAC Counter Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Interface Counter Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Host Commands Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Event Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Interrupt Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DMA Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ring Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Internal MAC Receive Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DEGXA Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DEGXABasic Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Status Block Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Receive MAC Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Transmit MAC Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Receive List Placement State Machine . . . . . . . . . . . . . . . . . . . . . . . .
Send Data Initiator State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . .
Host Coalescing State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LANCP Device-Specific Commands . . . . . . . . . . . . . . . . . . . . . . . . . . .
PDQ FDDI NICs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
TMS380 Token Ring NICs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Components of LAN Emulation over ATM Network . . . . . . . . . . . . . . .
Address Mappings of Token Ring Drivers . . . . . . . . . . . . . . . . . . . . . .
ISA Configuration Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ethernet Controller Device Characteristics . . . . . . . . . . . . . . . . . . . . .
Ethernet Controller Unit and Line Status . . . . . . . . . . . . . . . . . . . . . .
Error Summary Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LAN I/O Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Maximum User Data Sizes for CSMA/CD, FDDI, and Token Ring . . . .
Maximum User Data Sizes for LAN Emulation over ATM (Alpha
Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Maximum Message Sizes for CSMA/CD, FDDI, and Token Ring . . . . .
Maximum Message Sizes for LAN Emulation over ATM (Alpha
Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
P2 Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Set Mode Parameters for Packet Formats . . . . . . . . . . . . . . . . . . . . . .
Medium Specific Parameters of IO$M_SET_MAC for Ethernet (Alpha
Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Medium Specific Parameters of IO$M_SET_MAC for FDDI . . . . . . . . .
Medium Specific Parameters of IO$M_SET_MAC for Token Ring . . . .
Medium Specific Parameters of IO$M_SET_MAC for ATM . . . . . . . . .
Parameters of IO$M_SENSE_MAC . . . . . . . . . . . . . . . . . . . . . . . . . . .
State of the Entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Rules for Promiscuous Mode Operation . . . . . . . . . . . . . . . . . . . . . . . .
96
97
97
98
98
911
913
916
917
917
918
918
919
921
922
926
926
927
929
929
930
931
932
932
933
942
943
960
961
961
961
965
965
967
967
970
979
982
982
983
984
989
993
994
B1
C1
C2
D1
D2
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
B4
C1
C9
D1
D11
xvii
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:
Chapter 1 describes the Queue I/O (QIO) interface to file system ancillary
control processes (ACPs).
Appendix C lists the DEC Multinational character set and the ANSI and
DIGITAL private escape sequences for terminals.
xix
Related Documents
The following manuals provide additional information that relates to the topics
covered in this book:
For additional information about Compaq OpenVMS products and services, access
the Compaq website at the following location:
http://www.openvms.compaq.com/
xx
Readers Comments
Compaq welcomes your comments on this manual. Please send comments to
either of the following addresses:
Internet
Conventions
The following conventions are used in this manual:
Ctrl/x
PF1 x
Return
...
.
.
.
()
[]
xxi
{}
bold text
italic text
UPPERCASE TEXT
Monospace text
xxii
numbers
1
ACPQIO Interface
An ancillary control process (ACP) is a process that interfaces between
the user process and the driver, and performs functions that supplement the
drivers 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.
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
unpredictable consequences such as system failure.
In addition to the ACP, the XQP (extended QIO processor) facility supplements
the QIO drivers functions when performing virtual I/O operations on filestructured 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 and ODS-5 (On-Disk Structure
Level 2 and 5) 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.
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.
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
ACPQIO Interface 11
ACPQIO Interface
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.271978.
IO$M_CREATECreates a file
IO$M_DMOUNTDismounts a volume
In addition to the function codes and modifiers, ACPs take five device- or
function-dependent arguments, as shown in Figure 11. 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
length. The resultant string is
Argument P4 is the address of
file name string. Both of these
12 ACPQIO Interface
ACPQIO Interface
1.1 ACP Functions and Encoding
Figure 11 ACP Device- or Function-Dependent Arguments
31
P1:
P2:
P3:
P4:
P5:
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 12 shows the format for the descriptors. The count field is the length in
bytes of the item described.
Figure 12 ACP Device/Function Argument Descriptor Format
31
16 15
Not Used
0
Count
Address
ZK0637GE
ACPQIO Interface 13
ACPQIO Interface
1.2 File Information Block (FIB)
Figure 13 Typical Short FIB
31
24 23
16 15
FIB$B_WSIZE
87
FIB$L_ACCTL
FIB$W_FID
FIB$W_DID
FIB$L_WCC
0
FIB$W_NMCTL
0
ZK0639GE
Table 11 gives a brief description of the FIB fields. More detailed descriptions
are provided in Sections 1.3 and 1.6.
Table 11 Contents of the FIB
Field
Subfields
Meaning
FIB$L_ACCTL
FIB$L_ACL_STATUS
FIB$L_ACLCTX
FIB$B_ALALIGN
FIB$W_ALLOC
FIB$B_ALOPTS
FIB$W_LOC_FID
FIB$W_LOC_NUM
FIB$W_LOC_SEQ
FIB$B_LOC_RVN
FIB$B_LOC_NMX
FIB$L_LOC_ADDR
14 ACPQIO Interface
ACPQIO Interface
1.2 File Information Block (FIB)
Table 11 (Cont.) Contents of the FIB
Field
Subfields
Meaning
FIB$L_ALT_ACCESS
FIB$W_CNTRLFUNC
FIB$L_CNTRLVAL
FIB$W_DID
File number.
FIB$W_DID_SEQ
FIB$W_DID_RVN
FIB$B_DID_RVN
FIB$B_DID_NMX
FIB$W_EXCTL
FIB$L_EXSZ
FIB$L_EXVBN
FIB$W_FID
File number.
FIB$W_FID_SEQ
FIB$W_FID_RVN
FIB$B_FID_RVN
FIB$B_FID_NMX
ACPQIO Interface 15
ACPQIO Interface
1.2 File Information Block (FIB)
Table 11 (Cont.) Contents of the FIB
Field
Subfields
Meaning
FIB$B_NAME_
FORMAT_IN
FIB$B_NAME_
FORMAT_OUT
FIB$W_NMCTL
FIB$L_STATUS
FIB$V_ALT_GRANTED
FIB$W_VERLIMIT
FIB$L_WCC
FIB$B_WSIZE
Directory Lookup
Access
Extend
Truncate
Read/Write Attributes
Section 1.6, which contains the descriptions of the major functions, lists the
subfunctions available to each major function.
16 ACPQIO Interface
ACPQIO Interface
1.3 ACP Subfunctions
1.3.1 Directory Lookup
The directory lookup subfunction is used to search for a file in a disk directory or
on a magnetic tape. This subfunction can be invoked using the major functions
IO$_ACCESS, IO$_MODIFY, IO$_DELETE, and IO$_ACPCONTROL. A directory
lookup occurs if the directory file ID field in the FIB (FIB$W_DID) is a nonzero
number.
1.3.1.1 Input Parameters
Table 12 lists the FIB fields that control the processing of a lookup subfunction.
Subfields
FIB$W_NMCTL
Meaning
Name string control. The following name control bits
are applicable to a lookup operation:
FIB$V_ALLNAM
FIB$V_ALLTYP
FIB$V_ALLVER
FIB$V_CASE_
SENSITIVE
FIB$V_FINDFID
FIB$V_NAMES_8BIT
FIB$V_NAMES_16BIT
FIB$V_WILD
FIB$W_FID
FIB$W_DID
FIB$L_WCC
FIB$L_ACCTL
FIB$B_NAME_
FORMAT_IN
FIB$C_ODS2
FIB$C_ISO_LATIN
FIB$C_UCS2
FIB$B_NAME_
FORMAT_OUT
ACPQIO Interface 17
ACPQIO Interface
1.3 ACP Subfunctions
Table 12 (Cont.) FIB Fields (Lookup Control)
Field
Subfields
Meaning
FIB$C_ISO_LATIN
FIB$C_UCS2
QIO arguments P2 through P6 (see Figure 11) are passed as values. The second
argument, P2, specifies the address of the descriptor for the file name string to be
searched for in the directory.
The file name string must have one of the following two formats:
name.type;version
name.type.version
The name and type can be any combination of alphanumeric characters, and
the dollar sign ( $ ), asterisk ( * ), and percent ( % ) characters. The version must
consist of numeric characters optionally preceded by a minus sign ( ) (only for
disk devices) or a single asterisk. The total number of alphanumeric and percent
characters in the name field and in the type field must not exceed 39. Any
number of additional asterisks can be present.
If any of the bits FIB$V_ALLNAM, FIB$V_ALLTYP, and FIB$V_ALLVER are
set, then the contents of the corresponding field in the name string are ignored
and the contents are assumed to be an asterisk.
Note that the file name string cannot contain a directory string. The directory
is specified by the FIB$W_DID field (see Table 11). Only RMS can process
directory strings.
Argument P3 is the address of a word to receive the resultant file name string
length. Argument P4 is the address of a descriptor for a buffer to receive the
resultant file name string. The resultant string is not padded. The P3 and P4
arguments are optional.
1.3.1.2 Operation
The system searches either the directory file specified by FIB$W_DID or the
magnetic tape for the file name specified in the P2 file name parameter. The
actual file name found and its length are returned in the P3 and P4 length and
result string buffers. The file ID of the file found is returned in FIB$W_FID and
can be used in subsequent operations as the major function is processed.
Zero and negative version numbers have special significance in a disk lookup
operation. Specifying 0 as a version number causes the latest version of the file
to be found. Specifying 1 locates the second most recent version, 2 the third
most recent, and so forth. Specifying a version of 0 locates the lowest numbered
version of the file. For magnetic tape lookups, a version number of 0 locates the
first occurrence of the file encountered; negative version numbers are not allowed.
Wildcard lookups are performed by specifying the appropriate wildcard characters
in the name string and setting FIB$V_WILD. (The name control bits FIB$V_
ALLNAM, FIB$V_ALLTYP, and FIB$V_ALLVER can also be used in searching
for wildcard entries, but they are intended primarily for compatibility mode use.)
On the first lookup, FIB$L_WCC should contain zero entries. On each lookup, the
ACP returns a nonzero value in FIB$L_WCC, which must be passed back on the
next lookup call. In addition, you must pass the resultant name string returned
by the previous lookup using the P4 result string buffer, and its length in the P3
18 ACPQIO Interface
ACPQIO Interface
1.3 ACP Subfunctions
result length word. This string is used together with FIB$L_WCC to continue the
wildcard search at the correct position in the directory.
Perform a lookup by file ID by setting the name control bit FIB$V_FINDFID.
When this bit is set, the system searches the directory for an entry containing the
file ID specified in FIB$W_FID, and the name of the entry found is returned in
the P3 and P4 result parameters. Note that if a directory contains multiple
entries with the same file ID, only the first entry can be located with this
technique.
Lookups by file ID should be done only when the file name is not available,
because lookups by this method are often significantly slower than lookups by file
name.
Because not all programs can handle all of the available name formats, the
FIB$W_NMCTL flags govern the name formats, and are returned as follows:
ACPQIO Interface 19
ACPQIO Interface
1.3 ACP Subfunctions
1.3.2 Access
The access subfunction is used to open a file so that virtual read or write
operations can be performed. This subfunction can be invoked using the major
functions IO$_CREATE and IO$_ACCESS (see Sections 1.6.1 and 1.6.2). An
access subfunction is performed if the IO$M_ACCESS modifier is specified in the
I/O function code.
1.3.2.1 Input Parameters
Table 13 lists the FIB fields that control the processing of an access subfunction.
Subfields
FIB$L_ACCTL
Meaning
Specifies field values that control access to the file.
The following access control bits are applicable to the
access subfunction:
FIB$V_WRITE
FIB$V_NOREAD
FIB$V_NOWRITE
FIB$V_NOTRUNC
FIB$V_DLOCK
FIB$V_UPDATE
FIB$V_READCK
FIB$V_WRITECK
FIB$V_EXECUTE
FIB$V_NOLOCK
FIB$V_NORECORD
ACPQIO Interface
1.3 ACP Subfunctions
Table 13 (Cont.) FIB Fields (Access Control)
Field
Subfields
Meaning
FIB$V_SEQONLY
FIB$B_WSIZE
FIB$W_FID
1.3.2.2 Operation
The file is opened according to the access control specified (see Table 13).
1.3.3 Extend
The extend subfunction is used to allocate space to a disk file. This subfunction
can be invoked using the major I/O functions IO$_CREATE and IO$_MODIFY
(see Sections 1.6.1 and 1.6.4). The extend subfunction is performed if the bit
FIB$V_EXTEND is set in the extend control word FIB$W_EXCTL.
1.3.3.1 Input Parameters
Table 14 lists the FIB fields that control the processing of an extend subfunction.
Subfields
FIB$W_EXCTL
Meaning
Extend control flags. The following flags are
applicable to the extend subfunction:
FIB$V_EXTEND
FIB$V_NOHDREXT
FIB$V_ALCON
FIB$V_ALCONB
FIB$L_EXSZ
FIB$V_FILCON
FIB$V_ALDEF
ACPQIO Interface
1.3 ACP Subfunctions
Table 14 (Cont.) FIB Fields (Extend Control)
Field
Subfields
Meaning
The number of blocks actually allocated for this
operation is returned in this longword. More blocks
than requested can be allocated to meet cluster
boundaries.
FIB$L_EXVBN
FIB$B_ALOPTS
FIB$V_ONCYL
FIB$B_ALALIGN
FIB$C_CYL
FIB$C_LBN
FIB$C_VBN
FIB$C_RFI
FIB$W_ALLOC
FIB$W_LOC_NUM
FIB$W_LOC_SEQ
FIB$B_LOC_RVN
FIB$B_LOC_NMX
FIB$L_LOC_ADDR
ACPQIO Interface
1.3 ACP Subfunctions
1.3.3.2 Operation
The specified number of blocks are allocated and appended to the file. The virtual
block number assigned to the first block allocated is returned in FIB$L_EXVBN.
The actual number of blocks allocated is returned in FIB$L_EXSZ.
The actual number of blocks allocated is also returned in the second longword of
the users I/O status block. If a contiguous allocation (FIB$V_ALCON) fails, the
size of the largest contiguous space available on the disk is returned in the second
longword of the users I/O status block.
1.3.4 Truncate
The truncate subfunction is used to remove space from a disk file. This
subfunction can be invoked by the major I/O functions IO$_DEACCESS and IO$_
MODIFY (see Sections 1.6.3 and 1.6.4). The truncate subfunction is performed if
the bit FIB$V_TRUNC is set in the extend control word FIB$W_EXCTL.
1.3.4.1 Input Parameters
Table 15 lists the FIB fields that control the processing of a truncate
subfunction.
Table 15 FIB Fields (Truncate Control)
Field
Subfields
FIB$W_EXCTL
Meaning
Extend control flags. The following flags are
applicable to the truncate subfunction:
FIB$V_TRUNC
FIB$V_MARKBAD
FIB$L_EXSZ
FIB$L_EXVBN
1.3.4.2 Operation
Blocks are deallocated from the file, starting with the virtual block specified in
FIB$L_EXVBN and continuing through the end of the file. The actual number
of blocks deallocated is returned in FIB$L_EXSZ. The virtual block number of
the first block actually deallocated is returned in FIB$L_EXVBN. Because of
cluster round-up, this value might be greater than the value specified. If FIB$V_
MARKBAD is specified, the truncation VBN is rounded down instead of up, and
the value returned in FIB$L_EXVBN might be less than that specified.
The number of blocks by which FIB$L_EXVBN was rounded up is returned in the
second longword of the I/O status block.
The truncate subfunction normally requires exclusive access to the file at run
time. This means, for example, that a file cannot be truncated while multiple
writers have access to it.
ACPQIO Interface
1.3 ACP Subfunctions
An exception occurs when a truncate subfunction is requested for a write-accessed
file that allows other readers. Although the truncate subfunction returns success
status in this instance, the actual file truncation (the return of the truncated
blocks to free storage) is deferred until the last reader deaccesses the file. If a
new writer accesses the file after the truncate subfunction is requested, but before
the last deaccess, the deferred truncation is ignored.
Once the truncate operation has started, the file is locked from other writers for
the duration of the truncate operation. Attempts to access the file for shared
write access during this time will result in an SS$_ACCONFLICT error.
16 15
ATR$W_TYPE
0
ATR$W_SIZE
ATR$L_ADDR
0
ZK0640GE
Meaning
ATR$W_SIZE
ACPQIO Interface
1.3 ACP Subfunctions
Table 16 (Cont.) Attribute Control Block Fields
Field
Meaning
ATR$W_TYPE
ATR$L_ADDR
Contains the buffer address of the memory space to or from which the
attribute is to be transferred. The attribute buffer must be writable.
Table 17 lists the valid attributes for ACP-QIO functions. The maximum size
(in bytes) is determined by the required attribute configuration. For example,
the Radix-50 file name (ATR$S_FILNAM) uses only 6 bytes, but it is always
accompanied by the file type and file version, so a total of 10 bytes is required.
Each attribute has two names: one for the code (for example, ATR$C_UCHAR)
and one for the size (for example, ATR$S_UCHAR).
Table 17 ACP-QIO Attributes
Maximum Size
(bytes)
Attribute Name6
Meaning
ATR$C_ACCDATE12
ATR$C_ACCESS_MODE
2 4 5 10
ATR$C_ACLEVEL
ATR$C_ACLLENGTH
10 11
ATR$C_ADDACLENT
7 10
ATR$C_ALCONTROL
ATR$C_ASCDATES
2 Protected
3 Not
255
14
35
4 Locked
5 For
2 3
11
6 Attributes with an ATR$C_ prefix have two names: one with the ATR$C_ prefix for the code and one with an ATR$S_
prefix for the size, which is not included in the list.
7 Exclusive
access required. This operation does not complete successfully if other readers or writers are allowed.
10 Not
11 The
12 Not
supported by all ACPs. Maintained on ODS-5 volumes when access dates are enabled using the DCL INITIALIZE
or SET VOLUME commands. Not maintained on ODS-2 volumes.
ACPQIO Interface
1.3 ACP Subfunctions
Table 17 (Cont.) ACP-QIO Attributes
Maximum Size
(bytes)
Attribute Name6
ATR$C_ASCNAME
252 (ODS-5)
86 (ODS-2)
Meaning
File name, type, and version, in ASCII, including
punctuation. Format: name.type;version.
Magnetic tape: contains 17-character file identifier
(ANSI a); no version number. Overrides all other
file name and file type specifications if supplied on
input operations. If specified on an access operation
and you want only a value to be returned, specify
(in ATR$W_SIZE) a buffer of greater than 17 bytes.
See Section 1.3.5.2 for additional information.
12
10
4 5 8 10
ATR$C_ATTDATE
ATR$C_BACKLINK
ATR$C_BAKDATE
ATR$C_BLOCKSIZE
ATR$C_BUFFER_OFFSET
ATR$C_CREDATE2
ATR$C_DELACLENT
ATR$C_DELETE_ALL
ATR$C_DELETEACL
7 10
11
255
7 10 11
255
255
7 10 11
10
ATR$C_ENDLBLAST
ATR$C_EXPDAT2
ATR$C_DIRSEQ
ATR$C_EXPDATE
ATR$C_FILE_SPEC
10
4098 (ODS-5)
512 (ODS-2)
ATR$C_FILNAM
10
ATR$C_FILTYP
2 Protected
3 Not
4 Locked
5 For
6 Attributes with an ATR$C_ prefix have two names: one with the ATR$C_ prefix for the code and one with an ATR$S_
prefix for the size, which is not included in the list.
7 Exclusive
8 Can
access required. This operation does not complete successfully if other readers or writers are allowed.
10 Not
11 The
12 Not
supported by all ACPs. Maintained on ODS-5 volumes when access dates are enabled using the DCL INITIALIZE
or SET VOLUME commands. Not maintained on ODS-2 volumes.
ACPQIO Interface
1.3 ACP Subfunctions
Table 17 (Cont.) ACP-QIO Attributes
Maximum Size
(bytes)
Attribute Name6
ATR$C_FILVER
Meaning
2-byte binary version number. See Section 1.3.5.2
for additional information.
ATR$C_FNDACLENT
10 11
255
ATR$C_FNDACETYP
10 11
255
ATR$C_FPRO2
2
10 11
ATR$C_GRANT_ACE
255
ATR$C_HDR1_ACC
ATR$C_HEADER
512
10
ATR$C_HIGHWATER
ATR$C_JOURNAL
10
ATR$C_LINKCOUNT
ATR$C_MATCHING_ACE
ATR$C_MODACLENT
10
7 10 11
ATR$C_MODDATE12
ATR$C_NEXT_ACE
File protection.
Return an ACE that grants or denies access to the
object.
ANSI magnetic tape header label accessibility
character.
Complete file header. This attribute is read only.
Count of hardlinks.
255
255
10 11
10
ATR$C_PRIVS_USED
ATR$C_READACE
10 11
255
ATR$C_READACL
10 11
512
32
ATR$C_RECATTR4
ATR$C_RESERVED
2 4
ATR$C_REVDATE
2 Protected
9 10
380
8
4 Locked
access required. This operation does not complete successfully if other readers or writers are allowed.
9 The actual length available can decrease if the file is extended in a noncontiguous manner or if an ACL is applied to the
file.
10 Not supported for Files-11 On-Disk Structure Level 1 or magnetic tapes.
11 The
12 Not
supported by all ACPs. Maintained on ODS-5 volumes when access dates are enabled using the DCL INITIALIZE
or SET VOLUME commands. Not maintained on ODS-2 volumes.
ACPQIO Interface
1.3 ACP Subfunctions
Table 17 (Cont.) ACP-QIO Attributes
Maximum Size
(bytes)
Attribute Name6
ATR$C_RPRO
10
10
ATR$C_SEMASK
ATR$C_STATBLK
ATR$C_UCHAR2
32
80
ATR$C_USERLABEL
Meaning
ATR$C_UIC2
ATR$C_UIC_RO
2 Protected
3 Not
6 Attributes with an ATR$C_ prefix have two names: one with the ATR$C_ prefix for the code and one with an ATR$S_
prefix for the size, which is not included in the list.
10 Not
Table 18 lists the bits contained in the file characteristics longword, which is
read with the ATR$C_UCHAR attribute.
Table 18 File Characteristics Bits
FCH$M_NOBACKUP
FCH$M_READCHECK
FCH$M_WRITCHECK
FCH$M_CONTIGB
FCH$M_LOCKED
File is deaccess-locked.
FCH$M_CONTIG
File is contiguous.
FCH$M_BADACL
FCH$M_SPOOL
FCH$M_DIRECTORY
File is a directory.
FCH$M_BADBLOCK
FCH$M_MARKDEL
FCH$M_ERASE
FCH$M_ASSOCIATED
FCH$M_EXISTENCE
FCH$M_NOMOVE
FCH$M_NOSHELVABLE
FCH$M_SHELVED
File is shelved.
1 Files-11
C/D only.
ACPQIO Interface
1.3 ACP Subfunctions
1.3.5.2 Attribute Descriptions
This section contains descriptions of the following attribute codes that are listed
in Table 17:
ATR$C_ASCNAME
ATR$C_FILE_SPEC
ATR$C_FILNAM
ATR$C_FILTYP
ATR$C_FILVER
ATR$C_ASCNAME
The ATR$C_ASCNAME attribute allows the file specification stored in a files
primary file header to be read and written.
Reading the ATR$C_ASCNAME Attribute
For ODS-5 volumes, the file specification is returned in the supplied buffer, and
the name format is returned in the FIB$B_ASCNAME_FORMAT cell.
The format in which the name is returned is controlled by the settings of the
FIB$V_NAMES_8BIT and FIB$V_NAMES_16BIT flags in the same way as the
output file specification parameter. A pseudoname can be returned in place of the
actual file specification if the format is not one of those the calling program can
accept.
Unlike the output file specification parameter, the length of a file specification
contained in the ASCNAME attribute is not passed back explicitly. To determine
the length of the file specification, the calling program must search the attribute
buffer for the first occurrence of the padding character. If neither the FIB$V_
NAMES_8BIT nor the FIB$V_NAMES_16BIT flag is set, the buffer is padded
with space (note that only ODS-2 format names are returned in this case). If one
or more of the flags are set, the attribute buffer is padded with zeros.
Note
The file system does not enforce a minimum length on the attribute
buffer. If the file specification is longer than the attribute buffer, the
value returned is truncated without signaling an error or warning.
In contrast, the file system does enforce a maximum size for the attribute
buffer. Supplying a larger buffer returns a BADPARAM error.
ACPQIO Interface
1.3 ACP Subfunctions
the offset of the first space character. This can be 252 bytes or the length of the
supplied buffer, whichever is the least.
ATR$C_FILE_SPEC
The FILE_SPEC attribute is a read-only attribute that returns the physical file
specification in the form:
DDnn:[DIR1.DIR2_DIRn]name.type;1
The file name returned is that from the file header, which may be different
from that in the directory. The specification may be incomplete if any errors are
encountered while reading the file headers of any of the directories in the path.
For files on ODS-5 volumes, the path may contain file names that are in any
of the three name formats. This creates a number of problems; for instance,
the presence of periods in a directory name could return an ambiguous path
specification. To avoid this and other problems, the file system makes use of
services provided by RMS to translate the file specification and the components of
the path to their escaped form.
When you access files on an ODS-5 volume from a VAX system in a mixed
architecture OpenVMS system, no escaped forms are returned. For an ODS-2
or ISO Latin-1 file format, the name stored in the file header is returned. For
a UCS-2 file format, a pseudoname is returned, followed by the file identifier in
parentheses. For example:
DKA100:[ABC]\pUNICODE\.??? (10095,5,0)
If the escaped form of the path is longer than can be accommodated by the buffer
for the attribute, one or more directories in the path may be replaced by the DID
of the rightmost of those replaced. This process is identical to that performed by
RMS.
However, if the file specification, even after DID abbreviation, is longer than can
be accommodated by the buffer, the file name is truncated. The file specification
string returned to the user buffer has a 2-byte count prefix. The count contains
the number of bytes for the untruncated file specification. If the count is greater
than the size of the user buffer (minus the two bytes that contain the count), the
user can conclude that the returned file specification has been truncated.
ATR$C_FILNAM, ATR$C_FILTYP, and ATR$C_FILVER
The first two of these attributes allow the file name and file type to be read and
written using Radix-50 encoding. This encoding scheme enables 3 characters to
be packed into a 16-bit word. Only 38 characters in the ODS-2 format set are
valid for Radix-50 names, with the exceptions being dash (-) and underscore (_).
The maximum component lengths of a Radix-50 encoded file specification are:
ACPQIO Interface
1.3 ACP Subfunctions
The ATR$C_FILVER attribute allows the file version number in the file header
to be read or written as a 2-byte integer. As the process requires the existing file
name to be converted into a Radix-50 file name, the above restriction also applies
to this attribute.
24 23
16 15
FAT$W_RSIZE
8 7
FAT$B_RATTRIB
0
FAT$B_RTYPE*
4
FAT$L_HIBLK
8
FAT$L_EFBLK
12
FAT$B_VFCSIZE
FAT$B_BKTSIZE
FAT$W_FFBYTE
16
FAT$W_DEFEXT
FAT$W_MAXREC
20
FAT$W_GBC
24
28
Not Used
Meaning
FAT$B_RTYPE
FAT$V_RTYPE
Fixed-length record
FAT$C_VARIABLE
Variable-length record
FAT$C_VFC
FAT$C_UNDEFINED
FAT$C_STREAM
FAT$C_STREAMLF
Stream terminated by LF
FAT$C_STREAMCR
Stream terminated by CR
(continued on next page)
ACPQIO Interface
1.4 ACP-QIO Record Attributes Area
Table 19 (Cont.) ACP Record Attributes Values
Field Value
Meaning
FAT$V_FILEORG
FAT$B_RATTRIB
FAT$C_DIRECT
FAT$C_INDEXED
FAT$C_RELATIVE
FAT$C_SEQUENTIAL
FAT$M_IMPLIEDCC
FAT$M_PRINTCC
FAT$M_NOSPAN
No spanned records
4
FAT$M_MSBRCW
FAT$W_RSIZE
Highest allocated VBN. The ACP maintains this field when the
file is extended or truncated. Attempts to modify this field in a
write attributes operation are ignored.
FAT$L_HIBLK
FAT$L_EFBLK2
FAT$W_HIBLKH
High-order 16 bits
FAT$W_HIBLKL
Low-order 16 bits
End-of-file VBN
FAT$W_EFBLKH
High-order 16 bits
FAT$W_EFBLKL
Low-order 16 bits
FAT$W_FFBYTE3
FAT$B_BKTSIZE
FAT$B_VFCSIZE
FAT$W_MAXREC
FAT$W_DEFEXT
FAT$W_GBC
FAT$W_VERSIONS
1 Defined
2 Inverted
format field. The high- and low-order 16 bits are transposed for compatibility with PDP-11
software.
3 When the end-of-file position corresponds to a block boundary, by convention
FAT$L_EFBLK contains the end-of-file VBN plus 1, and FAT$W_FFBYTE contains 0.
4 Variable-length
ACPQIO Interface
1.5 ACPQIO Attributes Statistics Block
Figure 16 ACPQIO Attributes Statistics Block
31
16 15
87
SBK$L_STLBN
SBK$L_FILESIZE
SBK$L_FCB
SBK$B_LCNT
SBK$B_ACNT
(Not Used)
SBK$W_LCNT
SBK$W_ACNT
SBK$W_TCNT
SBK$W_WCNT
SBK$L_READS
SBK$L_WRITES
ZK0642GE
ACPQIO Interface
1.5 ACPQIO Attributes Statistics Block
Subfields
SBK$L_STLBN
SBK$W_STLBNL
SBK$L_FILESIZE
SBK$B_ACNT
Meaning
SBK$W_FILESIZL
SBK$B_LCNT1
SBK$L_FCB
SBK$W_ACNT
SBK$W_LCNT1
SBK$W_WCNT1
SBK$W_TCNT1
SBK$L_READS
SBK$L_WRITES
1 Accesses
ACPQIO Interface
1.6 Major Functions
1.6.1 Create File
Create file is a virtual I/O function that creates a directory entry or a file on a
disk device, or a file on a magnetic tape device.
The following is the function code:
IO$_CREATE
IO$M_CREATECreates a file.
P3The address of the word that is to receive the length of the resultant file
name string (optional).
Table 111 lists fields in the FIB that are applicable to the IO$_CREATE
operation.
Table 111 IO$_CREATE and the FIB
Field
Subfields
FIB$L_ACCTL
Meaning
Specifies field values that control access to the file. The
following bits are applicable to the IO$_CREATE function:
FIB$V_REWIND
Set to rewind magnetic tape before creating the file. Any data
currently on the tape is overwritten.
FIB$V_CURPOS
FIB$V_
WRITETHRU
FIB$W_
CNTRLFUNC
FIB$W_FID
FIB$W_DID
ACPQIO Interface
1.6 Major Functions
Table 111 (Cont.) IO$_CREATE and the FIB
Field
Subfields
FIB$W_NMCTL
Meaning
Controls the processing of the file name in a directory
operation. The following bits are applicable to the IO$_
CREATE function:
FIB$V_NEWVER
Set to create a file of the same name with the next higher
version number. Only for disk devices.
FIB$V_
SUPERSEDE
FIB$V_LOWVER
FIB$V_HIGHVER
FIB$W_VERLIMIT
FIB$L_ACL_
STATUS
If the version number in the specified file name is 0 or negative, the directory
entry created gets a version number one greater than the highest previously
existing version of that file (or version 1 if the file did not previously exist).
If the version number in the specified file name is a nonzero number and
FIB$V_NEWVER is set, the directory entry created gets a version number
one greater than the highest previously existing version of that file, or the
specified version number, whichever is greater.
If, after creating the new directory entry, the number of versions of the
file exceeds the version limit, the lowest numbered version is set aside for
deletion.
ACPQIO Interface
1.6 Major Functions
If the file did not previously exist, the new directory entry is
given a version limit as follows: the version limit is taken from
FIB$W_VERLIMIT if it is a nonzero number; if it is 0, the version
limit is taken from the default version limit of the directory file; if the
default version limit of the directory file is 0, the version limit is set to
32,767 (the highest possible number).
The file name string entered in the directory is returned using the P3
and P4 result string parameters, if present. The file name string is
also written into the header. If no directory operation was requested
(FIB$W_DID is 0), the file name string specified by P2, if any, is written
into the file header.
If an attribute list is specified by P5, a write attributes subfunction is performed
(see Section 1.3.5).
If the modifier IO$M_ACCESS is specified, the file is opened (see
Section 1.3.2).
If the extend enable bit FIB$V_EXTEND is specified in the FIB, an extend
subfunction is performed (see Section 1.3.3).
Finally, if a file was set aside for deletion (IO$M_DELETE is specified), that file
is deleted. If the file is deleted because the FIB$V_SUPERSEDE bit was set, the
alternate success status SS$_SUPERSEDE is returned in the I/O status block. If
the file is deleted because the version limit was exceeded, the alternate success
status SS$_FILEPURGED is returned.
If an error occurs in the operation of an IO$_CREATE function, all actions
performed to that point are reversed (the file is neither created nor changed), and
the error status is returned to the user in the I/O status block.
1.6.1.3 Directory Entry Creation
Creating a new version of a file eliminates default access to the previously highest
version of the file. For example, creating RESUME.TXT;4 masks RESUME.TXT;3
so the DCL command TYPE RESUME.TXT yields the contents of version 4, not
version 3. To protect the contents of the earlier version of a file, the creator of a
file must have write access to the previous version of a file of the same name.
1.6.1.4 Magnetic Tape ACP Operation
No operation is performed unless the IO$M_CREATE modifier is specified.
The magnetic tape is positioned as specified by FIB$V_REWIND and FIB$V_
CURPOS, and the file is created. The name specified by the P2 parameter is
written into the file header label.
If P5 specifies an attribute list, a write attributes subfunction is performed (see
Section 1.3.5).
If the modifier IO$M_ACCESS is specified, the file is opened (see Section 1.3.2).
IO$_ACCESS
IO$M_CREATECreates a file.
ACPQIO Interface 127
ACPQIO Interface
1.6 Major Functions
P3The address of the word that is to receive the length of the resultant file
name string (optional).
Table 112 lists FIB fields that are applicable to the IO$_ACCESS operation.
Table 112 IO$_ACCESS and the File Information Block
Field
Subfields
Meaning
FIB$W_CNTRLFUNC
FIB$W_VERLIMIT
FIB$L_ACL_STATUS
FIB$L_STATUS
FIB$L_ALT_ACCESS
FIB$V_ALT_REQ
FIB$V_ALT_GRANTED
1.6.2.2 Operation
If a nonzero directory file ID is specified in FIB$W_DID, a lookup subfunction is
performed (see Section 1.3.1.) The version limit of the file found is returned in
FIB$W_VERLIMIT.
If the directory search fails with a file not found condition and the
IO$M_CREATE function modifier is specified, the function is reexecuted as a
CREATE. In that case, the argument interpretations for IO$_CREATE, rather
than those for IO$_ACCESS, apply.
ACPQIO Interface
1.6 Major Functions
If IO$M_ACCESS is specified, an access subfunction is performed to open the file
(see Section 1.3.2).
If P5 specifies an attribute list, a read attributes subfunction is performed (see
Section 1.3.5).
IO$_DEACCESS
Meaning
FIB$W_FID
FIB$L_ACL_STATUS
1.6.3.2 Operation
For disk files, if P5 specifies an attribute control list and the file was accessed for
a write operation, a write attributes subfunction is performed (see Section 1.3.5).
If the file was opened for write, no attributes were specified, and FIB$V_DLOCK
was set when the file was accessed, the deaccess lock bit is set in the file header,
inhibiting further access to that file.
For disk files, if the truncate enable bit FIB$V_TRUNC is specified in the FIB, a
truncate subfunction is performed (see Section 1.3.4).
Finally, the file is closed. Trailer labels are written for a magnetic tape file that
was opened for write.
IO$_MODIFY
IO$M_MOVEFILE
ACPQIO Interface
1.6 Major Functions
1.6.4.1 Input Parameters
The following are the device- or function-dependent arguments for
IO$_MODIFY:
P2The address of the file name string descriptor (optional). If specified, the
directory is searched for the name.
P3The address of the word that is to receive the length of the resultant file
name string (optional).
Subfields
FIB$L_ACCTL
Meaning
Specifies field values that control access to the file.
The following bit is applicable to the IO$_MODIFY
function:
FIB$V_WRITETHRU
FIB$W_VERLIMIT
FIB$L_ACL_STATUS
1.6.4.2 Operation
If a nonzero directory ID is specified in FIB$W_DID, a lookup subfunction is
executed (see Section 1.3.1). If a nonzero version limit is specified in
FIB$W_VERLIMIT and the directory entry found is the latest version of that file,
the version limit is set to the value specified.
If P5 specifies an attribute list, a write attributes subfunction is performed (see
Section 1.3.5).
The file can be either extended or truncated. If FIB$V_EXTEND is specified
in the FIB, an extend subfunction is performed (see Section 1.3.3). If FIB$V_
TRUNC is specified in the FIB, a truncate subfunction is performed (see
Section 1.3.4). Extend and truncate operations cannot be performed at the
same time.
IO$_DELETE
ACPQIO Interface
1.6 Major Functions
The following is the function modifier:
P3The address of the word that is to receive the length of the resultant file
name string (optional).
Subfields
FIB$L_ACCTL
Meaning
Specifies field values that control access to the file. The
following bit is applicable to the IO$_DELETE function.
FIB$V_NOLOCK (Alpha
only)
FIB$V_WRITETHRU
FIB$W_DID
FIB$W_FID
1.6.5.1 Operation
If a nonzero directory ID is specified in FIB$W_DID, a lookup subfunction is
performed (see Section 1.3.1). The file name located is removed from the directory.
If the function modifier IO$M_DELETE is specified, the file is marked for
deletion. If the file is not currently open, it is deleted immediately. If the file
is open, it is deleted when the last accessor closes it.
ACPQIO Interface
1.6 Major Functions
1.6.6.2 Input Parameters
Table 113 lists the FIB fields that control the processing of a movefile
subfunction.
Table 113 FIB Fields (Movefile)
Field
Subfields
FIB$L_ACCTL
Meaning
Movefile control flag. The following flags are
applicable:
FIB$V_NOVERIFY
FIB$V_CHANGE_VOL
FIB$W_FID
FIB$W_EXCTL
FIB$V_ALCONB
FIB$V_FILCON
ACPQIO Interface
1.6 Major Functions
Table 113 (Cont.) FIB Fields (Movefile)
Field
Subfields
Meaning
FIB$V_NOPLACE
FIB$B_ALOPTS
FIB$B_ALALIGN
FIB$W_ALLOC
FIB$L_MOV_SVBN
FIB$B_LOC_RVN
FIB$L_LOC_ADDR
ACPQIO Interface
1.6 Major Functions
Table 113 (Cont.) FIB Fields (Movefile)
Field
Subfields
FIB$L_MOV_VBNCNT
Meaning
Specifies the number of consecutive virtual blocks to
be moved.
This value must be a multiple of the disk cluster
size, and it must not exceed the difference between
the greatest VBN allocated to the file and the
FIB$L_MOV_SVBN value. If you specify a value
of 0, the movefile operation moves all the virtual
blocks between the FIB$L_MOV_SVBN value and
the greatest VBN.
If you specify an invalid value, the movefile
operation fails.
1.6.6.3 Operation
A program can perform a movefile operation on a file if the following conditions
are met:
ACPQIO Interface
1.6 Major Functions
1.6.7 Mount
On VAX and Alpha systems, mount is a virtual I/O function that informs the ACP
when a disk or magnetic tape volume is mounted. MOUNT privilege is required.
IO$_MOUNT takes no arguments or function modifiers. This function is part of
the volume mounting operation only, and it is not meant for general use. Most
of the actual processing is performed by the MOUNT command or the Mount
Volume ($MOUNT) system service.
IO$_ACPCONTROL
IO$M_DMOUNTDismounts a volume.
P3The address of the word that is to receive the length of the resultant file
name string (optional).
Table 114 lists FIB fields that control the processing of the
IO$_ACPCONTROL function.
Table 114 IO$_ACPCONTROL and the FIB
Field
Subfields
Meaning
FIB$W_CNTRLFUNC
FIB$L_CNTRLVAL1
FIB$L_ACL_STATUS
FIB$L_STATUS1
1 Not
ACPQIO Interface
1.6 Major Functions
Table 114 (Cont.) IO$_ACPCONTROL and the FIB
Field
Subfields
Meaning
FIB$V_ALT_GRANTED
FIB$L_ALT_ACCESS1
1 Not
Subfields
FIB$W_CNTRLFUNC
Meaning
Several ACP control functions are used for magnetic
tape positioning. These functions are specified
by supplying a FIB with P1 containing the FIB
descriptor address. Modifiers and parameters P2,
P3, and P4 are not allowed. These functions clear
serious exceptions in magnetic tape drivers. The
following control functions can be specified to control
magnetic tape positioning:
FIB$C_REWINDFIL
Rewind to beginning-of-file.
FIB$C_REWINDVOL
FIB$C_POSEND
FIB$C_NEXTVOL
FIB$C_SPACE
FIB$C_CLSEREXCP
ACPQIO Interface
1.6 Major Functions
IO$M_DMOUNT
Remap a file. The file window for the file open on the users
channel is remapped so that it maps the entire file.
FIB$C_LOCK_VOL
FIB$C_UNLK_VOL
Meaning
FIB$C_ENA_QUOTA
FIB$C_DSA_QUOTA
Disable the disk quota file. The quota file is deaccessed and quota
enforcement is turned off. To issue this function, you must have either
a system UIC or SYSPRV privilege, or be the owner of the volume.
ACPQIO Interface
1.6 Major Functions
Table 117 lists the quota control functions that operate on individual entries in
the quota file. Each operation transfers quota file data to and from the ACP using
a quota data block. This block has the same format as a record in the quota file.
Figure 17 shows the format of this block.
Table 117 Disk Quota Functions (Individual Entries)
Value
Meaning
FIB$C_ADD_QUOTA
Add an entry to the disk quota file, using the UIC and quota specified in
the P2 argument block. FIB$C_ADD_QUOTA requires write access to the
quota file.
FIB$C_EXA_QUOTA
Examine a disk quota file entry. The entry whose UIC is specified in the
P2 argument block is returned in the P4 argument block, and its length is
returned in the P3 argument word. Using two flags in FIB$L_CNTRLVAL,
it is possible to search through the quota file using wildcards. The two
flags are:
FIB$V_ALL_MEM
FIB$V_ALL_GRP
Modify a disk quota file entry. The quota file entry specified by the UIC in
the P2 argument block is modified according to the values in the block, as
controlled by the following three flags in FIB$L_CNTRLVAL:
FIB$V_MOD_PERM
FIB$V_MOD_OVER
FIB$V_MOD_USE
The usage data can be changed only if the volume is locked by FIB$C_
LOCK_VOL (see Section 1.6.8.3). FIB$C_MOD_QUOTA requires write
access to the quota file.
The P3 and P4 arguments return the modified quota entry to you.
By using the flags FIB$V_ALL_MEM and FIB$V_ALL_GRP, you can
search through the quota file using wildcards just as you would with the
FIB$C_EXA_QUOTA function.
FIB$C_REM_QUOTA
Remove a disk quota file entry whose UIC is specified in the P2 argument
block. FIB$C_REM_QUOTA requires write access to the quota file.
The P3 and P4 arguments return the removed quota file entry to you.
By using the flags FIB$V_ALL_MEM and FIB$V_ALL_GRP, you can
search through the quota file using wildcards just as you would with the
FIB$C_EXAQUOTA function.
ACPQIO Interface
1.6 Major Functions
Figure 17 Quota File Transfer Block
31
0
Flags Longword (DQF$L_FLAGS)
User Identification Code (DQF$L_UIC)
Current Usage (DQF$L_USAGE)
Permanent Quota (DQF$L_PERMQUOTA)
Overdraft Limit (DQF$L_OVERDRAFT)
(Reserved for Future Use)
ZK0643GE
IO$_ACPCONTROL functions that transfer quota file data between the caller and
the ACP use the following device- or function-dependent arguments:
P2The address of a descriptor for the quota data block being sent to the
ACP.
P4The address of a descriptor for a buffer to receive the quota data block
returned from the ACP.
IOSB
Status
+4
ZK0644GE
ACPQIO Interface
1.7 I/O Status Block
If an extend operation (including CREATE) was performed, IOSB+4 contains
the number of blocks allocated, or the largest available contiguous space if a
contiguous extend operation failed. If a truncate operation was performed,
IOSB+4 contains the number of blocks added to the file size to reach the next
cluster boundary.
2
Disk Drivers
This chapter describes the use of disk drivers that support the disk devices listed
in the Software Product Description for the OpenVMS Operating System for Alpha
and VAX. The chapter also includes descriptions of many of the supported disks
and controllers; however, not all supported devices are described here. Refer to
the Software Product Description for the OpenVMS Operating System for Alpha
and VAX for the definitive list of supported devices.
All disk drivers support Files-11 On-Disk Structure Level 1 and Level 2 file
structures. Access to these file structures is through the DCL commands
INITIALIZE and MOUNT, followed by the RMS calls described in the OpenVMS
Record Management Services Reference Manual. Files in RT-11 format can be
read or written with the file exchange facility EXCHANGE.
Disk Drivers 21
Disk Drivers
2.1 Supported Disk Devices and Controllers
The UDA50 controller corrects bad blocks on the disk by requesting that the disk
class driver revector a failing physical block to another, error-free physical block
on the disk; the logical block number is not changed (see Section 2.2.11.1). Any
bad blocks that might exist on a disk attached to a UDA50 are transparent to the
operating system, which does logical or virtual I/O to such a disk. The UDA50
also corrects most data errors.
22 Disk Drivers
Disk Drivers
2.1 Supported Disk Devices and Controllers
HSC-series controllers allow you to add or subtract disks from the device
configuration without rebooting the system.
Disk Drivers 23
Disk Drivers
2.1 Supported Disk Devices and Controllers
2.1.10 RA80/RB80/RM80 and RA81 Fixed-Media Disks
The R80 disk drive is a high-capacity, moving-head disk whose nonremovable
media consists of 14 data surfaces. Depending on how it is connected to the
system, the R80 is identified internally as an RA80, RB80, or RM80, as follows:
RM80On VAX and Alpha systems, an R80 connected to the system through
a MASSBUS adapter (MBA). Up to eight disk drives can be connected to each
MBA.
The RA81 is a high-capacity disk drive with nonremovable media that can hold
more than 890,000 blocks of data. This translates into more than 455 MB per
spindle. The RA81 is connected to a UDA50 or an HSC50 controller. Up to four
disk drives can be connected to each UDA50. Up to 24 drives can be connected to
each HSC50.
The RA80 and RA81 belong to the DIGITAL Storage Architecture (DSA) family of
disk devices (see Section 2.2.3).
24 Disk Drivers
Disk Drivers
2.1 Supported Disk Devices and Controllers
See Section 2.2.12 for information about using RD series disks on the VAXstation
2000.
Disk Drivers 25
Disk Drivers
2.1 Supported Disk Devices and Controllers
The media for the RRD40 and the RRD50 are removable 4.7-inch (120-mm)
compact discs. However, the media for the RRD40 are enclosed in protective
self-loading carriers. The RRD40 with a SCSI interface is also available as an
embedded unit. The RRD40 and RRD50 Q-bus subsystems are standard disk
MSCP devices.
16 15
Cylinder
8 7
Sector
Track
31
P3:
16 15
Track
0
Sector
26 Disk Drivers
Disk Drivers
2.1 Supported Disk Devices and Controllers
For physical block I/O operations, the track and sector parameters shown in
Figure 21 describe a physical sector (128 bytes in single density; 256 bytes in
double density). The driver does not apply track-to-track skew, cylinder offset, or
sector interleaving to the physical medium address.
Unformatted
Formatted
Standard
1.0 MB
700 KB
High
2.0 MB
1.4 MB
The RX23 is backward compatible in that it can read 1-MB media. It can also
read and write 2.0-MB double-sided, high-density (135 tracks per inch) media.
The RX23 communicates with the controller using the ST506 fixed-disk
interconnect (FDI).
Disk Drivers 27
Disk Drivers
2.1 Supported Disk Devices and Controllers
The TU58 uses two vectors. NUMVEC=2 is required on the CONNECT command
when specifying system parameters.
The TU58 interfaces with the UNIBUS adapter through a DL11-series interface
device. Both the TU58 and the DL11 should be set to 9600 baud. (Because the
TU58 is attached to a DL11, the user cannot directly access the TU58 registers if
the TU58 is on the UNIBUS.) The TU58, which has its own controller, can access
either one or two tape drives.
Multiple controllers of the same type (except RB730), for example, more than
one MBA or RK611 can be used on the system
Multiple disk drives per controller (the exact number depends on the
controller)
Full recovery from power failure for online disk drives with volumes mounted
Extensive error recovery algorithms, such as error code correction and offset
(except RB02, RL02, RX01, RX02, and TU58); for DSA disks, these algorithms
are implemented in the controller
The term dual-pathed refers to the two paths through which clustered CPUs can
access a disk to which they are not directly connected. If one path fails, the disk
is accessed over the other path. (Note that with a dual-ported MASSBUS disk, a
CPU directly connected to the disk always accesses it locally.)
28 Disk Drivers
Disk Drivers
2.2 Driver Features
2.2.2 Dual Porting MASSBUS Disks
The MASSBUS disk drivers, DBDRIVER and DRDRIVER, support static dual
porting. Dual porting allows two MASSBUS controllers to access the same disk
drive. Figure 22 shows this configuration. The RP05, RP06, RP07, RM03,
RM05, and RM80 disk drives can be ordered, or upgraded in the field, with the
MASSBUS dual-port option.
Figure 22 Dual-Ported Disk Drives
VAX
CPU A
VAX
CPU B
Controller
Controller
Disk
Drive
ZK0650GE
Locked on Port AThe drive is in a single-port mode (Port A). It does not
respond to any request on Port B.
Locked on Port BThe drive is in a single-port mode (Port B). It does not
respond to any request on Port A.
The operational condition of the drive cannot be changed with the port select
switches after the drive becomes ready. To change from one mode to another, the
drive must be in a nonrotating condition. After the new mode selection has been
made, the drive must be restarted.
Disk Drivers 29
Disk Drivers
2.2 Driver Features
If a drive is in the neutral state and a disk controller either reads or writes
to a drive register, the drive immediately connects a port to the requesting
controller. For read operations, the drive remains connected for the duration of
the operation. For write operations, the drive remains connected until a release
command is issued by the device driver or a 1-second timeout occurs. After the
connected port is released from its controller, the drive checks the other ports
request flag to determine whether there has been a request on that port. If no
request is pending, the drive returns to the neutral state.
2.2.2.2 Disk Use and Restrictions
If the volume is mounted foreign, read/write operations can be performed at both
ports provided the user maintains control of where information is stored on the
disk.
The Autoconfigure utility currently may not be able to locate the nonactive
port. For example, if a dual-ported disk drive is connected and responding at
Port A, the CPU attached to Port B might not be able to find Port B with the
Autoconfigure utility. If this problem occurs, execute the AUTOCONFIGURE
ALL/LOG command after the system is running.
2.2.2.3 Restriction on Dual-Ported Non-DSA Disks in a Cluster
Do not use SYSGEN to AUTOCONFIGURE or CONFIGURE a dual-ported, nonDSA disk that is already available on the system through use of an MSCP server.
Establishing a local connection to the disk when a remote path is already known
creates two uncoordinated paths to the same disk. Use of these two paths may
corrupt files and data on any volume mounted on the drive.
Note
If the disk is not dual-ported or is never served by an MSCP server on the
remote host, this restriction does not apply.
The port select switch for the drive is not enabled for this host.
The disk, cable, or adapter hardware for the local path is broken.
There is sufficient activity on the other port to hide the existence of the port.
Use of the disk is still possible through the MSCP server path.
After the configuration of the disk has reached this state, it is important not to
add the local path back into the system I/O database. Because the operating
system does not provide an automatic method for adding this local path, the only
possible way that you can add this local path is to use the System Generation
utility (SYSGEN) qualifiers AUTOCONFIGURE or CONFIGURE to configure the
Disk Drivers
2.2 Driver Features
device. SYSGEN is currently not able to detect the presence of the disks MSCP
path, and will incorrectly build a second set of data structures to describe it.
Subsequent events could lead to incompatible and uncoordinated file operations,
which might corrupt the volume.
To recover the local path to the disk, it is necessary to reboot the system
connected to that local path.
However, because a DSA disk can be on line to only one controller at a time,
only one of the CPUs can use its local connection to the disk. The second CPU
accesses the disk through the MSCP server. If the CPU that is currently serving
the disk fails, the other CPU detects the failure and fails the disk over to its local
connection. The disk is thereby made available to the cluster once more.
Note
A dual-ported DSA disk may not be used as a system disk.
Disk Drivers
2.2 Driver Features
If either CPU fails, satellites can access their disks through the remaining CPU.
Note that failover occurs in the following situations: ( 1 ) when the DSSI bus is
connected between SII integral adapters on both MicroVAX 3300/3400 CPUs or
( 2 ) when the DSSI bus is connected between the KFQSA adapters on pairs of
MicroVAX 3300/3400s or pairs of MicroVAX 3800/3900s.
Note
The DSSI bus should not be connected between a KFQSA adapter on one
CPU and an SII integral adapter on another.
Per volumeYou can specify the characteristics data check all reads and
data check all writes when the volume is mounted. The OpenVMS DCL
Dictionary describes volume mounting and dismounting. The OpenVMS
System Services Reference Manual describes the Mount Volume ($MOUNT)
and Dismount Volume ($DISMOU) system services.
Per fileYou can specify the file access attributes data check on read and
data check on write. File access attributes are specified when the file is
accessed. Chapter 1 of this manual and the OpenVMS Record Management
Services Reference Manual describe file access.
Offset recovery is performed during a data check, but error code correction (ECC)
is not performed (see Section 2.2.9). For example, if a read operation is performed
and an ECC correction is applied, the data check would fail even though the data
in memory is correct. In this case, the driver returns a status code indicating
that the operation was completed successfully, but the data check could not be
performed because of an ECC correction.
Data checks on read operations are extremely rare, and you can either accept
the data as is, treat the ECC correction as an error, or accept the data but
immediately move it to another area on the disk volume.
A data check operation directed to a TU58 does not compare the data in memory
with the data on tape. Instead, either a read check or a write check operation is
performed (see Sections 2.4.1 and 2.4.2).
Disk Drivers
2.2 Driver Features
2.2.7 Effects of a Failure During an I/O Write Operation
The operating system ensures that when an I/O write operation returns a
successful completion status, the data is available on the disk or tape media.
Applications that must guarantee the successful completion of a write operation
can verify that the data is on the media by specifying the data check function
modifier IO$M_DATACHECK. Note that the IO$M_DATACHECK data check
function, which compares the data in memory with the data on disk, affects
performance because the function incurs the overhead of an additional read
operation to the media.
If a system failure occurs while a multiple-block write operation is in progress,
the operating system does not guarantee the successful completion of the write
operation. (OpenVMS does guarantee single-block write operations to DSA
drives.) When a failure interrupts a write operation, the data may be left in any
one of the following conditions:
The new data is written completely to the disk blocks on the media, but a
completion status was not returned before the failure.
The new data is partially written to the media so that some of the disk blocks
involved in the I/O contain the data from the write operation in progress,
and the remainder of the blocks contain the data that was present before the
write operation.
The new data was never written to the disk blocks on the media.
To guarantee that a write operation either finishes successfully or (in the event
of failure) is redone or rolled back as if it were never started, use additional
techniques to ensure data correctness and recovery. For example, using database
journaling and recovery techniques allows applications to recover automatically
from failures such as the following:
Permanent loss of the path between a CPU data buffer containing the data
being written and the disk being written to during a multiple-block I/O
operation. Communication path loss can occur due to node or controller
failure or a failure of node-to-node communications.
Disk Drivers
2.2 Driver Features
During the seek operation, the controller is free to perform transfers on other
units. Therefore, seek operations can also overlap data transfer operations. For
example, at any one time, seven seeks and one data transfer could be in progress
on a single controller.
This overlapping is possible because, unlike I/O transfers, seek operations do
not require the controller once they are initiated. Therefore, seeks are initiated
before I/O transfers and other functions that require the controller for extended
periods.
All DSA controllers perform extensive seek optimization functions as part of their
operation; IO$M_INHSEEK has no effect on these controllers.
Retrying nonfatal controller and drive errors. For DSA and SCSI disks, this
function is implemented by the controller.
Applying error correction information (not applicable for RB02, RL02, RX01,
RX02, and TU58 drives). For DSA and SCSI disks, error correction is
implemented by the controller.
The error recovery algorithm uses a combination of these four types of error
recovery operations to complete an I/O operation:
Power failure recovery consists of waiting for mounted drives to spin up and
come on line, followed by reexecution of the I/O operation that was in progress
at the time of the power failure.
Disk Drivers
2.2 Driver Features
You can detect bad blocks when a disk is formatted. Most formatters place these
blocks in a bad block file. On an R80 drive, the first bad block encountered on a
track is designated as a skip sector. This is accomplished by setting a flag in the
sector header on the disk and placing the block in the skip sector file.
When a skip sector is encountered during a data transfer, it is skipped over, and
all remaining blocks in the track are shifted by one physical block. For example,
if block number 10 is a skip sector, and a transfer request was made beginning at
block 8 for four blocks, then blocks 8, 9, 11, and 12 will be transferred. Block 10
will be skipped.
Because skip sectors are implemented at the device driver level, they are not
visible to you. The device appears to have 31 contiguous sectors per track. Sector
32 is not directly addressable, although it is accessed if a skip sector is present on
the track.
Disk Drivers
2.2 Driver Features
4. Adjust the cylinder number to cylinder 1 (cylinder 0 is not used):
ICYL = ICYL+1
Because the operating system supports all DSA disks, it supports all controllerto-host aspects of DSA. Some of these disks, such as the RA60, RA80, and RA81,
use the standard drive-to-controller specifications. Other disks, such as the RC25,
RD51, RD52, RD53, and RX50, do not. Disk systems that use the standard
drive-to-controller specifications employ the same hardware connections and use
the HSC50, KDA50, KDB50, and UDA50 interchangeably. Disk systems that do
not use the drive-to-controller specifications provide their own internal controller,
which conforms to the controller-to-host specifications.
DSA disks differ from MASSBUS and UNIBUS disks in the following ways:
DSA disks contain no bad blocks. The hardware and the disk class driver
(DUDRIVER) function to ensure a logically contiguous range of good blocks.
If any block in the user area of the disk develops a defective area, all further
access to that block is revectored to a spare good block. Consequently, it is
never necessary to run the Bad Block Locator utility (BAD) on DSA disks.
There is no manufacturers bad block list and the file BADBLK.SYS is empty.
(The Verify utility, which is invoked by the ANALYZE /DISK_STRUCTURE
/READ_CHECK command, can be used to check the integrity of newly
received disks.) See Section 2.2.11.1 for more information about bad block
replacement for DSA disks.
The DUDRIVER and the DSA device controllers allow multiple, concurrently
outstanding QIO requests. The order in which these requests complete might
not be in the order in which they were issued.
All DSA disks can be dual-ported, but only one HSC/UDA controller can
control a disk at a time (see Section 2.2.3).
In many cases, you can attach a DSA disk to its controller on a running
system and then use it without manual intervention.
DSA disks and the DUDRIVER do not accept physical QIO data transfers or
seek operations.
Disk Drivers
2.2 Driver Features
2.2.11.1 Bad Block Replacement and Forced Errors for DSA Disks
Disks that are built according to the DSA specifications appear to be error free.
Some number of logical blocks are always capable of recording data. When a
disk is formatted, every user-addressable logical block is mapped to a functioning
portion of the actual disk surface, which is known as a physical block. The
physical block has the true data storage capacity represented by the logical block.
Additional physical blocks are set aside to replace blocks that fail during normal
disk operations. These extra physical blocks are called replacement blocks.
Whenever a physical block to which a logical block is mapped begins to fail, the
associated logical block is remapped (revectored) to one of the replacement blocks.
The process that revectors logical blocks is called a bad block replacement
operation. Bad block replacement operations use data stored in a special area of
the disk called the Replacement and Caching Table (RCT).
When a drive-dependent error threshold is reached, the need for a bad block
replacement operation is declared. Depending on the controller involved, the bad
block replacement operation is performed either by the controller itself (as is the
case with HSCs) or by the host (as is the case with UDAs). In either case, the
same steps are performed. After inspecting and altering the RCT, the failing
block is read and its contents are stored in a reserved section of the RCT.
The design goal of DSA disks is that this read operation proceeds without error
and that the RCT copy of the data is correct (as it was originally written). The
failing block is then tested with one or more data patterns. If no errors are
encountered in this test, the original data is copied back to the original block
and no further action is taken. If the data-pattern test fails, the logical block is
revectored to a replacement block. After the block is revectored, the original data
is copied back to the revectored logical block. In all these cases, the original data
is preserved and the bad block replacement operation occurs without the user
being aware that it happened.
However, if the original data cannot be read from the failing block, a best-attempt
copy of the data is stored in the RCT and the bad block replacement operation
proceeds. When the time comes to write-back the original data, the best-attempt
data (stored in the RCT) is written back with the forced error flag set. The
forced error flag is a signal that the data read is questionable. Reading a block
that contains a forced error flag causes the status SS$_FORCEDERROR to be
returned. This status is displayed by the following message:
%SYSTEM-F-FORCEDERROR, forced error flagged in last sector read
Writing into a block always clears the forced error flag.
Note that most utilities and DCL commands treat the forced error flag as a fatal
error and terminate operation when they encounter it. However, the Backup
utility (BACKUP) continues to operate in the presence of most errors, including
the forced error. BACKUP continues to process the file, and the forced error flag
is lost. Thus, data that was formerly marked as questionable may become correct
data.
System managers (and other users of BACKUP) should assume that forced errors
reported by BACKUP signal possible degradation of the data.
To determine what, if any, blocks on a given disk volume have the forced error flag
set, use the ANALYZE /DISK_STRUCTURE /READ_CHECK command, which
invokes the Verify utility. The Verify utility reads every logical block allocated
to every file on the disk and then reports (but ignores) any forced error blocks
encountered.
Disk Drivers 217
Disk Drivers
2.2 Driver Features
2.2.12 VAXstation 2000 and MicroVAX 2000 Disk Driver
The VAXstation 2000 and MicroVAX 2000 disk driver supports some DSA disk
operation. In particular, the driver supports block revectoring and bad block
replacement. This provides the system with a logically perfect disk medium.
Like other DSA disks, if a serious error occurs during a replacement operation,
the disk is write-locked to prevent further changes. This is done to preserve data
integrity and minimize damage that could be caused by failing hardware. Unlike
other DSA disks, there is no visible indication on the drive itself that the disk is
write-locked. However, the following indicators help you determine that the disk
has become write-protected:
DCL command SHOW DEVICE output shows that the disk is write-locked.
Error messages occur from programs and utilities attempting to write to the
disk.
If the disk becomes write-locked, you should use the following procedure:
1. Shut down the system.
2. Use standalone BACKUP to create a full backup of the disk.
3. Format the disk with the disk formatter.
4. Restore the disk from the backup using standalone BACKUP. Note that any
files with sectors flagged with a forced error may be corrupted and may need
to be restored from a previous backup.
If errors occurring during replacement operations persist, call Compaq Customer
Services.
Disk Drivers
2.2 Driver Features
2.2.14 Audio Extensions to the SCSI Disk Class Driver
This section describes SCSI disk class driver audio commands and the $QIO
interface by which the operating system provides audio functionality to the SCSI
disk.
Table 21 lists the SCSI audio commands supported by the SCSI disk class
driver.
Table 21 SCSI Disk Class Driver Audio Commands
Command
Description
AUDIO_PLAY_AUDIO_MSF (5)
AUDIO_PLAY_AUDIO_TRACK
(6)
Play Audio
AUDIO_PLAY_AUDIO (4)
Pause
AUDIO_PAUSE (0)
Resume
AUDIO_RESUME (1)
Get Status
AUDIO_GET_STATUS (9)
Set Volume
AUDIO_SET_VOLUME (11)
Get Volume
AUDIO_GET_VOLUME (12)
Prevent Removal
AUDIO_PREVENT_REMOVAL
(2)
1 Symbolic values for the function codes of SCSI audio commands are defined in SYS$EXAMPLES:CDVERIFY.C. Numeric
values appear within parentheses in this table column.
Disk Drivers
2.2 Driver Features
Table 21 (Cont.) SCSI Disk Class Driver Audio Commands
Command
Description
Allow Removal
AUDIO_ALLOW_REMOVAL (3)
Get TOC
AUDIO_GET_TOC (10)
1 Symbolic values for the function codes of SCSI audio commands are defined in SYS$EXAMPLES:CDVERIFY.C. Numeric
values appear within parentheses in this table column.
2.2.14.1 $QIO Interface to Audio Functionality of the SCSI Disk Class Driver
To employ the audio functions of the RRD42 CD-ROM reader, the application
program issues a call to the $QIO system service using the following format:
status=SYS$QIO ([efn] ,[chan] ,func [,iosb] [,astadr] [,astprm]
[,p1] [,p2] [,p3] [,p4] [,p5] [,p6])
Arguments
[efn]
[chan]
[iosb]
[astadr]
[astprm]
These arguments apply to the $QIO system service completion, not to device
interrupt actions. For an explanation of these arguments, refer to the description
of the $QIO system service in the OpenVMS System Services Reference Manual.
func
The IO$_AUDIO function code allows the SCSI disk class driver to process SCSI
audio commands.
p1
Address of an audio control block (AUCB). The $QIO system service passes a
SCSI audio command and command-specific control information to the SCSI disk
class driver in the AUCB structure (see Section 2.2.14.2).
p2
Size of the AUCB.
2.2.14.2 Defining an Audio Control Block (AUCB)
An application program that issues a call to the $QIO system service that
specifies the IO$_AUDIO function code in the func argument must supply
the address of an AUCB structure in the p1 argument and its size in the p2
argument.
An AUCB defines a specific SCSI audio command and provides the SCSI disk
class driver with command-specific arguments and control information. Table 22
defines the fields that appear in an AUCB; these fields are shown in Figure 23.
See SYS$EXAMPLES:CDROM_AUDIO.C for a code example that shows how an
AUCB is defined in the C programming language.
Disk Drivers
2.2 Driver Features
Figure 23 Audio Control Block (AUCB)
AUCB Version Number
Argument 1
Argument 2
Argument 3
12
Reserved
16
20
24
28
32
36
40
44
48
Reserved
52
ZK4625A
Use
Audio Function
Code
AUCB Version
Number
Version of the AUCB and SCSI disk class driver audio interface.
For the current version of the interface the value of this field should
be 1. This field must never contain a zero.
Argument 1
1 For
Field Contents
AUDIO_PLAY_
AUDIO_MSF (5)
AUDIO_PLAY_
AUDIO_TRACK (6)
AUDIO_PLAY_AUDIO
(4)
AUDIO_GET_STATUS
(9)
any function code not listed in this table, this field contains a zero.
Disk Drivers
2.2 Driver Features
Table 22 (Cont.) Contents of AUCB
Field
Argument 2
Use
AUDIO_SET_
VOLUME (11)
AUDIO_GET_
VOLUME (12)
AUDIO_GET_TOC
(10)
Field Contents
AUDIO_PLAY_
AUDIO_MSF (5)
AUDIO_PLAY_
AUDIO_TRACK (6)
AUDIO_PLAY_AUDIO
(4)
AUDIO_GET_TOC
(10)
Starting track
Reserved
Must be zero.
Destination Buffer
Address
Destination Buffer
Count
1 For
any function code not listed in this table, this field contains a zero.
Disk Drivers
2.2 Driver Features
Table 22 (Cont.) Contents of AUCB
Field
Use
Destination Buffer
Transfer Count
The SCSI disk class driver returns to this field the actual number
of bytes transferred to the buffer specified in the Destination Buffer
Address field.
Before accessing data returned by the GET_TOC or GET_STATUS
commands, an application program must check the contents of this
field to determine precisely how many bytes were returned by the
CD-ROM.
The application program initializes this field to zero.
Operating System
Command Status
SCSI Command
Status (optional)
SCSI status of the current operation. The SCSI disk class driver
returns the SCSI status byte for the SCSI audio command described
by this AUCB in the low byte of the low-order word of this field. It
returns the sense key in the low byte of the high-order word. Refer
to the SCSI specification for information regarding SCSI status and
SCSI sense keys.
The application program initializes this field to zero.
Address of buffer to which the SCSI disk class driver returns sense
data when errors occur during audio function execution. When
this field is specified, in the event of a check condition on an Audio
command, the SCSI disk class driver automatically issues a Request
Sense command to retrieve the Sense Key/Sense Data from the
target. The target returns this data to the buffer specified in this
field before the failing $QIO audio function completes.
Reserved
Must be zero.
The output channel selection and volume settings for CD-ROM ports as used by
the SET_VOLUME function appear as shown in Figure 24.
2.2.14.3 Error Handling in Applications Using SCSI Audio Functions
As indicated in Table 22, the AUCB provides for three levels of error status
reporting:
Disk Drivers
2.2 Driver Features
Figure 24 Output Channel Selection and Volume Settings for CD-ROM Ports
as Used by the SET_VOLUME Function
31
23
volume
output selection
Port 1 or 3
15
7
volume
output selection
Port 0 or 2
volume = 00 (muted) to FF
(maximum)
output selection <7:4> = 0
output selection <3:0> = 0000 (output muted on this channel)
0001 (connect audio channel 0 to this output port)
0010 (connect audio channel 1 to this output port)
0011 (connect audio channels 0 and 1 to this port)
ZK4626A
SCSI command status, returned in the SCSI Command Status field of the
AUCB. The SCSI disk class driver returns to this field SCSI status as well as
the sense key in the event of a check condition SCSI status. The sense key
can be used to determine the first level of error reporting supported by SCSI.
See the SCSI specification for further information.
Sense data, returned in the buffer specified in the Sense Data Buffer Address
field of the AUCB. Sense data bytes are assigned as defined in the SCSI II
specification. Sophisticated programmers can use the data in this to obtain
detailed information about the error-causing condition.
If the CD-ROM device is currently software-enabled (that is, the volume has
been mounted) and a unit attention is detected, then mount verification will
be initiated by the driver. However, if the CD-ROM is not software-enabled,
the event will simply be returned to the application issuing the Audio $QIO
function.
Disk Drivers
2.2 Driver Features
Table 23 Status Codes Returned to the IOSB and AUCB by the SCSI Disk
Class Driver
SS$_NORMAL
SS$_ABORT
SS$_BADPARM
SS$_CTRLERR
SS$_DEVOFFLINE
SS$_DRVERR
SS$_ILLIOFUNC
SS$_IVADDR
SS$_MEDOFL
SS$_NOPRIV
SS$_OPINCOMPL
SS$_PARITY
SS$_RECOVERR
SS$_VOLINV
SS$_WRITLCK
Disk Drivers
2.2 Driver Features
tracks (and, therefore, which logical blocks) contain data and which contain audio
information.
2.2.14.5 Programming Audio Applications
The following list contains information useful in avoiding problems when writing
code using the SCSI audio interfaces:
If you do not know the type of file system on the CD-ROM, you should mount
the CD-ROM as foreign and issue a $QIO request with the logical block I/O
read function (IO$_READLBLK) to read individual data blocks. The default
block size for all CD-ROMs is 512 bytes.
Before attempting to issue a $QIO request with the virtual block I/O read
function (IO$_READVBLK) to the CD-ROM, ensure that the CD-ROM has
been mounted. Typically, you have to foreign mount non-Files-11 disks. If an
IO$_READVBLK $QIO request is issued to an unmounted CD, the request
fails with a status of SS$_NOPRIV.
2.2.14.6 Application Program Example Using SCSI Audio Capabilities (VAX only)
The file SYS$EXAMPLES:CDROM_AUDIO.C contains an example of an
application program that performs the following tasks:
Defines standard symbolic names for the audio function codes representing
SCSI audio commands.
Defines representative AUCBs for each audio function code supported by the
SCSI disk class driver.
Issues a series of $QIO system service requests, each specifying the IO$_
AUDIO function, that exercise the SCSI disk class driver to test its support
for CD-ROM drives with audio capabilities.
Disk Drivers
2.3 Disk Driver Device Information
Table 24 Disk Device Characteristics
Characteristic1
Meaning
Dynamic Bits (Conditionally Set)
DEV$M_AVL
DEV$M_CDP
2;3
DEV$M_CLU
DEV$M_2P
Device is dual-pathed.
DEV$M_FOR
Device is foreign.
DEV$M_MNT
Volume is mounted.
DEV$M_RCK
DEV$M_WCK
DEV$M_MSCP2
DEV$M_RCT
DEV$M_SRV
DEV$M_FOD
Device is file-oriented.
DEV$M_IDV
DEV$M_ODV
DEV$M_RND
DEV$M_SHR
Device is shareable.
1 Defined
2 These
3 MASSBUS
only.
DVI$_DEVBUFSIZ returns the buffer size. The buffer size is the default to be
used for disk transfers (this default is normally 512 bytes). DVI$_DEVTYPE and
DVI$_DEVCLASS return the device type and class names, which are defined by
the $DCDEF macro. The disk model determines the device type. For example,
the device type for the RA81 is DT$_RA81. (Foreign device types take the form
DT$_FD1 through DT$_FD8.) The device class for disks is DC$_DISK.
DVI$_CYLINDERS returns the number of cylinders per volume (that is, per
disk), DVI$_TRACKS returns the number of tracks per cylinder, and
DVI$_SECTORS returns the number of sectors per track. Values are returned as
4-byte decimal numbers.
DVI$_MAXBLOCK returns the maximum number of blocks (1 block = 512 bytes)
that can be contained on the volume (that is, on the disk). Values are returned as
4-byte decimal numbers. This information can be used, for example, to determine
the density of an RX02 diskette (single density = 494 blocks, double density = 988
blocks).
Disk Drivers
2.4 Disk Function Codes
Virtual I/O functions require an ACP for Files-11 On-Disk Structure Level 1 files
or an XQP for Files-11 On-Disk Structure Level 2 files. Virtual I/O functions
must be executed in a prescribed order. First, you create and access a file, then
you write information to that file, and lastly you deaccess the file. Subsequently,
when you access the file, you read the information and then deaccess the file.
Delete the file when the information is no longer useful.
Non-DSA disk devices can read or write up to 65,535 bytes in a single request.
DSA devices connected to an HSC50 can transfer up to 4 billion bytes in a single
request. In all cases, the maximum size of the transfer is limited by the number
of pages that can be faulted into the process working set, and then locked into
physical memory. (The disk driver is responsible for any memory management
functions of this type.) The size of the transfer does not affect the applicable
quotas (direct I/O count, buffered I/O count, and asynchronous system trap (AST)
count limit). These quotas refer to the number of outstanding I/O operations of
each type, not the size of the I/O operation being performed.
The volume to which a logical or virtual function is directed must be mounted
for the function actually to be executed. If it is not mounted, either a device not
mounted or invalid volume status is returned in the I/O status block.
Table 25 lists the logical, virtual, and physical disk I/O functions and their
function codes. Chapter 1 describes the QIO level interface to the disk device
ACP.
Disk Drivers
2.4 Disk Function Codes
Table 25 Disk I/O Functions
Function
Modifiers
Function Code
Arguments
Type1
IO$_ACCESS
P1, [P2],[P3],[P4],[P5]
IO$M_CREATE
IO$M_ACCESS
Search a
directory for
a specified file
and access the
file if found.
IO$_ACPCONTROL
P1,[P2],[P3],[P4],[P5]
IO$M_DMOUNT
Perform
miscellaneous
control
functions.
IO$_AVAILABLE
Function
Clear volume
valid; make DSA
units available.
IO$_CREATE
P1,[P2],[P3],[P4],[P5]
IO$_DEACCESS
P1,[P2],[P3],[P4],[P5]
IO$_DELETE
P1,[P2],[P3],[P4],[P5]
IO$_FORMAT
P1
Set density
(RX02 only).
IO$_MODIFY
P1,[P2],[P3],[P4],[P5]
Update UCB
fields if RX02;
initialize volume
valid on other
devices. Bring
DSA units on
line.
IO$_PACKACK
IO$M_CREATE
IO$M_ACCESS
IO$M_DELETE
Create a
directory entry
or a file.
Deaccess a file
and, if specified,
write final
attributes in
the file header.
IO$M_DELETE
Remove a
directory entry
or file header, or
both.
IO$_READLBLK6
P1,P2,P3
IO$M_DATACHECK2
IO$M_INHRETRY
Read logical
block.
IO$_READPBLK6
P1,P2,P3
IO$M_DATACHECK2
IO$M_INHRETRY
IO$M_INHSEEK3
Read physical
block.5
IO$_READVBLK6
P1,P2,P3
IO$M_DATACHECK2
IO$M_INHRETRY
Read virtual
block.
1V
2 Not
3 Not
5 Not
6 On
Disk Drivers
2.4 Disk Function Codes
Table 25 (Cont.) Disk I/O Functions
Function
Modifiers
Function Code
Arguments
Type1
IO$_SEARCH
P1
Search for
specified block or
sector (only for
TU58).
IO$_SEEK
P1
Seek to specified
cylinder.5
IO$_SENSECHAR
Sense the
devicedependent
characteristics
and return them
in the I/O status
block.
IO$_SENSEMODE
Sense the
devicedependent
characteristics
and return them
in the I/O status
block.
IO$_SETPRFPATH
P1
IO$_UNLOAD
IO$M_FORCEPTH
Function
Specifies a
preferred path
for DSA disks.
Clear volume
valid; make DSA
units available
and spin down
the volume.
Verify data
written to disk
by a previous
write QIO.2
IO$_WRITECHECK6
P1,P2,P3
IO$_WRITELBLK6
P1,P2,P3
IO$M_DATACHECK2
IO$M_ERASE
IO$M_INHRETRY
Write logical
block.
IO$_WRITEPBLK6
P1,P2,P3
IO$M_DATACHECK2
IO$M_ERASE
IO$M_INHRETRY
IO$M_INHSEEK3
IO$M_DELDATA4
Write physical
block.5
IO$_WRITEVBLK6
P1,P2,P3
IO$M_DATACHECK2
IO$M_ERASE
IO$M_INHRETRY
Write virtual
block.
1V
2 Not
3 Not
4 RX02
only.
5 Not
Disk Drivers
2.4 Disk Function Codes
P2The address of the file name string descriptor (optional). If specified, the
name is entered in the directory specified by the FIB.
P3The address of the word that is to receive the length of the resulting file
name string (optional).
P1The starting virtual address of the buffer that is to receive the data from
a read operation; or, in the case of a write operation, the virtual address of
the buffer that is to be written on the disk. On OpenVMS Alpha, P1 can be a
64-bit address.
P2The number of bytes that are to be read from the disk, or written from
memory to the disk. An even number must be specified if the controller is an
RK611, RL11, RX211, or UDA50.
P1The starting virtual address of the buffer that contains a 4-byte, userspecified erase pattern. If the P1 address is 0, a longword of 0 will be used
for the erase pattern. If the P1 address is nonzero, the contents of the 4
bytes starting at that address will be used as the erase pattern. Compaq
recommends that the user specify a P1 address of 0 to lower system overhead.
On OpenVMS Alpha, P1 can be a 64-bit address.
Note
DSA disk controllers provide controlled, assisted erasing for the IO$M_
ERASE modifier (with virtual and logical write functions) only when the
erase pattern is all zeros. If a nonzero erase pattern is used, there is a
significant performance degradation with these disks. DSA disks do not
accept physical QIO transfers.
Disk Drivers
2.4 Disk Function Codes
P2The number of bytes of erase pattern to write to the disk. The number
specified is rounded up to the next highest block boundary (512 bytes).
P1The starting virtual address of the buffer that is to receive the data in
a read operation; or, in a write operation, the starting virtual address of the
buffer that is to be written on the disk. Passed by reference. On OpenVMS
Alpha, P1 can be a 64-bit address.
P2The number of bytes that are to be read from the disk, or written from
memory to the disk. Passed by value. An even number must be specified if
the controller is an RK611, RL11, or UDA50.
16 15
Cylinder
8 7
0
Sector
Track
16 15
31
P3:
Track
0
Sector
Disk Drivers
2.4 Disk Function Codes
Figure 26 Physical Cylinder Number Format
31
16 15
Not Used
0
Cylinder
ZK0653GE
2.4.1 Read
The read function reads data into a specified buffer from disk starting at a
specified disk address.
The operating system provides the following read function codes:
SS$_DRVERR
SS$_NONEXDRV
SS$_NORMAL
SS$_MEDOFL
Disk Drivers
2.4 Disk Function Codes
2.4.2 Write
The write function writes data from a specified buffer to disk starting at a
specified disk address.
The operating system provides the following write function codes:
Disk Drivers
2.4 Disk Function Codes
2.4.3 Sense Mode
Sense mode operations obtain current disk device-dependent characteristics that
are returned to the caller in the second longword of the I/O status block (see
Figure 28). The operating system provides the following function codes:
IO$_SENSEMODESense characteristics
IO$_SENSECHARSense characteristics
2.4.5 Search
The search function positions a TU58 magnetic tape to the block specified. Search
is a physical I/O function and requires the access privilege necessary to perform
physical I/O. The operating system provides a single function code:
IO$_SEARCH
This function code takes the following function-dependent argument:
P1Specifies 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. For example,
nearly 30 seconds are required to completely rewind a tape. If the last read or
write operation is near the end of the tape and the next operation is near the
beginning of the tape, the search operation can begin after the last operation
completes, and the tape will rewind while the process is otherwise occupied. (The
search QIO is not completed until the search is completed. Consequently, if a
$QIOW system service request is issued, the process will be held up until the
search is completed.)
Disk Drivers
2.4 Disk Function Codes
2.4.6 Pack Acknowledge
The pack acknowledge function sets the volume valid bit for all disk devices.
Pack acknowledge is a physical I/O function and requires the access privilege
to perform physical I/O. If directed to an RX02 disk, pack acknowledge also
determines the diskette density and updates the device-dependent information
returned by $GETDVI item codes DVI$_CYLINDERS, DVI$_TRACKS, DVI$_
SECTORS, DVI$_DEVTYPE, DVI$_CLASS, and DVI$_MAXBLOCK. If directed
to a DSA disk, pack acknowledge also sends the online packet to the controller.
The following function code is 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 is issued automatically
when the DCL commands INITIALIZE or MOUNT are issued.
For DSA disks, the IO$_PACKACK function locks the drives port selector on the
port that initiated the pack acknowledge function.
In addition, the IO$_PACKACK function updates device-dependent information
about DSA disks returned by $GETDVI.
2.4.7 Unload
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 function performed by pack
acknowledge (see Section 2.4.6). The following function code is provided:
IO$_UNLOAD
This function takes no function-dependent arguments.
2.4.8 Available
The available function clears the volume valid bit for all disk drives; that is, it
reverses the function performed by pack acknowledge (see Section 2.4.6). No
unload function is issued to the drive; therefore, those drives capable of spinning
down do not spin down. The following function code is provided:
IO$_AVAILABLE
This function takes no function-dependent arguments.
2.4.9 Seek
The seek function directs the read/write heads to move to the cylinder specified in
the P1 argument (see Sections 2.2.8 and 2.4, and Figure 26).
Disk Drivers
2.4 Disk Function Codes
A write QIO must be used to write data to disk before you enter this command.
IO$_WRITECHECK then reads the same block of data and compares it with the
data in the specified buffer. Three function-dependent arguments are used with
this code: P1, P2, and P3. These arguments are described in Section 2.4.
IO$_WRITECHECK is similar to the IO$M_DATACHECK function modifier for
write 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 with IO$_WRITEVBLK (which does
not require access privilege) to determine whether data is written correctly. The
RX01 and RX02 drivers do not support the write check function.
The write check function and the data check function modifier to a TU58 can
return six error codes in the I/O status block: SS$_NORMAL,
SS$_CTRLERR, SS$_DRVERR, SS$_MEDOFL, SS$_NONEXDRV, and
SS$_WRTLCK.
.ascid /$254$DUA48:/
chnl:
.word
node:
.ascic /HSC001/
.entry start,0
Disk Drivers
2.4 Disk Function Codes
$assign_s
blbc
devnam=dev,chan=chnl
r0,done
$qiow_s
chan=chnl,func=#IO$_SETPRFPATH,p1=node
done:
$exit_s r0
.end start
This updates the local node I/O database to indicate that node HSC001 is the
preferred path for DUA48.
2.4.11.1 Forcing a Path Change
You can move a disk that is already mounted to its preferred path by specifying
the IO$M_FORCEPATH modifier. If a preferred path has not been specified for a
disk that is accessed through the MSCP server, the IO$M_FORCEPATH function
causes the disk class driver to use load-balancing information to select the server
path with the highest-load-available rating.
IO$M_FORCEPATH does not accept any arguments. If you intend to move a disk
to its preferred path, you must specify the preferred path in a separate $QIO
function.
The following example shows use of the IO$M_FORCEPATH function modifier:
$assigndef
$qiodef
$iodef
$exitdef
dev:
.ascid /$254$DUA197:/
chnl:
.word
.entry start,0
$assign_s
blbc
devnam=dev,chan=chnl
r0,done
$qiow_s
chan=chnl,func=#<IO$_SETPRFPATH!IO$M_FORCEPATH>
done:
$exit_s r0
.end
start
Note that forcing a path change places the disk in mount verification. New I/O
requests are suspended until mount verification is complete.
2.4.11.2 Using IO$_SETPRFPATH with Disks Dual-Pathed Between HSCs
You can use the IO$_SETPRFPATH and IO$M_FORCEPATH functions to load
balance disks that are dual-pathed between HSCs. The IO$M_FORCEPATH
function initiates failover of the disk on all nodes that have it mounted and
that have a direct path to the HSCs. Because the node that issues the IO$M_
FORCEPATH might not be the first one to attempt failover of the disk, it is
essential that all nodes with direct connections to the HSCs specify the same
preferred path for the disk. Only one node should issue the IO$M_FORCEPATH
request.
Disk Drivers
2.4 Disk Function Codes
2.4.11.3 Using IO$_SETPRFPATH with Disks Dual-Pathed Between Systems
You can use IO$M_FORCEPATH to load balance RA-series disks that are dualpathed between systems running the MSCP server. Both serving nodes should
specify the same preferred path. To move the disk between systems, the system
that currently has the disk on line through its local controller should issue the
IO$M_FORCEPATH request. The disk must be mounted on both serving nodes.
2.4.11.4 Using IO$_SETPRFPATH with Disks Accessed Through MSCP Servers
You can specify a preferred path for disks that are accessed through MSCP
servers; however, this specification overrides any load-balancing decisions.
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 always preferred to
server paths.
Using IO$M_FORCEPATH without a preferred path causes the disk class driver
to move the disk to the server with the highest available capacity.
2.4.11.5 Using IO$_SETPRFPATH with Phase I Volume Shadowing
You can specify IO$_SETPRFPATH for shadow set members, but not for virtual
units. IO$M_FORCEPATH is not supported for shadow set members or virtual
units.
2.4.11.6 Using IO$_SETPRFPATH with Phase II Volume Shadowing
IO$_SETPRFPATH and IO$M_FORCEPATH are supported for shadow set
members but not for virtual units.
16 15
Byte Count
(LowOrder Word)
Status
Byte Count
(HighOrder Word)
ZK0656GE
The byte count is a 32-bit integer that gives the actual number of bytes
transferred to or from the process buffer.
Disk Drivers
2.5 I/O Status Block
Figure 28 IOSB Contents for the Sense Mode Function
31
16 15
8 7
Status
Cylinders
Tracks
Sectors
ZK0657GE
The second longword of the I/O status block for the sense mode function returns
information about the cylinder, track, and sector configurations for the particular
device.
;
; Local storage
;
; Define number of records to be processed.
;
NUM_RECS=100
Disk Drivers
2.6 Disk Driver Programming Example
Example 21 (Cont.) DISK_DRIVER.MAR Disk Driver Programming Example
;
; Allocate storage for necessary data structures.
;
; Allocate File Access Block.
;
;
A file access block is required by RMS-32 to open and close a
;
file.
;
FAB_BLOCK:
;
$FAB
ALQ = 100,;Initial file size is to be
;100 blocks
FAC = PUT,;File Access Type is output
FNA = FILE_NAME,;File name string address
FNS = FILE_SIZE,;File name string size
FOP = CTG,;File is to be contiguous
MRS = 512,;Maximum record size is 512
;bytes
NAM = NAM_BLOCK,;File name block address
ORG = SEQ,;File organization is to be
;sequential
REM = FIX
;Record format is fixed length
;
; Allocate file information block.
;
;
A file information block is required as an argument in the
;
Queue I/O system service call that accesses a file.
;
FIB_BLOCK:
;
.BLKB FIB$K_LENGTH
;
;
; Allocate file information block descriptor.
;
FIB_DESCR:
.LONG
.LONG
FIB$K_LENGTH
FIB_BLOCK
;
;Length of the file
;information block
;Address of the file
;information block
;
; Allocate File Name Block
;
;
A file name block is required by RMS-32 to return information
;
concerning a file (for example, the resultant file name string
;
after logical name translation and defaults have been applied).
;
NAM_BLOCK:
$NAM
;
;
(continued on next page)
Disk Drivers
2.6 Disk Driver Programming Example
Example 21 (Cont.) DISK_DRIVER.MAR Disk Driver Programming Example
;
; Allocate Record Access Block
;
;
A record access block is required by RMS-32 for record
;
operations on a file.
;
RAB_BLOCK:
$RAB
FAB = FAB_BLOCK,;File access block address
RAC = SEQ,;Record access is to be
;sequential
RBF = RECORD_BUFFER,- ;Record buffer address
RSZ = 512
;Record buffer size
;
; Allocate direct address buffer
;
BLOCK_BUFFER:
.BLKB
1024
;
; Allocate space to store channel number returned by the $ASSIGN
; Channel system service.
;
DEVICE_CHANNEL:
;
.BLKW 1
;
;
; Allocate device name string and descriptor.
;
DEVICE_DESCR:
.LONG 20$-10$
.LONG 10$
10$:
.ASCII /SYS$DISK/
20$:
;
;Length of device name string
;Address of device name string
;Device on which created file
;will reside
;Reference label to calculate
;length
;
; Allocate file name string and define string length symbol.
;
FILE_NAME:
;
.ASCII /SYS$DISK:MYDATAFIL.DAT/
FILE_SIZE=.-FILE_NAME
;
; Allocate I/O status quadword storage.
;
IO_STATUS:
.BLKQ 1
;
; Allocate output record buffer.
;
;
;
Disk Drivers
2.6 Disk Driver Programming Example
Example 21 (Cont.) DISK_DRIVER.MAR Disk Driver Programming Example
RECORD_BUFFER:
;
.BLKB 512
;Record buffer is 512 bytes
;
; ********************************************************************
;
;
Start Program
;
; ********************************************************************
;
;
;
;
;
;
;
;
;
; First create the file and open it, using RMS-32.
;
PART_1:
;First part of example
$CREATE FAB = FAB_BLOCK
;Create and open file
BLBC
R0,20$
;If low bit = 0, creation
;failure
;
; Second, connect the record access block to the created file.
;
$CONNECT RAB = RAB_BLOCK
BLBC
R0,30$
;
; Now write 100 records, each containing its record number.
;
MOVZBL #NUM_RECS,R6
;
; Fill each byte of the record to be written with its record number.
;
10$:
SUBB3
R6,#NUM_RECS+1,R5
MOVC5
;
; Now use RMS-32 to write the record into the newly created file.
;
Disk Drivers
2.6 Disk Driver Programming Example
Example 21 (Cont.) DISK_DRIVER.MAR Disk Driver Programming Example
$PUT
RAB = RAB_BLOCK
BLBC
R0,30$
SOBGTR R6,10$
;
; The file creation part of the example is almost complete. All that
; remains to be done is to store the file information returned by
; RMS-32 and close the file.
;
MOVW
20$
;
; Record stream connection or put record failure.
;
; Close file and return status.
;
30$:
PUSHL R0
;Save error status
$CLOSE FAB = FAB_BLOCK
;Close file
POPL
R0
;Retrieve error status
RET
;Return with RMS error status
;
; The second part of the example illustrates accessing the previously
; created file directly using the Queue I/O system service, randomly
; reading and writing various parts of the file, and then deaccessing
; the file.
;
; First, assign a channel to the appropriate device and access the
; file.
PART_2:
;
$ASSIGN_S DEVNAM = DEVICE_DESCR,- ;Assign a channel to file
CHAN = DEVICE_CHANNEL ;device
BLBC
R0,20$
;If low bit = 0, assign
;failure
MOVL
#FIB$M_NOWRITE!FIB$M_WRITE,- ;Set for read/write
FIB_BLOCK+FIB$L_ACCTL ;access
$QIOW_S CHAN = DEVICE_CHANNEL,- ;Access file on device channel
FUNC = #IO$_ACCESS!IO$M_ACCESS,- ;I/O function is
;access file
IOSB = IO_STATUS,;Address of I/O status
;quadword
P1 = FIB_DESCR
;Address of information block
;descriptor
BLBC
R0,10$
;If low bit = 0, access
;failure
MOVZWL IO_STATUS,R0
;Get final I/O completion
;status
(continued on next page)
Disk Drivers
2.6 Disk Driver Programming Example
Example 21 (Cont.) DISK_DRIVER.MAR Disk Driver Programming Example
BLBS
10$:
R0,30$
20$:
;
; The file is now ready to be read and written randomly. Since the
; records are fixed length and exactly one block long, the record
; number corresponds to the virtual block number of the record in the
; file. Thus a particular record can be read or written simply by
; specifying its record number in the file.
;
; The following code reads two records at a time and checks to see
; that they contain their respective record numbers in every byte.
; The records are then written back into the file in reverse order.
; This results in record 1 having the old contents of record 2 and
; record 2 having the old contents of record 1, and so forth. After
; the example has been run, it is suggested that the file dump
; utility be used to verify the change in data positioning.
;
30$
MOVZBL #1,R6
;
; Read next two records into block buffer.
;
40$:
$QIO_S CHAN
FUNC
IOSB
P1 =
P2 =
P3 =
BSBB
;
; Check each record to make sure it contains the correct data.
;
SKPC
R6,#512,BLOCK_BUFFER
BNEQ
60$
ADDL3
#1,R6,R5
SKPC
BNEQ
;
; Record data matches.
;
; Write records in reverse order in file.
;
(continued on next page)
Disk Drivers
2.6 Disk Driver Programming Example
Example 21 (Cont.) DISK_DRIVER.MAR Disk Driver Programming Example
$QIOW_S CHAN = DEVICE_CHANNEL,FUNC = #IO$_WRITEVBLK,IOSB = IO_STATUS,P1 = BLOCK_BUFFER+512,P2 = #512,P3 = R6
BSBB
50$
ADDL3 #1,R6,R5
$QIOW_S CHAN = DEVICE_CHANNEL,FUNC = #IO$_WRITEVBLK,IOSB = IO_STATUS,P1 = BLOCK_BUFFER,P2 = #512,P3 = R5
BSBB
50$
ACBB
#NUM_RECS-1,#2,R6,40$
BRB
70$
;
; Check I/O completion status.
;
50$:
BLBC
R0,70$
MOVZWL IO_STATUS,R0
BLBC
RSB
R0,70$
;
; Record number mismatch in data.
;
60$:
MNEGL
#4,R0
;
; All records have been read, verified,
;
70$:
PUSHL R0
$QIOW_S CHAN = DEVICE_CHANNEL,FUNC = #IO$_DEACCESS
$DASSGN_S CHAN = DEVICE_CHANNEL
POPL
R0
RET
.END
DISK_EXAMPLE
3
Magnetic Tape Drivers
This chapter describes the use of magnetic tape drivers, drives, and controllers.
Read
Write
Yes
Yes
TQK50
Yes
Yes
TQK70
Yes
No
TZ30
1 Has
an internal controller.
The TK70 tape drive can read data on a TK50 cartridge formatted on a TK50 or
TZ30 tape drive.
Formatting a TK50 or TK52 Cartridge Tape on a TK70 Tape Drive
If a TK50 or TK52 cartridge tape is formatted on a TK70 tape drive, the TK70
cartridge tape drive initializes the TK50 or TK52 cartridge tape to TK70 density.
The following table summarizes the types of access available:
TK50
Controller
TK52
Read
Write
Read
Write
No
No
No
No
TQK50
No
No
No
No
TQK70
Yes
Yes
Yes
Yes
TZ30
1 Has
an internal controller.
The TK50 and TZ30 tape drives cannot read or write data on a TK50 cartridge
tape formatted on a TK70 drive.
Reverse read function (except for the TZ30 and TK50 on TUK50 and TQK50
controllers)
Reverse data check function (except for the TZ30, TS11, and TK50 on TUK50
and TQK50 controllers)
Full recovery from power failure for online drives with volumes mounted,
including repositioning by the driver (except on VAXstation 2000 and
MicroVAX 2000 systems)
The following sections describe master and slave controllers, and data check and
error recovery capabilities in greater detail.
When the device comes back on line, either through automatic failover or operator
intervention, the operating system validates the volume, restores the tape to the
position when the I/O failure occurred, and retries the failed request.
Per volumeYou can specify the characteristics data check all reads and
data check all writes when the volume is mounted. The OpenVMS DCL
Dictionary describes volume mounting and dismounting. The OpenVMS
System Services Reference Manual describes the Mount Volume ($MOUNT)
and Dismount Volume ($DISMOU) system services.
Per fileYou can specify the file attributes data check on read or data
check on write. File access attributes are specified when the file is accessed.
Chapter 1 of this manual and the OpenVMS Record Management Services
Reference Manual both describe file access.
The error recovery algorithm uses a combination of these types of error recovery
operations to complete an I/O operation.
Power failure recovery consists of repositioning the reel to the position held at
the start of the I/O operation in progress at the time of the power failure, and
then reexecuting this operation. This repositioning might or might not require
operator intervention to reload the drives. When such operator intervention
is required, device not ready messages are sent to the operator console to
solicit reloading of mounted drives. Power failure recovery is not supported on
VAXstation 2000 and MicroVAX 2000 systems.
Device timeout is treated as a fatal error, with a loss of tape position. A tape on
which a timeout has occurred must be dismounted and rewound before the drive
position can be established.
If a nonfatal controller/drive error occurs, the driver (or the controller, depending
on the type of drive) attempts to reexecute the I/O operation up to 16 times before
returning a fatal error. The driver repositions the tape before each retry.
The inhibit retry function modifier (IO$M_INHRETRY) inhibits all normal
(nonspecial conditions) error recovery. If an error occurs, and the request includes
that modifier, the operation is terminated immediately and the driver returns
a failure status. IO$M_INHRETRY has no effect on power failure and timeout
recovery.
The driver can write up to 16 extended interrecord gaps during the error
recovery for a write operation. For the TE16, TU45, and TU77 magnetic tape
drives, writing these gaps can be suppressed by specifying the inhibit extended
interrecord gap function modifier (IO$M_INHEXTGAP). This modifier is ignored
for the other magnetic tape drives.
Because the motors driving the reels are low-powered and because there is no
tape buffering, streaming tape drives are not capable of starting and stopping in
the interrecord gaps like conventional tape drives. When a streaming tape does
have to stop, the following events occur:
1. The tape slowly coasts forward to a stop.
Magnetic Tape Drivers 37
Meaning
Dynamic Bits (Conditionally Set)
DEV$M_AVL
DEV$M_FOR
Volume is foreign.
DEV$M_MNT
Volume is mounted.
DEV$M_RCK
DEV$M_WCK
1 Defined
Meaning
Static Bits (Always Set)
DEV$M_FOD
Device is file-oriented.
DEV$M_IDV
DEV$M_ODV
DEV$M_SQD
DEV$M_WBC
1 Defined
2 This
Meaning
MT$M_LOST
MT$M_HWL
MT$M_EOT
MT$M_EOF
MT$M_BOT
MT$M_PARITY
MT$V_DENSITY
MT$S_DENSITY
MT$V_FORMAT
MT$S_FORMAT
MT$K_GCR_6250
MT$K_PE_1600
MT$K_NRZI_800
Non-return-to-zero-inverted recording,
800 bits/inch
MT$K_BLK_833
MT$_FASTSKIP_USED
1 Defined
2 Only
Meaning
MT2$V_WBC_ENABLE
MT2$V_RDC_DISABLE
1 Defined by the $MT2DEF macro. Only for the TU81-Plus. Initial device status will show both of
these bits cleared; write-back caching will be disabled, read caching will be enabled.
DVI$_DEVTYPE and DVI$_DEVCLASS return the device type and class names,
which are defined by the $DCDEF macro. DVI$_DEVBUFSIZ returns the buffer
size. The buffer size is the default to be used for tape transfers (normally 2048
bytes). The device class for magnetic tapes is $DCTAPE, and the device type is
determined by the magnetic tape model. For example, the device type for the
TA78 is DT$_TA78; for the TA81 it is DT$_TA81.
Arguments
Type1
Function Modifiers
Function
IO$_ACCESS
P1,[P2],[P3],[P4],[P5]
IO$M_CREATE
IO$M_ACCESS
IO$_ACPCONTROL
P1,[P2],[P3],[P4], [P5]
IO$M_DMOUNT
Perform
miscellaneous
control functions.2
IO$_AVAILABLE
IO$_CREATE
P1,[P2][,[P3],[P4],[P5]
IO$_DEACCESS
P1,[P2],[P3],[P4],[P5]
Create a file.
Deaccess a file and,
if the file has been
written, write out
trailer records.
IO$_DSE3
IO$_FLUSH
Initialize volume
valid bit.
IO$_MODIFY
P1,[P2],[P3],[P4],[P5]
IO$_PACKACK
IO$M_NOWAIT
Erase a prescribed
section of the tape.
IO$_READLBLK10
P1,P2
IO$M_DATACHECK4
IO$M_INHRETRY
IO$M_REVERSE5
IO$_READPBLK10
P1,P2
IO$M_DATACHECK4
IO$M_INHRETRY
IO$M_REVERSE5
IO$_READVBLK10
P1,P2
IO$M_DATACHECK4
IO$M_INHRETRY
IO$M_REVERSE5
IO$_REWIND
IO$M_INHRETRY
IO$M_NOWAIT
IO$M_RETENSION
Reposition tape to
the beginning-oftape (BOT) marker.
IO$_REWINDOFF
IO$M_INHRETRY
IO$M_NOWAIT
IO$M_RETENSION
1V
2 See
3 Only
4 Not
5 Not
10 On
Function Modifiers
Function
IO$_SENSECHAR
[P1],[P2]
IO$M_INHRETRY
IO$_SENSEMODE
[P1],[P2]6
IO$M_INHRETRY
IO$_SETCHAR
P1,[P2]6
Set tape
characteristics
for subsequent
operations.
IO$_SETMODE
P1,[P2]6
Set tape
characteristics
for subsequent
operations.
IO$_SKIPFILE
P1
IO$M_INHRETRY
IO$M_NOWAIT7
IO$M_ALLOWFAST
IO$_SKIPRECORD
P1
IO$M_INHRETRY
IO$M_NOWAIT7
IO$M_INHRETRY
IO$M_NOWAIT
IO$M_ERASE8
IO$M_DATACHECK4
IO$M_INHRETRY
IO$M_INHEXTGAP9
IO$M_NOWAIT7
IO$M_INHRETRY
IO$M_INHEXTGAP9
IO$M_NOWAIT7
Write an extended
interrecord gap
followed by a tape
mark.
IO$M_ERASE8
IO$M_DATACHECK4
IO$M_INHRETRY
IO$M_INHEXTGAP9
IO$M_NOWAIT7
Write physical
block.
Function Code
Arguments
IO$_UNLOAD
IO$_WRITELBLK10
P1,P2
IO$_WRITEOF10
IO$_WRITEPBLK10
1V
P1,P2
4 Not
6 The
P1 and P2 arguments for IO$_SENSEMODE and IO$_SENSECHAR and the P2 argument for IO$_SETMODE and
IO$_SETCHAR are for TMSCP drives only.
7 Only
8 Takes
9 Only
10 On
no arguments; valid only for TMSCP drives, and TZK50 and TZ30 tape devices.
Arguments
IO$_WRITEVBLK
1V
10
P1,P2
Type1
V
Function Modifiers
Function
4
IO$M_DATACHECK
IO$M_INHRETRY
IO$M_INHEXTGAP9
IO$M_NOWAIT7
4 Not
7 Only
9 Only
10 On
P3Optional. The address of the word that is to receive the length of the
resultant file name string.
P1The starting virtual address of the buffer that is to receive the data in
the case of a read operation; or, in the case of a write operation, the virtual
address of the buffer that is to be written on the tape. On OpenVMS Alpha,
P1 can be a 64-bit address.
3.4.1 Read
The read function reads data into a specified buffer in the forward or reverse
direction starting at the next block position.
The operating system provides the following read function codes:
The tape is positioned past the end-of-tape (EOT) position at the start of the
read (forward or reverse) operation.
The tape enters the EOT region as a result of the read (forward) operation.
The transferred byte count reflects the actual number of bytes read.
If the drive reads a tape mark during a logical or physical read operation in
either the forward or reverse direction, any of the following conditions can return
an end-of-file (EOF) status:
The tape is positioned past the EOT position at the start of the read
operation.
The tape enters the EOT region as a result of the read operation.
The drive reads a tape mark as a result of a read operation but the tape does
not enter the EOT region.
An EOF status is also returned if the drive attempts a read operation in the
reverse direction when the tape is positioned at the beginning-of-tape (BOT)
marker. All conditions that cause an EOF status result in a transferred byte
count of zero.
If the drive attempts to read a block that is larger than the specified memory
buffer during a logical or physical read operation, a data overrun status is
returned. The buffer receives only the first part of the block. On a read in the
reverse direction (on drives other than the TK50 and TZ30) the buffer receives
only the latter part of the block. The transferred byte count is equal to the actual
size of the block. Read reverse starts at the top of the buffer. Therefore, the start
of the block is at P1 plus P2 minus the length read. The TUK50 and TZ30 cannot
actually perform read reverse operations; they must be simulated by the driver.
Therefore, the data returned are those that would have been returned had the
block been read in the forward direction.
It is not possible to read a block that is less than 14 bytes in length. Records that
contain less than 14 bytes are termed noise blocks and are completely ignored
by the driver.
The tape is positioned past the EOT position at the start of the write
operation.
The tape enters the EOT region as a result of the write operation.
The transferred byte count reflects the size of the block written. It is not possible
to write a block less than 14 bytes in length. An attempt to do so results in the
return of a bad parameter status for the QIO request.
3.4.3 Rewind
The rewind function repositions the tape to the beginning-of-tape (BOT) marker.
If the IO$M_NOWAIT function modifier is specified, the I/O operation is
completed when the rewind is initiated. Otherwise, I/O completion does not
occur until the tape is positioned at the BOT marker.
16 15
Not Used
0
File Count
ZK0671GE
Only tape marks (when the tape moves in either direction) and the BOT marker
(when the tape moves in reverse) are counted during a skip file operation. The
BOT marker terminates a skip file function in the reverse direction. The end-oftape (EOT) marker does not terminate a skip file function in either the forward
or reverse direction. A negative skip file function leaves the tape positioned just
before a tape mark (at the end of a file) unless the BOT marker is encountered,
whereas a positive skip file function leaves the tape positioned just past the tape
mark.
A skip file function in the forward direction can also be terminated if two
consecutive tape marks are encountered. Section 3.4.5.1 describes this feature.
The IO$M_ALLOWFAST modifier can be used with the IO$_SKIPFILE function
to provide better performance on SCSI tape drives that support the SCSI
space-by-file-marks command and the SCSI read position command.
When the IO$M_ALLOWFAST modifier is specified, a tape operation skips over
consecutive tape marks that are not immediately before the end-of-data position
on the medium. However, if two consecutive tape marks are detected immediately
before the end-of-data position on the tape, the tape is positioned between these
two tape marks and the SS$_ENDOFVOLUME status is returned.
The IO$M_ALLOWFAST modifier allows a SCSI tape subsystem to use the
optimized IO$_SKIPFILE if it is capabable. If a specific tape device does not
adequately support the optimized IO$_SKIPFILE that uses the SCSI space-byfile-marks command, the tape subsystem will use the standard space-by-records
algorithm.
16 15
Not Used
0
Block Count
ZK0672GE
A write EOF function is executed while the tape is positioned past the EOT
marker.
A write EOF function causes the tape position to enter the EOT region.
3.4.8 Unload
The unload function rewinds and unloads the tape on the selected drive. The
unload function is functionally the same as the rewind offline function. If the
IO$M_NOWAIT function modifier is specified, the I/O operation is completed
as soon as the rewind operation is initiated. No device- or function-dependent
arguments are used with IO$_UNLOAD.
IO$_SENSEMODESense mode
IO$_SENSECHARSense characteristics
Sense mode requires logical I/O privilege. Sense characteristics requires physical
I/O privilege. For TMSCP drives, the sense mode function returns magnetic
tape information in a user-supplied buffer, which is specified by the following
function-dependent arguments:
16 15
8 7
Type
Buffer Size
0
Class
Tape Characteristics *
* From UCB$L_DEVDEPEND
P2=12:
31
16 15
Buffer Size
8 7
Type
0
Class
Tape Characteristics *
Extended Tape Characteristics * *
Supported Densities * *
* From UCB$L_DEVDEPEND
** From UCB$L_DEVDEPND2
ZK4854GE
Regardless of whether the P1 buffer is specified, the I/O status block returns the
device-dependent characteristics in the second longword (see Figure 36). These
characteristics are identical to the information returned by DVI$_DEVDEPEND
(see Table 32 in Section 3.3).
IO$_SETMODESet mode
IO$_SETCHARSet characteristics
16 15
Buffer Size
0
Not Used
Tape Characteristics
P2=12:
31
16 15
Buffer Size
0
Not Used
Tape Characteristics
Extended Tape Characteristics
Reserved
ZK4856GE
16 15
Buffer Size
8 7
Type
0
Class
Tape Characteristics
P2=12:
31
16 15
Buffer Size
8 7
Type
0
Class
Tape Characteristics
Extended Tape Characteristics
Reserved
ZK4855GE
The first longword of the P1 buffer for the set characteristics function contains
information on device class and type, and the buffer size. The device class for
tapes is DC$_TAPE.
The $DCDEF macro defines the device type and class names. The buffer size is
the default to be used for tape transfers (this default is normally 2048 bytes).
The second longword of the P1 buffer for both the set mode and set
characteristics functions contains the tape characteristics. Table 35 lists the
tape characteristics and their meanings. The $MTDEF macro defines the symbols
listed. If P2=12, the third longword contains the extended tape characteristics for
TMSCP drives, which are listed in Table 36. The extended tape characteristics
are defined by the $MT2DEF macro and are identical to the information returned
by DVI$_DEVDEPEND2.
Table 35 Set Mode and Set Characteristics Magnetic Tape Characteristics
Characteristic1
Meaning
MT$M_PARITY
1 Defined
Meaning
MT$V_DENSITY
MT$S_DENSITY
MT$V_FORMAT
MT$S_FORMAT
1 Defined
2 Only
MT$K_DEFAULT
MT$K_GCR_6250
MT$K_PE_1600
MT$K_NRZI_800
Non-return-to-zero-inverted
recording, 800 bits/inch.
MT$K_BLK_833
MT$K_NORMAL11
Meaning
MT2$V_WBC_ENABLE
MT2$V_RDC_DISABLE
1 Defined
3.4.13 Modify
Specifying the ATR$C_USERLABEL or ATR$C_ENDLBLAST attributes with
IO$_MODIFY results in a bad attribute error. If any other attributes are
specified, the IO$_MODIFY function is treated as a no-operation; that is, the
function returns success, but no action is performed.
3.4.15 Available
The available function clears the volume valid bit for all magnetic tape drives,
that is, it reverses the function performed by the pack acknowledge function (see
Section 3.4.14). A rewind of the tape is performed (applicable to all tape drives).
No unload function is issued to the drive. The following function code is provided:
IO$_AVAILABLE
This function takes no function-dependent arguments.
3.4.16 Flush
The flush function is used to ensure that all previously issued cached commands
have fully completed. Normally, hosts use this function to establish or maintain
synchronization with write-back cached commands issued to the specified
tape unit. The I/O request does not complete until all cached data is written
successfully to the media in the exact order that the user specified.
IO$_FLUSH
This function code takes no function-dependent arguments.
16 15
Byte Count
0
Status
DeviceDependent Data
ZK0675GE
;
;
;
;
;
;
$QIOW_S FUNC
=
CHAN
=
IOSB
=
P1
=
P2
=
.
.
.
(Check for errors)
.
.
.
;
;
;
;
;
;
#IO$_SETMODE,CHANNEL,IO_STATUS,BUFFER,#12
$IODEF
DEVICE_NAME:
.ASCID
; Name of device
;
/MUA0/
CHANNEL:
.WORD
; Channel to device
;
BUFFER: .BLKL
; Set/Sense characteristics
; buffer
IO_STATUS:
.QUAD
.PSECT
.ENTRY
MAIN,^M<>
$ASSIGN_S DEVNAM
CHAN
BSBW
ERR_CHECK2
$QIOW_S FUNC
CHAN
IOSB
BSBW
BSBW
=
=
=
=
=
=
=
=
=
ERR_CHECK
$QIOW_S FUNC
CHAN
IOSB
P1
BSBW
ERR_CHECK
$QIOW_S FUNC
CHAN
IOSB
P1
P2
BSBW
ERR_CHECK
$QIOW_S FUNC
CHAN
IOSB
P1
P2
ERR_CHECK
ERR_CHECK
$QIOW_S FUNC
CHAN
IOSB
P1
BSBW
= DEVICE_NAME,= CHANNEL
#IO$_SETMODE,CHANNEL,IO_STATUS,BUFFER
=
=
=
=
=
ERR_CHECK
$QIOW_S FUNC
CHAN
IOSB
P1
P2
BSBW
#IO$_SETMODE,CHANNEL,IO_STATUS,BUFFER,#8
ERR_CHECK
RET
.ENABLE LSB
ERR_CHECK:
BLBS
IO_STATUS,ERR_CHECK2
MOVZWL IO_STATUS,-(SP)
BRB
10$
ERR_CHECK2:
BLBS
PUSHL
10$:
CALLS
20$:
R0,20$
R0
#1,G^LIB$STOP
RSB
.DISABLE LSB
.END
MAIN
$IODEF
;
; Allocate storage for the necessary data structures.
;
;
; Allocate magtape device name string and descriptor.
;
;
;Length of name string
;Address of name string
;Name string
;Reference label
;
; Allocate space to store assigned channel number.
;
TAPECHAN:
;
.BLKW 1
;Tape channel number
;
; Allocate space for the I/O status quadword.
;
IOSTATUS:
;
.BLKQ 1
;I/O status quadword
;
; Allocate storage for the input/output buffer.
;
BUFFER:
.REPT 256
.ASCII /A/
.ENDR
;
;
;
;
;
;
;
;Initialize buffer to
;contain A
;
Now define the file information block (FIB), which the ACP uses
in accessing and deaccessing the file. Both the user and the ACP
supply the information required in the FIB to perform these
functions.
FIB_DESCR:
.LONG
.LONG
FIB:
.LONG
.WORD
.WORD
.LONG
.WORD
.WORD
ENDFIB:
;Start of FIB
ENDFIB-FIB
;Length of FIB
FIB
;Address of FIB
FIB$M_WRITE!FIB$M_NOWRITE ;Read/write access allowed
0,0,0
;File ID
0,0,0
;Directory ID
0
;Context
0
;Name flags
0
;Extend control
;Reference label
;
; Now define the file name string and descriptor.
;
NAME_DESCR:
;
.LONG END_NAME-NAME
;File name descriptor
.LONG NAME
;Address of name string
NAME: .ASCII "MYDATA.DAT;1"
;File name string
END_NAME:
;Reference label
;
; *********************************************************************
;
;
Start Program
;
; *********************************************************************
;
(continued on next page)
The program first assigns a channel to the magnetic tape unit and
then performs an access function to create and access a file called
MYDATA.DAT. Next, the program writes 26 blocks of data (the letters
of the alphabet) to the tape. The first block contains all As, the
next, all Bs, and so forth. The program starts by writing a block of
256 bytes, that is, the block of As. Each subsequent block is reduced
in size by two bytes so that by the time the block of Zs is written,
the size is only 206 bytes. The magtape ACP does not allow the reading
of a file that has been written until one of three events occurs:
1. The file is deaccessed.
2. The file is rewound.
3. The file is backspaced.
In this example the file is backspaced zero blocks and then read in
reverse (incrementing the block size every block); the data is
checked against the data that is supposed to be there. If no data
errors are detected, the file is deaccessed and the program exits.
.ENTRY MAGTAPE_EXAMPLE,^M<R3,R4,R5,R6,R7,R8>
;
; First, assign a channel to the tape unit.
;
$ASSIGN_S TAPENAME,TAPECHAN
CMPW
#SS$_NORMAL,R0
BSBW
ERRCHECK
;
; Now create and access the file MYDATA.DAT.
;
$QIOW_S CHAN=TAPECHAN,;Channel is magtape
FUNC=#IO$_CREATE!IO$M_ACCESS!IO$M_CREATE,-;Function
;is create
IOSB=IOSTATUS,;Address of I/O status
;word
P1=FIB_DESCR,;FIB descriptor
P2=#NAME_DESCR
;Name descriptor
CMPW
#SS$_NORMAL,R0
;Success?
BSBW
ERRCHECK
;Find out
;
; LOOP1 consists of writing the alphabet to the tape (see previous
; description).
;
MOVL
MOVL
#26,R5
#256,R3
LOOP1:
$QIOW_S CHAN=TAPECHAN,FUNC=#IO$_WRITEVBLK,P1=BUFFER,P2=R3
CMPW
#SS$_NORMAL,R0
BSBW
ERRCHECK
;
; Now decrement the byte count in preparation for the next write
; operation and set up a loop count for updating the character
; written; LOOP2 performs the update.
(continued on next page)
#2,R3
MOVL
R3,R8
MOVAL
LOOP2: INCB
SOBGTR
SOBGTR
BUFFER,R7
(R7)+
R8,LOOP2
R5,LOOP1
;
; The alphabet is now complete. Fall through LOOP1 and update the
; byte count so that it reflects the actual size of the last block
; written to tape.
;
ADDL2
;
;
;
;
;
;
;
#2,R3
The tape is now read, but first the program must perform one of
the three functions described previously before the ACP allows
read access. The program performs an ACP control function,
specifying skip zero blocks. This is a special case of skip reverse
and causes the ACP to allow read access.
CLRL
MOVW
FIB+FIB$L_CNTRLVAL
;Set up to space zero blocks
#FIB$C_SPACE,FIB+FIB$W_CNTRLFUNC ;Set up for space
;function
$QIOW_S CHAN=TAPECHAN,;Perform QIOW to tape channel
FUNC=#IO$_ACPCONTROL,- ;Perform an ACP control
;function
P1=FIB_DESCR
;Define the FIB
CMPW
#SS$_NORMAL,R0
;Success?
BSBW
ERRCHECK
;Find out
;
; Read the file in reverse.
;
MOVL
MOVB
#26,R5
#^A/Z/,R6
R3,R4
(R7)+,R6
MISMATCH
R4,CHECKDATA
R6
#2,R3
SOBGTR R5,LOOP3
;
; Now deaccess the file.
;
$QIOW_S CHAN=TAPECHAN,FUNC=#IO$_DEACCESS,P1=FIB_DESCR,IOSB=IOSTATUS
;Channel is magtape
;Deaccess function
;File information block (required)
;I/O status
;
; Deassign the channel and exit.
;
EXIT:
$DASSGN_S CHAN=TAPECHAN
RET
;Deassign channel
;Exit
;
; If an error had been detected, a program would normally
; generate an error message here. But for this example the
; program simply exits.
;
MISMATCH:
BRB
EXIT
;
;Exit
ERRCHECK:
BNEQ
RSB
EXIT
;
;If not success, exit
;Otherwise, return
.END
MAGTAPE_EXAMPLE
4
Mailbox Driver
The operating system supports a virtual device, called a mailbox, that is used for
communication between processes. Mailboxes provide a controlled, synchronized
method for processes to exchange data. Although mailboxes transfer information
much like other I/O devices, they are not hardware devices. Rather, mailboxes
are a software-implemented way to perform read and write operations between
processes.
The OpenVMS Programming Concepts Manual and the OpenVMS System
Services Reference Manual contain additional information about using
mailboxes.
Creating mailboxes
Deleting mailboxes
Protecting mailboxes
Mailbox Driver 41
Mailbox Driver
4.1 Mailbox Operations
Figure 41 Multiple Mailbox Channels
User or
system
process
creates
mailbox.
Process
$CREMBX
assigns
channel.
Cooperating
processes use
$ASSIGN or $CREMBX
to define additional
channels.
Mailbox
Process
Process
ZK0676GE
If sufficient dynamic memory for the mailbox data structure is not available when
a mailbox is created, a resource wait occurs if resource wait mode is enabled.
When a mailbox is created, a certain amount of space is specified for buffering
messages that have been written to the mailbox but have not yet been read.
The bufquo argument to the $CREMBX system service specifies this amount or
quota. If that argument is omitted, its value defaults to the system parameter
DEFMBXBUFQUO.
A message written to a mailbox, in the absence of an outstanding read request,
is queued to the mailbox, and the size of the message (the QIO P2 argument) is
subtracted from the available buffering space. After the message is read, it is
added back to the available buffering space.
If a process attempts to write to a mailbox that is full or has insufficient buffering
space and if the process has resource wait enabled (which is the default case),
the process is placed in miscellaneous resource wait mode until sufficient space is
available in the mailbox. If resource wait is not enabled, the I/O completes with
the status return SS$_MBFULL in the I/O status block (IOSB).
42 Mailbox Driver
Mailbox Driver
4.1 Mailbox Operations
Channels can be assigned to mailboxes as bidirectional (read/write), read only, or
write only. This allows for greater synchronization between users of the mailbox.
To specify a unidirectional channel to the mailbox, specify the flags argument for
the $CREMBX or $ASSIGN system services.
The flags argument is a longword bit mask that enables you to specify that the
channel assigned to the mailbox is a read-only or write-only channel. If the flags
argument is not specified, the default channel behavior is read/write. A channel
assigned to the mailbox as read only is considered a reader. A channel assigned
to the mailbox as write only is considered a writer. A channel assigned to the
mailbox as read/write is considered both a reader and a writer.
For the $ASSIGN system service, the $AGNDEF macro defines a symbolic name
for each flag bit. These flags are as follows:
AGN$M_READONLYWhen this flag is specified, $ASSIGN assigns a readonly channel to the mailbox device. An attempt to issue a $QIO WRITE
operation on the mailbox channel causes an illegal I/O operation error.
For the $CREMBX system service, the $CMBDEF macro defines a symbolic name
for each flag bit. These flags are as follows:
Refer to the OpenVMS System Services Reference Manual for a syntax description
of the $CREMBX and $ASSIGN system services.
The programming examples at the end of this section (Section 4.5) show mailbox
creation, interprocess communication, and synchronization.
Mailbox Driver 43
Mailbox Driver
4.1 Mailbox Operations
4.1.3 Mailbox Message Format
There is no standardized format for mailbox messages and none is imposed on
users.
Meaning
Dynamic Bits (Conditionally Set)
DEV$M_SHR
Device is shareable.
DEV$M_AVL
Device is available.
Static Bits (Always Set)
DEV$M_REC
Device is record-oriented.
DEV$M_IDV
DEV$M_ODV
DEV$M_MBX
Device is a mailbox.
1 Defined
Mailbox Driver
4.2 Mailbox Driver Device Information
DVI$_UNIT returns the mailbox unit number. Using mailbox to hold a
termination message for a subprocess or a detached process requires that
the parent process obtain this number to pass to the mbxunt argument of the
$CREPRC system service.
4.3.1 Read
Read mailbox functions are used to obtain messages written to the mailbox. The
operating system provides the following mailbox function codes:
P1The starting virtual address of the buffer that is to receive the message.
If P2 specifies a zero-length buffer, P1 is ignored. On OpenVSM Alpha, P1
can be a 64-bit address.
P2The size of the buffer in bytes (limited by the maximum message size for
the mailbox). A zero-length buffer may be specified. If a message longer than
the buffer is read, the alternate success status SS$_BUFFEROVF is returned
in the I/O status block. In such cases, the message is truncated to fit the
buffer. The driver does not provide a means for recovering the deleted portion
of the message.
Mailbox Driver
4.3 Mailbox Function Codes
read request terminates successfully with the bytes it was able to read before
finding the WRITEOF message and the end-of-file message becomes the
first message in the mailbox. The next read request processes the end-of-file
message. If the read request is a READ STREAM, then the request must be
for greater than 0 bytes. $QIO READ STREAM can return fewer than P2
bytes with a return value of SS$_NORMAL if the mailbox is emptied by the
$QIO READ STREAM request or a WRITEOF message is encountered.
Figure 42 shows $QIO READ STREAM operations.
A READ IO$M_STREAM (without IO$M_NOW specified) on an empty
mailbox waits until some data has been written to the mailbox. It terminates
with:
0 bytes read if the next data written is an end-of-file message.
Fewer than P2 bytes read if the next data written is less than P2 bytes
but greater than 0 bytes. (READ IO$M_STREAM ignores writes of 0
bytes.)
P2 bytes read if the next data written is greater than or equal to P2
bytes.
If a $QIO READ STREAM is fulfilled by multiple $QIO WRITE requests,
the sender PID returned in the IOSB of the $QIO READ STREAM reflects
the first write request. A $QIO READ STREAM is charged BUFQUO for the
request. This BUFQUO is released when the read request is met. A $QIO
READ STREAM request that would cause BUFQUO to be exceeded for the
mailbox when the mailbox has no writes pending returns an SS$_EXQUOTA
error.
A $QIO READ STREAM issued to a mailbox that would cause BUFQUO to be
exceeded because BUFQUO is occupied by write requests still executes. This
happens because by allowing the mailbox to temporarily exceed BUFQUO,
BUFQUO is freed. Similarly, a $QIO WRITE that is issued to a mailbox that
would cause BUFQUO to be exceeded, because the BUFQUO is occupied by
read stream requests, still executes.
Reads of 0 bytes are handled differently depending on which functional modifiers
are specified. If IO$M_STREAM is specified, then the $QIO returns SS$_
NORMAL with 0 bytes read. The contents of the mailbox remain exactly as
they were before the $QIO was issued. A $QIO READ STREAM of 0 bytes does
not remove a 0 byte record, nor does it remove an end-of-file marker. If IO$M_
STREAM is not specified, then $QIO returns one of the following:
SS$_NORMAL (if 0 bytes were written with the corresponding $QIO WRITE
performed)
For a 0-byte nonstream read, a record is actually removed from the mailbox to
meet the $QIO READ request. Note that the use of the word immediately does
not imply that synchronization of the $QIO request should not be performed.
46 Mailbox Driver
Mailbox Driver
4.3 Mailbox Function Codes
Figure 42 $QIO READ STREAM Operation
1. CREMBX
Empty Mailbox
2. WRITE 20 bytes
Empty Mailbox
4. WRITE 20 bytes
6. WRITE 50 bytes
Empty Mailbox
Diagram reflects state of Mailbox after specified operation has been performed.
ZK3853AGE
Mailbox Driver 47
Mailbox Driver
4.3 Mailbox Function Codes
Figure 43 shows the read mailbox functions. In this figure, Process A reads a
mailbox message written by Process B. As the figure indicates, a mailbox read
request requires a corresponding mailbox write request (except in the case of an
error). The requests can be made in any sequence; the read request can either
precede or follow the write request.
Figure 43 Read Mailbox
1
or
Read QIO
Process
A
or
Write QIO
Process
B
Mailbox
Data
Data
If Process A issues a read request before Process B issues a write request, one of
two events can occur. If Process A did not specify the function modifier IO$M_
NOW, Process As request is queued before Process B issues the write request.
When Process Bs write request occurs, the data is transferred from Process B,
through the system buffers, to Process A to complete the I/O operation.
However, if Process A did specify the IO$M_NOW function modifier, the read
operation is completed immediately. That is, no data is transferred from Process
B to Process A, and Process As request is not queued until Process B issues
the write request. In this case, the I/O status returned to Process A is SS$_
ENDOFFILE.
If Process B sends a message (with no function modifier; see Section 4.3.2) before
Process A issues a read request (with or without a function modifier), Process A
finds a message in the mailbox. The data is transferred and the I/O operation
is completed immediately, regardless of whether IO$M_NOW is specified on the
read request.
48 Mailbox Driver
Mailbox Driver
4.3 Mailbox Function Codes
4.3.2 Write
Write mailbox functions are used to transfer data from a process to a mailbox.
The operating system provides the following mailbox function codes:
P1The starting virtual address of the buffer that contains the message
being written. If P2 specifies a zero-length buffer, P1 is ignored. On
OpenVMS Alpha, P1 can be a 64-bit address.
P2The size of the buffer in bytes (limited by the maximum message size for
the mailbox). A zero-length buffer produces a zero-length message to be read
by the mailbox reader.
Mailbox Driver 49
Mailbox Driver
4.3 Mailbox Function Codes
when no read channel is assigned to the mailbox, returns an SS$_NOREADER
error and the 0-byte record is not placed in the mailbox. A message that is 0
bytes long is charged 1 byte of mailbox BUFQUO.
Figure 44 shows the write mailbox function. In this figure, Process A writes a
message to be read by Process B. As in the read request example, a mailbox write
request requires a corresponding mailbox read request (unless an error occurs)
and the requests can be made in any sequence.
If Process A issues a write request before Process B issues a read request, one of
two events can occur. If Process A did not specify the function modifier IO$M_
NOW, Process As write request is queued before Process B issues a read request.
When this request occurs, the data is transferred from Process A to Process B to
complete the I/O operation.
However, if Process A did specify the IO$M_NOW function modifier, the write
operation is completed immediately. The data is available to Process B and is
transferred when Process B issues a read request.
If Process B issues a read request (with no function modifier) before Process
A issues a write request (with or without the function modifier), Process A
finds a request in the mailbox. The data is transferred and the I/O operation is
completed immediately.
Figure 44 Write Mailbox
1
or
Write QIO
Process
A
or
Read QIO
Process
B
Mailbox
Data
Data
Mailbox Driver
4.3 Mailbox Function Codes
4.3.3 Write End-of-File Message
Write end-of-file message functions are used to insert a special message in the
mailbox. The process that reads the end-of-file message is returned the status
code SS$_ENDOFFILE in the I/O status block. The message count of the Get
Mailbox Information function reflects this end-of-file message; however, the
mailbox byte count of this function does not include end-of-file markers. An
end-of-file message is charged 1 byte of mailbox BUFQUO.
This function takes no arguments. The operating system provides the following
function code:
IO$_WRITEOFWrite end-of-file message
The following function modifiers can be specified with a write end-of-file request:
IO$M_NORSWAITIf the mailbox is full, the I/O operation fails with a status
return of SS$_MBFULL instead of placing the process in resource wait mode.
Note that IO$M_NORSWAIT does not disable resource waits that may occur
elsewhere in the $QIO operation. For example, IO$M_NORSWAIT does not
affect any resource waiting that occurs when I/O processing routines try to
allocate an I/O request packet while passing the I/O request to the mailbox
driver.
When a cooperating process places a read request for which no write request
is pending in a designated mailbox. This is called an unsolicited read request.
When a cooperating process places a write request for which no read request
is pending in a designated mailbox. This is called an unsolicited write
request.
Mailbox Driver
4.3 Mailbox Function Codes
The operating system provides the following function codes:
P2AST parameter returned in the argument list when the AST service
routine is called
These functions are enabled only once; they must be explicitly reenabled after
the AST has been delivered if you desire repeat notification. All types of enable
functions, and more than one of each type, can be set at the same time. The
number of enable functions is limited only by the AST quota for the process.
Figure 45 shows the write attention AST function. In this figure, an AST is set
to notify Process A when Process B sends an unsolicited message.
Figure 45 Write Attention AST (Read Unsolicited Data)
AST
1
AST Specified by
IO$_SETMODE
!IO$M_WRTATTN
Read QIO
+IO$M_NOW
Unsolicited
Write QIO
Process
A
Process
B
Mailbox
Data
Data
Mailbox Driver
4.3 Mailbox Function Codes
Process A uses the IO$_SETMODE!IO$M_WRTATTN function to request an AST.
When Process B sends a message to the mailbox, the AST is delivered to Process
A. Process A responds to the AST by issuing a read request to the mailbox. The
data is then transferred to complete the I/O operation.
If several requesting processes have set ASTs for unsolicited messages at the
same mailbox, all ASTs are delivered when the first unsolicited message is placed
in the mailbox; however, only the first process to respond to the AST with a read
request receives the data. Therefore, when the next process to respond to an AST
issues a read request to the mailbox, it might find the mailbox empty. If this
request does not include the function modifier IO$M_NOW, it is queued before
the next message arrives in the mailbox.
Figure 46 shows the read attention AST function. In this figure, an AST is set
to notify Process A when Process B issues a read request for which no message is
available.
Figure 46 Read Attention AST
AST
1
AST Specified by
IO$_SETMODE
!IO$M_READATTN
Write QIO
+IO$M_NOW
Read QIO
Process
A
Process
B
Mailbox
Data
Data
Mailbox Driver
4.3 Mailbox Function Codes
If several requesting processes set ASTs for read requests for the same mailbox,
all ASTs are delivered when the first read request is placed in the mailbox. Only
the first process to respond with a write request is able to transfer data to Process
B.
Mailbox Driver
4.3 Mailbox Function Codes
Figure 47 Protection Mask
15
11
World
Group
Owner
System
11
10
Log I/O
Write
Read
* Not Used
ZK0683GE
Mailbox Driver
4.4 I/O Status Block
(The OpenVMS system messages documentation provides explanations and
suggested user actions for both types of returns.)
Figure 48 IOSB ContentsRead Function
+2
IOSB
Byte Count
Status
ZK0684GE
IOSB
Byte Count *
Status
+4
IOSB
Status
+4
ZK1201GE
16
15
0
Condition Value
Mailbox Driver
4.5 Mailbox Driver Programming Examples
Example 41 creates a mailbox and puts mail into it; no matching read is pending
on the mailbox. First, the program shows that if the function modifier IO$M_
NOW is not used when mail is deposited, the write function waits until a read
operation is performed. In this case, IO$M_NOW is specified and the program
continues after the mail is left in the mailbox.
Next, the mailbox is read. If there is no mail in the mailbox, the program waits
because IO$M_NOW is not specified. IO$M_NOW should be specified if there is
any doubt about the availability of data in the mailbox, and it is important for
the program not to wait.
It is up to the user to coordinate the data that goes into and out of mailboxes.
In this example, the process reads its own message. Normally, two mailboxes
are used for interprocess communication: one for sending data from process A
to process B, and one for sending data from process B to process A. If a program
is arranged in this manner, there is no possibility of a process reading its own
message.
Example 42 and Example 43 work together from two separate processes
and show the unidirectional mailbox synchronization features. Note that these
examples require the /STANDARD=VAXC qualifier when compiled on Alpha
systems.
Example 42 performs the following functions:
1. Assigns a read-only channel to the mailbox.
2. Waits for another program to assign a writable channel to the mailbox.
3. Reads, using the IO$M_WRITERCHECK function modifier, what has been
written to the mailbox.
4. When SS$_NOWRITER is returned from the read operation, goes back to
Step 2 and waits for another writer.
Example 43 is a writer to the mailbox. It performs the following functions:
1. Assigns a write-only channel to the mailbox.
2. Waits for a reader.
3. Gathers user input until the user enters Ctrl/Z, then writes that input to the
mailbox.
Mailbox Driver
4.5 Mailbox Driver Programming Examples
Example 41 Mailbox Driver Program Example 1
; *********************************************************************
;
.TITLE MAILBOX DRIVER PROGRAM EXAMPLE
.IDENT /01/
;
; Define necessary symbols.
;
$IODEF
;
; Allocate storage for necessary data structures.
;
;
; Allocate output device name string and descriptor.
;
DEVICE_DESCR:
.LONG 20$-10$
.LONG 10$
10$:
.ASCII /SYS$OUTPUT/
20$:
;
;Length of name string
;Address of name string
;Name string of output device
;Reference label
;
; Allocate space to store assigned channel number.
;
DEVICE_CHANNEL:
.BLKW 1
;
;Channel number
;
; Allocate mailbox name string and descriptor.
;
MAILBOX_NAME:
.LONG ENDBOX-NAMEBOX
.LONG NAMEBOX
NAMEBOX: .ASCII /146_MAIN_ST/
ENDBOX:
;
;Length of name string
;Address of name string
;Name string
;Reference label
;
; Allocate space to store assigned channel number.
;
MAILBOX_CHANNEL:
.BLKW 1
;
;Channel number
;
; Allocate space to store the outgoing and incoming messages.
;
IN_BOX_BUFFER:
.BLKB 40
IN_LENGTH=.-IN_BOX_BUFFER
OUT_BOX_BUFFER:
.ASCII /SHEEP ARE VERY DIM/
OUT_LENGTH=.-OUT_BOX_BUFFER
;
;Allocate 40 bytes for
;received message
;Define input buffer length
;
;Message to send
;Define length of message to
;send
;
; Finally, allocate space for the I/O status quadword.
;
(continued on next page)
Mailbox Driver
4.5 Mailbox Driver Programming Examples
Example 41 (Cont.) Mailbox Driver Program Example 1
STATUS:
.QUAD
;
;I/O status quadword
;
; *********************************************************************
;
;
Start Program
;
; *********************************************************************
;
;
;
;
;
;
;
;
START: .WORD 0
;Entry mask
$CREMBX_S CHAN=MAILBOX_CHANNEL,- ;Channel is the mailbox
PROMSK=#^X0000,;No protection
BUFQUO=#^X0060,;Buffer quota is hex 60
LOGNAM=MAILBOX_NAME,- ;Logical name descriptor
MAXMSG=#^X0060
;Maximum message is hex 60
CMPW
#SS$_NORMAL,R0
;Successful mailbox creation?
BSBW
ERROR_CHECK
;Find out
$ASSIGN_S ;Assign channel
DEVNAM=DEVICE_DESCR,- ;Device descriptor
CHAN=DEVICE_CHANNEL
;Channel
CMPW
#SS$_NORMAL,R0
;Successful channel assign?
BSBW
ERROR_CHECK
;Find out
;
;
;
;
;
;
The program now writes to the mailbox using a write request that
includes the function modifier IO$M_NOW so that it need not wait for
a read request to the mailbox before continuing to the next step in
the program.
$QIOW_S FUNC=#IO$_WRITEVBLK!IO$M_NOW,- ;Write message NOW
CHAN=MAILBOX_CHANNEL,- ;to the mailbox channel
P1=OUT_BOX_BUFFER,;Write buffer
P2=#OUT_LENGTH
;Buffer length
CMPW
#SS$_NORMAL,R0
;Successful write request?
BSBW
ERROR_CHECK
;Find out
;
; Read the mailbox.
;
$QIOW_S FUNC=#IO$_READVBLK,CHAN=MAILBOX_CHANNEL,IOSB=STATUS,P1=IN_BOX_BUFFER,P2=#IN_LENGTH
CMPW
#SS$_NORMAL,R0
BSBW
ERROR_CHECK
Mailbox Driver
4.5 Mailbox Driver Programming Examples
Example 41 (Cont.) Mailbox Driver Program Example 1
;
; The program now determines how much mail is in the mailbox (this
; information is in STATUS+2) and then prints the mailbox message on
; the process output device.
;
MOVZWL STATUS+2,R2
$QIOW_S FUNC=#IO$_WRITEVBLK,CHAN=DEVICE_CHANNEL,P1=IN_BOX_BUFFER,P2=R2,P4=#32
;
; Finally, deassign the channel and exit.
;
EXIT:
$DASSGN_S CHAN=DEVICE_CHANNEL
RET
;Deassign channel
;Return
;
; This is the error checking part of the program. Normally, some kind
; of error recovery would be attempted at this point if an error was
; detected. However, this example program simply exits.
;
ERROR_CHECK:
BNEQ
RSB
.END
;
;System service failure, exit
;Otherwise, return
EXIT
START
"sys$library:descrip"
"sys$library:libdef"
"sys$library:stdio"
"decc$library:[include]ssdef"
"decc$library:[include]cmbdef"
"decc$library:[include]agndef"
"decc$library:[include]iodef"
/*
/*
/*
/*
/*
/*
/*
#define $ARRAY_DESCRIPTOR(name,size,array_name)
char array_name[ size ];
struct dsc$descriptor_s name =
{ size, DSC$K_DTYPE_T, DSC$K_CLASS_S, array_name }
\
\
\
main()
(continued on next page)
Mailbox Driver
4.5 Mailbox Driver Programming Examples
Example 42 (Cont.) Mailbox Driver Program Example 2
{
# define max_msg_len 256
$DESCRIPTOR(mailbox_name_desc,"MAILBOX_EXAMPLE");
$ARRAY_DESCRIPTOR(read_buffer_desc,max_msg_len,read_buffer);
int status, mailbox_channel;
int true=1, false = 0;
struct io_status_block {
/* I/O status block */
short int condition;
short int count;
int dev;
} iosb;
/*
* Create a permanent mailbox with a READONLY channel. Its logical name
* will be entered into the LNM$PERMANENT_MAILBOX logical name table.
*/
SYS$CREMBX(1,&mailbox_channel,0,0,0,0,&mailbox_name_desc,CMB$M_READONLY);
/*
* Mark it for deletion
*/
SYS$DELMBX(mailbox_channel);
/*
* Loop forever, first waiting til a WRITE channel is assigned to the mailbox
* and then reading data from it until the WRITER deassigns.
*/
while (TRUE)
{
/* First, check to see if there is a WRITER assigned to the mailbox */
status = SYS$QIOW (
0,
mailbox_channel,
IO$_SENSEMODE|IO$M_WRITERCHECK,
&iosb,
0,0,
0,0,0,0,0,0);
/* If there was no WRITER, then wait for one.*/
if (iosb.condition == SS$_NOWRITER)
status = SYS$QIOW (
0,
mailbox_channel,
IO$_SETMODE|IO$M_WRITERWAIT,
&iosb,
0,0,
0,0,0,0,0,0);
(continued on next page)
Mailbox Driver
4.5 Mailbox Driver Programming Examples
Example 42 (Cont.) Mailbox Driver Program Example 2
/*
* While the status is good, READ from the mailbox, and write it to
*/
while (status == SS$_NORMAL)
{
status = SYS$QIOW(
0,
mailbox_channel,
IO$_READVBLK|IO$M_WRITERCHECK,
&iosb,
0,0,
read_buffer_desc.dsc$a_pointer,max_msg_len,
0,0,0,0);
status=iosb.condition;
read_buffer_desc.dsc$w_length = iosb.count;
lib$put_output(&read_buffer_desc);
}
}
}
Example 43 assigns a write-only channel to the mailbox.
Example 43 Mailbox Driver Program Example 3
/*
* C program to demonstrate the new features of the Mailbox driver
* This program is a Mailbox WRITER. It assigns a WRITE_ONLY channel to the
* mailbox. Its partner program is a Mailbox READER.
*/
#include
#include
#include
#include
#include
#include
#include
#include
"sys$library:descrip"
"sys$library:libdef"
"sys$library:rmsdef"
"sys$library:stdio"
"decc$library:[include]ssdef"
"decc$library:[include]cmbdef"
"decc$library:[include]agndef"
"decc$library:[include]iodef"
/*
/*
/*
/*
/*
/*
/*
/*
#define $ARRAY_DESCRIPTOR(name,size,array_name)
char array_name[ size ];
struct dsc$descriptor_s name =
{ size, DSC$K_DTYPE_T, DSC$K_CLASS_S, array_name }
\
\
\
Mailbox Driver
4.5 Mailbox Driver Programming Examples
Example 43 (Cont.) Mailbox Driver Program Example 3
main()
{
#define max_msg_len 256
$DESCRIPTOR(mailbox_name_desc,"MAILBOX_EXAMPLE");
$DESCRIPTOR(prompt_string_desc,"DATA TO SEND TO MAILBOX
(<CTRL Z> to terminate) >>>");
$ARRAY_DESCRIPTOR(write_buffer_desc,max_msg_len,write_buffer);
int status, mailbox_channel, wait_efn;
int true=1, false = 0;
int MORE_ROOM_AST();
struct io_status_block {
/* I/O status block */
short int condition;
short int count;
int dev;
} iosb;
/*
* Create a permanent mailbox with a WRITEONLY channel. Its logical name
* will be entered into the LNM$PERMANENT_MAILBOX logical name table.
*/
SYS$CREMBX(1,&mailbox_channel,0,0,0,0,&mailbox_name_desc,CMB$M_WRITEONLY);
/*
* Mark it for deletion
*/
SYS$DELMBX(mailbox_channel);
/*
* Loop forever, first waiting til a READ channel is assigned to the mailbox
* and then write data until there is no more data to write.
*/
while (TRUE)
{
/*
* Wait for a READER to assign a channel. If a READER is already
* assigned, this will return immediatly.
*/
status = SYS$QIOW (
0,
mailbox_channel,
IO$_SETMODE|IO$M_READERWAIT,
&iosb,
0,0,
0,0,0,0,0,0);
while (status)
{
write_buffer_desc.dsc$w_length = max_msg_len;
status = lib$get_input(
&write_buffer_desc,
&prompt_string_desc,
&write_buffer_desc.dsc$w_length);
/*
* If at end of file (user typed <CTRL Z>)
* then stop here.
*/
if (status == RMS$_EOF) SYS$EXIT(SS$_NORMAL);
(continued on next page)
Mailbox Driver
4.5 Mailbox Driver Programming Examples
Example 43 (Cont.) Mailbox Driver Program Example 3
/* Keep trying to write the message, until it fits in the mailbox
* Note that if the NORSWAIT function modifier had been eliminated
* below, then the ROOM_NOTIFY and the retry loop could have been
* removed. ROOM_NOTIFY was used in this example simply to show
* its use. It would be more appropriately used when the program
* has other things it can be working on, as opposed to the
* example below in which the program is not doing anything except
* WAITING for room in the mailbox.
*/
status = SS$_NOREADER;
/* Force attempt to WRITE */
while (status != SS$_NORMAL)
{
status = SYS$QIOW(
0,
mailbox_channel,
IO$_WRITEVBLK|IO$M_READERCHECK|IO$M_NORSWAIT,
&iosb,
0,0,
write_buffer_desc.dsc$a_pointer, write_buffer_desc.dsc$w_length,
0,0,0,0);
if (iosb.condition == SS$_NOREADER) SYS$EXIT(SS$_NOREADER);
if (status == SS$_MBFULL)
{
LIB$GET_EF(&wait_efn);
SYS$CLREF(wait_efn);
SYS$QIOW (
0,
mailbox_channel,
IO$_SETMODE|IO$M_MB_ROOM_NOTIFY,
&iosb,
0,0,
MORE_ROOM_AST,wait_efn,0,0,0,0);
SYS$WAITFR(wait_efn);
}
}
}
}
}
MORE_ROOM_AST(efn_to_set)
int efn_to_set;
{
SYS$SETEF(efn_to_set);
}
5
Terminal Driver
This chapter describes the use of the terminal driver (TTDRIVER) and the
LAT port driver (LTDRIVER). The terminal driver supports the asynchronous,
serial line multiplexers listed in Table 51. The terminal driver also supports
the console terminal. The LAT port driver accommodates I/O requests from
application programs; for example to make connections to remote devices, such as
a printer, on a server (see Section 5.4.4).
No.of
Interface
Lines
CXY08
Outout
Silo
Split
International
DMA
Speed
Bus
Modem Control
Yes
Yes
Q-bus
Full
Yes
CXA16
16
Yes
Yes
Yes
Q-bus
No
CXB16
16
Yes1
Yes
Yes
Q-bus
No
DZQ11
No
No
Yes
Q-bus
No
DZQ11-CR
No
No
Yes
Q-bus
No
MicroVAX 2000
No
No
Yes
None
No
MicroVAX 3100
No
No
Yes
None
No
DZV11
No
No
No
Q-bus
No
Yes
Yes
Q-bus
Full
DHQ11
Yes
DHU11
16
Yes
Yes
Yes
UNIBUS
Full
DHV11
No
Yes
Yes
Q-bus
Full
DMB32
No
Yes
Yes
VAXBI bus
Full
DHB32
16
No
Yes
Yes
VAXBI bus
Full
1 Depends
on whether the DHV or DHU mode is selected when the board is installed.
Terminal Driver 51
Terminal Driver
5.1 Supported Terminal Devices
Table 51 (Cont.) Supported Terminal Devices
Outout
Terminal
No.of
Interface
Lines
Silo
DMA
Speed
Bus
Modem Control
DSH32
Yes
No
Yes
MicroVAX
2000,
MicroVAX
3100
No
DMF32
Yes
Yes2
Yes2
UNIBUS
Yes
DMZ32
24
Yes
Yes
Yes
UNIBUS
Full
DZ11
8/16
No
No
No
UNIBUS
No
DZ32
No
No
Limited
UNIBUS
No
LAT
Yes
No
Split
International
N/A
VAX 8200
serial lines
No
No
No
None
No
VAXstation 3100
No
No
Yes
None
No
VAXstation 4000
No
No
Yes
None
No
DEC 2000
Model 300
No
No
No
None
Full
DEC 2000
Model 3007
4, 8
Yes
No
No
EISA
Full
AlphaServer 2100
No
No
No
None
Full
AlphaServer7
4, 8
Yes
No
No
EISA
Full
DEC 3000
Model 300
No
Yes
No
None
Full
DEC 3000
Model 400
No
Yes6
No
None
Full
DEC 3000
Model 500
No
Yes6
No
None
Full
DEC 4000
Model 600
No
No
No
None
Full
2 Lines
0 and 1.
dependent.
3 Server
4 The operating system always supports the first serial line as a console interface. The first serial line and the remaining
three serial lines are also supported as user terminal interfaces at a maximum speed of 1200 baud in configurations that
can include a LAT terminal interface, but do not include other terminal interfaces.
5 Communications
6 Communications
only.
7 Optional
multifunctional serial/parallel PC4XD-AA adapter card. You can daisy-chain up to four boards in one system,
resulting in 16, 32, or 64 ports.
Input processing
Command-line editing and command recall
Control characters and special keys
Input character validation (read verify)
52 Terminal Driver
Terminal Driver
5.2 Terminal Driver Features
American National Standard Institute (ANSI) escape sequence detection
Type-ahead feature
Specifiable or default input terminators
Special operating modes, such as NOECHO and PASTHRU
Output processing
Efficiency
Limited full-duplex operation
Formatted or unformatted output
Dialup support
Modem control
Hangup on logout
Preservation of process across hangups
Miscellaneous
Terminal/mailbox interaction
Autobaud detection
Out-of-band control character handling
You cannot move the cursor to a previous line after a line wrap.
You cannot insert a character if the insertion would force a line wrap or if a
tab follows the current cursor position.
You cannot delete a word at the beginning of a line after a line wrap.
Terminal Driver 53
Terminal Driver
5.2 Terminal Driver Features
Command recall, initiated by Ctrl/B or the up arrow, returns the last line entered
to the command-line buffer. At this point, you edit or reenter the line by pressing
the Return key. DCL extends command recall to the last 20 commands by using
the TRM$M_TM_NORECALL modifier to disable the terminal drivers recall
mechanism.
Any control key that is not defined by line editing is ignored. For application
programs that require control key input but do not perform QIO functions with
special read modifiers, the SET TERMINAL/NOLINE_EDIT DCL command
restores most of the terminal driver behavior described under OpenVMS Versions
3.0 through 3.7.
5.2.1.2 Control Characters and Special Keys
A control character is a character that controls action at the terminal rather
than passing data to a process. An ASCII control character has a code between 0
and 31, and 127 (hexadecimal 0 through 1F, and 7F); that is, all normal control
characters plus DELETE. (Table C1 lists the numeric values for all control
characters.)
You enter some control characters at the terminal by simultaneously pressing the
Ctrl key and a character key, such as Ctrl/x. Table 52 lists the terminal control
characters. You can change control character echo strings (Ctrl/C, Ctrl/Y, Ctrl/O,
and Ctrl/Z) on a systemwide basis (refer to the OpenVMS System Management
Utilities Reference Manual). You enter special keys, such as Return, Line Feed,
and Escape, by pressing a single key.
Several of the control characters do not function as described if the DCL command
SET TERMINAL/LINE_EDIT is not specified. Refer to the OpenVMS DCL
Dictionary for information on line editing function keys and the SET TERMINAL
command.
54 Terminal Driver
Terminal Driver
5.2 Terminal Driver Features
Table 52 Terminal Control Characters
Control Character
Meaning
Cancel
(Ctrl/C)
All queued and in-progress write operations and all inprogress read operations are successfully completed. The
status return is SS$_CONTROLC, or SS$_CONTROLY if
Ctrl/C is converted to Ctrl/Y.
Delete line
(Ctrl/U)
Delete word
(Ctrl/J or F13)
(Line feed)
Deletes the word before the cursor. Word terminators are all
control characters, space, comma, dash, period, and ! " # $ & (
) + @ [ \ ] ^ { | ~ / : ; <> = ? (see Appendix C).
Discard output
(Ctrl/O)
Terminal Driver 55
Terminal Driver
5.2 Terminal Driver Features
Table 52 (Cont.) Terminal Control Characters
Control Character
Meaning
End of line
(Ctrl/E)
Exit
(Ctrl/Z or F10)
Interrupt
(Ctrl/Y)
All queued and in-progress write operations and all inprogress read operations are successfully completed with a 0
transfer count. The status return is SS$_CONTROLY.
Move cursor to
beginning of line
(Ctrl/H or F12)
(Backspace)
Purge type-ahead
(Ctrl/X)
Recall
(Ctrl/B or
up arrow)
Redisplay input
(Ctrl/R)
56 Terminal Driver
Terminal Driver
5.2 Terminal Driver Features
Table 52 (Cont.) Terminal Control Characters
Control Character
Meaning
Restart output
(Ctrl/Q)
RET
(Return)
If used during a read (input) operation, RET echoes a carriagereturn/line-feed combination. All carriage returns are filled on
terminals with TT$M_CRFILL specified.
Stop output
(Ctrl/S)
TAB
(Ctrl/I)
Status
(Ctrl/T)
Displays the current time. Ctrl/T also displays the current node
and user name, the name of the image that is running, and
information about system resources that have been used during
the current terminal session.
Toggle
insert/overstrike
(Ctrl/A or F14)
Terminal Driver 57
Terminal Driver
5.2 Terminal Driver Features
not part of an escape sequence, but a complete escape sequence always terminates
a read operation. The return information in the read buffer and the I/O status
block includes the position and size of the terminating escape sequence in the
data record (see Section 5.5).
Any escape sequence received from a terminal is checked for correct syntax. If
the syntax is not correct, SS$_BADESCAPE is returned as the status of the
I/O. If the escape sequence does not fit in the user buffer, SS$_PARTESCAPE is
returned. If SS$_PARTESCAPE is returned, the application program must issue
enough single-character read requests, without timeout, to read the remaining
characters in the escape sequence, while parsing the syntax of the rest of the
escape sequence. Use of the TRM$_ESCTRMOVR item code prevents SS$_
PARTESCAPE errors. No syntax integrity is guaranteed across read operations.
Escape sequences are never echoed. Valid escape sequences take any of the
following forms (hexadecimal notation):
ESC <int>...<int> <fin>
(7-bit environment)
(8-bit environment)
The ESC key, a byte (character) of 1B. This character introduces the escape
sequence in a 7-bit environment.
CSI
<int>
<fin>
A final character in the range of 30 to 7E. This range includes uppercase and
lowercase letters, numbers, and 13 punctuation marks.
(8-bit environment)
CSI
<par>
<int>
<fin>
58 Terminal Driver
Terminal Driver
5.2 Terminal Driver Features
Section 5.2.1.2 describes control character functions during escape sequences.
Table C2 lists the valid ANSI and DIGITAL private escape sequences for
terminals that have the TT2$M_ANSICRT, TT2$M_DECCRT, TT2$M_DECCRT2,
TT2$M_AVO, TT2$M_EDIT, and TT2$M_BLOCK characteristics (see Table 56).
Table C2 also lists assumed and selectable ANSI modes and selectable DIGITAL
private modes. Only the names of the escape sequences and modes are listed
(for more information, refer to the specific user guide for the various terminals).
Unless otherwise noted, the operation of escape sequences and modes is identical
to the particular terminals that implement these features.
5.2.1.5 Type-Ahead Feature
Input (data received) from a terminal is always independent of concurrent output
(data sent) to a terminal. This feature is called type-ahead. Type-ahead is
allowed on all terminals, unless explicitly disabled by the set mode characteristic,
inhibit type-ahead (TT$M_NOTYPEAHD; see Table 55 and Section 5.4.3).
Data entered at the terminal is retained in the type-ahead buffer until the user
program issues an I/O request for a read operation. At that time, the data is
transferred to the program buffer and echoed at the terminal where it was typed.
Deferring the echo until the read operation is active allows the user process to
specify function code modifiers that modify the read operation. These modifiers
can include, for example, noecho (IO$M_NOECHO) and convert lowercase
characters to uppercase (IO$M_CVTLOW) (see Table 57).
If a read operation is already in progress when the data is typed at the terminal,
the data transfer and echo are immediate.
The action of the driver when the type-ahead buffer fills depends on the set mode
characteristic TT$M_HOSTSYNC (see Table 55 and Section 5.4.3). If TT$M_
HOSTSYNC is not set, Ctrl/G (bell) is returned to inform you that the type-ahead
buffer is full. The buffer must then be emptied, at which time a status of SS$_
DATAOVERUN is returned. If TT$M_HOSTSYNC is set, the driver stops input
by sending a Ctrl/S and the terminal responds by sending no more characters.
These warning operations begin eight characters before the type-ahead buffer fills
unless the TT2$M_ALTYPEAHD characteristic is set. In that case, the system
generation parameter TTY_ALTALARM is used. The driver sends a Ctrl/Q to
restart transmission when the type-ahead buffer empties completely, and the user
has posted another READ QIO.
The type-ahead buffer length is variable, with possible values in the range of 0
through 32,767. The length can be set on a systemwide basis through use of the
system generation parameter TTY_TYPAHDSZ. Terminal lines that do a large
amount of bulk input should use the characteristic TT2$M_ALTYPEAHD, which
allows the use of a larger type-ahead buffer specified by the system generation
parameters TTY_ALTYPAHD and TTY_ALTALARM. (TTY_ALTYPAHD specifies
the total size of the alternate type-ahead buffer; TTY_ALTALARM specifies the
threshold at which a Ctrl/S is sent.)
Certain input-intensive applications, such as block mode input terminals,
can take advantage of an optimization in the driver. If a terminal has the
characteristic TT2$M_PASTHRU and the read function IO$M_NOECHO is
specified, data is placed directly into the read buffer and thereby eliminates the
overhead for moving the data from the type-ahead buffer.
Terminal Driver 59
Terminal Driver
5.2 Terminal Driver Features
5.2.1.6 Line Terminators
A line terminator is the control sequence that you type at the terminal to indicate
the end of an input line. Optionally, the application can specify a particular line
terminator or class of terminators for read operations.
Terminators are specified by an argument to the QIO request for a read operation.
By default, they can be any ASCII control character except FF, VT, LF, TAB,
or BS (see Appendix C). If line editing is enabled, the only terminators are
CR, Ctrl/Z, or an escape sequence. Control keys that do not have an editing
function are nonfunctioning keys. If included in the request, the argument is a
user-selected group of characters (see Section 5.4.1.2).
All characters are 7-bit ASCII characters unless data is input on an 8-bit terminal
(see Section 5.4.1). The characteristic TT$M_EIGHTBIT determines whether a
terminal uses the 7-bit or 8-bit character set; see Table 55. All input characters
(except some special keys; see Section 5.2.1.2) are tested against the selected
terminators. The input is terminated when a match occurs or your input buffer
fills.
The terminal driver notifies the job controller to initiate login when it detects a
carriage-return terminator on a line with no current process (provided the line
is not a secure server or the type-ahead feature has not been disabled). A bell
character is sent when the notification occurs. A notification character other than
the bell character may be specified by setting the system generation parameter
TTY_AUTOCHAR.
5.2.1.7 Special Operating Modes
The terminal driver supports many special operating modes for terminal lines.
(Tables 55 and 56 in Section 5.3 list these modes.) All special modes are
enabled or disabled by the set mode and set characteristics functions (see
Section 5.4.3).
Terminal Driver
5.2 Terminal Driver Features
The following terms describe the state of a read request:
A read request is active when the terminal driver removes that request from
the head of the I/O queue.
A read request is started when the terminal driver moves the first character
into the read buffer.
In the terminal driver, write requests usually have priority. A write request can
interrupt an active, but not started, read request.
The terminal driver does not start a read request until all outstanding writes are
completed. This means that a read request could be removed from the head of
the read queue while write requests are outstanding, but the first character is not
moved into the read buffer until all outstanding writes are completed.
Once a read request is started, all write requests are queued until the read
completes. However, during a read operation many write requests can be
executed before the first input character is entered at the terminal. Terminal
lines that have the TT$M_NOECHO characteristic, or read functions that
include the IO$M_NOECHO function modifier, do not inhibit write operations
in full-duplex mode.
If a write function specifies the IO$M_BREAKTHRU modifier, the write operation
is not blocked, even by an active read operation. IO$M_BREAKTHRU does not
change the order in which write operations are queued.
When all I/O requests are entered using the Queue I/O Request and Wait
($QIOW) system service, there can be only one current I/O request at a time.
In this case, the order in which requests are serviced is the same for both halfand full-duplex modes.
The type-ahead buffer always buffers input data for which there is no current
read request, in both half- and full-duplex modes.
5.2.2.2 Formatting of Output
By default, output data is subject to formatting by the terminal driver. This
formatting includes actions such as wrapping, tab expansion, uppercase, and
fallback conversions. Applications that do not require formatting of data can
write with the IO$M_NOFORMAT modifier and thereby reduce overhead. IO$M_
NOFORMAT overrides all formatting except fallback translation. Setting the
PASTHRU mode (TT2$M_PASTHRU) is equivalent to writing with the noformat
modifier.
Fallback conversions occur regardless of formatting mode.
5.2.2.3 SET HOST Facility and Output Buffering
The SET HOST facility emulates the terminal driver in the way it writes data to
the terminal by stopping the display as soon as the abort character is entered.
However, the SET HOST facility behaves differently from the terminal driver in
that it buffers output data from the program that is executing. Occasionally, this
causes a perception problem for the user when the program is aborted with a
Ctrl/C, Ctrl/Y, or an out-of-band abort character. The user expects the program to
terminate and the display to stop immediately.
Terminal Driver
5.2 Terminal Driver Features
CTDRIVER and RTPAD
When used between two systems, the SET HOST facility consists of two
components: RTPAD on the local node and CTDRIVER on the remote node.
Both components buffer output data to enhance performance when using wide
area networks. CTDRIVER performs the initial buffering, queues the buffers for
network transfer, and returns a successful write status. The user should note
that the local terminal display reflects the output of the executing program after
the data has been buffered and transferred over the networknot as the output
buffers are filled on the remote node.
The delay between execution of an application and the display of its output can
lead to several anomalies in the effects of Ctrl/C, Ctrl/Y, and out-of-band abort
characters.
Output Line Not in Sequence Following an Abort Character
After you enter an abort character (Ctrl/C, Ctrl/Y, or an out-of-band abort
character) that causes the input or output to be aborted, it is possible to receive
an additional line of output. This occurs when the application program calls $QIO
(either directly or indirectly through RMS or language support routines) to output
data to a buffer at the same time the abort character is entered.
When CTDRIVER receives the abort character (Ctrl/C, Ctrl/Y, or an out-of-band
abort character) from the network, it flushes the current output buffers and
aborts any pending read operations. However, if the application program calls
$QIO with a write operation when the abort character is entered, the $QIO write
data is still buffered and then displayed. The data may not be the next output
in sequence from the users point of view, since all the previous output buffers in
CTDRIVER were flushed and the data in them was not displayed.
When using the terminal driver, the effect of an abort character on the display
screen is different. The terminal driver does not buffer output from the
application during program execution. If the application program has just called
$QIO with a write operation when the abort character is entered, then the $QIO
write data is displayed. Because all write operations are sequential and do not
complete until the output is actually displayed, the additional line displayed is in
sequence. There is no break in the data. Normally, the user will not notice that
there is an additional line.
Extra Input Prompt Following an Abort Character
For connections between systems, the CTERM protocol allows CTDRIVER to
synchronize with RTPAD before displaying any more data on the terminal.
Note
Prior to VAX VMS Version 5.2, a control character entered during program
execution to abort input and output could cause the system to display
more than one input prompt.
If the SET HOST facility is used between systems running VMS Version
5.2 and an earlier version, the extra input prompt is still displayed.
Terminal Driver
5.2 Terminal Driver Features
Processing Abort Characters
The abort character AST is delivered after the message describing the aborted
read operation has been received. Therefore, the read status should be set very
shortly after the abort character AST is delivered to the application. Note,
however, these are still two asynchronous events, and the application must still
synchronize with the completing read operation.
Note
Prior to VAX VMS Version 5.2, if an application had a read operation
pending and had queued a Ctrl/C, Ctrl/Y, or out-of-band abort character
AST, it was possible to queue multiple read operations unknowingly when
the read operation was aborted.
Terminal Driver
5.2 Terminal Driver Features
a minimum of 2 seconds after the hangup sequence begins. The hangup sequence
is not reversible. If the line hangs up, all enabled Ctrl/Y and out-of-band ASTs
are delivered; the Ctrl/Y AST P2 argument is overwritten with SS$_HANGUP.
The I/O operation in progress is canceled, and the status value SS$_HANGUP
is returned in the I/O status block. DCL is responsible for process deletion after
Ctrl/Y is delivered. If the process is suspended, DCL cannot run, and therefore
deletion cannot occur, until the process is resumed.
Note
Some systems, such as the VAXstation 3100, provide built-in serial lines
using 6-pin modular jacks. These lines do not provide the minimum
required modem signals. Although the hardware may allow a dial-out
connection to be established, hangup cannot be detected and process
deletion will not occur on these lines.
Terminal Driver
5.2 Terminal Driver Features
Figure 51 Modem Control: Two-Way Simultaneous Operation
DTR
RTS
TX
Idle
OFF
OFF
MARK
TTY_DIALTYPE=2
Delay 2 sec
DTR
ON
RTS
ON
DZ11
Init2
ON
OFF
ON
CARRIER
ON
ON
Transmit0
Start 30sec timer
PORT_RESUME
TTY_DIALTYPE=4
Reference Count>0
DSR
RING
DTR
ON
RTS
ON
Start 30sec timer
Reference
Count=0
ON
Delay 1 sec
Init1
Timeout
RING
DZ11 Wait
Wait
DSR
RING Wait
Transmit
Transmit and receive data
CARRIER
Transmit1
OFF
CARRIER
ON
Timeout
Shutdown
DTR
DSR
OFF
OFF
Delay 1 sec
Timeout
DSR
OFF
Shut1
Start 2sec timer
ZK0687GE
Terminal Driver
5.2 Terminal Driver Features
Bit 1 of the system generation parameter TTY_DIALTYPE enables alternate
modem protocol on a systemwide basis. If bit 1 is 0 (the default), the RING signal
is not used. If bit 1 is 1, the modem protocol delays setting the DTR signal until
the RING signal is detected.
Remote terminal connections have a timeout feature for the security of dialup
lines. If no channel is assigned to the port within 30 seconds, or a port
with an assigned channel is not allocated, the DTR signal is dropped. Such
action prevents an unused terminal from tying up a line. However, there are
configurations (such as a printer connected to a remote line) in which the line
should not be dropped even though it is not being used interactively. To bypass
the 30-second timeout, set the system generation parameter TTY_DIALTYPE
to 4. (Note that if TTY_DIALTYPE is equal to 4, all dialup lines will skip the
timeout waiting for a channel to be assigned.)
Table 53 Control and Data Signals (Full Modem Mode Configuration)
Signal
Source
MUX1
Meaning
Transmitted
data (TxD)
Computer
All
Received data
(RxD)
Modem
All
Request to
send (RTS)
Computer
Full
Clear to send
(CTS)
Modem
Full
Modem
Full
1 Multiplexers (All = any supported controller; Full = DZ32, DMF32, DMB32, DMZ32, DHU11, DHV11,
and CXY08).
Terminal Driver
5.2 Terminal Driver Features
Table 53 (Cont.) Control and Data Signals (Full Modem Mode Configuration)
Signal
Source
MUX1
Meaning
Data channel
received line
signal detector
(CARRIER)
Modem
All
Data terminal
ready (DTR)
Computer
All
Calling
indicator
(RING)
Modem
All
1 Multiplexers (All = any supported controller; Full = DZ32, DMF32, DMB32, DMZ32, DHU11, DHV11,
and CXY08).
Terminal Driver
5.2 Terminal Driver Features
On VAX and Alpha systems, after this command is entered, a terminal with the
TT2$M_DISCONNECT characteristic logs in as VTAn:, rather than with the
physical terminal name. When a terminal is set up in this manner, no input
or output operations are allowed to the physical device; I/O is automatically
redirected to the appropriate virtual terminal.
Following are four ways in which a terminal can become disconnected:
Modem signals between the host and the terminal are lost.
A user presses the BREAK key on a terminal that has the TT2$M_SECURE
characteristic.
Unsolicited data in the type-ahead buffer. The use of the associated mailbox
can be enabled and disabled as a subfunction of the read and write requests
(see Sections 5.4.1 and 5.4.2). (Initially, mailbox messages are enabled on all
terminals. This is the default state.) Therefore, the user process can enter
into a dialogue with the terminal after an unsolicited data message arrives.
Then, after the dialogue is over, the user process can reenable the unsolicited
data message function on the last I/O exchange. Only one message is sent
between read operations.
Terminal hangup. When a remote line loses the carrier signal, it hangs up; a
message is sent to the mailbox. When hangup occurs on lines that have the
characteristic TT$M_REMOTE set, the line returns to local mode.
Terminal Driver
5.2 Terminal Driver Features
Messages placed in the mailbox have the following content and format (see
Figure 52):
Device unit number to identify the terminal that sent the message.
Controller name.
16 15
Unit Number
Controller Name *
87
Message Type
Counted String
4
8
12
16
20
Broadcast
Message
Terminal Driver
5.2 Terminal Driver Features
The SET TERMINAL qualifier /EIGHT_BIT specifies that the terminal uses
8-bit ASCII code. /NOEIGHT_BIT, which is the default, specifies 7-bit ASCII
code. (If parity is specified, the parity bit is separate from the data bits.) The
optimal settings for automatic baud rate detection on Compaq terminals are
/NOEIGHT_BIT/PARITY=EVEN or /EIGHT_BIT/NOPARITY, although automatic
baud rate detection also works with other combinations, such as /NOEIGHT_
BIT/NOPARITY.
Table 56 describes the terminal characteristic TT2$M_AUTOBAUD, which
allows the baud rate to be set automatically at login.
Compaq does not usually recommend specifying the /FRAME qualifier with the
SET TERMINAL command. The terminal driver selects the frame size (the
number of data bits that the device can transmit) based on how the /PARITY and
/EIGHT_BIT qualifiers are set. It might be necessary to change these values if
the terminal is not made by Compaq.
Terminal Driver
5.3 Terminal Driver Device Information
Table 54 Terminal Device-Independent Characteristics
Characteristic
Meaning
DEV$M_AVL
DEV$M_CCL
DEV$M_DET
Terminal is detached.
DEV$M_IDV
DEV$M_ODV
DEV$M_OPR
DEV$M_REC
Device is record-oriented.
DEV$M_RTT
DEV$M_SPL
Device is spooled.
DEV$M_TRM
Device is a terminal.
DEV$M_NET
Meaning
TT$M_CRFILL
Terminal requires fill after the Return key is pressed (the fill
type can be specified by the set mode function P4 argument).
TT$M_EIGHTBIT
Terminal uses the 8-bit ASCII character set (see Appendix C).
Terminals without this characteristic use the 7-bit ASCII
code. In this case, the eighth bit is masked out on received
characters and is ignored on output characters. The eighth bit
is meaningful only if TT$M_EIGHTBIT is set.
TT$M_ESCAPE
TT$M_HALFDUP
TT$M_HOSTSYNC
TT$M_LFFILL
TT$M_LOWER
1 Defined by the $TTDEF macro. The prefix can be TT$M_ or TT$V_. TT$M_ is a bit mask whose bit
corresponds to the specific field; TT$V_ is a bit number.
Terminal Driver
5.3 Terminal Driver Device Information
Table 55 (Cont.) Terminal Characteristics
Value1
Meaning
TT$M_MBXDSABL
TT$M_MECHFORM
TT$M_MECHTAB
TT$M_MODEM
TT$M_NOBRDCST
TT$M_NOECHO
TT$M_NOTYPEAHD
TT$M_READSYNC
TT$M_REMOTE
TT$M_SCOPE
TT$M_TTSYNC
1 Defined by the $TTDEF macro. The prefix can be TT$M_ or TT$V_. TT$M_ is a bit mask whose bit
corresponds to the specific field; TT$V_ is a bit number.
Terminal Driver
5.3 Terminal Driver Device Information
Table 55 (Cont.) Terminal Characteristics
Value1
Meaning
TT$M_WRAP
1 Defined by the $TTDEF macro. The prefix can be TT$M_ or TT$V_. TT$M_ is a bit mask whose bit
corresponds to the specific field; TT$V_ is a bit number.
Meaning
TT2$M_ALTYPEAHD
TT2$M_ANSICRT
TT2$M_APP_KEYPAD
TT2$M_AUTOBAUD
TT2$M_AVO
1 Defined by the $TT2DEF MACRO. The prefix can be TT2$M_ or TT2$V_. TT2$M_ is a bit mask in
which the bit set corresponds to the specific field; TT2$V_ is a bit number.
Terminal Driver
5.3 Terminal Driver Device Information
Table 56 (Cont.) Extended Terminal Characteristics
Value1
Meaning
TT2$M_BLOCK
TT2$M_BRDCSTMBX
TT2$M_COMMSYNC
TT2$M_DECCRT
TT2$M_DECCRT2
1 Defined by the $TT2DEF MACRO. The prefix can be TT2$M_ or TT2$V_. TT2$M_ is a bit mask in
which the bit set corresponds to the specific field; TT2$V_ is a bit number.
Terminal Driver
5.3 Terminal Driver Device Information
Table 56 (Cont.) Extended Terminal Characteristics
Value1
Meaning
TT2$M_DECCRT3
TT2$M_DECCRT4
TT2$M_DIALUP
TT2$M_DISCONNECT
TT2$M_DMA
TT2$M_DRCS
TT2$M_EDIT
TT2$M_EDITING
TT2$M_FALLBACK
TT2$M_HANGUP
TT2$M_INSERT
1 Defined by the $TT2DEF MACRO. The prefix can be TT2$M_ or TT2$V_. TT2$M_ is a bit mask in
which the bit set corresponds to the specific field; TT2$V_ is a bit number.
2 If an attempt is made to turn on TT2$V_FALLBACK for a disconnected virtual terminal (_VTAx:)
or if the Terminal Fallback Facility (TFF) has not been activated, the status code SS$_BADPARAM
is returned. For more information on TFF, refer to the OpenVMS Terminal Fallback Utility Manual
(available on the Documentation CD-ROM).
Terminal Driver
5.3 Terminal Driver Device Information
Table 56 (Cont.) Extended Terminal Characteristics
Value1
Meaning
TT2$M_LOCALECHO
TT2$M_MODHANGUP
TT2$M_PASTHRU
TT2$M_PRINTER
TT2$M_REGIS
TT2$M_SIXEL
TT2$M_SECURE
TT2$M_SETSPEED
TT2$M_SYSPWD
TT2$M_XON
1 Defined by the $TT2DEF MACRO. The prefix can be TT2$M_ or TT2$V_. TT2$M_ is a bit mask in
which the bit set corresponds to the specific field; TT2$V_ is a bit number.
Terminal Driver
5.3 Terminal Driver Device Information
To customize terminal behavior and usage, the operating system divides terminal
characteristics into the following categories:
Format effectorsThe following characteristics allow you to specify terminaldependent formatting requirements:
TT$M_CRFILL
TT$M_EIGHTBIT
TT$M_LFFILL
TT$M_LOWER
TT2$M_LOCALECHO
TT$M_MECHFORM
TT$M_MECHTAB
TT$M_NOECHO
TT$M_SCOPE
TT$M_WRAP
TT2$M_AVO
TT2$M_BLOCK
TT2$M_DECCRT
TT2$M_DECCRT2
TT2$M_DECCRT3
TT2$M_DECCRT4
TT2$M_DRCS
TT2$M_EDIT
TT2$M_PRINTER
TT2$M_REGIS
TT2$M_SIXEL
Their use allows execution of these programs without knowledge of the actual
terminal type. For example, a program should check for TT2$M_DECCRT
rather than for VT100 or VT101.
TT$M_HALFDUP
TT2$M_PASTHRU
TT$M_TTSYNC
TT$M_HOSTSYNC
TT2$M_AUTOBAUD
TT2$M_DIALUP
TT2$M_DISCONNECT
TT2$M_DMA
TT2$M_HANGUP
TT$M_MODEM
TT$M_NOTYPEAHD
TT2$M_MODHANGUP
TT2$M_SECURE
TT2$M_SETSPEED
TT2$M_SYSPWD
TT2$M_COMMSYNC
TT2$M_FALLBACK
TT2$M_INSERT
TT$M_NOBRDCST
TT2$M_EDITING
TT$M_MBXDSABL
TT2$M_XON
Terminal Driver
5.4 Terminal Function Codes
5.4.1 Read
When a read function code is issued, the user-specified buffer is filled with
characters from the associated terminal. The operating system provides the
following read function codes:
Read operations are terminated if either of the following two conditions occurs:
P1The starting virtual address of the buffer that is to receive the data read.
P2The size of the buffer that is to receive the data read in bytes. (The
system generation parameter, MAXBUF, and the terminal driver limit the
maximum size of the buffer. The terminal driver will only function with
buffer sizes less than 32718 bytes.)
P6The size of the prompt buffer that is to be written to the terminal; for
read with prompt operations using the IO$_READPROMPT function code.
In a read with prompt operation, the P5 and P6 arguments specify the address
and size of a prompt string buffer containing data to be written to the terminal
before the input data is read. In a read with prompt operation, both read and
write operations are performed on the specified terminal. The prompt string
buffer is formatted like any other write buffer. If cursor position specifiers are
supplied, they are not interpreted by the driver but passed to the terminal.
During a read with prompt operation, pressing Ctrl/O (which is turned off at the
start of any read operation) stops the prompt string. If you press either Ctrl/U
or Ctrl/X, the entire prompt string is written out again, and the current input is
ignored. If you press Ctrl/R, the current prompt string and input are written to
the terminal.
Depending on the terminal type and your input, the prompt string can be very
simple or quite complexfrom single command prompts to screen fills followed
by input data. Compaq recommends that prompt strings contain only one leading
line feed.
Terminal Driver
5.4 Terminal Function Codes
In PASTHRU mode, data received from the associated terminal is placed in
the user buffer as binary information without interpretation. (Prompts are not
refreshed after a broadcast in PASTHRU mode.)
5.4.1.1 Function Modifier Codes for Read QIO Functions
Eight function modifiers can be specified with IO$_READVBLK, IO$_
READLBLK, and IO$_READPROMPT. Table 57 lists these function modifiers
and IO$_EXTEND, which is described in Section 5.4.1.3. All read function
modifiers are supported for LAT devices.
Table 57 Read QIO Function Modifiers for the Terminal Driver
Code
Consequence
IO$M_CVTLOW
IO$M_DSABLMBX
IO$M_ESCAPE
IO$M_EXTEND
IO$M_NOECHO
IO$M_NOFILTR
IO$M_PURGE
Terminal Driver
5.4 Terminal Function Codes
Table 57 (Cont.) Read QIO Function Modifiers for the Terminal Driver
Code
Consequence
IO$M_TIMED
IO$M_TRMNOECHO
Terminal Driver
5.4 Terminal Function Codes
The long form allows use of a more comprehensive set of terminator characters.
Any mask equal to or greater than 1 byte is acceptable. For example, a mask size
of 16 bytes allows all 7-bit ASCII characters to be used as terminators; a mask
size of 32 bytes allows all 8-bit characters to be used as terminators for 8-bit
terminals.
If the terminator mask is all zeros, there are no specified terminators. The
read operation ends when the specified number of bytes (characters) have been
transferred to the input buffer.
Certain control keys will not act as terminators unless IO$M_NOFILTR
is specified or the line has the TT2$M_PASTHRU characteristic (see
Section 5.2.1.2).
Figure 53 Short and Long Forms of Terminator Mask Quadwords
31
SHORT:
0
Terminator Character Bit Mask
31
LONG:
16 15
(Not Used)
0
Mask Size in Bytes
Address of Mask
ZK0689GE
The itemlist read function code and modifier combination takes the following
device- or function-dependent arguments:
P1The starting virtual address of the buffer that is to receive the data read.
Terminal Driver
5.4 Terminal Function Codes
P2The size of the buffer that is to receive the data read in bytes. If
required, the P2 size includes additional space for an overflow buffer to
hold an escape sequence terminator (see item code TRM$_ESCTRMOVR in
Table 58).
Note
The IO$_READxBLK and IO$_WRITExBLK are limited by the system
parameter MAXBUF as well as the terminal driver. The terminal driver
will only function with buffer sizes less than 32718 bytes.
16 15
Item Code
0
Buffer Length
Table 58 lists the item codes that can be specified in the first longword of the
item descriptors.
Table 58 Item Codes for Itemlist Read Operations for the Terminal Driver
Item Code
Meaning
TRM$_ALTECHSTR
Terminal Driver
5.4 Terminal Function Codes
Table 58 (Cont.) Item Codes for Itemlist Read Operations for the Terminal
Driver
Item Code
Meaning
TRM$_EDITMODE
TRM$_ESCTRMOVR
TRM$K_EM_DEFAULT
TRM$K_EM_RDVERIFY
TRM$_FILLCHR
A 2-byte value that indicates the fill and clear character for
TRM$K_EM_RDVERIFY. The first byte of the immediate data
longword specifies the clear character; the second byte specifies
the fill character.
This item code is for character validating read mode (TRM$K_
EM_RDVERIFY) editing only.
TRM$_INIOFFSET
TRM$_INISTRNG
Terminal Driver
5.4 Terminal Function Codes
Table 58 (Cont.) Item Codes for Itemlist Read Operations for the Terminal
Driver
Item Code
Meaning
TRM$_MODIFIERS
Read modifiers. The immediate data longword contains a 32bit value that specifies modifiers to read operations. The read
operations are defined in $TRMDEF. The buffer length word
must be zero. The following bits are defined:
TRM$M_TM_ARROWS
TRM$M_TM_AUTO_TAB
TRM$M_TM_CVTLOW
Lowercase alphabetic
characters (hexadecimal 61 to
7A) are converted to uppercase
when transferred to the user
buffer or echoed.
TRM$M_TM_DSABLMBX
TRM$M_TM_ESCAPE
Terminal Driver
5.4 Terminal Function Codes
Table 58 (Cont.) Item Codes for Itemlist Read Operations for the Terminal
Driver
Item Code
Meaning
TRM$M_TM_NOCLEAR
TRM$M_TM_NOECHO
TRM$M_TM_NOEDIT
TRM$M_TM_NOFILTR
TRM$M_TM_NORECALL
TRM$M_TM_OTHERWAY
TRM$M_TM_PURGE
TRM$M_TM_R_JUST
TRM$M_TM_TERM_
ARROW
TRM$M_TM_TERM_DEL
Terminal Driver
5.4 Terminal Function Codes
Table 58 (Cont.) Item Codes for Itemlist Read Operations for the Terminal
Driver
Item Code
Meaning
TRM$M_TM_TOGGLE
TRM$M_TM_TIMED
TRM$M_TM_
TRMNOECHO
TRM$_PICSTRNG
Meaning
TRM$M_CV_UPPER
Uppercase alphabetic
TRM$M_CV_LOWER
Lowercase alphabetic
TRM$M_CV_NUMERIC
Numeric (09)
TRM$M_CV_NUMPUNC
Numeric punctuation (+ - .)
TRM$M_CV_PRINTABLE
TRM$M_CV_ANY
Any character
Terminal Driver
5.4 Terminal Function Codes
Table 58 (Cont.) Item Codes for Itemlist Read Operations for the Terminal
Driver
Item Code
Meaning
TRM$_PROMPT
TRM$_TERM
TRM$_TIMEOUT
Terminal Driver
5.4 Terminal Function Codes
If the modifier TRM$M_TM_AUTO_TAB is set in TRM$_MODIFIERS, then
detection of a full field terminates the read operation. In the event of autotab
termination, the terminator character in the IOSB is null. If the autotab option
is not selected, then termination occurs when one more character is typed to a
full field. Applications can detect this condition when the terminating character
index is one character beyond the end of the field. The extra character is reported
as the terminator. In a left-justified field, the IOSB index to the terminator is
zero-based; in a right-justified field, this index is one-based.
If a read verify function is interrupted by an asynchronous write operation, the
read verify is completed with status SS$_OPINCOMPL.
No line editing functions other than the delete character function are supported
for read verify.
5.4.2 Write
Write operations display the contents of a user-specified buffer on the associated
terminal. The operating system provides the following write I/O functions, which
are listed with their function codes:
The write function codes can take the following device- or function-dependent
arguments:
P2The number of bytes that are to be written to the terminal. (The system
generation parameter, MAXBUF, and the terminal driver limit the maximum
size of the buffer. The terminal driver will only function with buffer sizes less
than 32718 bytes.)
P3, P5, and P6 are not meaningful for terminal write operations.
In write virtual block and write logical block operations, the buffer (P1 and P2) is
formatted for the selected terminal and includes the carriage control information
specified by P4.
Unless TT$M_MECHFORM is specified, multiple line feeds are generated for
form feeds. The number of line feeds generated depends on the current page
position and the length of the page. By producing a carriage return after the last
line feed, a form feed also moves the cursor to the left margin. Multiple spaces
are generated for tabs if the characteristics of the selected terminal do not include
TT$M_MECHTAB (this does not apply to write physical block operations). Tab
stops occur every eight characters or positions.
CTDRIVER and Buffered Output
CTDRIVER, a component of the SET HOST facility, buffers output from remote
terminals in order to package multiple output requests into a single network
transfer. As a result, control is returned early to the user with a status of SS$_
NORMAL when the output buffer has been filled and successfully queued.
Terminal Driver
5.4 Terminal Function Codes
Note that this output might not be displayed if the user enters an abort character
or a Ctrl/O.
5.4.2.1 Function Modifier Codes for Write QIO Functions
Five function modifiers can be specified with IO$_WRITEVBLK, IO$_
WRITELBLK, and IO$_WRITEPBLK. Table 59 lists these function modifiers.
All write function modifiers are supported for LAT devices.
Table 59 Write QIO Function Modifiers for the Terminal Driver
Code
Consequence
IO$M_BREAKTHRU
IO$M_CANCTRLO
IO$M_ENABLMBX
IO$M_NOFORMAT
IO$M_REFRESH
1 Any interruption caused by the execution of the $BRDCST or the $BRKTHRU system service
broadcasting messages to terminals is referred to as a write breakthrough.
P4:
POSTFIX
PREFIX
(Not Used)
FORTRAN
ZK0690GE
Only bytes 0, 2, and 3 in the longword are used. Byte 1 is ignored. If the loworder byte (byte 0) is not 0, the contents of the longword are interpreted as a
Fortran carriage control specifier. Table 510 lists the possible byte 0 values (in
hexadecimal) and their meanings.
Terminal Driver
5.4 Terminal Function Codes
Table 510 Write Function Carriage Control (FORTRAN: Byte 0 Not Equal to 0)
Byte 0 Value
(hexadecimal)
ASCII
Character
20
(space)
30
31
2B
24
All other
values
1A
Meaning
Terminal Driver
5.4 Terminal Function Codes
Table 511 Write Function Carriage Control (P4 byte 0 = 0)
Prefix/Postfix Bytes (Hexadecimal)
Bit 7
Bits 06
Meaning
17F
Bit 7
Bit 6
Bit 5
Bits 04
Meaning
01F
01F
01F
Reserved.
Terminal Driver
5.4 Terminal Function Codes
Figure 56 Write Function Carriage Control (Prefix and Postfix Coding)
(Space)
P4:
8D
Sequence:
1
Sequence:
"0"
P4:
8D
8D
8C
8D
8D
18
Prefix = NL
Print
Postfix = NULL
Sequence:
Prefix = NULL
Print
Postfix = CR
Sequence:
"$"
P4:
Prefix = FF
Print
Postfix = CR
Sequence:
"+"
P4:
Prefix = NL, NL
Print
Postfix = CR
Sequence:
"1"
P4:
Prefix = NL
Print
Postfix = CR
Prefix = 24NL
Print
Postfix = CR
ZK0665GE
P5Parity flags
Terminal Driver
5.4 Terminal Function Codes
Figure 57 Set Mode and Set Characteristics Buffers
31
24 23
16 15
Page Width
Page Length
8 7
Type
0
Class
P2 = 8 (Default)
31
24 23
16 15
Type
Page Width
Page Length
8 7
0
Class
Note
Make sure that the selected device is a terminal before performing any set
mode function, particularly when using SYS$INPUT or SYS$OUTPUT.
The P3 argument defines the device speed, such as TT$C_BAUD_300. The low
eight bits specify the transmit speed, and the high eight bits specify the receive
speed. If no receive speed is specified, the indicated transmit speed is used for
both transmitting and receiving. If neither the transmit nor the receive speed is
specified (P3 = 0), the baud rate is not changed. The terminal driver ignores the
receive speed bits for interfaces that do not support split-speed operation. While
speeds up to 19.2 K baud can be specified, not all controllers support all speed
combinations. Refer to the associated hardware documentation to determine
which speeds are supported by your controller.
P4 contains fill counts for the carriage-return and line-feed characters. Bits 0
through 7 specify the number of fill characters used after a carriage return. Bits
8 through 15 specify the number of fill characters used after a line feed.
P4 is applicable only if TT$M_CRFILL or TT$M_LFFILL is specified as a
terminal characteristic for the current QIO request; see Table 55.
Several parity flags can be specified in the P5 argument:
Terminal Driver
5.4 Terminal Function Codes
To take the existing parity settings, modify them, and use them in the set mode
or set characteristic function, move the byte starting at the second nibble of the
buffer that is going to be used in the P5 argument. For example, the following
instructions change the parity from even to odd:
insv
bisl
The following instruction then resets the parity to its original state:
bicl
#tt$m_odd!tt$m_parity, flags
See Section 5.2.5 for information about the SET TERMINAL/FRAME command.
Application programs that change terminal characteristics should perform the
following steps:
1. Use the IO$_SENSEMODE function to read the current characteristics.
2. Modify the characteristics.
3. Use the set mode function to write back the results.
4. If the characteristic is intended to be reset when the image exits, the
application must perform this operation.
Failure to follow this sequence will result in clearing any previously set
characteristic.
Two stop bits are used only for data rates less than or equal to 150 baud; higher
data rates default to one stop bit.
The set mode and set characteristics functions can take the enable Ctrl/C AST,
enable Ctrl/Y AST, enable out-of-band AST, hangup, set modem, broadcast, and
loopback function modifiers that are described in the following sections.
Terminal Driver
5.4 Terminal Function Codes
Note
If an attempt is made to turn on TT2$V_FALLBACK for a disconnected
virtual terminal (_VTAx:) or if the Terminal Fallback facility has not been
activated, the status code SS$_BADPARAM will be returned. For more
information on TFF, refer to the OpenVMS Terminal Fallback Utility
Manual (available on the Documentation CD-ROM).
IO$_SETMODE!IO$M_HANGUP
IO$_SETCHAR!IO$M_HANGUP
5.4.3.2 Enable Ctrl/C AST and Enable Ctrl/Y AST Function Modifiers
Both set mode functions can take the enable Ctrl/C AST and enable Ctrl/Y AST
function modifiers. These function modifiers request the terminal driver to queue
an AST for the requesting process when you press Ctrl/C or Ctrl/Y. The following
combinations of function code and modifier are provided:
These function code modifier pairs take the following device- or functiondependent arguments:
P1Address of the AST service or 0 if the corresponding AST is disabled
P2AST parameter
P3Access mode to deliver AST (maximized with callers access mode)
If the respective enabling is in effect, pressing Ctrl/C or Ctrl/Y gains the attention
of the enabling process (see Table 52).
Enable Ctrl/C and Ctrl/Y AST are one-time enabling function modifiers. After
the AST occurs, it must be explicitly reenabled by one of the two function code
combinations before an AST can occur again. This function code is also used to
disable the AST. The function is subject to AST quotas.
You can have more than one Ctrl/C or Ctrl/Y enabled; pressing Ctrl/C, for
example, results in the delivery of all Ctrl/C ASTs. ASTs are queued and
delivered to the user process on a first-in/first-out basis for each access mode.
However, ASTs are processed in the reverse order of the Ctrl/C AST or Ctrl/Y
AST requests that have been issued to the terminal driver (on a last-in/first-out
basis).
Terminal Driver
5.4 Terminal Function Codes
If no enable Ctrl/C AST is present, the holder of an enable Ctrl/Y AST receives
an AST when Ctrl/C is pressed; carriage-return/line-feed combination, ^Y, and
Return are echoed.
Figure 58 shows the relationship of Ctrl/C and Ctrl/Y with the out-of-band
function. If Ctrl/C or Ctrl/Y is an enabled out-of-band character, any out-of-band
ASTs specified for this character are delivered. If IO$M_INCLUDE function
modifier is included in the out-of-band AST request for this character, an enabled
Ctrl/C or Ctrl/Y AST is also delivered.
Enable Ctrl/C AST requests are flushed by the Cancel I/O on the Channel
($CANCEL) system service. Enable Ctrl/Y AST requests are flushed by the
Deassign I/O Channel ($DASSGN) system service.
Ctrl/Y is normally used to gain the attention of the command interpreter and
to input special commands such as DEBUG, STOP, and CONTINUE. Programs
that are run from a command interpreter should not enable Ctrl/Y. Because ASTs
are delivered on a first-in/first-out basis, the command interpreters AST routine
gets control first, and might not allow the programs AST to be delivered at all.
Programs that require the use of Ctrl/Y should use the LIB$DISABLE_CTRL
RTL routine to disable DCL recognition of Ctrl/Y.
See Example 54 for a programming example that demonstrates Ctrl/Y and
Ctrl/C handling under OpenVMS.
Section 5.2.1.2 describes other effects of Ctrl/C and Ctrl/Y.
5.4.3.3 Set Modem Function Modifier
The set modem function modifier is used in maintenance operations to allow a
process to activate and deactivate modem control signals. Both set mode and set
characteristics functions can take the set modem function modifier. The following
combinations of function code and modifier are provided:
IO$_SETMODE!IO$M_SET_MODEM!IO$M_MAINT
IO$_SETCHAR!IO$M_SET_MODEM!IO$M_MAINT
Note
For LAT devices, the set modem field for maintenance operations of the
IO$M_SET_MODEM!IO$M_MAINT function modifier is unsupported and
may return unpredictable results.
These function code modifier pairs take the following device- or functiondependent argument:
P1The address of a quadword block that specifies which modem control
signals to activate or deactivate
Figure 59 shows the format of this block.
Terminal Driver
5.4 Terminal Function Codes
Figure 58 Relationship of Out-of-Band Function with Control Characters
Character Typed
on Keyboard
Deliver
outofband
AST.
If TT$M_EIGHTBIT
not set, strip bit 7
of character.
Yes
CTRL/S
or
CTRL/Q
?
No
Automatically
reenable
AST.
Is
TT2$M_PASTHRU
set?
IO$M_INCLUDE
set for this
character in any
outofband
AST?
No
Is this
an enabled
outofband
character
?
Yes
Yes
No
Yes
Done
No
CTRL/C
CTRL/Y
Control/C
enabled
?
CTRL/O
No
CTRL/S
CTRL/Q
CTRL/X
Other
Discard output/
continue
output.
Flush
typeahead
buffer.
Done
Done
Yes
Control/Y
enabled
?
Is
TT$M_TTSYNC
set
?
No
Deliver
Control/C
AST.
Deliver
Control/Y
AST.
OneShot
OneShot
Done
Done
Yes
Yes
No
Is
TT$M_TTSYNC
set
?
No
Stop output
stream.
Resume
output
stream.
Done
Done
Put character
in typeahead
buffer.
ZK1202GE
The modem on and modem off fields, in combination or separately, can specify one
or more of the following values:
Terminal Driver
5.4 Terminal Function Codes
Figure 59 Set Mode P1 Block
31
24 23
Modem Off
16 15
8 7
Modem On
ZK0692GE
The $TTDEF macro defines the values for these values. These values can only be
specified if the terminal characteristic TT$M_MODEM is not set. Otherwise, an
error (SS$_ABORT) will result.
Notes
The set modem function is not supported for remote terminals. The status
SS$_DEVREQERR is returned in the I/O status block.
Because the DMF32 does not provide the secondary transmitted data
signal (Sec Txd), the driver sets the secondary request to send the signal.
Users should connect a jumper cable between pins 14 and 19 on the
DMF32.
IO$_SETMODE!IO$M_LOOP!IO$M_MAINT
IO$_SETCHAR!IO$M_LOOP!IO$M_MAINT
Data transmitted in the loopback mode should only be written in records less
than or equal to the size of the type-ahead buffer (see Section 5.2.1.5). Programs
that use the loopback function modifier should incorporate a 1-second delay to
allow the controller to enable the loopback mode after the request is posted. Write
requests should also include the IO$M_NOFORMAT function modifier to prevent
terminal driver from formatting input or output data.
Note
The serial line interfaces for the VAX 8200 processor implement an
internal loopback bus that is common to all four serial lines. The
Terminal Driver
5.4 Terminal Function Codes
hardware allows all serial lines operating in loopback mode to transmit
data to the bus at the same time. If more than one serial line writes data
to the bus, all of the transmitted data is combined and made available
to the receiving end of those same serial lines. Therefore, the received
data may be different from the transmitted data if more than one serial
line is operating in loopback mode at the same time. To prevent receiving
such spurious data, you must not operate multiple serial lines in loopback
mode.
The operating system provides another function modifier to reset a terminal line
previously placed in loopback mode. The following combinations of function code
and modifier are provided:
IO$_SETMODE!IO$M_UNLOOP!IO$M_MAINT
IO$_SETCHAR!IO$M_UNLOOP!IO$M_MAINT
Programs that use the unloop function modifier should incorporate a 1-second
delay to allow the controller to reset the loopback mode after the request is
posted.
Note
IO$M_LOOP and IO$M_UNLOOP are not supported for LAT devices.
These function code modifier pairs take the following device- or functiondependent arguments:
P2Address of a character mask with the same format as the short form
terminator mask (see Section 5.4.1.2).
P3Access mode to deliver AST (maximized with the callers access mode).
Terminal Driver
5.4 Terminal Function Codes
Out-of-band ASTs are repeating ASTs; they continue to be delivered until
specifically disabled. Out-of-band AST enables are flushed by the Cancel I/O
on Channel ($CANCEL) system service.
5.4.3.6 Broadcast Function Modifier
The broadcast function modifier allows you to turn on or turn off selected
broadcast requester identifiers (IDs). The following combination of function
code and modifier is provided:
IO$_SETMODE!IO$M_BRDCST
This function code modifier pair takes the following device- or function-dependent
arguments:
P1A buffer that contains the bits that specify the requester IDs to be
broadcast
Meaning
BRK$C_DCL
BRK$C_GENERAL
BRK$C_MAIL
BRK$C_PHONE
BRC$C_QUEUE
BRK$C_SHUTDOWN
BRK$C_URGENT
BRK$C_USERn
Terminal Driver
5.4 Terminal Function Codes
This section describes the capabilities of the QIO interface to the LAT port driver
(LTDRIVER). The QIO interface allows application programs to access and modify
information contained in the LTDRIVER data structures and to initiate events
and obtain status information. You must use these QIO functions to establish a
connection to a remote device or service from an application program. Compaq
does not support any other methods of connection.
The LTDRIVER responds to TEST SERVICE commands issued at terminal
servers that support the TEST SERVICE command, such as the DECserver 200
and DECserver 500 servers.
LAT devices can use all read and write function modifiers listed for the terminal
driver function codes except those modifiers that apply to modems (see Sections
5.4.1 and 5.4.2).
The operating system does not support the following set mode or set
characteristics function code modifiers for LAT devices:
IO$M_LOOP
IO$M_UNLOOP
TT$M_ALTRPAR
TT$M_ALTFRAME
TT$M_MODEM
TT$M_READSYNC
TT2$M_SETSPEED
With LAT devices, the terminal server, rather than the host, handles flow control
to the physical device. A separate flow control mechanism exists between the
server and the host.
5.4.4.1 LAT Port Types
QIO functions can be used to create the following LAT port types:
Application Port. This type of port can be used to connect to a remote device
(typically a printer) on a terminal server or to a dedicated port on another
LAT service node. This is the default port type. See Section 5.4.4.5 for a
description of programming an application port.
Dedicated Port. This type of port specifies that the logical port on your node
is dedicated to an application service. When users on a terminal server (or on
another node that supports outgoing connections) request a connection to this
service name, they are connected to a dedicated port. See Section 5.4.4.6 for a
description of programming a dedicated port and application service.
Forward Port. This type of port is used for outgoing LAT connections (to
remote services) and is created by assigning a channel to the LAT template
device _LTA0: with the $ASSIGN system service.
QIO functions can also be used to configure and read information about these
ports; for more information:
Terminal Driver
5.4 Terminal Function Codes
Node (LAT$C_ENT_NODE). Only the local node name may be specified, with
the exception of a SETMODE itemlist containing no item codes other than
LAT$_ITM_COUNTERS.
Port (LAT$C_ENT_PORT).
Terminal Driver
5.4 Terminal Function Codes
The value for the entity type occupies the low-order 16 bits (bits 015) of the
P3 parameter. For all four entity types, bits 1619 are used as a status field to
indicate the expected current status of the entity. These bits are used to decide
whether the entity needs to be created before its characteristics are set. The
possible values for this field are:
P4 may contain the address of an entity name string descriptor. If this parameter
is omitted (contains a 0 or the address of a descriptor that points to an empty
buffer), a default may be used in some cases. The defaults for each entity type
are as follows:
Terminal Driver
5.4 Terminal Function Codes
Figure 510 Example SETMODE Itemlist
31
16 15
LAT$C_ON
LAT$_ITM_STATE
LAT$_ITM_KEEPALIVE_TIMER
40
L
LAT$_ITM_IDENTIFICATION
11
T
S
LAT$_ITM_CIRCUIT_TIMER
160
LAT$C_ENABLED
LAT$_ITM_SERVER_MODE
LAT$_ITM_USER_GROUPS
13
LAT$_OUTGOING_SES_LIMIT
5
ZK3798A
Terminal Driver
5.4 Terminal Function Codes
Table 513 LAT$C_ENT_NODE Item Codes
Item Code
Meaning
LAT$_ITM_STATE
Operating state of the LAT protocol. The following values are allowed:
LAT$C_OFF
LAT$C_SHUT
LAT$C_ON
LAT$_ITM_CIRCUIT_
TIMER
LAT$_ITM_CPU_RATING
CPU rating. Valid values are 0 to 100. If this value is 0, then the CPU
rating value is not used in the rating calculation. Refer to the OpenVMS
System Management Utilities Reference Manual for a complete description of
this feature.
LAT$_ITM_DEVICE_SEED
Overrides the default lower boundary for new LTA devices. Valid values
are 0 to 9999; the default is 0. Refer to the OpenVMS System Management
Utilities Reference Manual for more information on this feature.
LAT$_ITM_KEEPALIVE_
TIMER
Keepalive timer value in seconds. Valid values are 10 to 255 seconds. The
default is 20 seconds.
LAT$_ITM_MULTICAST_
TIMER
Multicast timer value in seconds. Valid values are 10 to 180 seconds. The
default is 60 seconds.
LAT$_ITM_NODE_LIMIT
LAT$_ITM_RETRANSMIT_
LIMIT
LAT retransmit limit. Valid values are 4 to 120 retransmissions. The default
is 8 retransmissions.
LAT$_ITM_SERVER_
MODE
Controls whether the node allows the use of the MASTER side of the LAT
protocol for outbound connections. Valid values are:
LAT$_ITM_SERVICE_
RESPONDER
LAT$C_DISABLED
LAT$C_ENABLED
LAT$C_ENABLED
LAT$_ITM_OUTGOING_
SES_LIMIT
LAT$_ITM_INCOMING_
SES_LIMIT
LAT$_ITM_
CONNECTIONS
LAT$_ITM_NODE_NAME
LAT$C_DISABLED
LAT$C_ENABLED
Causes the LAT node name to be set to the given name. This item code may
be specified only if the entity status field of the P3 parameter is LAT$C_
ENTS_NEW; otherwise, a LAT$_ENTNOTFOU error results.
(continued on next page)
Terminal Driver
5.4 Terminal Function Codes
Table 513 (Cont.) LAT$C_ENT_NODE Item Codes
Item Code
Meaning
LAT$_ITM_
IDENTIFICATION
LAT$_ITM_SERVICE_
GROUPS
Specifies a default service group code bit mask. This mask is then used
when creating new local services. The default is group code 0 enabled and
all others disabled when the LAT software is initialized.
Note that the use of the LAT$V_CLEAR bit is an exception for this
parameter code. If you clear bit LAT$V_CLEAR, group codes corresponding
to the group code mask, as specified in the itemlist, are set. Alternatively, if
you set LAT$V_CLEAR, group codes corresponding to the group code mask,
as specified in the itemlist, are cleared.
LAT$_ITM_USER_
GROUPS
LAT group codes to be used when attempting outbound connections using the
MASTER side of the LAT protocol. The default is all group codes disabled
when the LAT software is initialized.
Note that the use of the LAT$V_CLEAR bit is an exception for this
parameter code. If you clear bit LAT$V_CLEAR, group codes corresponding
to the group code mask, as specified in the itemlist, are set. Alternatively, if
you set LAT$V_CLEAR, group codes corresponding to the group code mask,
as specified in the itemlist, are cleared.
LAT$_ITM_COUNTERS
Node counters block. Allows for zeroing of all node counters. This item
code may be specified only if the entity status field of the P3 parameter is
LAT$C_ENTS_OLD and the LAT$V_CLEAR bit is set. Violating either of
these two rules results in a returned status of SS$_BADPARAM.
LAT$_ITM_MAXIMUM_
UNITS
Maximum unit number. Sets the highest value for a LTA unit number. Must
be between 1 and 9999; defaults to 9999.
LAT$_ITM_HI_CIRCUITS
Indicates the highest number the resource attained since the host was
initialized for LAT connections to node.
LAT$_ITM_CUR_
CIRCUITS
LAT$_ITM_MAX_
CIRCUITS
LAT$_ITM_HI_
SESSIONS
Indicates highest number the resource attained since the host was initialized
for LAT sessions.
LAT$_ITM_CUR_
SESSIONS
LAT$_ITM_MAX_
SESSIONS
LAT$_ITM_HI_OUT_
QUEUE
Indicates highest number the resource attained since the host was initialized
of outgoing queued connect requests.
LAT$_ITM_CUR_OUT_
QUEUE
LAT$_ITM_MAX_OUT_
QUEUE
LAT$_TIM_HI_IN_
QUEUE
Indicates highest number the resource attained since the host was initialized
of incoming queued requests.
LAT$_ITM_CUR_IN_
QUEUE
Alpha specific.
Terminal Driver
5.4 Terminal Function Codes
Table 513 (Cont.) LAT$C_ENT_NODE Item Codes
Item Code
Meaning
LAT$_ITM_MAX_IN_
QUEUE
LAT$_ITM_HI_SAMS_
QUEUED
Indicates highest number the resource attained since the host was initialized
of outstanding, unprocessed service announcement messages by LATACP.
LAT$_ITM_CUR_SAMS_
QUEUED
LAT$_ITM_MAX_SAMS_
QUEUED
LAT$_ITM_HI_SOL_
QUEUED
Indicates highest number the resource attained since the host was initialized
of outstanding, unprocessed solicit information messages by LATACP.
LAT$_ITM_CUR_SOL_
QUEUED
LAT$_ITM_MAX_SOL_
QUEUED
LAT$_ITM_HI_AVAIL_
SVCS
Indicates highest number the resource attained since the host was initialized
of number of available services in LATACP database.
LAT$_ITM_CUR_AVAIL_
SVCS
LAT$_ITM_MAX_AVAIL_
SVCS
LAT$_ITM_HI_REACH_
NODES
Indicates highest number the resource attained since the host was initialized
of reachable nodes in LATACP database.
LAT$_ITM_CUR_
REACH_NODES
LAT$_ITM_MAX_
REACH_NODES
LAT$_ITM_HI_LCL_
SVCS
Indicates highest number the resource attained since the host was initialized
of locally offered services.
LAT$_ITM_CUR_LCL_
SVCS
LAT$_ITM_MAX_LCL_
SVCS
LAT$_ITM_DISCARDED_
NODES
LAT$_ITM_SERVICE_
CLASSES
Indicates returned service class bit mask for supported service classes on
node. It is returned for both local and remote nodes. If service class 1 is
enabled, then bit <1> is set in this mask. When bit setting equals 1, this
indicates the corresponding service class for that bit is enabled. That is,
when bit <3> equal 1, then service class 3 is enabled.
LAT$_ITM_LARGE_
BUFFERS
Indicates in Boolean logic whether or not the LAT software is using large
packet support by default.
LAT$_ITM_
ANNOUNCEMENTS
Alpha specific.
Terminal Driver
5.4 Terminal Function Codes
Table 514 lists the item codes that may be set for the LAT$C_ENT_SERVICE
entity type.
Table 514 LAT$C_ENT_SERVICE Item Codes
Item Code
Meaning
LAT$_ITM_RATING
Static LAT service rating. The default is the dynamic rating calculation.
Static ratings can be between 0 and 255.
LAT$_ITM_
IDENTIFICATION
LAT$_ITM_SERVICE_
TYPE
LAT$C_ST_APPLICATION
LAT$C_ST_LIMITED
LAT$_ITM_COUNTERS
Service counters block. Allows for zeroing of all service counters. This item
code may be specified only if the entity status field is LAT$C_ENTS_OLD
and the LAT$V_CLEAR bit is set. Violating either of these two rules results
in a returned status of SS$_BADPARAM.
LAT$_ITM_PASSWORD
LAT$_ITM_LIM_PORT_
BLOCK
Alpha specific.
Terminal Driver
5.4 Terminal Function Codes
Table 515 lists the item codes that may be set for the LAT$C_ENT_LINK entity
type.
Table 515 LAT$C_ENT_LINK ItemCodes
Item Code
Meaning
LAT$_ITM_STATE
LAT$C_SHUT
LAT$C_ON
LAT$_ITM_DEVICE_
NAME
The name of the local area network (LAN) device to be used for
this link. The default is hardware-dependent.
LAT$_ITM_DECNET_
ADDRESS
LAT$_ITM_COUNTERS
LAT$C_DISABLED
LAT$C_ENABLED
Table 516 lists the item codes that may be set for the LAT$C_ENT_PORT entity
type.
Table 516 LAT$C_ENT_PORT Item Codes
Item Code
Meaning
LAT$_ITM_PORT_
TYPE
LAT$_ITM_QUEUED
LAT$C_PT_APPLICATION
LAT$C_PT_DEDICATED
LAT$C_PT_LIMITED
LAT$C_ENABLED
Alpha specific.
Terminal Driver
5.4 Terminal Function Codes
Table 516 (Cont.) LAT$C_ENT_PORT Item Codes
Item Code
Meaning
LAT$_ITM_SERVICE_
CLASS
LAT$C_SERVCLASS_
XTRANSPORT
LAT$C_SERVCLASS_FONT
LAT$_ITM_DISPLAY_
NUMBER
LAT$_ITM_TARGET_
NODE_NAME
LAT$_ITM_TARGET_
SERVICE_NAME
LAT$_ITM_TARGET_
PORT_NAME
LAT$_ITM_SERVICE_
PASSWORD
LAT$_ITM_DIALUP
LAT$_ITM_
AUTOPROMPT
Alpha specific.
Terminal Driver
5.4 Terminal Function Codes
P3 specifies the type of entity to which the SENSEMODE operation applies. The
entity type can be one of five types:
Port (LAT$C_ENT_PORT).
The value for the entity type occupies the low-order 16 bits (bits 015) of the P3
parameter. Bits 1623 are used as a flag field. Two bits are currently defined
within this field: LAT$V_SENSE_NEXT and LAT$V_SENSE_FULL. If the
LAT$V_SENSE_NEXT bit is 0, information about the current entity described
by the P3 and P4 parameters is returned to the user; if this bit is 1, information
about the next entity that logically follows the one described by P4 is returned.
If LAT$V_SENSE_FULL is 0, only those item codes marked SUMMARY in the
following tables are returned; if this bit is 1, all item codes that describe the
entity specified by the P3 and P4 parameters are returned.
P4 may contain the address of an entity name string descriptor. If this parameter
is omitted (contains a zero or the address of a descriptor that points to an empty
string) and the LAT$V_SENSE_NEXT bit is set, information about the first entity
that matches the entity type supplied by P3 is returned.
If P4 is omitted and the LAT$V_SENSE_NEXT bit is 0, a default entity name
may be used in some cases. The defaults for each entity type are as follows:
Terminal Driver
5.4 Terminal Function Codes
Table 517 LAT$C_ENT_NODE Item Codes
Item Codes
Meaning
LAT$_ITM_NODE_
NAME (BOTH,
SUMMARY)
LAT$_ITM_
IDENTIFICATION
(BOTH, SUMMARY)
LAT$_ITM_NODE_
TYPE (BOTH,
SUMMARY)
LAT$_ITM_STATE
(LOCAL,SUMMARY)
LAT$_ITM_NODE_
STATUS (REMOTE,
SUMMARY)
LAT$C_NT_LOCAL
LAT$C_NT_REMOTE
LAT$C_OFF
LAT$C_SHUT
LAT$C_UNREACHABLE
LAT$C_UNKNOWN
LAT$_ITM_
CONNECTED_COUNT
(REMOTE, SUMMARY)
LAT$_ITM_SERVICE_
GROUPS (BOTH)
A bit mask of LAT group codes that are serviced by the node.
LAT$_ITM_
PROTOCOL_VERSION
(BOTH)
LAT$_ITM_DATALINK_
ADDRESS (REMOTE)
LAT$_ITM_NODE_
LIMIT
LAT$_ITM_
RETRANSMIT_LIMIT
LAT$_ITM_MAXIMUM_
UNITS (LOCAL)
Terminal Driver
5.4 Terminal Function Codes
Table 517 (Cont.) LAT$C_ENT_NODE Item Codes
Item Codes
Meaning
LAT$_ITM_SERVER_
MODE (LOCAL)
Controls whether the node allows the use of the MASTER side
of the LAT protocol for outbound connections. Possible values
are:
LAT$_ITM_SERVICE_
RESPONDER (LOCAL)
LAT$C_DISABLED
LAT$C_ENABLED
LAT$C_ENABLED
LAT$_ITM_
OUTGOING_SES_
LIMIT (LOCAL)
LAT$_ITM_
INCOMING_SES_
LIMIT (LOCAL)
LAT$_ITM_USER_
GROUPS (LOCAL)
LAT$_ITM_CIRCUIT_
TIMER (BOTH)
LAT$_ITM_CPU_
RATING (LOCAL)
CPU rating.
LAT$_ITM_
KEEPALIVE_TIMER
(LOCAL)
LAT$_ITM_
MULTICAST_TIMER
(BOTH)
LAT$_ITM_
CONNECTIONS
(BOTH)
LAT$C_ENABLED
LAT$C_ITM_LARGE_
BUFFERS
LAT$C_ITM_
ANNOUNCEMENTS
Terminal Driver
5.4 Terminal Function Codes
Table 518 Node Service Subblock Item Codes
Item Codes
Meaning
LAT$_ITM_SERVICE_NAME
(BOTH)
LAT$_ITM_SERVICE_
STATUS (BOTH)
LAT$_ITM_SERVICE_TYPE
(LOCAL)
LAT$C_AVAILABLE
Service available.
LAT$C_UNAVAILABLE
Service unavailable.
Creates a general
timesharing service.
LAT$C_ST_APPLICATION
Creates a special
application service that
must then be associated
with ports dedicated to
accepting connections to
this service (dedicated
ports).
LAT$_ITM_RATING (BOTH)
LAT$_ITM_RATING_TYPE
(LOCAL)
LAT$_ITM_
IDENTIFICATION (BOTH)
LAT$C_STATIC
LAT$C_DYNAMIC
Dynamic rating
calculation
Meaning
LAT$_ITM_CTPRT_LCL
LAT$_ITM_CTPRT_SLCA
LAT$_ITM_CTPRT_SLCR
LAT$_ITM_CTPRT_ISOLA
LAT$_ITM_CTPRT_ISOLR
LAT$_ITM_CTPRT_FRAMERR
LAT$_ITM_CTPRT_PARERR
LAT$_ITM_CTPRT_OVERRUN
LAT$_ITM_PASSWORD_
FAILURES
Terminal Driver
5.4 Terminal Function Codes
Node counters information is presented as a counters subblock. The subblock
item code LAT$_ITM_COUNTERS has the LAT$V_STRING bit set to 1, and
the string length byte actually contains the length of the entire subblock. The
subblock itself is an itemlist and consists of the item codes listed in Table 520.
Table 520 Node Counters Item Codes
Item Codes
Meaning
LAT$_ITM_CTNOD_SSZ
(BOTH)
LAT$_ITM_CTNOD_MSGR
(BOTH)
Messages received
LAT$_ITM_CTNOD_MSGT
(BOTH)
Messages transmitted
LAT$_ITM_CTNOD_SLTR
(BOTH)
Slots received
LAT$_ITM_CTNOD_SLTT
(BOTH)
Slots transmitted
LAT$_ITM_CTNOD_BYTR
(BOTH)
Bytes received
LAT$_ITM_CTNOD_BYTT
(BOTH)
Bytes transmitted
LAT$_ITM_CTNOD_MNA
(BOTH)
LAT$_ITM_CTNOD_DUP
(BOTH)
Duplicates received
LAT$_ITM_CTNOD_MRT
(BOTH)
Messages retransmitted
LAT$_ITM_CTNOD_ILM
(BOTH)
LAT$_ITM_CTNOD_ILS (BOTH)
LAT$_ITM_CTNOD_SLCA
(BOTH)
Solicitations accepted
LAT$_ITM_CTNOD_SLCR
(BOTH)
Solicitations rejected
LAT$_ITM_CTNOD_TER
(LOCAL)
Transmit errors
LAT$_ITM_CTNOD_RES
(LOCAL)
Resource errors
LAT$_ITM_CTNOD_NTB
(LOCAL)
No transmit buffer
LAT$_ITM_CTNOD_TMO
(LOCAL)
LAT$_ITM_CTNOD_DOB
(LOCAL)
LAT$_ITM_CTNOD_LSTER
(LOCAL)
LAT$_ITM_CTNOD_MCBXMT
(LOCAL)
Terminal Driver
5.4 Terminal Function Codes
Table 520 (Cont.) Node Counters Item Codes
Item Codes
Meaning
LAT$_ITM_CTNOD_MCBRCV
(LOCAL)
LAT$_ITM_CTNOD_MCMXMT
(LOCAL)
LAT$_ITM_CTNOD_MCMRCV
(LOCAL)
LAT$_ITM_CTNOD_SOLFAIL
(LOCAL)
LAT$_ITM_CTNOD_ATLOS
(LOCAL)
LAT$_ITM_CTNOD_DATLOS
(LOCAL)
LAT$_ITM_CTNOD_NOREJ
(LOCAL)
LAT$_ITM_CTNOD_LOSCT
(LOCAL)
LAT$_ITM_CTNOD_LOSSAM
(LOCAL)
LAT$_ITM_CTNOD_NOSAM
(LOCAL)
LAT$_ITM_CTNOD_NOSTS
(LOCAL)
LAT$_ITM_CTNOD_NOXMT
(LOCAL)
LAT$_ITM_CTNOD_
CTLERR(LOCAL)
LAT$_ITM_CTNOD_
CERRCOD(LOCAL)
LAT$_ITM_CTNOD_
ISOLA(LOCAL)
LAT$_ITM_CTNOD_
ISOLR(LOCAL)
LAT$_ITM_CTNOD_PROTO
(LOCAL)
LAT$_ITM_CTNOD_XSTR
(REMOTE)
Alpha specific.
Several protocol errors are also included in a separate subblock. The protocol
errors item code is LAT$_ITM_PROTOCOL_ERRORS and has LAT$V_STRING
set (the size of the subblock is contained in the first byte following the item code).
The item codes and the events they represent are listed in Table 521.
Terminal Driver
5.4 Terminal Function Codes
Table 521 Protocol Error Item Codes
Item Codes
Meaning
LAT$_ITM_CTPRO_IVM
(LOCAL)
LAT$_ITM_CTPRO_ISM
(LOCAL)
LAT$_ITM_CTPRO_IVS
(LOCAL)
LAT$_ITM_CTPRO_NIZ
(LOCAL)
LAT$_ITM_CTPRO_ICI
(LOCAL)
LAT$_ITM_CTPRO_CSI
(LOCAL)
LAT$_ITM_CTPRO_NLV
(LOCAL)
LAT$_ITM_CTPRO_HALT
(LOCAL)
LAT$_ITM_CTPRO_MIZ
(LOCAL)
LAT$_ITM_CTPRO_SIZ
(LOCAL)
LAT$_ITM_CTPRO_CRED
(LOCAL)
LAT$_ITM_CTPRO_RCSM
(LOCAL)
LAT$_ITM_CTPRO_RDSM
(LOCAL)
LAT$_ITM_CTPRO_
INVCLASS (LOCAL)
LAT$_ITM_CTPRO_
EXCSTART (LOCAL)
Alpha specific.
Table 522 lists the item codes that are returned for the LAT$C_ENT_SERVICE
entity type. As in Table 517, item codes noted as LOCAL are returned only if
the information being returned is for a locally offered service. Item codes noted
as REMOTE are returned only if the information being returned is for a service
offered by a remote node. Item codes noted as BOTH are returned for both types
of services.
Terminal Driver
5.4 Terminal Function Codes
Table 522 LAT$C_ENT_SERVICE Item Codes
Item Codes
Meaning
LAT$_ITM_SERVICE_
NAME
(BOTH, SUMMARY)
Service name.
LAT$_ITM_SERVICE_
STATUS
(BOTH, SUMMARY)
LAT$_ITM_
SERVICE_TYPE
(LOCAL,SUMMARY)
LAT$_ITM_
IDENTIFICATION
(BOTH, SUMMARY)
LAT$C_AVAILABLE
Service available.
LAT$C_UNAVAILABLE
Service unavailable.
LAT$C_ST_APPLICATION
Meaning
LAT$_ITM_NODE_NAME
(BOTH)
LAT$_ITM_STATE
(LOCAL)
LAT$C_OFF
LAT$C_SHUT
Terminal Driver
5.4 Terminal Function Codes
Table 523 (Cont.) Service Node Subblock Item Codes
Item Codes
Meaning
LAT$_ITM_NODE_STATUS
(REMOTE)
Remote node is
reachable.
LAT$C_UNREACHABLE
Remote node is
unreachable.
LAT$C_UNKNOWN
LAT$_ITM_CONNECTED_
COUNT
(REMOTE)
LAT$_ITM_RATING
(BOTH)
LAT$_ITM_RATING_TYPE
(LOCAL)
LAT$_ITM_
IDENTIFICATION
(BOTH)
Terminal Driver
5.4 Terminal Function Codes
Table 524 Service Counters Subblock Item Codes
Item Codes
Meaning
LAT$_ITM_CTSRV_SSZ
(BOTH)
LAT$_ITM_CTSRV_MCNA
(BOTH)
LAT$_ITM_CTSRV_MCNC
(BOTH)
LAT$_ITM_CTSRV_SCNA
(BOTH)
LAT$_ITM_CTSRV_SCNR
(BOTH)
LAT$_ITM_DED_PORT_
BLOCK
(LOCAL)
LAT$_ITM_PASSWORD_
FAILURE
Alpha specific.
Table 525 lists the item codes that are returned for the LAT$C_ENT_LINK
entity type.
Table 525 LAT$C_ENT_LINK Item Codes
Item Codes
Meaning
LAT$_ITM_LINK_NAME
(SUMMARY)
Terminal Driver
5.4 Terminal Function Codes
Table 525 (Cont.) LAT$C_ENT_LINK Item Codes
Item Codes
Meaning
LAT$_ITM_STATE
(SUMMARY)
LAT$C_OFF
LAT$C_SHUT
LAT$_ITM_DEVICE_NAME
(SUMMARY)
LAT$_ITM_DATALINK_
ADDRESS
LAT$_ITM_DECNET_
ADDRESS
LAT$C_ENABLED
Meaning
NMA$C_CTLIN_ZER
NMA$C_CTLIN_DBR
Messages received
NMA$C_CTLIN_DBS
Messages transmitted
NMA$C_CTLIN_MBL
NMA$C_CTLIN_MBS
NMA$C_CTLIN_BRC
Bytes received
NMA$C_CTLIN_BSN
Bytes transmitted
(continued on next page)
Terminal Driver
5.4 Terminal Function Codes
Table 526 (Cont.) Link Counters Item Codes
Item Codes
Meaning
NMA$C_CTLIN_MBY
NMA$C_CTLIN_MSN
NMA$C_CTLIN_RFL
Receive errors
NMA$C_CTLIN_SFL
Transmit errors
NMA$C_CTLIN_OVR
Data overrun
NMA$C_CTLIN_UBU
NMA$C_CTLIN_SBU
NMA$C_CTLIN_LBE
NMA$C_CTLIN_BS1
NMA$C_CTLIN_BSM
NMA$C_CTLIN_BID
NMA$C_CTLIN_CDC
Table 527 lists additional link counter item codes of the LINK entity.
Table 527 Link Counters Item Codes
Item Codes
Meaning
LAT$_ITM_CTLAT_RMSG
LAT$_ITM_CTLAT_RBYT
LAT$_ITM_CTLAT_XMSG
LAT$_ITM_CTLAT_XBYT
LAT$_ITM_CTLAT_MUL_
RMSG
LAT$_ITM_CTLAT_MUL_
RBYT
LAT$_ITM_CTLAT_MUL_
XMSG
LAT$_ITM_CTLAT_MUL_
XBYT
LAT$_ITM_LAT_DEV_CTR_
BLOCK
The counter item codes listed in Table 527 are used by LATCP in the display
generated by the $SHOW LINK /COUNTER command. The display looks similiar to
the following:
Link Name:
LAT$LINK
Device Name: _XQA1:
Terminal Driver
5.4 Terminal Function Codes
Seconds Since Zeroed:
Messages Received:
LAT Messages Received:
Multicast Msgs Received:
LAT Multicast Msgs Received:
Bytes Received:
LAT Bytes Received:
Multicast Bytes Received:
LAT Multicast Bytes Received:
System Buffer Unavailable:
Unrecognized Destination:
Receive Errors:
65535
7080630
1484817
5578139
5093417
678189475
107809441
602984574
565264261
1638401
65537
7
Yes
No
No
No
No
Messages Sent:
2135394
LAT Messages Sent:
2086167
Multicast Msgs Sent:
10775
LAT Multicast Msgs Sent:
9142
Bytes Sent:
1312778402
LAT Bytes Sent:
1278118808
Multicast Bytes Sent:
1696264
LAT Multicast Bytes Sent:
1448342
User Buffer Unavailable:
1
Data Overrun:
1
Transmit Errors:
1
Transmit Errors (bitmask = 001)
Excessive Collisions:
Carrier Check Failure:
Short Circuit:
Open Circuit:
Frame Too Long:
Remote Failure To Defer:
Transmit Underrun:
Transmit Failure:
Yes
No
No
No
No
No
No
No
1
5208
4732
0
Table 528 lists the item codes that are returned for the LAT$C_ENT_PORT
entity type.
Table 528 LAT$C_ENT_PORT Item Codes
Item Codes
Meaning
LAT$_ITM_PORT_NAME
SUMMARY
LAT$_ITM_PORT_TYPE
SUMMARY
LAT$C_PT_INTERACTIVE
LAT$C_PT_APPLICATION
LAT$C_PT_DEDICATED
Terminal Driver
5.4 Terminal Function Codes
Table 528 (Cont.) LAT$C_ENT_PORT Item Codes
Item Codes
Meaning
LAT$_ITM_QUEUED
LAT$_ITM_SERVICE_
CLASS
LAT$C_DISABLED
LAT$C_ENABLED
Service class 1,
TTDRIVER (this is the
default).
LAT$C_SERVCLASS_
TESTSERVICE
LAT$C_SERVCLASS_
XTRANSPORT
Service class 3, X
Protocol.
LAT$C_SERVCLASS_FONT
LAT$_ITM_DISPLAY_
NUMBER
LAT$_ITM_DISCONNECT_
REASON
LAT$_ITM_CONNECTED_
SERVICE_NAME1
LAT$_ITM_CONNECTED_
NODE_NAME1
LAT$_ITM_CONNECTED_
PORT_NAME1
LAT$_ITM_CONNECTED_
LINK_NAME1
LAT$_ITM_TARGET_
SERVICE_NAME2
LAT$_ITM_TARGET_NODE_
NAME2
LAT$_ITM_TARGET_PORT_
NAME2
1 Returned
2 Shows
information about how the port is set up. May be returned even if there is no current LAT
connection.
Terminal Driver
5.4 Terminal Function Codes
Table 528 (Cont.) LAT$C_ENT_PORT Item Codes
Item Codes
Meaning
LAT$_ITM_NODE_
QUEUE_POSITION
LAT$_ITM_SERVICE_
QUEUE_POSITION
LAT$_ITM_PORT_STATE
Port is inactive.
LAT$C_PT_STATE_
CONNECTING
Port connection in
progress but not
complete.
LAT$C_PT_STATE_ACTIVE
LAT$C_PT_STATE_
DISCONNECTING
Alpha specific.
On Alpha systems, the item codes for queue entries are listed in Table 529.
Table 529 LAT SENSMODE Queue Entries (Alpha Only)
Item Code
Meaning
LAT$_ITM_QUEUED_ENTRY_
ID (SUMMARY)
LAT$_ITM_NODE_QUEUE_
POSITION (SUMMARY)
LAT$_ITM_SERVICE_QUEUE_
POSITION (SUMMARY)
LAT$_ITM_NODE_NAME
(SUMMARY)
Indicates where the remote node name queue entry came from.
LAT$_ITM_SERVICE_NAME
(SUMMARY)
Indicates the target service name to which the queue entry is queued (if
specified).
LAT$_ITM_PORT_NAME
(SUMMARY)
Indicates the target port name to which the entry is queued (if
specified).
LAT$_ITM_LINK_NAME
LAT$_ITM_DATALINK_
ADDRESS
Returns the remote node that issued requests data link address.
Terminal Driver
5.4 Terminal Function Codes
Table 530 IO$M_LT_CONNECT Request Status
Event
IOSB Status
Explanation
Connection established
SS$_NORMAL
Connection timeout
SS$_TIMEOUT
Connection rejected
SS$_ABORT. IOSB+2
contains LAT rejection
code or LAT facility
message code.
Connection request
SS$_ILLIOFUNC
Connection already
established on port
SS$_DEVACTIVE
Incorrectly configured
LAT port
SS$_DEVREQERR
Insufficient resources
SS$_INSFMEM
Before the application port can be used, it must be mapped to a remote node
name, and either the port name or the service name of the remote terminal
server port. (These names must be defined locally on the terminal server.) The
application port is mapped with the IO$M_LT_SETMODE modifier, specifying the
following items in the P1 itemlist parameter:
The queued status of the connection can also be mapped to the port by specifying
the LAT$_ITM_QUEUED item in the P1 itemlist parameter. Valid values for this
item are:
Terminal Driver
5.4 Terminal Function Codes
5.4.4.6 Programming Application Services and Dedicated Ports
Rather than the normal timesharing service offered by the operating system,
application programs can make use of LAT application services that allow
terminal server users (or users on sytems with outgoing connections) to connect to
a specialized application. To do this, the system manager must create LAT ports
that are dedicated to a particular application service. (Alternatively, this LAT
port creation can be done from a program using the QIOs discussed in previous
sections, providing OPER privilege.) When the remote user makes the connection
to the application service, the connection is directly to the application program
that controls a LAT port (LTA device) associated with the service. In this case the
prompt, Username:, is not received. Compaq recommends that you follow these
steps to create an application service:
1. Define the dedicated ports in LAT$SYSTARTUP.COM and execute the
command procedure in SYSTARTUP_VMS.COM. (Refer to the OpenVMS
System Management Utilities Reference Manual and the OpenVMS System
Managers Manual for additional information.)
2. Run the application program. Within the application program,
allocate dedicated ports with the same name as those defined in
LAT$SYSTARTUP.COM. Use the Assign I/O Channel ($ASSIGN) system
service to assign service channels to the ports.
3. Post a read request to the dedicated ports. When the terminal user connects
to the service and presses the Return key, the application program can
perform I/O to the dedicated port.
4. To break the connection, use the Deassign I/O Channel ($DASSGN) system
service to deassign the channel and the Deallocate Device ($DALLOC) system
service to deallocate the device. The application program must reallocate the
port and reassign the channel in preparation for the next connection.
An example of the application service concept is a program that provides the
time of day. For this example, the system manager includes the following lines in
LAT$SYSTARTUP.COM (or enters them manually in the LATCP program):
CREATE SERVICE TIME/ID="At the tone, the time will be"/APPLICATION
CREATE PORT LTA99:/DEDICATED
SET PORT LTA99:/SERVICE=TIME
An application program then assigns a channel to device LTA99. When a
terminal server user types CONNECT TIME, the user is connected to this
application program, and the program prints out the time of day. The program
then deassigns the channel, which disconnects the server user.
A system manager may associate more than one LAT port with the same service.
In that case, the application program that offers the service should assign
channels to all of the LTA devices created for that service.
5.4.4.7 Programming Forward Ports
An outbound LAT connection to a remote service node can be made using a
forward port. The LAT port driver can connect to a remote service node only if
outgoing connections are enabled on the local node. Outgoing connections can
be enabled with LATCP or with a LAT SETMODE QIO to the local node. In
addition, user group codes on the local node must match the service group codes
of the service to which they are being connected. LATCP can list the services to
which the local node can connect. (Refer to the OpenVMS System Management
Utilities Reference Manual for additional information.) Before the forward port
can be used to make an outbound LAT connection, it must be mapped to a service
Terminal Driver 577
Terminal Driver
5.4 Terminal Function Codes
and optionally, a node and port. The forward port is mapped with the IO$M_LT_
SETMODE modifier, specifying the following items in the P1 item list parameter:
A LAT SETMODE QIO on a forward port does not require OPER privilege if
the port name is not specified in the P4 parameter. In other words, the LAT
SETMODE QIO must be to the port corresponding to the CHAN parameter (the
forward port attained by assigning a channel to _LTA0:). Note that SS$_NOPRIV
is returned if you attempt to change the port type by specifying the LAT$_ITM_
PORT_TYPE item code in the P1 itemlist parameter. If the P4 parameter is
specified, the LAT port driver also returns SS$_NOPRIV.
Table 530 lists the conditions that can occur when an application program issues
an IO$M_LT_CONNECT request for a connection to a remote service node. The
QIO request is completed when a session is established with the service node.
Once the connection completes, data can be read and written to the port with the
QIO read and write functions.
5.4.4.8 Queue Change Notification (Alpha Only)
On Alpha systems, the IO$M_LT_QUE_CHG_NOTIF function modifier for $QIO
allows a process to enable an attention asynchronous system trap (AST), which
is used with the LAT $QIO connect request. The IO$M_LT_QUE_CHG_NOTIF
function is available only for APPLICATION and FORWARD LAT devices.
If a $QIO connect request has been issued to a remote node and that request has
been queued, this attention AST will be set each time the queue position changes.
This AST can be used as long as the $QIO connect request is queued. Like a
Ctrl/Y AST, it is set only once; it must be reenabled after each completion.
If the LAT $QIO connect succeeds or if a LAT connection exists for the intended
service, the AST completes with the SS$_DEVACTIVE status code.
If the LAT device does not have the queued characteristic, issuing the IO$M_LT_
QUE_CHG_NOTIF function results in the return of SS$_DEVREQERR status
code.
The implementation of IO$M_LT_QUE_CHG_NOTIF is shown in the following C
example:
Terminal Driver
5.4 Terminal Function Codes
status - sys$qiow (
0,
/* efn
ltchannel,
/* channel
IO$_TTY_PORT|IO$M_LT_QUE_CHG_NOTIF,
/* function
q_iosb,
/* iosb
0,
/* astadr
0,
/* astprm
queue_pos_change, /* P1 = ast routine
0, 0, 0, 0, 0);
/* P2 through P6 not
*/
*/
*/
*/
*/
*/
*/
used */
When a queue position change occurs, the AST routine is called with a 32-bit
value. If this value is 0, then the LAT connect $QIO is about to complete, if it has
not already. If the value is not 0, the lower word of 16 bits indicates the service
queue position, and the upper word of 16 bits indicates the node queue position.
5.4.4.9 Hangup Notification
To allow notification by the terminal driver of abnormal termination during I/O
operations, enable a Ctrl/Y AST on the channel. This ensures that the terminal
driver notifies application programs of an abnormal connection termination. Note
that the operating system does not return an AST parameter to the Ctrl/Y AST
routine.
When an application with a pending read or write request has an abnormal
LAT connection completion, the terminal driver returns a SS$_HANGUP status
in the first word of the IOSB. The reason for the abnormal LAT connection
completion can be attained with a LAT SENSEMODE QIO request to the port.
Search the resulting P1 itemlist for the value corresponding to the LAT$_ITM_
DISCONNECT_REASON item code. The value is either a LAT reject code or
a LAT facility message. The LAT$V_SENSE_FULL bit must be set in the P3
parameter in order to receive this information.
If IOSB indicates an abnormal completion (SS$_ABORT, see Table 530) on a
IO$M_LT_CONNECT modifier QIO, the LAT port driver returns the reason for
the abnormal completion in IOSB+2. The reason can also be attained with the
LAT SENSEMODE QIO function.
IO$_SENSEMODE
IO$_SENSECHAR
Terminal Driver
5.4 Terminal Function Codes
Figure 511 Sense Mode Characteristics Buffer
31
24 23
16 15
Buffer Size *
8 7
Type
Page Length
0
Class
P2 = 12
ZK0693GE
24 23
(Reserved)
16 15
First Character
(Reserved)
ZK0694GE
IO$_SENSEMODE!IO$M_RD_MODEM
IO$_SENSECHAR!IO$M_RD_MODEM
These function code modifier pairs take the following device- or functiondependent argument:
Terminal Driver
5.4 Terminal Function Codes
Figure 513 shows the format of this block.
Figure 513 Sense Mode P1 Block
31
P1:
24 23
16 15
Receive Modem
8 7
Controller Type
ZK0695GE
The receive modem field returns the value of the current input modem signals.
Any or all of the following signals can be returned:
The $TTDEF macro defines the symbols for the receive modem field.
The controller type field returns the type of terminal controller in use by the
currently active terminal line. The $DCDEF macro defines the symbols for the
following types of controllers:
DT$_DZ32DZ32
DT$_DMF32DMF32
DT$_DMB32DMB32
DT$_DMZ32DMZ32
DT$_DHVDHV11
DT$_DHUDHU11
DT$_LATLAT server
Note 1
For LAT devices, the receive modem field of the IO$M_RD_MODEM
function modifier does not return any valid modem signal data.
Note 2
The IO$M_RD_MODEM function modifier is not supported for remote
terminals. The status SS$_DEVREQERR is returned in the I/O status
block.
Terminal Driver
5.4 Terminal Function Codes
5.4.5.3 Broadcast Function Modifier
The broadcast function modifier returns those bits that have been set by the set
mode function modifier IO$M_BRDCST (see Table 512 in Section 5.4.3.6). The
following combination of function code and modifier is provided:
IO$_SENSEMODE!IO$M_BRDCST
This function code modifier pair takes the following device- or function-dependent
arguments:
P1A buffer that contains the bits that specify the requester IDs to be
broadcast. (If the bit is set in the first longword, that particular command is
turned off for broadcast.)
P2The length of the P1 buffer.
IOSB
Offset to Terminator
Status
Terminator Size
Terminator
+6
+4
ZK0696GE
In Figure 515 the terminator position word contains a number, the character
of which is determined by the mode of operation. For itemlist read operations
that do not specify TRM$K_EM_RDVERIFY, this word contains the number
of characters from the end of the buffer to the cursor location at the time the
terminator character was received. If TRM$K_EM_RDVERIFY is specified, the
terminator position word contains the offset into the buffer from the nonverified
character.
Terminal Driver
5.5 I/O Status Block
Figure 515 IOSB ContentsItemlist Read Function
Offset to Terminator
Cursor Position
from EOL
Terminator
Length
Status
Terminator
Character
(Reserved)
The byte at IOSB+5 passes the status information, listed in Table 531,
on TRM$K_EM_RDVERIFY operations in which TRM$M_TM_ARROWS or
TRM$M_TM_TOGGLE is set in TRM$_MODIFIERS.
Table 531 Byte IOSB+5 Status Information
Bit
Interpretation
7 (sign bit)
62
1 TRM$V_ST_OTHERWAY
0 TRM$V_ST_FIELD_FULL
In Figure 516, the remote terminal driver does not return the number of lines
output or the cursor position.
Figure 516 IOSB ContentsWrite Function
Byte Count
Status
0
IOSB Contents: Write Function
ZK1307GE
In Figure 517, the TTdriver attempts to return the correct data in IOSB after a
SETMODE or SETCHAR. To be sure the returned data is correct, the user should
follow the SETMODE or SETCHAR with a SENSEMODE or SENSECHAR.
Terminal Driver
5.5 I/O Status Block
Figure 517 IOSB ContentsSet Mode, Set Characteristics, Sense Mode, and
Sense Characteristics Functions
Receive Speed * Transmit Speed
0
Parity Flags
Status
LF Fill Count
CR Fill Count
0
Status
(Reserved)
ZK6135GE
Reason
Reason is unknown.
Service in use.
No such service.
Service is disabled.
10
11
Invalid password.
12
Terminal Driver
5.5 I/O Status Block
Table 532 (Cont.) LAT Rejection Codes
Value
Reason
13
14
15
16
17
18
19
Terminal Driver
5.6 Terminal Driver Programming Examples
IO$M_LT_SETMODE
IO$M_LT_SENSEMODE
/*
/*
/*
/*
*/
*/
/*
** Service name which the session will be to.
*/
#define SERVICE_NAME
"LAT_SERVICE"
#define SERVICE_NAME_LENGTH 11
(continued on next page)
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 51 (Cont.) LAT.C Terminal Driver Programming Example
/*
**
**
**
**
**
**
**
**
**
**
**
**
**
**
*/
For the sake of clarity, the sizes of the buffers used for reading from
and writing to the LTA and TT devices are set to the values below. In
order to gain maximum throughput from this program, the following system
parameters can be set:
o TTY_ALTYPAHD - 1500
o TTY_TYPAHDSZ - 80
To get the best performance from this program without touching these
system parameters on your system, modify the program to set the size of
the buffers to the following:
o LTA_BUFFER_SIZE = MIN(TTY_ALTYPAHD, 1500)
o TT_BUFFER_SIZE = MIN(TTY_TYPAHDSZ, 132)
#define LTA_MAXBUF
#define TT_MAXBUF
1500
80
/*
** Size of the LAT SENSEmode itemlist.
*/
#define MAX_SENSE_ITEMLIST_SIZE 1500
/*
** Character user can press to terminate the LAT connection (CTRL+\).
*/
#define CONNECTION_TERMINATOR
0x1C
/*
**
** FUNCTION PROTOTYPES
**
*/
unsigned long
void
void
void
void
void
void
SetDeviceChars(void);
ConnectAST(void);
LTAreadChannelAST(void);
TTreadChannelAST(void);
LTAhangupHandler(void);
EndSession(void);
ExitHandler(void);
/*
**
** GLOBAL DATA
**
*/
char
*/
*/
/*
** Text for LAT reject codes. Note that some LAT
** implementations will return a 0 reject code to
** indicate a normal disconnect.
*/
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 51 (Cont.) LAT.C Terminal Driver Programming Example
*LATrejectTable[] = {
"Unknown",
"User requested disconnect",
"System shutdown in progress",
"Invalid slot received",
"Invalid service class received",
"Insufficient resources at server",
"Port or service in use",
"No such service",
"Service is disabled",
"Service is not offeredon the requested port",
"Port name is unknown",
"Invalid service password",
"Remote entry is not in queue",
"Immediate access rejected",
"Access denied",
"Corrupted request",
"Requested function is not supported",
"Session cannot be started",
"Queue entry deleted by server",
"Illegal request parameters"
};
unsigned short LTAchannel,
TTchannel,
LTA_QIOiosb[4],
TT_QIOiosb[4];
unsigned long
/*
/*
/*
/*
*/
*/
*/
*/
ReadTerminatorMask[2] = { 0, 0 },
/* $QIO read terminator mask
*/
SavedTTdeviceChar[3],
/* Saved TT device characteristics
*/
DeviceCharBuffSize = sizeof(SavedTTdeviceChar);
/* Size of device characteristics buffer*/
ExitConditionValue, /* Exit condition value of program
*/
LATrejectTableSize =/* Number of elements in LAT reject tbl */
sizeof(LATrejectTable) / sizeof(LATrejectTable[0]);
/*
** Itemlist for setting LAT port with the target service name.
*/
struct {
unsigned short item_code;
char
item_byte_count;
char
item_value[ SERVICE_NAME_LENGTH ];
} PortSetmodeItemlist = {
LAT$_ITM_TARGET_SERVICE_NAME, SERVICE_NAME_LENGTH, SERVICE_NAME
};
/*
** Exit handler block.
*/
struct {
unsigned long
void
unsigned long
unsigned long
} ExitHandlerBlock = {
flink;
(*exit_handler)();
arg_count;
*exit_status;
0, ExitHandler, 1, &ExitConditionValue };
(continued on next page)
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 51 (Cont.) LAT.C Terminal Driver Programming Example
/*
** Devices which channels are assigned to.
*/
$DESCRIPTOR(LTAtemplateDSC, "LTA0:");
$DESCRIPTOR(TTchannelDSC, "SYS$COMMAND");
main()
{
/*
** Local Variables:
*/
unsigned long
status,
portSetmodeItemlistSize = sizeof(PortSetmodeItemlist);
/*
** BEGIN:
**
** Declare an exit handler.
*/
if (!((status = sys$dclexh(&ExitHandlerBlock)) & 1))
lib$signal(status);
/*
** Assign a channel to LTA0: to get a forward LAT port and assign a
** channel to the terminal.
*/
if (!((status = sys$assign(<AtemplateDSC, <Achannel, 0, 0)) & 1))
lib$signal(status);
if (!((status = sys$assign(&TTchannelDSC, &TTchannel, 0, 0)) & 1))
lib$signal(status);
/*
** Allocate memory for the channel data buffers.
*/
LTAbuffer = malloc(LTA_MAXBUF);
TTbuffer = malloc(TT_MAXBUF);
/*
** Set device characteristics for the two channels.
*/
if (!((status = SetDeviceChars()) & 1))
lib$signal(status);
/*
** Do SETmode $QIO to set the port entity with the target service name
** specified in the item list.
*/
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 51 (Cont.) LAT.C Terminal Driver Programming Example
if (!((status = sys$qiow(
0,
LTAchannel,
IO$_TTY_PORT|IO$M_LT_SETMODE,
<A_QIOiosb, 0, 0,
&PortSetmodeItemlist,
portSetmodeItemlistSize,
LAT$C_ENT_PORT|(LAT$C_ENTS_OLD << 0x10),
0, 0, 0)) & 1))
lib$signal(status);
if (!(LTA_QIOiosb[0] & 1))
lib$signal(LTA_QIOiosb[0]);
/*
** Enable a CTRL+Y AST on the LAT channel.
*/
if (!((status = sys$qiow(
0,
LTAchannel,
IO$_SETMODE|IO$M_CTRLYAST,
<A_QIOiosb, 0, 0,
LTAhangupHandler,
0, 0, 0, 0, 0)) & 1))
lib$signal(status);
if (!(LTA_QIOiosb[0] & 1))
lib$signal(LTA_QIOiosb[0]);
/*
**
**
**
**
*/
if (!((status = sys$qio(
0,
LTAchannel,
IO$_READVBLK|IO$M_NOECHO,
<A_QIOiosb,
LTAreadChannelAST, 0,
LTAbuffer,
1, 0, &ReadTerminatorMask, 0, 0)) & 1))
lib$signal(status);
/*
** Do the LAT connect $QIO and hibernate until program exit. The
** ConnectAST will execute when the connection completes and post the
** initial read on the TT channel.
*/
if (!((status = sys$qio(
0,
LTAchannel,
IO$_TTY_PORT|IO$M_LT_CONNECT,
<A_QIOiosb,
ConnectAST, 0, 0, 0, 0, 0, 0, 0)) & 1))
lib$signal(status);
sys$hiber();
}
/* END - main() */
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 51 (Cont.) LAT.C Terminal Driver Programming Example
/*
**++
**
** FUNCTIONAL DESCRIPTION:
**
**
This routine sets device characteristics of the LTA and TT devices.
**
The HOSTSYNC, NOBRDCST, EIGHTBIT and PASTHRU characteristics are set
** on the LTA device. The ESCAPE and TTSYNC characteristics are cleared.
**
**
The TTSYNC, HOSTSYNC, EIGHTBIT, and PASTHRU characteristics are set
**
on the TT device. The ESCAPE characteristic is cleared. The TT
**
characterisitcs are also saved for restoration at program exit.
**
**-*/
unsigned long SetDeviceChars(void)
{
/*
** Local Variables:
*/
unsigned long
status,
deviceChar[3];
/*
** BEGIN:
**
** Mask and set the characteristics of the LTA device. Sense the
** current characteristics, and mask in and set the new ones.
*/
if (!((status = sys$qiow(
0,
LTAchannel,
IO$_SENSEMODE,
<A_QIOiosb, 0, 0,
&deviceChar,
DeviceCharBuffSize, 0, 0, 0, 0)) & 1))
lib$signal(status);
if (!(LTA_QIOiosb[0] & 1))
lib$signal(LTA_QIOiosb[0]);
deviceChar[1] =
(deviceChar[1] | (TT$M_HOSTSYNC | TT$M_NOBRDCST | TT$M_EIGHTBIT))
& ~TT$M_ESCAPE & ~TT$M_TTSYNC;
deviceChar[2] |= TT2$M_PASTHRU;
if (!((status = sys$qiow(
0,
LTAchannel,
IO$_SETMODE,
<A_QIOiosb, 0, 0,
&deviceChar,
DeviceCharBuffSize, 0, 0, 0, 0)) & 1))
lib$signal(status);
if (!(LTA_QIOiosb[0] & 1))
lib$signal(LTA_QIOiosb[0]);
(continued on next page)
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 51 (Cont.) LAT.C Terminal Driver Programming Example
/*
** Repeat the procedure for TT device characteristics. However, save
** the current characteristics for restoration at program exit.
*/
if (!((status = sys$qiow(
0,
TTchannel,
IO$_SENSEMODE,
&TT_QIOiosb, 0, 0,
&SavedTTdeviceChar,
DeviceCharBuffSize, 0, 0, 0, 0)) & 1))
lib$signal(status);
if (!(TT_QIOiosb[0] & 1))
lib$signal(TT_QIOiosb[0]);
deviceChar[0] = SavedTTdeviceChar[0];
deviceChar[1] = (SavedTTdeviceChar[1] |
(TT$M_TTSYNC | TT$M_HOSTSYNC | TT$M_EIGHTBIT)) & ~TT$M_ESCAPE;
deviceChar[2] = SavedTTdeviceChar[2] | TT2$M_PASTHRU;
if (!((status = sys$qiow(
0,
TTchannel,
IO$_SETMODE,
&TT_QIOiosb, 0, 0,
&deviceChar,
DeviceCharBuffSize, 0, 0, 0, 0)) & 1))
lib$signal(status);
if (!(TT_QIOiosb[0] & 1))
lib$signal(TT_QIOiosb[0]);
return(status);
}
/* END - SetDeviceChars */
/*
**++
**
** FUNCTIONAL DESCRIPTION:
**
**
This routine is an AST which executes when the connect $QIO completes.
**
First the IOSB is checked. If the connection timed out or was aborted,
**
simply end the session. Any other abnormal status causes the program
**
to exit.
**
**
Otherwise the connection completed successfully and a read on the TT
**
channel is posted.
**
**-*/
void
{
ConnectAST()
/*
** Local Variables:
*/
unsigned long
status;
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 51 (Cont.) LAT.C Terminal Driver Programming Example
/*
**
**
**
**
**
*/
BEGIN:
If the status in the IOSB indicates that the connection timed out
or aborted, call the session end routine. Any other abnormal
status causes program exit.
/* END - ConnectAST */
/*
**++
**
** FUNCTIONAL DESCRIPTION:
**
**
This routine is an AST which executes when the first character read on
**
the LTA channel completes. It does a "flush" read of the channel to
**
drain any data out of the ALTYPAHD buffer and writes the data to the
**
TT channel. It then posts another read on the channel.
**
**-*/
void
{
LTAreadChannelAST(void)
/*
** Local Variables:
*/
unsigned long
status;
/*
** BEGIN:
**
** If the status in the IOSB indicates channel hangup, simply end the
** session. Signal any other abnormal status.
*/
(continued on next page)
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 51 (Cont.) LAT.C Terminal Driver Programming Example
if (LTA_QIOiosb[0] == SS$_HANGUP)
EndSession();
if (!(LTA_QIOiosb[0] & 1))
lib$signal(LTA_QIOiosb[0]);
/*
** Do a "flush" read of the LTA device. This is done by doing a timed
** read with a 0 timeout. There may or may not be any data to drain.
** This method is more efficient than using single character reads.
*/
if (!((status = sys$qiow(
0,
LTAchannel,
IO$_READVBLK|IO$M_TIMED|IO$M_NOECHO,
<A_QIOiosb, 0, 0,
LTAbuffer+1,
LTA_MAXBUF-1, 0,
&ReadTerminatorMask, 0, 0)) & 1))
lib$signal(status);
if (!(LTA_QIOiosb[0] & 1) && (LTA_QIOiosb[0] != SS$_TIMEOUT))
lib$signal(LTA_QIOiosb[0]);
/*
** The second word of the IOSB contains the number of characters
** read. Write the characters plus 1 for the initial read to the
** TT device.
*/
if (!((status = sys$qiow(
0,
TTchannel,
IO$_WRITEVBLK,
&TT_QIOiosb, 0, 0,
LTAbuffer,
LTA_QIOiosb[1]+1, 0, 0, 0, 0)) & 1))
lib$signal(status);
if (!(TT_QIOiosb[0] & 1))
lib$signal(TT_QIOiosb[0]);
/*
** Post another read on the LTA device.
*/
if (!((status = sys$qio(
0,
LTAchannel,
IO$_READVBLK|IO$M_NOECHO,
<A_QIOiosb,
LTAreadChannelAST, 0,
LTAbuffer,
1, 0, &ReadTerminatorMask, 0, 0)) & 1))
lib$signal(status);
return;
}
/* END - LTAreadChannelAST */
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 51 (Cont.) LAT.C Terminal Driver Programming Example
/*
**++
**
** FUNCTIONAL DESCRIPTION:
**
**
This routine is an AST which executes when the first character read on
**
the TT channel completes. It does a "flush" read of the channel to
**
drain any data out of the TYPAHD buffer and writes the data to the
**
LTA channel. It then posts another read on the channel.
**
**-*/
void
{
TTreadChannelAST(void)
/*
** Local Variables:
*/
unsigned long
status;
/*
** BEGIN:
**
** If the user pressed the connection terminator character, do a LAT
** disconnect $QIO and exit.
*/
if (*TTbuffer == CONNECTION_TERMINATOR)
{
if (!((status = sys$qiow(
0,
LTAchannel,
IO$_TTY_PORT|IO$M_LT_DISCON,
<A_QIOiosb, 0, 0, 0, 0, 0, 0, 0, 0)) & 1))
lib$signal(status);
if (!(LTA_QIOiosb[0] & 1))
lib$signal(LTA_QIOiosb[0]);
return;
}
/*
** Do a "flush" read of the TT device. This is done by doing a timed
** read with a 0 timeout. There may or may not be any data to drain.
*/
if (!((status = sys$qiow(
0,
TTchannel,
IO$_READVBLK|IO$M_TIMED|IO$M_NOECHO,
&TT_QIOiosb, 0, 0,
TTbuffer+1,
TT_MAXBUF-1, 0,
&ReadTerminatorMask, 0, 0)) & 1))
lib$signal(status);
if (!(TT_QIOiosb[0] & 1) && (TT_QIOiosb[0] != SS$_TIMEOUT))
lib$signal(TT_QIOiosb[0]);
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 51 (Cont.) LAT.C Terminal Driver Programming Example
/*
** The second word of the IOSB contains the number of characters
** read. Write the characters plus 1 for the initial read to the
** TT device.
*/
if (!((status = sys$qiow(
0,
LTAchannel,
IO$_WRITEVBLK,
<A_QIOiosb, 0, 0,
TTbuffer,
TT_QIOiosb[1]+1, 0, 0, 0, 0)) & 1))
lib$signal(status);
/*
** If the status in the IOSB indicates channel hangup, simply end
** the session. Signal any other abnormal status.
*/
if (LTA_QIOiosb[0] == SS$_HANGUP)
EndSession();
if (!(LTA_QIOiosb[0] & 1))
lib$signal(LTA_QIOiosb[0]);
/*
** Post another read on the LTA device.
*/
if (!((status = sys$qio(
0,
TTchannel,
IO$_READVBLK|IO$M_NOECHO,
&TT_QIOiosb,
TTreadChannelAST, 0,
TTbuffer,
1, 0, &ReadTerminatorMask, 0, 0)) & 1))
lib$signal(status);
return;
}
/* END - TTreadChannelAST */
/*
**++
**
** FUNCTIONAL DESCRIPTION:
**
**
This routine is the CTRL+Y AST for the LTA channel. It executes when
**
a hangup on the LTA channel is recognized (connection timed out or
**
aborted). It will call the session end routine if it hasnt already
**
been called by ConnectAST.
**
**
NOTE: CTRL+Y ASTs for application ports will NOT execute when the
**
connection is disconnected.
**
**-*/
(continued on next page)
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 51 (Cont.) LAT.C Terminal Driver Programming Example
void
{
LTAhangupHandler(void)
/*
** BEGIN:
**
** Call the session end routine and return.
*/
EndSession();
return;
/* END - LTAhanghupHandler */
/*
**++
**
** FUNCTIONAL DESCRIPTION:
**
**
This routine is executed at session end. It will do a $QIO SENSEmode
**
and search the resulting itemlist to find the reason for the LAT
**
disconnect. The reason for the disconnect is displayed on the
**
terminal and the image exits.
**
**-*/
void
{
EndSession(void)
/*
** Local Variables:
*/
struct ITEM_ENTRY
unsigned long
char
*itemlistEntry;
status;
*senseItemlist = malloc(MAX_SENSE_ITEMLIST_SIZE),
*itemlistEntryPointer;
/*
** BEGIN:
**
** Do the SENSEmode on the port.
*/
if (!((status = sys$qiow(
0,
LTAchannel,
IO$_TTY_PORT|IO$M_LT_SENSEMODE,
<A_QIOiosb, 0, 0,
senseItemlist,
MAX_SENSE_ITEMLIST_SIZE,
LAT$C_ENT_PORT|(LAT$M_SENSE_FULL << 0x10),
0, 0, 0)) & 1))
lib$signal(status);
if (!(LTA_QIOiosb[0] & 1))
lib$signal(LTA_QIOiosb[0]);
/*
** Set up two pointers used to traverse the itemlist.
*/
itemlistEntry = (struct ITEM_ENTRY *) senseItemlist;
itemlistEntryPointer = senseItemlist;
(continued on next page)
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 51 (Cont.) LAT.C Terminal Driver Programming Example
/*
** Search the itemlist for the LAT$_ITM_DISCONNECT_REASON code to find
** out why the connection terminated.
*/
while (itemlistEntry->LAT$R_ITM_CODE.LAT$W_ITEMCODE !=
LAT$_ITM_DISCONNECT_REASON)
{
/*
** If the current itemcode being checked has a string value,
** advance the pointer to the next itemcode by skipping
** BCNT bytes plus 3 bytes for the BCNT byte itself and the
** 2 byte itemcode.
*/
if (itemlistEntry->
LAT$R_ITM_CODE.LAT$R_ITM_BITS.LAT$V_STRING)
itemlistEntryPointer +=
itemlistEntry->LAT$R_ITEM_VALUE.
LAT$R_ITEM_COUNTED_STRING.LAT$B_ITEM_BCNT + 3;
/*
** If the current itemcode being checked has a scalar value,
** advance the pointer to the next itemcode by skipping 6
** bytes for the itemcode and the 4 byte scalar.
*/
else
itemlistEntryPointer += 6;
itemlistEntry = (struct ITEM_ENTRY *) itemlistEntryPointer;
}
/*
** If the disconnect reason is a LAT reject code, print out the
** text corresponding to the code and set the exit condition value
** to SS$_NORMAL.
*/
if (itemlistEntry->LAT$R_ITEM_VALUE.LAT$L_ITEM_SCALAR_VALUE <=
LATrejectTableSize)
{
printf("\nSession disconnected. Reason: %s\n\n\n",
LATrejectTable[ itemlistEntry->LAT$R_ITEM_VALUE.
LAT$L_ITEM_SCALAR_VALUE ]);
ExitConditionValue = SS$_NORMAL;
}
/*
** The scalar value is a LAT facility message code. Set the exit
** condition value to be the scalar. Upon image exit, the
** corresponding LAT facility message will be displayed.
*/
else
ExitConditionValue =
itemlistEntry->LAT$R_ITEM_VALUE.LAT$L_ITEM_SCALAR_VALUE;
sys$exit(ExitConditionValue);
}
/* END - EndSession */
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 51 (Cont.) LAT.C Terminal Driver Programming Example
/*
**++
**
** FUNCTIONAL DESCRIPTION:
**
**
This is the program exit handler which is executed upon image exit.
**
It will cancel all pending I/O on the two channels and restore the
**
TT channel characteristics.
**
**-*/
void
{
ExitHandler(void)
/*
** Local Variables:
*/
unsigned long
status;
/*
** BEGIN:
**
** Cancel I/O on the channels, reset terminal characteristics and
** return.
*/
if (!((status = sys$cancel(LTAchannel)) & 1))
lib$signal(status);
if (!((status = sys$cancel(TTchannel)) & 1))
lib$signal(status);
if (!((status = sys$qiow(
0,
TTchannel,
IO$_SETMODE,
&TT_QIOiosb, 0, 0,
&SavedTTdeviceChar,
DeviceCharBuffSize, 0, 0, 0, 0)) & 1))
lib$signal(status);
if (!(TT_QIOiosb[0] & 1))
lib$signal(TT_QIOiosb[0]);
return;
}
/* END - ExitHandler */
The VAX MACRO program FULL_DUPLEX_TERMINAL.MAR (Example 52)
shows several I/O operations using the full-duplex capabilities of the
terminal. This program shows some important concepts about terminal driver
programming: assigning an I/O channel, performing full-duplex I/O operations,
enabling Ctrl/C AST requests, and itemlist read operations. The program is
designed to run with a terminal set to full-duplex mode.
The initialization code queues a read request to the terminal and enables Ctrl/C
AST requests. The main loop then prints out a random message every three
seconds. When you enter a message on the terminal, the read AST routine prints
an acknowledgment message and queues another read request. If you press
Ctrl/C, the associated AST routine cancels the I/O operation on the assigned
channel and exits to the command interpreter.
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 52 FULL_DUPLEX_TERMINAL.MAR Terminal Driver Programming Example
.TITLE FULL_DUPLEX TERMINAL PROGRAMMING EXAMPLE
.IDENT /05/
; ********************************************************************
;
;
TERMINAL PROGRAM
;
; ********************************************************************
.SBTTL DECLARATIONS
.DISABLE
GLOBAL
;
; Declare the external symbols and MACRO libraries.
;
.EXTERNAL
.LIBRARY
.LIBRARY
LIB$GET_EF
SYS$LIBRARY:LIB.MLB
SYS$LIBRARY:STARLET.MLB
;
; Define symbols
;
$IODEF
$QIODEF
$SSDEF
$TRMDEF
$TTDEF
;
; Define macros
;
.SHOW
.MACRO
.WORD
.WORD
.LONG
.LONG
.ENDM
.NOSHOW
;
;
;
;
;
ITEM
LEN=0,CODE,VALUE
LEN
TRM$_CODE
VALUE
0
ITEM
;
; Declare exit handler control
;
EXIT_HANDLER_BLOCK:
.LONG 0
.LONG EXIT_HANDLER
.LONG 1
.LONG STATUS
STATUS: .BLKL 1
block
;
;
;
;
;
;
; Allocate terminal descriptor and channel number storage
;
TT_DESC:
.ASCID /SYS$INPUT/
TT_CHAN:
.BLKW 1
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 52 (Cont.) FULL_DUPLEX_TERMINAL.MAR Terminal Driver Programming Example
;
; Define acknowledgment message. This is done right above input buffer
; so that we can concatenate the two together when the acknowledgment
; message is issued.
;
ACK_MSG:
.ASCII <CR><LF> /Following input acknowledged: /
ACK_MSGLEN=.-ACK_MSG
; Calculate length of message
;
; Allocate input buffer
;
IN_BUFLEN = 20
; Set length of buffer
IN_BUF:
.BLKB IN_BUFLEN
; Allocate character buffer
IN_IOSB:
.BLKQ 1
; Input I/O status block
;
; Define out-of-band ast character mask
;
CNTRLA_MASK:
.LONG 0
.LONG ^B0010
; Control A mask
;
; Define old terminal characteristics buffer
;
OLDCHAR_BUF_LEN = 12
OLDCHAR_BUF:
.BLKB OLDCHAR_BUF_LEN
;
; Define new terminal characteristics buffer
;
NEWCHAR_BUF_LEN = 12
NEWCHAR_BUF:
.BLKB NEWCHAR_BUF_LEN
;
; Define carriage control symbols
;
CR=^X0D
LF=^X0A
;
;
;
;
;
;
;
; Carriage return
; Line feed
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 52 (Cont.) FULL_DUPLEX_TERMINAL.MAR Terminal Driver Programming Example
ARRAY:
.LONG
.LONG
.LONG
.LONG
.LONG
.LONG
.LONG
.LONG
10$
15$
20$
25$
30$
35$
40$
45$
;
;
;
;
;
; Define messages
;
10$:
.ASCII
<CR><LF>/RED ALERT! RED ALERT!/
15$=.-10$
;
20$:
.ASCII
<CR><LF>/ALL SYSTEMS GO/
25$=.-20$
;
30$:
.ASCII
<CR><LF>/WARNING..INTRUDER ALARM/
35$=.-30$
;
40$:
.ASCII
<CR><LF>/** SYSTEM OVERLOAD **/
45$=.-40$
;
; Static QIO packet for message output using QIO$_G form
;
WRITE_QIO:
$QIO
;
; Declare the required I/O status blocks.
;
SYNC_IOSB::
.BLKQ 1
; I/O status block for synchronous terminal processing.
;
; Declare the required event flags.
;
ASYNC_EFN::
.BLKL 1
; Event flag for asynchronous terminal processing.
SYNC_EFN
==
WRITE_QIO + 4 ; Event flag for sync terminal processing.
TIMER_EFN::
.BLKL 1
; Event flag for timer processing.
;
; Timer storage
;
WAITIME:
.LONG
TIME:
.BLKQ
-10*1000*1000*3,-1
1
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 52 (Cont.) FULL_DUPLEX_TERMINAL.MAR Terminal Driver Programming Example
.PAGE
.SBTTL START - MAIN ROUTINE
.ENABLE LOCAL_BLOCK
;++
;
; Functional description:
;
; ********************************************************************
;
;
Start program
;
; ********************************************************************
;
;
The following code performs initialization functions.
;
It is assumed that the terminal is already in
;
FULL-DUPLEX mode.
;
;
NOTE: When doing QIO_S calls, parameters P1 and P3-P6 should be
;
passed by value, while P2 should be passed by reference.
;
; Input parameters:
;
None
;
; Output parameters:
;
None
;
;-.ENTRY START ^M < >
;
ASYNC_EFN
# 1, G^ LIB$GET_EF
R0, 10$
SYNC_EFN
# 1, G^ LIB$GET_EF
R0, 10$
TIMER_EFN
# 1, G^ LIB$GET_EF
R0, 10$
DEVNAM=TT_DESC,-;
CHAN=TT_CHAN
;
BLBC
R0, 10$
;
BSBW
CHANGE_CHARACTERISTICS ;
;
BSBW
ENABLE_CTRLCAST
;
BSBW
ENABLE_OUTBANDAST
;
BSBW
ENABLE_READ
;
MOVZWL TT_CHAN, WRITE_QIO+8
;
BRB
LOOP
;
10$:
BRW
ERROR
;
; This loop outputs a message based on a random number and then
; delays for 3 seconds
;
(continued on next page)
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 52 (Cont.) FULL_DUPLEX_TERMINAL.MAR Terminal Driver Programming Example
LOOP:
$GETTIM_S
TIMADR=TIME
BLBC
R0, 10$
EXTZV #6, #2, TIME, R0
MOVQ
ARRAY[R0], WRITE_QIO+QIO$_P1
;
;
;
;
;
;
;
; Issue QIO write using packet defined in data area
;
$QIOW_G
BLBC
MOVZWL
BLBC
WRITE_QIO
R0, 10$
SYNC_IOSB, R0
R0, 10$
;
; Delay for 3 seconds before issuing next message
;
$SETIMR_S
LOCAL_BLOCK
.PAGE
.SBTTL CHANGE_CHARACTERISTICS - CHANGE CHARACTERISTICS OF TERMINAL
;++
;
; Functional description:
;
;
Routine to change the characteristics of the terminal.
;
; Input parameters:
;
None
;
; Output parameters:
;
R0 - status from $QIO call.
;
R1 - R5 destroyed
;
;-;
CHANGE_CHARACTERISTICS:
$QIOW_S EFN=SYNC_EFN, ; Get current terminal characteristics
CHAN=TT_CHAN, FUNC=#IO$_SENSEMODE, IOSB=SYNC_IOSB, P1=OLDCHAR_BUF, P2=#OLDCHAR_BUF_LEN
BLBC
R0, 10$
; Error if clear
MOVZWL SYNC_IOSB, R0
; Get the terminal driver status.
BLBC
R0, 10$
; Error - branch
(continued on next page)
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 52 (Cont.) FULL_DUPLEX_TERMINAL.MAR Terminal Driver Programming Example
$DCLEXH_S EXIT_HANDLER_BLOCK
BLBC
MOVC3
R0, 10$
#OLDCHAR_BUF_LEN, OLDCHAR_BUF, NEWCHAR_BUF
BISL2 #TT$M_NOBRDCST, NEWCHAR_BUF+4
$QIOW_S EFN=SYNC_EFN, CHAN=TT_CHAN, FUNC=#IO$_SETMODE, IOSB=SYNC_IOSB, P1=NEWCHAR_BUF, P2=#NEWCHAR_BUF_LEN
BLBC
R0, 10$
MOVZWL SYNC_IOSB, R0
BLBC
R0, 10$
RSB
;
;
;
;
;
10$:
BRW
ERROR
.PAGE
.SBTTL ENABLE_CTRLCAST - ENABLE Ctrl/C AST
;++
;
; Functional description:
;
;
Routine to allow Ctrl/C recognition.
;
; Input parameters:
;
None
;
; Output parameters:
;
None
;
;-;
ENABLE_CTRLCAST:
$QIOW_S EFN=SYNC_EFN, CHAN=TT_CHAN, FUNC=#IO$_SETMODE!IO$M_CTRLCAST, IOSB=SYNC_IOSB, P1=CTRLCAST, ; AST routine address
P3=#3
; User mode
BLBC
R0, 10$
; Error - branch.
MOVZWL SYNC_IOSB, R0
; Get the terminal driver status.
BLBC
R0, 10$
; Terminal driver error - branch.
RSB
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 52 (Cont.) FULL_DUPLEX_TERMINAL.MAR Terminal Driver Programming Example
10$:
BRW
ERROR
.PAGE
.SBTTL ENABLE_OUTBANDAST - ENABLE Ctrl/A AST
;++
;
; Functional description:
;
;
Routine to allow CNTRL/A recognition.
;
; Input parameters:
;
None
;
; Output parameters:
;
None
;
ENABLE_OUTBANDAST:
$QIOW_S EFN=SYNC_EFN, CHAN=TT_CHAN, FUNC=#IO$_SETMODE!IO$M_OUTBAND, IOSB=SYNC_IOSB, P1=CTRLAAST, ; AST routine address
P2=#CNTRLA_MASK, ; Character mask
P3=#3
; User mode
BLBC
R0, 10$
; QIO error - branch.
MOVZWL SYNC_IOSB, R0
; Get the terminal driver status.
BLBC
R0, 10$
; Terminal driver error - branch.
RSB
10$:
BRW
ERROR
.PAGE
.SBTTL ENABLE_READ - QUEUE A READ TO THE TERMINAL.
;++
;
; Functional description:
;
;
Routine to queue a read operation to the terminal.
;
; Input parameters:
;
None
;
; Output parameters:
;
None
;
; Define item list for itemlist read
;
ITEM_LST:
ITEM
0, MODIFIERS, ; Convert lowercase to
TRM$M_TM_CVTLOW!TRM$M_TM_NOEDIT ; upper and inhibit line
ITEM
6, TERM,MASK_ADDR
; editing
; Set up terminator mask
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 52 (Cont.) FULL_DUPLEX_TERMINAL.MAR Terminal Driver Programming Example
ITEM_LEN
MASK_ADDR:
.LONG
. - ITEM_LST
1@^XD
; Terminator mask is
; <CR>
; and "$"
.WORD 1@4
ENABLE_READ:
$QIO_S EFN=ASYNC_EFN, ; Must not be QIOW form or read will block
CHAN=TT_CHAN, ; process
FUNC=#IO$_READVBLK!IO$M_EXTEND, IOSB=IN_IOSB, ASTADR=READAST, ; AST routine to execute
P1=IN_BUF, ; on
P2=#IN_BUFLEN, P5=#ITEM_LST, ; Itemlist read address
P6=#ITEM_LEN
; Itemlist read size
BLBC
R0, 10$
; QIO error - branch.
; The queued read operation will not affect write operations due
; to the fact that breakthru has been set for the write operations.
RSB
10$:
BRW
ERROR
.PAGE
.SBTTL READAST - AST ROUTINE FOR READ COMPLETION
.ENABLE LOCAL_BLOCK
;++
;
; Functional description:
;
;
AST routine to execute on read completion.
;
; Input parameters:
;
None
;
; Output parameters:
;
None
;
;-;
10$:
MOVZWL IN_IOSB, R0
BRW
20$:
ERROR
.ENTRY READAST
BLBC
MOVZWL
ADDL2
$QIO_S
BLBC
IN_IOSB, 10$
; Terminal driver error - branch
IN_IOSB+2, R0
; Get number of characters read into R0
#ACK_MSGLEN, R0
; Add size of fixed acknowledge message
EFN=ASYNC_EFN, ; Issue acknowledge message
CHAN=TT_CHAN, ; Note, ACK must be asynchronous (QIO)
FUNC=#IO$_WRITEVBLK, - ; and the terminal driver write status
P1=ACK_MSG, ; is ignored (no IOSB and AST routine).
P2=R0
; Specify IOSB and AST routine if output
; must be displayed on the terminal.
R0, 20$
; QIO error - branch
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 52 (Cont.) FULL_DUPLEX_TERMINAL.MAR Terminal Driver Programming Example
;
; Process read message
;
;
.
;
.
;
.
;(user-provided code to decode command inserted here)
;
.
;
.
;
.
BSBW
RET
ENABLE_READ
.DISABLE
LOCAL_BLOCK
.PAGE
.SBTTL CTRLAAST - AST ROUTINE FOR Ctrl/A
.SBTTL CTRLCAST - AST ROUTINE FOR Ctrl/C
.SBTTL ERROR - EXIT ROUTINE
;++
;
; Functional description:
;
;
AST routine to execute when Ctrl/C or Ctrl/A is entered.
;
; Input parameters:
;
None
;
; Output parameters:
;
None
;
CTRLCAST::
CTRLAAST::
.WORD
MOVL
^M < >
#SS$_NORMAL, R0
ERROR::
$EXIT_S R0
RSB
; Exit
.PAGE
.SBTTL EXIT_HANDLER - EXIT HANDLER ROUTINE
;++
;
; Functional description:
;
;
Exit handler routine to execute when image exits. It cancels
;
any outstanding I/O on this channel and resets the terminal
;
characteristics to their original state.
;
; Input parameters:
;
None
;
; Output parameters:
;
None
;
;-;
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 52 (Cont.) FULL_DUPLEX_TERMINAL.MAR Terminal Driver Programming Example
.ENTRY EXIT_HANDLER
^M< >
$CANCEL_S
CHAN=TT_CHAN
$QIOW_S EFN=SYNC_EFN, CHAN=TT_CHAN, FUNC=#IO$_SETMODE, IOSB=SYNC_IOSB, P1=OLDCHAR_BUF, P2=#OLDCHAR_BUF_LEN
BLBC
R0, 10$
MOVZWL SYNC_IOSB, R0
10$:
RET
.END
START
The VAX MACRO program READ_VERIFY.MAR (Example 53) shows the read
verify function. The program shows a typical build of itemlists (both the right and
left fields), channel assignment, a right- and left-justified read verify operation,
and then the read QIO operation.
SYS$LIBRARY:LIB.MLB
SYS$LIBRARY:STARLET.MLB
;
; Include files:
;
$IODEF
$TRMDEF
;
; Macros:
;
.MACRO ITEM LEN=0,CODE,VALUE
.WORD LEN
.WORD TRM$_CODE
.LONG VALUE
.LONG 0
.ENDM ITEM
;
; Equated symbols:
;
INBUF_LEN = 20
ESC = ^X1B
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 53 (Cont.) READ_VERIFY.MAR Terminal Driver Programming Example
;
; Own storage:
;
; Build item lists for the read verify QIO
;
;
; Right-justified field
;
R_ITEM_LIST:
ITEM
CODE
= MODIFIERS, VALUE = TRM$M_TM_R_JUST
ITEM
; Right justify
CODE
VALUE
= EDITMODE, = TRM$K_EM_RDVERIFY
CODE
VALUE
LEN
; Set up prompt
CODE
VALUE
LEN
ITEM
CODE
VALUE
= INIOFFSET, = R_INISTR_LEN
ITEM
CODE
VALUE
LEN
CODE
VALUE
ITEM
ITEM
ITEM
R_ITEM_LIST_LEN = .-R_ITEM_LIST
R_PROMPT_ADDR:
.ASCII <ESC> /[12;12H$/
R_PROMPT_LEN = .-R_PROMPT_ADDR
R_INISTR_ADDR:
.ASCII / , /
R_INISTR_LEN = .-R_INISTR_ADDR
MASK = TRM$M_CV_NUMERIC!TRM$M_CV_NUMPUNC
R_PICSTR_ADDR:
.BYTE MASK
.BYTE MASK
.BYTE MASK
.BYTE 0
; Marker character
.BYTE MASK
.BYTE MASK
.BYTE MASK
R_PICSTR_LEN = .-R_PICSTR_ADDR
;
; Left-justified field
;
L_ITEM_LIST:
ITEM
CODE
= MODIFIERS, VALUE = TRM$M_TM_CVTLOW!TRM$M_TM_AUTO_TAB
; Upcase input and
; complete on field full
(continued on next page)
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 53 (Cont.) READ_VERIFY.MAR Terminal Driver Programming Example
ITEM
CODE
VALUE
= EDITMODE, = TRM$K_EM_RDVERIFY
CODE
VALUE
LEN
; Set up prompt
CODE
VALUE
LEN
ITEM
CODE
VALUE
= INIOFFSET, = 0
ITEM
CODE
VALUE
LEN
CODE
VALUE
ITEM
ITEM
ITEM
L_ITEM_LIST_LEN = .-L_ITEM_LIST
L_PROMPT_ADDR:
.ASCII <ESC>/[13;12H Enter Date: /
L_PROMPT_LEN = .-L_PROMPT_ADDR
L_INISTR_ADDR:
.ASCII / - - /
L_INISTR_LEN = .-L_INISTR_ADDR
MASK1 = TRM$M_CV_NUMERIC
MASK2 = TRM$M_CV_UPPER!TRM$M_CV_LOWER
L_PICSTR_ADDR:
.BYTE
.BYTE
.BYTE
.BYTE
.BYTE
.BYTE
.BYTE
.BYTE
.BYTE
L_PICSTR_LEN =
IN_IOSB:
TT_CHAN:
INBUF:
SYSINPUT:
SYNC_EFN:
MASK1
MASK1
0
; Marker character
MASK2
MASK2
MASK2
0
; marker character
MASK1
MASK1
.-L_PICSTR_ADDR
.BLKL
.BLKW
.BLKB
.ASCID
.BLKL
2
1
INBUF_LEN
/SYS$INPUT/
1
.PAGE
.ENTRY READ_VERIFY
^M < >
;
; Get the required event flags.
;
PUSHAL SYNC_EFN
CALLS # 1, G^ LIB$GET_EF
BLBC
R0, ERROR
; Error - branch
;
; Assign the channel to SYS$INPUT
;
(continued on next page)
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 53 (Cont.) READ_VERIFY.MAR Terminal Driver Programming Example
$ASSIGN_S CHAN = TT_CHAN DEVNAM = SYSINPUT
BLBC
R0, ERROR
; SYS$INPUT
; Branch on error
;
; Clear the screen
;
CLRQ
CALLS
BLBC
-(SP)
#2, G^ SCR$ERASE_PAGE
R0, ERROR
;
; Do the right-justified read operation
;
PUSHL
PUSHAB
CALLS
BLBC
#R_ITEM_LIST_LEN
R_ITEM_LIST
#2, DO_READ
R0, ERROR
;
; Do the left-justified read operation
;
PUSHL
PUSHAB
CALLS
BLBC
#L_ITEM_LIST_LEN
L_ITEM_LIST
#2, DO_READ
R0, ERROR
ERROR:
RET
.PAGE
;++
;
; DO_READ - do the actual QIO
;
; Inputs:
;
;
4(AP) the address of the itemlist
;
8(AP) the length of the itemlist
;
;-.ENTRY DO_READ, ^M<>
$QIOW_S EFN=SYNC_EFN, CHAN = TT_CHAN, FUNC = #<IO$_READVBLK!IO$M_EXTEND>, IOSB = IN_IOSB, p1 = inbuf, p2 = #inbuf_len, p5 = 4(AP), P6 = 8(AP)
BLBC
R0, 10$
; QIO error - branch
MOVZWL IN_IOSB, R0
; Get the terminal driver status.
BLBC
R0, 10$
; Terminal driver error - branch
; Handle the input...
(continued on next page)
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 53 (Cont.) READ_VERIFY.MAR Terminal Driver Programming Example
10$:
RET
.END READ_VERIFY
Terminal Driver
5.6 Terminal Driver Programming Examples
Example 54 (Cont.) LIB$XXABLE_CTRL.C Terminal Driver Programming Example
main()
{
int RetStat;
unsigned short int IOChan;
unsigned short int GotLen;
struct dsc$descriptor GotDsc = { 0, DSC$K_DTYPE_T, DSC$K_CLASS_D, NULL };
$DESCRIPTOR( Prompt, "Enter CTRL/Y, CTRL/C, or any characters and RETURN:" );
$DESCRIPTOR( Exiting, "Exiting" );
$DESCRIPTOR( TTDsc, "TT:");
RetStat = lib$disable_ctrl( &LIB$M_CLI_CTRLY );
if (!$VMS_STATUS_SUCCESS( RetStat ))
return RetStat;
RetStat = sys$assign( &TTDsc, &IOChan, 0, 0 );
if (!$VMS_STATUS_SUCCESS( RetStat ))
return RetStat;
RetStat = sys$qiow( 0, IOChan, IO$_SETMODE|IO$M_CTRLYAST, 0, 0, 0,
CtrlYHandler, 0, 0, 0, 0, 0 );
if (!$VMS_STATUS_SUCCESS( RetStat ))
return RetStat;
RetStat = sys$qiow( 0, IOChan, IO$_SETMODE|IO$M_CTRLCAST, 0, 0, 0,
CtrlCHandler, 0, 0, 0, 0, 0 );
if (!$VMS_STATUS_SUCCESS( RetStat ))
return RetStat;
RetStat = lib$get_input( &GotDsc, &Prompt, &GotLen );
if (!$VMS_STATUS_SUCCESS( RetStat ))
return RetStat;
RetStat = sys$dassgn( IOChan );
if (!$VMS_STATUS_SUCCESS( RetStat ))
return RetStat;
RetStat = lib$enable_ctrl( &LIB$M_CLI_CTRLY );
if (!$VMS_STATUS_SUCCESS( RetStat ))
return RetStat;
RetStat = lib$put_output( &Exiting );
if (!$VMS_STATUS_SUCCESS( RetStat ))
return RetStat;
RetStat = lib$sfree1_dd( &GotDsc );
if (!$VMS_STATUS_SUCCESS( RetStat ))
return RetStat;
return SS$_NORMAL;
}
6
Pseudoterminal Driver
This chapter describes the use of the pseudoterminal driver (FTDRIVER) and the
pseudoterminal software.
A pseudoterminal is a software device that appears as a real terminal to
an application communicating with it, but does not require the existence
of a physical terminal. A pseudoterminal consists of two components: the
pseudoterminal device and a control program. The control program acts like
a keyboard; that is, anything written to the control program appears on the
pseudoterminal device as if the keystrokes had been typed in at a physical
terminal. The control program also acts like a viewport to the pseudoterminal
device; that is, the control program reads anything that is written by the system
to the pseudoterminal device.
A pseudoterminal allows an application to be set up on the control side of the link
to communicate with another application that is on the pseudoterminal side. This
arrangement allows development of applications that either simulate users or
monitor the communication between a real user (at a physical terminal) and an
application. As with other devices, the work of the pseudoterminal is performed
by a device driver and is tightly coupled to the operating system.
The pseudoterminal driver software includes a set of control connection routines.
Applications can use these routines to perform pseudoterminal operations and
functions. Appendix D provides the calling conventions for these routines.
Creating a pseudoterminal
Canceling a request
Deleting a pseudoterminal
Pseudoterminal Driver
6.1 Pseudoterminal Operations
TT$M_TTSYNC is set. To change this attribute, issue the SET MODE $QIO
function.
62 Pseudoterminal Driver
Pseudoterminal Driver
6.2 Pseudoterminal Driver Features
Type-ahead buffer
Terminal/mailbox interaction
Terminal control characters, such as Ctrl/S and Ctrl/Q for starting and
stopping output, Ctrl/O for discarding output, and all other special characters
that are handled by the standard terminal driver
Pseudoterminal Driver 63
Pseudoterminal Driver
6.4 I/O Buffers
is responsible for managing the pages and cannot use buffers that are owned
by another pseudoterminal. The application must decide whether to delete the
buffers when they are freed by the driver or to reuse them.
The I/O buffers must be valid pages in virtual address space. Creating or deleting
an I/O buffer does not alter the contents of the pages.
The low-order word of the status information longword contains the status of the
request. The high-order word of the status information longword contains the
actual number of bytes that are read or written.
Assume that an I/O buffer starting at 200 hexadecimal is available for use. If you
want to read 20 bytes from the pseudoterminal, the readbuf address would be
200, and the readbuf_len would be 20. An application can use the rest of this
buffer for other purposes, including reading or writing to the pseudoterminal.
Figure 61 shows how the buffer would look.
Figure 61 Buffer Layout
Byte Count
Status
200 16
204 16
Data
218 16
ZK9656GE
Reading data
Writing data
Flow control
Event notification
64 Pseudoterminal Driver
Pseudoterminal Driver
6.5 Pseudoterminal Functions
6.5.2 Writing Data
To write data to the pseudoterminal, the control program uses the PTD$WRITE
routine. The write request allows you to specify a buffer to receive any output
that the write request generates; you do not need to issue a separate read request
to read this data. When you use an echo buffer, the control application can
significantly reduce the number of I/O requests required.
An application can issue only one write request at a time. Once the write request
completes, the application must check the write buffer status longword to see
whether all the data supplied was written. If not, the application must issue
additional write requests until all the data has been accepted.
Pseudoterminal Driver 65
Pseudoterminal Driver
6.5 Pseudoterminal Functions
6.5.5 Event Notification
This section describes how the pseudoterminal driver provides notification of
important driver events.
6.5.5.1 Input Flow Control
The driver provides three ways to indicate when the class driver wants to stop
input and one way to signal when it is safe to resume output:
The control program can enable a BELL attention AST to be delivered when
the class driver calls the PTD$SET_TERMINAL_NOTIFICATION routine.
This AST is delivered if the pseudoterminal does not have the HOSTSYNC
attribute set. If only a BELL or only an XOFF AST event is enabled and
an XOFF or a BELL AST needs to be delivered, the AST that is available is
delivered.
The control program can enable an XOFF attention AST to be delivered when
the class driver calls the PTD$SET_TERMINAL_NOTIFICATION routine.
This AST is delivered if the pseudoterminal has the HOSTSYNC attribute
set.
66 Pseudoterminal Driver
Pseudoterminal Driver
6.5 Pseudoterminal Functions
6.5.5.6 Terminal Driver Read Events
Three special event types notify the control program when a terminal read
request starts and finishes. By default, the pseudoterminal does not deliver the
read notification ASTs associated with these events. The PTD$SET_EVENT_
NOTIFICATION routine must be used explicitly to enable or disable their
delivery.
Start ReadTells the control program that the terminal driver is starting a
read request. Some applications require this in order to know when to start
inputting a logged session script.
Middle ReadTells the control program that the terminal driver has finished
writing the prompt string if one was supplied.
End ReadTells the control program that the terminal driver has finished a
read request.
Pseudoterminal Driver 67
Pseudoterminal Driver
6.6 Pseudoterminal Driver Programming Example
One of the six I/O buffers is permanently reserved as the terminal read buffer.
This buffer is passed directly to the terminal read $QIO. This eliminates having
to move data that is read from the terminal into the read buffer. The other five
buffers are placed in a queue and are allocated and deallocated as needed. This
pool of buffers reserves the first two longwords to be used as queue headers and
traditional IOSBs. The third longword and the I/O status longwords are used by
the pseudoterminal driver.
Example 61 Sample Pseudocode for Pseudoterminal Driver Program
/*
** Main Routine
**
** Function: Intitializes the environment and then hibernates, waiting
** to be awakened. When awakened, the program checks to see whether it
** is exiting, or whether more log data is available. If more data is
** available, the data is appended to the current log record and checked
** to see whether a log record should be written. A log record is written
** either when maxbuf characters are in the log buffer,
** or when it finds a <CR><LF> character pair. The algorithm
** allows an unlimited number of <NULL> fill characters to occur
** between the <CR> and the <LF>. If the program is
** exiting, it closes the log file, deletes the pseudoterminal, resets the
** terminal, and exits.
*/
Initialize environments (This includes creating pseudoterminal, the log file
and starting up the subprocess.)
If (Initialization OK) Then
Do
while (I/O buffer to log)
Data size = number of bytes in I/O buff
For all data in I/O buffer
If (cr_seen) Then
If (current char == <LF>) Then
write current log buffer
reset cr_seen
point to start of log buffer
Else if (current char != <NULL>) Then
insert <CR> and current char into log buffer
move log buffer ptr over 2 characters
reset cr_seen
Endif
Else if (current character != <CR>) Then
insert character into log buffer
move log buffer ptr over 1 character
Else
set cr_seen
Endif
(continued on next page)
68 Pseudoterminal Driver
Pseudoterminal Driver
6.6 Pseudoterminal Driver Programming Example
Example 61 (Cont.) Sample Pseudocode for Pseudoterminal Driver Program
If (log buffer ptr >= IOC$GW_MAX-48) Then
write log buffer
reset log buffer pointer
reset cr_seen
Endif
Endloop
Free I/O buffer call free_io_buffers
Endwhile
If (not exiting) Then
Wait for more to do call SYS$HIBER
Endif
Until ((exiting) and (no I/O buffers to log))
close log file
If ((close failed) and (exit reason is SS$_NORMAL)) Then
set exit to status to failure reason
Endif
If (subprocess still running) Then
call SYS$FORCEX to run down the subprocess
Endif
call PTD$CANCEL to flush all pending pseudoterminal read requests
call SYS$CANCEL to flush all terminal requests
call PTD$DELETE to delete the pseudoterminal
If ((delete failed) and (exit reason is SS$_NORMAL)) Then
set exit to status to failure reason
Endif
reset terminal to startup condition using SYS$QIOW
If ((terminal reset failed) and (exit reason is SS$_NORMAL)) Then
exit to status to failure reason
Endif
Endif
call LIB$SIGNAL and report exit reason
Exit
/*
**
** Initialization Code
**
** Function: This routine sets the terminal characteristics, creates the
** pseudoterminal, starts up the subprocess, and opens the log file. If
** any of these steps fail, the program undoes any steps already done and
** returns to the main routine.
**
*/
(continued on next page)
Pseudoterminal Driver 69
Pseudoterminal Driver
6.6 Pseudoterminal Driver Programming Example
Example 61 (Cont.) Sample Pseudocode for Pseudoterminal Driver Program
read the maximum buffer size from IOC$GW_MAXBUF
Assign a channel to SYS$INPUT
If (assign ok) Then
Read the terminal characteristics from the terminal
If (read of terminal characteristics ok) Then
Open log file with maximum record size of IOC$GW_MAXBUF
If (open ok) Then
Create the pseudoterminal with characteristics of terminal
If (create ok) then
Place 4 of the buffers on the queue of free I/O buffers
Copy terminal characteristics and modify them to NOECHO and PASTHRU
Set the terminal characteristics use modified value
If (set ok) Then
Get device name of pseudoterminal use SYS$GETDVI
If (get ok) Then
Create subprocess
If (create ok) Then
Enable XON, XOFF, BELL, SET_LINE event notification ASTs
If (AST setup OK) Then
Call PTD$READ to start reading from the pseudoterminal
ASTADR = ft_read_ast
ASTPRM = buffer address
READBUF = I/O buffer + 8
READBUF_LEN = 500
If (read ok) Then
Call SYS$QIO and read a single character from the
keyboard ASTADR = kbd_read_ast
If (read failed) Then
Call PTD$CANCEL to flush queued pseudoterminal read
Call PTD$DELETE to delete pseudoterminal
Reset terminal to original state
Close log file and delete it
Endif
Else
Call PTD$DELETE to delete pseudoterminal
Reset terminal to original state
Close log file and delete it
Endif
Else
Call PTD$DELETE to delete pseudoterminal
Reset terminal to original state
Close log file and delete it
Endif
Else
Call PTD$DELETE to delete pseudoterminal
Reset terminal to original state
Close log file and delete it
Endif
Else
Call PTD$DELETE to delete pseudoterminal
Reset terminal to original state
Close log file and delete it
Endif
Else
Call PTD$DELETE to delete pseudoterminal
Close log file and delete it
Endif
Else
Close log file and delete it
Endif
(continued on next page)
Pseudoterminal Driver
6.6 Pseudoterminal Driver Programming Example
Example 61 (Cont.) Sample Pseudocode for Pseudoterminal Driver Program
Endif
Endif
Endif
/*
** kbd_read_ast
**
** Function: This routine is called every time data is read from the terminal.
** If the program is exiting, then the routine exits without restarting the
** read. The character read is checked to see if the terminate processing
** character Ctrl\ was entered. If the terminate processing character was
** entered, the exiting state is set and a SYS$WAKE is issued to start the
** main routine. Now an attempt is made to obtain an I/O buffer in which
** to store echoed output. If an I/O buffer is unavailable, a simple
** PTD$WRITE is issued; a PTD$WRITE with echo is issued if a buffer is
** available. If the write completes successfully, another read is issued
** to the keyboard.
**
*/
If (not exiting) Then
If (read ok) Then
Search input data for Ctrl\
Allocate a read buffer call allocate_io_buffer
If (got a buffer) Then
Call PTD$WRITE to write characters to pseudoterminal
ASTADR = ft_echo_ast
ASTPRM = allocated I/O buffer
WRTBUF = read I/O buffer
WRTBUF_LEN = number of characters read
ECHOBUF = allocated I/O buffer
ECHOBUF_LEN = 500
Else
Call PTD$WRITE to write characters to pseudoterminal
WRTBUF = read I/O buffer
WRTBUF_LEN = number of characters read
Endif
If (write setup ok)
If ((write status is ok) or (write status is SS$_DATALOST))
Issue another single character read to terminal with
ASTADR = kbd_read_ast, with data going to read I/O buffer
If (read setup failed) Then
Set exit flag
Set exiting reason to SS$_NORMAL
Endif
Else
Set exit flag
Set exiting reason to SS$_NORMAL
Endif
Else
Set exit flag
Set exiting reason to SS$_NORMAL
Endif
Else
Set exit flag
Set exiting reason to read failure status
Endif
If (exiting) Then
Wake the mainline call SYS$WAKE
Endif
Endif
(continued on next page)
Pseudoterminal Driver
6.6 Pseudoterminal Driver Programming Example
Example 61 (Cont.) Sample Pseudocode for Pseudoterminal Driver Program
/*
**
**
**
**
**
**
**
**
**
**
**
*/
If
terminal_output_ast
Function: This routine is called every time an I/O buffer is written
to the terminal. If the terminal write request completes successfully,
it inserts the I/O buffer into the queue of I/O buffers to be logged.
If the I/O buffer is the only entry on the queue, it issues a SYS$WAKE
to start the main routine. To prevent spurious wake requests,
SYS$WAKE is not issued if multiple entries are already on
the queue. If a terminal write error occurs, the routine sets the
exit flag and wakes the main routine.
Pseudoterminal Driver
6.6 Pseudoterminal Driver Programming Example
Example 61 (Cont.) Sample Pseudocode for Pseudoterminal Driver Program
Wake the mainline call SYS$WAKE
Endif
Endif
/*
**
** ft_echo_ast
**
** Function: This routine is called if a write to the pseudoterminal used
** an ECHO buffer. If any data was echoed, the output is written to the
** terminal. If no data was echoed, the I/O buffer is freed so it can be
** used later. If the program is exiting, this routine exits.
**
*/
If (not exiting) Then
If (ECHO buffer has data) Then
Write the buffer to the terminal with ASTADR = terminal_output_ast
If (error setting up write) Then
Set exit flag
Set exiting reason to write failure reason
Wake mainline call SYS$WAKE
Endif
Else
Free I/O buffer call free_io_buffers
Endif
Endif
/*
** free_io_buffers
**
** Function: This routine places a free I/O buffer on the queue of available
** I/O buffers. It also restarts any stopped read operations from the
** pseudoterminals. This routine disables AST delivery while it is running
** in order to synchronize reading and resetting the read stopped flag.
**
*/
If (not exiting) Then
Disable AST deliver using SYS$SETAST
If (Pseudoterminal reads not stopped) Then
Insert I/O buffer on the interlocked queue of free I/O buffers
Else
Call PTD$READ to restart reads from the pseudoterminal.
ASTADR = ft_read_ast
ASTPRM = buffer address
READBUF = I/O buffer + 8
READBUF_LEN = 500
If (no error starting read) Then
Clear read stopped flag
Else
Set exit flag
Set exit reason to read setup reason
Endif
Endif
Enable AST delivery using SYS$SETAST
Endif
(continued on next page)
Pseudoterminal Driver
6.6 Pseudoterminal Driver Programming Example
Example 61 (Cont.) Sample Pseudocode for Pseudoterminal Driver Program
/*
**
**
**
**
**
**
**
*/
If
allocate_io_buffer
Function: This routine obtains a free I/O buffer from the queue of
available I/O buffers. If the program is exiting, this routine
returns an SS$_FORCEDEXIT error.
Pseudoterminal Driver
6.6 Pseudoterminal Driver Programming Example
Example 61 (Cont.) Sample Pseudocode for Pseudoterminal Driver Program
/*
**
**
**
**
**
**
**
*/
If
xoff_ast
Function: This routine is called when the pseudoterminal driver wants to
signal that it will stop accepting keyboard input. The routine attempts
to send an XOFF character to the terminal by sending XOFF DC3 to the
terminal using SYS$QIO. If the attempt fails, it is not retried.
7
Shadow-Set Virtual Unit Driver
This chapter provides an overview of Compaq Volume Shadowing for OpenVMS
and describes the use of the shadow-set virtual unit driver (SHDRIVER).
7.1 Introduction
Compaq Volume Shadowing for OpenVMS ensures that data is available for
applications and end users by duplicating data on multiple disks. Because the
same data is recorded on multiple disk volumes, if one disk fails, the remaining
disk or disks can continue to service I/O requests. This ability to shadow disk
volumes is sometimes referred to as disk mirroring.
Volume shadowing supports the clusterwide shadowing of DIGITAL SCSI and
DSA storage systems. Volume shadowing also supports shadowing of all mass
storage control protocol (MSCP) served DSA disks and DIGITAL SCSI disks.
For more information about Volume Shadowing supported devices, refer to the
Volume Shadowing for OpenVMS Software Product Description.
You can mount one, two or three compatible disk volumes, including the system
disk, to form a shadow set. Each disk in the shadow set is known as a shadow
set member. Volume Shadowing for OpenVMS logically binds the shadow set
devices together and represents them as a single virtual device called a virtual
unit. This means that multiple members of the shadow set, represented by the
virtual unit, appear to applications and users as a single, highly available disk.
Volume Shadowing features include:
Applications and users read and write data to and from a shadow set using the
same commands and program language syntax and semantics that are used for
nonshadowed I/O operations. Volume shadowed sets are managed and monitored
using the same commands and utilities that are used for nonshadowed disks. The
only difference is that access is through the virtual unit, not to individual devices.
SHDRIVER, the driver that controls the virtual unit functions, is described in
Section 7.3.
For more detailed information on Compaq Volume Shadowing for OpenVMS, refer
to the Volume Shadowing for OpenVMS manual.
7.2 Configurations
Compaq Volume Shadowing for OpenVMS does not depend on specific hardware
in order to operate. All shadowing functions can be performed on VAX and Alpha
systems running the OpenVMS operating system. Shadow set members must
have the same physical geometry (that is, the same number of identical logical
blocks [LBNs]) and members can be located anywhere in an OpenVMS Cluster.
Units must have the same geometry, including the same number of sectors
per track, the same number of tracks per cylinder, and the same number of
cylinders per volume.
Units and controllers must conform to DSA and OpenVMS MSCP, or must be
SCSI compliant.
Units should not have hardware write protection enabled. Hardware write
protection stops the volume shadowing software from maintaining identical
volumes. However, the shadow set virtual unit may be mounted software
write-locked with the /NOWRITE qualifier to MOUNT.
Description
MOUNTSHAD
ADDSHAD
COPYSHAD
REMSHAD
AVAILABLE
SENSECHAR
READ
WRITE
Some members might contain new data and others might contain old data.
When the system recovers, volume shadowing performs a merge or copy operation
to ensure that the corresponding blocks on each shadow set member contain the
same data (right or wrong); therefore, the goal here is not one of data correctness
but of data availability. Volume shadowing is designed to make the data on all
disks identical, then, if necessary, incorrect data can be reconciled either by the
user reentering the data or by an application automatically employing database
or journaling techniques.
For example, when used with volume shadowing, OpenVMS RMS journaling
allows you to develop applications that can automatically recover from failures
such as:
Permanent loss of the path between a CPU data buffer containing the data
being written and the disk being written to during a multiple block I/O
Refer to the Volume Shadowing for OpenVMS manual for more information about
shadowing merge and copy operations.
If some, but not all, members of the set are accessible, then the local node
sequentially adjusts the membership and notifies the other hosts.
There are two types of volume processing: active and passive. Active volume
processing handles error processing on a local node. Triggered by a failed I/O
operation, active volume processing also controls mount verification functions,
member removal, and failover. Passive volume processing is triggered by lock
messages or by a cluster event. Passive volume processing revalidates shadow
set membership, ensures that the shadow set reflects changes made outside the
shadow set, and handles the following functions:
For more information, refer to the Volume Shadowing for OpenVMS manual.
8
Using the OpenVMS Generic SCSI Class Driver
This chapter describes the use of the OpenVMS Generic Small Computer System
Interface (SCSI) class driver.
DeviceLevel Operations
Handles SCSI commands
Handles SCSI status
BusLevel Operations
Handles SCSI phases and timing
Handles SCSI messages
Handles data movement
Class
Driver
Port
Driver
Port Hardware
ZK1366AGE
The SCSI port driver transmits and receives SCSI commands and data. It
knows the details of transmitting data from the local processors SCSI port
hardware across the SCSI bus. Although it understands SCSI bus phases,
protocol, and timing, it has no knowledge of which SCSI commands the device
supports, what status messages it returns, or the format of the packets in
which this information is delivered. Strictly speaking, the port driver is a
communications path. When directed by a SCSI class driver, the port driver
forwards commands and data from the class driver onto the SCSI bus to the
User
Interface
Application
Program
$QIO
GKDRIVER
Class
Port
SCSI Port Interface
Port
Driver
Port Hardware
ZK1370AGE
Command retry
Command timeouts
Description
Disconnect timeout
An application program using the generic SCSI class driver is responsible for
maintaining both of these timeout values. It has the following options:
Accepting a connections default value. The default value for both timeouts is
20 seconds.
Altering the connections default value. To modify the default values, the
class driver specifies nonzero values for the phase change timeout and
disconnect timeout fields of the generic SCSI descriptor, the address of
which is passed to the driver in the p1 argument to the $QIO system service
call.
07
07
SCSI Device ID
SCSI Port ID
ZK1371AGE
16 15
Transfer count
(loworder)
31
24 23
SCSI STS
0
VMS status code
16 15
IOSB 1
0
Transfer count
(highorder)
IOSB 2
ZK1372AGE
The status code provides the final status indicating the success or failure of the
SCSI command. The SCSI status byte contains the status value returned from
the target device, as defined in the ANSI SCSI specification. The transfer count
field specifies the actual number of bytes transferred during the SCSI bus DATA
IN or DATA OUT phase.
810 Using the OpenVMS Generic SCSI Class Driver
0
opcode
flags
12
16
20
24
28
disconnect timeout
32
36
reserved
56
ZK1373AGE
p2
Length of the generic SCSI descriptor.
Descriptor Fields
opcode
Currently, the only supported opcode is 1, indicating a pass-through function.
Other opcode values are reserved for future expansion.
flags
Bit map having the following format:
31
4
reserved
dpr syn
dis
dir
ZK1374AGE
Definition
dir
Direction of transfer.
If this bit is set, the target is expected at some time to enter the DATA IN
phase to send data to the host. To facilitate this, the port driver maps the
specified data buffer for write access.
If this bit is clear, the target is expected at some time to enter the DATA OUT
phase to receive data from the host. To facilitate this, the port driver maps the
specified data buffer for read access.
The generic SCSI class driver ignores the dir flag if either the SCSI data
address or SCSI data length field of the generic SCSI descriptor is zero.
dis
Enable disconnection.
If this bit is set, the target device is allowed to disconnect during the execution
of the command.
If this bit is clear, the target cannot disconnect during the execution of the
command.
Note that targets that hold on to the bus for long periods of time without
disconnecting can adversely affect system performance. See Section 8.5.2 for
additional information.
syn
dpr
Available device
DEV$M_IDV
Input device
DEV$M_ODV
Output device
DEV$M_SHR
Shareable device
DEV$M_RND
Random-access device
OPCODE 0
FLAGS 1
COMMAND_ADDRESS 2
COMMAND_LENGTH 3
DATA_ADDRESS 4
DATA_LENGTH 5
PAD_LENGTH 6
PHASE_TIMEOUT 7
DISCONNECT_TIMEOUT 8
#define FLAGS_READ 1
#define FLAGS_DISCONNECT 2
#define GK_EFN 1
#define SCSI_STATUS_MASK 0X3E
#define INQUIRY_OPCODE 0x12
#define INQUIRY_DATA_LENGTH 0x30
globalvalue
IO$_DIAGNOSE;
short
gk_chan,
transfer_length;
int
i,
status,
gk_device_desc[2],
gk_iosb[2],
gk_desc[15];
(continued on next page)
9
Local Area Network (LAN) Device Drivers
This chapter describes the QIO interface of local area network (LAN) drivers that
control the LAN devices.
In addition to the QIO interface, the OpenVMS operating system supports
another interface into LAN drivers. The VMS Communications Interface (VCI)
provides a low overhead, privileged interface.
CSMA/CD Stands for carrier sense multiple access with collision detection,
a technique that mediates demands by nodes for a single shared network
channel; carrier sense determines whether the communications medium is
already in use, while collision detection detects when more than one node is
attempting to transmit.
Ethernet One of the earliest and the most common local area networks
(LANs), Ethernet can refer to either a general LAN application (for example,
Ethernet address) or to the specific CSMA/CD technology that implements
the Intel, Xerox, and Digital intercompany Ethernet specifications. The data
transmission rate is 10 Mb/s.
FDDI Fiber Distributed Data Interface is a 100 Mb/s token ring LAN
technology standardized by the American National Standards Institute
(ANSI).
Token Ring This LAN is the IEEE 802.5 standard token passing ring. The
data transmission rate is 4 or 16 Mb/s.
Bus
Device
Device
Name
DECnet
Name
Device Type
Version
CSMA/CD
XMI
DEMNA
EXc0
MNA
V5.3
CSMA/CD
Local
SGEC
EZc0
ISA
DT$_EZ_SGEC
V5.3
CSMA/CD
Local
LANCE
ESc0
SVA
DT$_ES_LANCE
V4.4
CSMA/CD
TURBOchannel PMAD
ECc0
MXE
DT$_EC_PMAD
V5.5-2HW
CSMA/CD
TURBOchannel DELTA
ECc0
MXE
DT$_EC_PMAD
V5.5-2HW
CSMA/CD
Q-bus
DESQA
ESc0
SVA
DT$_ES_LANCE
V5.0
CSMA/CD
Q-bus
DELQA
XQc0
QNA
DT$_XQ_DELOA
V5.0
CSMA/CD
Q-bus
DEQTA
XQc0
QNA
DT$_XQ_DEQTA
V5.3
CSMA/CD
Q-bus
DEQNA
XQc0
QNA
DT$_DEQNA
V4.0
CSMA/CD
Q-bus
KFE52
EFc0
KFE
DT$_FT_NI
V5.4
CSMA/CD
UNIBUS
DEUNA
XEc0
UNA
DT$_DEUNA
V4.0
CSMA/CD
UNIBUS
DELUA
XEc0
UNA
DT$_DELUA
V4.0
CSMA/CD
BI
DEBNA
ETc0
BNA
DT$_ET_DEBNA
V4.4
CSMA/CD
BI
DEBNK
ETc0
BNA
DT$_ET_DEBNA
V4.4
CSMA/CD
BI
DEBNT
ETc0
BNA
DT$_ET_DEBNA
V4.4
CSMA/CD
BI
DEBNI
ETc0
BNA
DT$_ET_DEBNI
V5.2
FDDI
XMI
DEMFA
FXc0
MFA
DT$_FX_DEMFA
V5.4-3
FDDI
TURBOchannel DEFZA
FCc0
FZA
DT$_FC_DEFZA
V5.5-2HW
FDDI
TURBOchannel DEFTA
FCc0
FZA
DT$_FC_DEFTA
V6.0
FDDI
Q-bus
FQc0
FQA
DT$_FQ_DEFQA
V6.1
DEFQA
DT$_EX_DEMNA
Note
The DEQTA device is also known as the DELQA-YM. Also note that
the device name is the name of the template device that is used by
applications to identify the LAN device. The "c" in the device name
indicates the controller letter, for example, A, B, and so on.
Device
Name
DECnet
Name
Device Type
Version
XMI
DEMNA
EXc0
MNA
DT$_EX_DEMNA
V1.0
Local
TGEC
EZc0
ISA
DT$_EZ_TGEC
V1.0
TURBOchannel COREIO
ESc0
SVA
DT$_ES_LANCE
V1.0
CSMA/CD
TURBOchannel PMAD
ECc0
MXE
DT$_EC_PMAD
V1.0
CSMA/CD
TURBOchannel DELTA
ECc0
MXE
DT$_EY_NITC2
V6.1
CSMA/CD
EISA
DE422
ERc0
ERA
DT$_ER_DE422
V1.5
CSMA/CD
EISA
DE425
ERc0
ETA
DT$_ER_TULIP
V6.1
CSMA/CD
ISA
DE200
ERc0
ERA
DT$_ER_LANCE
V6.1
CSMA/CD
ISA
DE201
ERc0
ERA
DT$_ER_LANCE
V6.1
CSMA/CD
ISA
DE202
ERc0
ERA
DT$_ER_LANCE
V6.1
CSMA/CD
ISA
DE203
ERc0
ERA
DT$_ER_LEMAC
V6.2
CSMA/CD
ISA
DE204
ERc0
ERA
DT$_ER_LEMAC
V6.2
CSMA/CD
ISA
DE205
ERc0
ERA
DT$_ER_LEMAC
V6.2
CSMA/CD
Embedded
Tulip
EWc0
EWA
DT$_EW_TULIP
V6.1
CSMA/CD
PCI
DE434
EWc0
EWA
DT$_EW_DE435
V6.1
CSMA/CD
PCI
DE435
EWc0
EWA
DT$_EW_DE435
V6.1
CSMA/CD
PCI
DE436
EWc0
EWA
DT$_EW_DE435
V6.1
CSMA/CD
PCI
DE450
EWc0
EWA
DT$_EW_DE450
V6.2
CSMA/CD
PCI
DE500XA
EWc0
EWA
DT$_EW_DE500
V6.2
CSMA/CD
PCI
DE500AA
EWc0
EWA
DT$_EW_DE500
V6.2
CSMA/CD
PCI
DE500BA
EWc0
EWA
DT$_EW_DE500
V6.2
CSMA/CD
PCI
DE504BA
EWc0
EWA
DT$_EW_DE504
V7.1-1H1
CSMA/CD
PCI
DE500FA
EWc0
EWA
DT$_EW_DE500
V7.1
CSMA/CD
PCI
P2SE
EWc0
EWA
DT$_EW_DE500
V7.2
CSMA/CD
PCI
P2SE+
EWc0
EWA
DT$_EW_DE500
V7.2
CSMA/CD
Embedded
21142
EWc0
EWA
DT$_EW_DE500
V7.2
CSMA/CD
Embedded
21143
EWc0
EWA
DT$_EW_DE500
V7.2
CSMA/CD
PCMCIA
3COM
3C589B
EOc0
CEC
DT$_EO_3C589
V6.2-1H2
CSMA/CD
PCI
DEGPASA
EWc0
EWA
DT$_EW_DEGPA
V7.1-2
CSMA/CD
PCI
DEGPATA
EWc0
EWA
DT$_EW_DEGPA
V7.1-2
CSMA/CD
PCI
DE600
EIc0
EIA
DT$_EI_82558 or
DT$_EI_82559
V7.1-2
Medium
Bus
CSMA/CD
CSMA/CD
CSMA/CD
Bus
Device
Device
Name
DECnet
Name
Device Type
Version
CSMA/CD
PCI
DE602
EIc0
EIA
DT$_EI_82558 or
DT$_EI_82559
V7.1-2
CSMA/CD
PCI
Shared
Memory
EBc0
EBA
DT$_EB_SMLAN
V7.1-2
FDDI
XMI
DEMFA
FXc0
MFA
DT$_FX_DEMFA
V1.0
FDDI
FutureBus+
DEFAA
FAc0
FAA
DT$_FA_DEFAA
V1.5
FDDI
TURBOchannel DEFZA
FCc0
FZA
DT$_FC_DEFZA
V1.0
FDDI
TURBOchannel DEFTA
FCc0
FZA
DT$_FC_DEFTA
V1.5
FDDI
EISA
DEFEA
FRc0
FEA
DT$_FR_DEFEA
V1.5-1H1
FDDI
PCI
DEFPA
FWc0
FPA
DT$_FW_DEFPA
V6.2
TokenRing
TURBOchannel DETRA
ICc0
TRA
DT$_IC_DETRA
V6.1
TokenRing
EISA
DW300
IRc0
TRE
DT$_IR_DW300
V6.1
TokenRing
ISA
DW110
IRc0
TRE
DT$_IR_DW300
V6.2
TokenRing
PCI
PBXNPAA
IWc0
TRE
DT$_IW_TI380PCI
V6.2-1H1
TokenRing
PCI
PBXNPDA
IWc0
TRE
DT$_IW_RACORE
V7.1-1H1
ATM
TURBOchannel DGLTA
HCc0
/ELc0
DT$_HC_OTTO
V6.2
ELA
HWc0
/ELc0
DT$_HW_OTTO
V7.1-1H1
ELA
HWc0
/ELc0
DT$_HW_METEOR
V7.1-2
ELA
HWc0
/ELc0
DT$_HW_HE155
V7.2-1
ELA
HWc0
/ELc0
DT$_HW_HE622
V7.2-1
ELA
ATM
ATM
ATM
ATM
PCI
PCI
PCI
PCI
DGLPB
DGLPA
DAPBA
DAPCA
Note
The EL device is the emulated LAN device associated with the physical
ATM device.
Gigabit Ethernet maximum frame size of 9018 bytes (limited to 7552 bytes in
OpenVMS Version 7.3-1 and earlier)
IEEE 802.2 Class II service may be specified where the functions are provided
by the user application
Contrary to the IEEE 802.2 Standard, the Global DSAP (FF) must be enabled as
a Group SAP to receive messages with the Global DSAP in the destination SAP
field.
FDDI conforms to the ANSI Standards defined in the following documents:
Description
100BaseTX
100BaseFX
Driver
Description
DE500XA
SYS$EWDRIVER.EXE
DE500AA
SYS$EWDRIVER.EXE
10,100 Mb UTP
DE500BA
SYS$EWDRIVER_
DE500BA.EXE
10,100 Mb UTP
DE500FA
SYS$EWDRIVER_
DE500BA.EXE
Driver
Description
DE600AA
SYS$EIDRIVER.EXE
DE602AA
SYS$EIDRIVER.EXE
DE602BA
SYS$EIDRIVER.EXE
DE602BB
SYS$EIDRIVER.EXE
DE602TA
SYS$EIDRIVER.EXE
DE602FA
SYS$EIDRIVER.EXE
Embedded
82559ER
SYS$EIDRIVER.EXE
Description
1000Base-SX
Works with multimode fiber optic cabling. Used mainly for shorter
backbone applications. It supports distances of up to 550 meters.
1000Base-LX
Works with singlemode fiber optic cabling. Used mainly for longer fiber
backbones and campus backbones. It supports distances of up to 5
kilometers.
1000BaseT
Works with unshielded copper cabling. Used mainly for short distance
applications. It supports a signal transmission over four pairs of
category 5 unshielded twisted pair (UTP), covering distances up to 100
meters, or networks with a diameter of 200 meters.
Driver
Description
DEGPASA
SYS$EW1000A.EXE
Multimode fiber
DEGPATA
SYS$EW1000A.EXE
10,100,1000 Mb UTP
Meaning
Driver version
Firmware version
Device interrupts
Events completed
Link transitions
Meaning
Transmit timeouts
Initialization timeouts
Resets issued
Initialization done
Transmits queued
Soft errors
Commands outstanding
Commands queued
Meaning
Invalid command
Unexpected event
Rescheduled forks
Requested speed
Meaning
Jumbo packets
Link autonegotiation
DMA operation
Current EXE$GL_ABSTIM_
TICS
Statistics EXE$GL_ABSTIM_
TICS
Meaning
Alignment errors
Meaning
FCS errors
Single collisions
Multiple collisions
Deferred transmits
Late collisions
Excessive collisions
Meaning
Index
Type
Mtu
Speed
Operational status
Last change
Inbound discards
Inbound errors
Meaning
Outbound discards
Outbound errors
Physical address
Description
Bytes received
Bytes sent
Meaning
Meaning
Unused.
Unused.
Unused.
Unused.
Unused.
Unused.
Unused.
Unused.
(continued on next page)
Meaning
Unknown commands
Meaning
FW operational events
Error events
Meaning
Interrupts generated
Interrupts avoided
Meaning
Meaning
Meaning
Meaning
Meaning
MAC resets
Receive BD attentions
Unused.
Meaning
Transmit attentions
Driver
Description
DEGXAUA
SYS$EW5700.EXE
10,100,1000 Mb UTP
DEGXASA
SYS$EW5700.EXE
Multimode fiber
DEGXALA
SYS$EW5700.EXE
Singlemode fiber
DEGXATA
SYS$EW5700.EXE
10,100,1000 Mb UTP
Embedded
5703c
SYS$EW5700.EXE
10,100,1000 Mb UTP
Meaning
Driver version
Firmware version
Device revision
Actual PHY ID
Current PHY ID
Device interrupts
Link checks
Link transitions
Transmit timeouts
Resets issued
Meaning
Initialization done
Transmits queued
Soft errors
Rescheduled forks
Meaning
Meaning
BUS type
MSI status
Initialization delay
Current EXE$GL_ABSTIM_
TICS
Status block VA
Statistics block VA
Meaning
Reserved1
Unused.
Status
Unused.
Unused1
Unused.
Meaning
Bytes received
FCS errors
Meaning
Alignment errors
Meaning
Bytes sent
Collisions experienced
Meaning
Single collisions
Multiple collisions
Deferred transmits
Excessive collisions
Late collisions
Outbound discards
Outbound errors
Meaning
The number of times the DMA write highpriority queue was full.
Inbound discards
Inbound errors
Meaning
The number of times the DMA read highpriority queue was full.
Meaning
Interrupts generated
Interrupts avoided
Initialization failures:
Failed
Failed
Failed
Failed
to enable interrupts
during map register allocation
to enable interrupts
to read MAC address
Meaning
FUNCTION="CCOU"
FUNCTION="DXMT", VALUE=n
FUNCTION="DRCV", VALUE=n
FUNCTION="CXMT",VALUE=n
FUNCTION="CRCV", VALUE=n
Device
Driver
TurboChannel
DEFTA
SYS$FCDRIVER,EXE
FutureBus+
DEFFA
SYS$FADRIVER.EXE
EISA
DEFEA
SYS$FRDRIVER.EXE
PCI
DEFPA
SYS$FWDRIVER.EXE
Device
Driver
TurboChannel
DETRA
SYS$ICDRIVER.EXE
EISA
DW300
SYS$IRDRIVER.EXE
ISA
DW110 (P1392+)
SYS$IRDRIVER.EXE
PCI
Racore
SYS$IWDRIVER.EXE
PCI
TC4048
SYS$IWDRIVER.EXE
Function
The LEC exists on all ATM-attached computers that participate in the LAN
emulation configuration. LEC provides the ATM MAC-layer connectionless
function that is transparent to the LAN-type applications. The LEC, LES, and
BUS can exist on one ATM-attached computer or on separate computers. The
server functions usually reside inside an ATM switch, but can be implemented on
client systems.
Ethernet
Workstation
ATM/Ethernet
Switch
Ethernet
Workstation
LEC
Ethernet
Workstation
OpenVMS Server
OpenVMS Server
LEC
LEC
155 Mbps
LES
BUS
155 Mbps
ATM Switch
ATM Switch
NT Workstation
UNIX Server
155 Mbps
LES
LEC
BUS
155 Mbps
LEC
VM-0733A-AI
9.11.3 Booting
OpenVMS Alpha does not support ATM adapters as boot devices.
The following example shows the SET DEVICE commands required for setting
up an ELAN with the desired parameters. Note that some of the commands
generate a console message.
$ mcr lancp
LANCP> set dev ela0/elan=create
%%%%%%%%%%% OPCOM 26-MAR-2001 16:57:12.89 %%%%%%%%%%%
Message from user SYSTEM on ALPHA1
LANACP LAN Services
Found LAN device ELA0, hardware address 00-00-00-00-00-00
LANCP> set dev ela0/elan=(parent=hwa0,type=csmacd,size=1516)
LANCP> set dev ela0/elan=(descr="An ATM ELAN")
LANCP> set dev ela0/elan=enable=startup
%ELDRIVER, LAN Emulation event at 26-MAR-1996 16:57:28.78
%ELDRIVER, LAN Emulation startup: Emulated LAN 1 on device ELA0
LANCP> sho dev ela/char
Transceiver
Transceiver
Transceiver
Cable
Transceiver
Ethernet 1,024
Transceivers in
Parallel
Ethernet Controller
(DE205, DE450, and so on)
CPU
a. Hardware Interface
Application
Program
User
Port
1
Port
2
Port
3
Port
4
Port
n
LAN Driver
(ERDRIVER, EWDRIVER, and so on)
Ethernet Controller
(DE205, DE450, and so on)
b. Software Interface
ZK1129GE
Contrary to the Ethernet specification and the IEEE 802.3 Standard, the
broadcast address (FF-FF-FF-FF-FF-FF) must be enabled as a multicast address
to receive messages addressed to it.
Meaning
FF-FF-FF-FF-FF-FF
Broadcast
CF-00-00-00-00-00
Loopback assistance
Meaning
AB-00-00-01-00-00
Dump/load assistance
AB-00-00-02-00-00
Remote console
AB-00-00-03-00-00
AB-00-00-04-00-00
09-00-2B-02-00-00
Level 2 routers
AB-00-00-05-00-00
through
AB-00-03-FF-FF-FF
AB-00-03-00-00-00
LAT
AB-00-04-00-00-00
through
AB-00-04-00-FF-FF
AB-00-04-01-00-00
through
AB-00-04-01-FF-FF
Meaning
AB-00-04-02-00-00
through
AB-00-04-FF-FF-FF
09-00-2B-01-00-00
Bridge management
09-00-2B-01-00-01
Functional Address
Bit-Reversed
Description
09-00-2B-00-00-04
03-00-00-00-02-00
C0:00:00:00:40:00
09-00-2B-00-00-05
03-00-00-00-01-00
C0:00:00:00:80:00
CF-00-00-00-00-00
03-00-00-08-00-00
C0:00:00:10:00:00
Loopback Assistance
AB-00-00-01-00-00
03-00-02-00-00-00
C0:00:40:00:00:00
MOP Dump/Load
AB-00-00-02-00-00
03-00-04-00-00-00
C0:00:20:00:00:00
AB-00-00-03-00-00
03-00-08-00-00-00
C0:00:10:00:00:00
DNA L1 Routers
09-00-2B-02-00-00
03-00-08-00-00-00
C0:00:10:00:00:00
DNA L2 Routers
09-00-2B-02-01-0A
03-00-08-00-00-00
C0:00:10:00:00:00
AB-00-00-04-00-00
03-00-10-00-00-00
C0:00:08:00:00:00
09-00-2B-02-01-0B
03-00-10-00-00-00
C0:00:08:00:00:00
09-00-2B-00-00-07
03-00-20-00-00-00
C0:00:04:00:00:00
09-00-2B-00-00-0F
03-00-40-00-00-00
C0:00:02:00:00:00
09-00-2B-02-01-04
03-00-80-00-00-00
C0:00:01:00:00:00
09-00-2B-02-01-07
03-00-00-02-00-00
C0:00:00:40:00:00
09-00-2B-04-00-00
03-00-00-04-00-00
C0:00:00:20:00:00
LAST
09-00-2B-02-01-00
03-00-00-00-08-00
C0:00:00:00:10:00
09-00-2B-02-01-01
03-00-00-00-10-00
C0:00:00:00:08:00
09-00-2B-02-01-02
03-00-00-00-20-00
C0:00:00:00:04:00
03-00-00-00-00-01
03-00-00-00-00-01
C0:00:00:00:00:80
NETBUI Emulation
Explanation
IRQ
Port Address
Memory Address
DMA Channel
Slot 1
IO Base at %x300
IRQ 5
Slot 4
IRQ 10
DMA channel 7
Base %x4e20
Ring speed of 16
DATA
CRC
802.2/802.1 Header
DATA
CRC
802.2/802.1 Header
DATA
CRC
802.2/802.1 Header
DATA
CRC
FDDI
FDDI Header
Token Ring
Token Ring Header
DATA
Ethernet Header
802.3 Header
802.2/802.1 Header
DATA
Note that CSMA/CD provides two frame formats and the FDDI provides one
frame format. The 802.1 header is an optional extension to the 802.2 header.
Ethernet header
SA
PTY
DATA
CRC
46=>1500
Destination Address
SA:
Source Address
PTY:
The Ethernet header consists of the DA, SA, and PTY fields. Ethernet frames
must be at least 64 bytes in length, which means that the minimum data length
is 46 bytes. Applications select Ethernet format by specifying NMA$C_LINFM_
ETH (the default) as the value for NMA$C_PCLI_FMT in their P2 characteristics
buffer. If the amount of actual data to be transmitted is less than 46 bytes, the
CSMA/CD drivers transmit extra bytes of zero after the application data.
Figure 95 illustrates a CSMA/CD frame with an IEEE 802.3 header.
Figure 95 CSMA/CD Frame with IEEE 802.3 Header
DA
SA
LEN
DATA
CRC
46=>1500
DA:
Destination Address
SA:
Source Address
LEN:
The IEEE 802.3 format is similar to the Ethernet format, except the PTY field is
replaced by the LEN field.
DA
SA
DATA
CRC
0=>4478
FC:
DA:
Destination Address
SA:
Source Address
[RI]
DATA
030 0=>4476
CRC
4
DA
SA
PTY/LEN
DATA
46=>*
Destination Address
SA:
Source Address
SSAP
CTL
12
ZK4799GE
This 802.2 header is followed by the 802.1 header illustrated in Figure 910 if the
DSAP field is the SNAP SAP (AA hex), the SSAP field is the SNAP SAP, and the
CTL field is UI (03 hex).
The PID field consists of two subfields: the company portion of the PID and the
implementation-specific portion of the PID (see Figure 911).
Figure 911 802.1 Header Subfields
COPID
IPID
Sn
2
ZK6680AGE
The routing control (RC) contains the information about how the packet is to be
routed.
The Sn contains the segment identifier for the hop. Each segment identifier
contains a ring number and bridge number used in the hop.
PTY
DATA
CRC
461500
For FDDI
FC
DA
SA
DSAP
SSAP
CTL
COPID
IPID
DATA
CRC
04470
FC
DA
SA
DSAP
SSAP
CTL
COPID
IPID
DATA
CRC
04418
SA
PTY
DATA
For a format parameter value of NMA$C_PCLI_802, the frame formats are shown
in Figure 914.
SA
LEN
DSAP
SSAP
CTL DATA
12
CRC
For FDDI
FC
DA
SA
DSAP
SSAP
CTL DATA
12
CRC
FC
DA
SA
12
SA
6
12
DATA
X
DATA CRC
For FDDI
FC DA
1
SA
Meaning
08-00
IP protocol (ARPAnet)
08-06
90-00
Meaning
60-01
60-02
60-03
DNA Routing
60-04
60-05
Diagnostics
60-06
Customer use
60-07
80-38
Bridge
80-3C
80-3D
CSMA/CD Encryption
80-3E
80-3F
80-40
80-41
Packets transmitted are padded with null bytes as needed (CSMA/CD only).
The length of user data in the packets received is always between 46 and
1500 bytes for CSMA/CD, and 0 to 4470 for FDDI. For example, if a 10-byte
packet is transmitted, it is received as 46 bytes because the driver cannot
determine the amount of user data in the packetonly the amount of user
data plus padded null bytes.
Packets transmitted are padded with null bytes as needed (CSMA/CD only).
The length of user data in the packets received is always between 0 and 1498
bytes for CSMA/CD, and 0 to 4468 bytes for FDDI. The driver uses the size
field to determine the amount of user data in the packet. The size field is not
included in the data returned to the user.
The shared-default mode is the default user of a shared protocol type. There
can be only one such user for each shared protocol type. A shared-default
user does not have to exist if a protocol type is shared, but there can be no
more than one such user per shared protocol type.
The shared-default user receives all messages for the shared protocol type,
but not for any of the shared-with-destination users. The shared-default
user also receives all messages matching both the shared protocol type and
any multicast address enabled by the shared-default user.
The shared-default user can only transmit to multicast addresses and
physical addresses that are not enabled by any of the shared-withdestination users sharing the same protocol type.
If there is no shared-default user of a protocol type, incoming messages from
nodes not among the shared-with-destination users for that protocol type
are ignored.
SSAP
1
ZK4798GE
The control field for an 802 packet is always an unnumbered control field. The
unnumbered control field, which is always 1 byte in length, is passed by the P4
argument of the write QIO and can be one of the following binary values:
UI command (00000011)
This is the unnumbered information command. It is the method used to
transmit data from one user to another and is the most widely used control
field value.
The UI command can be specified by using NMA$C_CTLVL_UI.
An 802 format port with Class I service is allowed to transmit UI, XID, and TEST
commands. An 802 format port with Class I service is allowed to receive UI
commands and XID and TEST responses.
Refer to the IEEE 802.2 Standard for more information on these control field
values and response messages.
9.18.2.2 User-Supplied Service Header Format
Figure 917 shows the 802.2 header format for user-supplied service.
Figure 917 User-Supplied Service 802.2 Header
Size of
Field
(Bytes)
DSAP
SSAP
CTL
12
ZK4799GE
The user provides the control field values, which are documented in the IEEE
802.2 Standard. The user-supplied packet format is the generic packet format
as specified in the IEEE 802.2 Standard. Class I packets (see Section 9.18.2.1)
are a subset of this generic packet format; therefore, if the control field value of
the user-supplied packet is UI, XID, or TEST, the packet is the same as a Class
I packet. Note that Class II packets, as defined in the IEEE 802.2 Standard,
include the UI, XID, and TEST command/response formats.
0
DDDDDDDI/G
7
SSAP
0
SSSSSSSC/R
ZK4800GE
Definition of the least significant bit depends on whether the SAP is a source
SAP (SSAP) or a destination SAP (DSAP). For a DSAP field, the least significant
bit distinguishes group SAPs (bit 0 = 1) from individual SAPs (bit 0 = 0). For
an SSAP field, the least significant bit distinguishes commands (bit 0 = 0)
from responses (bit 0 = 1). Because these two bits are located at the same bit
position within the SAP field, a group SAP cannot be used as an SSAP. If this
were allowed, a group SAP would be interpreted as an individual SAP with
the command/response bit set to 1, thus implying a response. The IEEE 802.2
Standard reserves for its own definition all SAP addresses with the second least
significant bit set to 1. You should use these SAP values for their intended
purposes, as defined in the IEEE 802.2 Standard.
Up to four group SAPs can be enabled on each 802 port. The group SAPs enabled
on a controller do not have to be unique for each port; for example, two 802 format
ports can have the same group SAP enabled. This allows a single packet coming
into the controller to be duplicated and passed to each port on the controller that
has the group SAP enabledassuming the packet has a DSAP value that is a
group SAP. If the received packet has an individual SAP for a DSAP, the packet
goes to, at most, one port.
SSAP
CTL
PID
5
ZK5791GE
For an 802E packet format, the DSAP and SSAP fields are always set to the
SNAP SAP (AA hex). The SNAP SAP value is a special SAP value reserved for
802 extended format packets. The SNAP SAP value distinguishes an 802 packet
from an 802 extended packet. The only valid control field value for 802 extended
packets is UI (unnumbered information).
9.18.3.1 Protocol Type PID Sharing (Alpha Only)
On Alpha systems, the 802E format allows users protocol identifier (PID) sharing.
PIDs are usually nonshareable; however, an application may benefit from a
shared protocol implementation. The protocol access parameter (NMA$C_PCLI_
ACC) allows a PID to be opened in either of two shareable modes: shared-default
(NMA$C_ACC_SHR) and shared-with-destination (NMA$C_ACC_LIM). The LAN
drivers also provide the nonshareable exclusive mode (NMA$C_ACC_EXC). (See
Table 939.) The rules and requirements for using each mode are as follows:
The shared-default mode is the default user of a shared PID. There can be
only one such user for each shared PID. A shared-default user does not have
to exist if a PID is shared, but there can be no more than one such user per
shared PID.
Meaning
Static Bits (Always Set)
DEV$M_AVL
Device is available.
DEV$M_IDV
Input device.
DEV$M_NET
Network device.
DEV$M_ODV
Output device.
31
Not Used
16 15
Error
Summary
8 7
Unit and Line
Status
0
Not Used
ZK5932GE
Meaning
XM$M_STS_ACTIVE
Port is active.
XM$M_STS_BUFFAIL
XM$M_STS_TIMO
Timeout occurred.
The error summary bits are set when an error occurs. They are read-only bits.
If an error is fatal, the Ethernet port is shut down. Table 933 lists the error
summary bit values and their meanings.
Table 933 Error Summary Bits
Error Summary Bit
Meaning
XM$M_ERR_FATAL
Type1
Function
Modifiers
Function
P1,P2,[P5]
IO$M_NOW
IO$_READVBLK
P1,P2,[P5]
IO$M_NOW
IO$_READPBLK3
P1,P2,[P5]
IO$M_NOW
P1,P2,[P4],P5
IO$M_RESPONSE
P1,P2,[P4],P5
IO$M_RESPONSE
P1,P2,[P4],P5
IO$M_RESPONSE
Function Code
IO$_READLBLK
IO$_WRITELBLK
IO$_WRITEVBLK
IO$_WRITEPBLK
1V
3 On
4 On
Arguments
Type1
Function
Modifiers
Function
IO$_SETMODE
P1,[P2],P3
IO$M_CTRL
IO$M_STARTUP
IO$M_SHUTDOWN
IO$M_ATTNAST
IO$M_SET_MAC
IO$M_UPDATE_MAP
IO$M_ROUTE
Set controller
characteristics and
controller state for
subsequent operations.
IO$_SETCHAR
P1,[P2],P32
IO$M_CTRL
IO$M_STARTUP
IO$M_SHUTDOWN
IO$M_ATTNAST
IO$M_SET_MAC
IO$M_UPDATE_MAP
IO$M_ROUTE
Set controller
characteristics and
controller state for
subsequent operations.
IO$_SENSEMODE
[P1],[P2]
IO$M_CTRL
IO$M_SENSE_MAC
IO$M_SHOW_MAP
IO$M_SHOW_ROUTE
Sense controller
characteristics and return
them in specified buffers.
IO$_SENSECHAR
[P1],[P2]
IO$M_CTRL
IO$M_SENSE_MAC
IO$M_SHOW_MAP
IO$M_SHOW_ROUTE
Sense controller
characteristics and return
them in specified buffers.
1V
2 The
Although the LAN device drivers do not differentiate among logical, virtual, and
physical I/O functions (all are treated identically), you must have the required
privilege to issue the request. (Logical I/O functions do not require I/O privilege.)
9.20.1 Read
Read functions directly transfer data from a packet received from another port
on the Ethernet into the virtual memory address space of the user process. The
operating system provides the following function codes:
Received messages are buffered in system memory and then copied to the users
buffer when a read operation is performed.
The read functions take the following device- or function-dependent arguments:
P5The address of a buffer where the LAN driver returns packet header
information. This is an optional argument. The information returned
depends on the packet format enabled with the set mode QIO. The size of the
buffer must be 14 bytes for an Ethernet format packet, 16 bytes for an IEEE
6Byte Destination
Address (Physical or
Multicast)
4
6
8
10
12
6Byte Destination
Address (Physical or
Multicast)
4
6
8
10
12
SSAP
DSAP
14
1 or 2Byte CTL Field
6Byte Destination
Address (Physical or
Multicast)
4
6
8
10
12
SSAP
DSAP
14
1Byte CTL Field
16
5Byte Protocol Identifier
18
ZK1126GE
CSMA/CD
FDDI
Token Ring
1500
4470
4418
1498
4468
4416
1497
4475
4423
1496
4474
4422
802E format
1492
4470
4418
Alpha specific.
On Alpha systems, Table 936 lists the maximum user data sizes that can be
received for LAN emulation over ATM protocol.
Table 936 Maximum User Data Sizes for LAN Emulation over ATM (Alpha Only)
Packet Format
1516
4544
9234
1500
4528
9218
1498
4526
9216
1497
4525
9215
1496
4524
9214
802E format
1492
4520
9210
For 802 format packets, the P5 buffer always contains the DSAP and SSAP in the
bytes at offset 12 and 13. The next one or two bytes (offsets 14 and 15) following
the SSAP contain the control field value. For Class I service, the control field
value is always 1 byte in length and will always be placed in the byte at offset 14
of this buffer. For user-supplied service, you have to determine the length of the
control field value according to the IEEE 802.2 Standard.
On Alpha systems with Token Ring, if received access control (RAC) is on, the
first byte of the P5 buffer contains the frame control (FC) field.
For FDDI, if RAC is on, the first byte of the P5 buffer contains the FC field.
The read functions can take the following function modifier:
IO$M_NOWComplete the read operation immediately with a received
message (if no message is currently available, return a status of SS$_
ENDOFFILE in the I/O status block).
Transmitted messages are copied from the buffer of the requesting process to a
system buffer for transmission.
The write function takes the following device- or function-dependent arguments:
23
8
CTL
0
DSAP
ZK4801GE
6Byte Destination
Address (Physical or
Multicast)
4
6
Table 937 lists the maximum user data sizes that can be specified by P2 and
received for CSMA/CD, FDDI, and Token Ring protocols.
Table 937 Maximum Message Sizes for CSMA/CD, FDDI, and Token Ring
Packet Format
CSMA/CD
FDDI
Token Ring
1500
4470
4418
1498
4468
4416
1497
4475
4423
1496
4474
4422
802E format
1492
4470
4418
Alpha specific.
On Alpha systems, Table 938 lists the maximum user data sizes that can be
specified by P2 and received for LAN emulation over ATM protocol.
Table 938 Maximum Message Sizes for LAN Emulation over ATM (Alpha Only)
Packet Format
1516
4544
9234
1500
4528
9218
1498
4526
9216
1497
4525
9215
1496
4524
9214
802E format
1492
4520
9210
If P2 specifies a message size larger than that allowed, the driver returns the
status SS$_IVBUFLEN in the I/O status block.
If the P4 buffer is specified, it must be at least 3 bytes long. The first byte is
always the DSAP; the next two bytes are used to determine the CTL field value.
The DSAP value cannot be the SNAP SAP.
IO$_SETMODE!IO$M_CTRL!IO$M_SHUTDOWNShutdown port
Parameter ID
Longword Value or Counted String
Parameter ID
Longword Value or Counted String
etc.
ZK1177GE
Table 939 is an alphabetic listing of the parameter IDs and values that
can be specified in the P2 buffer. These parameter IDs are applicable to
all LAN controllers, except where otherwise noted. The $NMADEF macro
defines these values. The $NMADEF macro is included in the macro library
SYS$LIBRARY:LIB.MLB. (Table 940 lists the parameters that can be used with
Local Area Network (LAN) Device Drivers 969
Meaning
NMA$C_PCLI_ACC
Protocol access mode. This optional parameter determines the access mode for
the protocol type. NMA$C_PCLI_ACC is valid only for ports using Ethernet
packet format.
NMA$C_PCLI_ACC is valid for ports using 802E packet format.
One of the following values can be specified:
NMA$C_ACC_EXC Exclusive mode (default)
NMA$C_ACC_SHR Shared-default user mode
NMA$C_ACC_LIM Shared-with-destination mode
Section 9.18.1.3 provides a description of protocol type sharing.
Section 9.18.3.1 provides a description of protocol type PID sharing.
NMA$C_PCLI_ACC is passed as a longword value.
NMA$C_PCLI_BFN
NMA$C_PCLI_BUS
Maximum allowable port receive data size, that is, message length (default =
512 bytes). NMA$C_PCLI_BUS can have a maximum value of 9234.
This optional parameter is specified on a per-port basis. It is passed as a
longword value.
Any message received for this port that is larger than this parameter value is
discarded.
NMA$C_PCLI_CCA
Meaning
1
1 If the LAN controller is active and you do not specify this parameter, the parameter defaults to the current setting. If
the LAN controller is not active, this parameter defaults to the default value indicated.
Meaning
NMA$C_PCLI_DES
NMA$C_PCLI_EKO
Meaning
NMA$C_PCLI_FMT
Packet format. This optional parameter specifies the packet format as either
Ethernet, IEEE 802, or 802 extended. This characteristic is passed as a
longword value and affects single ports on a single controller. One of the
following values can be specified:
NMA$C_LINFM_ETH Ethernet packet format (default)
NMA$C_LINFM_802 802 packet format
NMA$C_LINFM_802E 802 extended packet format
NMA$C_PCLI_PTY, NMA$C_PCLI_ACC, and NMA$C_PCLI_DES should only
be specified on those ports where the Ethernet packet format (NMA$C_LINFM_
ETH) is selected.
NMA$C_PCLI_SRV, NMA$C_PCLI_SAP, and NMA$C_PCLI_GSP should only
be specified on those ports where the 802 packet format (NMA$C_LINFM_802)
is selected.
NMA$C_PCLI_PID should only be specified on those ports where the 802
extended packet format (NMA$C_LINFM_802E) is selected.
NMA$C_PCLI_GSP
Group SAP. This is an optional parameter if the 802 packet format is selected
(NMA$C_PCLI_FMT is set to NMA$C_LINFM_802). If the Ethernet or 802
extended packet format is selected, NMA$C_PCLI_GSP cannot be specified.
Group SAPs can be shared among multiple ports on the same controller. If the
802 packet format is selected, NMA$C_PCLI_GSP defines up to four 802 group
SAPs that are to be enabled for matching incoming packets to complete read
operations on this port. By default, no group SAPs are enabled.
NMA$C_PCLI_GSP is passed as a longword value and is read as four 8-bit
unsigned integers. Each integer must be either a group SAP or zero. To enable
a single group SAP on a port, you need only specify the group SAP value to
be enabled in one of the four integers and place a value of zero in the three
remaining integers. To disable group SAPs on the port, you need only place a
value of zero in all four integers and issue the QIO.
If this characteristic is correctly specified, any group SAPs that were previously
enabled on the port are now replaced by the SAPs specified by the current
request.
NMA$C_PCLI_ILP1
Internal loopback mode. This optional parameter places the device in internal
loopback mode (not for the DEUNA, DEQNA, or DELQA devices). One of the
following values can be specified:
NMA$C_STATE_ON Internal loopback mode
NMA$C_STATE_OFF Not in internal loopback mode (default)
If NMA$C_STATE_ON is specified, the NMA$C_PCLI_CON parameter must be
in loopback (NMA$C_LINCN_LOO) mode.
When the controller is in loopback mode (generally for testing), it can loop
packets in external loopback or internal loopback. This parameter places the
controller in one of these loopback modes. NMA$C_PCLI_ILP is passed as a
longword value and affects all ports on the controller.
Not all devices support loopback mode. If NMA$C_STATE_OFF is not specified,
the request is completed with SS$_BADPARAM status.
1 If the LAN controller is active and you do not specify this parameter, the parameter defaults to the current setting. If
the LAN controller is not active, this parameter defaults to the default value indicated.
Meaning
NMA$C_PCLI_MCA
NMA$C_PCLI_MLT
NMA$C_PCLI_PAD
Use message size field on transmit and receive messages (optional). One of the
following values can be specified:
NMA$C_STATE_ON Insert message size field (default)
NMA$C_STATE_OFF No size field
(continued on next page)
Meaning
NMA$C_PCLI_PAD affects only the protocol type that issued the set mode
request. It is passed as a longword value.
On CSMA/CD, if padding is enabled on Ethernet format packets, the driver
adds a 2-byte count field to the transmitted data. This field allows short
packets (packets fewer than 46 bytes long) to be received with the proper
length returned by the driver. The minimum Ethernet packet contains 46 bytes
of user data. When fewer than 46 bytes are sent, the packet is padded and
the receiver always receives 46 bytes of data. When padding is enabled, the
maximum message size for transmit or receive operations is 1498 bytes and
the minimum is zero bytes. See Section 9.18.1.2 for additional information.
NMA$C_PCLI_PAD should be specified only on a port where the Ethernet
packet format is selected (NMA$C_PCLI_FMT is set to NMA$C_LINFM_ETH).
For FDDI, the same 2-byte count field is added; however, because FDDI packets
can be as short as 22 bytes, FDDI transmit requests are never padded.
NMA$C_PCLI_PHA1
NMA$C_PCLI_PID
Protocol identifier. This parameter is required for, and valid only on, ports that
use 802 extended format packets. NMA$C_PCLI_PID is passed as a counted
5-byte string, which is the unique protocol identifier required for each 802
extended format user.
All protocol identifiers specified on a controller must be unique except when the
PID is being shared.
NMA$C_PCLI_PID may only be specified on a port when the 802 extended
packet format is selected; that is, NMA$C_PCLI_FMT is set to NMA$C_
LINFM_802E.
1 If the LAN controller is active and you do not specify this parameter, the parameter defaults to the current setting. If
the LAN controller is not active, this parameter defaults to the default value indicated.
Meaning
NMA$C_PCLI_PRM
NMA$C_PCLI_PTY
Protocol type. This value is read as a 16-bit unsigned integer and must be
unique on the controller except when the protocol type is being shared. For
Ethernet format ports, this is a required parameter.
Valid protocol types are in the range 05-DD through FF-FF.
NMA$C_PCLI_PTY may only be specified on a port where the Ethernet packet
format is selected (NMA$C_PCLI_FMT is set to NMA$C_LINFM_ETH).
NMA$C_PCLI_PTY is passed as a longword value; however, only the low-order
word is used.
NMA$C_PCLI_RAC
Receive access control (Token Ring only). This optional parameter specifies
whether the application receives a copy of the access control (AC) field for each
Token Ring frame received. It is passed as a longword value. It must be passed
with one of the following values:
The AC is returned in the P5 buffer. The P5 buffer size for Token Ring should
always be a minimum of 54 bytes. This is due to the variable size of the Token
Ring header.
(continued on next page)
Meaning
NMA$C_PCLI_RES
Restart. This optional parameter allows the user to enable the automatic port
restart feature of the LAN drivers. One of the following values can be specified:
NMA$C_LINRES_DIS Disable automatic restart (default)
NMA$C_LINRES_ENA Enable automatic restart
The LAN drivers shut down all users of a controller if there is a fatal error on
the controller or if the LAN driver determines that the controller has stopped
functioning. All outstanding I/O operations on the LAN driver are completed
with either an SS$_ABORT or SS$_TIMEOUT status.
All ports that have the NMA$C_PCLI_RES parameter enabled (set to NMA$C_
LINRES_ENA) have the port automatically restarted by the LAN driver
approximately one second after it has been shut down due to a fatal error.
If the user issues read or write QIOs to the port during the time the port is shut
down, the driver completes the QIOs with an SS$_OPINCOMPL status.
All ports that have the automatic restart feature disabled must be restarted
by the application program when the port is shut down by the LAN driver.
The application program should wait approximately 2 seconds to allow the
LAN driver to stabilize. Once the LAN driver shuts down a port, it attempts
a maximum of 30 consecutive automatic restarts. If there are 30 consecutive
failures to restart the port, the port remains shut down.
Note that it is unusual to have fatal errors on a LAN controller or to have a
LAN driver detect that a LAN controller has stopped functioning. Having the
ability to automatically restart a users port makes the program easier to design
because the program does not have to take into account the possibility of the
LAN driver shutting down the port.
NMA$C_PCLI_RFC
Receive frame control (FDDI only). This optional parameter specifies whether
the application receives a copy of the Frame Control (FC) field for each FDDI
frame received. It is passed as a longword value; however, only the low-order
byte is used. It must be passed with one of the following values:
For $QIO Read operations, the FC is passed to the application in the P5 buffer.
The following are the sizes required for the P5 buffer for various packet formats
and settings of NMA$C_PCLI_RFC:
Receiving the FC requires one additional byte of space in the P5 buffer. The FC
is the first byte in the P5 buffer, immediately preceding the 6-byte destination
address. The size of the P5 buffer required does not change from the CSMA/CD
sizes if NMA$C_PCLI_RFC is set to NMA$C_STATE_OFF.
(continued on next page)
Meaning
NMA$C_PCLI_SAP
802 format SAP. This parameter is required if the 802 packet format is selected
(NMA$C_PCLI_FMT is set to NMA$C_LINFM_802). NMA$C_PCLI_SAP
defines an 802 SAP and is read as an 8-bit unsigned integer. The least
significant bit of the SAP must be zero and the SAP cannot be the null SAP
(all 8 bits equal zero) or the SNAP SAP. NMA$C_PCLI_SAP is passed as a
longword value; however, only the low-order byte is used.
The SAP specified by NMA$C_PCLI_SAP is the SAP used to match incoming
packets to complete read requests. It is used as the source SAP (SSAP) in all
transmissions (write QIOs). Because it is illegal to transmit using a group SAP
as the source SAP, the SAP specified by this NMA$C_PCLI_SAP cannot be a
group SAP. NMA$C_PCLI_GSP describes how to set up group SAPs on a port.
All individual SAPs specified on a controller must be unique on that controller;
therefore, the SAP specified using the NMA$C_PCLI_SAP parameter is checked
for uniqueness on the controller.
NMA$C_PCLI_
SRMODE
Sets the source routing (SR) mode for the $QIO user (Token Ring only).
This optional parameter allows the application to perform the source routing
discovery. It must be passed with one of the following values:
The $QIOs exist to further manipulate the source routing cache. Compaq
recommends that applications use the NMA$C_SR_TRANSPARENT mode.
NMA$C_PCLI_SRV
Port service. This optional parameter specifies the service supplied by the
driver for the port. It can only be specified if the 802 packet format is selected
(NMA$C_PCLI_FMT is set to NMA$C_LINFM_802). This characteristic is
passed as a longword value. One of the following values can be specified:
NMA$C_LINSR_USR User-supplied service (default)
NMA$C_LINSR_CLI Class I service
See Section 9.18.2.1 for a description of Class I service and Section 9.18.2.2 for
a description of user-supplied service.
NMC$C_PCLI_XAC
Transmit access control (Token Ring only). This is an optional parameter that
enables applications to control the setting of the priority bits in the access
control (AC) for frames being transmitted in a $QIO write operation. When set
to the wanted value, all subsequent transmits use this AC value.
(continued on next page)
Meaning
NMA$C_PCLI_XFC
Ethernet
IEEE 802
802E
FMT
DEF
REQ
REQ
PTY
REQ
SAP
REQ
PID
REQ
ACC
OPT
DES
OPT
PAD
OPT
SRV
OPT
GSP
OPT
VAX specific. On Alpha systems, however, the ACC and DES parameters are OPT.
Legend
DEFDefault. If not specified, this is the default parameter for this packet format.
REQRequired. This parameter must be specified for this packet format.
OPTOptional. This parameter is optional for this packet format; it may be specified.
EError. This parameter cannot be specified for this packet format. If the parameter is specified,
it generates an SS$_BADPARAM error.
Ethernet
IEEE 802
802E
BFN, BUS,
CCA, CON,
CRC, EKO,
ILP, MCA,
MLT, PHA,
PRM, RAC,
RES, RFC,
SRMODE, XAC,
XFC
OPT
OPT
OPT
Alpha specific.
Legend
DEFDefault. If not specified, this is the default parameter for this packet format.
REQRequired. This parameter must be specified for this packet format.
OPTOptional. This parameter is optional for this packet format; it may be specified.
EError. This parameter cannot be specified for this packet format. If the parameter is specified,
it generates an SS$_BADPARAM error.
P2Ignored
Meaning
MA$C_PCLI_FDE
Enables or disables full duplex operation. The values for this parameter
are NMA$C_STATE_ON or NMA$C_STATE_OFF.
NMA$C_PCLI_LINEMEDIA
Sets the connection media type for the Ethernet adapter. Valid values
for this parameter are:
NMA$C_MEDIA_AUTO
NMA$C_MEDIA_AUI
NMA$C_MEDIA_BNC
NMA$C_MEDIA_TP
NMA$C_PCLI_LINESPEED
Sets the speed of the Ethernet adapter. Valid values for this parameter
are:
0Used to autosense the speed.
10Sets the speed to 10 Mb/s.
100Sets the speed to 100 Mb/s.
65636Used to autonegotiate with a maximum speed of 100 Mb/s.
65546Used to autonegotiate with a maximum speed of 10 Mb/s.
Meaning
NMA$C_PCLI_TREQ
Requested value for token rotation timer, ANSI MAC T_req parameter.
Units are in 80 nanoseconds, default is 8000, minimum is 4000, and
maximum is 167772.
NMA$C_PCLI_TVX
NMA$C_PCLI_REST_TTO
Restricted token timeout which limits how long a single restricted mode
dialog may last before being terminated. Units are in milliseconds,
default is 1000, minimum is 0, and maximum is 10000.
NMA$C_PCLI_RPE
Ring purge enable. If 1 (TRUE), this link will particpate in the Ring
Purger election and, if elected, perform the Ring Purger function.
(continued on next page)
Meaning
NMA$C_PCLI_NIF_TARG
NMA$C_PCLI_SIF_CONF_
TARG
NMA$C_PCLI_SIF_OP_TARG
NMA$C_PCLI_ECHO_TARG
Echo test target. A 6-byte string specifying the LAN address of the
target. Used only by DECnet/OSI.
NMA$C_PCLI_ECHO_DAT
Data pattern to use for the echo test. Used only by DECnet/OSI.
NMA$C_PCLI_ECHO_LEN
Meaning
NMA$C_PCLI_RNG_SPD
NMA$C_PCLI_LINEMEDIA
Sets the connection media type for the Token Ring adapter. Valid values
for this longword parameter are:
NMA$C_MEDIA_STP
NMA$C_MEDIA_UTP
The default is NMA$C_MEDIA_STP.
NMA$C_PCLI_ETR
Controls the Early Token release feature of the Token Ring hardware.
This feature can greatly improve throughput, and is only valid on
16 Mb/s rings. The values for this longword parameter are NMA$C_
STATE_ON or NMA$C_STATE_OFF. The default is NMA$C_STATE_
ON.
NMA$C_PCLI_MONCONTEND
NMA$C_PCLI_CACHE_ENT
NMA$C_PCLI_ROUTEDIS
NMA$C_PCLI_A_TIM
The source routing aging timer. After traffic is neither received from
nor sent to a given node for this number of seconds, the entry is marked
stale. After the entry is marked stale, rediscovery is required to
communicate with the node. The default is 60 seconds, minimum is
1, and maximum is 65535.
(continued on next page)
Meaning
NMA$C_PCLI_SRC_ROU
Enables and disables source routing. The values for this longword
parameter are NMA$C_LINSRC_ENA or NMA$C_LINSRC_DIS. The
default is NMA$C_LINSRC_ENA.
NMA$C_PCLI_AUTH_PR
Specifies the highest priority that a user may transmit a frame. The
priority is set within the NMA$C_PCLI_XAC parameter. The default
for this parameter is 3, minimum is 0, and maximum is 6.
Meaning
NMA$C_PCLI_MED
NMA$C_PCLI_BUS
NMA$C_PCLI_ELAN_PAR
NMA$C_PCLI_NET
NMA$C_PCLI_ELAN_DESC
NMA$C_PCLI_LES_HWA
NMA$C_PCLI_ELAN_STATE_
REQ
ELAN change state request value. This longword parameter directs the
driver to either start or shutdown the emulated LAN. Start is specified
by a value of 2. Shutdown is specified by a value of 4.
NMA$C_PCLI_EVENT_REQ
NMA$C_PCLI_EVENT
Event mask value. This is a longword bit mask that controls the
event reporting done by the driver. A bit set in the mask enables the
reporting of corresponding event(s).
15
Length
(bytes following this field)
NMA$C_PCLI_MAP
MC Addr 1
Subfunction
MC Addr 3
MC Addr 2
FUNCTIONAL Address 2
FUNCTIONAL Address 1
ZK6791AGE
15
Length
(bytes following this field)
NMA$C_PCLI_MAP
MC Addr 1
Subfunction
MC Addr 3
MC Addr 2
RI_Size
ZK6792AGE
IO$_SENSEMODE!IO$M_CTRLRead characteristics
IO$_SENSECHAR!IO$M_CTRLRead characteristics
On Alpha systems, the following combinations of function code and modifier for
Token Ring are provided:
Except for the following differences, P2 returns the same attributes as those
listed in Table 939:
All parameters that are valid for the enabled packet format are returned (see
Table 940).
The sense-mode P2 buffer does not return the modifier word for the NMA$C_
PCLI_PHA, NMA$C_PCLI_MCA, and NMA$C_PCLI_DES parameter IDs.
Meaning
NMA$C_PCLI_FCA
NMA$C_PCLI_HWA
NMA$C_PCLI_MBS
CSMA/CD
FDDI
Token Ring
1500
4470
4418
1498
4468
4416
1497
4475
4423
802E format
1492
4470
4418
Packet Format
NMA$C_PCLI_MED
802E format
24 23
16 15
Error Summary
8 7
Type
Class
Status
Not Used
ZK1178GE
It is suggested that a size of 250 bytes be used for the P2 buffer. This will
allow space for additional parameters that may be returned in future releases of
OpenVMS.
15 14 13 12 11
0
Parameter ID
Longword of
Value
* Not Used
String Parameter:
15 14 13 12 11
0
Parameter ID
Word of String Count
String
* Not Used
ZK1210GE
Meaning
NMA$C_PCLI_T_NEG
The negotiated value of the token rotation timer (ANSI MAC parameter T_neg)
(FDDI only).
NMA$C_PCLI_DAT
The duplicate address test flag (FDDI only). If set, this indicates that there is
another station on the ring with the same hardware LAN address.
NMA$C_PCLI_UNA
NMA$C_PCLI_OLD_
UNA
The old (previous) upstream neighbor address (FDDI only). Neighbor addresses
change as nodes insert and deinsert into the ring.
NMA$C_PCLI_UN_DAT
NMA$C_PCLI_DNA
Meaning
NMA$C_PCLI_OLD_
DNA
NMA$C_PCLI_RPS
The current ring purger state (FDDI only). This longword parameter is one of
the following values:
0Off
1Candidate
2Non-purger
3Purger
NMA$C_PCLI_RER
The latest ring error reason (FDDI only). This longword parameter is one of the
following values:
0No Error
5Ring Init initiated
6Ring Init received
7Ring beaconing initiated
8Duplicate address detected
9Duplicate token detected
10Ring purger error
11FCI strip error
12Ring op oscillation
14PC trace initiated
15PC trace received
NMA$C_PCLI_NBR_
PHY
Neighbors PHY type (FDDI only). This longword parameter is one of the
following values:
0A
1B
2S
3M
4Unknown
NMA$C_PCLI_RJR
Ring reject reason (FDDI only). This longword parameter is one of the following
values:
0None
1Local LCT
2Remote LCT
3LCT both sides
4LEM reject
5Topology error
6Noise reject
7Remote reject
8Trace in progress
9Trace received-disabled
10Standby
11LCT protocol error
NMA$C_PCLI_LEE
Link error estimate (FDDI only). The longword value is a negative exponent of
10 representing the Link error rate. For example, the value of X represents the
error rate of 10^X.
(continued on next page)
Meaning
NMA$C_PCLI_RNG_
NUM
The longword value contains the ring number that the controller is running on
(Token Ring only). It is only valid for a controller that is started, and also only
valid for rings that have a ring parameter server that is configured for providing
this information.
15
Multicast 2
Multicast 1
Reserved
Multicast 3
Reserved
ZK6793AGE
The multicast address and functional address mask are returned in canonical
format (that is, not bit-reversed). The following errors may occur:
SS$_BUFFEROVFThe passed buffer is not large enough to hold all the data
required for the operation.
15
LAN Addr 2
LAN Addr1
Reserved
LAN Addr3
State of Entry
Routing Information String Size
Segment Descriptor
Segment Descriptor
Segment Descriptor
Segment Descriptor
Segment Descriptor
Segment Descriptor
Segment Descriptor
Segment Descriptor
Segment Descriptor
Segment Descriptor
Segment Descriptor
Segment Descriptor
Segment Descriptor
Stale Timer
Discovery Timer
ZK6794AGE
Name
Description
LOCAL
STALE
UNKNOWN
DELETED
KNOWN
EXPLORING
The LAN address is returned in canonical format (that is, not bit-reversed). The
timers are recorded as seconds before expiration. The transmit and receive timers
are initialized from the NMA$C_PCLI_A_TIM parameter, the discovery timer is
initialized from the NMA$C_PCLI_ROUTEDIS parameter, and the stale timer is
initialized to 10 minutes (600 seconds). The following errors may occur:
SS$_BUFFEROVFThe passed buffer is not large enough to hold all the data
required for the operation.
Transfer Size
Completion Status
+4
Not
Used
Error
Summary
Status
Not
Used
Byte of Value
ZK1179GE
The first longword of the IOSB returns, in addition to the completion status,
either the size (in bytes) of the data transfer or the size (in bytes) of the attribute
buffer (P2) returned by a sense mode function. The second longword returns the
unit and line status bits listed in Table 932 and the error summary bits listed in
Table 933.
Rule
IO$_SETMODE
IO$_SETCHAR
IO$_WRITE
The user can only transmit packets in the packet format previously
specified with a set mode QIO when the user was started. The
unique identifier for the packet format must be included in the P5
buffer following the destination address (see Section 9.20.2).
IO$_READ
This LAN test program sends a MOP loopback message to the Loopback Assistant
Multicast address and waits for a response. The program uses the LAN device
EWA0. To use a different device, change the device name in the program or
define the desired lan device as EWA0.
To build on VAX or Alpha:
$ MACRO LANETH
$ LINK LANETH
.LIBRARY "SYS$LIBRARY:LIB.MLB"
$IODEF
$NMADEF
; Setmode parameter buffer and descriptor. Since the loopback protocol does
; not include a length word following the protocol type, we have to explicitly
; turn off padding since the default is on.
SETPARM:
.WORD NMA$C_PCLI_FMT
.LONG NMA$C_LINFM_ETH
.WORD NMA$C_PCLI_PTY
.LONG ^X0090
.WORD NMA$C_PCLI_PAD
.LONG NMA$C_STATE_OFF
SETPARMLEN = .-SETPARM
; Packet format
; Ethernet
; Protocol type
; Loopback
; Padding
; Off
SETPARMDSC:
.LONG SETPARMLEN
.ADDRESS SETPARM
; Sensemode parameter buffer and descriptor. This is used to get our physical
; address to put into the loopback message.
SENSEBUF:
.BLKB 512
SENSELEN=.-SENSEBUF
SENSEDSC:
.LONG SENSELEN
.ADDRESS SENSEBUF
; P2 transmit data buffer.
XMTBUF: .WORD 00
.WORD 02
FORW: .BLKB 6
.WORD 01
.WORD 00
XMTBUFLEN = .-XMTBUF
;
;
;
;
Skip count
Forward request
Forward address
Reply request
^XCF,0,0,0,0,0
6
6
2
.ASCID
.ASCID
.ASCID
.ASCID
"Successful test"
"No response"
"Error occurred while running test"
"LAN device not found"
; Miscellaneous data.
IOSB: .BLKQ 1
DEVCHAN:.BLKL 1
LANDSC: .ASCID EWA0
;*************************************************************************
;
; Start of code
;
;*************************************************************************
.PSECT CODE,EXE,NOWRT,PAGE
.ENTRY START,^M<>
; Assign a port to the LAN device.
$ASSIGN_S DEVNAM=LANDSC,CHAN=DEVCHAN
BLBS
R0,10$
; Branch if succeeded
MOVAL DMSG,R9
; Get address of error message
BRW
EXIT
; Print message and exit
; Set up the ports characteristics.
10$:
20$:
MOVAL EMSG,R9
; Assume error message address
$QIOW_S FUNC=#<IO$_SETMODE!IO$M_CTRL!IO$M_STARTUP>,CHAN=DEVCHAN,IOSB=IOSB,P2=#SETPARMDSC
BLBC
R0,20$
; Branch if failed
MOVZWL IOSB,R0
; Get status from IOSB
BLBS
R0,30$
; Branch if succeeded
BRW
EXIT
; Print message and exit
; Issue the SENSEMODE QIO to get our physical address for the loopback
; message.
30$:
$QIOW_S FUNC=#<IO$_SENSEMODE!IO$M_CTRL>,CHAN=DEVCHAN,IOSB=IOSB,P2=#SENSEDSC
BLBC
R0,20$
; Branch if failed
MOVZWL IOSB,R0
; Get status from IOSB
BLBC
R0,20$
; Branch if failed
; Locate the PHA parameter in the SENSEMODE buffer and copy it into the
; LOOPBACK transmit message. The PHA parameter is a string parameter.
(continued on next page)
60$:
MOVAB
BBS
ADDL
BRB
BICW3
CMPW
BEQL
ADDW
BRW
MOVL
MOVW
SENSEBUF,R0
#^XC,(R0),50$
#6,R0
40$
#^XF000,(R0)+,R1
R1,#NMA$C_PCLI_PHA
60$
(R0)+,R0
40$
2(R0),FORW
6(R0),FORW+4
;
;
;
;
;
;
;
;
;
;
;
70$:
$QIOW_S FUNC=#IO$_WRITEVBLK,CHAN=DEVCHAN,IOSB=IOSB,P1=XMTBUF,P2=#XMTBUFLEN,P5=#XMTP5
BLBC
R0,70$
; Branch if failed
MOVZWL IOSB,R0
; Get status from IOSB
BLBS
R0,80$
; Branch if succeeded
BRW
EXIT
; Print message and exit
; Look for a response. We use the NOW function modifier on the READ so that
; we dont hang here waiting forever if there is no response. If there is no
; response in 1000 receive attempts, we declare no response status.
80$:
90$:
MOVL
#1000,R2
; Check 1000 times
$QIOW_S FUNC=#IO$_READVBLK!IO$M_NOW,CHAN=DEVCHAN,IOSB=IOSB,P1=RCVBUF,P2=#RCVBUFLEN,P5=#RCVP5
BLBC
R0,EXIT
; Branch if failed
MOVZWL IOSB,R0
; Get status from IOSB
BLBS
R0,100$
; Branch if succeeded
CMPL
R0,#SS$_ENDOFFILE
; Was there just no message available?
BNEQ
EXIT
; Branch if failed
SOBGTR R2,90$
; Try again
LMSG,R9
EXIT
; Received a message.
100$:
MOVAL
GMSG,R9
PUSHL R9
CALLS #1,G^LIB$PUT_OUTPUT
$EXIT_S
.END
START
<ctype>
<descrip>
<iodef>
<ssdef>
<starlet>
<stdio>
<stdlib>
<string>
<stsdef>
/*
/*
/*
/*
/*
/*
/*
/*
/*
NMA$C_PCLI_FMT 2770
NMA$C_PCLI_PID 2774
NMA$C_PCLI_PHA 2820
NMA$C_LINFM_802E 0
$SUCCESS(status) (((status) & STS$M_SUCCESS) == SS$_NORMAL)
$FAIL(status) (((status) & STS$M_SUCCESS) != SS$_NORMAL)
#pragma nomember_alignment
struct parm_802e
{
short pcli_fmt;
/* Format - 802E */
int fmt_value;
short pcli_pid;
/* Protocol ID - 08-00-2B-90-00 */
short pid_length;
char pid_value[5];
} setparm_802e = {NMA$C_PCLI_FMT, NMA$C_LINFM_802E,NMA$C_PCLI_PID, 5, 8,0,0x2b,0x90,0};
struct setparmdsc
{
int parm_len;
void *parm_buffer;
};
struct setparmdsc setparmdsc_loop = {sizeof(setparm_802e),&setparm_802e};
struct p5_param
{
unsigned char da[6];
unsigned char sa[6];
char misc[20];
};
/* IOSB structure */
/*
/*
/*
/*
Completion Status */
Transfer Size */
Additional status */
Miscellaneous */
struct ascid
{
short w_len;
short w_info;
char *a_string;
} devdsc = {4,0,"EWA0"};
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
char sense_buffer[512];
/* Sensemode buffer */
IOSB structure */
Receive header structure */
Transmit header structure */
Loopback Assistant Multicast Address */
Receive buffer */
Transmit buffer */
Skip count */
Forward request */
Forward address */
Reply request */
/* Scratch */
/* Channel assigned */
/* Return status */
/*
* Start a channel.
*/
status = sys$assign(&devdsc,&chan,0,0);
if ($FAIL(status)) exit(status);
status = sys$qiow(0,chan,IO$_SETMODE|IO$M_CTRL|IO$M_STARTUP,&qio_iosb,0,0,0,
&setparmdsc_loop,0,0,0,0);
if ($SUCCESS(status)) status = qio_iosb.w_err;
if ($FAIL(status))
{
printf("IOSB addl status = %04X %04X (on startup)\n",qio_iosb.w_addl,qio_iosb.w_misc);
exit(status);
}
/*
* Issue the SENSEMODE QIO to get our physical address for the loopback message.
*/
(continued on next page)
9.23 References
The following publications provide more information on local area networks:
RFC 1577
10
Optional Features for Improving I/O
Performance
This chapter includes updated information for OpenVMS Version 7.31.
As of Version 7.0, OpenVMS Alpha includes two features that provide
dramatically improved I/O performance: Fast I/O and Fast Path. These features
are designed to promote OpenVMS as a leading platform for database systems.
Performance improvement results from reducing the CPU cost per I/O request
and improving symmetric multiprocessing (SMP) scaling of I/O operations. The
CPU cost per I/O is reduced by optimizing code for high-volume I/O and by using
better SMP CPU memory cache. SMP scaling of I/O is increased by reducing the
number of spinlocks taken per I/O and by substituting finer-granularity spinlocks
for global spinlocks.
The improvements follow a natural division that already exists between the
device-independent and device-dependent layers in the OpenVMS I/O subsystem.
The device-independent overhead is addressed by Fast I/O, which is a set of
lean system services that can substitute for certain $QIO operations. Using
these services requires some coding changes in existing applications, but the
changes are usually modest and well contained. The device-dependent overhead
is addressed by Fast Path, which is an optional performance feature that creates
a fast path to the device. It requires no application changes.
Fast I/O and Fast Path can be used independently; however, together they can
provide a 45% reduction in CPU cost per I/O on uniprocessor systems and a 52%
reduction on multiprocessor systems.
For buffered I/O, avoid allocation and deallocation of a separate system buffer,
because the user buffer is always addressable.
In total, Fast I/O services eliminate four spinlock acquisitions per I/O (two for the
MMG spinlock and two for the SCHED spinlock). The reduction in CPU cost per
I/O is 20% for uniprocessor systems and 10% for multiprocessor systems.
The $QIO system service I/O status block (IOSB) is replaced by an I/O status
area (IOSA) that is larger and quadword aligned. The transfer byte count
returned in IOSA is 64 bits, and the field is aligned on a quadword boundary.
Unlike the IOSB, which is optional, the IOSA is required.
All user process structures passed to the Fast I/O system services must reside
in buffer objects. This includes the user data buffer and the IOSA.
No event flags are used with Fast I/O services. If application code must
use an event flag in relation to a specific I/O, then the Event No Flag EFN
(EFN$C_ENF) can be used. This event flag is a no-overhead EFN that can be
used in situations when an EFN is required by a system service interface but
has no meaning to an application.
Segmented transfers are supported by Fast I/O but are not fully optimized.
There are two major causes of segmented transfers. The first is disk
fragmenting. While this can be an issue, it is assumed that sites seeking
maximum performance have eliminated the overhead of segmenting I/O due
to fragmentation.
A second cause of segmenting is issuing an I/O that exceeds the ports
maximum limit for a single transfer. Transfers beyond the port maximum
limit are segmented into several smaller transfers. Some ports limit transfers
to 64K bytes. If the application limits its transfers to less than 64K bytes,
this type of segmentation should not be a concern.
$IO_SETUPSets up an I/O
Ports
7.31
KZPEA
7.3
7.1
CIXCD, CIPCA
7.0
CIXCD
Prior to OpenVMS Alpha Version 7.31, all hardware interrupts took place on
the primary CPU. Interrupts from Fast Path enabled devices would have to be
redirected from the primary CPU to a preferred CPU. However, this redirection
still involved the primary CPU, and also incurred interprocessor overhead.
Starting with OpenVMS Alpha Version 7.31, hardware interrupts that are
targetted for a preferred CPU go directly to the preferred CPU, thereby
eliminating any I/O processing in the primary CPU. This major Fast Path
enhancement is known as distributed interrupts.
Note
This feature is available on Fibre Channel, CI, and some SCSI ports on
AlphaServer DS20, ES40/45, and GS series systems.
Reducing code paths through streamlining for the case of high-volume I/O
FAST_PATH
FAST_PATH_PORTS
IO_PREFER_CPUS
Mask
Description
00000001
00000002
00000004
The remaining bits are reserved for possible future adapter types.
The default setting for FAST_PATH_PORTS is 0; therefore, the following ports
are enabled: KZPBA, KGPSA, and KZPEA.
Note that CI drivers are not controlled by FAST_PATH_PORTS. Fast Path for CI
is enabled and disabled exclusively by the FAST_PATH system parameter.
IO_PREFER_CPUS
IO_PREFER_CPUS is a dynamic system parameter that controls the set of CPUs
available for use as Fast Path preferred CPUs.
IO_PREFER_CPUS is a CPU bit mask specifying the CPUs that are allowed to
serve as preferred CPUs and thus can be assigned a Fast Path port. CPUs whose
bit is set in the IO_PREFER_CPUS bit mask are enabled for Fast Path port
assignment. IO_PREFER_CPUS defaults to -1, which specifies that all CPUs are
allowed to be assigned Fast Path ports.
You may want to disable the primary CPU from serving as a preferred CPU by
clearing its bit in IO_PREFER_CPUS. This will reserve the primary for use by
non-Fast Path IO operations.
Changing the value of IO_PREFER_CPUS causes the FASTPATH_SERVER
process to execute the automatic assignment algorithm that spreads Fast Path
ports evenly among the new set of usable CPUs.
10.2.2.2 Identifying and Setting a Ports Preferred CPU
Following are the commands used to identify and set a preferred CPU for a port.
DCL SHOW DEVICE/FULL or $GETDVI DVI$_PREFERRED_CPU
To identify the preferred CPU for any Fast Path-capable device when Fast Path
is enabled, use the DCL command SHOW DEVICE/FULL to displaywhether or
not the device supports Fast Paththe current preferred CPU ID and, if set, the
User Preferred CPU ID for a port or disk device.
Alternatively, the $GETDVI system service or the DCL F$GETDVI lexical
function will return the preferred CPU for a given device or file. The $GETDVI
system service item code is DVI$_PREFERRED_CPU, and the F$GETDVI item
code string argument is PREFERRED_CPU. The return argument is a 32-bit
CPU bit mask with a bit set indicating the preferred CPU. A return argument
containing a bit mask of zero indicates that no preferred CPU exists, either
because Fast Path is disabled or the device is not a Fast Path-capable device. The
There is no intersection between the candidate set and the nodes set of usable
CPUs.
A
I/O Function Codes
This appendix lists the function codes and function modifiers defined in the
$IODEF macro. The arguments for these functions are also listed.
Arguments
Modifiers
IO$_CREATE
IO$_ACCESS
IO$_DEACCESS
IO$_MODIFY
IO$_DELETE
IO$_ACPCONTROL
P1FIB descriptor
address
P2file name string
address
P3result string length
address
P4result string
descriptor address
P5attribute list
address
IO$M_CREATE1
IO$M_ACCESS1
IO$M_DELETE2
IO$M_DMOUNT3
IO$_MOUNT
None
None
1 Only
2 Only
3 Only
for IO$_ACPCONTROL
SS$_ACPVAFUL
SS$_BADATTRIB
SS$_BADCHKSUM
SS$_BADFILEHDR
SS$_BADFILENAME
SS$_BADFILEVER
SS$_BADIRECTORY
SS$_BADPARAM
SS$_BADQFILE
SS$_BLOCKCNTERR
SS$_CREATED
SS$_DEVICEFULL
SS$_DIRFULL
SS$_DIRNOTEMPTY
SS$_DUPDSKQUOTA
SS$_DUPFILENAME
SS$_ENDOFFILE
SS$_EXBYTLM
SS$_EXDISKQUOTA
SS$_FCPREADERR
SS$_FCPREWNDERR
SS$_FCPSPACERR
SS$_FCPWRITERR
SS$_FILELOCKED
SS$_FILENUMCHK
SS$_FILEPURGED
SS$_FILESEQCHK
SS$_FILESTRUCT
SS$_FILNOTEXP
SS$_HEADERFULL
SS$_IBCERROR
SS$_ILLCNTRFUNC
SS$_NODISKQUOTA
1 The
SS$_IDXFILEFULL
SS$_NOMOREFILES
SS$_NOQFILE
SS$_NOSUCHFILE
SS$_NOTAPEOP
SS$_NOTLABELMT
SS$_NOTPRINTED1
SS$_NOTVOLSET
SS$_OVRDSKQUOTA
SS$_QFACTIVE
SS$_QFNOTACT
SS$_SERIOUSEXCP
SS$_SUPERSEDE
SS$_TAPEPOSLOST
SS$_TOOMANYVER
SS$_WRITLCK
SS$_WRONGACP
1 The
Arguments
Modifiers
IO$_READVBLK
IO$_READLBLK
IO$_READPBLK4
IO$_WRITEVBLK
IO$_WRITELBLK
IO$_WRITEPBLK4
P1buffer address
P2byte count
P3disk address
IO$M_INHSEEK1
IO$M_DATACHECK2
IO$M_DELDATA3
IO$M_INHRETRY
IO$M_ERASE5
IO$_WRITECHECK2
P1buffer address
P2byte count
P3disk address
None
IO$_SENSECHAR
IO$_SENSEMODE
IO$_PACKACK
IO$_AVAILABLE
IO$_UNLOAD
None
None
IO$_SEARCH
P1read/write
head position
None
IO$_SEEK4
P1seek to
specified
cylinder
None
IO$_FORMAT
P1RX02 density
None
IO$_SETPRFPATH
IO$_FORCEPATH
1 Only
for IO$READPBLK and IO$_WRITEPBLK (not for TU58, RX01, RX02, RB02, or RL02)
2 Not
5 Only
Arguments
Modifiers
IO$_CREATE
IO$_ACCESS
IO$_DEACCESS
IO$_MODIFY
IO$_DELETE
IO$_ACPCONTROL
P1FIB descriptor
address
P2file name string
address
P3result string
length address
P4result string
descriptor
address
P5attribute list
address
IO$M_CREATE6
IO$M_ACCESS6
IO$M_DELETE7
IO$M_DMOUNT8
6 Only
7 Only
8 Only
for IO$_ACPCONTROL
SS$_CANCEL
SS$_CTRLERR
SS$_DATACHECK
SS$_DATAOVERUN
SS$_DRVERR
SS$_FORCEDERR
SS$_FORMAT
SS$_ILLIOFUNC
SS$_IVADDR
SS$_IVBUFLEN
SS$_MEDOFL
SS$_NONEXDRV
SS$_NORMAL
SS$_OPINCOMPL
SS$_PARITY
SS$_RCT
SS$_RDDELDATA
SS$_TIMEOUT
SS$_UNSAFE
SS$_VOLINV
SS$_WASECC
SS$_WRITLCK
Arguments
Modifiers
IO$_READVBLK
IO$_READLBLK
IO$_READPBLK
P1buffer address
P2byte count
IO$M_DATACHECK1
IO$M_INHRETRY
IO$M_REVERSE3
IO$_WRITEVBLK
IO$_WRITELBLK
IO$_WRITEPBLK
P1buffer address
P2byte count
IO$M_DATACHECK1
IO$M_INHRETRY
IO$M_INHEXTGAP2
IO$M_NOWAIT8
IO$M_ERASE7
IO$_SETMODE
IO$_SETCHAR
P1characteristics buffer
address
P2characteristics buffer
length9
1 Not
2 Only
3 Not
for TK50
7 IO$M_ERASE
Arguments
Modifiers
IO$_CREATE
IO$_ACCESS
IO$_DEACCESS
IO$_MODIFY
IO$_ACPCONTROL
P1FIB descriptor
address
P2file name string
address
P3result string length
address
P4result string
descriptor address
P5attribute list address
IO$M_CREATE4
IO$M_ACCESS4
IO$M_DMOUNT5
IO$_SKIPFILE
IO$M_ALLOWFAST10
IO$M_INHRETRY
IO$M_NOWAIT8
IO$_SKIPRECORD
P1skip n blocks
IO$M_INHRETRY
IO$M_NOWAIT8
IO$_REWIND
IO$_REWINDOFF
IO$_UNLOAD
None
IO$M_INHRETRY
IO$M_NOWAIT
IO$M_RETENSION
IO$_WRITEOF
None
IO$M_INHEXTGAP2
IO$M_INHRETRY
IO$M_NOWAIT8
IO$_SENSEMODE
IO$_SENSECHAR
P1characteristics
buffer address9
P2characteristics
buffer length9
IO$M_INHRETRY
IO$_DSE6
IO$_PACKACK
IO$_AVAILABLE
None
None
2 Only
4 Only
5 Only
for IO$_ACPCONTROL
6 Only
8 Only
9 Only
10 Only
SS$_CANCEL
SS$_CTRLERR
SS$_DATACHECK
SS$_DATAOVERUN
SS$_DEVOFFLINE
SS$_DRVERR
SS$_ENDOFFILE
SS$_ENDOFTAPE
SS$_ENDOFVOLUME
SS$_FORMAT
SS$_ILLIOFUNC
SS$_MEDOFL
SS$_NONEXDRV
SS$_NORMAL
SS$_OPINCOMPL
SS$_PARITY
SS$_SERIOUSEXCP
SS$_TIMEOUT
SS$_UNSAFE
SS$_VOLINV
SS$_WRITLCK
Arguments
Modifiers
IO$_READVBLK
IO$_READLBLK
IO$_READPBLK
IO$_WRITEVBLK
IO$_WRITELBLK
IO$_WRITEPBLK
P1buffer
address
P2buffer size
IO$M_NOW
IO$M_NORSWAIT1
IO$M_
READERCHECK1
IO$M_
WRITERCHECK2
IO$M_STREAM2
IO$_WRITEOF
None
IO$M_NOW
IO$M_
READERCHECK
IO$M_STREAM
IO$_SETMODE!IO$M_READATTN
IO$_SETMODE!IO$M_WRTATTN
IO$_SETMODE!IO$MB_ROOM_
NOTIFY
P1AST address
P2AST parameter
P3access mode
None
IO$_SETMODE!IO$M_
READERWAIT
IO$_SETMODE!IO$M_
WRITERWAIT
None
None
IO$_SETMODE!IO$M_SETPROT
P2volume
protection
mask
None
IO$_SENSEMODE!IO$M_
READERCHECK
IO$_SENSEMODE!IO$M_
WRITERCHECK
None
None
1 Only
2 Only
SS$_EXQUOTA
SS$_ILLIOFUNC
SS$INSFMEM
SS$MBFULL
SS$_MBTOOSML
SS$_NOPRIV
SS$_NORMAL
SS$_ENDOFFILE
SS$_BUFFEROVF
SS$_CANCEL
SS$_
NOREADER
SS$_NORMAL
SS$_NOWRITER
Arguments
Modifiers
IO$_READVBLK
IO$_READLBLK
IO$_READPROMPT
P1buffer address
P2buffer size
P3timeout
P4read terminator
block address
P5prompt string
buffer address
P6prompt string
buffer size1
IO$M_NOECHO
IO$M_CVTLOW
IO$M_NOFILTR
IO$M_TIMED
IO$M_PURGE
IO$M_DSABLMBX
IO$M_TRMNOECHO
IO$M_ESCAPE
IO$_READVBLK
P1buffer address
P2buffer size
P3access mode to
probe itemlist
P4(zero)
P5itemlist buffer
address
P6itemlist buffer
size
IO$M_EXTEND2
IO$_WRITEVBLK
IO$_WRITELBLK
IO$_WRITEPBLK
P1buffer address
P2buffer size
P3(ignored)
P4carriage control
specifier3
IO$M_CANCTRLO
IO$M_ENABLMBX
IO$M_NOFORMAT
IO$M_REFRESH
IO$M_BREAKTHRU
IO$_SETMODE
IO$_SETCHAR
P1characteristics
buffer address
P2characteristics
buffer size
P3speed specifier
P4fill specifier
P5parity flags
IO$_SETMODE
IO$_SETCHAR
None
IO$M_HANGUP
IO$_SETMODE
P1buffer address
P2buffer size
IO$M_BRDCST
IO$_SETMODE
IO$_SETCHAR
P1AST service
routine address
P2AST parameter
P3access mode to
deliver AST
IO$M_CTRLCAST
IO$M_CTRLYAST
IO$_SETMODE
IO$_SETCHAR
P1AST service
routine address
P2character mask
address
P3access mode to
deliver AST
IO$M_OUTBAND
IO$M_TT_ABORT4
IO$M_INCLUDE4
1 Only
for IO$_READPROMPT
2 Only
3 Only
4 Only
with IO$M_OUTBAND
Arguments
Modifiers
IO$_SETMODE
IO$_SETCHAR
P1address of
control signals
IO$M_SET_MODEM5
IO$M_MAINT
IO$_SETMODE
IO$_SETCHAR
None
IO$M_LOOP5
IO$M_UNLOOP5
IO$M_MAINT
IO$_TTY_PORT
IO$M_LT_CONNECT
IO$M_LT_DISCON
IO$_TTY_PORT
P1itemlist6
address
P2queued status
IO$M_LT_MAP_PORT
IO$_TTY_PORT
P1service name
descriptor
address
P2service rating
IO$M_LT_RATING
IO$_TTY_PORT
P1itemlist
address
P2itemlist
length
P3entity type
P4entity string
descriptor
IO$M_LT_SENSEMODE
IO$_TTY_PORT
P1itemlist
address
P2itemlist
length
P3entity type
P4entity string
descriptor
IO$M_LT_SETMODE
IO$_SENSEMODE
IO$_SENSECHAR
P1characteristics
buffer address
P2characteristics
buffer size
IO$M_TYPEAHDCNT
IO$_SENSEMODE
IO$_SENSECHAR
P1address of input
modem signal
block
IO$M_RD_MODEM
IO$_SENSEMODE
P1buffer address
P2buffer size
IO$M_BRDCST
5 Only
with IO$M_MAINT
6 Itemlist:
SS$_BADESCAPE
SS$_BADPARAM
SS$_CANCEL
SS$_CHANINTLK
SS$_CONTROLC
SS$_CONTROLO
SS$_CONTROLY
SS$_DATAOVERUN
SS$_INCOMPAT
SS$_NORMAL
SS$_PARITY
SS$_PARTESCAPE
SS$_TIMEOUT
Arguments
Modifiers
IO$_READLBLK
IO$_READVBLK
IO$_READPBLK
IO$_WRITELBLK
IO$_WRITEVBLK
IO$_WRITEPBLK
P1buffer address
P2buffer size
P4802 format fields (optional)3
P5destination address (optional)3
IO$M_NOW1
IO$M_RESPONSE2
IO$_SETMODE
IO$_SETCHAR
IO$M_CTRL
IO$M_STARTUP
IO$M_SHUTDOWN
IO$_SETMODE
IO$_SETCHAR
IO$M_ATTNAST
IO$_SENSEMODE
IO$_SENSECHAR
IO$M_CTRL
1 Only
2 Only
3 See
4 Use
only with IO$M_CTRL alone or with IO$_STARTUP, that is, the set controller mode
SS$_ACCVIO
SS$_BADPARAM
SS$_BUFFEROVF
SS$_COMMHARD
SS$_CTRLERR
SS$_DATACHECK
SS$_DATAOVERUN
SS$_DEVACTIVE
SS$_DEVALLOC
SS$_DEVINACT
SS$_DEVOFFLINE
SS$_DEVREQERR
SS$_DISCONNECT
SS$_DUPUNIT
SS$_ENDOFFILE
SS$_EXQUOTA
SS$_INSFMEM
SS$_INSFMAPREG
SS$_IVBUFLEN
SS$_MEDOFL
SS$_NOPRIV
SS$_NORMAL
SS$_OPINCOMPL
SS$_TIMEOUT
SS$_TOOMUCHDATA
Arguments
IO$_READVBLK
IO$_READLBLK
IO$_WRITEVBLK
IO$_WRITELBLK
Arguments
Modifiers
IO$_SETPRFPATH
P1CPU mask
None
IO$M_PREFERRED_CPU
IO$M_SYS_ASSIGNABLE
B
IO$_DIAGNOSE Function for SCSI Class
Drivers
As of OpenVMS Version 7.0, the $QIO IO$_DIAGNOSE function has been
enhanced to support 64-bit addressing for the following SCSI class drivers:
GKDRIVER, DKDRIVER, and MKDRIVER. This means that the virtual
addresses specified within the S2DGB may now be 64-bit virtual addresses if the
user application requests it.
The $QIO IO$_DIAGNOSE arguments are still as follows:
Argument
Use
P1
P2
S2DGB length
P3
P4
P5
P6
The SCSI Diagnose Buffer (S2DGB) defined in STARLET now allows two formats,
one for 32-bit addressing and one for 64-bit addressing. The 32-bit format is
identical to the one supported on OpenVMS Alpha Version 6.2.
Figure B1 shows the 32-bit S2DGB format. Figure B2 shows the 64-bit S2DGB
format.
:00
S2DGB$L_FLAGS
:04
S2DGB$L_32CDBADDR
:08
S2DGB$L_32CDBLEN
:0C
S2DGB$L_32DATADDR
:10
S2DGB$L_32DATLEN
:14
S2DGB$L_32PADCNT
:18
S2DGB$L_32PHSTMO
:1C
S2DGB$L_32DSCTMO
:20
S2DGB$L_32SENSEADDR
:24
S2DGB$L_32SENSELEN
:28
:2C
Reserved
:30
Should Be Zero
:34
:38
ZK8486AGE
:00
S2DGB$L_FLAGS
:04
S2DGB$PQ_64CDBADDR
:08
S2DGB$PQ_64DATADDR
:10
S2DGB$PQ_64SENSEADDR
:18
S2DGB$L_64CDBLEN
:20
S2DGB$L_64DATLEN
:24
S2DGB$L_64SENSELEN
:28
S2DGB$L_64PADCNT
:2C
S2DGB$L_64PHSTMO
:30
S2DGB$L_64DSCTMO
:34
:38
ZK8487AGE
A user application must specify which one of the two S2DGB formats is
to be used by passing a format value in S2DGB$L_OPCODE. Specifically,
S2DGB$L_OPCODE must be assigned a value of either OP_XCDB32 (= 1) to
request 32-bit format, or OP_XCDB64 (= 2) to request 64-bit format. Once the
value of OP_XCDB64 has been specified, the user application is obligated to use
the 64-bit S2DGB format and, in particular, to use the 64-bit names for S2DGB
fields as described below. Likewise, an opcode value of OP_XCDB32 obligates the
user application to use the 32-bit names for the fields.
The correct length of the structure is defined by the constant S2DGB$K_
XCDB32_LENGTH (value: 60-decimal), as well as by the constant S2DGB$K_
XCDB64_LENGTH (value: 60-decimal).
The fields in the S2DGB are in the sections that follow. Whenever a field has two
different names for the 32-bit and 64-bit cases, the 32-bit name is given first,
and the 64-bit name is given after it in parentheses. Also, except for fields that
contain addresses, all fields are unsigned longwords.
S2DGB$L_OPCODE
This field should contain either S2DGB$K_OP_XCDB32 or S2DGB$K_OP_
XCDB64, depending on whether the user application intends to supply 32-bit
virtual addresses or 64-bit virtual addresses, respectively, in the other fields of
the S2DGB.
IO$_DIAGNOSE Function for SCSI Class Drivers B3
S2DGB$L_FLAGS
This field should contain the bit fields shown in the following table. Note
that these bit definitions start at bit 0 and omit no bits. This is required for
compatibility with the IO$_DIAGNOSE interface available in OpenVMS Alpha
Version 6.1 and earlier.
Table B1 S2DGB$L_FLAGS Bit Fields
Bit Field
Description
S2DGB$V_READ
S2DGB$V_DISCPRIV
This bit should contain the DiscPriv bit value to be used in the IDENTIFY
message sent with this operation. If S2DGB$V_TAGGED_REQ is 1, then
this bit is ignored. Note that S2DGB$V_DISCPRIV may be ignored by
some ports unconditionally.
S2DGB$V_SYNCHRONOUS
This bit is ignored because its value is beyond the control of the user in
SCSI-2 drivers.
S2DGB$V_OBSOLETE1
S2DGB$V_TAGGED_REQ
Description
S2DGB$V_AUTOSENSE
S2DGB$L_32CDBADDR (S2DGB$PQ_64CDBADDR)
This field should contain the 32-bit (or 64-bit) virtual address of the SCSI
command data block (CDB) to be sent to the target by this IO$_DIAGNOSE
operation.
Note that S2DGB$L_32CDBADDR is a pointer to a longword, while S2DGB$PQ_
64CDBADDR is a pointer to a quadword.
S2DGB$L_32CDBLEN (S2DGB$L_64CDBLEN)
This field should contain the number of bytes in the SCSI command data block
(CDB) to be sent to the target by this IO$_DIAGNOSE operation. (Legal
values: 2 to 248; however, some ports may restrict CDBs to smaller lengths.
Recommended values: 2 to 16.)
S2DGB$L_32DATADDR (S2DGB$PQ_64DATADDR)
This field should contain the 32-bit (or 64-bit) virtual address of the DATAIN or
DATAOUT buffer to be used with this SCSI operation. If the CDB being sent to
the target does not use a DATAIN or DATAOUT buffer, then this field should be
zero.
Note that S2DGB$L_32DATADDR is a pointer to a longword, while S2DGB$PQ_
64DATADDR is a pointer to a quadword.
S2DGB$L_32DATLEN (S2DGB$L_64DATLEN)
This field should contain the number of bytes in the DATAIN or DATAOUT buffer
associated with this operation. If the CDB being sent to the target does not use a
DATAIN or DATAOUT buffer, then this field should be zero. (Legal values: 0 to
UCB$L_MAXBCNT. Recommended values: 0 to 65,536. All ports are required to
support at least 65,536 byte data transfers.)
S2DGB$L_32PADCNT (S2DGB$L_64PADCNT)
This field should contain the number of padding DATAIN or DATAOUT bytes
required by this operation. If S2DGB$V_TAGGED_REQ is 1, then the PAD count
value will not be its default value. (Legal values: 0 to the maximum number of
bytes in a disk block on this system minus one. Current legal values: 0 to 511.)
S2DGB$L_32PHSTMO (S2DGB$L_64PHSTMO)
This field should contain the number of seconds that the port driver should
wait for a phase transition to occur or for delivery of an expected interrupt. If
S2DGB$V_ TAGGED_REQ is 1 or this field contains a 0 or 1, then the current
phase transition timeout setting will not be changed. (Legal values: 0 to 65,535
[about 18 hours].)
IO$_DIAGNOSE Function for SCSI Class Drivers B5
S2DGB$L_32DSCTMO (S2DGB$L_64DSCTMO)
This field should contain the number of seconds that the port driver should wait
for a disconnected transaction to reconnect. If S2DGB$V_TAGGED_REQ is 1 or
this field contains a 0 or 1, then the current disconnect timeout setting will not be
changed. (Legal values: 0 to 65,535 [about 18 hours].)
S2DGB$L_32SENSEADDR (S2DGB$PQ_64SENSEADDR)
If S2DGB$V_AUTOSENSE is 1, then this field should contain the 32-bit (or
64-bit) virtual address of the sense buffer to be used by this SCSI operation. If
S2DGB$V_AUTOSENSE is 0, this field will be ignored.
Note that S2DGB$L_32SENSEADDR is a pointer to a longword, while
S2DGB$PQ_64SENSEADDR is a pointer to a quadword.
S2DGB$L_32SENSELEN (S2DGB$L_64SENSELEN)
If S2DGB$V_AUTOSENSE is 1, then this field should contain the number of
bytes in the sense buffer associated with this operation. (Legal values: 0 to
255. Note that a value of 0 instructs the class driver to discard any sense data
received. Recommended value: 18. Some ports may restrict the number of sense
bytes to 18.) If S2DGB$V_AUTOSENSE is 0, this field will be ignored.
The following example shows how to set up a 64-bit S2DGB:
#include <s2dgbdef.h>
#include <far_pointers.h>
/* Define S2DGB */
/* Define VOID_PQ */
S2DGB diag_desc;
/* Set up some default S2DGB descriptor values */
diag_desc.s2dgb$l_opcode = OP_XCDB64
/* Use 64-bits */
diag_desc.s2dgb$l_flags = (S2DGB$M_READ |
/* Flags*/
S2DGB$M_TAGGED_REQ |
S2DGB$M_AUTOSENSE);
diag_desc.s2dgb$v_tag = S2DGB$K_SIMPLE;
/* SIMPLE que tag */
diag_desc.s2dgb$pq_64cdbaddr = (VOID_PQ)(&cdb[0]);/* Command addr */
diag_desc.s2dgb$l_64cdblen = 6;
/* Command length */
diag_desc.s2dgb$pq_64dataddr = (VOID_PQ)(&buf[0]);/* Data addr
*/
diag_desc.s2dgb$l_64datlen = 20;
/* Data length
*/
diag_desc.s2dgb$l_64padcnt = 0;
/* Pad length
*/
diag_desc.s2dgb$l_64phstmo = 20;
/* Phase timeout */
diag_desc.s2dgb$l_64dsctmo = 10;
/* Disc timeout */
diag_desc.s2dgb$pq_64senseaddr = (VOID_PQ)(&asn[0]);/* Autosense addr */
diag_desc.s2dgb$l_64senselen = 255;
/* Sense length */
diag_desc.s2dgb$l_reserved_1 = 0;
/* Reserved
*/
.
.
.
status = sys$qiow(0, target_chan, IO$_DIAGNOSE, &iosb, 0, 0,
&diag_desc, S2DGB$K_XCDB64_LENGTH, 0, 0, 0, 0);
If all arguments are valid, the class driver will invoke the necessary port
functions to send the CDB, transfer the data, and return, save or discard sense
data as defined by the input S2DGB. Upon completion, the return IOSB will have
the following format:
Byte count <15:0>
SCSI status
Zero
:00
:04
ZK8488AGE
C
Tables
This appendix includes tables for the DEC Multinational character set and for
terminal escape sequences and modes.
Octal Code
Decimal
Code
Char or
Abbrev.
Description
000
000
NUL
null character
01
001
001
SOH
02
002
002
STX
03
003
003
ETX
04
004
004
EOT
05
005
005
ENQ
enquiry (Ctrl/E)
06
006
006
ACK
acknowledge (Ctrl/F)
07
007
007
BEL
bell (Ctrl/G)
08
010
008
BS
backspace (Ctrl/H)
09
011
009
HT
0A
012
010
LF
0B
013
011
VT
0C
014
012
FF
0D
015
013
CR
0E
016
014
SO
0F
017
015
SI
shift in (Ctrl/O)
10
020
016
DLE
11
021
017
DC1
12
022
018
DC2
1 The
ALTMODE and DELETE characters (decimal 125, 126, and 127) are also control characters.
Tables C1
Tables
C.1 DEC Multinational Character Set
Table C1 (Cont.) DEC Multinational Character Set
Hex Code
Octal Code
Decimal
Code
Char or
Abbrev.
Description
023
019
DC3
14
024
020
DC4
15
025
021
NAK
16
026
022
SYN
17
027
023
ETB
18
030
024
CAN
cancel (Ctrl/X)
19
031
025
EM
1A
032
026
SUB
substitute (Ctrl/Z)
1B
033
027
ESC
escape
1C
034
028
FS
file separator
1D
035
029
GS
group separator
1E
036
030
RS
record separator
1F
037
031
US
unit separator
040
032
SP
space
21
041
033
exclamation point
22
042
034
"
23
043
035
number sign
24
044
036
dollar sign
25
045
037
percent sign
26
046
038
&
ampersand
27
047
039
28
050
040
opening parenthesis
29
051
041
closing parenthesis
2A
052
042
asterisk
2B
053
043
plus
2C
054
044
comma
2D
055
045
hyphen or minus
2E
056
046
2F
057
047
slash
30
060
048
zero
31
061
049
one
32
062
050
two
33
063
051
three
1 The
ALTMODE and DELETE characters (decimal 125, 126, and 127) are also control characters.
C2 Tables
Tables
C.1 DEC Multinational Character Set
Table C1 (Cont.) DEC Multinational Character Set
Decimal
Code
Char or
Abbrev.
Hex Code
Octal Code
Description
34
064
052
four
35
065
053
five
36
066
054
six
37
067
055
seven
38
070
056
eight
39
071
057
nine
3A
072
058
colon
3B
073
059
semicolon
3C
074
060
<
less than
3D
075
061
equals
3E
076
062
>
greater than
3F
077
063
question mark
100
064
commercial at sign
41
101
065
uppercase A
42
102
066
uppercase B
43
103
067
uppercase C
44
104
068
uppercase D
45
105
069
uppercase E
46
106
070
uppercase F
47
107
071
uppercase G
48
110
072
uppercase H
49
111
073
uppercase I
4A
112
074
uppercase J
4B
113
075
uppercase K
4C
114
076
uppercase L
4D
115
077
uppercase M
4E
116
078
uppercase N
4F
117
079
uppercase O
50
120
080
uppercase P
51
121
081
uppercase Q
52
122
082
uppercase R
53
123
083
uppercase S
54
124
084
uppercase T
55
125
085
uppercase U
(continued on next page)
Tables C3
Tables
C.1 DEC Multinational Character Set
Table C1 (Cont.) DEC Multinational Character Set
Hex Code
Octal Code
Decimal
Code
Char or
Abbrev.
56
126
086
uppercase V
57
127
087
uppercase W
58
130
088
uppercase X
59
131
089
uppercase Y
5A
132
090
uppercase Z
5B
133
091
left bracket
5C
134
092
backslash
5D
135
093
right bracket
5E
136
094
circumflex
5F
137
095
underscore
60
140
096
grave accent
61
141
097
lowercase a
62
142
098
lowercase b
63
143
099
lowercase c
64
144
100
lowercase d
65
145
101
lowercase e
66
146
102
lowercase f
67
147
103
lowercase g
68
150
104
lowercase h
69
151
105
lowercase i
6A
152
106
lowercase j
6B
153
107
lowercase k
6C
154
108
lowercase l
6D
155
109
lowercase m
6E
156
110
lowercase n
6F
157
111
lowercase o
70
160
112
lowercase p
71
161
113
lowercase q
72
162
114
lowercase r
73
163
115
lowercase s
74
164
116
lowercase t
75
165
117
lowercase u
76
166
118
lowercase v
77
167
119
lowercase w
78
170
120
lowercase x
79
171
121
lowercase y
Description
C4 Tables
Tables
C.1 DEC Multinational Character Set
Table C1 (Cont.) DEC Multinational Character Set
Hex Code
Octal Code
Decimal
Code
Char or
Abbrev.
7A
172
122
lowercase z
7B
173
123
left brace
7C
174
124
vertical line
7D
175
125
7E
176
126
tilde (ALTMODE)
7F
177
127
DEL
rubout (DELETE)
80
200
128
[reserved]
81
201
129
[reserved]
82
202
130
[reserved]
83
203
131
[reserved]
84
204
132
IND
index
85
205
133
NEL
next line
86
206
134
SSA
87
207
135
ESA
88
210
136
HTS
89
211
137
HTJ
8A
212
138
VTS
8B
213
139
PLD
8C
214
140
PLU
partial line up
8D
215
141
RI
reverse index
Description
8E
216
142
SS2
single shift 2
8F
217
143
SS3
single shift 3
90
220
144
DCS
91
221
145
PU1
private use 1
92
222
146
PU2
private use 2
93
223
147
STS
94
224
148
CCH
cancel character
95
225
149
MW
message waiting
96
226
150
SPA
97
227
151
EPA
98
230
152
[reserved]
99
231
153
[reserved]
9A
232
154
[reserved]
9B
233
155
CSI
9C
234
156
ST
string terminator
9D
235
157
OSC
Tables C5
Tables
C.1 DEC Multinational Character Set
Table C1 (Cont.) DEC Multinational Character Set
Hex Code
Octal Code
Decimal
Code
Char or
Abbrev.
9E
236
158
PM
privacy message
9F
237
159
APC
application
A0
240
160
[reserved]
A1
241
161
A2
242
162
cent sign
A3
243
163
pound sign
A4
244
164
[reserved]
A5
245
165
yen sign
A6
246
166
[reserved]
A7
247
167
section sign
A8
250
168
A9
251
169
copyright sign
AA
252
170
AB
253
171
AC
254
172
[reserved]
AD
255
173
[reserved]
AE
256
174
[reserved]
AF
257
175
[reserved]
B0
260
176
degree sign
B1
261
177
plus/minus sign
B2
262
178
superscript 2
B3
263
179
superscript 3
B4
264
180
[reserved]
B5
265
181
micro sign
B6
266
182
B7
267
183
middle dot
B8
270
184
[reserved]
B9
271
185
superscript 1
BA
272
186
BB
273
187
Description
BC
274
188
fraction one-quarter
BD
275
189
fraction one-half
BE
276
190
[reserved]
BF
277
191
C0
300
192
C6 Tables
Tables
C.1 DEC Multinational Character Set
Table C1 (Cont.) DEC Multinational Character Set
Hex Code
Octal Code
Decimal
Code
Char or
Abbrev.
C1
301
193
C2
302
194
C3
303
195
C4
304
196
C5
305
197
C6
306
198
uppercase AE diphthong
C7
307
199
C8
310
200
C9
311
201
CA
312
202
CB
313
203
CC
314
204
CD
315
205
CE
316
206
CF
317
207
D0
320
208
[reserved]
D1
321
209
D2
322
210
D3
323
211
D4
324
212
D5
325
213
D6
326
214
D7
327
215
uppercase OE ligature
D8
330
216
D9
331
217
DA
332
218
DB
333
219
Description
Tables C7
Tables
C.1 DEC Multinational Character Set
Table C1 (Cont.) DEC Multinational Character Set
Hex Code
Octal Code
Decimal
Code
Char or
Abbrev.
DC
334
220
DD
335
221
DE
336
222
[reserved]
DF
337
223
E0
340
224
E1
341
225
E2
342
226
E3
343
227
E4
344
228
E5
345
229
E6
346
230
lowercase ae diphthong
E7
347
231
E8
350
232
E9
351
233
EA
352
234
EB
353
235
EC
354
236
ED
355
237
EE
356
238
EF
357
239
F0
360
240
[reserved]
F1
361
241
F2
362
242
F3
363
243
F4
364
244
F5
365
245
F6
366
246
Description
C8 Tables
Tables
C.1 DEC Multinational Character Set
Table C1 (Cont.) DEC Multinational Character Set
Hex Code
Octal Code
Decimal
Code
Char or
Abbrev.
F7
367
247
lowercase oe ligature
F8
370
248
F9
371
249
FA
372
250
FB
373
251
FC
374
252
FD
375
253
FE
376
254
[reserved]
FF
377
255
[reserved]
Description
Valid Parameters
ANSICRT
DECCRT
AVO
EDIT
BLOCK1
All
CUB
All
CUD
All
CUF
All
CUP
All
CUU
All
DSR
0,3,5,6
ED
0,1,2
1 Terminal
Tables C9
Tables
C.2 Terminal Sequences and Modes
Table C2 (Cont.) Sequences and Modes
Name
Valid Parameters
ANSICRT
DECCRT
AVO
EDIT
BLOCK1
0,1,2
HVP
All
IND
NEL
RI
RIS
SCS
UK,ASCII,0
SCS
UK,ASCII
SGR
0,4,7
SGR
0,1,4,5,7
DA
Terminal specific
HTS
RM
Class specific
SM
Class specific
TBC
0,3
DCH
All
DL
All
IL
All
2,3
DECDWL
DECKPAM
DECKPNM
DECRC
DECSC
DECSTBM
All
DECSWL
DECPRO
0,1,4,5,7,254
DECTTC
0,1
DECXMIT
x
ANSI Selectable Modes (Set with ANSI SM/RM)
IRM
GATM
ERM
1 Terminal
x
x
x
C10 Tables
Tables
C.2 Terminal Sequences and Modes
Table C2 (Cont.) Sequences and Modes
Name
Valid Parameters
ANSICRT
DECCRT
AVO
EDIT
BLOCK1
16
x
DIGITAL Private Selectable Modes (Set with ANSI SM/RM)
DECCKM
DECANM
DECCOLM
DECSCLM
DECSCNM
DECOM
DECAWM
DECARM
DECEDM
10
DECEKEM
16
DECLTM
11
DECSCFDM
13
DECTEM
14
x
ANSI Assumed Modes
CRM
Reset
Reset
EBM
Reset
Reset
ERM
Set
Set
FEAM
Reset
Reset
FETM
Reset
Reset
GATM
N/A
N/A
HEM
N/A
N/A
IRM
Reset
Reset
KAM
Reset
Reset
MATH
N/A
N/A
PUM
Reset
Reset
SATM
N/A
N/A
SRTM
Reset
Reset
TSM
Reset
Reset
TTM
N/A
N/A
VEM
N/A
N/A
1 Terminal
2 Selectable
mode.
Tables C11
D
Control Connection Routines
This appendix lists and describes the calling conventions for the pseudoterminal
driver control connection routines. The routines appear in this section in
alphabetical order.
Table D1 lists the control connection routines and their functions:
Table D1 Control Connection Routines
Routine Name
Description
PTD$CANCEL
PTD$CREATE
Creates a pseudoterminal
PTD$DELETE
Deletes a pseudoterminal
PTD$READ
PTD$READW
PTD$SET_EVENT_NOTIFICATION
PTD$WRITE
Format
PTD$CANCEL chan
Returns
OpenVMS usage:
type:
access:
mechanism:
cond_value
longword (unsigned)
write only
by value
chan
OpenVMS usage:
type:
access:
mechanism:
channel
word (unsigned)
read only
by value
Arguments
Number of the I/O channel assigned to the pseudoterminal. This channel is only
intended to be used for PTD$XXX operations.
Return Values
SS$_NORMAL
SS$_DEVOFFLINE
SS$_IVCHAN
SS$_NOPRIV
PTD$CREATECreate a Pseudoterminal
Creates a new pseudoterminal with a unique device name.
Format
PTD$CREATE chan [,acmode] [,charbuff] [,buflen] [,astadr] [,astprm] [,ast_acmode], inadr
Returns
OpenVMS usage: cond_value
type:
longword (unsigned)
access:
write only
mechanism:
by value
Arguments
chan
OpenVMS usage:
type:
access:
mechanism:
channel
word (unsigned)
write only
by reference
access_mode
longword (unsigned)
read only
by value
Access mode to be associated with the channel. The most privileged access mode
is the access mode of the caller. I/O operations on the channel can be performed
only from equal and more privileged access modes.
charbuff
OpenVMS usage:
type:
access:
mechanism:
device_characteristics
longword (unsigned)
read only
by reference
Page Width
Page Length
Type
Class
buflen
OpenVMS usage:
type:
access:
mechanism:
word_unsigned
word (unsigned)
read only
by value
Length of the characteristics buffer (either 12, 16, or 20 bytes). This argument is
required if you supply the charbuff argument.
astadr
OpenVMS usage:
type:
access:
mechanism:
ast_procedure
procedure value
call without stack unwinding
by reference
AST service routine to be executed when the terminal connection deassigns the
last channel to the pseudoterminal. This argument is the procedure value of this
routine. This is a repeating AST and is active until the control connection deletes
the pseudoterminal.
astprm
OpenVMS usage:
type:
access:
mechanism:
user_arg
longword (unsigned)
read only
by value
access_mode
longword (unsigned)
read only
by value
Access mode for which the AST is to be declared. The most privileged access
mode is the access mode of the caller. The resulting mode is the access mode at
which the AST is declared.
inadr
OpenVMS usage:
type:
access:
mechanism:
address_range
longword (unsigned)
read only
by reference
Description
PTD$CREATE creates a new pseudoterminal with a unique device name. This
device name is in the form FTAn:, where n is the unit number.
When a pseudoterminal is created, it inherits the current system terminal default
attributes unless you specify an alternate set of characteristics.
Return Values
SS$_NORMAL
SS$_ACCVIO
SS$_BADPARAM
SS$_EXBYTLM
SS$_EXQUOTA
SS$_EXASTLM
SS$_INSFMEM
SS$_INSFWSL
SS$_IVSECFLG
SS$_NOPRIV
SS$_PAGOWNVIO
SS$_VA_IN_USE
PTD$DELETEDelete a Pseudoterminal
Forces the pseudoterminal to be deleted and frees the channel.
Format
PTD$DELETE chan
Returns
OpenVMS usage: longword (unsigned)
type:
write only
access:
by value
Arguments
chan
OpenVMS usage:
type:
access:
mechanism:
channel
word (unsigned)
read only
by value
Number of the I/O channel assigned to the pseudoterminal. This channel is only
intended to be used for PTD$XXX operations.
Description
PTD$DELETE forces the pseudoterminal to be deleted and frees the channel
assigned to the pseudoterminal. When a pseudoterminal is deleted, any process
using the pseudoterminal (except the control program) is disconnected. A
PTD$DELETE request causes any pending I/O for the control program to be
aborted. It deletes any queued event notification ASTs and returns the I/O
buffers back to the application. It also causes the pseudoterminal unit control
block (UCB) to be deleted once the reference count returns to zero.
Return Values
SS$_NORMAL
SS$_DEVOFFLINE
SS$_IVCHAN
SS$_NOPRIV
Format
PTD$READ [efn], chan [,astadr] [,astprm] readbuf, readbuf_len
Returns
OpenVMS usage: longword (unsigned)
type:
write only
access:
by value
Arguments
efn
OpenVMS usage:
type:
access:
mechanism:
ef_number
longword (unsigned)
read only
by value
Number of the event flag to be set when PTD$READ returns the requested
information. If you do not specify this argument, event flag 0 is used. When
PTD$READ begins execution, it clears this flag.
chan
OpenVMS usage:
type:
access:
mechanism:
channel
word (unsigned)
read only
by value
Number of the I/O channel assigned to the pseudoterminal. This channel is only
intended to be used for PTD$XXX operations.
astadr
OpenVMS usage:
type:
access:
mechanism:
ast_procedure
procedure value
call without stack unwinding
by reference
user_arg
longword (unsigned)
read only
by value
AST parameter to be passed to the AST service routine specified by the astadr
argument.
readbuf
OpenVMS usage:
type:
access:
mechanism:
char_string
character coded text string
write only
by reference
Address of the read I/O status longword. The first character position in an I/O
buffer to receive all output is this address plus 4. The readbuf argument must
be in the range specified in the inadr argument of the PTD$CREATE routine;
otherwise, an SS$_ACCVIO status is returned.
readbuf_len
OpenVMS usage:
type:
access:
mechanism:
word_unsigned
word (unsigned)
read only
by value
Number of characters that can be read from the pseudoterminal and stored in the
buffer specified by readbuf.
Description
The PTD$READ routine reads data from the pseudoterminal. The read request
completes with a minimum of one character and a maximum of the number of
characters specified by the readbuf_len argument. The read operation completes
when the pseudoterminal has characters to output. If a read request is issued
and no data is available, the read request is queued and then completed at a later
time.
Return Values
SS$_NORMAL
SS$_ACCVIO
SS$_DEVOFFLINE
SS$_EXASTLM
SS$_ILLEFC
SS$_INSFMEM
SS$_IVBUFLEN
SS$_IVCHAN
SS$_NOPRIV
SS$_UNASEFC
Format
PTD$READW [efn], chan [,astadr] [,astprm] readbuf, readbuf_len
Format
PTD$SET_EVENT_NOTIFICATION chan, astadr [,astprm] [,acmode], type
Returns
OpenVMS usage: longword (unsigned)
type:
write only
access:
by value
Arguments
chan
OpenVMS usage:
type:
access:
mechanism:
channel
word (unsigned)
read only
by value
Number of the I/O channel assigned to the pseudoterminal. This channel is only
intended to be used for PTD$XXX operations.
astadr
OpenVMS usage:
type:
access:
mechanism:
ast_procedure
procedure value
call without stack unwinding
by reference
user_arg
longword (unsigned)
read only
by value
AST parameter to be passed to the AST service routine specified by the astadr
argument.
acmode
OpenVMS usage:
type:
access:
mechanism:
access_mode
longword (unsigned)
read only
by value
Access mode for which the AST is to be declared. The most privileged access
mode is the access mode of the caller. The resulting mode is the access mode at
which the AST is declared.
type_longword
longword (unsigned)
read only
by value
Value that indicates which notification AST to enable. The $PTDDEF macro
defines the symbolic names listed in Table D2.
Table D2 Symbolic Names Defined by $PTDDEF Macro
Symbolic Name
Description
PTD$C_SEND_XON
PTD$C_SEND_BELL
PTD$C_SEND_XOFF
PTD$C_STOP_OUTPUT
PTD$C_RESUME_OUTPUT
PTD$C_CHAR_CHANGED
PTD$C_ABORT_OUTPUT
PTD$C_START_READ
PTD$C_MIDDLE_READ
PTD$C_END_READ
PTD$C_ENABLE_READ
PTD$C_DISABLE_READ
Description
PTD$SET_EVENT_NOTIFICATION enables or disables the repeating terminal
event notification ASTs listed in Table D2. After an event notification AST is
enabled, it remains in effect until it is disabled or until the device is deleted.
SS$_DEVOFFLINE
SS$_EXASTLM
SS$_INSFMEM
SS$_IVCHAN
SS$_NOPRIV
Format
PTD$WRITE chan [,astadr] [,astprm], wrtbuf, wrtbuf_len [,echobuf] [,echobuf_len]
Returns
OpenVMS usage: longword (unsigned)
type:
write only
access:
by value
Arguments
chan
OpenVMS usage:
type:
access:
mechanism:
channel
word (unsigned)
read only
by value
ast_procedure
procedure value
call without stack unwinding
by reference
user_arg
longword (unsigned)
read only
by value
AST parameter to be passed to the AST service routine specified by the astadr
argument.
wrtbuf
OpenVMS usage:
type:
access:
mechanism:
char_string
character coded text string
read only
by reference
Address of the write I/O status longword. The first character in an I/O buffer to
be written is this address plus 4. The wrtbuf must be in the range specified by
the inadr argument of the PTD$CREATE routine; otherwise, an SS$_ACCVIO
status is returned.
word_unsigned
word (unsigned)
read only
by value
char_string
character coded text string
write only
by reference
Address of the echo I/O status longword. The first character position in an I/O
buffer to receive all output is this address plus 4. The echobuf must be in the
range specified by the inadr argument of the PTD$CREATE routine; otherwise
an SS$_ACCVIO status is returned.
echobuf_len
OpenVMS usage:
type:
access:
mechanism:
word_unsigned
word (unsigned)
read only
by value
Number of characters that can be read from the pseudoterminal. If an echo buffer
is specified, up to echobuf_len characters can be stored in it.
Description
PTD$WRITE inputs data to the pseudoterminal and reads any immediately
echoed characters. PTD$WRITE allows you to specify a buffer to receive any
output generated by the write; you do not need to issue a separate read request
to read this data.
Return Values
SS$_NORMAL
SS$_ACCVIO
SS$_DATALOST
SS$_DATAOVERUN
SS$_DEVOFFLINE
SS$_EXASTLM
SS$_INSFMEM
SS$_IVBUFLEN
SS$_IVCHAN
SS$_NOPRIV
Index
A
ACP functions, 12, 135
attributes, 115 to 118
disk quotas, 137
IO$_ACCESS, 17, 110, 114, 127
IO$_ACPCONTROL, 17
IO$_CREATE, 110, 111, 114, 125
IO$_DEACCESS, 113, 114, 129
IO$_DELETE, 17, 130
IO$_MODIFY, 17, 111, 113, 114, 129
IO$_MOUNT, 135
magnetic tape positioning, 136
miscellaneous disk, 136
quota file transfer block, 138
ACP-QIO interface
See also FIBs
access file function, 127
access subfunction, 110
ACP control function, 135
ANSI standard, 12, 136
arguments, 12
disk quota, 139
attribute control block, 114
attributes, 115 to 118
attributes statistics block, 122
BLISS-32 programming, 11
create file function, 125
disk, 126
magnetic tape, 127
deaccess file function, 129
delete file function, 130
description, 11
directory entries, 19, 127
file characteristics, 118
function codes, A1
function modifiers, 12
IO$M_ACCESS, 110, 125, 127
IO$M_CREATE, 125, 126, 127
IO$M_DELETE, 125, 126, 131
IO$M_DMOUNT, 135, 137
I/O operations, 11
I/O status block, 139
MACRO programming, 11
movefile subfunction, 131
record attributes area, 121
values, 121
Index1
Autoconfiguration
of SCSI device, 88
B
Baud rate
of terminal, 543
64-bit virtual addressing
device driver support, xx
Booting, 936
Broadcast and unknown server (BUS), 933
Broadcast messages, 518, 522, 524, 550
Buffered I/O
quota, 228, 310, 45
C
Caches
tape, 35
write-back volatile, 35
Carriage control, 539
CD-ROM (compact disc read-only memory)
storing data and audio information, 25
Characters
terminator set for, 530
Character sets
See also DEC Multinational character set
terminal lowercase, 521, C1
Classical IP, 934
Classical IP over ATM, 932
Compact discs
See CD-ROM (compact disc read-only memory)
Configuring
Ethernet media type, 944
Configuring ISA devices, 943 to 944
CONNECT command, 518
Console configuring
Ethernet media type, 944
Console disks
See RX01 console disk
Console terminals, 51
Control characters
list, C1
terminal, 54 to 57, 510
Control connection routines, D1 to D14
PTD$CANCEL, D2
PTD$CREATE, D3
PTD$DELETE, D6
PTD$READ, D7
PTD$READW, D9
PTD$SET_EVENT_NOTIFICATION, D10
PTD$WRITE, D13
Control key sequences, 58
Create file function, 125
directory entry creation, 127
Index2
D
Data
storing with audio information on CD-ROM,
225
Data checks
disk, 212, 233, 234
magnetic tape, 36, 314, 316
Data transfer mode
as controlled by the generic SCSI class driver,
86, 812
asynchronous, 86, 812
synchronous, 86, 812
DE500-AA adapter, 96
DE500-BA adapter, 96
DE500-FA adapter, 96
DE500 LAN controllers, 96
DE500-XA adapter, 96
DE600 adapter, 97
Deaccess file function, 129
DEC Multinational character set, C1
DEGPA Gigabit Ethernet NIC, 98
DEGPA internal counters, 98
DEGXA Gigabit Ethernet NIC, 921
DEGXA internal counters, 922
Delete file function, 130
Delete key, 55
Device characteristics
disk, 226
LAN drivers, 960
magnetic tape, 38
mailbox, 44
pseudoterminal, 63
terminal, 520
Devices
SCSI support, 72
supported, 72
Device-specific functions, 931
DHU11 device, 51
DHV11 device, 51
Dialup lines, 513
Digital private escape sequence, C9
Digital Storage Architecture disks
See DSA disks
Direct I/O
count process limit, 228, 310
Directory entry
creation, 127
protection, 19
Directory lookup subfunction, 17
directory entry protection, 19
Disks (contd)
RA90, 23
RB02 cartridge, 24
RC25, 24
RCT (replacement and caching table), 217
RD53, 24
RD54, 24
read function, 233
RF30, 25
RF31
failover, 211
RF70
failover, 211
RF71, 25
RK06 cartridge, 25
RK07 cartridge, 25
RL02 cartridge, 24
RM03, 25
RM05, 25
RP05, 25
RP06, 25
RP07, 25
RQDX3 controller, 23
RRD40 CD-ROM, 25
RRD50 CD-ROM, 25
RX02, 26
RX23 flexible, 27
RX33 flexible, 27
RX50 flexible, 27
RZ22, 27
RZ23, 27
RZ55, 27
SDI (standard disk interface), 23
search function, 235
sector translation, 215
seek operations, 213, 236
sense mode function, 235
set density function, 235
set preferred path function, 237
SII integral adapter, 23
skip sectoring, 214
status returns, A3
supported devices, 21 to 28
SYS$GETDVI returns, 226
TU58 magnetic tape, 27
data checks, 212
read function, 233
search function, 235
write check function, 237
write function, 234
UDA50 disk adapter, 21
unload function, 236
use with Verify utility, 216, 217
VAXstation 2000 and MicroVAX 2000 driver,
218
write check function, 236
write function, 234
Index3
E
ELAN configuring, 936
Enable attention AST function
LAN drivers, 981
End-of-file
See EOF
End-of-tape markers
See EOT markers
Index4
End-of-volume
See EOV
EOF (end-of-file)
status of magnetic tape, 315
write mailbox message, 411
EOT markers
status
magnetic tape, 315, 316, 319
EOV (end-of-volume)
detection on magnetic tape, 318
Error recovery
disk, 214
magnetic tape, 37
shadow set virtual unit driver, 74
Escape sequences
ANSI, C9
Digital private, C9
terminal, 57, 521
Ethernet
device drivers, 95
Ethernet media types
configuring from console, 944
Event notification
pseudoterminal, 66
Event statistics, 917
Extend subfunction, 111
F
Fandle, 104
Fast Ethernet, 96
Fast I/O
function codes, A8
system services, 101
Fast Path, 107
function codes, A9
Fast Path performance enhancement, 107
FDDI (Fiber Distributed Data Interface)
device drivers, 95
FDDI NIcs
PDQ chip, 932
FIBs (file information blocks), 13
See also ACP functions
access control, 110
contents, 14 to 16
descriptor, 12, 13
directory lookup, 17
disk quota, 137 to 138
extend control, 111
IO$_ACCESS, 128
IO$_ACPCONTROL, 135 to 138
IO$_CREATE, 125
IO$_DEACCESS, 129
IO$_DELETE, 131
IO$_MODIFY, 130
truncate control, 113
File characteristics
ACP-QIO attributes, 118
Fork delay debug data, 930
Form feeds
terminal, 522
Full-duplex mode, 510
Function codes
See also I/O functions
IO$_ACCESS, 127
IO$_ACPCONTROL, 135, 311
IO$_AVAILABLE, 236, 325
IO$_CREATE, 125
IO$_DEACCESS, 129
IO$_DELETE, 130
IO$_DSE, 324
IO$_FORMAT, 235
IO$_MODIFY, 129
IO$_PACKACK, 236
IO$_READLBLK, 233, 314, 45, 528, 962
IO$_READPBLK, 233, 314, 45, 962
IO$_READPROMPT, 528
IO$_READVBLK, 233, 314, 45, 528, 962
IO$_REWIND, 316
IO$_REWINDOFF, 319
IO$_SEARCH, 235
IO$_SEEK, 232, 236
IO$_SENSECHAR, 235, 579
IO$_SENSEMODE, 235, 319, 579, 987
IO$_SETCHAR, 320, 541, 968
IO$_SETMODE, 320, 541, 968
IO$_SETPRFPATH, 237
IO$_SKIPFILE, 317
IO$_SKIPRECORD, 318
IO$_UNLOAD, 236, 319
IO$_WRITECHECK, 236
IO$_WRITELBLK, 234, 316, 49, 538, 966
IO$_WRITEOF, 319
IO$_WRITEPBLK, 234, 316, 49, 538, 966
IO$_WRITEVBLK, 234, 316, 49, 538, 966
list of, A1
Function modifiers
for LAN driver, 965
IO$M_ACCESS, 125, 127, 311
IO$M_ATTNAST, 981
IO$M_BRDCST, 550, 582
IO$M_BREAKTHRU, 511, 539
IO$M_CANCTRLO, 55, 539
IO$M_CREATE, 125, 127, 311
IO$M_CTRL, 981, 987
IO$M_CTRLCAST, 545
IO$M_CTRLYAST, 56, 545
IO$M_CVTLOW, 529
IO$M_DATACHECK, 212, 233, 234, 36,
314, 316
IO$M_DELDATA, 234
IO$M_DELETE, 125, 131
IO$M_DMOUNT, 135
IO$M_DSABLMBX, 529
G
Generic SCSI class driver, 81 to 815
assigning a channel to, 89
flow of, 84
I/O status block returned by, 810
loading, 88
obtaining device information from, 813
programming example, 814 to 815
$QIO system service format for, 810 to 813
security considerations, 84
Generic SCSI descriptor
format of, 811 to 813
Gigabit Ethernet, 97
Gigabit Ethernet NIC
DEGXA, 921
Index5
H
Half-duplex mode, 510, 521
See also Duplex mode
Hangup function modifier
terminal
disconnecting a, 545
interaction with, 518, 525
Hardware
supported, 72
Hardware interrupts
preferred CPU, 107
Host coalescing state machine statistics, 929
Host commands statistics, 915
HSC40 disk controller, 22
HSC50 disk controller, 22
HSC70 disk controller, 22
HSC disk controllers, 22
HSC disks, 211
I
I/O buffers
pseudoterminal, 63
I/O drivers
LAN drivers, 92
I/O functions
ACP-QIO interface, 12
codes, A1
disk, 12, 228
for LAN driver, 961
list of, A1
magnetic tape, 12, 310
terminal, 527
I/O write operations
preventing data loss, 213
unsuccessful completion, 213
INITIALIZE command, 325
Intel Ethernet devices, 97
Interface counter statistics, 912
Internal MAC receive statistics, 919
Internal MAC transmit statistics, 921
Interrupt statistics, 917
Interrupt status block, 925
IO$M_ALLOWFAST modifier, 317
IO$M_LT_QUE_CHG_NOTIF
LAT $QIO Function Modifier, 578
IO$M_ROUTE functional modifier, 986
IO$M_SENSE_MAC
Used with IO$_SENSEMODE, 989
IO$M_SENSE_MAC functional modifier, 989
IO$M_SHOW_MAP
Used with IO$_SENSEMODE, 991
IO$M_SHOW_MAP functional modifier, 991
IO$M_SHOW_ROUTE
Used with IO$_SENSEMODE, 991
Index6
K
KDA50 disk controller, 22
KDB50 disk controller, 22
Keyboard control character, 54 to 57, 510
KFQSA adapter, 23
L
LANCP commands, 936
LAN drivers
addresses
destination, 962, 966
Ethernet, 939 to 941
hardware, 988
loopback assistance, 940
multicast, 939, 940, 962, 974
node, 939
physical, 939, 940, 962, 975, 988
port, 975
shared protocol destination, 971
source, 962
Token Ring, 941
AST access mode, 981
AST service routine address, 981
ATM, 95
attention AST, 981
buffer
receive, 962, 970
channel assignment, 938
characteristics
device, 960, 987
extended, 969 to 979, 988
controller mode, 971
CRC generation, 971
device characteristics, 960, 987
See also LAN, extended characteristics
driver service (802 format), 978
echo mode (DEUNA only), 972
error summary bits, 961
Ethernet, 95, 938, 939, 954
Ethernet packet format, 954
Index7
M
MAC counter statistics, 911
Magnetic tapes
function codes, A3
I/O functions
See ACP-QIO interface
status returns, A4
Mailboxes
See also Terminals
creating, 41
deleting, 43
device characteristics, 44
disable terminal, 522
driver, 41
function codes, 45, A5
function modifiers
IO$M_NORSWAIT, 49, 411
IO$M_NOW, 45, 49, 411, 413
IO$M_READATTN, 411
IO$M_READERCHECK, 49, 411, 415
IO$M_SETPROT, 414
IO$M_STREAM, 45
IO$M_WRITERCHECK, 45, 415
get mailbox information function, 415
I/O functions
IO$_READLBLK, 45
IO$_READPBLK, 45
IO$_READVBLK, 45
IO$_WRITELBLK, 49
IO$_WRITEOF, 411
IO$_WRITEPBLK, 49
IO$_WRITEVBLK, 49
I/O status block, 415
list of operations, 41
message format, 44
terminal, 519
message size, 41
permanent, 41, 43, 44
programming examples, 417
protection, 41, 44, 414
read attention AST function, 411
read function, 45
set attention AST function, 411
set protection function, 414
status returns, A5
SYS$GETDVI returns, 44
temporary, 41, 44
terminal/mailbox interaction, 518
volume protection, 414, 415
wait for writer/reader function, 414
write attention AST function, 411
write end-of-file message function, 411
write function, 49
Master adapter, 36
Index8
O
Out-of-band AST, 514, 549
P
Parity flag, 543
PASTHRU mode, 59, 511, 526, 529
PDQ chip
FDDI NICs, 932
Permanent mailboxes
See Mailboxes
Port access mode, 29
Ports
LAN configuration, 937
Port selection, 29
Protection
directory entry, 19
Pseudoterminals
canceling request, 62
control connection routines, D1
creating, 61
deleting, 62
device characteristics, 63
driver, 61
event notification, 66
features, 63
flow control, 65
I/O buffers, 63
programming example, 67
reading data, 64
using write with echo, 65
writing data, 65
PTD$CANCEL control connection routine, D2
PTD$CREATE control connection routine, D3
PTD$DELETE control connection routine, D6
Q
$QIO, 578
Quota file
transfer block, 139
Quotas
AST, 228, 310, 45, 412, 545
buffered I/O, 228, 310, 45
BYTELIM, 111
direct I/O, 228, 310
disk, 137 to 138
mailbox buffer, 41, 43, 45
R
RA60 disk, 23
RA70 disk, 23
RA90 disk, 23
Radix-50 encoding, 120
RADs support
See Resource Affinity Domains support
RB02 cartridge disk, 24
RC25 disk, 24
RD53 disk, 24
RD54 disk, 24
Read/write attributes subfunction, 114
Read attention AST function, 412
Receive list placement state machine statistics,
928
Receive MAC statistics, 926
Record attributes value, 121
Resource Affinity Domains (RADs) support, 1013
Return key, 57
Rewind offline function, 319
RF30 disk, 25
RF71 disk, 25
Ring statistics, 918
RK06 cartridge disk, 25
RK07 cartridge disk, 25
RL02 cartridge disk, 24
RM03 disk, 25
RM05 disk, 25
RP05 disk, 25
RP06 disk, 25
RP07 disk, 25
RQDX3 disk controller, 23
RTPAD component of SET HOST, 512
RX01 console disk, 26
RX02 diskette, 26
RX23 diskette, 27
RX33 diskette, 27
RX50 diskette, 27
RZ22 disk, 27
RZ23 disk, 27
RZ55 disk, 27
S
SCSI (Small Computer Systems Interface)
disk class driver, 219
disks
class driver, 218
error recovery, 214, 218
handling errors in audio applications, 223
hardware compliance, 72
$QIO interface to disk class driver, 220
SCSI class/port architecture, 82
SCSI class driver, 83
SCSI command
disabling retry, 87
enabling retry, 812
padding, when required, 813
setting disconnect timeout for, 88, 813
setting DMA timeout for, 88, 813
setting phase change timeout for, 88, 813
SCSI disconnect feature
enabling, 87
SCSI port driver, 82
SCSI_NOAUTO system parameter, 89
SDI (standard disk interface), 23
Sector translation, 215
Seek operation, 213
Send data initiator state machine statistics, 929
Sense tape mode function, 319
Serial line multiplexer, 51
Set attention AST
See Attention AST
SET HOST facility, 511
Set modes
magnetic tape, 320
mailbox, 411
Set Mac qualifier, 982
terminal, 541
SET TERMINAL command, 54, 519, 526
Setting characteristics
magnetic tape, 320
terminal, 541
Shadow set virtual unit driver, 71
functions, 72
hardware configurations, 72
SHDRIVER functions, 71
Shelving
determining if file is shelvable, 118
determining if file is shelved, 118
Index9
Index10
SS$_ENDOFTAPE return, A4
SS$_ENDOFVOLUME return, 318, A4
SS$_EXBYTLM return, A1
SS$_EXDISKQUOTA return, A1
SS$_EXQUOTA return, 415, A5, A8
SS$_FCPREADERR return, A1
SS$_FCPREWNDERR return, A1
SS$_FCPSPACERR return, A1
SS$_FCPWRITERR return, A1
SS$_FILELOCKED return, A1
SS$_FILENUMCHK return, A1
SS$_FILEPURGED return, A1
SS$_FILESEQCHK return, A1
SS$_FILESTRUCT return, A1
SS$_FILNOTEXP return, A1
SS$_FORCEDERR return, A3
SS$_FORMAT return, A3, A4
SS$_HANGUP return, 514
SS$_HEADERFULL return, A1
SS$_IBCERROR return, A1
SS$_IDXFILEFULL return, A1
SS$_ILLCNTRFUNC return, A1
SS$_ILLIOFUNC return, 415, 576, A3, A4,
A5
SS$_INCOMPAT return, A7
SS$_INSFMAPREG return, A8
SS$_INSFMEM return, 415, A5, A8
SS$_IVADDR return, A3
SS$_IVBUFLEN return, 967, A3, A8
SS$_MBFULL return, 42, 49, 415, A5
SS$_MBTOOSML return, 415, A5
SS$_MEDOFL return, A3, A4, A8
SS$_NODISKQUOTA return, A1
SS$_NOMOREFILES return, A1
SS$_NONEXDRV return, A3, A4
SS$_NOPRIV return, 414, 415, A2, A5, A8
SS$_NOQFILE return, A2
SS$_NOREADER return, A5
SS$_NORMAL return, 415, 576, A3, A4, A7,
A8
SS$_NOSUCHFILE return, A2
SS$_NOTAPEOP return, A2
SS$_NOTLABELMT return, A2
SS$_NOTPRINTED return, A2
SS$_NOTVOLSET return, A2
SS$_NOWRITER return, A5
SS$_OPINCOMPL return, 977, A3, A4, A8
SS$_OVRDSKQUOTA return, A2
SS$_PARITY return, A3, A4, A7
SS$_PARTESCAPE return, 58, 533, A7
SS$_QFACTIVE return, A2
SS$_QFNOTACT return, A2
SS$_RCT return, A3
SS$_RDDELDATA return, A3
SS$_SERIOUSEXCP return, A2, A4
SS$_SUPERSEDE return, A2
SS$_TAPEPOSLOST return, A2
SS$_TIMEOUT return, 530, 576, 977, A3,
A4, A7, A8
SS$_TOOMANYVER return, A2
SS$_TOOMUCHDATA return, A8
SS$_UNSAFE return, A3, A4
SS$_VOLINV return, A3, A4
SS$_WASECC return, A3
SS$_WRITLCK return, A2, A3, A4
SS$_WRONGACP return, A2
Statistics block, 926
Synchronous Digital Hierarchy (SDH), 936
Synchronous Optical Network (SONET), 936
Synchronous SCSI data transfer mode
enabling, 86, 812
SYS$ASSIGN routine, 41, 518, 577, 938
SYS$CREMBX system service, 41
SYS$DASSGN routine, 43, 938
SYS$DELMBX system service, 43
SYS$DISMOU system service, 137
SYS$EWDRIVER LAN driver, 944
SYS$GETDVI routine, 38
disk, 226
LAN drivers, 960
mailbox, 44
SCSI generic class driver, 813
terminal, 520
SYS$QIO routines
format for request to SCSI generic class driver,
810
SYS$QIO system service
interface to audio functions, 220
SYSGEN (System Generation utility)
See System Generation utility
System
console terminal, 51
System Generation utility (SYSGEN)
configuring SCSI devices, 88
System parameters
LAN_FLAGS, 936
T
Tabs
Ctrl/I, 57
terminal mechanical, 522
terminal tab stops, 538
Tape class drivers
disabling the loading of, 89
Tape marks, 315, 317, 318
Tapes
function codes, 310
function modifiers
IO$M_DATACHECK, 36, 314
IO$M_INHEXTGAP, 37
IO$M_INHRETRY, 37
IO$M_REVERSE, 314
I/O functions
Tapes
I/O functions (contd)
IO$_ACCESS, 311
IO$_ACPCONTROL, 136, 311
IO$_AVAILABLE, 325
IO$_CREATE, 311
IO$_DEACCESS, 311
IO$_DSE, 311, 324
IO$_FLUSH, 311
IO$_MODIFY, 311, 324
IO$_PACKACK, 325
IO$_READLBLK, 314
IO$_READPBLK, 314
IO$_READVBLK, 314
IO$_REWIND, 316
IO$_REWINDOFF, 319
IO$_SENSEMODE, 319
IO$_SETCHAR, 320
IO$_SETMODE, 320
IO$_SKIPFILE, 317
IO$_SKIPRECORD, 318
IO$_UNLOAD, 319
IO$_WRITELBLK, 316
IO$_WRITEOF, 319
IO$_WRITEPBLK, 316
IO$_WRITEVBLK, 316
modify function, 324
sense mode function, 319
status returns, 310
Temporary mailboxes, 44
Terminal characteristics, 521 to 526
Terminals
ANSI CRT terminal, 523
autobaud detection, 519, 523
baud rates, 519, 523, 543
bell (Ctrl/G), 59
broadcast messages, 518, 522, 524, 550
carriage control, 539
command line editing, 53, 538
command recall (Ctrl/B), 54, 56
control and data signals, 516
control characters, 54 to 57, 510, 528
numeric values, C1
control key sequences, 58
cursor movement, 53, 56, 523
delete character, 53
delete line (Ctrl/U), 55, 528
device characteristics, 520, 521
categories, 527
changing, 544
extended, 523
dialup
characteristic, 522
lines, 513, 525, 545
support, 513
Digital CRT terminal, 524, 525
discard output (Ctrl/O), 55, 528, 539
driver, 51
Index11
Terminals (contd)
duplex modes, 510, 513
enable Ctrl/C AST, 545
enable Ctrl/Y AST, 545
escape sequences, 57, 582
ANSI, C9
Digital private, C9
overflow size (item code), 533
extended characteristics, 523
fallback conversion, 511, 525, 545
features, 52
form feed, 522, 538
frame size, 544
function codes, 527, A6
function modifiers
IO$M_BRDCST, 550, 582
IO$M_BREAKTHRU, 511, 539
IO$M_CANCTRLO, 55, 539
IO$M_CTRLCAST, 545
IO$M_CTRLYAST, 56, 514, 545
IO$M_CVTLOW, 529
IO$M_DSABLMBX, 529
IO$M_ENABLMBX, 539
IO$M_ESCAPE, 57, 529
IO$M_EXTEND, 529, 531
IO$M_HANGUP, 545
IO$M_INCLUDE, 520, 546, 549
IO$M_LOOP, 548
IO$M_LT_CONNECT, 552
IO$M_LT_DISCON, 552
IO$M_LT_SENSEMODE, 552
IO$M_LT_SETMODE, 552
IO$M_MAINT, 546, 548
IO$M_NOECHO, 59, 511, 526, 529
IO$M_NOFILTR, 529
IO$M_NOFORMAT, 511, 539, 548
IO$M_OUTBAND, 549
IO$M_PURGE, 529
IO$M_RD_MODEM, 580
IO$M_REFRESH, 539
IO$M_SET_MODEM, 546
IO$M_TIMED, 530
IO$M_TRMNOECHO, 530
IO$M_TT_ABORT, 520, 549
IO$M_TYPEAHDCNT, 580
IO$M_UNLOOP, 549
hangup, 514, 517, 518, 525, 545, 579
I/O functions
CTDRIVER, 538
IO$_READLBLK, 528
IO$_READPROMPT, 528
IO$_READVBLK, 528
IO$_SENSECHAR, 579
IO$_SENSEMODE, 579
IO$_SETCHAR, 541
IO$_SETMODE, 541
IO$_TTY_PORT, 552
IO$_WRITELBLK, 538
Index12
Terminals
I/O functions (contd)
IO$_WRITEPBLK, 538
IO$_WRITEVBLK, 538
I/O status block, 582
initiate login, 510
input processing, 53
insert/overstrike (Ctrl/A), 53, 57
interrupt (Ctrl/Y), 56
item codes, 532 to 537
itemlist read, 531
item codes, 532 to 537
item descriptor, 532
LAT line, 51
LAT port driver, 550
application services creation, 577
I/O functions, 552
LAT rejection codes, 584
line editing, 53, 525
See also Terminals, item codes
line feed, 538
line terminators, 510
mailbox, 518, 539
message format, 519
message types, 519
modem
characteristic, 522
control signals, 516
data signals, 516
protocol, 514
sense signals, 580
signal control, 513
no type-ahead, 522
out-of-band
See also Out-of-band AST
characters, 520
output
CTDRIVER, 512
RTPAD, 512
SET HOST, 511
output formatting, 511, 527
output processing, 510
page length and width, 542, 580
parity flag, 543
PASTHRU mode, 59, 511, 526, 529
process preservation, 517
programming examples, 586
protocol, 514
read function, 528 to 538
read verify, 57, 537
receive speed, 543
redisplay data (Ctrl/R), 56, 528
ReGIS graphics, 526
restart data (Ctrl/Q), 57
sense characteristics function, 579
sense mode function, 579
serial line multiplexer, 51
set characteristics function, 541
Terminals
set characteristics function (contd)
arguments, 541
set mode function, 541
arguments, 541
SET TERMINAL DCL command, 54, 519,
526
SIXEL graphics, 526
special operating modes, 510
status (Ctrl/T), 57
status returns, A7
stop data (Ctrl/S), 57
supported devices, 51
SYS$GETDVI returns, 520
system password, 526
tab
Ctrl/I, 57
mechanical, 522
stops, 538
terminator mask, 530, 531
time (Ctrl/T), 57
transmit speed, 543
TTY_DIALTYPE system parameter, 513,
516, 517
type-ahead, 59, 518, 521, 580
alternate buffer, 523
unsolicited data, 518
write breakthrough function, 539
write function, 538 to 541
XON/XOFF control, 526
Terminator character bit mask, 530
ThinWire, 94
Thrashing magnetic tape, 38
Timeout periods
for SCSI device, 88, 813
TMS380 chip
Token Ring NICs, 932
Token Ring
Address mappings, 941
Token Ring NICs
TMS380 chip, 932
Translations
logical to physical, 215
Transmit MAC statistics, 927
Truncate subfunction, 113
TU58 magnetic tapes
See Disks
W
Write attention AST function, 412
Write breakthrough function, 539
Write end-of-file function
magnetic tape, 319
message, 411
Write protection
hardware, 72
X
XQP (extended QIO processor), 11
U
UDA50 disk adapter, 21
UNI
user to network interface, 935
Unload function
disk, 236
magnetic tape, 319
Index13