-- StoragePrograms.mesa (last edited by Knutsen on January 26, 1981 11:42 AM)
DIRECTORY
Boot USING [DiskFileID, Location, LVBootFiles],
Device USING [Type],
Environment USING [Long, PageCount, PageNumber , wordsPerPage],
Inline USING [LongMult],
Space USING [Handle, WindowOrigin],
StartList USING [Index, Base],
Transaction USING [Handle];
StoragePrograms: DEFINITIONS
IMPORTS Inline =
BEGIN
-- Subcomponents of the Store configuration:
InitializeFileMgr: PROCEDURE [bootFile: LONG POINTER TO disk Boot.Location, pLVBootFiles: POINTER TO Boot.LVBootFiles]
RETURNS [debuggerDeviceType: Device.Type, debuggerDeviceOrdinal: CARDINAL];
-- If bootFile.deviceType~=Device.nullType then set system volume to logical volume containing bootFile.id.da. If no installed debugger can be found then return debuggerDeviceType=nullDevice, else return type, handle, and boot file id’s from our debugger’s system volume.
InitializeFiler: PROCEDURE;
InitializeMStore: PROCEDURE; -- real memory management.
InitializeRegionCacheA: PROCEDURE; -- creates region cache, initializes AllocateRuthlessly.
InitializeRegionCacheB: PROCEDURE; -- describes region cache space to Swapper.
InitializeResidentMemoryA: PROCEDURE; -- (On return, ResidentMemory is fully functional.)
InitializeResidentMemoryB: PROCEDURE; -- Describes its space(s) to the Swapper.
InitializeSimpleSpace: PROCEDURE;
InitializeSwapper: PROCEDURE [pMapLogDesc: LONG POINTER];
InitializeTransactionData: PROCEDURE; -- (must be called at SimpleSpace time.)
InitializeVMMgr: PROCEDURE [countVM: Environment.PageCount, pMapLogDesc: LONG POINTER];
RecoverTransactions: PROCEDURE; -- (must be called after Space is functional.)
ReplacementProcess: PROCEDURE [threshold: Environment.PageCount];
-- Facilities used during initialization of the components of the Store configuration:
-- Exported by PilotControl:
countVM: Environment.PageCount; -- amount of virtual memory implemented by the current processor.
pageMDS: Environment.PageNumber; -- first page of Pilot’s (only) MDS.
lpMDS: LONG POINTER; -- to Pilot’s (only) MDS.
pageHyperspace: Environment.PageNumber; -- first page following Pilot’s MDS.
countHyperspace: Environment.PageCount;
pageMDSGerm: Environment.PageNumber; -- first page of Germ’s MDS.
tableBase: StartList.Base; -- base of the Start List.
StartListProc: TYPE = PROCEDURE [index: StartList.Index];
EnumerateStartList: PROCEDURE [Proc: StartListProc];
-- Calls Proc once for each entry in the StartList.
PointerFromPage: PROCEDURE [page: Environment.PageNumber] RETURNS [p: POINTER];
-- Exported by SimpleSpaceImpl:
nullSpaceHandle: Space.Handle; -- for use before Space.nullHandle is initialized.
nullTransactionHandle: Transaction.Handle; -- for use before Transaction.nullHandle is initialized.
SpaceOptions: TYPE = RECORD [
createSpace, pinSpaceD, -- options for space creation.
mapped, -- options for space and region creation.
createRegion, pinRegionD, subspace, initiallyResident, pinned, -- options for region creation.
mStoreDeallocate, -- do an MStore.Deallocate on this interval.
emptyInterval : -- an unused VM.Interval useable for creation of simpleSpaces.
BOOLEAN ← FALSE];
-- Note: subspace=TRUE indicates that the primary space (family space) is divided into smaller swap unit spaces/regions.
createSimpleSpace: SpaceOptions =
[createSpace: TRUE, pinSpaceD: TRUE, mapped: FALSE, createRegion: TRUE, pinRegionD: TRUE, subspace: FALSE];
empty: SpaceOptions = [emptyInterval: TRUE]; -- an unused VM.Interval useable for creation of simpleSpaces.
free: SpaceOptions = [mStoreDeallocate: TRUE]; -- do an MStore.Deallocate on this interval.
outlaw: SpaceOptions = -- a space whose contents will not be managed by the Swapper.
[createSpace: TRUE, pinSpaceD: FALSE, mapped: FALSE, createRegion: TRUE, pinRegionD: FALSE, subspace: FALSE];
-- Creates entries in VM databases (space and region caches) describing initially resident VM spaces allocated by StartPilot.
DescribeSpace: PROCEDURE
[options: SpaceOptions, page: Environment.PageNumber, count: Environment.PageCount, window: Space.WindowOrigin];
-- Note: a space or region is made readOnly iff the window’s permissions only allow reading.
-- The initially resident memory allocated and filled by StartPilot is organized into spaces, possibly tiled with smaller swap unit subspaces. Information describing this initially resident memory must be inserted into the space and region caches by DescribeSpace, which only supports this organization of spaces. In particular, there must be a space descriptor created for each mapped space, and a region descriptor created for each unitary mapped space and for each subspace of a mapped space. No other space or region descriptors should be created.
HandleFromPage: PROCEDURE [page: Environment.PageNumber] RETURNS [handle: Space.Handle];
-- Returns handle corresponding to the unitary or family space starting at the given page. (See StartList.mesa.)
SuperFromPage: PROCEDURE [page: Environment.PageNumber] RETURNS [handle: Space.Handle, superPage: Environment.PageNumber];
-- Returns handle and first page number of the parent space of the unitary or family space starting at the given page. (See StartList.mesa.)
-- Exported by MStore:
RecoverMStore: PROCEDURE;
-- Places all free real memory into arbitrary vacant virtual pages. Caller must first disable interrupts.
-- Allocation table is not updated since another system is about to be booted.
-- Exported by VMMControl and UtilityVMMControl and DiagnosticPilotImpl:
IsUtilityPilot: PROCEDURE RETURNS [BOOLEAN];
IsDiagnosticPilot: PROCEDURE RETURNS [BOOLEAN];
-- INLINEs:
LongPointerFromPage: PROCEDURE [page: Environment.PageNumber] RETURNS [lp: LONG POINTER] = INLINE
{ RETURN[LOOPHOLE[Inline.LongMult[page, Environment.wordsPerPage]]] };
PageFromLongPointer: PROCEDURE [lp: LONG POINTER] RETURNS [page: Environment.PageNumber] = INLINE
BEGIN OPEN LOOPHOLE[lp, num Environment.Long];
RETURN[highbits*256+lowbits/256];
END;
END.
LOG
July 14, 1978 10:01 AMMcJonesCreate file
July 17, 1978 5:30 PMMcJonesAdd countReal to SwapperControl, VMMControl
August 10, 1978 5:13 PMPurcellAdd DesribeSpace
August 16, 1978 8:01 PMPurcellAdd pMapLogDesc
August 29, 1978 11:33 AMMcJonesAdd ReplacementProcess; added pMapLogDesc to SwapperControl
September 29, 1978 5:23 PMMcJonesCR20.45: Add UnmapDataSpaces
July 31, 1979 11:16 AMMcJonesAdd boot file id’s to FileImpl
August 23, 1979 9:12 AMKnutsenImprove readability of SpaceOptions table.
August 27, 1979 10:58 AMKnutsenChange VMMControl: PROGRAM to InitVMMgr: PROCEDURE
September 18, 1979 3:18 PMMcJonesChange FileImpl parameters to use types from Boot
January 31, 1980 1:15 PMKnutsenPass VM for Region Cache to SwapperControl.
February 5, 1980 3:23 PMMcJonesReplace FileMgr debugger device result with type and ordinal
April 16, 1980 9:04 AMKnutsenAdded InitializeResidentMemoryA/B, InitializeRegionCacheA/B, InitializeMStore, InitializeSimpleSpace, RecoverMStore, StartListProc, countVM, pageMDS, pageMDSGerm, lpMDS, pageHyperspace, countHyperspace, EnumerateStartList, tableBase. InitializeSwapper takes fewer parameters. Changed IsBoundIfNotUtilityPilot to IsUtilityPilot, added IsDiagnosticPilot.
July 1, 1980 4:55 PMKnutsenNew StartList format. Redo SpaceOptions. Made inlines really inline.
July 7, 1980 5:13 PMGobbelAdded InitializeTransactionData, RecoverTransactions.
January 26, 1981 11:45 AMKnutsenAdded nullTransactionHandle.