-- FloppyChannel.mesa: (last edited by: Jose, October 10, 1980 3:07 PM) --
DIRECTORY
PhysicalVolume: FROM "PhysicalVolume" USING [Handle];
FloppyChannel: DEFINITIONS =
BEGIN
-- Basic serial read/write access to a floppy disk drive of the SA800 family. Floppy channel access and Pilot volume operations are mutually exclusive and interlocked. Note that the serial nature of the interface dictates that only one process should be using it at a time.
-- TYPES
Handle: TYPE = PhysicalVolume.Handle;
Attributes: TYPE = RECORD [
deviceType: {SA800, SA850},
--Indicates what type of drive is connected to the controller.
numberOfCylinders: [0..256),
--Number of cylinders available for recording on the drive connected to the controller.
numberOfHeads: [0..256),
--Number of read/write heads available for recording on the drive connected to the controller.
trackLength: CARDINAL];
--Length in words of the buffer that the client must supply in order to format the diskette.
Buffer: TYPE = RECORD [
address:
LONG POINTER TO UNSPECIFIED,-- must be quad-word alligned
length:
CARDINAL];-- must be >= Context.sectorLength*operation count
Context: TYPE = RECORD [
protect: BOOLEAN,
--Software write protect available to the client. The actual write protect status is a logical OR of this variable and the physical signal being returned from the drive.
format: {IBM, Troy},
--Client’s selection of the format type; either an IBM compatible format (which includes STAR), or the Xerox 850 (Troy) format.
density: {single, double},
--Selection of either FM (single density) or MFM (double density) recording. This is an available selection when formatting a new diskette. When accessng a previously recorded diskette, the client must provide the correct setting. (Note that track00 on IBM format diskettes and all tracks of Troy format diskettes will be single density.)
sectorLength: CARDINAL];
--Length in words of the sectors on the current track. The value must come from a valid set defined as {64, 128, 256, 512} for IBM format and {1022} for Troy format.
DiskAddress: TYPE = MACHINE DEPENDENT RECORD [
cylinder: CARDINAL,
--must be IN [0..numberOfCylinders]
head: [0..256),
--must be IN [0..numberOfHeads]
sector: [0..256)];
--must be IN [1..{value depends on sectorLength}]
Status: TYPE = MACHINE DEPENDENT RECORD [
diskChanged (0: 0..0): BOOLEAN,
--(information) The disk drive has apparently gone from ready to not-ready (door open), or from not-ready to ready, one or more times since the last operation was performed.
tbd1 (0: 1..1): BOOLEAN,
--This status record is unassigned.
twoSided (0: 2..2): BOOLEAN,
--(information) The diskette currently installed is double sided.
tbd2 (0: 3..3): BOOLEAN,
--This status record is unassigned.
error (0: 4..4): BOOLEAN,
--This status record indicates an error; a specific error status is also set.
inProgress (0: 5..5): BOOLEAN,
--The operation is not yet complete.
recalibrateError (0: 6..6): BOOLEAN,
--A recalibrate failed.
wrongSizeBuffer (0: 7..7): BOOLEAN,
--The buffer supplied by the client was shorter than the length of the transfer requested.
notReady (0: 8..8): BOOLEAN,
--The drive is not ready.
writeProtect (0: 9..9): BOOLEAN,
--(information OR error, depending on the value of the error bit) Logical OR of the context setting of protect and the physical signal being returned from the drive.
deletedData (0: 10..10): BOOLEAN,
--(information) The ID for the sector contained a deleted data address mark.
recordNotFound (0: 11..11): BOOLEAN,
--The record defined by the disk address could not be found.
crcError (0: 12..12): BOOLEAN,
--A CRC error was encountered on either the record ID or the data field.
track00 (0: 13..13): BOOLEAN,
--(information) The read/write heads are currently positioned over track00, the outermost track.
hardwareError (0: 14..14): BOOLEAN,
--An undefined status was returned.
goodCompletion (0: 15..15): BOOLEAN];
--The request was completed successfully.
-- PROCEDURES
-- The following six drive-access procedures include seek, error retry, and wait for completion or error. Operations in a single call may not cross over from an IBM-format track 0 to the rest of the diskette; no check is made for this.
ReadSectors: PROCEDURE [handle: Handle, address: DiskAddress, buffer: Buffer, count: CARDINAL ← 1, incrementDataPtr: BOOLEANTRUE]
RETURNS [status: Status, countDone: CARDINAL];
--Reads the specified number of sectors from the diskette beginning at the specified disk address.
WriteSectors: PROCEDURE [handle: Handle, address: DiskAddress, buffer: Buffer, count: CARDINAL ← 1, incrementDataPtr: BOOLEANTRUE]
RETURNS [status: Status, countDone: CARDINAL];
--Writes the specified number of sectors with data address marks to the diskette beginning at the specified disk address.
WriteDeletedSectors: PROCEDURE [handle: Handle, address: DiskAddress, buffer: Buffer, count: CARDINAL ← 1, incrementDataPtr: BOOLEANTRUE]
RETURNS [status: Status, countDone: CARDINAL];
--Writes the specified number of sectors with deleted data address marks to the diskette beginning at the specified disk address.
ReadID: PROCEDURE [handle: Handle, address: DiskAddress, buffer: Buffer]
RETURNS [status: Status];
--Reads to first encountered record ID from the specified disk address. The value of sector in the disk address is ignored.
Nop: PROCEDURE [handle: Handle]
RETURNS [
status: Status];
--Does a regular drive-access operation without data transfer and returns a valid status.
Recalibrate: PROCEDURE [handle: Handle]
RETURNS [
status: Status];
--Moves the heads to track 00, sector 00.
GetContext: PROCEDURE [handle: Handle]
RETURNS
[context: Context];
--Returns the current settings of the context.
GetDeviceAttributes: PROCEDURE [handle: Handle]
RETURNS
[attributes: Attributes];
--Returns attributes as defined above.
SetContext: PROCEDURE [handle: Handle, context: Context]
RETURNS [
ok: BOOLEAN];
--Sets context as defined above and returns a BOOLEAN indicating whether the settings were accepted.
END...
LOG
Time: June 10, 1980 3:10 PMBy: JoseAction: Created file.
Time: October 10, 1980 3:06 PMBy: JoseAction: Add incrementDataPtr parameter to transfer procedures, default count and incrementDataPtr.