-- 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.

ReadDriveStatus: PROC [unit: Unit ← 0];
-- Displays disk and controller parameters

SelfTest: PROC [];
-- Zylogics controller self test.  If the board is not functioning properly the Self-Test 
-- LED on the controller board will not extinguish.

END.