DIRECTORY Boot USING [LP, MDSIndex, pRequest, ReadMDS], BootSwap, Frame USING [Free, MyLocalFrame, MyGlobalFrame], Inline USING [COPY, LongCOPY], Mopcodes USING [zWR], PrincOps USING [FrameHandle, GlobalFrameHandle, Port, TrapLink]; BootSwapCross: PROGRAM IMPORTS Boot, Frame, Inline EXPORTS BootSwap SHARES BootSwap = BEGIN OPEN BootSwap, PrincOps; Initialize: PUBLIC PROCEDURE [mdsiOther: Boot.MDSIndex] = BEGIN OPEN port: LOOPHOLE[Port, PrincOps.Port], Frame; InitializeMDS[]; -- set pMon port.dest _ [frame[MyLocalFrame[]]]; -- temporarily connect Port to self Procedure[]; lCross.accesslink _ gCross; lCross.pc _ port.frame.pc; lCross.returnlink _ TrapLink; Free[port.frame]; port.frame _ lCross; Inline.COPY[from: MyGlobalFrame[], nwords: nGCross, to: gCross]; -- now mustn't set global variables Inline.LongCOPY[from: lCross, nwords: nLCross+nGCross, to: Boot.LP[highbits: mdsiOther, lowbits: lCross]]; pMon.CrossMDSCall _ LOOPHOLE[gCross+(@port-LOOPHOLE[MyGlobalFrame[], POINTER TO PrincOps.Port])]; -- connect CrossMDSCall to Port pMon.pcCross _ LOOPHOLE[lCross.pc] END; InitializeMDS: PUBLIC PROCEDURE = BEGIN pMon _ LOOPHOLE[Boot.LP[highbits: mdsiGerm, lowbits: lCross-SIZE[Mon]], LONG POINTER TO Mon] END; nGCross: CARDINAL = 12; limit: CARDINAL = LOOPHOLE[Boot.pRequest]; gCross: GlobalFrameHandle _ LOOPHOLE[limit-(limit MOD 4)-nGCross]; -- variable to avoid compiler bug nLCross: CARDINAL = 8; lCross: FrameHandle _ LOOPHOLE[gCross-nLCross]; -- variable to avoid compiler bug pMon: PUBLIC LONG POINTER TO Mon; Port: PORT RETURNS [mdsiOther: Boot.MDSIndex, Dest: PROCEDURE]; Procedure: PROCEDURE = BEGIN -- address of this frame must be same in both MDS's; global frames must be "similar" mdsiOther: Boot.MDSIndex; Dest: PROCEDURE; mdsiBack: Boot.MDSIndex; DO [mdsiOther, Dest] _ Port[]; [Dest, mdsiBack] _ Save2AndWriteMDS[Dest, Boot.ReadMDS[], mdsiOther]; Dest[]; WriteMDS[mdsiBack]; ENDLOOP END; Save2AndWriteMDS: PROCEDURE [s1, s2: UNSPECIFIED, mdsi: Boot.MDSIndex] RETURNS [t1, t2: UNSPECIFIED] = LOOPHOLE[WriteMDS]; -- t1=s1 AND t2=s2 WriteMDS: PROCEDURE [mdsi: Boot.MDSIndex] = MACHINE CODE BEGIN Mopcodes.zWR, 3 END; END. BootSwapCross.mesa last edited by Levin on March 11, 1983 1:26 pm Inter-MDS germ linkage Set up frame for Procedure and make it pending on Port Now set up local and global frames with copy in other MDS The numbers nGCross and nLCross must be divisible by 4 and not too small! Κΰ– "Cedar" style˜Jšœ™J™.J™šΟk ˜ Jšœœœ˜-Jšœ ˜ Jšœœ%˜0Jšœœœ ˜Jšœ œ˜šœ œ2˜@J˜——šœ˜Jšœ˜Jšœ ˜Jšœ ˜—J˜Jš˜J˜Jšœ˜J˜Jšœ™J˜šΟn œœ œ˜9Jšœœœ˜6JšœΟc ˜Jšœ6™6Jšœ%Ÿ#˜HJ˜ Jšœ9™9J˜J˜J˜J˜J˜Jšœœ6Ÿ#˜dJšœ@œ(˜j˜Jš œœœœŸ˜m—Jšœœ ˜"Jšœ˜—J˜šž œœ œ˜!Jš˜Jš œœœ%œœœœ˜\Jšœ˜J˜—JšœI™IJšœ œ˜Jšœœœ˜*JšœœœŸ!˜dJšœ œ˜JšœœŸ!˜QJ˜Jš œœœœœ˜!J˜Jš œœœžœ œ˜?J˜šž œ œ˜JšœŸT˜ZJšœžœ œ˜*J˜š˜J˜J˜EJ˜J˜Jš˜—Jšœ˜J˜—š žœ œ  œœ  œ˜fJšœ Ÿ˜&—šžœ œ˜+Jšœœœœ˜'J˜—Jšœ˜J˜—…—n j