home *** CD-ROM | disk | FTP | other *** search
- (**************************************************************************
-
- $RCSfile: Trackdisk.mod $
- Description: trackdisk device structure and value definitions
-
- Created by: fjc (Frank Copeland)
- $Revision: 3.8 $
- $Author: fjc $
- $Date: 1995/06/04 23:13:14 $
-
- $VER: trackdisk.h 33.13 (28.11.90)
- Includes Release 40.15
-
- (C) Copyright 1985-1993 Commodore-Amiga, Inc.
- All Rights Reserved
-
- Oberon-A interface Copyright © 1994-1995, Frank Copeland.
- This file is part of the Oberon-A Interface.
- See Oberon-A.doc for conditions of use and distribution.
-
- ***************************************************************************)
-
- <* STANDARD- *>
-
- MODULE [2] Trackdisk;
-
- IMPORT e := Exec, s := Sets;
-
-
- (*
- *--------------------------------------------------------------------
- *
- * Physical drive constants
- *
- *--------------------------------------------------------------------
- *)
-
- CONST
-
- numSecs * = 11;
- numUnits * = 4;
-
- (*
- *--------------------------------------------------------------------
- *
- * Useful constants
- *
- *--------------------------------------------------------------------
- *)
-
- CONST
-
- (* -- sizes before mfm encoding *)
- sector * = 512;
- secShift * = 9; (* log tdSECTOR *)
-
- (*
- *--------------------------------------------------------------------
- *
- * Driver Specific Commands
- *
- *--------------------------------------------------------------------
- *)
-
-
- CONST
-
- name * = "trackdisk.device";
-
- extCom * = -10000H; (* for internal use only! *)
-
-
- motor * = e.nonstd+0; (* control the disk's motor *)
- seek * = e.nonstd+1; (* explicit seek (for testing) *)
- format * = e.nonstd+2; (* format disk *)
- remove * = e.nonstd+3; (* notify when disk changes *)
- changeNum * = e.nonstd+4; (* number of disk changes *)
- changeState * = e.nonstd+5; (* is there a disk in the drive? *)
- protStatus * = e.nonstd+6; (* is the disk write protected? *)
- rawRead * = e.nonstd+7; (* read raw bits from the disk *)
- rawWrite * = e.nonstd+8; (* write raw bits to the disk *)
- getDriveType * = e.nonstd+9; (* get the type of the disk drive *)
- getNumTracks * = e.nonstd+10; (* # of tracks for this type drive *)
- addChangeInt * = e.nonstd+11; (* tdREMOVE done right *)
- remChangeInt * = e.nonstd+12; (* remove softint set by ADDCHANGEINT *)
- getGeometry * = e.nonstd+13; (* gets the disk geometry table *)
- eject * = e.nonstd+14; (* for those drives that support it *)
- lastComm * = e.nonstd+15;
-
- (*
- *
- * The disk driver has an "extended command" facility. These commands
- * take a superset of the normal IO Request block.
- *
- *)
-
- CONST
-
- extWrite * = e.write + extCom;
- extRead * = e.read + extCom;
- extMotor * = motor + extCom;
- extSeek * = seek + extCom;
- extFormat * = format + extCom;
- extUpdate * = e.update + extCom;
- extClear * = e.clear + extCom;
- extRawRead * = rawRead + extCom;
- extRawWrite * = rawWrite + extCom;
-
- (*
- *
- * extended IO has a larger than normal io request block.
- *
- *)
-
- TYPE
-
- IOExtTDPtr * = POINTER TO IOExtTD;
- IOExtTD * = RECORD (e.IORequestBase)
- req * : e.IOStdReq;
- count * : e.ULONG;
- secLabel * : e.ULONG;
- END; (* IOExtTD *)
-
- (*
- * This is the structure returned by tdDRIVEGEOMETRY
- * Note that the layout can be defined three ways:
- *
- * 1. TotalSectors
- * 2. Cylinders and CylSectors
- * 3. Cylinders, Heads, and TrackSectors.
- *
- * #1 is most accurate, #2 is less so, and #3 is least accurate. All
- * are usable, though #2 and #3 may waste some portion of the available
- * space on some drives.
- *)
-
- TYPE
-
- DriveGeometryPtr * = POINTER TO DriveGeometry;
- DriveGeometry * = RECORD
- sectorSize * : e.ULONG; (* in bytes *)
- totalSectors * : e.ULONG; (* total # of sectors on drive *)
- cylinders * : e.ULONG; (* number of cylinders *)
- cylSectors * : e.ULONG; (* number of sectors/cylinder *)
- heads * : e.ULONG; (* number of surfaces *)
- trackSectors * : e.ULONG; (* number of sectors/track *)
- bufMemType * : e.ULONG; (* preferred buffer memory type *)
- (* (usually memfPUBLIC) *)
- deviceType * : SHORTINT; (* codes as defined in the SCSI-2 spec *)
- flags * : s.SET8; (* flags, including removable *)
- reserved * : e.UWORD;
- END; (* DriveGeometry *)
-
- CONST
-
- (* device types *)
- directAccess * = 0;
- sequentialAccess * = 1;
- printer * = 2;
- processor * = 3;
- worm * = 4;
- cdRom * = 5;
- scanner * = 6;
- opticalDisk * = 7;
- mediumChanger * = 8;
- communication * = 9;
- unknown * = 31;
-
- (* flags *)
- removable * = 0;
-
- (*
- ** raw read and write can be synced with the index pulse. This flag
- ** in io request's ioFLAGS field tells the driver that you want this.
- *)
-
- indexSync * = 4;
- (*
- ** raw read and write can be synced with a $4489 sync pattern. This flag
- ** in io request's ioFLAGS field tells the driver that you want this.
- *)
- wordSync * = 5;
-
-
- (* labels are tdLabelSize bytes per sector *)
-
- labelSize * = 16;
-
- (*
- ** This is a bit in the FLAGS field of OpenDevice. If it is set, then
- ** the driver will allow you to open all the disks that the trackdisk
- ** driver understands. Otherwise only 3.5" disks will succeed.
- *)
-
- allowNon35 * = 0;
-
- (*
- ** If you set the tdbAllowNon35 bit in OpenDevice, then you don't
- ** know what type of disk you really got. These defines are for the
- ** tdGETDRIVETYPE command. In addition, you can find out how many
- ** tracks are supported via the tdGETNUMTRACKS command.
- *)
-
- drive35 * = 1;
- drive525 * = 2;
- drive35150rpm * = 3;
-
- (*
- *--------------------------------------------------------------------
- *
- * Driver error defines
- *
- *--------------------------------------------------------------------
- *)
-
- CONST
-
- notSpecified * = 20; (* general catchall *)
- noSecHdr * = 21; (* couldn't even find a sector *)
- badSecPreamble * = 22; (* sector looked wrong *)
- badSecID * = 23; (* ditto *)
- badHdrSum * = 24; (* header had incorrect checksum *)
- badSecSum * = 25; (* data had incorrect checksum *)
- tooFewSecs * = 26; (* couldn't find enough sectors *)
- badSecHdr * = 27; (* another "sector looked wrong" *)
- writeProt * = 28; (* can't write to a protected disk *)
- diskChanged * = 29; (* no disk in the drive *)
- seekError * = 30; (* couldn't find track 0 *)
- noMem * = 31; (* ran out of memory *)
- badUnitNum * = 32; (* asked for a unit > NUMUNITS *)
- badDriveType * = 33; (* not a drive that trackdisk groks *)
- driveInUse * = 34; (* someone else allocated the drive *)
- postReset * = 35; (* user hit reset; awaiting doom *)
-
- (*
- *--------------------------------------------------------------------
- *
- * public portion of the unit structure
- *
- *--------------------------------------------------------------------
- *)
-
- TYPE
-
- PublicUnitPtr * = POINTER TO PublicUnit;
- PublicUnit * = RECORD (e.UnitBase)
- unit * : e.Unit; (* base message port *)
- comp01Track * : e.UWORD; (* track for first precomp *)
- comp10Track * : e.UWORD; (* track for second precomp *)
- comp11Track * : e.UWORD; (* track for third precomp *)
- stepDelay * : e.ULONG; (* time to wait after stepping *)
- settleDelay * : e.ULONG; (* time to wait after seeking *)
- retryCnt * : SHORTINT; (* # of times to retry *)
- pubFlags * : s.SET8; (* public flags, see below *)
- currTrk * : e.UWORD; (* track the heads are over... *)
- (* ONLY ACCESS WHILE UNIT IS STOPPED! *)
- calibrateDelay * : e.ULONG; (* time to wait after stepping *)
- (* during a recalibrate *)
- counter * : e.ULONG; (* counter for disk changes... *)
- (* ONLY ACCESS WHILE UNIT IS STOPPED! *)
- END; (* PublicUnit *)
-
- CONST
-
- (* flags for tduPubFlags *)
- noClick * = 0;
-
-
- END Trackdisk.
-