DIRECTORY BootStartList USING [Base, Initialize], DebuggerSwap USING [ CallDebugger, Catcher, Initialize, StartSwatWatcher, WorryCallDebugger], GermSwap USING [GetPStartListHeader, switches], MesaRuntimeInit USING [ FrameImpl, InstructionsImpl, ProcessImpl, SignalsImpl, Start, TrapsImpl], MPCodes USING [ incorrectMachineType, incorrectMicrocode, initializationStarted, mesaRuntimeInitialized], PrincOps USING [NullFrame, VersionResult], PrincOpsUtils USING [PagesToWords, SetReturnFrame, VERSION, WriteWDC, WriteXTS], Process USING [priorityNormal, SetPriority], ProcessorFace USING [Go, millisecondsPerTick, reservedNakedNotifyMask, SetMP], RuntimeError USING [RegisterUncaughtSignalHandler], SystemVersion USING [Date, MachineType, ReleaseNumber]; Wart: PROGRAM IMPORTS BootStartList, DebuggerSwap, GermSwap, MesaRuntimeInit, PrincOpsUtils, Process, ProcessorFace, RuntimeError EXPORTS SystemVersion = BEGIN machineType: PUBLIC SystemVersion.MachineType; uCodeDate: PUBLIC SystemVersion.Date; uCodeVersion: PUBLIC CARDINAL; uCodeFloatingPoint: PUBLIC BOOL; uCodeCedar: PUBLIC BOOL; release: PUBLIC SystemVersion.ReleaseNumber; bootFileDate: PUBLIC SystemVersion.Date; InitializeBootFile: PROC = { h: BootStartList.Base; ProcessorFace.SetMP[MPCodes.initializationStarted]; DebuggerSwap.Initialize[]; h _ GermSwap.GetPStartListHeader[]; -- get it while it's still valid (i.e., before first world swap)! IF GermSwap.switches[zero] THEN DebuggerSwap.WorryCallDebugger["Key Stop 0"L]; MesaRuntimeInit.Start[LOOPHOLE[MesaRuntimeInit.TrapsImpl]]; START MesaRuntimeInit.InstructionsImpl[]; -- goes away in Trinity ProcessorFace.Go[]; CheckVersions[h]; START MesaRuntimeInit.ProcessImpl[ pdaWords: PrincOpsUtils.PagesToWords[h.pdaPages], svCounts: @h.stateVectorCounts, wordsPerSV: h.stateVectorSize, reservedNakedNotifyMask: ProcessorFace.reservedNakedNotifyMask, millisecondsPerTick: ProcessorFace.millisecondsPerTick ]; DebuggerSwap.StartSwatWatcher[enabled: GermSwap.switches[i]]; START MesaRuntimeInit.FrameImpl[]; START MesaRuntimeInit.SignalsImpl[]; [] _ RuntimeError.RegisterUncaughtSignalHandler[DebuggerSwap.Catcher]; Process.SetPriority[Process.priorityNormal]; ProcessorFace.SetMP[MPCodes.mesaRuntimeInitialized]; IF GermSwap.switches[one] THEN DebuggerSwap.CallDebugger["Key Stop 1"L]; BootStartList.Initialize[h]; MesaRuntimeInit.Start[h.controlList]; }; CheckVersions: PROC [h: BootStartList.Base] = INLINE { SecondsToDays: PROC [s: SystemVersion.Date] RETURNS [CARDINAL] = INLINE { RETURN [s/(LONG[60*60]*24)] }; info: PrincOps.VersionResult = PrincOpsUtils.VERSION[]; IF ~(info.machineType IN SystemVersion.MachineType) THEN {ProcessorFace.SetMP[MPCodes.incorrectMachineType]; DO ENDLOOP}; machineType _ info.machineType; IF SecondsToDays[uCodeDate _ h.requiredUCode[machineType]] > info.releaseDate THEN {ProcessorFace.SetMP[MPCodes.incorrectMicrocode]; DO ENDLOOP}; uCodeVersion _ info.majorVersion; uCodeFloatingPoint _ info.floatingPoint; uCodeCedar _ info.cedar; release _ h.release; bootFileDate _ h.buildDate; }; PrincOpsUtils.WriteWDC[1]; PrincOpsUtils.WriteXTS[off]; PrincOpsUtils.SetReturnFrame[PrincOps.NullFrame]; -- for Detach in MesaRuntime initialization InitializeBootFile[]; END. ΐWart.mesa last edited by Levin on June 21, 1983 5:26 pm Last edited by Andrew Birrell on April 26, 1983 1:43 pm Exports to SystemVersion Let the human know we're here. On a Dorado, this is a no-op, since ProcessorFace.Start hasn't been called yet and the "maintenance panel" is implemented in software in the processor head. On processors with physical maintenance panels (Dolphin, Dandelion), this works because SetMP is an inline, hence the ProcessorFace need not have been started (a cheat, but a useful one). Initialize the debugger linkage. We can now get to a local world-swap debugger if someone has told us where it is (i.e., if h.locDebugger and friends have been filled in (by Set Debugger Pointers)). If not, we can get to a remote debugger. Enable the language's START construct. Note: Any module invoked by the code before this point must be specified as "NOTRAP" in the input to MakeBoot and must be coded without any useful main body (including no initialization variable declarations). Furthermore, it must not use any non-microcode instructions, since the processor face has not yet been started. Such modules should be compiled /-m. Note: Any module invoked by the code before this point must not use any non-microcode instructions, since the processor face has not yet been started. Such modules should be compiled /-m. Initialize processor face. The Dorado maintenance panel now works. Other heads are started by control list on the heads configuration. Ensure valid microcode. Since this relies on the VERSION instruction, which may be implemented in software, it can't be invoked until the processor face is working. Make FORK, JOIN and the procedures in the Process interface work. If we were booted with the "i" swaitch, we can now get to the remote debugger via the keyboard, or to the local debugger if h.locDebugger and friends have been filled in. The Mesa runtime is now fully operational. Start the rest of the boot file. Main Body Κu– "Cedar" style˜Jšœ ™ Jšœ-™-J™7J˜šΟk ˜ Jšœœ˜'šœ œ˜JšœH˜H—Jšœ œ!˜/šœœ˜JšœI˜I—šœœ˜JšœY˜Y—Jšœ œ˜*Jšœœ œ˜PJšœœ˜,Jšœœ;˜NJšœ œ!˜3Jšœœ$˜7—J˜šœ˜ š˜Jšœk˜k—Jšœ˜—J˜Jš˜J™J™JšΟc™J™J˜Jšœ œ˜.J˜Jšœ œ˜%Jšœœœ˜J˜Jšœœœ˜ Jšœ œœ˜J˜Jšœ œ˜,Jšœœ˜(J˜J˜šΟnœœ˜Jšœ˜Jšœω™ωJšœ3˜3Jšœ ™ J˜Jšœ$žA˜eJšœΟ™ΟJšœœ/˜NJšœ&™&Jšœœ˜;Jšœι™ιJšœ%ž˜AJšœΎ™ΎJšœˆ™ˆJ˜Jšœ₯™₯Jšœ˜JšœA™Ašœ˜"Jšœ1˜1J˜J˜Jšœ?˜?Jšœ6˜6Jšœ˜—J˜=Jšœͺ™ͺJšœ˜"Jšœ˜$J˜FJšœ*™*J˜,Jšœ4˜4Jšœœ*˜HJ™ J˜Jšœ%˜%J˜—J˜šŸ œœœ˜6š Ÿ œœœœœ˜IJšœœ ˜J˜—Jšœ-œ˜7šœœ˜8Jšœ4œœ˜@—Jšœ˜šœL˜RJšœ2œœ˜>—J˜!Jšœ(˜(Jšœ˜J˜J˜J˜—J™Jšœ ™ J˜J˜J˜Jšœ3ž+˜^J˜J˜Jšœ˜J˜—…— ˜Ν