|##########| |#MAGIC #|CLABLLCG |#PROJECT #|"IMPORTALL" |#PATHS #|"StdProject" |#FLAGS #|xx-x-x--xx--x-x----------------- |#USERSW #|-------------------------------- |#USERMASK#|-------------------------------- |#SWITCHES#|x-xx-x---------- |##########| DEFINITION MODULE TrackDisk; (* $A- *) |S. Herr, 30.09.92 FROM T_Exec IMPORT IOCommand, nonstdVAL, IOStdReq, Unit, IOFlags, IOReturn; FROM System IMPORT SHORTSET; FROM Resources IMPORT ContextPtr; CONST motor = IOCommand( nonstdVAL + 0 ); seek = IOCommand( nonstdVAL + 1 ); format = IOCommand( nonstdVAL + 2 ); remove = IOCommand( nonstdVAL + 3 ); changeNum = IOCommand( nonstdVAL + 4 ); changeState = IOCommand( nonstdVAL + 5 ); protStatus = IOCommand( nonstdVAL + 6 ); rawRead = IOCommand( nonstdVAL + 7 ); rawWrite = IOCommand( nonstdVAL + 8 ); getDriveType = IOCommand( nonstdVAL + 9 ); getNumTracks = IOCommand( nonstdVAL + 10 ); addChangeInt = IOCommand( nonstdVAL + 11 ); remChangeInt = IOCommand( nonstdVAL + 12 ); getGeometry = IOCommand( nonstdVAL + 13 ); eject = IOCommand( nonstdVAL + 14 ); lastComm = IOCommand( nonstdVAL + 15 ); extCom = CARDINAL($8000); extWrite = IOCommand( extCom + CARDINAL(write) ); extRead = IOCommand( extCom + CARDINAL(read) ); extMotor = IOCommand( extCom + CARDINAL(motor) ); extSeek = IOCommand( extCom + CARDINAL(seek) ); extFormat = IOCommand( extCom + CARDINAL(format) ); extUpdate = IOCommand( extCom + CARDINAL(update) ); extClear = IOCommand( extCom + CARDINAL(IOCommand.clear) ); extRawRead = IOCommand( extCom + CARDINAL(rawRead) ); extRawWrite = IOCommand( extCom + CARDINAL(rawWrite) ); numSecs = 11; numUnits = 4; sector = 512; secShift = 9; labelSize = 16; | Flags für die IORequest Struktur | indexSync = IO4; wordSync = IO5; TYPE | Flags für OpenDevice() | TDFlags = (allowNon3_5,dummy=31); TDFlagSet = SET OF TDFlags; getDriveTypeFlags = (drive3_5, drive5_25, drive3_5_150RPM); getDriveTypeFlagSet = SET OF getDriveTypeFlags; CONST | Driver Errors | notSpecified = IOReturn(20); noSecHdr = IOReturn(21); badSecPreamble = IOReturn(22); badSecID = IOReturn(23); badHdrSum = IOReturn(24); badSecSum = IOReturn(25); tooFewSecs = IOReturn(26); badSecHdr = IOReturn(27); writeProt = IOReturn(28); diskChanged = IOReturn(29); seekError = IOReturn(30); noMem = IOReturn(31); badUnitNum = IOReturn(32); badDriveType = IOReturn(33); driveInUse = IOReturn(34); postReset = IOReturn(35); TYPE | Typen für das driveGeometry-Kommando | DeviceTypes = (directAccess,sequentialAccess,printer,processor,worm, cdRom,scanner,opticalDisk,mediumChanger, communication,unknown=31); GeoFlags = (removable); GeoFlagSet = SET OF GeoFlags; DriveGeometry = RECORD sectorSize : LONGCARD; totalSectors : LONGCARD; cylinders : LONGCARD; cylSectors : LONGCARD; heads : LONGCARD; trackSectors : LONGCARD; bufMemType : LONGCARD; deviceType : DeviceTypes; flags : GeoFlagSet; reserved : CARDINAL; END; DriveGeometryPtr = POINTER TO DriveGeometry; TYPE IOTrackDiskPtr = POINTER TO IOTrackDisk; IOTrackDisk = RECORD OF IOStdReq; count : LONGCARD; secLabel : LONGCARD END; DriveNum = ( DF0, DF1, DF2, DF3); PubFlags = (noClick); PubFlagSet = SET OF PubFlags; TDUPublicUnitPtr = POINTER TO TDUPublicUnit; TDUPublicUnit = RECORD OF Unit; comp01Track : CARDINAL; comp10Track : CARDINAL; comp11Track : CARDINAL; stepDelay : LONGCARD; settleDelay : LONGCARD; retryCnt : SHORTCARD; pubFlags : PubFlagSet; currTrk : CARDINAL; calibrateDelay : LONGCARD; counter : LONGCARD; END; PROCEDURE OpenTrackDisk( drive : DriveNum:=DF0; flags :=TDFlagSet:{}; context : ContextPtr:=NIL ): IOTrackDiskPtr; PROCEDURE CloseTrackDisk( VAR request : IOTrackDiskPtr ); GROUP CommandGrp = motor,seek,format,remove,changeNum,changeState,protStatus, rawRead,rawWrite,getDriveType,getNumTracks,addChangeInt, remChangeInt,getGeometry,eject,lastComm,extCom,extWrite, extRead,extMotor,extSeek,extFormat,extUpdate,extClear, extRawRead,extRawWrite; ConstGrp = numSecs,numUnits,sector,secShift,labelSize,indexSync, wordSync; MiscGrp = TDFlags,TDFlagSet,getDriveTypeFlags,getDriveTypeFlagSet; ErrorGrp = notSpecified,noSecHdr,badSecPreamble,badSecID,badHdrSum, badSecSum,tooFewSecs,badSecHdr,writeProt,diskChanged, seekError,noMem,badUnitNum,badDriveType,driveInUse, postReset; GeometryGrp= DeviceTypes,GeoFlags,GeoFlagSet,DriveGeometry, DriveGeometryPtr; DeviceGrp = IOTrackDiskPtr,IOTrackDisk,OpenTrackDisk,CloseTrackDisk, DriveNum; UnitGrp = PubFlags,PubFlagSet,TDUPublicUnitPtr,TDUPublicUnit; All = CommandGrp,ConstGrp,MiscGrp,ErrorGrp,GeometryGrp,DeviceGrp, UnitGrp; END TrackDisk.