DiskFace: CEDAR DEFINITIONS = BEGIN wordsPerPage: CARDINAL = 256; PageNumber: TYPE = RECORD[INT]; PageCount: TYPE = INT; ControllerHandle: TYPE[1]; GetNextController: PROC[ControllerHandle] RETURNS [ControllerHandle]; nullControllerHandle: READONLY ControllerHandle; GetControllerAttributes: PROC[ControllerHandle] RETURNS [globalStateSize: CARDINAL]; InitializeController: PROC[controller: ControllerHandle, globalState: LONG POINTER, mask: WORD]; InitializeCleanup: PROC[ControllerHandle]; Reset: PROC[ControllerHandle]; Type: TYPE = MACHINE DEPENDENT { null(0), sa800(1), sa1000(2), sa4000(3), cdc9730(4), ethernet(5), (LAST[CARDINAL]) }; DeviceHandle: TYPE[1]; nullDeviceHandle: READONLY DeviceHandle; GetNextDevice: PROC[DeviceHandle] RETURNS[DeviceHandle]; DeterminationMode: TYPE = { quickReadOnly, longReadOnly, writeEnabled }; DetermineDiskShape: PROC[device: DeviceHandle, operation: OperationPtr, mode: DeterminationMode, buffer: LONG POINTER _ NIL] RETURNS [nowKnown: BOOL]; GetDeviceType: PROC[DeviceHandle] RETURNS [Type]; GetDeviceAttributes: PROC[DeviceHandle] RETURNS [cylinders, movingHeads, fixedHeads, sectorsPerTrack: CARDINAL]; unknownAttribute: CARDINAL = LAST[CARDINAL]; Tries: TYPE = (0..400B]; SuggestedTries: PROC[DeviceHandle] RETURNS [Tries]; Recalibrate: PROC[DeviceHandle]; DiskAddress: TYPE = MACHINE DEPENDENT RECORD[ cylinder(0): CARDINAL, head(1:0..7): [0..256), sector(1:8..15): [0..256) ]; Command: TYPE = MACHINE DEPENDENT RECORD[header, label, data: Op]; Op: TYPE = MACHINE DEPENDENT { noOp, read, write, verify }; Label: TYPE = MACHINE DEPENDENT RECORD[ fileID(0): FileID, filePage(5): INT, attributes(7): Attributes, dontCare(8): DontCare ]; FileID: TYPE = MACHINE DEPENDENT RECORD[id(0): SELECT OVERLAID * FROM rel => [ relID(0): RelID, fill4(4): CARDINAL _ 0], abs => [ absID(0): AbsID ], ENDCASE ]; RelID: TYPE[4]; AbsID: TYPE[5]; Attributes: TYPE[1]; DontCare: TYPE[2]; DeviceOpStatus: TYPE[2]; operationSize: READONLY CARDINAL; OperationPtr: TYPE = LONG POINTER TO Operation; Operation: TYPE = MACHINE DEPENDENT RECORD[ -- 16-word aligned and in first 64K of VM clientHeader(0): DiskAddress, -- address of first sector of request labelPtr(2): LONG POINTER TO Label, -- first label of request. Must not be NIL. dataPtr(4): LONG POINTER, -- first (VM page aligned) data address of operation incrementDataPtr(6:0..0): BOOL, -- increment dataPtr after each successful data r/w/v unused(6:1..1): [0..1] _ NULL, command(6:2..7): Command, tries(6:8..15): Tries, -- indication of how hard to retry after errors pageCount(7): CARDINAL, -- number of (remaining) sectors for this operation deviceStatus(10B): DeviceOpStatus _ NULL, -- used by the Head diskHeader(12B): DiskAddress _ NULL, -- if command.header=read, places result here device(14B): DeviceHandle ]; Initiate: PROC[OperationPtr]; Poll: PROC[ControllerHandle] RETURNS [status: Status, op: OperationPtr, retriedCount: CARDINAL]; Status: TYPE = { inProgress, goodCompletion, notReady, recalibrateError, seekTimeout, headerCRCError, labelCRCError, dataCRCError, headerNotFound, labelVerifyError, dataVerifyError, overrunError, writeFault, memoryError, memoryFault, clientError, operationReset, otherError }; FormattingUnit: TYPE = {arbitrary, singleTrack}; GetFormattingUnit: PROC[DeviceHandle] RETURNS [FormattingUnit]; END. àCedar Nucleus: disk face DiskFace.mesa Andrew Birrell May 3, 1983 1:41 pm Note that the Head does not perform any synchronisation. Clients must make their own arrangements to avoid conflict over use of this interface. Note also that heads may dependent on the layout of MACHINE DEPENDENT types in this interface. Page size and numbering Sequential numbering of pages on a pack, starting from 0. Adjacent physical sectors have consecutive PageNumber's. Controllers "globalState" is in first 64K of VM. "mask" indicates naked notify channels Restore the controller (as nearly as possible) to the state existing immediately after InitializeController. Clients may see operations associated with a reset controller coming back as operationReset. Devices Before DetermineDiskShape has returned TRUE, some or all attributes may be unknownAttribute. An indication of how hard the head should work when retrying a failed operation. Increasing values of "Tries" indicates that extra effort should be expended in trtrying the operation. Retrying includes device specific error recovery (ECC, recalibrates, ...). Value of "Tries" to cause the default error recovery algorithm for the device. Forces a recalibrate at the beginning of the next operation. The Head may also voluntarily supply recalibrates as part of its retry logic. Operations The fields "fileID", "attributes" and "dontCare" have opaque types and are not interpreted by the Head, only by the higher level software. When verifying a label, all fields except "dontCare" must match. When the head/microcode moves to next page of a run, label.filePage is incremented. Ignored in label verification. Typically used for boot chain links, in which case it's actually a DiskFace.Address. device-dependent status information about an operation; used only inside the head. The storage pointed to by an OperationPtr should be at least operationSize words long (i.e. must be longer than SIZE[Operation]), to allow extra words for use by the Head. Note a new disk request and arrange for its eventual execution. Note that the client has no control over what controller services the operation. Each controller will notify its naked notify channels when an operation serviced by that controller completes. Poll a particular controller. Polling an idle controller will result in the result [clientError, NIL]. Operations will not necessarily come back in the order they were submitted, and an error in a particular operation does not abort the rest. Formatting ʇ˜Jšœ™Jšœ ™ Jšœ#™#J˜Jšœ Ïkœ œ˜J˜Jš˜J˜J™JšœÅœ œ™ïJ™J™Jšœ™˜Jšœœ˜J˜šœ œœœ˜Jšœs™sJ˜—Jšœ œœ˜J˜J˜J˜—Jšœ ™ ˜Jšœœ˜J˜JšÏnœœœ˜EJ˜Jšœœ˜0J˜Jšžœœœœ˜TJ˜š žœœ,œœœ˜`JšœL™L—J˜Jšžœœ˜*J˜šžœœ˜JšœÊ™Ê—J˜J˜J˜—Jšœ™˜šœœœ œ˜ J˜J˜ J˜ J˜ J˜ J˜ Jšœœœ˜J˜—J˜Jšœœ˜J˜Jšœœ˜(J˜šž œœœ˜8J˜—Jšœœ1˜HJ˜JšžœœQœœœœ œ˜–J˜Jšž œœœ˜1J˜šžœœœ7œ˜pJšœ\™\—J˜Jšœœœœ˜,J˜šœœ ˜Jšœ„™„—J˜šžœœœ ˜3JšœN™N—J˜šž œœ˜ Jšœ‹™‹—J˜J˜J˜—Jšœ ™ ˜š œ œœ œœ˜-Jšœ œ˜Jšœ˜Jšœ˜Jšœ˜—J˜Jš œ œœ œœ˜BJ˜Jšœœœ œ˜;J˜š œœœ œœ˜'J˜Jšœ œ˜J˜J˜Jšœ¡™¡—J˜šœœœ œœœœ˜EJšœ$œ˜2J˜Jšœ˜ —Jšœœ˜Jšœœ˜J˜Jšœ œ˜J˜šœ œ˜Jšœt™t—J˜šœœ˜JšœS™S—J™šœœœ˜!Jšœpœ7™«—J˜Jš œœœœœ ˜/J˜š œ œœ œœÏc)˜UJšœŸ%˜CJšœ œœœŸ,˜PJšœ œœŸ4˜NJšœœŸ5˜UJšœœ˜J˜JšœŸ/˜FJšœœŸ3˜LJšœ$œŸ˜=JšœœŸ-˜RJ˜J˜—J˜šžœœ˜Jšœ™—J˜šžœœœ2œ˜`Jšœô™ô—J˜šœœ˜J˜ J˜J˜ J˜J˜ J˜J˜J˜ J˜J˜J˜J˜ J˜ J˜ J˜ J˜ J˜J˜ J˜—J˜J˜J˜—Jšœ ™ ˜Jšœœ˜0J˜Jšžœœœ˜?J˜—Jšœ˜J˜J˜J˜J˜J˜—…— 8Ÿ