StdIOShell.Mod 8.3 KB

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