StdIOShell.Mod 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. MODULE StdIOShell; (** AUTHOR ""; PURPOSE ""; *)
  2. IMPORT StdIO, Commands, Streams, Modules, Objects, Shell;
  3. PROCEDURE Execute(context: Commands.Context);
  4. VAR str, msg: ARRAY 256 OF CHAR; res: LONGINT; shell: Shell.Shell;
  5. BEGIN
  6. IF ~context.arg.GetString(str) THEN
  7. context.out.String("Critical error: no arg");
  8. RETURN END;
  9. IF ~context.arg.GetString(str) THEN
  10. NEW(shell, context.in, context.out, context.error, FALSE, ">");
  11. shell.AwaitDeath;
  12. RETURN
  13. END;
  14. IF str = "compile" THEN str := "Compiler.Compile"
  15. ELSIF str="link" THEN str := "StaticLinker.Link"
  16. ELSIF (str="i") OR (str = "interpreter") THEN str := "InterpreterShell.Start"
  17. END;
  18. Commands.Activate(str, context, {Commands.Wait}, res, msg);
  19. IF res # 0 THEN context.error.String(msg); context.error.Ln; END;
  20. END Execute;
  21. BEGIN
  22. Execute(StdIO.env);
  23. Modules.Shutdown(Modules.PowerDown);
  24. LOOP END;
  25. END StdIOShell.
  26. TODOS:
  27. - check linux file system (new files dot not work)
  28. - add interpreter to linked image
  29. (** LINUX **)
  30. SystemTools.DoCommands
  31. Compiler.Compile -p=Linux32G --mergeSections
  32. Runtime.Mod Trace.Mod Generic.Linux.I386.Glue.Mod Generic.Linux.I386.Unix.Mod Generic.Unix.I386.Machine.Mod Heaps.Mod Generic.Modules.Mod
  33. Generic.Unix.Objects.Mod
  34. Unix.Kernel.Mod KernelLog.Mod Plugins.Mod Streams.Mod
  35. Pipes.Mod Commands.Mod I386.Reals.Mod Generic.Reflection.Mod TrapWriters.Mod CRC.Mod SystemVersion.Mod
  36. Unix.StdIO.Mod Generic.Unix.Traps.Mod Locks.Mod Unix.Clock.Mod Disks.Mod Files.Mod Dates.Mod Strings.Mod
  37. UTF8Strings.Mod FileTrapWriter.Mod Caches.Mod DiskVolumes.Mod OldDiskVolumes.Mod RAMVolumes.Mod
  38. DiskFS.Mod OldDiskFS.Mod OberonFS.Mod FATVolumes.Mod FATFiles.Mod ISO9660Volumes.Mod
  39. ISO9660Files.Mod Generic.Unix.UnixFiles.Mod RelativeFileSystem.Mod BitSets.Mod StringPool.Mod DIagnostics.Mod
  40. ObjectFile.Mod GenericLinker.Mod GenericLoader.Mod Unix.BootConsole.Mod
  41. Pipes.Mod Shell.Mod StdIOShell.Mod
  42. Options.Mod Debugging.Mod
  43. StaticLinker.Mod
  44. FoxBasic.Mod FoxProgTools.Mod FoxScanner.Mod FoxCSharpScanner.Mod FoxSyntaxTree.Mod FoxGlobal.Mod
  45. FoxActiveCells.Mod FoxHardware.Mod FoxFormats.Mod FoxPrintout.Mod
  46. FoxParser.Mod FoxCSharpParser.Mod FoxSemanticChecker.Mod
  47. FoxBackend.Mod FoxSections.Mod
  48. FoxFrontend.Mod
  49. FoxCompiler.Mod
  50. FoxOberonFrontend.Mod FoxCSharpFrontend.Mod
  51. FoxFingerPrinter.Mod FoxInterfaceComparison.Mod FoxTextualSymbolFile.Mod FoxBinarySymbolFile.Mod
  52. FoxBinaryCode.Mod FoxIntermediateCode.Mod FoxIntermediateBackend.Mod FoxCodeGenerators.Mod
  53. FoxBinaryObjectFile.Mod FoxGenericObjectFile.Mod
  54. FoxAMD64InstructionSet.Mod FoxAMD64Assembler.Mod FoxAMDBackend.Mod
  55. FoxAssembler.Mod FoxIntermediateAssembler.Mod FoxDisassembler.Mod
  56. FoxARMInstructionSet.Mod FoxARMAssembler.Mod FoxARMBackend.Mod FoxMinosObjectFile.Mod
  57. FoxIntermediateParser.Mod FoxIntermediateObjectFile.Mod FoxIntermediateLinker.Mod
  58. FoxTRMInstructionSet.Mod FoxTRMAssembler.Mod FoxTRMBackend.Mod
  59. FoxInterpreterBackend.Mod FoxTranspilerBackend.Mod
  60. FoxDocumentationScanner.Mod FoxDocumentationTree.Mod FoxDocumentationPrinter.Mod FoxDocumentationHtml.Mod
  61. FoxDocumentationParser.Mod FoxDocumentationBackend.Mod
  62. DynamicStrings.Mod XMLObjects.Mod XML.Mod XMLScanner.Mod UTF8Strings.Mod XMLParser.Mod
  63. PersistentObjects.Mod FoxInterpreterSymbols.Mod FoxInterpreter.Mod
  64. InterpreterShell.Mod
  65. FoxProfiler.Mod
  66. ProcessInfo0.Mod ProcessInfo.Mod Plugins.Mod SystemTools.Mod
  67. ~
  68. StaticLinker.Link -p=Linux32G
  69. Runtime Trace Glue Unix Machine Heaps Modules Objects Kernel KernelLog
  70. Streams Commands StdIO TrapWriters Traps
  71. Files UnixFiles Clock Dates Reals Strings Diagnostics
  72. BitSets StringPool ObjectFile GenericLinker Reflection GenericLoader
  73. Pipes Shell StdIOShell
  74. Options Locks Debugging
  75. StaticLinker
  76. FoxBasic FoxProgTools FoxScanner FoxSyntaxTree FoxGlobal
  77. FoxActiveCells FoxHardware FoxFormats FoxPrintout
  78. FoxParser FoxSemanticChecker
  79. FoxBackend FoxSections
  80. FoxFrontend
  81. Compiler FoxOberonFrontend
  82. FoxFingerPrinter FoxInterfaceComparison FoxTextualSymbolFile FoxBinarySymbolFile
  83. FoxBinaryCode FoxIntermediateCode FoxIntermediateBackend FoxCodeGenerators
  84. FoxBinaryObjectFile FoxGenericObjectFile
  85. FoxAMD64InstructionSet FoxAMD64Assembler FoxAMDBackend
  86. FoxAssembler FoxIntermediateAssembler FoxDisassembler
  87. FoxARMInstructionSet FoxARMAssembler FoxARMBackend
  88. FoxMinosObjectFile
  89. FoxIntermediateParser FoxIntermediateObjectFile FoxIntermediateLinker
  90. FoxTRMInstructionSet FoxTRMAssembler FoxTRMBackend
  91. FoxInterpreterBackend FoxTranspilerBackend
  92. FoxDocumentationScanner FoxDocumentationTree FoxDocumentationPrinter FoxDocumentationHtml
  93. FoxDocumentationParser FoxDocumentationBackend
  94. DynamicStrings XMLObjects XML XMLScanner UTF8Strings XMLParser
  95. PersistentObjects FoxInterpreterSymbols FoxInterpreter
  96. InterpreterShell
  97. CRC SystemVersion ProcessInfo0 ProcessInfo Plugins SystemTools
  98. ~
  99. FSTools.CloseFiles oberon
  100. ~
  101. ~
  102. (** WINDOWS **)
  103. SystemTools.DoCommands
  104. Compiler.Compile -p=Win32G
  105. Runtime.Mod Trace.Mod Generic.Win32.Kernel32.Mod Win32.Machine.Mod Heaps.Mod
  106. Generic.Modules.Mod Win32.Objects.Mod Win32.Kernel.Mod KernelLog.Mod Streams.Mod Commands.Mod
  107. I386.Reals.Mod Generic.Reflection.Mod Locks.Mod Win32.Clock.Mod Files.Mod Dates.Mod Strings.Mod
  108. Diagnostics.Mod StringPool.Mod BitSets.Mod ObjectFile.Mod
  109. GenericLinker.Mod GenericLoader.Mod Options.Mod Debugging.Mod
  110. TrapWriters.Mod CRC.Mod SystemVersion.Mod Win32.Traps.Mod
  111. Win32.WinTrace.Mod Win32.WinFS.Mod
  112. Win32.StdIO.Mod Pipes.Mod Shell.Mod StdIOShell.Mod
  113. StaticLinker.Mod
  114. FoxBasic.Mod FoxProgTools.Mod FoxScanner.Mod FoxCSharpScanner.Mod FoxSyntaxTree.Mod FoxGlobal.Mod
  115. FoxActiveCells.Mod FoxHardware.Mod FoxFormats.Mod FoxPrintout.Mod
  116. FoxParser.Mod FoxCSharpParser.Mod FoxSemanticChecker.Mod
  117. FoxBackend.Mod FoxSections.Mod
  118. FoxFrontend.Mod
  119. FoxCompiler.Mod
  120. FoxOberonFrontend.Mod FoxCSharpFrontend.Mod
  121. FoxFingerPrinter.Mod FoxInterfaceComparison.Mod FoxTextualSymbolFile.Mod FoxBinarySymbolFile.Mod
  122. FoxBinaryCode.Mod FoxIntermediateCode.Mod FoxIntermediateBackend.Mod FoxCodeGenerators.Mod
  123. FoxBinaryObjectFile.Mod FoxGenericObjectFile.Mod
  124. FoxAMD64InstructionSet.Mod FoxAMD64Assembler.Mod FoxAMDBackend.Mod
  125. FoxAssembler.Mod FoxIntermediateAssembler.Mod FoxDisassembler.Mod
  126. FoxARMInstructionSet.Mod FoxARMAssembler.Mod FoxARMBackend.Mod FoxMinosObjectFile.Mod
  127. FoxIntermediateParser.Mod FoxIntermediateObjectFile.Mod FoxIntermediateLinker.Mod
  128. FoxTRMInstructionSet.Mod FoxTRMAssembler.Mod FoxTRMBackend.Mod
  129. FoxInterpreterBackend.Mod FoxTranspilerBackend.Mod
  130. FoxDocumentationScanner.Mod FoxDocumentationTree.Mod FoxDocumentationPrinter.Mod FoxDocumentationHtml.Mod
  131. FoxDocumentationParser.Mod FoxDocumentationBackend.Mod
  132. DynamicStrings.Mod XMLObjects.Mod XML.Mod XMLScanner.Mod UTF8Strings.Mod XMLParser.Mod
  133. PersistentObjects.Mod FoxInterpreterSymbols.Mod FoxInterpreter.Mod
  134. InterpreterShell.Mod
  135. FoxProfiler.Mod
  136. ProcessInfo0.Mod ProcessInfo.Mod Plugins.Mod SystemTools.Mod
  137. ~
  138. (* first lines can be replaced by Kernel.lib *)
  139. StaticLinker.Link --fileFormat=PE32CUI --fileName=oberon.exe --extension=GofW --displacement=401000H
  140. Runtime Trace Kernel32 Machine Heaps Modules Objects Kernel KernelLog Streams Commands Files
  141. WinFS Clock Dates Reals Strings Diagnostics BitSets StringPool ObjectFile GenericLinker Reflection GenericLoader
  142. WinTrace StdIO
  143. TrapWriters CRC SystemVersion Traps
  144. Pipes Shell StdIOShell
  145. Options Locks Debugging
  146. StaticLinker
  147. FoxBasic FoxProgTools FoxScanner FoxSyntaxTree FoxGlobal
  148. FoxActiveCells FoxHardware FoxFormats FoxPrintout
  149. FoxParser FoxSemanticChecker
  150. FoxBackend FoxSections
  151. FoxFrontend
  152. Compiler
  153. FoxOberonFrontend
  154. FoxFingerPrinter FoxInterfaceComparison FoxTextualSymbolFile FoxBinarySymbolFile
  155. FoxBinaryCode FoxIntermediateCode FoxIntermediateBackend FoxCodeGenerators
  156. FoxBinaryObjectFile FoxGenericObjectFile
  157. FoxAMD64InstructionSet FoxAMD64Assembler FoxAMDBackend
  158. FoxAssembler FoxIntermediateAssembler FoxDisassembler
  159. FoxARMInstructionSet FoxARMAssembler FoxARMBackend
  160. FoxMinosObjectFile
  161. FoxIntermediateParser FoxIntermediateObjectFile FoxIntermediateLinker
  162. FoxTRMInstructionSet FoxTRMAssembler FoxTRMBackend
  163. FoxInterpreterBackend FoxTranspilerBackend
  164. FoxDocumentationScanner FoxDocumentationTree FoxDocumentationPrinter FoxDocumentationHtml
  165. FoxDocumentationParser FoxDocumentationBackend
  166. XML XMLScanner DynamicStrings UTF8Strings XMLParser XMLObjects
  167. PersistentObjects FoxInterpreterSymbols FoxInterpreter
  168. InterpreterShell
  169. ProcessInfo0 ProcessInfo Plugins SystemTools
  170. ~
  171. FSTools.CloseFiles oberon.exe ~
  172. ~
  173. FoxGenericObjectFile.MakeLibrary
  174. Kernel.Lib Runtime.GofW Trace.GofW
  175. Kernel32.GofW Machine.GofW Heaps.GofW Modules.GofW Objects.GofW
  176. Kernel.GofW KernelLog.GofW Streams.GofW Commands.GofW Files.GofW
  177. WinFS.GofW Clock.GofW Dates.GofW Reals.GofW Strings.GofW Diagnostics.GofW BitSets.GofW StringPool.GofW ObjectFile.GofW GenericLinker.GofW Reflection.GofW
  178. GenericLoader.GofW
  179. WinTrace.GofW WinApplication.GofW
  180. ~
  181. ~