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 BEGIN pMon.continuation _ [vp: resumptive[mdsi: ReadMDS[], resumee: PrincOpsUtils.MyLocalFrame[]]]; pMon.inLoadMode _ inLoadMode; SetGermArguments[outLoad, pLocation]; CallGerm[]; RETURN[pMon.responseKind] END; ResponseKind: TYPE = {initiated, outLoaded, resumed}; InLoad: PROC [pMicrocodeCopy, pGermCopy: LONG POINTER, nGerm: CARDINAL, pLocation: POINTER TO BootFile.Location, switches: Switches _ defaultSwitches] = INLINE BEGIN 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[]; END; Teledebug: PROC [pLocation: POINTER TO BootFile.Location] = INLINE BEGIN SetGermArguments[teledebug, pLocation]; CallGerm[]; END; 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 BEGIN pMon.CrossMDSCall[mdsiOther: mdsiGerm, Dest: LOOPHOLE[pInitialLink]]; LOOPHOLE[pMon.CrossMDSCall, POINTER TO PrincOps.FrameHandle].pc _ LOOPHOLE[pMon.pcCross]; END; LoadRam: PRIVATE PROC [pMicrocode: LONG POINTER, andJump: BOOLEAN] = MACHINE CODE BEGIN PrincOps.zMISC, 3 END; 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: UNSPECIFIED] -- 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 = 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. øCedar Nucleus: Interface with Germ. GermSwap.mesa Andrew Birrell May 26, 1983 9:29 am Last Edited by: Levin, September 20, 1983 11:25 am 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 Ê:˜Jšœ#™#Jšœ ™ Jšœ$™$J™2J™šÏk ˜ Jšœ œB˜PJšœœ ˜Jšœ œBœ&˜xJšœœ5˜H—J˜šœ ˜Jšœ˜—J˜Jš˜J˜J™˜š Ïnœœ œœ9œ%˜‰Jšœ2™2Jšœ˜ Jšœ4™4šœ@™@Jšœ™Jšœ ™ Jšœ™Jšœ™—Jšœl™lJšœ]˜]J˜J˜%J˜ Jšœ˜Jšœ˜—J˜Jšœœ#˜5J˜šžœœœœ œ œœ;˜˜Jšœ?™?Jšœ˜ JšœX™Xšœ œ˜Jšœ;œœ0˜q—J˜$Jš œœ œ%œœœ˜cšœœ˜Jšœ-œÏc˜D—J˜ Jšœ˜—J˜šž œœ œœ˜;Jšœ$™$Jšœ2™2Jšœ˜ Jšœ4™4J˜'J˜ Jšœ˜—J˜J˜—Jšœ$™$˜š œ œœ œœ˜)J˜J˜!—J˜šœœœ œ˜"Jšœ ˜ Jšœ˜Jšœ˜Jšœ ˜ Jšœ˜Jšœ ˜ Jšœœœ˜J˜—J˜šœœœ œ˜"J˜;J˜J˜J˜—J˜Jš œ œœœœ˜;Jšœœœœ˜#J˜Jšœœœ˜'J˜šœ˜JšœV™V—J˜šœ˜JšœU™U—J˜—Jšœ™˜šž œœ ˜0Jšœ3™3—J˜šž œœ˜Jšœ™—J˜š žœœœœœœ˜JJšœE™EJšœœ˜)—J˜š žœœœœœ˜ZJš œœœœœœ$˜]—J˜šžœœœ˜Jšœ˜ Jšœ-œ˜EJšœœœœ˜YJšœ˜—J˜š žœœœœœ œ˜DJšœœœœ˜)—J˜šžœœœ˜*Jš œœœœœ˜G—J˜š œœ œœœœ˜IJšœœ:˜I—J˜šœœœœ˜Jšœ6™6JšœV™VJšœ™Jšž œœ žœœ˜>J˜Jšœ&™&Jšœ0Ÿ˜DJ˜ Jšœ™J˜J˜JšœœœŸ˜QJšœ œ œŸ˜GJ˜—J˜J˜—JšœW™W˜šœ œœ œ˜/Jšœ™—Jšœœœœ ˜-Jšœ œœŸ˜>Jšœ œœŸ#˜BJšœJ™JJšœœœœ ˜SJšœœœ˜@Jš œœœœœœœ˜Cš œœœœœ˜HJšœ4™4—šœ œœœ˜