// PupTestInit.bcpl // Copyright Xerox Corporation 1979, 1982 // Last modified February 15, 1982 5:18 PM by Boggs get "Pup0.decl" get "Pup1.decl" get "PupTest.decl" get "Streams.d" get "AltoDefs.d" external [ // outgoing procedures InitPupTest // incoming procedures CreateDisplayStream; ShowDisplayStream CharWidth; InvertLine; GetLinePos; SetBitPos MyFrame; Usc; LoadRam; InitBcplRuntime; StartIO; Zero PupChecksum; UPupChecksum; BlockEq; UBlockEq InitializeZone; AddToZone; Allocate; Idle InitPupLevel1; Enqueue; InitializeContext; Block DefaultOtherPupProc; OtherSpigot; InitStatServ BSPReceive; EFTPReceive; EchoServer; PupTestParams Command; RemoteControl; OtherSpigotProcess PutTemplate; Ws; Wss; Confirm // outgoing statics sendPort; tp; checkBuffer savedFinish; spigotQ; ctxQ; bootFlag spyBuffer; sysZone; dsp // incoming statics PupTestFinish; maxPupDataBytes lvUserFinishProc; sysFont; PupTestEIAMc; PupTestCPMc eiaMcLoaded; etherMcLoaded; cpMcLoaded ] manifest [ stkLim = #335 black = -1 white = 0 ] static [ lastShownStream; savedSwatCP spyBuffer; sysZone; dsp sendPort; tp; checkBuffer savedFinish; spigotQ; ctxQ; bootFlag ] structure Byte^0,0 byte //---------------------------------------------------------------------------- let InitPupTest() be //---------------------------------------------------------------------------- [ bootFlag = PupTestParams eq 0 //hack...should be done in a cleaner way let versionText = "PupTest of February 15, 1982" let freeBegin = @stkLim @stkLim = MyFrame() -1000 let length = @stkLim - freeBegin let lenInit = length ls 0? #77777, length sysZone = InitializeZone(freeBegin, lenInit) freeBegin = freeBegin + lenInit length = length - lenInit if length gr 10 then AddToZone(sysZone, freeBegin, length) //This ugly patch of code discovers whether an EIA or ComProc // (or both) is present, and therefore what microcode to load. //If both are present, the user must choose one. //The boot version loads the EIA version to get the Extra Ether code. let eiaPresent, cpPresent = true, false unless bootFlag do [ @177700b = 140000b //@eiaControl = swi eiaPresent = @177704b ne 0 //read status for line = 0 to 15 do [ @(177300b + 4*line) = 1 if @(177300b + 4*line) eq 1 then [ cpPresent = true; break ] ] if cpPresent & eiaPresent then [ Ws("This machine has both an EIA and a ComProc.") Ws("*NI can use one or the other but not both.") test Confirm("*NShall I use the ComProc?") ifso eiaPresent = false ifnot cpPresent = false ] ] //Flip the Memory Refresh Task into the ram only if // this is an Alto II XM. //The boot locus vector is in ramImage!0. let ramImage = eiaPresent? PupTestEIAMc, PupTestCPMc structure Vers: [ eng bit 4; blank bit 12 ] if (table [ #61014; #1401 ])()<>Byte^i = i Enqueue(ctxQ,InitializeContext(Allocate(sysZone, (alto? 400, 300)), (alto? 400, 300), Command)) Enqueue(ctxQ,InitializeContext(Allocate(sysZone, (alto? 200, 150)), (alto? 200, 150), RemoteControl)) Enqueue(ctxQ,InitializeContext(Allocate(sysZone, (alto? 200, 150)), (alto? 200, 150), EchoServer)) Enqueue(ctxQ,InitializeContext(Allocate(sysZone, (alto? 200, 100)), (alto? 200, 100), OtherSpigotProcess)) Enqueue(ctxQ,InitializeContext(Allocate(sysZone, (alto? 400, 300)), (alto? 400, 300), BSPReceive)) Enqueue(ctxQ,InitializeContext(Allocate(sysZone, (alto? 400, 300)), (alto? 400, 300), EFTPReceive)) ] //--------------------------------------------------------------------------- and GCShowDisplayStream(st) be //--------------------------------------------------------------------------- [ ShowDisplayStream(st, DSbelow, lastShownStream) lastShownStream = st ] //--------------------------------------------------------------------------- and MakeBar(background, nLines) = valof //--------------------------------------------------------------------------- [ structure Bar: [ fdcb word; ldcb word; @DCB ] manifest lenBar = size Bar/16 let bar = Allocate(sysZone, lenBar, false, true) Zero(bar, lenBar) bar>>Bar.fdcb = lv bar>>Bar.next bar>>Bar.ldcb = lv bar>>Bar.next bar>>Bar.background = background bar>>Bar.width = 0 bar>>Bar.height = nLines resultis bar ]