-- DicentraDiskDriver.mesa
-- Driver for Century Data AMS-315 disk drive and Xylogics SMD controller
-- Jim Gasbarro 19-Mar-84 10:08:14

DicentraDiskDriver: DEFINITIONS = BEGIN

Head: TYPE = [0..tracksPerCylinder);
Sector: TYPE = [0..sectorsPerTrack);
Cylinder: TYPE = [0..cylindersPerSpindle);
Unit: TYPE = [0..4);

tracksPerCylinder: CARDINAL = 19;
sectorsPerTrack: CARDINAL = 32;
cylindersPerSpindle: CARDINAL = 823;
wordsPerSector: CARDINAL = 256;

RawFormat: PROC [unit: Unit ← 0, cmdOffset: CARDINAL] RETURNS [noHardErrors: BOOLEAN];
-- Formats an AMS-315 drive to look like a CDC-9766.  There are 32 sectors per
-- track, 19 heads per cylinder, and 823 cylinders.  The format is 'raw' in 
-- that it does no bad sector relocation. The drive number to be formatted is
-- specified by 'unit'

Read: PROC [head: Head, sector: Sector, cylinder: Cylinder, unit: Unit ← 0, sectorCount: CARDINAL, cmdOffset: CARDINAL, dataOffset: LONG CARDINAL] RETURNS [success: BOOLEAN];
-- Reads 'sectorCount' sectors from the disk and transfers them to hyperspace
-- starting at word address 'hyperStart+dataOffset'.  The read starts at the
-- disk address specified by 'head', 'sector', and 'cylinder'. The drive
-- number to be read from is specified by 'unit'

Write: PROC [head: Head, sector: Sector, cylinder: Cylinder, unit: Unit ← 0, sectorCount: CARDINAL, cmdOffset: CARDINAL, dataOffset: LONG CARDINAL] RETURNS [success: BOOLEAN];
-- Writes 'sectorCount' sectors from the disk,transfering them from hyperspace
-- starting at word address 'hyperStart+dataOffset'.  The write starts at the
-- disk address specified by 'head', 'sector', and 'cylinder'. The drive
-- number to be written to is specified by 'unit'

Seek: PROC [head: Head ← 0, cylinder: Cylinder ← 0, unit: Unit ← 0, cmdOffset: CARDINAL] RETURNS [success: BOOLEAN];
-- Sends the disk specified by 'unit' to cylinder 'cylinder' and selects
-- head 'head'

DiskInitialCheckout: PROC [];
-- Tests Drive 0 to make sure that it is on line.  Prints a message on the
-- console terminal every 2 seconds if it is not.  Good for making sure 
-- everything is powered up OK.

SeekTest: PROC [];
-- A diagnostic routine that causes Drive 0 to do a bunch of seeks.

ReadWriteTest: PROC [];
-- A diagnostic routine that writes pseudo-random data on one sector of each
-- track of the first 50 cylinders, then goes back and verifies it.  
-- Destroys any data that was on the disk



END.