Procházet zdrojové kódy

Added shell command - to be able to open a shell from a command list.
For example, LinuxA2 can nicely be started at a shell using
>>
oberon run a2
<<
where a2 contains
>>
Display.Install ~
WindowManager.install ~
Autostart.Run ~
Shell.Start ~
<<

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7039 8c9fc860-2736-0410-a75d-ab315db34111

felixf před 8 roky
rodič
revize
de34d7f33d
2 změnil soubory, kde provedl 10 přidání a 3 odebrání
  1. 7 0
      source/Shell.Mod
  2. 3 3
      source/StdIOShell.Mod

+ 7 - 0
source/Shell.Mod

@@ -650,6 +650,13 @@ TYPE
 		BEGIN {EXCLUSIVE} dead := TRUE; END;
 	END Shell;
 
+	PROCEDURE Start*(context: Commands.Context);
+	VAR shell: Shell;
+	BEGIN
+		NEW(shell, context.in, context.out, context.error, FALSE, ">");
+		shell.AwaitDeath()
+	END Start;
+	
 END Shell.
 
 SystemTools.Free Shell ~

+ 3 - 3
source/StdIOShell.Mod

@@ -9,9 +9,7 @@ BEGIN
 		context.out.String("Critical error: no arg"); 
 		RETURN END;
 	IF ~context.arg.GetString(str) THEN 
-		NEW(shell, context.in, context.out, context.error, FALSE, ">"); 
-		shell.AwaitDeath;
-		RETURN
+		str := "Shell.Start";
 	END;
 	IF str = "compile" THEN str := "Compiler.Compile"
 	ELSIF str="link" THEN str := "StaticLinker.Link"
@@ -30,6 +28,7 @@ BEGIN
 END StdIOShell.
 SystemTools.Free StaticLinker ~
 
+SystemTools.DoCommands
 	StaticLinker.Link -p=Linux32G
 		Runtime  Traps UnixFiles RelativeFileSystem GenericLoader
 		WMDefaultFont
@@ -49,6 +48,7 @@ SystemTools.Free StaticLinker ~
 		Partitions
 		~
 		FSTools.CloseFiles oberon ~
+		~
 TODOS:
 	- check linux file system (new files dot not work)
 	- add interpreter to linked image