MB.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Sandman on 6-Aug-81 16:06:17
Lewis on 17-Sep-81 14:54:32
Levin on January 12, 1984 1:27 pm
Russ Atkinson on March 8, 1985 4:58:29 pm PST
DIRECTORY
BasicTime USING [GMT, nullGMT],
BcdDefs USING [BcdBase, CTHandle, FPHandle, FTIndex, ModuleIndex, MTHandle, NameRecord, SPHandle],
BootFile USING [Header],
BootStartList USING [Header, Base, StateVectorCounts],
IO USING [STREAM],
MBVM USING [Base, BIndex, CodeSeg, DataSeg, FileSeg, Links, nullIndex, Pages, Segs],
PrincOps USING [ControlLink, FrameSizeIndex, GlobalFrameHandle, PageNumber],
Rope USING [ROPE];
MB: CEDAR DEFINITIONS =
BEGIN
Types and Related Declarations
ROPE: TYPE = Rope.ROPE;
Handle: TYPE = REF Object;
Object: TYPE = RECORD [
input, output, etherOutput, loadmapName: ROPENIL,
buildTime: BasicTime.GMT ← BasicTime.nullGMT,
typescript, loadmap: IO.STREAMNIL,
debug, germ, etherFormat, hexLoadmap: BOOLFALSE,
inputBCDs: REF InputBCDs ← NIL,
lsseg: MBVM.DataSeg ← NIL, -- loadstate's MBVM segment
bootHeader: REF BootFile.Header ← NIL,
bootStream: IO.STREAMNIL,
header: REF BootStartList.Header ← NIL, -- header portion of start list in MakeBoot's VM
scriptBase: BootStartList.Base ← NIL, -- entire start list in MakeBoot's VM
scriptBaseInVM: BootStartList.Base ← NIL, -- entire start list in target VM
nProcesses, framePages, pdaPages, svSize, gftLength: CARDINAL ← 0,
mdsBase, codeBase: MBVM.Base ← 0,
vmMap: BitArray ← NIL,
lastVMPage: MBVM.Base ← 0,
nModules, nGFIs, nFilePages, nResidentPages, nBootLoadedPages: CARDINAL ← 0,
stateVectorCounts: BootStartList.StateVectorCounts ← ALL[0]
];
BIndex: TYPE = MBVM.BIndex;
nullIndex: BIndex = MBVM.nullIndex;
BCount: TYPE = [0..LAST[BIndex]-1+1];
InputBCDs: TYPE = RECORD[
nBcds: BCount ← 0,
bcds: SEQUENCE length: BCount OF BHandle ← NULL
];
BHandle: TYPE = REF BObject;
BObject: TYPE = RECORD [
name: ROPE, -- name as presented in command input, extension guaranteed
bcd: BcdDefs.BcdBase, -- in MakeBoot's address space
pages: MBVM.Pages, -- in MakeBoot's address space
bcdSeg: MBVM.FileSeg, -- in boot file's address space
mt: MT,
gfiOffset: CARDINAL,
files: FileList
];
FileList: TYPE = LIST OF BcdDefs.FTIndex;
MT: TYPE = REF ModuleInfoSequence;
ModuleInfoSequence: TYPE = RECORD [
SEQUENCE length: BcdDefs.ModuleIndex OF ModuleInfo
];
ModuleInfo: TYPE = RECORD [
mth: BcdDefs.MTHandle,
frame: PrincOps.GlobalFrameHandle,
code: MBVM.CodeSeg,
codeLinks: MBVM.Links
];
BitArray: TYPE = REF BitArrayObject;
BitArrayObject: TYPE = RECORD [PACKED SEQUENCE length: CARDINAL OF BOOL];
From MBDebug
InitDebug: PROC [h: Handle];
FinishDebug: PROC;
DumpSegs: PROC [segs: MBVM.Segs, msg: ROPE];
DumpFrames: PROC;
DumpInputBcds: PROC;
DumpBootHeader: PROC;
DumpStartList: PROC;
From MBDriver
MakeBootVersion: PROC RETURNS [ROPE];
From MBLoader and friends
InitLoader: PROC [h: Handle];
FinishLoader: PROC;
Load: PROC;
Alloc: UNSAFE PROC [fsi: CARDINAL] RETURNS [p: POINTER]; -- not really UNSAFE
AllocFault: ERROR;
From MBLoadmap
InitLoadmap: PROC [h: Handle];
FinishLoadmap: PROC;
OpenLoadmap: PROC;
From MBMain
InitMain: PROC [h: Handle];
FinishMain: PROC;
Abort: SIGNAL;
Error: PROC [msg: ROPE];
InitMemory: PROC;
TurnOffStartTrap: PROC;
StartControlLink: PROC RETURNS [PrincOps.ControlLink];
GetFrameWeight: PROC [index: PrincOps.FrameSizeIndex] RETURNS [weight: CARDINAL];
SetFrameWeight: PROC [index: PrincOps.FrameSizeIndex, weight: CARDINAL];
GetFsiChain: PROC [index: PrincOps.FrameSizeIndex]
RETURNS [fsiNext: PrincOps.FrameSizeIndex];
SetFsiChain: PROC [index: PrincOps.FrameSizeIndex, fsiNext: PrincOps.FrameSizeIndex];
AllocateFrames: UNSAFE PROC [size: CARDINAL, single, resident: BOOL]
RETURNS [frames: POINTER, inFrameHeap: BOOL]; -- not really UNSAFE
ReportFrameAllocation: PROC;
From MBOutput
InitOutput: PROC [h: Handle];
FinishOutput: PROC;
PreScanSegsForOutput: PROC [segs: MBVM.Segs]
RETURNS [lastBootedPage: PrincOps.PageNumber];
WriteBootFile: PROC;
WriteGermFile: PROC;
From MBParse
ListType: TYPE = {resident, resDesc, in};
InitParse: PROC [h: Handle];
FinishParse: PROC;
ProcessInput: PROC [file: ROPE];
EchoInput: PROC;
WartFrame: PROC RETURNS [PrincOps.GlobalFrameHandle];
EnumerateCode: PROC [
state: ListType, proc: PROC [bh: BHandle, mth: BcdDefs.MTHandle] RETURNS [BOOL]];
EnumerateFramePacks: PROC [
state: ListType, proc: PROC [bh: BHandle, fph: BcdDefs.FPHandle] RETURNS [BOOL]];
EnumerateSpaces: PROC [
state: ListType, proc: PROC [bh: BHandle, sph: BcdDefs.SPHandle, index: CARDINAL] RETURNS [BOOL]];
EnumerateGlobalFrames: PROC [
state: ListType, proc: PROC [bh: BHandle, mth: BcdDefs.MTHandle] RETURNS [BOOL]];
EnumerateBCDs: PROC [
state: ListType, proc: PROC [bh: BHandle] RETURNS [BOOLEAN]];
EnumerateNoTrapModules: PROC [
proc: PROC [bh: BHandle, mth: BcdDefs.MTHandle] RETURNS [BOOL]];
EnumerateControlList: PROC [
proc: PROC [bh: BHandle, cth: BcdDefs.CTHandle] RETURNS [BOOL]];
From MBScript
InitScript: PROC [h: Handle];
FinishScript: PROC;
MakeScript: PROC;
From MBUtilities
InitUtilities: PROC [h: Handle];
FinishUtilities: PROC;
NameToG: PROC [name: ROPE] RETURNS [PrincOps.GlobalFrameHandle];
NameToMTHandle: PROC [name: ROPE] RETURNS [bh: BHandle, mth: BcdDefs.MTHandle];
NameToFPHandle: PROC [name: ROPE] RETURNS [bh: BHandle, fph: BcdDefs.FPHandle];
NameToSPHandle: PROC [name: ROPE]
RETURNS [bh: BHandle, sph: BcdDefs.SPHandle, index: CARDINAL];
NameToCTHandle: PROC [name: ROPE] RETURNS [bh: BHandle, cth: BcdDefs.CTHandle];
InstanceToMTHandle: PROC [module, instance: ROPE]
RETURNS [bh: BHandle, mth: BcdDefs.MTHandle];
RopeForFTI: PROC [bcd: BcdDefs.BcdBase, fti: BcdDefs.FTIndex] RETURNS [ROPE];
RopeForNameRecord: PROC [bcd: BcdDefs.BcdBase, name: BcdDefs.NameRecord]
RETURNS [ROPE];
DoAllModules: PROC [PROC [BHandle, BcdDefs.MTHandle] RETURNS [BOOL]]
RETURNS [BOOL];
DoAllSpaces: PROC [PROC [BHandle, BcdDefs.SPHandle, CARDINAL] RETURNS [BOOL]]
RETURNS [BOOL];
DoAllFramePacks: PROC [PROC [BHandle, BcdDefs.FPHandle] RETURNS [BOOL]]
RETURNS [BOOL];
DoAllBCDs: PROC [PROC [BHandle] RETURNS [BOOL]]
RETURNS [BOOL];
DoAllTopLevelConfigs: PROC [proc: PROC [BHandle, BcdDefs.CTHandle] RETURNS [BOOL]]
RETURNS [BOOL];
SetConfig: PROC [name: ROPE];
ResetConfig: PROC;
VirtualGlobalFrame: PROC [PrincOps.GlobalFrameHandle]
RETURNS [PrincOps.GlobalFrameHandle];
From MBVMemory and MBCache
InitCache: PROC [h: Handle];
FinishCache: PROC;
InitVM: PROC [h: Handle];
FinishVM: PROC;
END.