DEFINITION MODULE TrackDisk; (*$Implementation:=FALSE*)
(* 16-May-1992/cn *)

FROM SYSTEM IMPORT BYTE,LONGSET,SHIFT;

FROM ExecD IMPORT
 clear,read,update,write,nonstd,IOFlagSet,IOStdReq,MemReqSet,Unit;

CONST
 trackDiskName="trackdisk.device";

 motor=nonstd;
 seek=nonstd+1;
 format=nonstd+2;
 remove=nonstd+3;
 changeNum=nonstd+4;
 changeState=nonstd+5;
 protStatus=nonstd+6;
 rawRead=nonstd+7;
 rawWrite=nonstd+8;
 getDriveType=nonstd+9;
 getNumTracks=nonstd+10;
 addChangeInt=nonstd+11;
 remChangeInt=nonstd+12;
 (*36*)getGeometry=nonstd+13;
 (*36*)eject=nonstd+14;
 lastComm=nonstd+15;

 extCom=8000H;

 extWrite=write+extCom;
 extRead=read+extCom;
 extMotor=motor+extCom;
 extSeek=seek+extCom;
 extFormat=format+extCom;
 extUpdate=update+extCom;
 extClear=clear+extCom;
 extRawRead=rawRead+extCom;
 extRawWrite=rawWrite+extCom;

 numSecs=11;
 numUnits=4;

 sector=512;
 secShift=9;

 labelSize=16;

 indexSync=4;
 index=IOFlagSet{4};
 (*36*)wordSync=5;
 (*36*)word=IOFlagSet{5};

 allowNon35=LONGSET{0};

 drive35=1;
 drive525=2;
 (*36*)drive35rpm150=3;

 notSpecified=20;
 noSecHdr=21;
 badSecPreamble=22;
 badSecId=23;
 badHdrSum=24;
 badSecSum=25;
 tooFewSecs=26;
 badSecHdr=27;
 writeProt=28;
 diskChanged=29;
 seekError=30;
 noMem=31;
 badUnitNum=32;
 badDriveType=33;
 driveInUse=34;
 postReset=35;

TYPE
 DgFlags=(removable,dg1,dg2,dg3,dg4,dg5,dg6,dg7);
 DgFlagSet=SET OF DgFlags;

 DriveGeometry=RECORD
  sectorSize:LONGCARD;
  totalSectors:LONGCARD;
  cylinders:LONGCARD;
  cylSectors:LONGCARD;
  heads:LONGCARD;
  trackSectors:LONGCARD;
  bufMemType:MemReqSet;
  deviceType:SHORTCARD;
  flags:DgFlagSet;
  reserved:CARDINAL;
 END;
 DriveGeometryPtr=POINTER TO DriveGeometry;

CONST
 directAccess=0;
 sequentialAccess=1;
 printer=2;
 processor=3;
 worm=4;
 cdrom=5;
 scanner=6;
 opticalDisk=7;
 mediumChanger=8;
 communication=9;
 unknown=31;

TYPE
 PubFlags=(noClick,pf1,pf2,pf3,pf4,pf5,pf6,pf7);
 PubFlagSet=SET OF PubFlags;

 IOExtTD=RECORD
  req:IOStdReq;
  count:LONGCARD;
  secLabel:LONGCARD;
 END;
 IOExtTDPtr=POINTER TO IOExtTD;

 TDUPublicUnit=RECORD
  unit:Unit;
  comp01Track:CARDINAL;
  comp10Track:CARDINAL;
  comp11Track:CARDINAL;
  stepDelay:LONGCARD;
  settleDelay:LONGCARD;
  retryCnt:[0..255];
  (*36*)pubFlags:PubFlagSet;
  (*36*)currTrk:CARDINAL;
  (*36*)calibrateDelay:LONGCARD;
  (*36*)counter:LONGCARD;
 END;

(*
 Synonyme zur einheitlichen Namesgebung
*)
 IOTrackDisk=IOExtTD;
 IOTrackDiskPtr=IOExtTDPtr;

END TrackDisk.noimp
