(FILECREATED " 4-DEC-83 13:23:13" {PHYLUM}<LISPCORE>SOURCES>TTDISKDLION.;1 6392 changes to: (VARS TTDISKDLIONCOMS)) (* Copyright (c) 1983 by Xerox Corporation) (PRETTYCOMPRINT TTDISKDLIONCOMS) (RPAQQ TTDISKDLIONCOMS [(VARS DDFNS \TRIDENTFLG) (FNS \DL.DISKINIT \DL.ACTONVMEMFILE \DL.ACTONVMEMPAGE \DL.DISKSEEK \DL.XFERDISK \DL.DISKOP \D2V \V2HDSEC \V2CYL) (FNS INITDLIONDISK) (DECLARE: EVAL@COMPILE DONTCOPY (FILES (LOADCOMP) LLFAULT) (GLOBALVARS SEC/HD SEC/CYL \DISKTYPE)) (DECLARE: DONTEVAL@LOAD DOCOPY (P (INITDLIONDISK]) (RPAQQ DDFNS (\DL.DISKINIT \DL.ACTONVMEMFILE \DL.ACTONVMEMPAGE \DL.DISKSEEK \DL.XFERDISK \DL.DISKOP \D2V \V2HDSEC \V2CYL)) (RPAQQ \TRIDENTFLG NIL) (DEFINEQ (\DL.DISKINIT [LAMBDA NIL (* bvm: "31-MAR-83 23:07") (COND ((NEQ 0 (LOGAND 32 (\DEVICE.INPUT 3))) (SETQQ \DISKTYPE \SA4000) (SETQ SEC/HD 28) (SETQ SEC/CYL 224)) ((NEQ 0 (LOGAND 64 (\DEVICE.INPUT 6))) (SETQQ \DISKTYPE \QUANTUM) (SETQ SEC/HD 16) (SETQ SEC/CYL 128)) (T (SETQQ \DISKTYPE \SA1000) (SETQ SEC/HD 16) (SETQ SEC/CYL 64]) (\DL.ACTONVMEMFILE [LAMBDA (FILEPAGE BUFFER NPAGES WRITEFLAG) (* bvm: " 4-APR-83 12:58") (DECLARE (GLOBALVARS \FPTOVP)) (FRPTQ NPAGES (\DL.ACTONVMEMPAGE (COND (\FPTOVP (* New way, page is in boot file) (* Pilot page is zero-based, vmem page is one-base) (SUB1 FILEPAGE)) (T (* Old way, page is in sysout after initial core image) (IPLUS 3069 FILEPAGE))) BUFFER WRITEFLAG) (* the simple IPLUS here is actually converting from sysout file page number into a raw disk address. Obviously, this will have to change, since it assumes, e.g., no bad pages in this region of the disk) (SETQ BUFFER (\ADDBASE BUFFER WORDSPERPAGE)) (add FILEPAGE 1]) (\DL.ACTONVMEMPAGE [LAMBDA (FILEPAGE BUFFER WRITEFLAG) (* bvm: "31-MAR-83 22:47") (PROG ((LINKBASE (ADDBASE \IOCBPAGE 127)) (I 42)) LP [COND ((OR (IGREATERP (\GETBASE LINKBASE 3) FILEPAGE) (EQ 0 (\GETBASE LINKBASE 3))) (RETURN (\DL.XFERDISK (IPLUS (\D2V (\GETBASE LINKBASE 1) (\GETBASE LINKBASE 2)) (IDIFFERENCE FILEPAGE (\GETBASE LINKBASE 0))) BUFFER WRITEFLAG] (SETQ LINKBASE (\ADDBASE LINKBASE 3)) (COND ((EQ 0 I) (RAID) (RETURN))) (SETQ I (SUB1 I)) (GO LP]) (\DL.DISKSEEK [LAMBDA (CYL) (* bvm: "31-MAR-83 22:47") (PROG [SEEKBITS (DISP (IDIFFERENCE CYL (\GETBASE \IOCBPAGE 9] (COND ((ZEROP DISP) (RETURN 0))) (SETQ SEEKBITS 1056) (COND ((IGREATERP 0 DISP) (SETQ DISP (IMINUS DISP))) (T (SETQ SEEKBITS 1120))) (\PUTBASE \IOCBPAGE 87 (LOGOR SEEKBITS 128)) (\PUTBASE \IOCBPAGE 89 SEEKBITS) (\PUTBASE \IOCBPAGE 81 (ADD1 (LOGXOR DISP 65535))) (\PUTBASE \IOCBPAGE 9 CYL) (RETURN (\DL.DISKOP 338]) (\DL.XFERDISK [LAMBDA (DA BUFFER WRITEFLG) (* bvm: "31-MAR-83 22:47") (\DL.DISKSEEK (\V2CYL DA)) (PROG ((RETRYCNT 10) (HDSEC (\V2HDSEC DA)) STATUS) LP (\PUTBASE \IOCBPAGE 10 HDSEC) (\PUTBASE \IOCBPAGE 64 1) (\PUTBASE \IOCBPAGE 75 (COND (WRITEFLG 1083) (T 1072))) (\PUTBASE \IOCBPAGE 77 (SUB1 (fetch (POINTER PAGE#) of BUFFER))) (\PUTBASE \IOCBPAGE 78 (COND (WRITEFLG 28) (T 30))) (\PUTBASE \IOCBPAGE 79 (LOGOR (LOGAND (\GETBASE \IOCBPAGE 79) 2047) (LLSH (LOGAND HDSEC 65280) 3))) (\PUTBASE \IOCBPAGE 80 (LOGOR (LOGAND (\GETBASE \IOCBPAGE 80) 2047) (LLSH (LOGAND HDSEC 65280) 3))) (* DSKRD1=DISKOP) (COND ((ZEROP (\DL.DISKOP 355)) (RETURN T))) (SETQ RETRYCNT (SUB1 RETRYCNT)) (COND ((ZEROP RETRYCNT) (RAID)) (T (GO LP]) (\DL.DISKOP [LAMBDA (IOCB) (* edited: "16-MAR-83 11:57") (\PUTBASE \IOPAGE 1 IOCB) (\PUTBASE \IOCBPAGE 3 256) (\DEVICE.OUTPUT 32 3) (until (ZEROP (LOGAND (\GETBASE \IOCBPAGE 3) 256))) (LOGAND 63 (\GETBASE \IOCBPAGE 3]) (\D2V [LAMBDA (CYL HDSEC) (* lmm "13-DEC-82 17:40") (PROG ((HD (FOLDLO HDSEC 256)) (SEC (IMOD HDSEC 256))) (RETURN (IPLUS (ITIMES CYL SEC/CYL) (ITIMES HD SEC/HD) SEC]) (\V2HDSEC [LAMBDA (DA) (* scp " 8-MAR-83 02:20") (* returns the head and sector number, packed into one word, for the disk address DA) (PROG ((SEC (IMOD DA SEC/HD)) (HD (IQUOTIENT (IMOD DA SEC/CYL) SEC/HD))) (RETURN (LOGOR (LLSH HD 8) SEC]) (\V2CYL [LAMBDA (DA) (* scp " 8-MAR-83 02:22") (* returns the cylinder number of virtual disk address DA) (IQUOTIENT DA SEC/CYL]) ) (DEFINEQ (INITDLIONDISK [LAMBDA NIL (* bvm: "31-MAR-83 22:45") (MAPC (QUOTE (\MAKENUMBER \SETGLOBALVAL.UFN \RPLPTR.UFN \HTFIND \SLOWIPLUS2 \SLOWIDIFFERENCE \SLOWLLSH1 \SLOWLLSH8 \SLOWLRSH1 \SLOWLRSH8 \SLOWLOGOR2 \SLOWLOGAND2 \SLOWLOGXOR2 \SLOWIGREATERP \SLOWIQUOTIENT \SLOWITIMES2 IMOD IREMAINDER) ) (FUNCTION \LOCKFN)) (MAPC DDFNS (FUNCTION \LOCKFN)) (MAPC (QUOTE (\SMALLNEGSPACE \IOCBPAGE \MDSTypeTable \HTCOLL \HTMAIN \VMBASEDP SEC/HD SEC/CYL \DISKTYPE)) (FUNCTION \LOCKVAR]) ) (DECLARE: EVAL@COMPILE DONTCOPY (FILESLOAD (LOADCOMP) LLFAULT) (DECLARE: DOEVAL@COMPILE DONTCOPY (ADDTOVAR GLOBALVARS SEC/HD SEC/CYL \DISKTYPE) ) ) (DECLARE: DONTEVAL@LOAD DOCOPY (INITDLIONDISK) ) (PUTPROPS TTDISKDLION COPYRIGHT ("Xerox Corporation" 1983)) (DECLARE: DONTCOPY (FILEMAP (NIL (752 5519 (\DL.DISKINIT 762 . 1179) (\DL.ACTONVMEMFILE 1181 . 2046) (\DL.ACTONVMEMPAGE 2048 . 2669) (\DL.DISKSEEK 2671 . 3274) (\DL.XFERDISK 3276 . 4290) (\DL.DISKOP 4292 . 4593) (\D2V 4595 . 4837) (\V2HDSEC 4839 . 5244) (\V2CYL 5246 . 5517)) (5520 6105 (INITDLIONDISK 5530 . 6103))))) STOP