.title VDINFO .sbttl Displays Information on Virtual Disk Devices .ident /050589/ ; ;+ ;***** ; ; VDINFO -- Retrieves information regarding a virtual disk device ; using the special IO$_SENSEMODE!IO$M_VD_GETINFO function. ; Input command syntax is, ; ; VDINFO VDan: ; ; where: ; VDan: = Valid device name of VDDRIVER unit to be displayed ; ;- ;***** ; ; Paul Sorenson ; AEP/Engineering Computer Support Center ; 1 Riverside Plaza ; Columbus, OH 43215 ; ;***** ; VD$IODEF ; define special VDDRIVER QIO functions .psect $LRWDATA,RD,WRT,NOEXE ; ASSIGN_LIST: $ASSIGN devnam=VD_DESC,- chan=VD_CHAN ; GET_FOREIGN_LIST: .long 4 ; # arguments .address IN_DESC ; input buffer descriptor .address P1_DESC ; 1st prompt string descriptor .address IN_SIZE ; place for output length .address PROMPT ; initial "force-prompt" value ; QIO_LIST: $QIO efn=0,- func=IO$_SENSEMODE!IO$M_VD_GETINFO,- iosb=IOSB,- P1=INFO,- P2=INFO_LENGTH ; IN_SIZE: .long 0 IN_DESC: .long IN_BUF_LENGTH .address IN_BUF IN_BUF: .blkb 128 IN_BUF_LENGTH = .-IN_BUF ; OUT_DESC: .long OUT_BUF_LENGTH .address OUT_BUF OUT_BUF: .blkb 256 OUT_BUF_LENGTH = .-OUT_BUF ; CTRSTR1_DESC: .long CTRSTR1_LENGTH .address CTRSTR1 CTRSTR1: .ascii &!AS assigned to file-id (!UW,!UW,!UW) on !AC!UW:!/& .ascii & starting at LBN !UL with !UL total blocks& CTRSTR1_LENGTH = .-CTRSTR1 ; CTRSTR2_DESC: .long CTRSTR2_LENGTH .address CTRSTR2 CTRSTR2: .ascii &!AS not assigned& CTRSTR2_LENGTH = .-CTRSTR2 ; IOSB: .blkl 2 ; PROMPT: .long 0 P1_DESC: ; 1st command line parameter prompt .ascid /Device ? / ; VD_CHAN: ; channel # assigned to VDan: .blkl 1 VD_DESC: ; descriptor of virtual disk device .long 0 .address IN_BUF ; INFO: ; VD information buffer DISK_NAME: ; host disk device name .blkb 16 DISK_UNIT: ; host disk device unit # .blkw 1 FID: ; file-id .blkw 1 SEQ: ; sequence number .blkw 1 RVN: ; relative volume number .blkw 1 SIZE: ; device size .blkl 1 LBN: ; starting LBN .blkl 1 INFO_LENGTH = .-INFO ; .psect $CODE,RD,WRT,EXE ; .page .sbttl ; ; .entry VD_INFO,^M<> ; ; *** Start by retrieving command line from the CLI prompting for ; required input. ; 1$: CALLG GET_FOREIGN_LIST,G^LIB$GET_FOREIGN CMPL R0,#RMS$_EOF ; end-of-file ?? BEQL ERR_EXIT MOVL IN_SIZE,R0 ; recover size of string MOVL IN_DESC+4,R1 ; and start address MOVL #1,PROMPT ; force prompting from here on SKPC #^A/ /,R0,(R1) ; skip leading spaces BEQL 1$ ; prompt again if null MOVL R1,VD_DESC+4 ; set start address of "VDan:" string LOCC #^A/ /,R0,(R1) ; find next space or end-of-string CMPB -1(R1),#^A/:/ ; name end with colon ?? BEQL 14$ ; branch if yes MOVB #^A/:/,(R1)+ ; else, insert one for output 14$: SUBL3 VD_DESC+4,R1,VD_DESC ; set length of string ; ; *** Assign channel to VDDRIVER and then issue IO$_SENSEMODE!IO$M_GENTINFO QIO ; to VDDRIVER to get information on the container file. ; $ASSIGN_G ASSIGN_LIST ; assign channel to VDDRIVER BLBC R0,ERROR ; branch on error MOVZWL VD_CHAN,QIO_LIST+QIO$_CHAN ; copy channel number to QIO list $QIOW_G QIO_LIST ; issue "getinfo" request to VDDRIVER BLBC R0,ERROR ; branch on error MOVZWL IOSB,R0 ; pickup I/O status BLBS R0,FORMAT ; branch on success ERROR: PUSHL R0 ; setup error status CALLS #1,G^LIB$SIGNAL ; signal the condition ERR_EXIT: BRB EXIT FORMAT: TSTL IOSB+4 ; check UCB address BEQL 4$ ; branch if undefined $FAO_S ctrstr=CTRSTR1_DESC,- outlen=OUT_DESC,- outbuf=OUT_DESC,- p1=#VD_DESC,- p2=FID,- p3=SEQ,- p4=RVN,- p5=#DISK_NAME,- p6=DISK_UNIT,- p7=LBN,- p8=SIZE BRB 5$ 4$: $FAO_S ctrstr=CTRSTR2_DESC,- outlen=OUT_DESC,- outbuf=OUT_DESC,- p1=#VD_DESC 5$: PUSHAL OUT_DESC ; setup output string descriptor CALLS #1,G^LIB$PUT_OUTPUT ; send info to SYS$OUTPUT ; EXIT: $EXIT_S ; .end VD_INFO