diff --git a/src/other/pbsh.s b/src/other/pbsh.s index 9e18983..9d0aab4 100644 --- a/src/other/pbsh.s +++ b/src/other/pbsh.s @@ -5,34 +5,52 @@ " In particular, the newline/newcom/newarg/newchar processing loop(s) " are copied from the v1 shell: -" redirection must occur at the start of a name (after whitespace) +" 1. Redirection must occur at the start of a name (after whitespace) +" 2. In parroting the v1 shell code, I did NOT add whitespace removal +" after > and < " includes ';' and '&' (which are mentioned as added close after "fork") -" does NOT include quoting (backslash or single quote) -" No "globbing" (performed by /etc/glob in v1 shell); -" McIlroy's "Reader" paper reports that cp/mv syntax -" changed in response to the introduction of globbing, -" the the surviving "cp" command takes src dest pairs. +" does NOT include quoting (backslash or quotes), which are mentioned +" in the v1 shell man page: http://man.cat-v.org/unix-1st/1/sh -" cat.s seems to write error output on fd 8, *BUT* shell doesn't know -" what device is on stdout (passed by init, and init doesn't pass fd 8) -" and there isn't a "dup" call, an "indirect" device like /dev/tty, -" nor does init make an equivalent link!! +" does NOT implement >> (not mentioned in the v1 sh man page) + +" No "globbing" (performed by /etc/glob in v1 shell); McIlroy's +" "Reader" paper reports that cp/mv syntax changed in response to the +" introduction of globbing, the the surviving "cp" command takes src +" dest pairs. + +" v1 shell expects "-" as argument from init or login, will read a +" filename passed as the first argument. *BUT* the PDP-7 init.s +" doesn't set up an arg pointer at the top of memory, so it's unlikely +" the PDP-7 shell took command line arguments!!! + +" cat.s seems to write error output on fd 8, but "init" (which opened +" stdin and stdout) doesn't set it up, and the shell doesn't know what +" device is on stdout (passed by init, and init doesn't pass fd 8) and +" there isn't a "dup" call, or an "indirect" device like /dev/tty +" (nor does init make an equivalent link), so the shell doesn't have +" a way to open the correct device). + +" Direct exection of "runcom" files _could_ be implemented by reading +" the first block of the "binary" (into 010000) and seeing if any have +" any bits in 0300300 set before jumping into the "boostrap" code. + +" If that's the case, then the child could open "sh" instead of the +" command file, close stdin, and open the command file, read the first +" block of "sh" into 010000, and jumping into the bootstrap, but there +" isn't any evidence that this was the case. " Arguments for new processes are located at the end of memory. " Location 17777 points to a word with the argument count (argc), " followed by blocks of four words with (filename) arguments. -" Currently leave room for ONLY maxargs items. -" 10 is enough to build "cold start" system (sop + s1-9): -maxargs=10 -" v1 shell expects "-" as argument from init or login, will read -" filename passed as argument. *BUT* init.s doesn't set up the argv -" at the top of memory, so the v0 shell may not have taken command -" line arguments!!! You can still invoke "sh