forked from SDL-Hercules-390/hyperion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TMOUNT.txt
225 lines (220 loc) · 7.88 KB
/
TMOUNT.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Fish note:
The length of the filename is not limted to 17 characters as the
below sample states. Rather, the length of the filename is limited
solely by the host filesystem code. On Windows, filenames can be up
to 260 characters long. (or even longer if "\\?\" format is used!)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* $$ JOB JNM=TMOUNT,DISP=D,CLASS=0
// JOB TMOUNT COMPILE PROGRAM TMOUNT
// LIBDEF *,CATALOG=PRD2.CONFIG
// OPTION ERRS,SXREF,SYM,NODECK,CATAL
PHASE TMOUNT,*
// EXEC ASMA90,SIZE=(ASMA90,64K),PARM='EXIT(LIBEXIT(EDECKXIT)),SIZE(MAXC
-200K,ABOVE)'
TMOUNT CSECT
SPACE 1
*---------------------------------------------------------------------
*
* TMOUNT - VSE VERSION II
*
* THE TMOUNT COMMAND IS USED FROM VSE ON THE P/390 TO TELL THE
* AWSTAPE MANAGER WHICH OS/2 FILE TO USE WHEN THE USER WRITES TO
* THIS DEVICE. IT CAN ALSO BE USED TO QUERY WHAT OS/2 FILE IS
* CURRENTLY ASSOCIATED WITH THE DEVICE.
*
* TWO SPECIAL CCW OPCODES ARE SUPPORTED BY THE AWSTAPE EMULATOR:
* X'4B' - ASSIGN A DOS FILEID TO THE DEVICE. (WAS '4B' 6/30)
* X'E4' - SENSE FILEID - RETURN THE NAME OF THE ASSIGNED DOS FILE
*
* THE EMULATED TAPE HAS TO BE ASSIGNED TO SYS014
*
* E.G // JOB TMOUNT
* // ASSGN SYS014,580
* // EXEC TMOUNT,REAL,SIZE=AUTO,PARM='580 D:TEST.TAP'
* OR
* // EXEC TMOUNT,REAL,SIZE=AUTO,PARM='580 (QUERY'
* /*
* /&
*
* AWSTAPE HAS A LIMIT OF 17 CHARACTERS IN A DOS FILEID. THAT
* LIMIT IS ENFORCED ENTIRELY IN AWSTAPE.
*
* THIS PROGRAM IS PROVIDED ON AN AS-IS BASIS.
* IT HAS NOT BEEN TESTED ON R/390
* NO MAINTENANCE WILL BE DONE AND NO APARS WILL BE ACCEPTED
*
* COMMENTS AND SUGGESTION ARE WELCOME
*
* AUTHOR: CHUCK BERGHORN
* REVISED FOR VSE: CHRISTIAN TOEPSCH (TOEPSCH@DE.IBM.COM)
*
*---------------------------------------------------------------------
*
SPACE 1
PRINT GEN
BALR R8,0
USING *,R8
CR R15,R1 TEST FOR PARM=
BE NOPARM NO PARM SPECIFIED, RETURN
L R2,0(R1) GET PARAMETER ADDRESS
SR R3,R3 CLEAR R3
LH R3,0(R2) GET PARMLENGTH
AH R3,=X'0001' ADJUST MOVE LENGTH
EX R3,MOVEINST DO THE MOVE
CLC PARMLEN,=X'0015' PARMLEN > THAN 21?
* BH TOOLONG PARMS TOO LONG, RETURN
OPEN CONSOLE PREPARE TO WRITE TO CONSOLE
MVC MSGOUT,MSGSTART
* PUT CONSOLE PRINT OUT THIS MESSAGE
*---------------------------------------------------------------------
*
* END OF PROLOGUE
*
*---------------------------------------------------------------------
*
CLI PARMDAT,C'(' ANY OPTIONS?
BNE NOOPT NO, DO SETFILE
CLC PARMDAT+1(5),=C'QUERY' IS IT A QUERY?
BE DOQUERY
B BADOPT
*---------------------------------------------------------------------
*
* QUERY THE CURRENT FILE THAT IS THE VIRTUAL TAPE
*
*---------------------------------------------------------------------
*
DOQUERY DS 0H SET UP TO DO A QUERY
MVC MSGOUT,TMPQUERY
MVC MSGOUT+42(4),PARMDEV INSERT DEVADDR FROM PARM
PUT CONSOLE PRINT OUT THIS MESSAGE
*
* DO THE QUERY
*
EXCP QDCCB FIND OUT THE CURRENT FILE
WAIT QDCCB WAIT FOR IT TO HAPPEN
MVC MSGOUT,DOSFID PREPARE MESSAGE AND DISPLAY
PUT CONSOLE RESULT OF QUERY
LA R15,0 SET RETURN CODE
B RETURN
MOVEINST MVC RADDR(01),0(R2) GET PARMS
MOVEINS2 MVC DOSFID(01),PARMDAT MOVE FILENAME
*---------------------------------------------------------------------
*
* CODE TO SET A NEW FILENAME EQUAL TO THE VIRTUAL TAPE...
*
*---------------------------------------------------------------------
*
NOOPT DS 0H ASSUME ATTEMPT TO SET FILENAME
CLI PARMDAT+1,C':' WAS A DRIVE LETTER SPECIFIED
* BNE BADFILE
CLC PARMDAT,MSGBLANK ANY FILENAME SPECIFIED
BE BADFILE NO, BAD FILENAME
MVC MSGOUT,TMPNOOPT
MVC MSGOUT+49(4),PARMDEV PUT DEVADDR IN MESSAGE
PUT CONSOLE
LH R6,PARMLEN THIS IS THE LENGTH HALFW
LA R4,PARMDAT THIS IS THE DATA
S R6,PLUS4 SUBTRACT DEVADDR LENGTH AND
STH R6,SDCCW+6 STORE LENGTH IN CCW
SH R6,=X'0001' ADJUST MOVE LENGTH
EX R6,MOVEINS2 DO THE MOVE
MVC MSGOUT,MSGBLANK CLEAR MESSAGE AREA
MVC MSGOUT,DOSFID FILENAME IN MESSAGE
PUT CONSOLE DISPLAY IT
EXCP SDCCB SET THE FILENAME INTO MOUNT
WAIT SDCCB WAIT FOR THIS TO HAPPEN
LA R15,0 SET RETURN CODE
B RETURN EXIT
*---------------------------------------------------------------------
*
* ERROR CONDITIONS
*
*---------------------------------------------------------------------
*
NOPARM DS 0H
MVC MSGOUT,MSGOPT25 SUBSTITUTE VSE MSG
PUT CONSOLE SHOW THIS MESSAGE
LA R15,4
B RETURN
BADOPT DS 0H
MVC MSGOUT,MSGOPT24 SUBSTITUTE VSE MSG
PUT CONSOLE SHOW THIS MESSAGE
LA R15,8
B RETURN
BADFILE DS 0H
MVC MSGOUT,MSGNOF5 SUBSTITUTE VSE MSG
PUT CONSOLE SHOW THIS MESSAGE
LA R15,12
B RETURN
TOOLONG DS 0H
MVC MSGOUT,MSGLNG6 SUBSTITUTE VSE MSG
PUT CONSOLE SHOW THIS MESSAGE
LA R15,16
B RETURN
*---------------------------------------------------------------------
*
* EXIT CODE
*
*---------------------------------------------------------------------
*
RETURN DS 0H
MVC MSGOUT,MSGEND TMP MSG TO SHOW COMPLETION
* PUT CONSOLE TMP - PUT OUT THIS MESSAGE
CLOSE CONSOLE
EOJ
*
*
CONSOLE DTFCN DEVADDR=SYSLOG,IOAREA1=MSGOUT,RECFORM=FIXUNB, X
TYPEFLE=CMBND,BLKSIZE=70,INPSIZE=17
MSGOUT DS CL80
MSGSTART DC CL80'*** BEGINNING OF VSE MOUNT ***'
MSGEND DC CL80'*** END OF VSE MOUNT ***'
MSGNOF5 DC CL80'AWSMNT001E NO OR INCORRECT FILEID SPECIFIED'
MSGLNG6 DC CL80'AWSMNT002E DOS FILENAME TOO LONG'
MSGOPT24 DC CL80'AWSMNT003E NO OR INVALID OPTION SPECIFIED'
MSGOPT25 DC CL80'AWSMNT004E NO PARM= GIVEN'
TMPQUERY DC CL80'AWSMNT005E QUERY VIRTUAL TAPE AT ADDRESS '
TMPNOOPT DC CL80'AWSMNT006E ASSIGNING TO VIRTUAL TAPE AT ADDRESS '
MSGBLANK DC CL216' '
*
RADDR DS 0CL256 USED TO SAVE PARMS
PARMLEN DC CL2' ' PARAMETER LENGTH
PARMDEV DC CL4' ' DEVADDR FROM PARMS
PARMDAT DC CL216' ' DATA FROM PARMS (QUERY
* OR FULL QUALIFIED FILENAME
DOSFID DC CL80' '
*
*
QDCCB CCB SYS014,QDCCW
SDCCB CCB SYS014,SDCCW
QDCCW CCW X'4B',DOSFID,X'60',1
CCW X'E4',DOSFID,X'20',L'DOSFID
SDCCW CCW X'4B',DOSFID,X'20',L'DOSFID
*
*
PLUS4 DC F'4'
R0 EQU 0
R1 EQU 1
R2 EQU 2
R3 EQU 3
R4 EQU 4
R5 EQU 5
R6 EQU 6
R7 EQU 7
R8 EQU 8
R9 EQU 9
R10 EQU 10
R11 EQU 11
R12 EQU 12
R13 EQU 13
R14 EQU 14
R15 EQU 15
END
/*
// IF $MRC GT 4 THEN
// GOTO NOLNK
// EXEC LNKEDT
/. NOLNK
/&
* $$ EOJ