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 April 5, 1983 2:06 pm
DIRECTORY
BcdDefs USING [FTIndex],
BcdOps USING [BcdBase, CTHandle, FPHandle, MTHandle, SPHandle],
BootFile USING [Header],
MBTTY USING [Handle],
MBVM USING [Base, BIndex, CodeSeg, DataSeg, FileSeg, nullIndex, Seg],
PrincOps USING [ControlLink, FrameSizeIndex, GlobalFrameHandle],
Segments USING [FHandle, SHandle],
StartList USING [Header, Base, StateVectorCounts],
Streams USING [Handle],
Time USING [Packed];
MB: DEFINITIONS =
BEGIN
Types and Related Declarations
Handle: TYPE = LONG POINTER TO Object;
Object:
TYPE =
RECORD [
input, output, etherOutput, loadmap: LONG STRING,
buildTime: Time.Packed,
ttyHandle: MBTTY.Handle,
zone: UNCOUNTED ZONE,
debug, germ, etherFormat, hexLoadmap: BOOLEAN,
inputBCDs: LONG POINTER TO InputBCDs,
lsseg: MBVM.DataSeg, -- loadstate's MBVM segment
header: LONG POINTER TO StartList.Header,
bootHeader: LONG POINTER TO BootFile.Header,
bootStream: Streams.Handle,
nProcesses, framePages, pdaPages, svSize, gftLength: CARDINAL,
mdsBase, codeBase: MBVM.Base,
vmMap: BitArray,
lastVMPage: MBVM.Base,
nBootPages: CARDINAL,
nModules, nGFIs, nFilePages, nResidentPages, nBootLoadedPages: CARDINAL,
stateVectorCounts: StartList.StateVectorCounts,
scriptBase: StartList.Base
];
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 = LONG POINTER TO BObject;
BObject:
TYPE =
RECORD [
name: LONG STRING,
bcd: BcdOps.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 = LONG POINTER TO 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 = LONG DESCRIPTOR FOR ARRAY --BcdDefs.GFTIndex-- OF ModuleInfo;
ModuleInfo:
TYPE =
RECORD [
mth: BcdOps.MTHandle,
frame: PrincOps.GlobalFrameHandle,
code: MBVM.CodeSeg
];
BitArray: TYPE = LONG DESCRIPTOR FOR PACKED ARRAY OF BOOL;
From MBDebug
InitDebug: PROC [h: Handle];
FinishDebug: PROC;
DumpSegs: PROC [segs: LONG DESCRIPTOR FOR ARRAY OF MBVM.Seg, msg: STRING];
DumpFrames: PROC;
DumpInputBcds: PROC;
DumpBootHeader: PROC;
DumpStartList: PROC;
From MBDriver
Zero: PROC [p: LONG POINTER, n: CARDINAL];
MakeBootVersion: PROC [s: STRING];
From MBLoader and friends
InitLoader: PROC [h: Handle];
FinishLoader: PROC;
Load: PROC;
ReleaseModuleTable: PROC [loadee: BHandle];
Alloc: PROC [fsi: CARDINAL] RETURNS [p: POINTER];
AllocFault: ERROR;
From MBLoadmap
InitLoadmap: PROC [h: Handle];
FinishLoadmap: PROC;
From MBMain
InitMain: PROC [h: Handle];
FinishMain: PROC;
Abort: SIGNAL;
Error: PROC [msg: STRING];
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;
WriteBootFile: PROC;
WriteGermFile: PROC;
From MBParse
ListType: TYPE = {resident, resDesc, in};
InitParse: PROC [h: Handle];
FinishParse: PROC;
ProcessInput: PROC [file: LONG STRING];
EchoInput: PROC;
WartFrame: PROC RETURNS [PrincOps.GlobalFrameHandle];
EnumerateCode:
PROC [
state: ListType, proc: PROC [bh: BHandle, mth: BcdOps.MTHandle] RETURNS [BOOL]];
EnumerateFramePacks:
PROC [
state: ListType, proc: PROC [bh: BHandle, fph: BcdOps.FPHandle] RETURNS [BOOL]];
EnumerateSpaces:
PROC [
state: ListType, proc: PROC [bh: BHandle, sph: BcdOps.SPHandle, index: CARDINAL] RETURNS [BOOL]];
EnumerateGlobalFrames:
PROC [
state: ListType, proc: PROC [bh: BHandle, mth: BcdOps.MTHandle] RETURNS [BOOL]];
EnumerateBCDs:
PROC [
state: ListType, proc: PROC [bh: BHandle] RETURNS [BOOLEAN]];
EnumerateNoTrapModules:
PROC [
proc: PROC [bh: BHandle, mth: BcdOps.MTHandle] RETURNS [BOOL]];
From MBScript
InitScript: PROC [h: Handle];
FinishScript: PROC;
MakeScript: PROC;
From MBUtilities
InitUtilities: PROC [h: Handle];
FinishUtilities: PROC;
NameToG: PROC [name: LONG STRING] RETURNS [PrincOps.GlobalFrameHandle];
NameToMTHandle:
PROC [name:
LONG
STRING]
RETURNS [bh: BHandle, mth: BcdOps.MTHandle];
NameToFPHandle:
PROC [name:
LONG
STRING]
RETURNS [bh: BHandle, fph: BcdOps.FPHandle];
NameToSPHandle:
PROC [name:
LONG
STRING]
RETURNS [bh: BHandle, sph: BcdOps.SPHandle, index: CARDINAL];
NameToCTHandle:
PROC [name:
LONG
STRING]
RETURNS [bh: MB.BHandle, cth: BcdOps.CTHandle];
InstanceToMTHandle:
PROC [module, instance:
LONG
STRING]
RETURNS [bh: BHandle, mth: BcdOps.MTHandle];
DoAllModules:
PROC [
PROC [BHandle, BcdOps.MTHandle]
RETURNS [
BOOL]]
RETURNS [BOOL];
DoAllSpaces:
PROC [
PROC [BHandle, BcdOps.SPHandle,
CARDINAL]
RETURNS [
BOOL]]
RETURNS [BOOL];
DoAllFramePacks:
PROC [
PROC [BHandle, BcdOps.FPHandle]
RETURNS [
BOOL]]
RETURNS [BOOL];
DoAllBCDs:
PROC [
PROC [BHandle]
RETURNS [
BOOL]]
RETURNS [BOOL];
SetConfig: PROC [name: LONG STRING];
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;