SA4000Face.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
McJones on: July 1, 1980 9:30 AM
Andrew Birrell on: May 5, 1983 10:56 am
Russ Atkinson (RRA) January 29, 1985 1:13:52 am PST
Willie-Sue, January 31, 1985 1:04:09 pm PST
Doug Wyatt, February 22, 1985 3:40:20 pm PST
Processor-independent access to a Shugart SA1000/SA4000 equivalent.
DIRECTORY
DiskFace USING [Label];
SA4000Face: DEFINITIONS
= BEGIN
GetDeviceAttributes:
PROC [DeviceHandle]
RETURNS [cylinders, movingHeads, fixedHeads, sectorsPerTrack:
CARDINAL];
Return the "shape" of a particular drive in the family.
GetTrueDeviceAttributes:
PROC [SA4000Face.DeviceHandle]
RETURNS [cylinders, movingHeads, fixedHeads, sectorsPerTrack:
CARDINAL];
Return the "shape" of a particular drive in the family. These are the true physical parameters.
GetNextDevice:
PROC [DeviceHandle]
RETURNS [DeviceHandle];
Return handle of next drive in physical order (starts and ends with nullDeviceHandle).
Initialize:
PROC [t:
WORD, globalState: GlobalStatePtr];
Initialize. t is a mask for transmission wakeups. globalState is a client supplied block of globalStateSize words, 16-word aligned in first 64K of address space. Lifetime: permanently allocated and passed in on call to Initialize.
InitializeCleanup:
PROC;
Install cleanup coroutine used to quiesce SA4000 devices before a world swap (see DeviceCleanup.mesa).
Initiate:
PROC [OperationPtr];
Queue an operation using the OperationState supplied by the user.
Poll:
PROC [OperationPtr]
RETURNS [Status];
Return the status of an operation previously queued.
Recalibrate:
PROC [DeviceHandle];
Cause the disk to be recalibrated before another command is executed.
Reset:
PROC [DeviceHandle];
To be defined.
DiskAddress:
TYPE =
MACHINE
DEPENDENT
RECORD [
cylinder (0): CARDINAL,
head (1:0..7): [0..256),
sector (1:8..15): [0..256)
];
The assignment of DiskAddresses to sectors on disks numbers moving heads before fixed heads (if any).
DeviceHandle: TYPE[1];
GlobalStatePtr: TYPE = Base RELATIVE POINTER;
Base: TYPE = LONG BASE POINTER;
Command:
TYPE = {
Command to be executed by Initiate. If the header operation is read, the label and data field operations will be executed even if the header or label does not verify. In the following commands, v is for verify, r is for read, and w is for write. Field actions are always specified in the order header, label, data. For commands with less than three actions, the trailing fields are passed.
vv, vvr, vvw, vvv, vw, vww, vr, vrr, vrw, vrv,
rv, rvr, rvw, rvv, rw, rww, rr, rrr, rrw, rrv,
w, www
};
Operation:
TYPE =
MACHINE
DEPENDENT
RECORD [
Operation: client supplied block of operationSize words, 16-word aligned in first 64K of address space. The actual size depends on the implementation because the trailing portion is used by the microcode for workspace. The portion shown below is used for communication between the client and the Face and for communication between between the Face and the microcode.
Lifetime: duration of I/O operation - i.e. from original call on Initiate until either the operation has completed (a call on Poll has returned a status for it other than inProgress) or some previous operation has incurred an error (a call on Poll has returned a status for it other than inProgress or goodCompletion).
A call on Poll causes fields in the Operation to be updated. The following fields have special significance for runs of pages: pageCount, clientHeader, label, and dataPtr. These fields are updated by the Face implementation after each page successfully transferred. dataPtr is an exception: if incrementDataPtr is not TRUE, dataPtr will not be updated after each page transferred. This option may be used for example to write successive pages of zeros or read don't care data while checking labels.
If the Status returned by Poll is inProgress, care must be taken when accessing these fields because they may be continually updated by the Face implementation. For example, if Poll returns inProgess, the pageCount may be zero by the time it is accessed by the client.
clientHeader (0): DiskAddress,
disk address to be accessed, initially supplied by client. After Poll, this contains the next sequential disk address if the Status is inProgress or goodCompletion; otherwise it contains the address that caused the error.
labelPtr (2):
LONG
POINTER
TO DiskFace.Label
--PilotDisk.Label--,
label initially supplied by client for label verify or read from the disk after a label read operation. This field is treated by the Face implementation as a composite field with two parts: the first eight words and the last two words. Whenever the command involves label verify, PilotDisk.MatchLabels is used to compare clientLabel with the label on the disk. After each successfully transferred page, PilotDisk.NextLabel is used to increment the "filePageHi*232+filePageLo" field and to clear the immutable, temporary, and zeroSize fields (since they are set only the first page of a file). Thus if Poll returns goodCompletion, label will reflect pageCount applications of PilotDisk.NextLabel. Once an operation has completed (Poll returns status other than inProgress), label.bootChainLink will have set by the face implementation to the corresponding field of the disk label of the last successfully transferred page.
dataPtr (4):
LONG
POINTER,
points to the first 256 word data area in the run, initially supplied by client. After each page successfully transferred, this is updated to be the next data address if incrementDataPtr is TRUE.
incrementDataPtr (6:0..0):
BOOL,
if TRUE, dataPtr will be incremented to the next data address after every page successfully transferred; if FALSE, the same dataPtr will be used for each command.
unused (6:1..10): [0..1777B] ← 0,
command (6:11..15): Command,
command to be executed.
pageCount (7):
CARDINAL,
number of pages to access, supplied by client. This must always be at least one. After Poll, this is updated to be the number of pages left to access.
deviceStatus (10B):
RECORD [a, b:
WORD] ←
NULL,
device dependent status set by call on Poll
diskHeader (12B): DiskAddress ←
NULL,
buffer to read header from the disk. The contents are only valid after a headerRead operation has completed.
device (14B): DeviceHandle
drive to access
];
OperationPtr: TYPE = LONG POINTER TO Operation;
Status:
TYPE =
MACHINE
DEPENDENT {
inProgress(0), goodCompletion, dataError, labelError, labelCheck, seekTimeout, sectorTimeout, notReady, wrongSector, wrongCylinder, wrongHead, hardwareError};
globalStateSize: READONLY CARDINAL;
nullDeviceHandle: READONLY DeviceHandle;
operationSize: READONLY CARDINAL;
dataSize: CARDINAL = 256; -- size of data field in words
headerSize: CARDINAL = 2; -- size of header field in words
labelSize: CARDINAL = 10; -- size of label field in words
totalErrors: READONLY CARDINAL; -- number of errors reported by microcode
END.