DIRECTORY BootFile USING [Continuation, ContinuationKind, InLoadMode, Location, MDSIndex], BootStartList USING [Header], PrincOps USING [BytePC, ControlLink, FrameHandle, GlobalFrameHandle, PageCount, SD, sBootSwitches, wordsPerPage, zMISC], PrincOpsUtils USING [HighHalf, LongCopy, MakeLongPointer, MyLocalFrame]; GermSwap: DEFINITIONS IMPORTS PrincOpsUtils = BEGIN OutLoad: PROC [pLocation: POINTER TO BootFile.Location, inLoadMode: BootFile.InLoadMode] RETURNS [ResponseKind[outLoaded..resumed]] = INLINE { pMon.continuation _ [vp: resumptive[mdsi: ReadMDS[], resumee: PrincOpsUtils.MyLocalFrame[]]]; pMon.inLoadMode _ inLoadMode; SetGermArguments[outLoad, pLocation]; CallGerm[]; RETURN[pMon.responseKind] }; ResponseKind: TYPE = {initiated, outLoaded, resumed}; InLoad: PROC [pMicrocodeCopy, pGermCopy: LONG POINTER, nGerm: CARDINAL, pLocation: POINTER TO BootFile.Location, switches: Switches _ defaultSwitches] = INLINE { IF pGermCopy~=NIL THEN PrincOpsUtils.LongCopy[from: pGermCopy, nwords: nGerm, to: LP[NIL, mdsiGerm] + countSkip*PrincOps.wordsPerPage ]; SetGermArguments[inLoad, pLocation]; LOOPHOLE[LP[@PrincOps.SD[PrincOps.sBootSwitches], mdsiGerm], LONG POINTER TO Switches]^ _ switches; IF pMicrocodeCopy~=NIL THEN LoadRam[pMicrocode: pMicrocodeCopy, andJump: TRUE]; -- never returns CallGerm[]; }; Teledebug: PROC [pLocation: POINTER TO BootFile.Location] = INLINE { SetGermArguments[teledebug, pLocation]; CallGerm[]; }; Request: TYPE = MACHINE DEPENDENT RECORD[ action(0): Action, location(1): BootFile.Location ]; Action: TYPE = MACHINE DEPENDENT { inLoad(0), pilotOutLoad(1), bootPhysicalVolume(2), teledebug(3), noOp(4), outLoad(5), (LAST[CARDINAL]) }; Switch: TYPE = MACHINE DEPENDENT { zero, one, two, three, four, five, six, seven, eight, nine, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z }; Switches: TYPE = PACKED ARRAY Switch OF DefaultSwitch _ []; DefaultSwitch: TYPE = BOOL _ FALSE; defaultSwitches: Switches = ALL[FALSE]; switches: Switches; bootedFrom: Request; Initialize: PROC [mdsiOther: BootFile.MDSIndex]; InitializeMDS: PROC; GetPStartListHeader: PROC RETURNS [LONG POINTER TO BootStartList.Header] = INLINE { RETURN[pMon.pStartListHeader] }; SetGermArguments: PRIVATE PROC [action: Action, pLocation: POINTER TO BootFile.Location] = INLINE { LOOPHOLE[LP[pRequest, mdsiGerm], LONG POINTER TO Request]^ _ [action, pLocation^]; }; CallGerm: PRIVATE PROC = INLINE { pMon.CrossMDSCall[mdsiOther: mdsiGerm, Dest: LOOPHOLE[pInitialLink]]; LOOPHOLE[pMon.CrossMDSCall, POINTER TO PrincOps.FrameHandle].pc _ LOOPHOLE[pMon.pcCross]; }; LoadRam: PRIVATE PROC [pMicrocode: LONG POINTER, andJump: BOOLEAN] = MACHINE CODE { PrincOps.zMISC, 3 }; ReadMDS: PROC RETURNS[BootFile.MDSIndex] = INLINE { RETURN[[PrincOpsUtils.HighHalf[LONG[LOOPHOLE[1,POINTER]]]]] }; LP: PROC[mdsRel: POINTER, mds: BootFile.MDSIndex] RETURNS[LONG POINTER] = INLINE { RETURN[PrincOpsUtils.MakeLongPointer[low: mdsRel, high: mds]] }; Mon: PRIVATE TYPE = RECORD [ CrossMDSCall: PROC [mdsiOther: BootFile.MDSIndex, Dest: PROC], pcCross: PrincOps.BytePC, continuation: resumptive BootFile.Continuation, -- for WriteMDS hack inLoadMode: BootFile.InLoadMode, responseKind: ResponseKind, fill: [0..8192) _ 0, pStartListHeader: POINTER TO BootStartList.Header, -- only if responseKind=booted selfFill: RECORD [a, b, c, d: WORD] -- obsolete, remove someday ]; pRequest: POINTER TO Request = LOOPHOLE[1360B]; limit: PRIVATE CARDINAL = LOOPHOLE[pRequest]; nGCross: PRIVATE CARDINAL = 12; --cross-MDS global frame words nLCross: PRIVATE CARDINAL = 8; --cross-MDS fixed local frame words gCross: PRIVATE PrincOps.GlobalFrameHandle = LOOPHOLE[limit-(limit MOD 4)-nGCross]; lCross: PRIVATE PrincOps.FrameHandle = LOOPHOLE[gCross-nLCross]; pMon: PRIVATE LONG POINTER TO Mon = LOOPHOLE[LP[lCross-SIZE[Mon], mdsiGerm]]; pInitialLink: PRIVATE POINTER TO PrincOps.ControlLink = LOOPHOLE[1376B]; pCountGerm: POINTER TO PrincOps.PageCount = LOOPHOLE[1377B]; mdsiGerm: BootFile.MDSIndex = [76B]; countSkip: PrincOps.PageCount = 2; END. |GermSwap.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Andrew Birrell May 26, 1983 9:29 am Levin, September 20, 1983 11:25 am Russ Atkinson (RRA) February 19, 1985 2:48:00 pm PST Doug Wyatt, February 22, 1985 6:03:36 pm PST Interface with the Germ. Transfers to germ Assume interrupts disabled, all devices turned off Set up request in cross-MDS monitor shared with germ RC: TYPE = MACHINE DEPENDENT RECORD [ to get around compiler bug fill: [0..177B], kind: BootFile.ContinuationKind, mdsi: BootFile.MDSIndex, resumee: UNSPECIFIED]; pMon.continuation _ LOOPHOLE[RC[fill: 0, kind: resumptive, mdsi: ReadMDS[], resumee: Frame.MyLocalFrame[]]]; Load boot file, performing microcode and germ swap if necessary IF pMicrocodeCopy~=NIL THEN DeviceCleanup.Perform[kill]; ++ causes FATAL ERROR IN PASS 4 The germ is free to ingore pLocation Assume interrupts disabled, all devices turned off Set up request in cross-MDS monitor shared with germ Layout of Germ requests and switches Switches with which we were booted. Valid only after calling GermSwap.InitialiseMDS[]. Request with which we were booted. Valid only after calling GermSwap.InitialiseMDS[]. Cross-MDS linkage Per-system initialization (does InitializeMDS also) Per-MDS initialization Valid after start of initial boot file up until first call to OutLoad Extension to basic request for cross-MDS communication WHEN THIS IS CHANGED, both Pilot and Germ will be incompatible until both are updated! constants for WriteMDS hack: additional fields for outLoad request: response fields: Attributes of germ Short pointers are relative to Germ's MDS. Beware of GFT at 1400B. Arguments of each germ call. gCross and lCross must be allocated identically in our MDS and Germ's MDS! which is itself an indirect link within the germ MDS excluding pageBuffer until Pilot is moved from first 64K initial vacant pages within germ; will become 0 Κ5˜codešœ ™ Kšœ Οmœ1™—K˜šžœžœ žœžœžœžœžœ˜RKšžœ:˜@—K˜šœžœžœžœ˜Kšœ6™6KšœV™VKšœ™KšŸ œžœ Ÿœžœ˜>K˜Kšœ&™&Kšœ0 ˜DK˜ Kšœ™K˜K˜Kšœžœžœ ˜QKšœ žœžœ ˜@K˜—K˜—šœ™KšœC™CK™šœ žœžœ žœ˜/Kšœ™—Kšœžœžœžœ ˜-Kšœ žœžœ ˜>Kšœ žœžœ #˜BKšœJ™JKšœžœžœžœ ˜SKšœžœžœ˜@Kšœžœžœžœžœžœžœžœ˜Mš œžœžœžœžœ˜HKšœ4™4—šœ žœžœžœ˜