-- XDInstall.Mesa Edited by: -- Smokey on Sep 16, 1980 2:52 PM -- Bruce on September 24, 1980 5:15 PM -- Mark on Apr 16, 1980 8:43 PM -- PK on May 19, 1980 7:16 PM -- Sandman on July 21, 1980 11:03 AM DIRECTORY AltoFileDefs USING [NullFP], Ascii USING [CR, NUL], BFSDefs USING [ActOnPages, GetNextDA, MakeCFP], Commands USING [GetToken, WriteCommand, WriteError], CoreSwapDefs USING [ BBArray, BBHandle, CFP, ExternalStateVector, PuntInfo, PuntTable, SVPointer, SwapReason, UserBreakBlock, VersionID], Cursor USING [Set], DebugOps USING [Abort], DebugUsefulDefs USING [], DHeap USING [Initialize], DiskDefs USING [DiskRequest, RealDA], DOutput USING [Char, EOL, Line, Text], DSyms USING [Initialize], FileSW USING [Create, SetFile], FrameDefs USING [MakeCodeResident, UnNew], FrameOps USING [CodeHandle, MyGlobalFrame], ImageDefs USING [AddFileRequest, FileRequest, StopMesa], Init USING [ Adjust, DumpCold, DumpHot, Files, PcHot, StartDebugger, Transition, UtilsHot, WriteHerald], InitXD USING [XDSwap, ourBitmapSeg], Internal USING [Catcher, GetDebuggerNub, Interrupt, PauseAtDebuggerNub, ProcessBreakpoint, ShowBreak, ShowInterrupt, ShowSignal, SVPointer, SwatBreak], LoadStateFormat USING [LoadState], LoadStateOps USING [state], MachineDefs USING [ BytesPerPage, CFP, eofDA, FA, FileHandle, fillinDA, GFHandle, NullGF, vDA], Menu USING [SetFont], MiscDefs USING [SetBlock], Nub USING [BadFile, BadVersion, InitSwitches, LoadNew, ProcessSwitches, Sob, Switches], NubOps USING [Place], NucleusOps USING [Wart], SDDefs USING [sBreakBlock, sBreakBlockSize, sCallDebugger, SD, sInterrupt, sProcessBreakpoint, sUncaughtSignal], SegmentDefs USING [ Append, CopyDataToFileSegment, CopyFileToDataSegment, DataSegmentAddress, DataSegmentHandle, DefaultBase, DefaultVersion, DefaultXMBase, DeleteDataSegment, DeleteFileSegment, EnumerateFileSegments, FileHandle, FileSegmentHandle, GetEndOfFile, GetFileSegmentDA, InsufficientVM, LockFile, LongDataSegmentAddress, memConfig, NewDataSegment, NewFile, NewFileSegment, PageNumber, Read, ReadWriteAppend, ReleaseFile, SetEndOfFile, SetFileAccess, SetFileSegmentDA, UnlockFile, Write], Source USING [SetupSourceWindow], State USING [GetSet, Go, GSHandle, OnYourMark], Storage USING [CopyString, FreeString, Node, PagesForWords], StreamDefs USING [CreateByteStream, DiskHandle, GetFA, JumpToFA, Read, StreamHandle], String USING [AppendChar, AppendString, EquivalentString], SwapperOps USING [MoveCode, systemTable], TajoMisc USING [InitRoot, SetBitmap, SetState], TajoOps USING [StartStimulusLevel], TextSW USING [SetEOF], ToolFont USING [Create], ToolWindow USING [Create, CreateSubwindow, Handle, SetName, Show, State], UserInput USING [ CreateIndirectStringInOut, FunctionKeysetPNR, GetDefaultWindow, SetCursorPNR, SetKeyPNR, TypeInCursorPNR, TypeInPNR], UserTerminal USING [SetBackground], UserTerminalOps USING [SetBitmapSpace, StartUserTerminal], Window USING [Handle, Place, rootWindow], WindowFont USING [Handle, SetDefault]; XDInstall: PROGRAM [PROGRAM] IMPORTS BFSDefs, Commands, Cursor, DebugOps, DiskDefs, DOutput, DSyms, FileSW, FrameDefs, FrameOps, DHeap, ImageDefs, Init, InitXD, Internal, LoadStateOps, Menu, MiscDefs, Nub, NucleusOps, SegmentDefs, Source, State, Storage, StreamDefs, String, SwapperOps, TextSW, ToolFont, TajoMisc, TajoOps, ToolWindow, UserInput, UserTerminal, UserTerminalOps, Window, WindowFont EXPORTS DebugOps, DebugUsefulDefs, Init, TajoMisc = BEGIN OPEN MachineDefs; window: PUBLIC Window.Handle; fileSW: PUBLIC Window.Handle; myPlace: PUBLIC NubOps.Place _ debugger; initialToolStateDefault: PUBLIC ToolWindow.State _ inactive; displayOn: BOOLEAN _ FALSE; puntData: CoreSwapDefs.PuntTable; fa: FA; switches: Nub.Switches; data: State.GSHandle; FileRequest: TYPE = ImageDefs.FileRequest; ComCmFR, DebuggerFR, CoreFR, SwatFR, DebugDebuggerFR: FileRequest; MesaFontFR, SysFontFR, RemCmFR: FileRequest; DebugLogFR, InternalLogFR: FileRequest; Done: SIGNAL = CODE; SetSwappableSD: PROCEDURE = BEGIN OPEN Internal, SDDefs; sd: POINTER TO ARRAY [0..0) OF UNSPECIFIED = SD; sd[sProcessBreakpoint] _ ProcessBreakpoint; sd[sUncaughtSignal] _ Catcher; sd[sInterrupt] _ Interrupt; sd[sCallDebugger] _ PauseAtDebuggerNub; END; SetNonSwappableSD: PROCEDURE = BEGIN OPEN Internal, SDDefs; sd: POINTER TO ARRAY [0..0) OF UNSPECIFIED = SD; sd[sProcessBreakpoint] _ ShowBreak; sd[sUncaughtSignal] _ ShowSignal; sd[sInterrupt] _ ShowInterrupt; sd[sCallDebugger] _ GetDebuggerNub; END; NumberBlocks: CARDINAL = 5; InitBreakBlocks: PUBLIC PROCEDURE = BEGIN OPEN CoreSwapDefs, SDDefs; sd: POINTER TO ARRAY [0..0) OF UNSPECIFIED _ SD; size: CARDINAL = SIZE[UserBreakBlock]*NumberBlocks+SIZE[BBArray]; p: BBHandle _ Storage.Node[size]; p.length _ 0; sd[sBreakBlock] _ p; sd[sBreakBlockSize] _ size; RETURN END; RequestFiles: PROCEDURE = BEGIN OPEN SegmentDefs, Storage; ComCmFR _ [file: NIL, link:, access: Read, name: CopyString["Com.Cm."L]]; DebuggerFR _ [file: NIL, link:, access: Read, name: CopyString["MesaDebugger."L]]; CoreFR _ [file: NIL, link:, access: Read, name: CopyString["MesaCore."L]]; SwatFR _ [file: NIL, link:, access: Read, name: CopyString["Swatee."L]]; DebugDebuggerFR _ [file: NIL, link:, access: Read, name: CopyString["MesaDebugDebugger."L]]; MesaFontFR _ [file: NIL, link:, access: Read, name: CopyString["MesaFont.strike."L]]; SysFontFR _ [file: NIL, link:, access: Read, name: CopyString["SysFont.strike."L]]; RemCmFR _ [file: NIL, link:, access: Read+Write+Append, name: CopyString["Rem.cm."L]]; DebugLogFR _ [file: NIL, link:, access: Read+Write+Append, name: CopyString["Debug.log."L]]; InternalLogFR _ [file: NIL, link:, access: Read+Write+Append, name: CopyString["InternalDebug.log."L]]; ImageDefs.AddFileRequest[@DebuggerFR]; ImageDefs.AddFileRequest[@CoreFR]; ImageDefs.AddFileRequest[@SwatFR]; ImageDefs.AddFileRequest[@DebugDebuggerFR]; ImageDefs.AddFileRequest[@ComCmFR]; ImageDefs.AddFileRequest[@MesaFontFR]; ImageDefs.AddFileRequest[@SysFontFR]; ImageDefs.AddFileRequest[@RemCmFR]; ImageDefs.AddFileRequest[@DebugLogFR]; ImageDefs.AddFileRequest[@InternalLogFR]; END; FreeStrings: PROC = BEGIN Storage.FreeString[ComCmFR.name]; Storage.FreeString[DebugDebuggerFR.name]; Storage.FreeString[SwatFR.name]; Storage.FreeString[CoreFR.name]; Storage.FreeString[DebuggerFR.name]; Storage.FreeString[MesaFontFR.name]; Storage.FreeString[SysFontFR.name]; Storage.FreeString[RemCmFR.name]; Storage.FreeString[DebugLogFR.name]; Storage.FreeString[InternalLogFR.name]; END; DebugDebuggerInstall: PROCEDURE = BEGIN debuggee: SegmentDefs.FileHandle; myPlace _ internaldebugger; [data.selfFH, data.selfFP.leaderDA] _ FixFile[@DebugDebuggerFR, @data.selfFP]; [debuggee, data.debuggeeFP.leaderDA] _ FixFile[@DebuggerFR, @data.debuggeeFP]; data.debuggerFP _ data.selfFP; data.debuggeeFH _ debuggee; MoveLoadState[@DebugDebuggerFR]; Init.Files[]; SetupPuntESV[FALSE, NIL]; SetNonSwappableSD[]; ResetDebugScriptFile[]; END; DebuggerInstall: PROCEDURE = BEGIN swappable: BOOLEAN _ FALSE; debuggee: SegmentDefs.FileHandle; IF InternalLogFR.file # NIL THEN SegmentDefs.ReleaseFile[InternalLogFR.file]; [data.selfFH, data.selfFP.leaderDA] _ FixFile[@DebuggerFR, @data.selfFP]; IF CoreFR.file # NIL THEN BEGIN [debuggee, data.debuggeeFP.leaderDA] _ FixFile[@CoreFR, @data.debuggeeFP]; SegmentDefs.ReleaseFile[SwatFR.file]; END ELSE [debuggee, data.debuggeeFP.leaderDA] _ FixFile[@SwatFR, @data.debuggeeFP]; IF DebugDebuggerFR.file # NIL THEN BEGIN swappable _ TRUE; [, data.debuggerFP.leaderDA] _ FixFile[@DebugDebuggerFR, @data.debuggerFP]; END; data.debuggeeFH _ debuggee; Init.Files[]; SetupPuntESV[swappable, IF swappable THEN data.selfFH ELSE NIL]; IF swappable THEN SetSwappableSD[] ELSE SetNonSwappableSD[]; END; FixFile: PROCEDURE [fr: POINTER TO FileRequest, p: POINTER TO CFP] RETURNS [f: FileHandle, da: vDA] = BEGIN OPEN SegmentDefs; s: FileSegmentHandle; pages: PageNumber; bytes: CARDINAL; IF (f _ fr.file) = NIL THEN f _ NewFile[fr.name, Read+Write+Append, DefaultVersion] ELSE SetFileAccess[f, Read+Write+Append]; LockFile[f]; [pages, bytes] _ GetEndOfFile[f]; IF pages < 255 OR (pages = 255 AND bytes < BytesPerPage) THEN SetEndOfFile[f, 255, BytesPerPage]; s _ SegmentDefs.NewFileSegment[f,1,1,SegmentDefs.Read]; BFSDefs.MakeCFP[p,@f.fp]; da _ LOOPHOLE[DiskDefs.RealDA[SegmentDefs.GetFileSegmentDA[s]]]; SegmentDefs.DeleteFileSegment[s]; UnlockFile[f]; RETURN[f, da]; END; SetupPuntESV: PROCEDURE [swappable: BOOLEAN, file: FileHandle] = BEGIN seg: SegmentDefs.FileSegmentHandle _ LoadStateOps.state; puntData.puntESV.reason _ punt; puntData.puntESV.versionident _ CoreSwapDefs.VersionID; puntData.puntESV.tables _ @SwapperOps.systemTable; puntData.puntESV.drumFile _ file; puntData.puntESV.loadstateCFA.fp _ seg.file.fp; puntData.puntESV.loadstateCFA.fa _ [ page: seg.base, byte: 0, da: SegmentDefs.GetFileSegmentDA[seg]]; puntData.puntESV.lspages _ seg.pages; puntData.puntESV.bitmap _ NIL; puntData.puntESV.bitmapPages _ 0; IF swappable THEN BEGIN puntData.pDebuggerFP _ @data.debuggerFP; puntData.debuggerFP _ data.debuggerFP; puntData.pCoreFP _ @data.selfFP; puntData.coreFP _ data.selfFP; END ELSE puntData.pDebuggerFP _ puntData.pCoreFP _ LOOPHOLE[0]; CoreSwapDefs.PuntInfo^ _ @puntData; puntData.puntESV.fill _ ALL[0]; END; MoveLoadState: PROCEDURE [fr: POINTER TO ImageDefs.FileRequest] = BEGIN OPEN SegmentDefs; f: FileHandle; new, old: FileSegmentHandle; temp: DataSegmentHandle; loadstate: LoadStateFormat.LoadState; old _ LoadStateOps.state; IF (f _ fr.file) = NIL THEN f _ fr.file _ NewFile[fr.name, Read+Write+Append, DefaultVersion] ELSE SetFileAccess[f, Read+Write+Append]; SetEndOfFile[f, 255+old.pages, BytesPerPage]; temp _ NewDataSegment[DefaultBase, old.pages]; new _ NewFileSegment[f, 256, old.pages, Read+Write]; CopyFileToDataSegment[old, temp]; loadstate _ DataSegmentAddress[temp]; FOR i: CARDINAL IN [0..loadstate.nBcds) DO WITH b: loadstate.bcds[i] SELECT FROM alto => IF b.fp = AltoFileDefs.NullFP THEN b.fp _ old.file.fp; ENDCASE; ENDLOOP; CopyDataToFileSegment[temp, new]; DeleteDataSegment[temp]; DeleteFileSegment[old]; LoadStateOps.state _ new; END; CollectDiskAddresses: PROCEDURE = BEGIN OPEN SegmentDefs; ImageFile: FileHandle = FrameOps.CodeHandle[FrameOps.MyGlobalFrame[]].file; DAs: DESCRIPTOR FOR ARRAY OF vDA; maxunknown, maxknown: CARDINAL _ FIRST[CARDINAL]; minunknown: CARDINAL _ LAST[CARDINAL]; maxknownDA: vDA; DisplayHead: POINTER TO WORD = LOOPHOLE[420B]; DisplayInterruptWord: POINTER TO WORD = LOOPHOLE[421B]; saveDisplay, saveDiw: WORD; diskrequest: DiskDefs.DiskRequest; bufseg, DAseg: DataSegmentHandle; FindEnds: PROCEDURE [seg: FileSegmentHandle] RETURNS [BOOLEAN] = BEGIN WITH s: seg SELECT FROM disk => IF s.file = ImageFile AND s.hint.da = eofDA THEN BEGIN maxunknown _ MAX[maxunknown,s.base]; minunknown _ MIN[minunknown,s.base]; END; ENDCASE; RETURN[FALSE]; END; FindKnown: PROCEDURE [seg: FileSegmentHandle] RETURNS [BOOLEAN] = BEGIN WITH s: seg SELECT FROM disk => IF s.file = ImageFile AND s.hint.da # eofDA AND s.base < minunknown AND s.base > maxknown THEN BEGIN maxknown _ s.base; maxknownDA _ s.hint.da END; ENDCASE; RETURN[FALSE]; END; PlugDA: PROCEDURE [seg: FileSegmentHandle] RETURNS [BOOLEAN] = BEGIN WITH s: seg SELECT FROM disk => IF s.file = ImageFile AND s.hint.da = eofDA AND s.base IN (maxknown..maxunknown] THEN SegmentDefs.SetFileSegmentDA[@s,DAs[s.base]]; ENDCASE; RETURN[FALSE]; END; saveDisplay _ DisplayHead^; saveDiw _ DisplayInterruptWord^; DisplayHead^ _ DisplayInterruptWord^ _ 0; [] _ EnumerateFileSegments[FindEnds]; [] _ EnumerateFileSegments[FindKnown]; bufseg _ NewDataSegment[DefaultBase, 1]; DAseg _ NewDataSegment[ DefaultBase, Storage.PagesForWords[maxunknown-maxknown+3]]; DAs _ DESCRIPTOR[DataSegmentAddress[DAseg]-(maxknown-1),maxunknown+2]; diskrequest _ DiskDefs.DiskRequest [ ca: DataSegmentAddress[bufseg], fixedCA: TRUE, da: @DAs[0], fp: @ImageFile.fp, firstPage: maxknown, lastPage: maxunknown, action: ReadD, lastAction: ReadD, signalCheckError: FALSE, option: update[cleanup: BFSDefs.GetNextDA]]; MiscDefs.SetBlock[@DAs[maxknown-1],fillinDA,maxunknown-maxknown+3]; DAs[maxknown] _ maxknownDA; [] _ BFSDefs.ActOnPages[LOOPHOLE[@diskrequest]]; -- we know it is an Update diskrequest [] _ EnumerateFileSegments[PlugDA]; DeleteDataSegment[DAseg]; DeleteDataSegment[bufseg]; DisplayHead^ _ saveDisplay; DisplayInterruptWord^ _ saveDiw; RETURN; END; LoadDebugger: PROCEDURE = BEGIN OPEN switches; SkipImage[]; UNTIL install OR internalInstall DO DoCommand[ ! Done => BEGIN install _ TRUE; CONTINUE END; ABORTED => CONTINUE; DebugOps.Abort => CONTINUE; Nub.BadFile => BEGIN OPEN DOutput; EOL[]; Commands.WriteError[file]; Text[badname]; Text[": "L]; Text[reason]; CONTINUE END; Nub.BadVersion --[badname: STRING] --=> BEGIN DOutput.EOL[]; Commands.WriteError[file]; DOutput.Text[badname]; Commands.WriteError[diffver]; RESUME END]; ENDLOOP; RETURN END; DoCommand: PROCEDURE = BEGIN f: GFHandle; p: PROCESS; f _ LoadSystem[]; IF f # NullGF THEN BEGIN p _ FORK StartModule[LOOPHOLE[f]]; JOIN p; END; END; StartModule: PROCEDURE [f: PROGRAM] = BEGIN ENABLE ABORTED, DebugOps.Abort => CONTINUE; IF ~LOOPHOLE[f, GFHandle].started THEN START f ELSE RESTART f; RETURN END; CleanUpCommandLine: PROCEDURE = BEGIN SegmentDefs.UnlockFile[ComCmFR.file]; SegmentDefs.ReleaseFile[ComCmFR.file]; RETURN END; LoadSystem: PROCEDURE RETURNS [user: GFHandle] = BEGIN switches _ Nub.InitSwitches[]; user _ LoadUser[@fa ! UNWIND => CleanUpCommandLine[]]; IF ~switches.start THEN user _ NullGF; RETURN END; LoadUser: PROCEDURE [fa: POINTER TO FA] RETURNS [user: GFHandle] = BEGIN OPEN StreamDefs; com: StreamHandle; name: STRING _ [40]; ext: STRING _ [10]; sw: STRING _ [10]; get: PROCEDURE RETURNS [c: CHARACTER] = BEGIN IF com.endof[com] THEN RETURN[Ascii.NUL]; RETURN[com.get[com]]; END; IF ComCmFR.file = NIL THEN SIGNAL Done; com _ CreateByteStream[ComCmFR.file, Read]; user _ NullGF; BEGIN OPEN switches; StreamDefs.JumpToFA[com, fa ! ANY => GO TO finished]; Commands.GetToken[get, name, ext, sw]; IF name.length = 0 AND sw.length = 0 THEN GO TO finished; StreamDefs.GetFA[com, fa]; com.destroy[com]; DoSwitches[sw]; IF name.length # 0 AND ~command THEN BEGIN IF ext.length = 0 THEN ext _ "bcd"L; DOutput.EOL[]; DOutput.Char['/]; DOutput.Text[name]; IF sw.length # 0 THEN BEGIN DOutput.Char['/]; DOutput.Text[sw] END; String.AppendChar[name, '.]; String.AppendString[name, ext]; IF ~displayOn THEN {displayOn _ TRUE; [] _ TajoMisc.SetState[on]}; user _ Nub.LoadNew[name, framelinks]; END; IF command THEN DoSwitches[name]; EXITS finished => BEGIN com.destroy[com]; SIGNAL Done; END; END; RETURN END; SkipImage: PROCEDURE = BEGIN OPEN StreamDefs; com: StreamHandle; name: STRING _ [40]; ext: STRING _ [10]; sw: STRING _ [10]; get: PROCEDURE RETURNS [c: CHARACTER] = BEGIN IF com.endof[com] THEN RETURN[Ascii.NUL]; RETURN[com.get[com]]; END; IF ComCmFR.file = NIL THEN RETURN; SegmentDefs.LockFile[ComCmFR.file]; switches _ Nub.InitSwitches[]; com _ CreateByteStream[ComCmFR.file, Read]; StreamDefs.GetFA[com, @fa]; Commands.GetToken[get, name, ext, sw]; IF String.EquivalentString[ext, "image"L] THEN StreamDefs.GetFA[com, @fa]; com.destroy[com]; DoSwitches[sw]; END; DoSwitches: PROC [s: STRING] = BEGIN old: Nub.Sob _ switches^; Nub.ProcessSwitches[s]; IF old # switches^ AND ~displayOn THEN BEGIN displayOn _ TRUE; [] _ TajoMisc.SetState[on] END; IF old.trees # switches.trees THEN BEGIN Commands.WriteCommand[treePrinting]; IF switches.trees THEN Commands.WriteCommand[on] ELSE Commands.WriteCommand[off]; DOutput.Char[Ascii.CR]; data.tree _ switches.trees; END; IF old.search # switches.search THEN BEGIN IF switches.search THEN Commands.WriteCommand[oneFrame] ELSE Commands.WriteCommand[callStack]; DOutput.Char[Ascii.CR]; data.search _ switches.search; END; IF old.display # switches.display THEN BEGIN DOutput.Line["Invert display."L]; [] _ UserTerminal.SetBackground[ IF switches.display THEN black ELSE white]; END; END; ResetDebugScriptFile: PROCEDURE = BEGIN name: STRING = "InternalDebug.log"L; sh: StreamDefs.StreamHandle _ NIL; IF InternalLogFR.file # NIL THEN sh _ StreamDefs.CreateByteStream[ InternalLogFR.file,SegmentDefs.ReadWriteAppend]; ToolWindow.SetName[window, name]; FileSW.SetFile[fileSW, name, sh]; TextSW.SetEOF[fileSW, 0]; ToolWindow.Show[window]; END; InitDebugWindow: PROC = BEGIN name: STRING = "Debug.log"L; default: Window.Handle = UserInput.GetDefaultWindow[]; sh: StreamDefs.StreamHandle _ NIL; window _ ToolWindow.Create[ name, Init.Adjust, Init.Transition, [[0,32], [Window.rootWindow.box.dims.w,320]]]; fileSW _ ToolWindow.CreateSubwindow[ window, LOOPHOLE[0], [[0,0], [400,400]], many]; IF DebugLogFR.file # NIL THEN sh _ StreamDefs.CreateByteStream[ DebugLogFR.file,SegmentDefs.ReadWriteAppend]; FileSW.Create[fileSW, name, [append,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE],sh]; TextSW.SetEOF[fileSW, 0]; UserInput.CreateIndirectStringInOut[from: default, to: fileSW]; UserInput.SetKeyPNR[default, keyboard, UserInput.TypeInPNR]; UserInput.SetKeyPNR[default, keyset, UserInput.FunctionKeysetPNR]; UserInput.SetCursorPNR[default, UserInput.TypeInCursorPNR]; ToolWindow.Show[window]; END; FontFile: PROC RETURNS [file: SegmentDefs.FileHandle] = BEGIN OPEN SegmentDefs; NoFont: STRING = "// Can't install without strike font."L; sh: StreamDefs.DiskHandle; file _ IF MesaFontFR.file # NIL THEN MesaFontFR.file ELSE SysFontFR.file; IF file # NIL THEN {ReleaseFile[RemCmFR.file]; RETURN}; sh _ StreamDefs.CreateByteStream[RemCmFR.file,Read+Write+Append]; FOR i: CARDINAL IN [0..NoFont.length) DO sh.put[sh,NoFont[i]] ENDLOOP; sh.destroy[sh]; ImageDefs.StopMesa[]; END; addr: LONG POINTER _ NIL; seg: POINTER; xm: BOOLEAN; StartTools: PROC = BEGIN font: WindowFont.Handle; TajoMisc.InitRoot[]; UserTerminalOps.StartUserTerminal[]; TajoOps.StartStimulusLevel[]; InitXD.ourBitmapSeg _ NIL; IF xm THEN BEGIN OPEN SegmentDefs; InitXD.ourBitmapSeg _ NewDataSegment[DefaultXMBase,99 ! InsufficientVM => CONTINUE]; seg _ InitXD.ourBitmapSeg; END; IF InitXD.ourBitmapSeg # NIL THEN BEGIN addr _ SegmentDefs.LongDataSegmentAddress[InitXD.ourBitmapSeg]; UserTerminalOps.SetBitmapSpace[address: addr, words: 99*256]; TajoMisc.SetBitmap[[[32, 32], [544, 744]]]; END ELSE TajoMisc.SetBitmap[[[48,72], [512,352]]]; [] _ UserTerminal.SetBackground[white]; [] _ TajoMisc.SetState[off]; Cursor.Set[hourGlass]; font _ ToolFont.Create[FontFile[]]; WindowFont.SetDefault[font]; Menu.SetFont[font]; Source.SetupSourceWindow[]; InitDebugWindow[]; END; -- Main body SetNonSwappableSD[]; SDDefs.SD[SDDefs.sProcessBreakpoint] _ Internal.SwatBreak; InitBreakBlocks[]; RequestFiles[]; STOP; IF (xm _ SegmentDefs.memConfig.useXM) THEN { FrameDefs.MakeCodeResident[LOOPHOLE[InitXD.XDSwap]]; SwapperOps.MoveCode[intoMDS]}; DHeap.Initialize[]; State.OnYourMark[]; data _ State.GetSet[]; switches _ Nub.InitSwitches[]; CollectDiskAddresses[]; FrameDefs.UnNew[LOOPHOLE[NucleusOps.Wart, GFHandle]]; SDDefs.SD[SDDefs.sProcessBreakpoint] _ Internal.ShowBreak; StartTools[]; State.Go[]; Init.WriteHerald[TRUE]; DSyms.Initialize[]; START Init.PcHot; START Init.UtilsHot; START Init.DumpCold; START Init.DumpHot; LoadDebugger[ ! DebugOps.Abort => CONTINUE]; IF switches.internalInstall THEN DebugDebuggerInstall[] ELSE DebuggerInstall[]; FreeStrings[]; initialToolStateDefault _ active; IF ~displayOn THEN {displayOn _ TRUE; [] _ TajoMisc.SetState[on]}; Cursor.Set[textPointer]; Init.StartDebugger[]; ImageDefs.StopMesa[]; END.