What we wanted to preserve was not just a good
environment in which to do programming, but a system around which a
fellowship could form. We knew from experience that the essence of
communal computing, as supplied by remote-access, time-shared
machines, is not just to type programs into a terminal instead of a
keypunch, but to encourage close communication.
So it really did begin with Space Travel… then a file system (which
had been previously designed with chalk), then user-level utilities
(because a filesystem is wasted if you don’t have stuff to do with
it), then a shell, then an assembler.
How the old shell worked:
- The shell closed all its open files, then opened the terminal special file for standard input and output (file descriptors 0 and 1).
- It read a command line from the terminal.
- It linked to the file specifying the command, opened the file, and removed the link. Then it copied a small bootstrap program to the top of memory and jumped to it; this bootstrap program read in the file over the shell code, then jumped to the first location of the command (in effect an exec).
- The command did its work, then terminated by calling exit. The exit call caused the system to read in a fresh copy of the shell over the terminated command, then to jump to its start (and thus in effect to go to step 1).