MODULE StdIOShell; (** AUTHOR ""; PURPOSE ""; *) IMPORT StdIO, Commands, Modules, Streams, Pipes, Strings; PROCEDURE Activate(context: Commands.Context; CONST cmd: ARRAY OF CHAR): BOOLEAN; VAR msg: ARRAY 256 OF CHAR; res: LONGINT; BEGIN Commands.Activate(cmd, context, {Commands.Wait}, res, msg); IF res # 0 THEN context.error.String(msg); context.error.Ln; RETURN FALSE END; RETURN TRUE; END Activate; PROCEDURE Execute(context: Commands.Context); VAR str: ARRAY 256 OF CHAR; b: BOOLEAN; BEGIN IF ~context.arg.GetString(str) THEN context.out.String("Critical error: no arg"); RETURN END; IF ~context.arg.GetString(str) THEN str := "Shell.Start"; ELSIF str = "compile" THEN str := "Compiler.Compile" ELSIF str="link" THEN str := "StaticLinker.Link" ELSIF (str="i") OR (str = "interpreter") THEN str := "InterpreterShell.Start" ELSIF (str = "execute") OR (str="e") THEN str := "SystemTools.DoFile"; ELSIF (str = "run") OR (str="r") THEN IF ~Activate(context, "SystemTools.DoFile") THEN RETURN END; str := "Shell.Start"; END; b := Activate(context, str); END Execute; (* do not add commands here -- the module loader does not finish here and they will not become available *) VAR env: Commands.Context; str: Strings.String; decoupler: Pipes.ReadDecoupler; inDecoupled: Streams.Receiver; inStreamDecoupled: Streams.Reader; BEGIN Execute(StdIO.env); TRACE('shell died'); Modules.Shutdown(Modules.PowerDown); LOOP END; END StdIOShell. SystemTools.Free StaticLinker ~ SystemTools.DoCommands StaticLinker.Link -p=Linux32G Runtime Traps UnixFiles RelativeFileSystem GenericLoader WMDefaultFont StdIOShell Compiler StaticLinker FoxOberonFrontend FoxAMDBackend FoxARMBackend FoxGenericObjectFile InterpreterShell SystemTools FSTools PCAAMD64 BootManager VirtualDisks DiskFS Partitions ~ FSTools.CloseFiles oberon ~ ~ SystemTools.DoCommands StaticLinker.Link --fileFormat=PE32CUI --fileName=oberon.exe --extension=GofW --displacement=401000H Runtime Trace Kernel32 Machine Heaps Modules Objects Kernel KernelLog Streams Commands Files WinFS Clock Dates Reals Strings Diagnostics BitSets StringPool ObjectFile GenericLinker Reflection GenericLoader WinTrace StdIO Runtime Traps RelativeFileSystem GenericLoader WMDefaultFont StdIOShell Compiler StaticLinker FoxOberonFrontend FoxAMDBackend FoxARMBackend FoxGenericObjectFile InterpreterShell SystemTools FSTools PCAAMD64 BootManager VirtualDisks DiskFS Partitions ~ FSTools.CloseFiles oberon.exe ~ ~ (** LINUX **) SystemTools.DoCommands Compiler.Compile -p=Linux32G --mergeSections Runtime.Mod Trace.Mod Generic.Linux.I386.Glue.Mod Generic.Linux.I386.Unix.Mod Generic.Unix.I386.Machine.Mod Heaps.Mod Generic.Modules.Mod Generic.Unix.Objects.Mod Unix.Kernel.Mod KernelLog.Mod Plugins.Mod Streams.Mod Pipes.Mod Commands.Mod I386.Reals.Mod Generic.Reflection.Mod TrapWriters.Mod CRC.Mod SystemVersion.Mod Unix.StdIO.Mod Generic.Unix.Traps.Mod Locks.Mod Unix.Clock.Mod Disks.Mod Files.Mod Dates.Mod Strings.Mod UTF8Strings.Mod FileTrapWriter.Mod Caches.Mod DiskVolumes.Mod OldDiskVolumes.Mod RAMVolumes.Mod DiskFS.Mod OldDiskFS.Mod OberonFS.Mod FATVolumes.Mod FATFiles.Mod ISO9660Volumes.Mod ISO9660Files.Mod Unix.UnixFiles.Mod RelativeFileSystem.Mod BitSets.Mod StringPool.Mod Diagnostics.Mod ObjectFile.Mod GenericLinker.Mod GenericLoader.Mod Unix.BootConsole.Mod Pipes.Mod Shell.Mod StdIOShell.Mod Options.Mod Debugging.Mod StaticLinker.Mod FoxBasic.Mod FoxProgTools.Mod FoxScanner.Mod FoxCSharpScanner.Mod FoxSyntaxTree.Mod FoxGlobal.Mod FoxActiveCells.Mod FoxHardware.Mod FoxFormats.Mod FoxPrintout.Mod FoxParser.Mod FoxCSharpParser.Mod FoxSemanticChecker.Mod FoxBackend.Mod FoxSections.Mod FoxFrontend.Mod FoxCompiler.Mod FoxOberonFrontend.Mod FoxCSharpFrontend.Mod FoxFingerPrinter.Mod FoxInterfaceComparison.Mod FoxTextualSymbolFile.Mod FoxBinarySymbolFile.Mod FoxBinaryCode.Mod FoxIntermediateCode.Mod FoxIntermediateBackend.Mod FoxCodeGenerators.Mod FoxBinaryObjectFile.Mod FoxGenericObjectFile.Mod FoxAMD64InstructionSet.Mod FoxAMD64Assembler.Mod FoxAMDBackend.Mod FoxAssembler.Mod FoxIntermediateAssembler.Mod FoxDisassembler.Mod FoxARMInstructionSet.Mod FoxARMAssembler.Mod FoxARMBackend.Mod FoxMinosObjectFile.Mod FoxIntermediateParser.Mod FoxIntermediateObjectFile.Mod FoxIntermediateLinker.Mod FoxTRMInstructionSet.Mod FoxTRMAssembler.Mod FoxTRMBackend.Mod FoxInterpreterBackend.Mod FoxTranspilerBackend.Mod FoxDocumentationScanner.Mod FoxDocumentationTree.Mod FoxDocumentationPrinter.Mod FoxDocumentationHtml.Mod FoxDocumentationParser.Mod FoxDocumentationBackend.Mod DynamicStrings.Mod XMLObjects.Mod XML.Mod XMLScanner.Mod UTF8Strings.Mod XMLParser.Mod PersistentObjects.Mod FoxInterpreterSymbols.Mod FoxInterpreter.Mod InterpreterShell.Mod FoxProfiler.Mod ProcessInfo0.Mod ProcessInfo.Mod Plugins.Mod SystemTools.Mod ~ StaticLinker.Link -p=Linux32G Runtime Trace Glue Unix Machine Heaps Modules Objects Kernel KernelLog Streams Commands StdIO TrapWriters Traps Files UnixFiles Clock Dates Reals Strings Diagnostics BitSets StringPool ObjectFile GenericLinker Reflection GenericLoader Pipes Shell StdIOShell Options Locks Debugging StaticLinker FoxBasic FoxProgTools FoxScanner FoxSyntaxTree FoxGlobal FoxActiveCells FoxHardware FoxFormats FoxFingerPrinter FoxPrintout FoxParser FoxSemanticChecker FoxBackend FoxSections FoxFrontend Compiler FoxOberonFrontend FoxInterfaceComparison FoxTextualSymbolFile FoxBinarySymbolFile FoxBinaryCode FoxIntermediateCode FoxIntermediateBackend FoxCodeGenerators FoxBinaryObjectFile FoxGenericObjectFile FoxAMD64InstructionSet FoxAMD64Assembler FoxAMDBackend FoxAssembler FoxIntermediateAssembler FoxDisassembler FoxARMInstructionSet FoxARMAssembler FoxARMBackend FoxMinosObjectFile FoxIntermediateParser FoxIntermediateObjectFile FoxIntermediateLinker FoxTRMInstructionSet FoxTRMAssembler FoxTRMBackend FoxInterpreterBackend FoxTranspilerBackend FoxDocumentationScanner FoxDocumentationTree FoxDocumentationPrinter FoxDocumentationHtml FoxDocumentationParser FoxDocumentationBackend DynamicStrings XMLObjects XML XMLScanner UTF8Strings XMLParser PersistentObjects FoxInterpreterSymbols FoxInterpreter InterpreterShell CRC SystemVersion ProcessInfo0 ProcessInfo Plugins SystemTools ~ FSTools.CloseFiles oberon ~ ~ (** WINDOWS **) SystemTools.DoCommands Compiler.Compile -p=Win32G Runtime.Mod Trace.Mod Generic.Win32.Kernel32.Mod Win32.Machine.Mod Heaps.Mod Generic.Modules.Mod Win32.Objects.Mod Win32.Kernel.Mod KernelLog.Mod Streams.Mod Commands.Mod I386.Reals.Mod Generic.Reflection.Mod Locks.Mod Win32.Clock.Mod Files.Mod Dates.Mod Strings.Mod Diagnostics.Mod StringPool.Mod BitSets.Mod ObjectFile.Mod GenericLinker.Mod GenericLoader.Mod Options.Mod Debugging.Mod TrapWriters.Mod CRC.Mod SystemVersion.Mod Win32.Traps.Mod Win32.WinTrace.Mod Win32.WinFS.Mod Win32.StdIO.Mod Pipes.Mod Shell.Mod StdIOShell.Mod StaticLinker.Mod FoxBasic.Mod FoxProgTools.Mod FoxScanner.Mod FoxCSharpScanner.Mod FoxSyntaxTree.Mod FoxGlobal.Mod FoxActiveCells.Mod FoxHardware.Mod FoxFormats.Mod FoxPrintout.Mod FoxParser.Mod FoxCSharpParser.Mod FoxSemanticChecker.Mod FoxBackend.Mod FoxSections.Mod FoxFrontend.Mod FoxCompiler.Mod FoxOberonFrontend.Mod FoxCSharpFrontend.Mod FoxFingerPrinter.Mod FoxInterfaceComparison.Mod FoxTextualSymbolFile.Mod FoxBinarySymbolFile.Mod FoxBinaryCode.Mod FoxIntermediateCode.Mod FoxIntermediateBackend.Mod FoxCodeGenerators.Mod FoxBinaryObjectFile.Mod FoxGenericObjectFile.Mod FoxAMD64InstructionSet.Mod FoxAMD64Assembler.Mod FoxAMDBackend.Mod FoxAssembler.Mod FoxIntermediateAssembler.Mod FoxDisassembler.Mod FoxARMInstructionSet.Mod FoxARMAssembler.Mod FoxARMBackend.Mod FoxMinosObjectFile.Mod FoxIntermediateParser.Mod FoxIntermediateObjectFile.Mod FoxIntermediateLinker.Mod FoxTRMInstructionSet.Mod FoxTRMAssembler.Mod FoxTRMBackend.Mod FoxInterpreterBackend.Mod FoxTranspilerBackend.Mod FoxDocumentationScanner.Mod FoxDocumentationTree.Mod FoxDocumentationPrinter.Mod FoxDocumentationHtml.Mod FoxDocumentationParser.Mod FoxDocumentationBackend.Mod DynamicStrings.Mod XMLObjects.Mod XML.Mod XMLScanner.Mod UTF8Strings.Mod XMLParser.Mod PersistentObjects.Mod FoxInterpreterSymbols.Mod FoxInterpreter.Mod InterpreterShell.Mod FoxProfiler.Mod ProcessInfo0.Mod ProcessInfo.Mod Plugins.Mod SystemTools.Mod ~ (* first lines can be replaced by Kernel.lib *) StaticLinker.Link --fileFormat=PE32CUI --fileName=oberon.exe --extension=GofW --displacement=401000H Runtime Trace Kernel32 Machine Heaps Modules Objects Kernel KernelLog Streams Commands Files WinFS Clock Dates Reals Strings Diagnostics BitSets StringPool ObjectFile GenericLinker Reflection GenericLoader WinTrace StdIO TrapWriters CRC SystemVersion Traps Pipes Shell StdIOShell Options Locks Debugging StaticLinker FoxBasic FoxProgTools FoxScanner FoxSyntaxTree FoxGlobal FoxActiveCells FoxHardware FoxFormats FoxPrintout FoxParser FoxSemanticChecker FoxBackend FoxSections FoxFrontend Compiler FoxOberonFrontend FoxFingerPrinter FoxInterfaceComparison FoxTextualSymbolFile FoxBinarySymbolFile FoxBinaryCode FoxIntermediateCode FoxIntermediateBackend FoxCodeGenerators FoxBinaryObjectFile FoxGenericObjectFile FoxAMD64InstructionSet FoxAMD64Assembler FoxAMDBackend FoxAssembler FoxIntermediateAssembler FoxDisassembler FoxARMInstructionSet FoxARMAssembler FoxARMBackend FoxMinosObjectFile FoxIntermediateParser FoxIntermediateObjectFile FoxIntermediateLinker FoxTRMInstructionSet FoxTRMAssembler FoxTRMBackend FoxInterpreterBackend FoxTranspilerBackend FoxDocumentationScanner FoxDocumentationTree FoxDocumentationPrinter FoxDocumentationHtml FoxDocumentationParser FoxDocumentationBackend XML XMLScanner DynamicStrings UTF8Strings XMLParser XMLObjects PersistentObjects FoxInterpreterSymbols FoxInterpreter InterpreterShell ProcessInfo0 ProcessInfo Plugins SystemTools ~ FSTools.CloseFiles oberon.exe ~ ~ FoxGenericObjectFile.MakeLibrary Kernel.Lib Runtime.GofW Trace.GofW Kernel32.GofW Machine.GofW Heaps.GofW Modules.GofW Objects.GofW Kernel.GofW KernelLog.GofW Streams.GofW Commands.GofW Files.GofW WinFS.GofW Clock.GofW Dates.GofW Reals.GofW Strings.GofW Diagnostics.GofW BitSets.GofW StringPool.GofW ObjectFile.GofW GenericLinker.GofW Reflection.GofW GenericLoader.GofW WinTrace.GofW WinApplication.GofW ~ ~ FoxGenericObjectFile.MakeLibrary Fox.Lib FoxBasic.GofW FoxProgTools.GofW FoxScanner.GofW FoxCSharpScanner.GofW FoxSyntaxTree.GofW FoxGlobal.GofW FoxActiveCells.GofW FoxHardware.GofW FoxFormats.GofW FoxPrintout.GofW FoxParser.GofW FoxCSharpParser.GofW FoxSemanticChecker.GofW FoxBackend.GofW FoxSections.GofW FoxFrontend.GofW Compiler.GofW FoxOberonFrontend.GofW FoxCSharpFrontend.GofW FoxFingerPrinter.GofW FoxInterfaceComparison.GofW FoxTextualSymbolFile.GofW FoxBinarySymbolFile.GofW FoxBinaryCode.GofW FoxIntermediateCode.GofW FoxIntermediateBackend.GofW FoxCodeGenerators.GofW FoxBinaryObjectFile.GofW FoxGenericObjectFile.GofW FoxAMD64InstructionSet.GofW FoxAMD64Assembler.GofW FoxAMDBackend.GofW FoxAssembler.GofW FoxIntermediateAssembler.GofW FoxDisassembler.GofW FoxARMInstructionSet.GofW FoxARMAssembler.GofW FoxARMBackend.GofW FoxMinosObjectFile.GofW FoxIntermediateParser.GofW FoxIntermediateObjectFile.GofW FoxIntermediateLinker.GofW FoxTRMInstructionSet.GofW FoxTRMAssembler.GofW FoxTRMBackend.GofW FoxInterpreterBackend.GofW FoxTranspilerBackend.GofW FoxDocumentationScanner.GofW FoxDocumentationTree.GofW FoxDocumentationPrinter.GofW FoxDocumentationHtml.GofW FoxDocumentationParser.GofW FoxDocumentationBackend.GofW XML.GofW XMLScanner.GofW DynamicStrings.GofW UTF8Strings.GofW XMLParser.GofW XMLObjects.GofW PersistentObjects.GofW FoxInterpreterSymbols.GofW FoxInterpreter.GofW ~ StaticLinker.Link --fileFormat=PE32CUI --fileName=oberon.exe --extension=GofW --displacement=401000H Runtime Trace Kernel32 Machine Heaps Modules Objects Kernel KernelLog Streams Commands Files WinFS Clock Dates Reals Strings Diagnostics BitSets StringPool ObjectFile GenericLinker Reflection GenericLoader TrapWriters CRC SystemVersion Traps WinTrace StdIO Pipes Shell StdIOShell Options Locks Debugging StaticLinker Fox.Lib InterpreterShell ProcessInfo0 ProcessInfo Plugins SystemTools ~ StaticLinker.Link -p=Linux32G Runtime Trace Glue Unix Machine Heaps Modules Objects Kernel KernelLog Streams Commands Files UnixFiles Clock Dates Reals Strings Diagnostics BitSets StringPool ObjectFile GenericLinker Reflection GenericLoader StdIO TrapWriters Traps Pipes Shell StdIOShell Options Locks Debugging StaticLinker Fox.Lib InterpreterShell CRC SystemVersion ProcessInfo0 ProcessInfo Plugins SystemTools ~ FSTools.CloseFiles oberon ~ ~