(FILECREATED " 7-Aug-85 22:05:24" {ERIS}<DOVE>LISPHEADS>DOVEFLOPPY.;30 35464 changes to: (FNS \DOVEFLOPPY.XFERDISK \DoveFloppy.GetErrorStatus \DoveFloppy.Init \DoveFloppy.Initiate \DoveFloppy.StopHandler \DoveFloppy.Transfer \DOVEFLOPPY.SETCONTEXT \DOVEFLOPPY.RESET \DOVEFLOPPY.WRITEPROTECTED BUFBYTES TEST PRINTBUF REFRSH \DoveFloppy.InitIOCB GETRES \DoveFloppy.SetupPrimitiveFDCOp \DoveFloppy.SetupDMAInfo \DoveFloppy.ValidateIOCB) (VARS DOVEFLOPPYCOMS \DoveFloppy.ST2Masks \DoveFloppy.ST1Masks \DoveFloppy.ST0Masks \DoveFloppy.Debug \DoveFloppy.ByteFALSE \DoveFloppy.ByteTRUE) (RECORDS Dove.FloppyFDCCommand) previous date: " 5-Aug-85 12:42:08" {ERIS}<DOVE>LISPHEADS>DOVEFLOPPY.;15) (* Copyright (c) 1985 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT DOVEFLOPPYCOMS) (RPAQQ DOVEFLOPPYCOMS ((RECORDS Dove.FloppyCmdBytes Dove.FloppyContext Dove.FloppyDCB Dove.FloppyFCB Dove.FloppyFDCCommand Dove.FloppyFormatInfo Dove.FloppyIOCB Dove.FloppySectorHeader Dove.QueueBlock) (VARS \DoveFloppy.#CommandBytes \DoveFloppy.#ResultBytes \DoveFloppy.Commands \DoveFloppy.DMAInterruptWhenDone \DoveFloppy.DataTransferOps \DoveFloppy.Debug \DoveFloppy.FDCByteOneMasks \DoveFloppy.FDCByteTwoMasks \DoveFloppy.FormatInfo \DoveFloppy.ImpliedSeekOps \DoveFloppy.ST0Masks \DoveFloppy.ST1Masks \DoveFloppy.ST2Masks \DoveFloppy.SectorLengths \DoveFloppy.WaitForInterruptCmds \DoveFloppy.CurrentContext) (FNS \DOVEFLOPPY.RESET \DOVEFLOPPY.SETCONTEXT \DOVEFLOPPY.XFERDISK \DoveFloppy.ByteSwapIOCB \DoveFloppy.ClearDiskChanged \DoveFloppy.DiskChanged \DoveFloppy.DoorOpen \DoveFloppy.GetErrorStatus \DoveFloppy.Init \DoveFloppy.InitDCB \DoveFloppy.InitIOCB \DoveFloppy.Initiate \DoveFloppy.SetupDMAInfo \DoveFloppy.SetupPrimitiveFDCOp \DoveFloppy.StopHandler \DoveFloppy.Transfer \DoveFloppy.ValidateIOCB \DOVEFLOPPY.WRITEPROTECTED \DoveFloppy.XferDisk) (INITVARS \DoveFloppy.IOCB \DoveFloppy.CurrentContext) (GLOBALVARS \DoveFloppy.IOCB \DoveFloppy.CurrentContext) (CONSTANTS \DoveFloppy.StopDMA \DoveFloppy.StartDMAWrite \DoveFloppy.StopCounter \DoveFloppy.StartDMARead \DoveFloppy.StartCounter \DoveFloppy.ByteTRUE \DoveFloppy.ByteFALSE) (CONSTANTS \DoveFloppy.HardDoubleDensity \DoveFloppy.HardFDCCommands \DoveFloppy.HardHeadOne \DoveFloppy.HardMultiTrackMode \DoveFloppy.HardSkipDeletedSector) (CONSTANTS \DoveFloppy.DMAInterruptWhenDone \DoveFloppy.FDCCmdLength \DoveFloppy.None \DoveFloppy.Read \DoveFloppy.Write) (CONSTANTS \DoveFloppy.WriteProtected \DoveFloppy.Waiting \DoveFloppy.Read \DoveFloppy.Write \DoveFloppy.None \DoveFloppy.OperationCompleted \DoveFloppy.InProgress \DoveFloppy.OperationFailed \DoveFloppy.OperationBuilt))) [DECLARE: EVAL@COMPILE (BLOCKRECORD Dove.FloppyCmdBytes ((CB1 BYTE) (CB2 BYTE) (CB3 BYTE) (CB4 BYTE) (CB5 BYTE) (CB6 BYTE) (CB7 BYTE) (CB8 BYTE) (CB9 BYTE))) (TYPERECORD Dove.FloppyContext (DRIVETYPE SECTORSPERTRACK NUMBEROFHEADS NUMBEROFCYLINDERS DENSITY DISKCHANGED SECTORLENGTH)) (BLOCKRECORD Dove.FloppyDCB ((DeviceAttributes 5 WORD) (DriveAcquiredByPCE BYTE) (DriveBusy BYTE) (DiagnosticDiskChanged WORD) (PilotDiskChanged WORD) (DiagnosticContext WORD) (PilotContext WORD) (DoorOpen WORD) (DriveStatusHead0 BYTE) (DriveStatusHead1 BYTE) (ExtraWordForGatchas WORD))) (BLOCKRECORD Dove.FloppyFCB ((FloppyTask 15 WORD) (FloppyDMATask 15 WORD) (FloppyStopHandler BYTE) (FloppyResetFDC BYTE) (FloppyHandlerIsStopped BYTE) (FloppyFDCHung BYTE) (FloppyWaitingForDMA BYTE) (FloppyFirstDMAInterrupt BYTE) (FloppyDriveMotorControlCount BYTE) (FloppyNumberOfDrives BYTE) (FloppyBadDMAInterruptCount BYTE) (FloppyBadFDCInterruptCount BYTE) (FloppyStepRateTime BYTE) (FloppyHeadLoadTime BYTE) (FloppyFillerForFormatting BYTE) (FloppyDiagnosticsOn BYTE) (FloppyPCEReset BYTE) (FloppyPCEStartMotor BYTE) (FloppyWorkMask WORD) (FloppyWorkNotify WORD) (FloppyLockMask WORD) (FloppyCurrentIOCB 2 WORD) (FloppyDiagnosticQueue 6 WORD) (FloppyPilotQueue 6 WORD) (FloppyIOPQueue 6 WORD) (FloppyDCB0Base 13 WORD) (FloppyDCB1Base 13 WORD) (FloppyDCB2Base 13 WORD) (FloppyDCB3Base 13 WORD))) (BLOCKRECORD Dove.FloppyFDCCommand ((FDCCode BYTE) (DataTransferCode BYTE) (NIL BYTE) (MustWaitForInterrupt BYTE) (NumberOfCommandBytes BYTE) (NumberOfCommandBytesWritten BYTE) (CommandBytes 10 BYTE) (NumberOfResultBytes BYTE) (NumberOfResultBytesRead BYTE) (ResultBytes 8 BYTE))) (RECORD Dove.FloppyFormatInfo (ValidFormat SectorsPerTrack ReadWriteGapLength FormatGapLength)) (BLOCKRECORD Dove.FloppyIOCB ((CYLINDER BYTE) (HEAD BYTE) (SECTOR BYTE) (DENSITY BYTE) (NIL WORD) (RECALIBRATEFIRST? FLAG) (RESETFIRST? FLAG) (NIL BITS 6) (DataTransferCode BYTE) (BUFFER POINTER) (OPERATION POINTER) (FDCOperation BYTE) (NIL BYTE) (FloppyContext WORD) (AlternateSectors FLAG) (MultiTrackMode FLAG) (SkipDeletedSector FLAG) (NIL BITS 5) (CurrentRetryCount BYTE) (IsQueued BYTE) (OperationState BYTE) (NextIOCB 2 WORD) (DataAddress 2 WORD) (ClientCondition 3 WORD) (ExtraWord1 WORD) (ExtraWord2 WORD) (ResetFDCBeforeProcessing BYTE) (RecalibrateBeforeProcessing BYTE) (DriveNumber BYTE) (FDCHung BYTE) (BytesToTransfer WORD) (BytesTransferred WORD) (CounterControlReg WORD) (FirstDMATransferCount WORD) (FirstDMAControlWord WORD) (NumberOfMiddleDMATransfers WORD) (MiddleDMATransferCount WORD) (MiddleDMAControlWord WORD) (LastDMATransferCount WORD) (LastDMAControlWord WORD) (FinalDMACount WORD) (IncrementDataPtr BYTE) (NIL BYTE) (NumberOfFDCCommands WORD) (CurrentFDCCommand WORD) (FDCCommands 39 WORD))) (BLOCKRECORD Dove.FloppySectorHeader ((Cylinder BYTE) (Head BYTE) (Sector BYTE) (EncodedSectorLength BYTE))) (BLOCKRECORD Dove.QueueBlock ((QueueHead 2 WORD) (QueueTail 2 WORD) (QueueNext 2 WORD))) ] (RPAQQ \DoveFloppy.#CommandBytes ((NOP . 0) (FORMATTRACK . 6) (READDATA . 9) (READDELETEDDATA . 9) (READID . 2) (READTRACK . 9) (RECALIBRATE . 2) (SCANEQUAL . 9) (SCANHIGHOREQUAL . 9) (SCANLOWOREQUAL . 9) (SEEK . 3) (SENSEDRIVESTATUS . 2) (SENSEINTERRUPTSTATUS . 1) (SPECIFY . 3) (WRITEDATA . 9) (WRITEDELETEDDATA . 9))) (RPAQQ \DoveFloppy.#ResultBytes ((NOP . 0) (FORMATTRACK . 7) (READDATA . 7) (READDELETEDDATA . 7) (READID . 7) (READTRACK . 7) (RECALIBRATE . 0) (SCANEQUAL . 7) (SCANHIGHOREQUAL . 7) (SCANLOWOREQUAL . 7) (SEEK . 0) (SENSEDRIVESTATUS . 1) (SENSEINTERRUPTSTATUS . 2) (SPECIFY . 0) (WRITEDATA . 7))) (RPAQQ \DoveFloppy.Commands ((NOP . 0) (FORMATTRACK . 1) (READDATA . 2) (READDELETEDDATA . 3) (READID . 4) (READTRACK . 5) (RECALIBRATE . 6) (SCANEQUAL . 7) (SCANHIGHOREQUAL . 8) (SCANLOWOREQUAL . 9) (SEEK . 10) (SENSEDRIVESTATUS . 11) (SENSEINTERRUPTSTATUS . 12) (SPECIFY . 13) (WRITEDATA . 14) (WRITEDELETEDDATA . 15))) (RPAQQ \DoveFloppy.DMAInterruptWhenDone 256) (RPAQQ \DoveFloppy.DataTransferOps ((NOP . 0) (FORMATTRACK . 2) (READDATA . 1) (READDELETEDDATA . 1) (READID . 0) (READTRACK . 1) (RECALIBRATE . 0) (SCANEQUAL . 2) (SCANHIGHOREQUAL . 2) (SCANLOWOREQUAL . 2) (SEEK . 0) (SENSEDRIVESTATUS . 0) (SENSEINTERRUPTSTATUS . 0) (SPECIFY . 0) (WRITEDATA . 2) (WRITEDELETEDDATA . 2))) (RPAQQ \DoveFloppy.Debug NIL) (RPAQQ \DoveFloppy.FDCByteOneMasks ((NOP . 0) (FORMATTRACK . 95) (READDATA . 255) (READDELETEDDATA . 255) (READID . 95) (READTRACK . 127) (RECALIBRATE . 31) (SCANEQUAL . 255) (SCANHIGHOREQUAL . 255) (SCANLOWOREQUAL . 255) (SEEK . 31) (SENSEDRIVESTATUS . 31) (SENSEINTERRUPTSTATUS . 31) (SPECIFY . 31) (WRITEDATA . 223) (WRITEDELETEDDATA . 223))) (RPAQQ \DoveFloppy.FDCByteTwoMasks ((NOP . 0) (FORMATTRACK . 7) (READDATA . 7) (READDELETEDDATA . 7) (READID . 7) (READTRACK . 7) (RECALIBRATE . 3) (SCANEQUAL . 7) (SCANHIGHOREQUAL . 7) (SCANLOWOREQUAL . 7) (SEEK . 7) (SENSEDRIVESTATUS . 7) (SENSEINTERRUPTSTATUS . 0) (SPECIFY . 255) (WRITEDATA . 7) (WRITEDELETEDDATA . 7))) (RPAQQ \DoveFloppy.FormatInfo [(128 ((SINGLE T 16 16 25) (DOUBLE NIL 0 0 0))) (256 ((SINGLE T 8 24 48) (DOUBLE T 16 32 50))) (512 ((SINGLE T 4 70 135) (DOUBLE T 9 42 80))) (1024 ((SINGLE NIL 2 200 255) (DOUBLE NIL 4 200 255))) (2048 ((SINGLE NIL 1 200 255) (DOUBLE NIL 2 200 255))) (4096 ((SINGLE NIL 0 0 0) (DOUBLE NIL 1 200 255]) (RPAQQ \DoveFloppy.ImpliedSeekOps (FORMATTRACK READDATA READDELETEDDATA READID READTRACK SCANEQUAL SCANHIGHOREQUAL SCANLOWOREQUAL SEEK WRITEDATA WRITEDELETEDDATA)) (RPAQQ \DoveFloppy.ST0Masks ((8 . NOTREADY))) (RPAQQ \DoveFloppy.ST1Masks ((128 . ENDOFTRACK) (32 . DATAERROR) (16 . OVERRUNERROR) (4 . SECTORNOTFOUND) (2 . WRITEPROTECTED) (1 . MISSINGADDRESSMARK))) (RPAQQ \DoveFloppy.ST2Masks ((16 . WRONGCYLINDER) (8 . SCANEQUALHIT) (4 . SCANNOTSATISFIED) (2 . BADCYLINDER))) (RPAQQ \DoveFloppy.SectorLengths ((128 . 0) (256 . 1) (512 . 2) (1024 . 3) (2048 . 4) (4096 . 5))) (RPAQQ \DoveFloppy.WaitForInterruptCmds (FORMATTRACK READDATA READDELETEDDATA READID READTRACK RECALIBRATE SCANEQUAL SCANHIGHOREQUAL SCANLOWOREQUAL SEEK WRITEDATA WRITEDELETEDDATA)) (RPAQQ \DoveFloppy.CurrentContext (Dove.FloppyContext SA455 9 2 40 DOUBLE NIL 512)) (DEFINEQ (\DOVEFLOPPY.RESET [LAMBDA NIL (* mpl " 7-Aug-85 15:17") (\DoveFloppy.Init]) (\DOVEFLOPPY.SETCONTEXT [LAMBDA (DENSITY SECTORLENGTH) (* mpl " 7-Aug-85 15:20") (DECLARE (GLOBALVARS \DoveFloppy.SectorLengths \DoveFloppy.CurrentContext)) (COND ((NOT (LISTP \DoveFloppy.CurrentContext)) (\DoveFloppy.Init))) (COND ((FMEMB DENSITY (QUOTE (SINGLE DOUBLE))) (replace (Dove.FloppyContext DENSITY) of \DoveFloppy.CurrentContext with DENSITY)) (T (HELP "Invalid density " DENSITY))) (COND ((FASSOC SECTORLENGTH \DoveFloppy.SectorLengths) (replace (Dove.FloppyContext SECTORLENGTH) of \DoveFloppy.CurrentContext with SECTORLENGTH)) (T (HELP "Invalid sector length " SECTORLENGTH]) (\DOVEFLOPPY.XFERDISK [LAMBDA (CYL HD SEC BUFF MODE RECAL? RESET?) (* mpl " 7-Aug-85 22:04") (LET ((Status NIL)) (for I from 0 to 10 do (SETQ Status (\DoveFloppy.Transfer CYL HD SEC BUFF MODE RESET? RECAL?)) (COND ((OR (EQ Status (QUOTE OK)) (EQ Status (QUOTE TIMEOUT))) (RETURN Status))) (COND ((OR (EQ I 6) (EQ I 8)) (SETQ RECAL? T)) ((EQ I 7) (SETQ RESET? T))) finally (RETURN Status]) (\DoveFloppy.ByteSwapIOCB [LAMBDA (IOCB) (* mpl " 4-Aug-85 13:46") (with Dove.FloppyIOCB IOCB (SETQ ExtraWord1 (\DoveIO.ByteSwap ExtraWord1)) (SETQ ExtraWord2 (\DoveIO.ByteSwap ExtraWord2)) (SETQ BytesToTransfer (\DoveIO.ByteSwap BytesToTransfer)) (SETQ BytesTransferred (\DoveIO.ByteSwap BytesTransferred)) (SETQ CounterControlReg (\DoveIO.ByteSwap CounterControlReg)) (SETQ FirstDMATransferCount (\DoveIO.ByteSwap FirstDMATransferCount)) (SETQ FirstDMAControlWord (\DoveIO.ByteSwap FirstDMAControlWord)) (SETQ NumberOfMiddleDMATransfers (\DoveIO.ByteSwap NumberOfMiddleDMATransfers)) (SETQ MiddleDMATransferCount (\DoveIO.ByteSwap MiddleDMATransferCount)) (SETQ MiddleDMAControlWord (\DoveIO.ByteSwap MiddleDMAControlWord)) (SETQ LastDMATransferCount (\DoveIO.ByteSwap LastDMATransferCount)) (SETQ LastDMAControlWord (\DoveIO.ByteSwap LastDMAControlWord)) (SETQ FinalDMACount (\DoveIO.ByteSwap FinalDMACount)) (SETQ NumberOfFDCCommands (\DoveIO.ByteSwap NumberOfFDCCommands)) (SETQ CurrentFDCCommand (\DoveIO.ByteSwap CurrentFDCCommand]) (\DoveFloppy.ClearDiskChanged [LAMBDA NIL (* mpl " 4-Aug-85 12:39") (replace (Dove.FloppyDCB PilotDiskChanged) of (LOCF (fetch (Dove.FloppyFCB FloppyDCB0Base) of (\DoveFCBAt \Dove.FloppyFCBOffset))) with 0]) (\DoveFloppy.DiskChanged [LAMBDA NIL (* mpl " 4-Aug-85 12:39") (NOT (EQ 0 (fetch (Dove.FloppyDCB PilotDiskChanged) of (LOCF (fetch (Dove.FloppyFCB FloppyDCB0Base) of (\DoveFCBAt \Dove.FloppyFCBOffset]) (\DoveFloppy.DoorOpen [LAMBDA NIL (* mpl " 4-Aug-85 12:40") (NOT (EQ 0 (fetch (Dove.FloppyDCB DoorOpen) of (LOCF (fetch (Dove.FloppyFCB FloppyDCB0Base) of (\DoveFCBAt \Dove.FloppyFCBOffset]) (\DoveFloppy.GetErrorStatus [LAMBDA (IOCB) (* mpl " 7-Aug-85 20:52") (DECLARE (GLOBALVARS \DoveFloppy.ST0Masks \DoveFloppy.ST1Masks \DoveFloppy.ST2Masks)) (LET* ((CmdIndex (SUB1 (fetch (Dove.FloppyIOCB CurrentFDCCommand) of IOCB))) (CmdLoc (\ADDBASE (LOCF (fetch (Dove.FloppyIOCB FDCCommands) of IOCB)) (ITIMES CmdIndex \DoveFloppy.FDCCmdLength))) (CmdBytes (LOCF (fetch (Dove.FloppyFDCCommand ResultBytes) of CmdLoc))) (ST0 (fetch (Dove.FloppyCmdBytes CB1) of CmdBytes)) (ST1 (fetch (Dove.FloppyCmdBytes CB2) of CmdBytes)) (ST2 (fetch (Dove.FloppyCmdBytes CB3) of CmdBytes)) (Status NIL)) [COND ((EQ (fetch (Dove.FloppyIOCB OperationState) of IOCB) \DoveFloppy.InProgress) (SETQ Status (QUOTE TIMEOUT] [SETQ Status (OR Status (for I in \DoveFloppy.ST0Masks do (COND ((NEQ 0 (LOGAND (CAR I) ST0)) (RETURN (CDR I] [SETQ Status (OR Status (for I in \DoveFloppy.ST1Masks do (COND ((NEQ 0 (LOGAND (CAR I) ST1)) (RETURN (CDR I] [SETQ Status (OR Status (for I in \DoveFloppy.ST2Masks do (COND ((NEQ 0 (LOGAND (CAR I) ST2)) (RETURN (CDR I] (OR Status (QUOTE OK]) (\DoveFloppy.Init [LAMBDA NIL (* mpl " 7-Aug-85 20:45") (DECLARE (GLOBALVARS \DoveFloppy.CurrentContext)) (PROG1 (\DoveFloppy.StopHandler) (SETQ \DoveFloppy.CurrentContext (create Dove.FloppyContext DRIVETYPE ←(QUOTE SA455) SECTORSPERTRACK ← 9 NUMBEROFCYLINDERS ← 40 NUMBEROFHEADS ← 2 DENSITY ←(QUOTE DOUBLE) SECTORLENGTH ← 512 DISKCHANGED ← NIL)) (\DoveFloppy.InitDCB]) (\DoveFloppy.InitDCB [LAMBDA NIL (* mpl " 4-Aug-85 13:49") (with Dove.FloppyDCB (LOCF (fetch (Dove.FloppyFCB FloppyDCB0Base) of (\DoveFCBAt \Dove.FloppyFCBOffset))) (SETQ DoorOpen 0) (SETQ PilotDiskChanged 0]) (\DoveFloppy.InitIOCB [LAMBDA (IOCB) (* mpl " 7-Aug-85 00:08") (DECLARE (GLOBALVARS \DoveFloppy.Commands \DoveFloppy.ImpliedSeekOps \DoveFloppy.DataTransferCode \DoveFloppy.DataTransferOps)) (LET ([DCBPtr (LOCF (fetch (Dove.FloppyFCB FloppyDCB0Base) of (\DoveFCBAt \Dove.FloppyFCBOffset] (Op (fetch (Dove.FloppyIOCB OPERATION) of IOCB))) (\CLEARWORDS (LOCF (fetch (Dove.FloppyIOCB FDCOperation) of IOCB)) 81) (\DoveIO.MakeOpieAddress (LOCF (fetch (Dove.FloppyIOCB NextIOCB) of IOCB)) NIL) (\DoveIO.MakeOpieAddress (LOCF (fetch (Dove.FloppyIOCB DataAddress) of IOCB)) (fetch (Dove.FloppyIOCB BUFFER) of IOCB)) [with Dove.FloppyIOCB IOCB (SETQ AlternateSectors NIL) (SETQ FDCOperation (CDR (FASSOC Op \DoveFloppy.Commands))) (SETQ MultiTrackMode T) (SETQ SkipDeletedSector NIL) (SETQ CurrentRetryCount 1) (SETQ IsQueued \DoveFloppy.ByteFALSE) (SETQ OperationState \DoveFloppy.OperationBuilt) (SETQ ResetFDCBeforeProcessing (COND (RESETFIRST? \DoveFloppy.ByteTRUE) (T \DoveFloppy.ByteFALSE))) (SETQ RecalibrateBeforeProcessing (COND (RECALIBRATEFIRST? \DoveFloppy.ByteTRUE) (T \DoveFloppy.ByteFALSE))) (SETQ DriveNumber 0) (SETQ FDCHung \DoveFloppy.ByteFALSE) (SETQ CounterControlReg \DoveFloppy.StopCounter) (SETQ FirstDMAControlWord \DoveFloppy.StopDMA) (SETQ MiddleDMAControlWord \DoveFloppy.StopDMA) (SETQ LastDMAControlWord \DoveFloppy.StopDMA) (SETQ DataTransferCode (CDR (FASSOC Op \DoveFloppy.DataTransferOps] [COND ((FMEMB Op \DoveFloppy.ImpliedSeekOps) (\DoveFloppy.SetupPrimitiveFDCOp IOCB (QUOTE SEEK)) (\DoveFloppy.SetupPrimitiveFDCOp IOCB (QUOTE SENSEINTERRUPTSTATUS] (COND ([NOT (FMEMB Op (QUOTE (NOP SEEK] (\DoveFloppy.SetupPrimitiveFDCOp IOCB Op) (COND ((EQ Op (QUOTE RECALIBRATE)) (\DoveFloppy.SetupPrimitiveFDCOp IOCB (QUOTE SENSEINTERRUPTSTATUS]) (\DoveFloppy.Initiate [LAMBDA (IOCB) (* mpl " 7-Aug-85 20:59") (* * This fn makes the IOP go.) (* * We don't care about queues of IOCBs to floppies... what a waste!) (LET ([QueueNextLoc (LOCF (fetch (Dove.QueueBlock QueueNext) of (LOCF (fetch (Dove.FloppyFCB FloppyPilotQueue) of (\DoveFCBAt \Dove.FloppyFCBOffset] (Timer NIL) (Results NIL)) (* \DoveIO.LockMem is pointless here) (\DoveFloppy.ValidateIOCB IOCB) (\DoveFloppy.InitIOCB IOCB) (\DoveFloppy.SetupDMAInfo IOCB) (replace (Dove.FloppyIOCB OperationState) of IOCB with \DoveFloppy.Waiting) (replace (Dove.FloppyIOCB IsQueued) of IOCB with \DoveFloppy.ByteTRUE) (\DoveFloppy.ByteSwapIOCB IOCB) (* Lock buffer before doing anything) (\LOCKPAGES IOCB 1) (\PUTBASE (fetch (Dove.FloppyIOCB BUFFER) of IOCB) 0 (\GETBASE (fetch (Dove.FloppyIOCB BUFFER) of IOCB) 0)) (\LOCKPAGES (fetch (Dove.FloppyIOCB BUFFER) of IOCB) 1) (replace (Dove.FloppyFCB FloppyStopHandler) of (\DoveFCBAt \Dove.FloppyFCBOffset) with \DoveFloppy.ByteFALSE) (COND ((EQ \DoveFloppy.ByteTRUE (fetch (Dove.FloppyFCB FloppyFDCHung) of (\DoveFCBAt \Dove.FloppyFCBOffset))) (replace (Dove.FloppyFCB FloppyResetFDC) of (\DoveFCBAt \Dove.FloppyFCBOffset) with \DoveFloppy.ByteTRUE))) (\DoveIO.MakeOpieAddress QueueNextLoc IOCB) (\DoveIO.NotifyIOP (fetch (Dove.FloppyFCB FloppyWorkMask) of (\DoveFCBAt \Dove.FloppyFCBOffset))) [SETQ Results (for I from 1 to 3 do (SETQ Timer (SETUPTIMER 5000)) (until (OR (TIMEREXPIRED? Timer) (EQ (fetch (Dove.FloppyIOCB OperationState) of IOCB) \DoveFloppy.OperationCompleted) (EQ (fetch (Dove.FloppyIOCB OperationState) of IOCB) \DoveFloppy.OperationFailed)) do (BLOCK)) [COND ((TIMEREXPIRED? Timer) (\DoveFloppy.StopHandler)) (T (RETURN (QUOTE OK] finally (RETURN (QUOTE TIMEOUT] (\DoveFloppy.ByteSwapIOCB IOCB) (\UNLOCKPAGES IOCB 1) (\UNLOCKPAGES (fetch (Dove.FloppyIOCB BUFFER) of IOCB) 1) (COND ((EQ Results (QUOTE TIMEOUT)) (replace (Dove.FloppyIOCB OperationState) of IOCB with \DoveFloppy.InProgress))) (fetch (Dove.FloppyIOCB OperationState) of IOCB]) (\DoveFloppy.SetupDMAInfo [LAMBDA (IOCB) (* mpl " 6-Aug-85 23:09") (DECLARE (GLOBALVARS \DoveFloppy.CurrentContext \DoveFloppy.FormatInfo \DoveFloppy.SectorLengths)) (LET [(FormatInfo (CDR (FASSOC (fetch (Dove.FloppyContext DENSITY) of \DoveFloppy.CurrentContext) (CADR (FASSOC (fetch (Dove.FloppyContext SECTORLENGTH) of \DoveFloppy.CurrentContext) \DoveFloppy.FormatInfo] (replace (Dove.FloppyIOCB CounterControlReg) of IOCB with \DoveFloppy.StartCounter) (SELECTQ (fetch (Dove.FloppyIOCB OPERATION) of IOCB) (FORMATTRACK [for I from 1 to (fetch (Dove.FloppyFormatInfo SectorsPerTrack) of FormatInfo) do (with Dove.FloppySectorHeader (\ADDBASE (fetch (Dove.FloppyIOCB BUFFER) of IOCB) (ITIMES 2 (SUB1 I))) (SETQ Cylinder (fetch (Dove.FloppyIOCB CYLINDER) of IOCB)) (SETQ Head (fetch (Dove.FloppyIOCB HEAD) of IOCB)) (SETQ Sector I) (SETQ EncodedSectorLength (CDR (FASSOC (fetch (Dove.FloppyContext SECTORLENGTH) of \DoveFloppy.CurrentContext) \DoveFloppy.SectorLengths] (with Dove.FloppyIOCB IOCB (SETQ BytesToTransfer (ITIMES 4 (fetch (Dove.FloppyFormatInfo SectorsPerTrack) of FormatInfo))) (SETQ FirstDMATransferCount BytesToTransfer) (SETQ FirstDMAControlWord \DoveFloppy.StartDMAWrite))) (PROGN (with Dove.FloppyIOCB IOCB (SETQ BytesToTransfer (fetch (Dove.FloppyContext SECTORLENGTH) of \DoveFloppy.CurrentContext)) (SETQ FirstDMATransferCount BytesToTransfer) (SELECTC DataTransferCode (\DoveFloppy.Read (SETQ FirstDMAControlWord \DoveFloppy.StartDMARead) (SETQ MiddleDMAControlWord \DoveFloppy.StartDMARead) (SETQ LastDMAControlWord \DoveFloppy.StartDMARead)) (\DoveFloppy.Write (SETQ FirstDMAControlWord \DoveFloppy.StartDMAWrite) (SETQ MiddleDMAControlWord \DoveFloppy.StartDMAWrite) (SETQ LastDMAControlWord \DoveFloppy.StartDMAWrite)) (PROGN (SETQ FirstDMAControlWord (LOGOR FirstDMAControlWord \DoveFloppy.DMAInterruptWhenDone)) (SETQ NumberOfMiddleDMATransfers 0) (SETQ LastDMATransferCount 0]) (\DoveFloppy.SetupPrimitiveFDCOp [LAMBDA (IOCB OPERATION) (* mpl " 6-Aug-85 23:50") (DECLARE (GLOBALVARS \DoveFloppy.SectorLengths \DoveFloppy.Commands \DoveFloppy.CurrentContext \DoveFloppy.FormatInfo \DoveFloppy.DataTransferOps \DoveFloppy.#CommandBytes \DoveFloppy.#ResultBytes \DoveFloppy.FDCByteOneMasks \DoveFloppy.FDCByteTwoMasks \DoveFloppy.WaitForInterruptCmds)) (LET ((FDCCmdIndex (ADD1 (fetch (Dove.FloppyIOCB NumberOfFDCCommands) of IOCB))) (FDCCmd (CDR (FASSOC OPERATION \DoveFloppy.Commands))) (EncodedSectorLength (CDR (FASSOC (fetch (Dove.FloppyContext SECTORLENGTH) of \DoveFloppy.CurrentContext) \DoveFloppy.SectorLengths))) [FormatInfo (CDR (FASSOC (fetch (Dove.FloppyContext DENSITY) of \DoveFloppy.CurrentContext) (CADR (FASSOC (fetch (Dove.FloppyContext SECTORLENGTH) of \DoveFloppy.CurrentContext) \DoveFloppy.FormatInfo] (CurrentCmdRecord NIL)) [COND ((NULL EncodedSectorLength) (HELP "Invalid Sector Length" (fetch (Dove.FloppyContext SECTORLENGTH) of \DoveFloppy.CurrentContext] [SETQ CurrentCmdRecord (\ADDBASE (LOCF (fetch (Dove.FloppyIOCB FDCCommands) of IOCB)) (ITIMES \DoveFloppy.FDCCmdLength (SUB1 FDCCmdIndex] (replace (Dove.FloppyIOCB NumberOfFDCCommands) of IOCB with FDCCmdIndex) [with Dove.FloppyIOCB IOCB (SETQ DataTransferCode (CDR (FASSOC OPERATION \DoveFloppy.DataTransferOps] [with Dove.FloppyFDCCommand CurrentCmdRecord (SETQ FDCCode FDCCmd) (SETQ DataTransferCode (CDR (FASSOC OPERATION \DoveFloppy.DataTransferOps))) (SETQ NumberOfCommandBytes (CDR (FASSOC OPERATION \DoveFloppy.#CommandBytes))) (SETQ NumberOfResultBytes (CDR (FASSOC OPERATION \DoveFloppy.#ResultBytes))) (SETQ MustWaitForInterrupt (COND ((FMEMB OPERATION \DoveFloppy.WaitForInterruptCmds) \DoveFloppy.ByteTRUE) (T \DoveFloppy.ByteFALSE] (with Dove.FloppyCmdBytes (LOCF (fetch (Dove.FloppyFDCCommand CommandBytes) of CurrentCmdRecord)) (SETQ CB1 (CDR (FASSOC OPERATION \DoveFloppy.HardFDCCommands))) [COND ((fetch (Dove.FloppyIOCB MultiTrackMode) of IOCB) (SETQ CB1 (LOGOR CB1 \DoveFloppy.HardMultiTrackMode] [COND ((EQ (fetch (Dove.FloppyContext DENSITY) of \DoveFloppy.CurrentContext) (QUOTE DOUBLE)) (SETQ CB1 (LOGOR CB1 \DoveFloppy.HardDoubleDensity] [COND ((fetch (Dove.FloppyIOCB SkipDeletedSector) of IOCB) (SETQ CB1 (LOGOR CB1 \DoveFloppy.HardSkipDeletedSector] [SETQ CB1 (LOGAND CB1 (CDR (FASSOC OPERATION \DoveFloppy.FDCByteOneMasks] (SETQ CB2 0) [COND ((EQ (fetch (Dove.FloppyIOCB HEAD) of IOCB) 1) (SETQ CB2 (LOGOR CB2 \DoveFloppy.HardHeadOne] [SETQ CB2 (LOGAND CB2 (CDR (FASSOC OPERATION \DoveFloppy.FDCByteTwoMasks] (SETQ CB3 (fetch (Dove.FloppyIOCB CYLINDER) of IOCB)) (SETQ CB4 (fetch (Dove.FloppyIOCB HEAD) of IOCB)) (SETQ CB5 (fetch (Dove.FloppyIOCB SECTOR) of IOCB)) (SETQ CB6 EncodedSectorLength) (SETQ CB7 (fetch (Dove.FloppyFormatInfo SectorsPerTrack) of FormatInfo)) (SETQ CB8 (fetch (Dove.FloppyFormatInfo ReadWriteGapLength) of FormatInfo)) (SETQ CB9 (COND ((EQ CB6 0) 128) (T 255))) (SELECTQ OPERATION [FORMATTRACK (SETQ CB3 EncodedSectorLength) (SETQ CB4 (fetch (Dove.FloppyFormatInfo SectorsPerTrack) of FormatInfo)) (SETQ CB5 (fetch (Dove.FloppyFormatInfo FormatGapLength) of FormatInfo)) (SETQ CB6 (fetch (Dove.FloppyFCB FloppyFillerForFormatting) of (\DoveFCBAt \Dove.FloppyFCBOffset] ((SCANEQUAL SCANHIGHOREQUAL SCANLOWOREQUAL) (SETQ CB9 1)) [SPECIFY (SETQ CB2 (fetch (Dove.FloppyFCB FloppyStepRateTime) of (\DoveFCBAt \Dove.FloppyFCBOffset))) (SETQ CB3 (fetch (Dove.FloppyFCB FloppyHeadLoadTime) of (\DoveFCBAt \Dove.FloppyFCBOffset] (PROGN NIL]) (\DoveFloppy.StopHandler [LAMBDA NIL (* mpl " 7-Aug-85 20:43") (LET ((FCB (\DoveFCBAt \Dove.FloppyFCBOffset)) (Timer NIL)) (replace (Dove.FloppyFCB FloppyStopHandler) of FCB with \DoveFloppy.ByteTRUE) (\DoveIO.NotifyIOP (fetch (Dove.FloppyFCB FloppyWorkMask) of FCB)) (SETQ Timer (SETUPTIMER 500)) (until (OR (TIMEREXPIRED? Timer) (EQ \DoveFloppy.ByteTRUE (fetch (Dove.FloppyFCB FloppyHandlerIsStopped) of FCB))) do (BLOCK)) (* * This line clears out all 3 queueblocks in the fcb. beware!) (\CLEARWORDS (LOCF (fetch (Dove.FloppyFCB FloppyDiagnosticQueue) of FCB)) 18) (replace (Dove.FloppyFCB FloppyStopHandler) of FCB with \DoveFloppy.ByteFALSE) (COND ((TIMEREXPIRED? Timer) (QUOTE TIMEOUT)) (T (QUOTE OK]) (\DoveFloppy.Transfer [LAMBDA (CYL HD SEC BUFF MODE RESET? RECAL?) (* mpl " 7-Aug-85 15:40") [COND ((NOT \DoveFloppy.IOCB) (SETQ \DoveFloppy.IOCB (NCREATE (QUOTE VMEMPAGEP] (with Dove.FloppyIOCB \DoveFloppy.IOCB (SETQ CYLINDER CYL) (SETQ HEAD HD) (SETQ SECTOR SEC) (SETQ BUFFER BUFF) (SETQ OPERATION MODE) (SETQ RESETFIRST? RESET?) (SETQ RECALIBRATEFIRST? RECAL?)) (COND ((EQ \DoveFloppy.OperationCompleted (\DoveFloppy.Initiate \DoveFloppy.IOCB)) (QUOTE OK)) (T (\DoveFloppy.GetErrorStatus \DoveFloppy.IOCB]) (\DoveFloppy.ValidateIOCB [LAMBDA (IOCB) (* mpl " 6-Aug-85 20:40") (DECLARE (GLOBALVARS \DoveFloppy.CurrentContext \DoveFloppy.Commands)) (LET [(DCBPtr (LOCF (fetch (Dove.FloppyFCB FloppyDCB0Base) of (\DoveFCBAt \Dove.FloppyFCBOffset] (with Dove.FloppyIOCB IOCB (COND ((NOT (FASSOC OPERATION \DoveFloppy.Commands)) (HELP "Invalid operation " OPERATION))) (COND ((NOT BUFFER) (HELP "No buffer supplied!"))) (COND ((OR (ILESSP CYLINDER 0) (IGREATERP CYLINDER (fetch (Dove.FloppyContext NUMBEROFCYLINDERS) of \DoveFloppy.CurrentContext))) (HELP "Invalid Cylinder " CYLINDER))) (COND ((OR (ILESSP HEAD 0) (IGREATERP HEAD (fetch (Dove.FloppyContext NUMBEROFHEADS) of \DoveFloppy.CurrentContext))) (HELP "Invalid Head " HEAD))) (COND ((EQ (fetch (Dove.FloppyDCB DriveAcquiredByPCE) of DCBPtr) \DoveFloppy.ByteTRUE) (HELP "The PCE is using this drive!"))) (SETQ OperationState \DoveFloppy.InProgress]) (\DOVEFLOPPY.WRITEPROTECTED [LAMBDA NIL (* mpl " 4-Aug-85 13:16") (NOT (EQ 0 (LOGAND \DoveFloppy.WriteProtected (fetch (Dove.FloppyDCB DriveStatusHead0) of (LOCF (fetch (Dove.FloppyFCB FloppyDCB0Base) of (\DoveFCBAt \Dove.FloppyFCBOffset] ) (\DoveFloppy.XferDisk [LAMBDA (CYL HD SEC BUFF MODE) (* mpl " 5-Aug-85 11:29") (with Dove.FloppyIOCB \DoveFloppy.IOCB (SETQ CYLINDER CYL) (SETQ HEAD HD) (SETQ SECTOR SEC) (SETQ BUFFER BUFF) (SETQ OPERATION MODE) (\DoveFloppy.Initiate \DoveFloppy.IOCB]) ) (RPAQ? \DoveFloppy.IOCB NIL) (RPAQ? \DoveFloppy.CurrentContext NIL) (DECLARE: DOEVAL@COMPILE DONTCOPY (GLOBALVARS \DoveFloppy.IOCB \DoveFloppy.CurrentContext) ) (DECLARE: EVAL@COMPILE (RPAQQ \DoveFloppy.StopDMA 516) (RPAQQ \DoveFloppy.StartDMAWrite 5798) (RPAQQ \DoveFloppy.StopCounter 16384) (RPAQQ \DoveFloppy.StartDMARead 41574) (RPAQQ \DoveFloppy.StartCounter 49159) (RPAQQ \DoveFloppy.ByteTRUE 1) (RPAQQ \DoveFloppy.ByteFALSE 0) (CONSTANTS \DoveFloppy.StopDMA \DoveFloppy.StartDMAWrite \DoveFloppy.StopCounter \DoveFloppy.StartDMARead \DoveFloppy.StartCounter \DoveFloppy.ByteTRUE \DoveFloppy.ByteFALSE) ) (DECLARE: EVAL@COMPILE (RPAQQ \DoveFloppy.HardDoubleDensity 64) (RPAQQ \DoveFloppy.HardFDCCommands ((NOP . 0) (FORMATTRACK . 13) (READDATA . 6) (READDELETEDDATA . 12) (READID . 10) (READTRACK . 2) (RECALIBRATE . 7) (SCANEQUAL . 17) (SCANHIGHOREQUAL . 29) (SCANLOWOREQUAL . 25) (SEEK . 15) (SENSEDRIVESTATUS . 4) (SENSEINTERRUPTSTATUS . 8) (SPECIFY . 3) (WRITEDATA . 5) (WRITEDELETEDDATA . 9))) (RPAQQ \DoveFloppy.HardHeadOne 4) (RPAQQ \DoveFloppy.HardMultiTrackMode 128) (RPAQQ \DoveFloppy.HardSkipDeletedSector 32) (CONSTANTS \DoveFloppy.HardDoubleDensity \DoveFloppy.HardFDCCommands \DoveFloppy.HardHeadOne \DoveFloppy.HardMultiTrackMode \DoveFloppy.HardSkipDeletedSector) ) (DECLARE: EVAL@COMPILE (RPAQQ \DoveFloppy.DMAInterruptWhenDone 256) (RPAQQ \DoveFloppy.FDCCmdLength 13) (RPAQQ \DoveFloppy.None 0) (RPAQQ \DoveFloppy.Read 1) (RPAQQ \DoveFloppy.Write 2) (CONSTANTS \DoveFloppy.DMAInterruptWhenDone \DoveFloppy.FDCCmdLength \DoveFloppy.None \DoveFloppy.Read \DoveFloppy.Write) ) (DECLARE: EVAL@COMPILE (RPAQQ \DoveFloppy.WriteProtected 64) (RPAQQ \DoveFloppy.Waiting 3) (RPAQQ \DoveFloppy.Read 1) (RPAQQ \DoveFloppy.Write 2) (RPAQQ \DoveFloppy.None 0) (RPAQQ \DoveFloppy.OperationCompleted 6) (RPAQQ \DoveFloppy.InProgress 4) (RPAQQ \DoveFloppy.OperationFailed 7) (RPAQQ \DoveFloppy.OperationBuilt 2) (CONSTANTS \DoveFloppy.WriteProtected \DoveFloppy.Waiting \DoveFloppy.Read \DoveFloppy.Write \DoveFloppy.None \DoveFloppy.OperationCompleted \DoveFloppy.InProgress \DoveFloppy.OperationFailed \DoveFloppy.OperationBuilt) ) (PUTPROPS DOVEFLOPPY COPYRIGHT ("Xerox Corporation" 1985)) (DECLARE: DONTCOPY (FILEMAP (NIL (10893 32942 (\DOVEFLOPPY.RESET 10903 . 11044) (\DOVEFLOPPY.SETCONTEXT 11046 . 11800) ( \DOVEFLOPPY.XFERDISK 11802 . 12381) (\DoveFloppy.ByteSwapIOCB 12383 . 13586) ( \DoveFloppy.ClearDiskChanged 13588 . 13893) (\DoveFloppy.DiskChanged 13895 . 14221) ( \DoveFloppy.DoorOpen 14223 . 14509) (\DoveFloppy.GetErrorStatus 14511 . 16059) (\DoveFloppy.Init 16061 . 16610) (\DoveFloppy.InitDCB 16612 . 16922) (\DoveFloppy.InitIOCB 16924 . 19238) ( \DoveFloppy.Initiate 19240 . 22101) (\DoveFloppy.SetupDMAInfo 22103 . 24789) ( \DoveFloppy.SetupPrimitiveFDCOp 24791 . 29370) (\DoveFloppy.StopHandler 29372 . 30362) ( \DoveFloppy.Transfer 30364 . 31019) (\DoveFloppy.ValidateIOCB 31021 . 32250) ( \DOVEFLOPPY.WRITEPROTECTED 32252 . 32601) (\DoveFloppy.XferDisk 32603 . 32940))))) STOP