StdIOShell.Mod 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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 FoxOberonFrontend.Mod FoxCSharpFrontend.Mod
  49. FoxCompiler.Mod FoxFingerPrinter.Mod FoxInterfaceComparison.Mod FoxTextualSymbolFile.Mod FoxBinarySymbolFile.Mod
  50. FoxBinaryCode.Mod FoxIntermediateCode.Mod FoxIntermediateBackend.Mod FoxCodeGenerators.Mod
  51. FoxBinaryObjectFile.Mod FoxGenericObjectFile.Mod
  52. FoxAMD64InstructionSet.Mod FoxAMD64Assembler.Mod FoxAMDBackend.Mod
  53. FoxAssembler.Mod FoxIntermediateAssembler.Mod FoxDisassembler.Mod
  54. FoxARMInstructionSet.Mod FoxARMAssembler.Mod FoxARMBackend.Mod FoxMinosObjectFile.Mod
  55. FoxIntermediateParser.Mod FoxIntermediateObjectFile.Mod FoxIntermediateLinker.Mod
  56. FoxTRMInstructionSet.Mod FoxTRMAssembler.Mod FoxTRMBackend.Mod
  57. FoxInterpreterBackend.Mod FoxTranspilerBackend.Mod
  58. FoxDocumentationScanner.Mod FoxDocumentationTree.Mod FoxDocumentationPrinter.Mod FoxDocumentationHtml.Mod
  59. FoxDocumentationParser.Mod FoxDocumentationBackend.Mod
  60. XML.Mod XMLScanner.Mod DynamicStrings.Mod UTF8Strings.Mod XMLParser.Mod XMLObjects.Mod
  61. PersistentObjects.Mod FoxInterpreterSymbols.Mod FoxInterpreter.Mod
  62. InterpreterShell.Mod
  63. FoxProfiler.Mod
  64. ProcessInfo0.Mod ProcessInfo.Mod Plugins.Mod SystemTools.Mod
  65. ~
  66. StaticLinker.Link -p=Linux32G
  67. Runtime Trace Glue Unix Machine Heaps Modules Objects Kernel KernelLog
  68. Streams Commands StdIO TrapWriters Traps
  69. Files UnixFiles Clock Dates Reals Strings Diagnostics
  70. BitSets StringPool ObjectFile GenericLinker Reflection GenericLoader
  71. Pipes Shell StdIOShell
  72. Options Locks Debugging
  73. StaticLinker
  74. FoxBasic FoxProgTools FoxScanner FoxSyntaxTree FoxGlobal
  75. FoxActiveCells FoxHardware FoxFormats FoxPrintout
  76. FoxParser FoxSemanticChecker
  77. FoxBackend FoxSections
  78. FoxFrontend FoxOberonFrontend
  79. Compiler FoxFingerPrinter FoxInterfaceComparison FoxTextualSymbolFile FoxBinarySymbolFile
  80. FoxBinaryCode FoxIntermediateCode FoxIntermediateBackend FoxCodeGenerators
  81. FoxBinaryObjectFile FoxGenericObjectFile
  82. FoxAMD64InstructionSet FoxAMD64Assembler FoxAMDBackend
  83. FoxAssembler FoxIntermediateAssembler FoxDisassembler
  84. FoxARMInstructionSet FoxARMAssembler FoxARMBackend
  85. FoxMinosObjectFile
  86. FoxIntermediateParser FoxIntermediateObjectFile FoxIntermediateLinker
  87. FoxTRMInstructionSet FoxTRMAssembler FoxTRMBackend
  88. FoxInterpreterBackend FoxTranspilerBackend
  89. FoxDocumentationScanner FoxDocumentationTree FoxDocumentationPrinter FoxDocumentationHtml
  90. FoxDocumentationParser FoxDocumentationBackend
  91. XML XMLScanner DynamicStrings UTF8Strings XMLParser XMLObjects
  92. PersistentObjects FoxInterpreterSymbols FoxInterpreter
  93. InterpreterShell
  94. CRC SystemVersion ProcessInfo0 ProcessInfo Plugins SystemTools
  95. ~
  96. FSTools.CloseFiles oberon
  97. ~
  98. ~
  99. (** WINDOWS **)
  100. SystemTools.DoCommands
  101. Compiler.Compile -p=Win32G
  102. Runtime.Mod Trace.Mod Generic.Win32.Kernel32.Mod Win32.Machine.Mod Heaps.Mod
  103. Generic.Modules.Mod Win32.Objects.Mod Win32.Kernel.Mod KernelLog.Mod Streams.Mod Commands.Mod
  104. I386.Reals.Mod Generic.Reflection.Mod Locks.Mod Win32.Clock.Mod Files.Mod Dates.Mod Strings.Mod
  105. Diagnostics.Mod StringPool.Mod BitSets.Mod ObjectFile.Mod
  106. GenericLinker.Mod GenericLoader.Mod Options.Mod Debugging.Mod
  107. TrapWriters.Mod CRC.Mod SystemVersion.Mod Win32.Traps.Mod
  108. Win32.WinTrace.Mod Win32.WinFS.Mod
  109. Win32.StdIO.Mod Pipes.Mod Shell.Mod StdIOShell.Mod
  110. StaticLinker.Mod
  111. FoxBasic.Mod FoxProgTools.Mod FoxScanner.Mod FoxCSharpScanner.Mod FoxSyntaxTree.Mod FoxGlobal.Mod
  112. FoxActiveCells.Mod FoxHardware.Mod FoxFormats.Mod FoxPrintout.Mod
  113. FoxParser.Mod FoxCSharpParser.Mod FoxSemanticChecker.Mod
  114. FoxBackend.Mod FoxSections.Mod
  115. FoxFrontend.Mod FoxOberonFrontend.Mod FoxCSharpFrontend.Mod
  116. FoxCompiler.Mod FoxFingerPrinter.Mod FoxInterfaceComparison.Mod FoxTextualSymbolFile.Mod FoxBinarySymbolFile.Mod
  117. FoxBinaryCode.Mod FoxIntermediateCode.Mod FoxIntermediateBackend.Mod FoxCodeGenerators.Mod
  118. FoxBinaryObjectFile.Mod FoxGenericObjectFile.Mod
  119. FoxAMD64InstructionSet.Mod FoxAMD64Assembler.Mod FoxAMDBackend.Mod
  120. FoxAssembler.Mod FoxIntermediateAssembler.Mod FoxDisassembler.Mod
  121. FoxARMInstructionSet.Mod FoxARMAssembler.Mod FoxARMBackend.Mod FoxMinosObjectFile.Mod
  122. FoxIntermediateParser.Mod FoxIntermediateObjectFile.Mod FoxIntermediateLinker.Mod
  123. FoxTRMInstructionSet.Mod FoxTRMAssembler.Mod FoxTRMBackend.Mod
  124. FoxInterpreterBackend.Mod FoxTranspilerBackend.Mod
  125. FoxDocumentationScanner.Mod FoxDocumentationTree.Mod FoxDocumentationPrinter.Mod FoxDocumentationHtml.Mod
  126. FoxDocumentationParser.Mod FoxDocumentationBackend.Mod
  127. XML.Mod XMLScanner.Mod DynamicStrings.Mod UTF8Strings.Mod XMLParser.Mod XMLObjects.Mod
  128. PersistentObjects.Mod FoxInterpreterSymbols.Mod FoxInterpreter.Mod
  129. InterpreterShell.Mod
  130. FoxProfiler.Mod
  131. ProcessInfo0.Mod ProcessInfo.Mod Plugins.Mod SystemTools.Mod
  132. ~
  133. (* first lines can be replaced by Kernel.lib *)
  134. StaticLinker.Link --fileFormat=PE32CUI --fileName=oberon.exe --extension=GofW --displacement=401000H
  135. Runtime Trace Kernel32 Machine Heaps Modules Objects Kernel KernelLog Streams Commands Files
  136. WinFS Clock Dates Reals Strings Diagnostics BitSets StringPool ObjectFile GenericLinker Reflection GenericLoader
  137. WinTrace StdIO
  138. TrapWriters CRC SystemVersion Traps
  139. Pipes Shell StdIOShell
  140. Options Locks Debugging
  141. StaticLinker
  142. FoxBasic FoxProgTools FoxScanner FoxSyntaxTree FoxGlobal
  143. FoxActiveCells FoxHardware FoxFormats FoxPrintout
  144. FoxParser FoxSemanticChecker
  145. FoxBackend FoxSections
  146. FoxFrontend FoxOberonFrontend
  147. Compiler FoxFingerPrinter FoxInterfaceComparison FoxTextualSymbolFile FoxBinarySymbolFile
  148. FoxBinaryCode FoxIntermediateCode FoxIntermediateBackend FoxCodeGenerators
  149. FoxBinaryObjectFile FoxGenericObjectFile
  150. FoxAMD64InstructionSet FoxAMD64Assembler FoxAMDBackend
  151. FoxAssembler FoxIntermediateAssembler FoxDisassembler
  152. FoxARMInstructionSet FoxARMAssembler FoxARMBackend
  153. FoxMinosObjectFile
  154. FoxIntermediateParser FoxIntermediateObjectFile FoxIntermediateLinker
  155. FoxTRMInstructionSet FoxTRMAssembler FoxTRMBackend
  156. FoxInterpreterBackend FoxTranspilerBackend
  157. FoxDocumentationScanner FoxDocumentationTree FoxDocumentationPrinter FoxDocumentationHtml
  158. FoxDocumentationParser FoxDocumentationBackend
  159. XML XMLScanner DynamicStrings UTF8Strings XMLParser XMLObjects
  160. PersistentObjects FoxInterpreterSymbols FoxInterpreter
  161. InterpreterShell
  162. ProcessInfo0 ProcessInfo Plugins SystemTools
  163. ~
  164. FSTools.CloseFiles oberon.exe ~
  165. ~
  166. FoxGenericObjectFile.MakeLibrary
  167. Kernel.Lib Runtime.GofW Trace.GofW
  168. Kernel32.GofW Machine.GofW Heaps.GofW Modules.GofW Objects.GofW
  169. Kernel.GofW KernelLog.GofW Streams.GofW Commands.GofW Files.GofW
  170. WinFS.GofW Clock.GofW Dates.GofW Reals.GofW Strings.GofW Diagnostics.GofW BitSets.GofW StringPool.GofW ObjectFile.GofW GenericLinker.GofW Reflection.GofW
  171. GenericLoader.GofW
  172. WinTrace.GofW WinApplication.GofW
  173. ~
  174. ~