소스 검색

Kernel.cmdLine

Alexander Shiryaev 13 년 전
부모
커밋
3355c3fd9e

BIN
BlackBox/Lin/Mod/Obsd.linHostFiles.odc


+ 1 - 1
BlackBox/Lin/Mod/Obsd.linHostFiles.txt

@@ -1237,7 +1237,7 @@ MODULE HostFiles;
 			}
 *)
 		wildcard := "*"; NEW(dir);
-		(*str := Kernel.cmdLine$;*) str := "";
+		str := Kernel.cmdLine$;
 		i := 0; slp := -1;
 		WHILE (str[i] # " ") & (str[i] # 0X) DO 
 			startupDir[i] := str[i]; 

BIN
BlackBox/Lin/Mod/Obsd.linKernel.odc


+ 13 - 0
BlackBox/Lin/Mod/Obsd.linKernel.txt

@@ -2503,6 +2503,16 @@ L1:
 		FOR i := 1 TO bootInfo.argc - 1 DO cmdLine := cmdLine + " " + bootInfo.argv[i]END
 	END SetCmdLine;
 	
+	(* A. V. Shiryaev, 2012.09 *)
+	PROCEDURE SetCmdLine2;
+		VAR x: LinLibc.PtrSTR;
+	BEGIN
+		x := LinLibc.getenv("CMDLINE");
+		IF x # NIL THEN
+			cmdLine := x$
+		END
+	END SetCmdLine2;
+	
 	PROCEDURE Init;
 		VAR (*excp: KERNEL32.ExcpFrm; *) t: Type; (*res: COM.RESULT; *) i: INTEGER;
 			env: LinLibc.jmp_buf; res: LONGINT;
@@ -2565,8 +2575,11 @@ BEGIN
 		ELSE
 			SYSTEM.GETREG(ML, modList);	(* linker loads module list to BX *)
 			SYSTEM.GETREG(SP, baseStack);
+
 			static := init IN modList.opts;
 			inDll := dll IN modList.opts;
+
+			SetCmdLine2 (* A. V. Shiryaev, 2012.09 *)
 		END;
 (*
 		dllMem := inDll;

+ 1 - 1
BlackBox/run-BlackBox

@@ -1,4 +1,4 @@
 #!/bin/sh
 
 # env LD_LIBRARY_PATH=. env LD_DEBUG=1 ./BlackBox
-env LD_LIBRARY_PATH=. ./BlackBox
+env LD_LIBRARY_PATH=. CMDLINE="${0} `echo ${@}`" ./BlackBox

+ 4 - 0
BlackBox/run-BlackBox-dl

@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# env LD_LIBRARY_PATH=. env LD_DEBUG=1 ./BlackBox-dl
+env LD_LIBRARY_PATH=. CMDLINE="${0} `echo ${@}`" ./BlackBox-dl

+ 20 - 13
README

@@ -37,19 +37,25 @@ Files:
 			Lin/Mod/Kernel_so_init.odc
 	modified:
 		Lin/Mod/Obsd.linKernel.odc:
-			OpenBUGS Lin/Mod/linKernel.odc modified with OpenBSD specific:
-				Kernel.TrapHandler
-					OpenBSD sigcontext related
-				Kernel.Time
-					CLOCKS_PER_SEC related
-				Kernel.InitModule
-					mprotect added
-				Kernel.InstallSignals:
-					do not install signal handler for SIGTHR (when executable linked with -pthread)
+			OpenBUGS Lin/Mod/linKernel.odc:
+				OpenBSD specific:
+					Kernel.TrapHandler
+						OpenBSD sigcontext related
+					Kernel.Time
+						CLOCKS_PER_SEC related
+					Kernel.InitModule
+						mprotect added
+					Kernel.InstallSignals:
+						do not install signal handler for SIGTHR (when executable linked with -pthread)
+				Kernel.cmdLine support:
+					Kernel.INIT (SetCmdLine2)
 		Lin/Mod/Obsd.linHostFiles.odc:
-			OpenBUGS Lin/Mod/linHostFiles.odc: 
-				size_t specific
-				__xstat -> stat
+			OpenBUGS Lin/Mod/linHostFiles.odc:
+				OpenBSD-specific:
+					size_t
+					__xstat -> stat
+				Kernel.cmdLine support:
+					str := "" -> str := Kernel.cmdLine$
 		Lin/Mod/Obsd.Console.odc:
 			OpenBUGS Lin/Mod/Console.odc:
 				stdin -> SYSTEM.ADR(__sF[0])
@@ -57,7 +63,8 @@ Files:
 			OpenBUGS Lin/Mod/Libc.odc:
 				OpenBSD-specific
 		Lin/Mod/Dates.odc:
-			HostDates, thanks to Trurl@oberoncore.ru
+			HostDates, from http://oberoncore.ru/:
+				OpenBSD-specific
 		Lindev/Mod
 			CP*
 				BlackBox 1.6-rc6 Dev CP* modified to not depend on Dates, Texts etc.