MB.mesa
Last edited by Sandman on 6-Aug-81 16:06:17
Last edited by Lewis on 17-Sep-81 14:54:32
Last edited by Levin on June 21, 1983 2:40 pm
DIRECTORY
BcdDefs USING [BcdBase, CTHandle, FPHandle, FTIndex, ModuleIndex, MTHandle, SPHandle],
BootFile USING [Header],
BootStartList USING [Header, Base, StateVectorCounts],
IO USING [STREAM],
MBVM USING [Base, BIndex, CodeSeg, DataSeg, FileSeg, nullIndex, Segs],
PrincOps USING [ControlLink, FrameSizeIndex, GlobalFrameHandle, PageNumber],
Rope USING [ROPE],
Segments USING [FHandle, SHandle],
Time USING [Packed];
MB: DEFINITIONS =
BEGIN
Types and Related Declarations
ROPE: TYPE = Rope.ROPE;
Handle: TYPE = REF Object;
Object: TYPE = RECORD [
input, output, etherOutput, loadmapName: ROPENIL,
buildTime: Time.Packed ← [0],
typescript, loadmap: IO.STREAMNIL,
debug, germ, etherFormat, hexLoadmap: BOOLEANFALSE,
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,
bcd: BcdDefs.BcdBase,
bcdSeg: MBVM.FileSeg, -- in boot file's address space
bcdSegment: Segments.SHandle, -- in MakeBoot's address space
mt: MT,
gfiOffset: CARDINAL,
files: FileItem
];
FileItem: TYPE = REF FileObject;
FileObject: TYPE = RECORD [
link: FileItem,
fti: BcdDefs.FTIndex,
handle: Segments.FHandle,
create: Time.Packed,
ext: BOOL
]; -- TRUE => file's name has extension
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
];
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
Zero: PROC [p: LONG POINTER, n: CARDINAL];
MakeBootVersion: PROC RETURNS [ROPE];
From MBLoader and friends
InitLoader: PROC [h: Handle];
FinishLoader: PROC;
Load: PROC;
Alloc: PROC [fsi: CARDINAL] RETURNS [p: POINTER];
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: PROC [size: CARDINAL, single, resident: BOOL]
RETURNS [frames: POINTER, inFrameHeap: BOOL];
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: MB.BHandle, cth: BcdDefs.CTHandle];
InstanceToMTHandle: PROC [module, instance: ROPE]
RETURNS [bh: BHandle, mth: BcdDefs.MTHandle];
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 [MB.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.