📜 ⬆️ ⬇️

UNIX early history

This is a translation of a fragment from an article that, in my opinion, is appropriate to put in a separate post. Main article: habrahabr.ru/post/193798

The Multiple Access Computer, Man and Computer project, began as a purely research at MIT in 1963. Then it expanded into the Computer Science Laboratory (LCS), and today it is called the Laboratory of Computer Science and Artificial Intelligence.

In the early 60s there was a surge of interest in time-sharing systems. John McCarthy wrote a note under the title “Time Sharing Operator Program for the IBM 709 Project” in 1959. Corbato, Mervin-Dagget and Daley in 1962 wrote in an article that “we are on the verge of a third global change to the approach of using computers, due to the division of time”. At first it was considered as a way to increase the efficiency of computer use, but very quickly they came to the idea of ​​a multi-user system. Dennis Ritchie will later say that the slowest stage in the “write-compile-execute-debug” cycle was determined by a person, not a machine.
')
image

Within the framework of the project, the MAS turned out to be a significant contribution to systems with shared time, including the development of the operating system (there were no such words at that time, but let's say so for definiteness - approx. Translation) CTSS (Compatible Time-Sharing System). In the second half of the 60s, several other time-sharing systems were created, for example, BBN, DTSS, JOSS, SDC, etc. But all this has nothing to do with this article. But the Multiplexed Information and Computing Service (MULTICS) - has.

Multics


This is a joint development of MIT, Bell Telephone Laboratories (BTL) and General Electric (GE) to create a time-sharing OS for the GE-645 computer.

At that time, “using a computer” meant almost exclusively “programming”. That is, it was necessary to more efficiently perform the “write-debug” cycle mentioned above.

Multics was supposed to be application software that can support up to 1000 users simultaneously. From TK (cited from the “Introduction and Review to the Multics System”, Corbato, Vysotsky, 1965):

BTL departed from this project in early 1969. Multics developed as a commercial product even after a series of resales. Honeywell bought GE's computer business, and Bull bought Honeywell. In general, the project was a success and noticeably influenced many subsequent ones. The last computer running Multics turned off on October 31, 2000.

UNIX


Although BTL left the project, some of its employees wanted to continue on their own. For example, Ken Thompson, Dennis Ritchie, Stew Feldman, Doug McIlroy, Bob Morris, Joe Ossanna. Thompson worked on the Space Travel game on the GE-635. It was written first for Multics, and then rewritten in Fortran under GECOS on GE-635. The game modeled the bodies of the solar system, and the player had to put the ship somewhere on the planet or satellite. Neither the software nor the hardware of this computer was suitable for such a game. Thompson was looking for an alternative, and rewrote the game under the ownerless PDP-7. The memory was 8K of 18-bit words, and there was also a vector display processor for outputting beautiful graphics for that time. Thompson using Ritchie rewrote the game for the PDP-7 in assembler. In the process of work also turned out the software unit of work with a floating point. The game worked on bare hardware, without OS.

Zero Edition (end of 1969)


Thompson and Ritchie were fully cross-assembler at GE and transferred the code to punched tapes. Thompson did not actively like it, and he began writing an OS for the PDP-7, starting with the file system. The system began to gather on itself at the end of 1969. There was already a kernel, an editor, an assembler, a simple shell and file utilities like cat , cp , rm . It was UNICS, the name is thin trolling Multics. Then it mutated in UNIX. This can be considered a zero edition.

The first version of the cp command processed the arguments in pairs:

 # cp file11 file12 file21 file22 ... 


The dsw (delete using switches) command allowed online deletion of files.

The influence of Multics and the earlier CTSS system on modern Unix-like systems:

Ritchie wrote in one of his articles on history: “In general, UNIX is a very conservative system. Only a small part of the ideas realized in it is really new. But for CTSS heritage, even that is not bad. "

PDP-7 UNIX had a file system with inodes, but they contained very little information — a list of physical blocks and minimal metadata: size, creation time, and file type. Special files and directories were supported, but there were no file paths. But there was buffering. Another of the significant limitations:

PDP-7 UNIX also marked the beginning of the high-level language B, which was created under the influence of the BCPL language. Dennis Ritchie said that B is C without types. BCPL was placed in 8 KB of memory and was thoroughly reworked by Thompson. I gradually grew up in C. Let me remind you that the kernel and the PDP-7 UNIX programs were written entirely in assembly language.

An example of the Hanoi towers on the BCPL

UNIX also worked on the PDP-9. In 1969, the first ARPANET node was also launched and the first RFC was published.

The UNIX development team sent BTL to buy a more advanced computer, the PDP-11/20 with 24 KB of memory. They promised to write a system for editing and editing documentation to run without an OS, and use UNIX only for development. UNIX on a new computer launched in early 1971. 12 KB of memory was occupied by the kernel, a little more - by programs, and everything else went under ramdrayv.

First edition (November 1971)


The first edition worked on the PDP-11/20 without MMU and hardware memory protection. So the stability of work and resistance to failure was not up to par. There were no multiprogrammes either, but the paths to the files have already appeared. Documentation for such system calls: break, cemt, chdir, chmod, chown, close, creat, exec, exit, fork, fstat, getuid, gtty, ilgins, intr, link, mkdir, mount, open, quit, read, rele, seek, setuid, smdate, stat, stime, stty, tell, time, umount, unlink, wait, write.

From programming languages ​​supported assembler, B, BASIC, FORTRAN. Since it was not.

Development environment files in B and assembler:
/bin/as assembler. The default output file is called a.out
/bin/ld link editor (rather contextual linker, but it’s very difficult to get such a translation from the original - approx. transl.) . Only one user can work in the same directory at the same time due to a temporary file conflict.
/bin/nm prints the symbol table from the output of the assembler or loader
/bin/strip removes extra characters from binaries
/bin/un lists the characters that are not defined in the program.
/etc/as2 second pass of the assembler
/etc/ba assembler B (prog.i -> prog.s)
/etc/bc B compiler (prog.b -> prog.i)
/etc/bilib interpreter library B
/etc/brt1, /etc/brt2 runtime B
/etc/liba.a assembler routines
/etc/libb.a library routines for
/usr/b/rc shell script to compile a B program into a binary. Works on the chain program.b -> program.i -> program.s -> a.out

In the first edition, copyright is not mentioned anywhere. The documentation was an impressive seven-volume: cm.bell-labs.com/cm/cs/who/dmr/1stEdman.html . Summary:
  1. Commands. Programs that the user calls directly
  2. System calls. Called through a special processor command
  3. Subprograms Called by user programs
  4. Special files
  5. File formats
  6. miscellanea

In the following editions, the eighth volume appeared devoted to system maintenance.

Each logical page of the manual was called a man page and contained a title, a brief description, text, a list of affected files, links, diagnostics, bugs, and the author. Documentation was prepared in the ed editor and formatted with the roff program. The very first page was devoted to the cat .

Second Edition (June 1972)


In the second edition of the compiler added C, . It was written in another language. New commands and system calls appeared:: :(1), cc, echo(1), exit(1), goto(1), if(1), login(1), m6(1), man(1), mt(1), opr(1), stty(1), tmg(1), tss(1), kill(2), sleep(2), sync(2), atan(3), hypot(3), nlist(3), qsort(3), salloc(3), and sqrt(3).

:(1) Does nothing. Initially it was a label for goto, it was necessary to teach the shell to ignore such lines.
cc(1) compiler C
m6(1) general purpose macro processor
opr(1) sends the print job
tmg(1) compiler compiler. TMG is a language for writing compilers.
tss(1) interface for remote access to the Honeywell TSS OS.
salloc(3) library for working with strings of arbitrary length

In the second edition, there was also no multiprogramming or memory protection, but a copyright appeared.

Third Edition (February 1973)


This version has earned PDP-11/45 with memory protection and support for a large amount of it - up to 256 KB.

From new features should pay attention to the conveyors and multiprogram. Besides:
cdb(1) debugger C
crypt(3) password encryption procedure
proof(1) proto-diff
ps(8) process list
sno(1) SNOBOL III compiler and interpreter
speak(1) Speech synthesizer. At the entrance receives a stream of words, gives their pronunciation
typo(1) quote from the manual: "... looks for rare documents in the document, typos and hapax legomena and prints them to standard output")
yacc(6) compiler compiler

Fourth Edition (November 1973)


This is actually the third edition, rewritten in C. Also supported are new PDP-11 models - / 60 and / 70. Due to the development of a higher level language, the volume of the system has grown by a third. There were small updates of commands, language B is excluded from the delivery.

What else is on this topic on Habré


habrahabr.ru/post/114588
habrahabr.ru/post/126369
habrahabr.ru/post/147774 - very well written. The text is repeated in some places, because both articles are based on the same source.
habrahabr.ru/post/46432

Source: https://habr.com/ru/post/194160/


All Articles