-- PhysicalVolume.mesa (last edited by: Jose on: September 2, 1980 5:12 PM)
DIRECTORY
Device USING [nullType, Type],
System USING [nullID, PhysicalVolumeID],
Volume USING [ID, PageCount, Type];
PhysicalVolume: DEFINITIONS =
BEGIN
-- Handles are used to talk about drives
Handle: TYPE [3];
-- Types to deal with Physical Volumes
ID: TYPE = System.PhysicalVolumeID;
Layout: TYPE = {partialLogicalVolume, singleLogicalVolume, multipleLogicalVolumes};
PageNumber: TYPE = LONG CARDINAL;
VolumeType: TYPE = {notPilot, probablyNotPilot, probablyPilot, isPilot};
maxNameLength: CARDINAL = 40; -- maximum Physical Volume name length
nullBadPage: PageNumber = LAST[PageNumber];
nullDeviceIndex: CARDINAL = LAST[CARDINAL];
nullID: ID = [System.nullID];
ErrorType: TYPE = {badDisk, badSpotTableFull, containsOpenVolumes, diskReadError, hardwareError, hasPilotVolume, alreadyAsserted, insufficientSpace, invalidHandle, nameRequired, notReady, noSuchDrive, noSuchLogicalVolume, pageCountTooSmallForVolume, physicalVolumeUnknown, subvolumeHasTooManyBadPages, tooManySubvolumes, writeProtected, wrongFormat};
Error: ERROR [error: ErrorType];
CanNotScavenge: ERROR;
-- Find out about the current physical configuration
GetNextDrive: PROC [type: Device.Type, index: CARDINAL] RETURNS [nextType: Device.Type, nextIndex: CARDINAL]; -- Stateless enumeration of drives on the system element. Begins with [Device.nullType, nullDeviceIndex] as arguments and ends with the same pair as results. No guarantees are made as to the order of enumeration.
GetHandle: PROC [type: Device.Type, index: CARDINAL] RETURNS [Handle];
InterpretHandle: PROC [instance: Handle] RETURNS [type: Device.Type, index: CARDINAL];
IsReady: PROC [instance: Handle] RETURNS [ready: BOOLEAN];
-- Monitor state changes
AwaitStateChange: PROC [changeCount: CARDINAL, type: Device.Type ← Device.nullType, index: CARDINAL ← nullDeviceIndex] RETURNS [currentChangeCount: CARDINAL];
-- Find out about what is out there on that drive
GetHints: PROC [instance: Handle, label: STRINGNIL]
RETURNS [pvID: ID, volumeType: VolumeType];
-- Make volumes accessible for either Pilot or non-Pilot access
AssertPilotVolume: PROC [instance: Handle] RETURNS [ID]; -- Can raise CanNotScavenge
AssertNotAPilotVolume: PROC [instance: Handle];
-- Finish with non-Pilot access
FinishWithNonPilotVolume: PROC [instance: Handle];
-- Deal with current known (on-line) Pilot volumes
CreatePhysicalVolume: PROC [instance: Handle, name: STRING] RETURNS [ID];
GetAttributes: PROC [pvID: ID, label: STRINGNIL] RETURNS [instance: Handle, layout: Layout];
GetContainingPhysicalVolume: PROC [lvID: Volume.ID] RETURNS [pvID: ID];
-- Returns the Physical ID of the physical volume containing the FIRST subvolume of this logical volume.
GetNext: PROC [pvID: ID] RETURNS [ID];
-- Stateless enumeration of online physical volumes, beginning with a nullID argument and ending with a nullID result.
GetNextBadPage: PROC [pvID: ID, thisBadPageNumber: PageNumber] RETURNS [nextBadPageNumber: PageNumber];
GetNextLogicalVolume: PROC [pvID: ID, lvID: Volume.ID] RETURNS [Volume.ID];
-- Stateless enumeration, beginning with a Volume.nullID argument and ending with a Volume.nullID result, of the accessible logical volumes on pvID. It takes into account the existence of inaccessible volumes (e.g., Debugger volumes while Pilot is running) by not enumerating them; Logical volumes with multiple subvolumes on the same physical volume will be enumerated only once.
MarkPageBad: PROC [pvID:ID, badPage: PageNumber];
Offline: PROC [pvID: ID]; -- finish up with physical volume.
-- Create additional logical volumes (or erase current)
maxSubvolumesOnPhysicalVolume: READONLY CARDINAL;
-- Currenty there is one subvolume per Logical Volume. When ExtendLogicalVolume is implemented there will be potentially many subvolumes per Logical Volume.
CreateLogicalVolume: PROC [pvID: ID, size: Volume.PageCount, name: STRING, type: Volume.Type, minPVPageNumber: PageNumber ← 1] RETURNS [Volume.ID];
EraseLogicalVolume: PROC [lvID: Volume.ID]; -- see Scavenger to scavenge volumes.
END.
LOG
Time: May 29, 1980 11:24 AMBy: LuniewskiAction: Created file
Time: June 10, 1980 10:52 AMBy: LuniewskiAction: Changed Handle to an exported type. Made the truth for ID’s be in System.
Time: June 28, 1980 5:47 PMBy: ForrestAction: Moved in many procs from old SpecialVolume. Re-arranged. Made nullID compile-time constant.
Time: July 25, 1980 9:17 AMBy: LuniewskiAction: Updated ErrorType.
Time: September 2, 1980 5:11 PMBy: JoseAction: added to ErrorType.