.title DUSTAT.MAC ; DUSTAT V1.00 ; Tim Shoppa (shoppa@triumf.ca), 8-Jan-1998 ; At the CSI prompt, DUSTAT takes a single device name. ; ; If the device is not a MSCP device, the .DSTATUS information about ; the device is displayed, and an attempt is made to size the device ; with .SPFUN #373 if this is applicable. ; ; If the device is a MSCP device, the .DSTATUS information normally ; isn't displayed (though the /D switch can be used to force its display.) ; MSCP devices are sized with .SPFUN #373, their partition information ; is displayed, and the MSCP information available about the device's ; controller and unit information is displayed. If the /S (scan) switch ; is given, all the MSCP units attached to that devices controllers are ; also probed and displayed. .mcall .CSISPC,.DSTAT,.FETCH,.SPFUN,.EXIT,.CLOSE,.SRESET,.PRINT .mcall .LOOKUP,.CSTAT,.ASSUME START: .CSISPC #OUTSP,#DEXT;,,#LINBUF ;Get device spec CLR DFLAG CLR SFLAG MOV (SP)+,R0 BEQ NOOPT 4$: MOV (SP)+,R1 ;Get next option BMI 10$ ;Did we have a value MOV #32.,-(SP) ;If not, default one! 10$: CMPB #'D,R1 ;D option to display .DSTAT info BEQ 12$ ;for MSCP devices CMPB #'d,R1 BNE 14$ 12$: MOV (SP)+,DFLAG BR 20$ 14$: CMPB #'S,R1 ;S option to scan other MSCP units BEQ 16$ ;default to first 32 units CMPB #'s,R1 ;but numeric value will set limit BNE 20$ 16$: MOV (SP)+,SFLAG 20$: SOB R0,4$ NOOPT: 2$: MOV #OUTSP,R2 ;User was only supposed to specify MOV #<5*3>,R3 ;One input device. If anything 3$: TST (R2)+ ;else has been specified, complain. BNE 10$ SOB R3,3$ TST (R2)+ MOV #<6*4-1>,R3 4$: TST (R2)+ BNE 10$ SOB R3,4$ BR NGRIPE 10$: .PRINT #GRIPE BR START NGRIPE: TST INSPEC ;If no input file specified, BNE 2$ .PRINT #VERSON ;display version information BR START ;and get a new CSI line 2$: .DSTAT #STAT,#INSPEC ;Do a .DSTAT on the specified device MOV STAT,R1 ;If the device is number 50 BIC #177400,R1 ;(a MSCP device), skip DSTAT info TST DFLAG ;unless /D was specified BNE 4$ CMP R1,#50 BEQ SKIPDS 4$: .PRINT #DEVTAG ;Print the numeric value CALL PRVAL .PRINT #ZERO MOV #DEVNUM,R0 10$: CMPB (R0),#377 ;look up the numeric value in BEQ NONAME ;table of translations CMPB (R0)+,R1 BEQ ISNAME 20$: TSTB (R0)+ BNE 20$ BR 10$ NONAME: MOV #NONTXT,R0 ;Either there was no translation ISNAME: .PRINT ;or there was. Print message. MOV #8.,R3 ;8 status bits to be checked MOV #BITTAB,R2 MOV STAT,R1 SWAB R1 2$: ROR R1 BCS 10$ ;bit is set TSTB (R2) ;if high bit is set, this is "no message". BMI 20$ .PRINT R2 4$: TSTB (R2)+ BNE 4$ BR 20$ 10$: TSTB (R2)+ BNE 10$ .PRINT R2 20$: TSTB (R2)+ BNE 20$ SOB R3,2$ .PRINT #DSTSIZ ;Display the DSTAT size of device MOV STAT+6,R1 CALL PRVAL TST R1 BNE SPIT TST STAT BMI SPIT .PRINT #SEQMES JMP START SPIT: MOV STAT,R1 ;Can this device do a .SPFUN #373? SWAB R1 ROR R1 BCS 40$ .PRINT #FIXMES JMP START 40$: .PRINT #VARMES SKIPDS: TST STAT+4 BNE 42$ .FETCH #HANLOD,#INSPEC BCC 42$ .PRINT #FEFAIL .EXIT 42$: .LOOKUP #AREA,#3,#INSPEC BCC 50$ .PRINT #LOFAIL .EXIT 50$: .SPFUN #AREA,#3,#373,#BUFF,#1,#0,#0 ;Look up device size BCC NOERR .PRINT #SPERR BR CKMSCP ;Note we do not regard a .SPFUN #373 failure as fatal. It may be, for ;example, that an existing floppy drive is not mounted. NOERR: .PRINT #SPFSIZ MOV BUFF,R1 ;Get device size in R1 CALL PRVAL .PRINT #ZERO CKMSCP: MOV STAT,R1 BIC #177400,R1 CMP #50,R1 ;Is this a MSCP device? BEQ ISMSCP .CLOSE #3 ;No, get another device name .SRESET JMP START ISMSCP: ;It is MSCP device DUTTSZ=<<64.+1>*2> ;DU translation table size (words) ; Get DU unit number into R4 MOV #CSTATD,R2 .CSTAT #AREA,#3,R2 ;CSTAT seems to be the clever way MOV 10(R2),R4 ;Unit number is 5th word MOV #BUFF,R2 .SPFUN #AREA,#3,#372,R2,#DUTTSZ;Read translation table into buffer BCC 10$ .PRINT #TABERR .EXIT 10$: TST (R2)+ ;Get the number of translations into R3 CLR R3 BISB (R2)+,R3 TSTB (R2)+ CMP R4,R3 BLOS 20$ .PRINT #NOTRAN ;No translation! .EXIT 20$: ADD R4,R2 ;Go to the R4th entry in the table ADD R4,R2 ADD R4,R2 ADD R4,R2 .PRINT #TRAN1 ;"Translates to physical UNIT=" MOV (R2)+,R1 MOV R1,UNIT CALL PRVAL .PRINT #TRAN2 ;" PART=" CLR R1 BISB (R2)+,R1 CALL PRVAL .PRINT #TRAN3 ;" PORT=" CLR R1 BISB (R2)+,R1 MOV R1,PORT CALL PRVAL .PRINT #ZERO P.CRF= 0 ; 4 Command reference number P.UNIT= 4 ; 2 Unit number P.OPCD= 10 ; 1 Opcode ; MSCP OPCODES OP.SCC= 04 ; SET CONTROLLER CHARACTERISTICS Command OP.ONL= 11 ; ONLINE Command OP.GUS= 03 ; GET UNIT STATUS Command OP.AVL= 10 ; AVAILABLE Command OP.FMT= 24. ; FORMAT Command ;RQZX1 OP.SP8= 47. ; FORMAT Command for the RQDX3 ;RQZX1 P.MOD= 12 ; 2 Modifiers P.BCNT= 14 ; 4 Byte count P.BUFF= 20 ; 12 Buffer descriptor P.LBN= 34 ; 4 Logical block number ; ONLINE Command Message Offsets P.UNFL= 16 ; 2 Unit flags P.DVPM= 34 ; 4 Device dependent parameters P.SHUN= 40 ; 2 Shadow unit P.CPSP= 42 ; 2 Copy speed ; ONLINE Command Modifiers MD.IFM= 02 ; Ignore Media Format Errors ;RQZX1 ; SET CONTROLLER CHARACTERISTICS Command Message Offsets P.VRSN= 14 ; 2 MSCP version P.CNTF= 16 ; 2 Controller flags P.HTMO= 20 ; 2 Host timeout P.TIME= 24 ; 8 Quad-word time and date ; FORMAT Command Message Offsets P.FMTI= 34 ; 4 Format information ; END MESSAGE OFFSETS P.CRF= 0 ; 4 Command reference number P.UNIT= 4 ; 2 Unit number P.OPCD= 10 ; 1 Opcode ; MSCP OPCODES OP.END= 200 ; End message flag P.FLGS= 11 ; 1 End message flags P.STS= 12 ; 2 Status ; MSCP STATUS CODES ST.MSK= 37 ; Status / event code mask ST.SUC= 0 ; Success ST.OFL= 3 ; Unit-Offline NOVOLM= 40 ; No volume mounted ST.MFE= 5 ; Media Format Error ST.WPR= 6 ; Write protected P.BCNT= 14 ; 4 Byte count P.FBBK= 34 ; 4 First bad block ; GET UNIT STATUS End Message Offsets P.MLUN= 14 ; 2 Multi-unit code P.UNFL= 16 ; 2 Unit flags ; Unit flags UF.RMV= 00200 ; Bit - Removable UF.WPH= 20000 ; Bit - Write protect (hardware) UF.WPS= 10000 ; Bit - Write protect (software or volume) P.UNTI= 24 ; 8 Unit identifier P.MEDI= 34 ; 4 Media type identifier P.SHUN= 40 ; 2 Shadow unit P.SHST= 42 ; 2 Shadow status P.TRCK= 44 ; 2 Track size P.GRP= 46 ; 2 Group size P.CYL= 50 ; 2 Cylinder size P.USVR= 52 ; 1 Unit software version P.UHVR= 53 ; 1 Unit hardware version P.RCTS= 54 ; 2 RCT table size P.RBNS= 56 ; 1 RBNs / track P.RCTC= 57 ; 1 RCT copies ; ONLINE End Message Offsets P.MLUN= 14 ; 2 Multi-unit code P.UNFL= 16 ; 2 Unit flags ; Unit flags UF.WPH= 20000 ; Bit - Write protect (hardware) UF.WPS= 10000 ; Bit - Write protect (software or volume) P.UNTI= 24 ; 8 Unit identifier P.MEDI= 34 ; 4 Media type identifier P.SHUN= 40 ; 2 Shadow unit P.SHST= 42 ; 2 Shadow status P.UNSZ= 44 ; 4 Unit size P.VSER= 50 ; 4 Volume serial number ; SET CONTROLLER CHARACTERISTICS End Message Offsets P.VRSN= 14 ; 2 MSCP version P.CNTF= 16 ; 2 controller flags P.CTMO= 20 ; 2 controller timeout P.CSVR= 22 ; 1 controller software version P.CHVR= 23 ; 1 controller hardware version P.CNTI= 24 ; 8 controller ID CF.RPL=100000 ;Bit - controller-initiated BBR CLR CMDBUF+P.UNIT ;Clear the physical unit number JSR R5,BYPASS ;and set controller characteristics .WORD OP.SCC BCC TABLK .PRINT #SCCERR .EXIT TABLK: MOV #CONNUM,R0 ;Identify the controller 10$: CMPB (R0),#377 ;look up the numeric value in BEQ 30$ ;table of translations CMPB (R0)+,RSPBUF+P.CNTI+6 BEQ 32$ 20$: TSTB (R0)+ BNE 20$ BR 10$ 30$: MOV #NONCON,R0 ;Either there was no translation 32$: ;or there was. CLR R1 ;Count number of chars in string 36$: INC R1 TSTB (R0)+ BNE 36$ MOV #IDB6TR,R2 ;Now fill in (backwards) DEC R0 ;skip back to the zero DEC R1 ;get rid of extra count BEQ 50$ ;if count zero, nothing to fill 40$: MOVB -(R0),-(R2) SOB R1,40$ 50$: MOVB #' ,-(R2) ;fill in preceding spaces CMP #IDB6SP,R2 BNE 50$ .PRINT #CONM1 ;"Controller at Port #: MOV PORT,R1 CALL PRDEC1 .ASSUME CF.RPL EQ 100000 TST RSPBUF+P.CNTF ;test BBR capability bit BMI 60$ .PRINT #CONMS ;"Requires Software-initiated bad block rep" BR 64$ 60$: .PRINT #CONMC ;"Has controller-initiated bad block rep" 64$: MOV #CONTAB,R4 ;Make output table with info from CALL TABOUT ;from packet returned by SCC TST SFLAG BEQ 70$ CLR UNIT BR AUNIT 70$: MOV UNIT,SFLAG AUNIT: MOV UNIT,CMDBUF+P.UNIT ;Set unit number we want JSR R5,BYPASS ;And put device available .WORD OP.AVL BCC 50$ .PRINT #AVLERR .EXIT 50$: JSR R5,BYPASS ;Now try to put device online .WORD OP.ONL BCC TRANCOD CMP #ST.OFL!NOVOLM,RSPBUF+P.STS ;Is there a volume mounted? BNE TRANCOD ;Yes, continue .PRINT #ONLERR .EXIT TRANCOD: MOV RSPBUF+P.MEDI,R0 BNE 1$ JMP NUNIT ;If this field blank, no unit there 1$: MOV #ONLTA0,R4 CALL TABOUT ;Translate the unit flag bits into human-readable form CLR COMMA9 BIT #UF.WPH,RSPBUF+P.UNFL BEQ 2$ .PRINT #WPHMES INC COMMA9 2$: BIT #UF.WPS,RSPBUF+P.UNFL BEQ 3$ CALL COMMA .PRINT #WPSMES 3$: BIT #UF.RMV,RSPBUF+P.UNFL BEQ 4$ CALL COMMA .PRINT #RMVMES ;Translate the media type code. Rightmost 7 bits indicates a decimal ;number, presumably in range 00-99; Each group of 5 bits remaining is ;a letter, encoded as 1=A, 26=Z, 0=nothing. 4$: MOV RSPBUF+P.MEDI,R0 BIC #177600,R0 MOV #MEDTRD,R1 MOVB #'0,(R1) ;Clear tens digit 10$: CMP R0,#10. BLO 12$ SUB #10.,R0 INCB (R1) ;Bump tens digit BR 10$ 12$: ADD #'0,R0 MOVB R0,1(R1) ;set ones digit MOV RSPBUF+P.MEDI,R2 MOV RSPBUF+P.MEDI+2,R3 MOV #0,-(SP) ;Keep track of letters we've skipped MOV #5,R5 ;up to 5 chars MOV #7,R4 ;initial shift is 7 (to clear out digits) BR 40$ 30$: MOV #5,R4 ;usual shift is 5 (per letter) 40$: CLC ROR R3 ROR R2 SOB R4,40$ MOV R2,R0 BIC #^C<37>,R0 BEQ 50$ ;If a zero, then no letter here ADD #<'A-1>,R0 MOVB R0,-(R1) BR 54$ 50$: INC (SP) ;Increment the skipped letter count 54$: SOB R5,30$ MOV (SP)+,R0 ;fill in skipped spaces BEQ 57$ ;(if any) 55$: MOVB #' ,-(R1) SOB R0,55$ 57$: MOV #ONLTAB,R4 CALL TABOUT MOV RSPBUF+P.UNSZ+2,UNSZ+2 ;Make another copy because MOV RSPBUF+P.UNSZ,UNSZ ;these get clobbered by OP.GUS JSR R5,BYPASS ;Now try to get unit status .WORD OP.GUS BCC 60$ .PRINT #GUSERR .EXIT ;Here we calculate number of blocks/cylinder and number of cylinders 60$: CLR R4 MOV RSPBUF+P.TRCK,R0 ;Blocks/Trk in R0 BEQ 66$ ;was a zero MOV RSPBUF+P.GRP,R2 ;Trk/Cylinder in R2 BEQ 66$ ;was a zero CLR R1 61$: ADD R0,R1 ;Poor man's multiply SOB R2,61$ ;Product in R1 MOV UNSZ+2,R2 ;High byte MOV UNSZ,R3 ;Low byte SUB #1,R3 ;drop by one SBC R2 ;for rounding BMI 66$ ;if it becomes -1, bug out 64$: SUB R1,R3 ;Subtract R1 SBC R2 BMI 65$ ;Loop until underflow INC R4 BR 64$ 65$: INC R4 ;we round up 66$: MOV R4,TOTCYL ;the total cylinder number 70$: MOV #GUSTAB,R4 CALL TABOUT NUNIT: CMP UNIT,SFLAG BEQ 74$ INC UNIT JMP AUNIT 74$: .CLOSE #3 JMP START TABOUT: ;table driven output of data in memory ;input: R4=pointer to table structure $10: MOV (R4)+,R0 ;See what next data element is BNE $11 ;a zero byte means we're done RETURN $11: CMP #1,R0 ;a one means ASCII text to output BNE $21 MOV R4,R0 ;So we print it .PRINT ;till the terminating 200 $12: TSTB (R4)+ ;Now we have to skip to the terminating 200 BPL $12 MOV R4,R0 ;Is R4 odd? ROR R0 BCC $10 ;if it isn't, nothing to adjust TSTB (R4)+ ;otherwise we have to skip this odd byte BR $10 ;and loop back to element test $21: CMP #21,R0 ;"21" means Octal byte to output BNE $22 MOV (R4)+,R3 CLR R1 ;deal with ugly sign-extend BISB (R3),R1 ;when we get the value to R1 CALL PROCT1 ;and print it BR $10 ;and loop back to element test $22: CMP #22,R0 ;"22" means Octal word to output BNE $31 MOV (R4)+,R3 MOV (R3),R1 ;get the word value to R1 CALL PROCT2 ;and print it BR $10 ;and loop back to element test $31: CMP #12,R0 ;"12" means decimal word to output BNE $32 MOV (R4)+,R3 MOV (R3),R1 ;get the word value to R1 CALL PRVAL ;and print it BR $10 ;and loop back to element test $32: CMP #14,R0 ;"14" means decimal longword to output BNE $33 MOV (R4)+,R3 MOV (R3)+,R2 ;get one word MOV (R3),R1 ;get other word CALL PRDEC32 ;and print it BR $10 ;and loop back to element test $33: CMP #11,R0 BNE $34 MOV (R4)+,R3 CLR R1 BISB (R3),R1 CALL PRDEC1 BR $10 $34: HALT PROCT1: ;Print an octal byte in R1 MOV R0,-(SP) ;Save registers MOV R1,-(SP) MOV R2,-(SP) MOV R3,-(SP) MOV #OCT1TAB,R3 ;Point to table of octal digits MOV #OCT1BUF,R0 ;and output buffer CLR ZEROSP JMP PRCOMM ;and go to common output routine PROCT2: ;Print an octal word in R1 MOV R0,-(SP) ;Save registers MOV R1,-(SP) MOV R2,-(SP) MOV R3,-(SP) MOV #OCT2TAB,R3 ;Point to table of octal digits MOV #OCT2BUF,R0 ;and output buffer CLR ZEROSP JMP PRCOMM ;and go to common output routine PRDEC1: ;Print a decimal byte in R1 MOV R0,-(SP) ;Save registers MOV R1,-(SP) MOV R2,-(SP) MOV R3,-(SP) MOV #DEC1TAB,R3 ;Point to table of octal digits MOV #DEC1BUF,R0 ;and output buffer MOV #2,ZEROSP JMP PRCOMM ;and go to common output routine PRVAL: MOV R0,-(SP) MOV R1,-(SP) MOV R2,-(SP) MOV R3,-(SP) MOV #4,ZEROSP ;Now print the 16-bit value in R1 in decimal MOV #DECTAB,R3 ; List of decades MOV #DECBUF,R0 ; Where to store the digits ;PRCOMM is an alternate entry point for other number bases PRCOMM: MOV R0,R2 10$: MOVB #'0,(R2) ; Start with zero 20$: CMP R1,(R3) BLO 40$ SUB (R3),R1 INCB (R2) ; And bump it up in current place BR 20$ 40$: INC R2 ; Do next digit CMP #1,(R3)+ ; Unless we just did ones place BNE 10$ MOV ZEROSP,R1 ; Do we want a leading zero suppress? BEQ 60$ ; not if ZEROSP=0 MOV R0,R2 ; do a leading-zero suppress 50$: CMPB #'0,(R2) BNE 60$ MOVB #' ,(R2)+ SOB R1,50$ 60$: .PRINT MOV (SP)+,R3 MOV (SP)+,R2 MOV (SP)+,R1 MOV (SP)+,R0 RETURN PRDEC32:MOV R0,-(SP) MOV R1,-(SP) MOV R2,-(SP) MOV R3,-(SP) MOV R4,-(SP) ;Now print the 32-bit value in R1 (hi)/R2 (lo) in decimal MOV #DECT32,R3 ; List of decades MOV #DECB32,R0 ; Where to store the digits MOV R0,R4 10$: MOVB #'0,(R4) ; Start with zero 20$: CMP R1,(R3) ; Compare high words BLO 40$ BHI 30$ CMP R2,2(R3) ;They were the same, compare lo words BLO 40$ 30$: SUB 2(R3),R2 ;Subtract lo words SBC R1 SUB (R3),R1 ;Subtract hi words INCB (R4) ; And bump it up to decimal value BR 20$ 40$: INC R4 ; Do next digit TST (R3)+ CMP #1,(R3)+ ; Unless we just did ones place BNE 10$ MOV R0,R4 ; do a leading-zero suppress MOV #9.,R1 ; for up to first four digits 50$: CMPB #'0,(R4) BNE 60$ MOVB #' ,(R4)+ SOB R1,50$ 60$: .PRINT MOV (SP)+,R4 MOV (SP)+,R3 MOV (SP)+,R2 MOV (SP)+,R1 MOV (SP)+,R0 RETURN COMMA: TST COMMA9 ;Print comma if flagged for BEQ 10$ .PRINT #COMMES 10$: INC COMMA9 RETURN ; SUBROUTINE TO PERFORM MSCP BYPASS COMMAND ; ; INPUT VARIABLES: ; THE MSCP COMMAND PACKET MUST BE PREVIOUSLY SETUP IN CMDBUF ; R5 => MSCP OPCODE ; ; OUTPUT VARIABLES: ; CARRY SET IF SPFUN RETURNED ERROR OR INVALID COMMAND ; OTHERWISE, CARRY CLEAR ; ; CALLING SEQUENCE: ; JSR R5,BYPASS ; .WORD (MSCP OPCODE) ; BYPASS: MOV #RSPPKT,R2 ; POINTER TO MSCP AREA MOV #RSPLEN,(R2)+ ; RESPONSE PACKET LENGTH CLR (R2)+ ; VIRTUAL CIRCUIT ID ADD #RSPLEN,R2 ; POINT TO START OF COMMAND PACKET MOV #CMDLEN,(R2)+ ; COMMAND PACKET LENGTH CLR (R2)+ ; VIRTUAL CIRCUIT ID MOV (R5)+,P.OPCD(R2) ; OPCODE - FROM CALLER .SPFUN #AREA,#3,#360,#RSPPKT,#0,#0 ; ISSUE MSCP-BYPASS COMMAND BCS 1$ ; - BRANCH IF UNSUCCESSFUL MOVB RSPBUF+P.STS,-(SP) ; GET RETURNED STATUS BIC #^C,(SP) ; CLEAR SUBCODE CMP #1,(SP)+ ; WAS THE COMMAND INVALID? CLC ; ASSUME 'NO' BNE 1$ ; NO, RETURN SEC ; YES, SET CARRY THEN RETURN 1$: RTS R5 ; RETURN TO CALLER .EVEN DEXT: .WORD 0,0,0,0 BUFF: .BLKW DUTTSZ AREA: .BLKW 6. CSTATD: .BLKW 6. STAT: .BLKW 4. ZEROSP: .BLKW 1 DECBUF: .ASCII /XX/ DEC1BUF:.ASCII /XXX./ .BYTE 200 OCT2BUF:.ASCII /XXX/ OCT1BUF:.ASCII /XXX/ .BYTE 200 ;LINBUF: .BLKB 81. SPERR: .ASCIZ /?DUSTAT-W-Unable to determine device size/ FEFAIL: .ASCIZ /?DUSTAT-F-Fetch failed/ LOFAIL: .ASCIZ /?DUSTAT-F-Lookup failed/ GRIPE: .ASCIZ /?DUSTAT-W-Only one plain device name, please!/ TABERR: .ASCIZ /?DUSTAT-F-MSCP translation table read error/ DEVTAG: .ASCII /Device ID number is/ .BYTE 200 NONTXT: .ASCIZ /?DUSTAT-I-Device number not found in tables/ SPFSIZ: .ASCII /.SPFUN #373 Device size =/ .BYTE 200 DSTSIZ: .ASCII /.DSTATUS Device size =/ .BYTE 200 SEQMES: .ASCIZ / (normal for sequential devices.)/ VARMES: .ASCIZ / (smallest-sized volume for variable-sized device.)/ FIXMES: .ASCIZ / (size of fixed-size device.)/ ;WPST: .ASCIZ /Media is write protected./ ;NOWPST: .ASCIZ /Media is not write protected./ NOTRAN: .ASCIZ /?DUSTAT-F-No such translation (???)/ TRAN1: .ASCII /Translates to physical UNIT=/ .BYTE 200 TRAN2: .ASCII / PART=/ .BYTE 200 TRAN3: .ASCII / PORT=/ .BYTE 200 SCCERR: .ASCIZ /?DUSTAT-F-Error setting controller characteristics/ AVLERR: .ASCIZ /?DUSTAT-F-Error setting device available/ GUSERR: .ASCIZ /?DUSTAT-F-Error getting unit status/ ONLERR: .ASCIZ /?DUSTAT-F-Error setting device online/ CONM1: .ASCII /Controller at Port #/ .BYTE 200 CONMS: .ASCIZ / requires software-initiated bad block replacement/ CONMC: .ASCIZ / has controller-initiated bad block replacement/ WPSMES: .ASCII / is software write-protected/ .BYTE 200 WPHMES: .ASCII / is hardware write-protected/ .BYTE 200 RMVMES: .ASCII / is removable/ .BYTE 200 COMMES: .ASCII /,/ .BYTE 200 .EVEN CONTAB: .WORD 1 ;ASCII text .ASCII / MSCP Version / .BYTE 200 .EVEN .WORD 22 ;Octal word .WORD RSPBUF+P.VRSN .WORD 1 .ASCII / Controller flags / .BYTE 200 .EVEN .WORD 22 ;Octal word .WORD RSPBUF+P.CNTF .WORD 1 ;ASCII text .ASCII <15><12>/ Software version / .BYTE 200 .EVEN .WORD 21 ;Octal byte .WORD RSPBUF+P.CSVR .WORD 1 ;ASCII text .ASCII / Hardware version / .BYTE 200 .EVEN .WORD 21 ;Octal byte .WORD RSPBUF+P.CHVR .WORD 1 ;ASCII text .ASCII <15><12>/ ID Bytes 0-3 / .BYTE 200 .EVEN BLAH=RSPBUF+P.CNTI .REPT 4 ;Four octal bytes with spaces .WORD 1 .ASCII / / .BYTE 200 .EVEN .WORD 21 .WORD BLAH BLAH=BLAH+1 .ENDR .WORD 1 .ASCII / ID Bytes 4-7 / .BYTE 200 .EVEN .REPT 4 ;Four octal bytes with spaces .WORD 1 .ASCII / / .BYTE 200 .EVEN .WORD 21 .WORD BLAH BLAH=BLAH+1 .ENDR .WORD 1 .ASCII <15><12>/ IDs as/ IDB6SP: .ASCII / / IDB6TR: .BYTE 200 .EVEN .WORD 1 .ASCII <15><12><15><12> .BYTE 200 .EVEN .WORD 0 ONLTA0: .WORD 1 .ASCII /MSCP Unit #/ .BYTE 200 .EVEN .WORD 12 .WORD UNIT .WORD 0 ONLTAB: .WORD 1 .ASCII <15><12>/ Unit Flags / .BYTE 200 .EVEN .WORD 22 .WORD RSPBUF+P.UNFL .WORD 1 .ASCII / Media Type / .ASCII /?????/ MEDTRD: .ASCII /??/ .ASCII <15><12>/ 65536 block partitions / .BYTE 200 .EVEN .WORD 12 .WORD RSPBUF+P.UNSZ+2 .WORD 1 .ASCII / Blocks in remaining partition / .BYTE 200 .EVEN .WORD 12 .WORD RSPBUF+P.UNSZ .WORD 1 .ASCII <15><12>/ Total blocks / .BYTE 200 .EVEN .WORD 14 .WORD RSPBUF+P.UNSZ .WORD 1 .ASCII / Volume Serial Number / .BYTE 200 .EVEN .WORD 14 .WORD RSPBUF+P.VSER .WORD 1 .ASCII <15><12> .BYTE 200 .EVEN .WORD 0 GUSTAB: .WORD 1 .ASCII / Cylinder Size / .BYTE 200 .EVEN .WORD 12 .WORD RSPBUF+P.CYL .WORD 1 .ASCII / Sectors per track / .BYTE 200 .EVEN .WORD 12 .WORD RSPBUF+P.TRCK .WORD 1 .ASCII <15><12>/ Total cylinders / .BYTE 200 .WORD 12 .WORD TOTCYL .EVEN .WORD 1 .ASCII / Tracks per cylinder / .BYTE 200 .EVEN .WORD 12 .WORD RSPBUF+P.GRP .WORD 1 .ASCII <15><12>/ Unit software version / .BYTE 200 .EVEN .WORD 11 .WORD RSPBUF+P.USVR .WORD 1 .ASCII / Unit hardware version / .BYTE 200 .EVEN .WORD 11 .WORD RSPBUF+P.UHVR .WORD 1 .ASCII <15><12>/ RCT Table size / .BYTE 200 .EVEN .WORD 12 .WORD RSPBUF+P.RCTS .WORD 1 .ASCII / RBN's per track / .BYTE 200 .EVEN .WORD 11 .WORD RSPBUF+P.RBNS .WORD 1 .ASCII <15><12>/ RCT Copies / .BYTE 200 .EVEN .WORD 11 .WORD RSPBUF+P.RCTC .WORD 1 .ASCII <15><12><15><12> .BYTE 200 .EVEN .WORD 0 ZERO: DEVNUM: .BYTE 0 .ASCIZ /RK05 Disk/ .BYTE 1 .ASCIZ /TC11 DECtape/ .BYTE 2 .ASCIZ /Error Logger/ .BYTE 3 .ASCIZ /Line Printer/ .BYTE 4 .ASCIZ /Console Terminal or Batch Handler/ .BYTE 5 .ASCIZ /RL01 or RL02 Disk/ .BYTE 6 .ASCIZ /RX02 Diskette/ .BYTE 7 .ASCIZ /PC11 High-speed Paper Tape Reader and Punch/ .BYTE 10 .ASCIZ /Reserved (V2 PP handler)/ .BYTE 11 .ASCIZ /TU10 Magtape/ .BYTE 12 .ASCIZ /RF11 Disk/ .BYTE 13 .ASCIZ /TA11 Cassette/ .BYTE 14 .ASCIZ /Card Reader (CR11, CM11)/ .BYTE 15 .ASCIZ /Reserved/ .BYTE 16 .ASCIZ /RJS03,RJS04 Fixed-head disk/ .BYTE 17 .ASCIZ /Reserved/ .BYTE 20 .ASCIZ /TJU16 Magtape/ .BYTE 21 .ASCIZ /RP02,RP03 Disk/ .BYTE 22 .ASCIZ /RX01 Diskette/ .BYTE 23 .ASCIZ /RK06,RK07 Disk/ .BYTE 24 .ASCIZ /Reserved/ .BYTE 25 .ASCIZ /Null handler/ .BYTE 26 .ASCIZ /Reserved (DECnet)/ .BYTE 27 .ASCIZ /Reserved (DECnet)/ .BYTE 30 .ASCIZ /Reserved (DECnet)/ .BYTE 31 .ASCIZ /Reserved (CTS-300,LQ,LR,LS)/ .BYTE 32 .ASCIZ /Reserved (CTS-300,LQ,LR,LS)/ .BYTE 33 .ASCIZ /Reserved (CTS-300,LQ,LR,LS)/ .BYTE 34 .ASCIZ /TU58 DECtape II/ .BYTE 35 .ASCIZ /TS11 Magtape/ .BYTE 36 .ASCIZ "PDT-11/130" .BYTE 37 .ASCIZ "PDP-11/150" .BYTE 40 .ASCIZ /Reserved/ .BYTE 41 .ASCIZ /Serial Line Printer Hnalder (LS)/ .BYTE 42 .ASCIZ /Message Queue Handler (MQ)/ .BYTE 43 .ASCIZ /DRV11-J Interface (MRRT)/ .BYTE 44 .ASCIZ /Down-line Load Handler (XT) (MRRT-11 only)/ .BYTE 45 .ASCIZ /Reserved/ .BYTE 46 .ASCIZ /Logical Disk Handler/ .BYTE 47 .ASCIZ /KT-11 VM Handler/ .BYTE 50 .ASCIZ /MSCP Class Handler/ .BYTE 51 .ASCIZ /Single-line editor/ .BYTE 52 .ASCIZ "RX50 Diskette (Professional 325/350)" .BYTE 53 .ASCIZ "RD50/RD51 Disk (Professional 350)" .BYTE 54 .ASCIZ "Professional Interface (PI)" .BYTE 55 .ASCIZ "Transparent Spooler (SP)" .BYTE 56 .ASCIZ "Reserved" .BYTE 57 .ASCIZ "Communication Port (Professional 325/350 or DL(V)-11)" .BYTE 60 .ASCIZ "TMSCP Class Tape Handler" .BYTE 377 ;end of table mark CONNUM: .BYTE 1. .ASCIZ "HSC50" .BYTE 2. .ASCIZ "UDA50" .BYTE 3. .ASCIZ "RC25" .BYTE 4. .ASCIZ "VMS (Software)" .BYTE 5. .ASCIZ "TU81" .BYTE 6. .ASCIZ "UDA50-A" .BYTE 7. .ASCIZ "RQDX1/RQDX2" .BYTE 8. .ASCIZ "TOPS 10/20 (Software)" .BYTE 9. .ASCIZ "TQK50" .BYTE 10. .ASCIZ "RUX50" ;11. is unassigned .BYTE 12. .ASCIZ "KFBTA" .BYTE 13. .ASCIZ "KDA50" .BYTE 14. .ASCIZ "TQK50" .BYTE 15. .ASCIZ "RV20/RV60" .BYTE 16. .ASCIZ "KRQ50" ;17. is unassigned .BYTE 18. .ASCIZ "KBD50" .BYTE 19. .ASCIZ "RQDX3" ;20. is unassigned ; KFQSAs are an unusual beast. While the "disk" controller will report 21. ; at the end of step 4, it might report 96., 97., or some other ID later on ; since the controller ID actually depends on what type of disk it is. This ; also goes for the tape connections. So, this is why KFQSA devices appear ; to be listed twice; once under KFQSA, and once under the disk type itself. ; I've never seen a RT-11 system with a KFQSA, but I think it should work! TDS .BYTE 21. .ASCIZ "KFQSA-disk" .BYTE 22. .ASCIZ "KFQSA-tape" .BYTE 23. .ASCIZ "KFQSA-both" .BYTE 24. .ASCIZ "KFQSA-other" .BYTE 25. .ASCIZ "TUK50" .BYTE 27. .ASCIZ "KDM70" .BYTE 29. .ASCIZ "TM32" .BYTE 30. .ASCIZ "RQZX1" .BYTE 96. .ASCIZ "RF30" .BYTE 97. .ASCIZ "RF71" .BYTE 98. .ASCIZ "TF85" .BYTE 99. .ASCIZ "TF70" .BYTE 100. .ASCIZ "RF31" .BYTE 101. .ASCIZ "RF72" .BYTE 102. .ASCIZ "RF73" .BYTE 103. .ASCIZ "TF70L" .BYTE 104. .ASCIZ "RF35" .BYTE 105. .ASCIZ "EF51" .BYTE 108. .ASCIZ "RF36" .BYTE 109. .ASCIZ "RF74" .BYTE 112. .ASCIZ "RF75" .BYTE 377 ; end of table NONCON: .ASCIZ "(Unidentified)" BITTAB: .ASCIZ "Bit 8=0:All volumes used by this device are the same size." .ASCII "Bit 8=1:Handler can access variable-sized volumes"<15><12> .ASCIZ " and supports .SPFUN 373" .ASCII "Bit 9=0:Do not enter at abort entry point unless"<15><12> .ASCIZ " conditions for bit 11 are satisfied" .ASCII "Bit 9=1:Enter handler at abort entry whenever"<15><12> .ASCIZ " program terminates for any reason" .ASCIZ "Bit 10=0:No .SPFUN requests accepted" .ASCIZ "Bit 10=1:Handler accepts .SPFUN requests" .ASCII "Bit 11=0:Handler abort entry taken only if there is"<15><12> .ASCIZ " an active queue element belong to aborted job" .ASCII "Bit 11=1:Enter handler abort entry every time a job"<15><12> .ASCIZ " is aborted" .BYTE 200 .ASCIZ "Bit 12=1:Non RT-11 directory-structured device" .BYTE 200 .ASCIZ "Bit 13=1:Write-only device (line printer,serial line printer)" .BYTE 200 .ASCIZ "Bit 14=1:Read-only device (card reader, paper tape reader)" .ASCIZ "Bit 15=0:Sequential access device" .ASCIZ "Bit 15=1:Random-access device" VERSON: .ASCIZ "DUSTAT 1.00" .EVEN DECTAB: .WORD 10000.,1000. DEC1TAB:.WORD 100.,10.,1. OCT2TAB:.WORD 100000, 10000, 1000 OCT1TAB:.WORD 100, 10, 1 DECT32: .WORD 15258.,51712. .WORD 1525.,57600. .WORD 152.,38528. .WORD 15.,16960. .WORD 1.,34464. .WORD 0.,10000. .WORD 0., 1000. .WORD 0., 100. .WORD 0., 10. .WORD 0., 1. DECB32: .ASCII /XXXXXXXXXX./ .BYTE 200 ;Here we build the MSCP command/response packet for .SPFUN #360 RSPPKT: .WORD 0,0 ;Response packet length,virtual circuit ID RSPBUF: .BLKW 24. ;Response buffer RSPLEN= .-RSPBUF ;Length of response buffer CMDPKT: .WORD 0,0 ;Command packet length,virtual circuit ID CMDBUF: .REPT 24. ;Zeroed command buffer .WORD 0 .ENDR CMDLEN= .-CMDBUF ;Length of command buffer .EVEN OUTSP: .BLKW 5*3 INSPEC: .BLKW 4*6 UNIT: .BLKW 1 PORT: .BLKW 1 TOTCYL: .BLKW 1 COMMA9: .BLKW 1 UNSZ: .BLKW 2 DFLAG: .BLKW 1 SFLAG: .BLKW 1 ENDSP =. HANLOD =. .END START