.TITLE D ;ROUTINE TO SHOW DISK FRAGMENTATION IN AN ;UPDATING DISPLAY FORMAT .LIBRARY @DPYDEF@ .LIBRARY @SYS$LIBRARY:LIB@ $FAODEF $PRDEF $JPIDEF $AQBDEF $DYNDEF $VCBDEF $UCBDEF $DDBDEF $IRPDEF $DEVDEF $DCDEF $DIBDEF HASHSIZ=7 ;SIZE OF HASH TABLE C.VLEV=0 C.SBCL=2 C.VSIZ=4 C.BLKF=8 C.SECT=12 C.TRAK=16 C.CYLN=20 C.STAT=24 ;SPECIAL CHARACTERS: COMMA=^X2C .SBTTL SPECIAL MACROS .MACRO MAKFAO PRMLST XX=0 .IRP FOO,<'PRMLST'> DOFAO %EXTRACT(0,1,FOO),%LOCATE(<=>,FOO),FOO .ENDR .ENDM .MACRO DOFAO TYPE,POSIT,PARM .IF NE,<^A/'TYPE'/-^A/P/> MOVL PARM,FAOPRM+<4*XX> .MEXIT .ENDC XXX=POSIT-1 XXXX=XXX CHKFAO %EXTRACT(XXX,1,PARM) XX=%EXTRACT(1,XXX,PARM) ZZZ=%LENGTH(PARM) ZZ=XXXX+2 .IF EQ, MOVAL %EXTRACT(ZZ,ZZZ,PARM),- FAOPRM+<4*> .IF_FALSE MOVL %EXTRACT(ZZ,ZZZ,PARM),- FAOPRM+<4*> .ENDC .ENDM .MACRO CHKFAO ARG .IF EQ,<^A/'ARG'/-^A/V/> XXX=XXX-1 .ENDC .ENDM .MACRO PMOV TYPE,ADDR,DEST MOVA'TYPE ADDR,-(SP) ADDL2 POOLBAS,(SP) MOV'TYPE @(SP)+,DEST .ENDM .MACRO PMOVES LIST .IRP FOO,<'LIST'> .MACRO PMOV'FOO ARGS PMOV FOO,ARGS .ENDM .ENDR .ENDM .MACRO PMOVA TYPE,ADDR,DEST MOVA'TYPE ADDR,-(SP) ADDL2 POOLBAS,(SP) MOVL (SP)+,DEST .ENDM .MACRO PMOVAS LIST .IRP FOO,<'LIST'> .MACRO PMOVA'FOO ARGS PMOVA FOO,ARGS .ENDM .ENDR .ENDM PMOVES PMOVAS .SBTTL INITIALIZATION AND MAIN LOOP .PSECT DMAIN,RD,NOWRT,EXE .ENTRY D,^M $ASSIGN_S CHAN=TTCHN,DEVNAM=TTDEV BLBS R0,10$ RET 10$: DPY$SETUP INI$ #-1 $QIOW_S CHAN=DPYCHN,FUNC=#IO$_SETMODE!IO$M_CTRLCAST,- IOSB=IOSB,- P1=CCTRAP $QIO_S CHAN=TTCHN,- FUNC=#IO$_READVBLK!IO$M_NOECHO!IO$M_CVTLOW,- IOSB=IOSB,- ASTADR=DOCMD,- P1=TTIBUF,P2=#1 CALLS #0,GETPOOL LOOP: PUSHAL DISK CALLS #0,COUNT $CMEXEC_S ROUTIN=GETUCB ;GET UCB AND DDB CALLS #1,DISPLY ;USE BIG DISPLAY BBCC #FL$V_REF,FLAGS,20$ REF$ BRB 30$ 20$: DPY$ 30$: $SCHDWK_S DAYTIM=SLPTIM $HIBER_S BRB LOOP .SBTTL COMMAND PROCESSOR .ENTRY DOCMD,^M 30$: BLBC IOSB,CMDRET LOCC TTIBUF,#MAXCMD,CMDTAB BEQL CMDRET HAVCMD: SUBL2 #CMDTAB,R1 MOVL CMDADR[R1],R1 JSB (R1) CMDRET: $QIO_S CHAN=TTCHN,- FUNC=#IO$_READVBLK!IO$M_NOECHO!IO$M_CVTLOW,- ASTADR=DOCMD,- IOSB=IOSB,- P1=TTIBUF,P2=#1 RET .SBTTL COMMAND ROUTINES DCMD: $QIOW_S CHAN=TTCHN,- FUNC=#IO$_READVBLK!IO$M_NOECHO!IO$M_CVTLOW,- IOSB=IOSB,- P1=TTIBUF,P2=#80 MOVZBL IOSB+2,DISK MOVC3 IOSB+2,TTIBUF,DISK+1 CMPB #^A/:/,-1(R3) ;COLON SPEC'D? BEQL 10$ ;YES MOVB #^A/:/,(R3) INCB DISK 10$: RSB RCMD: BISL2 #FL$M_REF,FLAGS RSB .SBTTL ROUTINE TO COUNT THE BITS .PSECT DSUBS,RD,NOWRT,EXE ;ARG IS THE DISK .ENTRY COUNT,^M CLRL BLKNG CLRL CLUSTER CLRL VOLSIZ CLRL CHAIN MOVAL @4(AP),R2 MOVB (R2),BITFAB+FAB$B_FNS MOVAL 1(R2),BITFAB+FAB$L_FNA CLRB PRIBUF+DIB$B_DEVCLASS ;MAKE NOT A DISK CLRB SCDBUF+DIB$B_DEVCLASS ;.. TSTB (R2) ;FOR DEFAULT BEQL DOCHN MOVAL 1(R2),-(SP) ;SET UP DESCRIPTOR MOVZBL (R2),-(SP) MOVAL (SP),R0 $GETDEV_S DEVNAM=(R0),PRIBUF=PRIDSC,SCDBUF=SCDDSC CLRQ (SP)+ DOCHN: $OPEN FAB=BITFAB BLBS R0,0$ BRW NOFIL 0$: TSTB @4(AP) BNEQ HAVINF $GETCHN_S CHAN=BITFAB+FAB$L_STV,PRIBUF=PRIDSC,SCDBUF=SCDDSC MOVZBL NAM+NAM$T_DVI,(R2) MOVC3 (R2),NAM+NAM$T_DVI+1,1(R2) INCB @4(AP) MOVB #^A/:/,(R3) HAVINF: $EXPREG_S PAGCNT=BITFAB+FAB$L_ALQ,RETADR=BITCOR BLBS R0,HAVCOR BRW NOMAP HAVCOR: $CRMPSC_S INADR=BITCOR,CHAN=BITFAB+FAB$L_STV BLBS R0,HAVSEC BRW NOSEC HAVSEC: CLRL R3 ;START AT ZERO CLRL SUM MOVAL @BITCOR,R5 ;POINT TO FILE BISL2 #FL$M_HOLE,FLAGS ;SET HOLE BIT CLRL TEMP ;CLEAR REMEMBER # OF BITS MOVL C.BLKF(R5),BLKNG ;SET BLOCKING FACTOR MOVL C.VSIZ(R5),VOLSIZ CLRL VOLSIZ+4 ;MAKE QUADWORD MOVZWL C.SBCL(R5),CLUSTER ;GET CLUSTER FACTOR EDIV CLUSTER,VOLSIZ,R0,R1 ;GET # OF CLUSTERS TSTL R1 BEQL 5$ INCL R0 ;ROUND UP 5$: SUBL3 #1,R0,-(SP) ;TO ACCOUNT FOR ZERO BASE CLRL R4 ;START AT POSITION 0 LOOPX: MOVL #32,R0 ;DEFAULT 32 ACBL (SP),R0,R3,10$ ;IF OK SUBL2 R0,R3 SUBL3 R3,(SP),R0 ;GET # OF CHARS BGTR 12$ MOVL TEMP,R0 BEQL 7$ PUSHL R0 ADDL2 R0,SUM CALLS #1,STRHOLE 7$: BRW SUMBIT 10$: SUBL2 R0,R3 ;UNDO THE ACB 12$: BBS #FL$V_HOLE,FLAGS,DOFFS ;FIND START OF HOLE FFC R4,R0,512(R5),R1 ;TRY TO FIND END OF HOLE BNEQ 20$ ;FOUND ONE ADDL2 R0,TEMP ADDL2 R0,R3 ;ADD IN BITS MOVL R1,R4 BRB LOOPX ;MOVE ON 20$: SUBL3 R4,R1,-(SP) ;HOLE SIZE ADDL2 (SP),R3 ;UPDATE THIS ADDL2 TEMP,(SP) ;ADD TEMPORARY CLRL TEMP ;CLEAR IT MOVL R1,R4 ;SAVE ADDL2 (SP),SUM CALLS #1,STRHOLE ;STORE HOLE SIZE BISL2 #FL$M_HOLE,FLAGS ;CLEAR FLAG AND GO LOOPX1: BRW LOOPX ;JUST IN CASE DOFFS: FFS R4,R0,512(R5),R1 ;FIND START OF HOLE BNEQ 40$ MOVL R1,R4 ;POINT AHEAD ADDL2 R0,R3 ;POINT AHEAD 30$: BRW LOOPX 40$: SUBL3 R4,R1,R0 ADDL2 R0,R3 MOVL R1,R4 BBSC #FL$V_HOLE,FLAGS,LOOPX1 ;CHANGE AND GO SUMBIT: MOVZWL C.SBCL(R5),R0 MULL2 R0,SUM CLRL R5 ;THE QUOTIENT INDICATOR MOVAL CHAIN,R3 ;SET WHERE ENTRY GOES SUMLP1: CLRL R2 ;INDEX INTO HASH TABLE SUMLP: MOVL HASHTAB[R2],R4 ;GET TABLE ENTRY BEQL NXTSUM ;NEXT ENTRY BISL2 #FL$M_FOUND,FLAGS ;SET FOUND AN ENTRY CMPL FB$L_QUOTIENT(R4),R5 ;CORRECT QUOTIENT? BNEQ NXTSUM ;NO MULL2 R0,FB$L_SIZE(R4) ;CONVERT TO BLOCKS MOVL R4,FB$L_LINK(R3) ;CHAIN IN MOVL R4,R3 ;AND UPDATE MOVL FB$L_LINK(R4),HASHTAB[R2];POINT TO NEXT ENTRY NXTSUM: ACBL #HASHSIZ-1,#1,R2,SUMLP ;IF MORE THIS TIME THROUGH BBCC #FL$V_FOUND,FLAGS,80$ ;IF FOUND NONE ACBL #^X7FFFFFFF,#1,R5,SUMLP1;CONTINUE OTHERWISE 80$: NOSEC: $DELTVA_S INADR=BITCOR NOMAP: $QIOW_S CHAN=BITFAB+FAB$L_STV,- FUNC=#IO$_DEACCESS,- IOSB=IOSB NOFIL: $DASSGN_S CHAN=BITFAB+FAB$L_STV RET .SBTTL STRHOLE ;ROUTINE TO STORE THE ENTRY FOUND IN HASH TABLE ;ARG IS THE SIZE OF THE HOLE ON DISK ;BLOCK FORMAT: ; ; 0: LINK TO NEXT BLOCK (ZERO OF LAST) ; 4: COUNT OF HOLES THIS SIZE ; 8: SIZE OF THIS HOLE ; 12: QUOTIENT FROM DIVISION ; .ENTRY STRHOLE,^M MOVL 4(AP),R0 ;GET ENTRY SIZE CLRL R1 ;FOR EDIV EDIV #HASHSIZ,R0,R0,R1 ;HASH IT MOVAL HASHTAB[R1],R3 MOVL HASHTAB[R1],R2 ;ADDRESS OF BLOCK BEQL NEWENT ;IF NO ENTRIES HERE YET 10$: CMPL R0,12(R2) ;QUOTIENT CHECK BLSS NEWENT MOVL R2,R3 CMPL 4(AP),FB$L_SIZE(R2) ;SAME SIZE? BEQL OLDENT ;YES MOVL FB$L_LINK(R2),R2 ;NO CHAIN FURTHER BNEQ 10$ ;IF CAN NEWENT: PUSHL R0 PUSHL FB$L_LINK(R3) PUSHAL FB$L_LINK(R3) ;CAN'T CHAIN, GET NEW PUSHAL SIXTEEN CALLS #2,LIB$GET_VM ;GET CORE BLOCK MOVL FB$L_LINK(R3),R3 POPL FB$L_LINK(R3) CLRL FB$L_COUNT(R3) ;INIT LINK,COUNT MOVL 4(AP),FB$L_SIZE(R3) ;SET SIZE POPL FB$L_QUOTIENT(R3) ;SET QUOTIENT OLDENT: INCL FB$L_COUNT(R3) ;INCREMENT COUNT RET .SBTTL DISPLAY ROUTINE ;THIS DOES THE FRAGMENTATION DISPLAY ;ARG IS AGAIN THE DISK .ENTRY DISPLY,^M MOVAL PRIBUF,R6 ;ASSUME PRIMARY DEVICE BBC #DEV$V_SPL,SCDBUF+DIB$L_DEVCHAR,5$ MOVAL SCDBUF,R6 5$: CLRL R3 ;INDEX TO DEVTAB MOVZBL DIB$B_DEVCLASS(R6),R0 CLSLP: CMPL R0,DEVTAB[R3] BEQL 10$ ACBL #DEVMAX-DEVTABE,#DEVTABE,R3,CLSLP MOVAQ NOTDSK,FAOLST+FAO$_CTRSTR MAKFAO $FAOL_G FAOLST STR$ OUTDSC RET 10$: ;here if the device is a recognized device: ;output first line: name, type class MOVL DEVTAB+4[R3],R4 ;TYPE TABLE MOVZBL DIB$B_DEVTYPE(R6),R0 CLRL R1 DSKLP: CMPL 4(R4)[R1],R0 BEQL HAVDSK ACBL (R4),#2,R1,DSKLP MOVAB UNK,R2 BRB KNODSK HAVDSK: MOVL 8(R4)[R1],R2 KNODSK: SIZ$ MINLIN=#0,MAXLIN=#8,MINCOL=#0,MAXCOL=#-1 MOVAB OFLIN,R1 BBC #UCB$V_ONLINE,UCB+UCB$W_STS,0$ MOVAB ONLIN,R1 0$: MOVAQ HDRCTR,FAOLST+FAO$_CTRSTR MAKFAO $FAOL_G FAOLST STR$ OUTDSC ;now put out some device specific information: CASEL DEVTAB+8[R3],#0,#DEVIDX DEVCAS: .WORD DSKDEV-DEVCAS .WORD TAPDEV-DEVCAS .WORD TTYDEV-DEVCAS .WORD MBADEV-DEVCAS .WORD LPADEV-DEVCAS BRW UNDEV ;return here DSPDEV: STR$ OUTDSC ;device statistics: UNDEV: MOVAQ STTCTR,FAOLST+FAO$_CTRSTR MAKFAO $FAOL_G FAOLST STR$ OUTDSC BBC #DEV$V_AVL,DIB$L_DEVCHAR(R6),1$ STR$ AVL 1$: BBC #DEV$V_FOR,DIB$L_DEVCHAR(R6),2$ STR$ FOR 2$: BBC #DEV$V_MNT,DIB$L_DEVCHAR(R6),3$ STR$ MNT 3$: BBC #DEV$V_RCK,DIB$L_DEVCHAR(R6),4$ STR$ RCK 4$: BBC #DEV$V_WCK,DIB$L_DEVCHAR(R6),5$ STR$ WCK 5$: BBC #DEV$V_ELG,DIB$L_DEVCHAR(R6),6$ STR$ ELG 6$: BBC #DEV$V_SWL,DIB$L_DEVCHAR(R6),7$ STR$ SWL 7$: BBC #DEV$V_ALL,DIB$L_DEVCHAR(R6),8$ STR$ ALL 8$: BBC #DEV$V_DMT,DIB$L_DEVCHAR(R6),9$ STR$ DMT 9$: ;volume statistics: MOVAQ VOLCTR,FAOLST+FAO$_CTRSTR MAKFAO $FAOL_G FAOLST STR$ OUTDSC MOVZWL DIB$L_OWNUIC+2(R6),-(SP) CALLS #1,OCTDPY CHR$ #COMMA MOVZWL DIB$L_OWNUIC(R6),-(SP) CALLS #1,OCTDPY CHR$ #^A/]/ CLRQ R2 BBS #DEV$V_SPL,UCB+UCB$L_DEVCHAR,NOVCB2 ;WRONG TYPE OF VCB TSTL UCB+UCB$L_VCB BEQL NOVCB2 PMOVAB <@UCB+UCB$L_VCB,R3> CMPB VCB$B_TYPE(R3),#DYN$C_VCB BEQL DOVCB NOVCB2: BRW NOVCB1 DOVCB: MAKFAO MOVAQ VOL2CTR,FAOLST+FAO$_CTRSTR $FAOL_G FAOLST STR$ OUTDSC BITB #<<1@VCB$V_GROUP>!<1@VCB$V_SYSTEM>>,VCB$B_STATUS(R3) BEQL NOGS STR$ STATUS MOVAL SYS,R0 BBC #VCB$V_GROUP,VCB$B_STATUS(R3),NOGR MOVAL GRP,R0 NOGR: STR$ (R0) NOGS: STR$ CRLF ;affiliated ACP statistics TSTL VCB$L_AQB(R3) BEQL NOACP2 PMOVAB <@VCB$L_AQB(R3),R2> CMPB #DYN$C_AQB,AQB$B_TYPE(R2) BEQL ACPX NOACP2: BRW NOACP ACPX: PUSHL AQB$L_ACPPID(R2) MOVAL (SP),R0 $GETJPI_S ITMLST=ACPJPI,PIDADR=(R0) CLRL (SP)+ MOVZBL AQB$B_ACPTYPE(R2),R0 ACPST: CLRL R1 ACPLP: CMPL R0,ACPTYP[R1] BEQL HAVACP ACBL #ACPMAX,#2,R1,ACPLP MOVZBL #AQB$K_UNDEFINED,R0 BRB ACPST HAVACP: MOVL ACPTYP+4[R1],R0 MOVAQ ACPCTR,FAOLST+FAO$_CTRSTR MAKFAO $FAOL_G FAOLST STR$ OUTDSC NOACP: ;more volume stuff: MOVAQ VOL3CTR,FAOLST+FAO$_CTRSTR MAKFAO $FAOL_G FAOLST STR$ OUTDSC NOVCB1: SIZ$ MINLIN=#9,MAXLIN=#16,MINCOL=#0,MAXCOL=#-1 ;irp stuff: ;current request: STR$ IRPHDR PUSHAL IRPADR MOVAQ IRPCTR,FAOLST+FAO$_CTRSTR ADDL3 #UCB$W_STS,UCBADR,-(SP) PUSHL #4 PUSHL #3 MOVAL (SP),R3 $CMEXEC_S ROUTIN=GETMEM,ARGLST=(R3) BLBS R0,10$ 5$: BRW IRPQ 10$: BBC #UCB$V_BSY,IRPADR,5$ ADDL3 #UCB$L_IRP,UCBADR,8(R3) $CMEXEC_S ROUTIN=GETMEM,ARGLST=(R3) BLBC R0,5$ PMOVAB <@IRPADR,R1> EXTZV #0,#2,IRP$B_RMOD(R1),R0 MOVAB MODTAB(R0),R0 MAKFAO $FAOL_G FAOLST STR$ OUTDSC CHR$ #^A/*/ ;irps in the i/o request queue for the device: IRPQ: ADDL3 UCBADR,#UCB$L_IOQFL,8(R3) $CMEXEC_S ROUTIN=GETMEM,ARGLST=(R3) BLBC R0,GTQDON MOVL IRPADR,R4 IRPLP: CMPL R4,8(R3) BNEQ DOIRPQ GTQDON: BRW DOACPIRP DOIRPQ: PMOVAB <(R4),R4> PROBER #0,#IRP$K_LENGTH,(R4) BEQL GTQDON EXTZV #0,#2,IRP$B_RMOD(R4),R0 MOVAB MODTAB(R0),R0 MAKFAO $FAOL_G FAOLST STR$ OUTDSC MOVL IRP$L_IOQFL(R4),R4 BRW IRPLP ;irp request queue for the device's ACP DOACPIRP: CLRQ (SP)+ CLRQ (SP)+ TSTL R2 BEQL GTIDON MOVL AQB$L_ACPQFL(R2),R4 MOVAL AQB$L_ACPQFL(R2),R5 ACPIRPLP: PMOVAB <(R4),R4> CMPL R4,R5 BNEQ ACPQ GTIDON: BRW IRPDDON ACPQ: PROBER #0,#IRP$K_LENGTH,(R4) BEQL GTIDON EXTZV #0,#2,IRP$B_RMOD(R4),R0 MOVAB MODTAB(R0),R0 MAKFAO $FAOL_G FAOLST STR$ OUTDSC CHR$ #^A/$/ MOVL IRP$L_IOQFL(R4),R4 BRW ACPIRPLP IRPDDON: STR$ CRLF ;device specific info: ;disk: fragmentation SIZ$ MINLIN=#17,MAXLIN=#-1,MINCOL=#0,MAXCOL=#-1 BICL2 #FL$M_PLUS,FLAGS MOVL CHAIN,R3 BNEQ 10$ BRW TRYTRM 10$: MOVL FB$L_SIZE(R3),R0 BSBW CNTDIG ;COUNT DIGITS PUSHL R0 ;SAVE MOVL FB$L_COUNT(R3),R0 ;# CMPL #1,R0 ;NO REPL BEQL 14$ BSBW CNTDIG ;THAT ALSO ADDL2 R0,(SP) ;OTHER 14$: ADDL2 #3,(SP) ;INCLUDE ()+ 15$: BBCS #FL$V_PLUS,FLAGS,25$ CHR$ #^A/+/ 25$: LOC$ PTR ;GET ADDL3 PTR+4,(SP)+,R0 ;WHERE WILL BE CMPL R0,#80 BLEQ 20$ STR$ CRLF 20$: PUSHL FB$L_SIZE(R3) ;SIZE CALLS #1,DECDPY CMPL #1,FB$L_COUNT(R3) BEQL 30$ CHR$ #^A/(/ PUSHL FB$L_COUNT(R3) CALLS #1,DECDPY CHR$ #^A/)/ 30$: PUSHL FB$L_LINK(R3) ;SAVE POINTER MOVL R3,TEMP PUSHAL TEMP PUSHAL SIXTEEN CALLS #2,LIB$FREE_VM ;RELEASE ENTRY POPL R3 BEQL 40$ BRW 10$ 40$: MOVL SUM,R0 BSBW CNTDIG ADDL3 #1,R0,-(SP) LOC$ PTR ADDL3 PTR+4,(SP)+,R0 CMPL #80,R0 BGTR 50$ STR$ CRLF 50$: CHR$ #^A/=/ PUSHL SUM CALLS #1,DECDPY TRYTRM: RET ;device specific routines for DIB parameters DSKDEV: MOVAQ DISKCTR,FAOLST+FAO$_CTRSTR MAKFAO $FAOL_G FAOLST BRW DSPDEV TAPDEV: MOVAQ TAPCTR,FAOLST+FAO$_CTRSTR MAKFAO $FAOL_G FAOLST BRW DSPDEV TTYDEV: MOVAQ TERMCTR,FAOLST+FAO$_CTRSTR MAKFAO $FAOL_G FAOLST BRW DSPDEV MBADEV: MOVAQ MBCTR,FAOLST+FAO$_CTRSTR MAKFAO $FAOL_G FAOLST BRW DSPDEV LPADEV: MOVAQ LPCTR,FAOLST+FAO$_CTRSTR MAKFAO $FAOL_G FAOLST BRW DSPDEV .SBTTL MISCELLANEOUS SUBROUTINES .ENTRY DECDPY,^M MOVL #10,R2 BRB NUMDPY .ENTRY OCTDPY,^M MOVL #8,R2 ; BRB NUMDPY NUMDPY: MOVL 4(AP),R0 ;GET NUMBER PUSHAL DECRET LPDEC: CLRL R1 EDIV R2,R0,R0,R1 BNEQ 10$ PUSHL R1 BRB RTDEC 10$: PUSHL R1 PUSHAL RTDEC BRB LPDEC RTDEC: ADDL3 #^A/0/,(SP)+,R0 CHR$ R0 RSB DECRET: RET ;COUNT THE NUMBER OF DIGITS IN NUMBER (DECIMAL) ;NUMBER IS PASSED IN R0, # OF DIGITS IN IT IS RETURNED IN R0 ALSO CNTDIG: MOVZBL #1,R1 ;INIT COUNT CNTLP: DIVL2 #10,R0 ;DIVIDE BY 10 BEQL DONCNT ACBL #^X7FFFFFFF,#1,R1,CNTLP DONCNT: MOVL R1,R0 RSB .SBTTL CONTROL-C TRAP .ENTRY CCTRAP,0 TTY$ #TRM$C_TTY_BOTOM $EXIT_S .SBTTL ROUTINE TO GET THE POOL SET UP ;***THIS ROUTINE ASSUMES THE POOL IS CONTIGUOUS IN PHYSICAL MEMORY**** .ENTRY GETPOOL,^M $CMKRNL_S ROUTIN=KPOOL CLRQ POOL EXTZV #9,#21,SBR,R1 ASHL #2-9,SLR,R0 ;AND COUNT $CRMPSC_S FLAGS=#SEC$M_EXPREG!SEC$M_PFNMAP!SEC$M_PERM,- INADR=POOL,PAGCNT=R0,RETADR=POOL,- VBN=R1 ;MAP TABLE BLBC R0,10$ ASHL #-9,@#SGN$GL_NPAGEDYN,R2 ;SET UP # OF PAGES EXTZV #9,#21,@#MMG$GL_NPAGEDYN,R0 ;GET VPN FOR POOL MOVL POOL,R1 ;POINT TO THERE MOVL (R1)[R0],R3 EXTZV #0,#21,R3,R3 ;GET PFN $DELTVA_S INADR=POOL CLRQ POOL $CRMPSC_S FLAGS=#SEC$M_EXPREG!SEC$M_PFNMAP!SEC$M_PERM,- INADR=POOL,PAGCNT=R2,RETADR=POOL,- VBN=R3 ;SET UP POOL SECTION BLBC R0,10$ SUBL3 @#MMG$GL_NPAGEDYN,POOL,POOLBAS ;FOR DISPLACEMENT 10$: RET .ENTRY KPOOL,0 MFPR #PR$_SBR,SBR ;GET SYSTEM BASE REGISTER MFPR #PR$_SLR,SLR ;ITS SIZE MOVZWL #SS$_NORMAL,R0 RET .SBTTL ROUTINE TO COPY UCB AND DDB ;RUNS IN EXEC MODE FOR "SAFETY" .ENTRY GETUCB,^M CLRL UCBADR CLRL DDBADR MOVL @#IOC$GL_DEVLIST,R6 ;POINT TO DDB'S MOVAB PRIBUF,R7 BBC #DEV$V_SPL,SCDBUF+DIB$L_DEVCHAR,10$ MOVAL SCDBUF,R7 10$: MOVZWL DIB$W_DEVNAMOFF(R7),R9 MOVAB (R7)[R9],R9 MOVZBL (R9)+,R8 DDBLP: MOVZBL DDB$T_NAME(R6),R0 CMPC5 R8,(R9),#0,R0,DDB$T_NAME+1(R6) BEQL HAVDDB NXTDDB: MOVL DDB$L_LINK(R6),R6 BNEQ DDBLP NODEV: MOVZWL #SS$_NOSUCHDEV,R0 RET HAVDDB: MOVL DDB$L_UCB(R6),R8 ;POINT TO UCB'S UCBLP: BEQL NODEV CMPW UCB$W_UNIT(R8),DIB$W_UNIT(R7) ;COMPARE UNITS BEQL HAVUCB MOVL UCB$L_LINK(R8),R8 BRB UCBLP HAVUCB: MOVL R8,UCBADR MOVL R6,DDBADR MOVC3 #UCB$K_LENGTH,(R8),UCB MOVC3 #DDB$K_LENGTH,(R6),DDB MOVZWL #SS$_NORMAL,R0 RET .ENTRY GETMEM,^M ;ARGS: ; 4(AP) LENGTH ; 8(AP) FROM ; 12(AP) TO MOVZWL #SS$_ACCVIO,R0 PROBEW #0,4(AP),@12(AP) BEQL 200$ MOVPSL -(SP) INSV #PSL$C_EXEC,#PSL$V_PRVMOD,#PSL$S_PRVMOD,(SP) PUSHAB 100$ REI 100$: PROBER #0,4(AP),@8(AP) BEQL 200$ MOVC3 4(AP),@8(AP),@12(AP) MOVZWL #SS$_NORMAL,R0 200$: RET .SBTTL WRITABLE DATA .PSECT DATAW,LONG,RD,WRT,NOEXE DISK: .BYTE 0,0,0,0,0,0,0,0,0,0 TTCHN: .BLKW 1 TTIBUF: .BLKB 255 HASHTAB: .BLKL HASHSIZ ;HASH TABLE BITCOR: .BLKQ 1 ;CORE ADDRESS OF SECTION .ALIGN LONG BITFAB: $FAB DNM=<[0,0]BITMAP.SYS>,FOP=UFO,NAM=NAM NAM: $NAM OUTDSC: .BLKL 1 .LONG TTIBUF BUFDSC: .LONG 255 .LONG TTIBUF FLAGS: .BLKL 1 FL$V_HOLE=0 FL$M_HOLE=1 FL$V_PLUS=1 FL$M_PLUS=2 FL$V_FOUND=2 FL$M_FOUND=4 FL$V_REF=3 ;DO REFRESH FL$M_REF=8 CHAIN: .BLKL 1 TEMP: .BLKL 1 IOSB: .BLKQ 1 SUM: .BLKL 1 PTR: .BLKQ 1 VOLSIZ: .BLKQ 1 ;SIZE OF VOLUME IN BLOCKS CLUSTER: .BLKL 1 BLKNG: .BLKL 1 ;BLOCKING FACTOR PRIBUF: .BLKB 64 SCDBUF: .BLKB 64 UCB: .BLKB UCB$K_LENGTH DDB: .BLKB DDB$K_LENGTH ACPNAM: .BLKB 15 POOL: .BLKQ 1 POOLBAS: .BLKL 1 SBR: .BLKL 1 SLR: .BLKL 1 FAOLST: $FAOL OUTLEN=OUTDSC,OUTBUF=BUFDSC,PRMLST=FAOPRM FAOPRM: .BLKL 20 UCBADR: .BLKL 1 DDBADR: .BLKL 1 IRPADR: .BLKL 1 SLPTIM: .LONG -10*1000*1000*5,-1 .SBTTL SHARABLE DATA .PSECT DATAR,RD,NOWRT,NOEXE CMDTAB: .ASCII/DR/ MAXCMD=.-CMDTAB CMDADR: .LONG DCMD .LONG RCMD SIXTEEN: .LONG FB$K_LENGTH CRLF: .ASCID <^O15><^O12> TTDEV: .ASCID/TT/ HDRCTR: .ASCID\Structure !AC!UW: Type !ZB (!AC) Unit !ZW !AC!/\ DISKCTR: .ASCID\Volume size: !ZL Blocking factor: !ZL Cluster size: !ZL!/\- \Sectors/track: !ZB Tracks/cylinder: !ZB Cylinders: !ZW\ TAPCTR: .ASCID\Block size: !ZW\ TERMCTR: .ASCID\Page width: !ZW Page length: !ZB\ MBCTR: .ASCID\Maximum message size: !ZW Number of waiting messages: !ZW\ LPCTR: .ASCID\Page width: !ZW Page length: !ZB\ STTCTR: .ASCID\!/Error count: !ZW Operation count: !ZL \ VOLCTR: .ASCID\!/Protection: !4XW Owner PID: !XL Owner UIC: [\ VOL2CTR: .ASCID\!/Volume name: !AD \ STATUS: .ASCID/Volume status: / GRP: .ASCID\/Group\ SYS: .ASCID\/System\ VOL3CTR: .ASCID\RVN: !ZW Mount count: !ZW Transaction count: \- \!ZW Reference count: !ZW!/\- \Maximum files: !ZL Default protection: !4XW \- \Default extend quantity: !ZW\ ACPCTR: .ASCID\ACP: !AD(PID: !XL) Class: !SB Type: !SB (!AC)!/\ IRPHDR: .ASCID/PID FNC EFN M Count (H) Offset (H) Channel Status/ IRPCTR: .ASCID\!/!XL !XW !2SB !AD !XW !XW !XW !XW\ MODTAB: .ASCII/KESU/ PRIDSC: .LONG 64 .LONG PRIBUF SCDDSC: .LONG 64 .LONG SCDBUF .MACRO DEVTYP NAME .LONG DT$_'NAME' .LONG NAME .SAVE_PSECT .PSECT DEVTYPS,RD,NOWRT,NOEXE 'NAME': .ASCIC/'NAME'/ .RESTORE_PSECT .ENDM .MACRO DEVICE NAME,?L1,?L2 .IF NDF,DEVMAX DEVIDX=0 ;CASE INDEX DEVMAX=0 .ENDC L1: .LONG DC$_'NAME' .LONG 'NAME'TAB .LONG DEVIDX DEVIDX=DEVIDX+1 L2: DEVTABE=/4 DEVMAX=DEVMAX+DEVTABE .ENDM .MACRO TYPTAB LIST,?L1 .ENABLE LSB .LONG /4-1 .IRP FOO,<'LIST'> DEVTYP 'FOO' .ENDR L1: .DISABLE LSB .ENDM DEVTAB: DEVICE DISK DEVICE TAPE DEVICE TERM DEVICE MAILBOX DEVICE LP TAPETAB: TYPTAB TERMTAB: TYPTAB DISKTAB: TYPTAB MAILBOXTAB: TYPTAB LPTAB: TYPTAB UNK: .ASCIC/Unknown/ .MACRO ACP TYPE .SAVE_PSECT .PSECT ACPNAMS,RD,NOWRT,NOEXE TYPE: .ASCIC/TYPE/ .RESTORE_PSECT .LONG AQB$K_'TYPE' .LONG TYPE .ENDM ACPTYP: ACP UNDEFINED ACP F11V1 ACP F11V2 ACP NET ACP MTA ACPMAX=<.-ACPTYP>/4 AVL: .ASCID/ AVL/ FOR: .ASCID/ FOR/ MNT: .ASCID/ MNT/ RCK: .ASCID/ RCK/ WCK: .ASCID/ WCK/ ELG: .ASCID/ ELG/ SWL: .ASCID/ SWL/ ALL: .ASCID/ ALL/ DMT: .ASCID/ DMT/ ONLIN: .ASCIC/On line/ OFLIN: .ASCIC/Off line/ NOTDSK: .ASCID/!AC is not a recognized device/ ACPJPI: .WORD 15,JPI$_PRCNAM .LONG ACPNAM,0 .LONG 0 .SBTTL FORMAT OF DATA STORAGE BLOCK .PSECT FBLOCK,ABS FB$L_LINK: .BLKL 1 ;LINK WORD FB$L_COUNT: .BLKL 1 ;COUNT OF # OF HOLES THIS SIZE FB$L_SIZE: .BLKL 1 ;SIZE OF HOLE FB$L_QUOTIENT: .BLKL 1 ;QUOTIENT FROM DIVISION IN HASH FCN FB$K_LENGTH=.-FB$L_LINK .END D