<> <> <> <> <> <> DIRECTORY BootStartList USING [Base, Initialize], DebuggerSwap USING [CallDebugger, Catcher, Initialize, StartSwatWatcher, WorryCallDebugger], GermSwap USING [GetPStartListHeader, Switch, switches], MesaRuntimeInit USING [FrameImpl, InstructionsImpl, ProcessImpl, SignalsImpl, Start, TrapsImpl], MPCodes USING [incorrectMachineType, incorrectMicrocode, initializationStarted, mesaRuntimeInitialized], PrincOps USING [NullFrame, VersionResult], PrincOpsUtils USING [SetReturnFrame, VERSION, WordsForPages, WriteWDC, WriteXTS], Process USING [priorityNormal, SetPriority], ProcessorFace USING [Go, InitializeCleanup, millisecondsPerTick, reservedNakedNotifyMask, SetMP], RuntimeError USING [RegisterUncaughtSignalHandler], SystemVersion USING [Date, MachineType, ReleaseNumber], TerminalDefs USING [KeyName], TerminalFace USING [keyboard]; Wart: PROGRAM IMPORTS BootStartList, DebuggerSwap, GermSwap, MesaRuntimeInit, PrincOpsUtils, Process, ProcessorFace, RuntimeError, TerminalFace 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[]; ProcessorFace.InitializeCleanup[]; <> CheckVersions[h]; <> START MesaRuntimeInit.ProcessImpl[ pdaWords: PrincOpsUtils.WordsForPages[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]; LookForKeyboardKeys[]; <> MesaRuntimeInit.Start[h.controlList]; }; LookForKeyboardKeys: PROC = BEGIN keyNames: ARRAY GermSwap.Switch[a..z] OF TerminalDefs.KeyName = [ a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i: Space, j: J, k: K, l: L, m: M, n: N, o: O, p: P, q: Q, r: R, s: S, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z ]; FOR sw: GermSwap.Switch IN GermSwap.Switch[a..z] DO kn: TerminalDefs.KeyName ~ keyNames[sw]; IF kn=Space THEN LOOP; -- "Space" => ignore IF TerminalFace.keyboard[kn]=down THEN GermSwap.switches[sw] _ TRUE; ENDLOOP; END; CheckVersions: PROC [h: BootStartList.Base] = INLINE { DaysToSeconds: PROC [d: CARDINAL] RETURNS [SystemVersion.Date] = INLINE { RETURN [d.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 (uCodeDate _ DaysToSeconds[info.releaseDate]) < h.requiredUCode[machineType] 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.