Monday, October 20, 2008

Slackware/Linux/Unix (pre-)history (Part 2: A new language, a philosophy, and the spreading of Unix)

Needing a new language

The first crude version of Unix was written in assembler language on the PDP-7 and later the PDP-11. But Ken Thompson thought it should be written in a higher-level language. In 1971 he first experimented with Fortran, but according to some stories, he gave up after only one day. He then decided to write his own language, loosely based on BCPL, and called it simply B. But B was interpreted so it was too slow for an operating system. B also lacked types, which complicated things.
Ritchie first expanded B, adding types to the language, and named the result New B, or NB. The next step was writing a compiler, which took longer than expected. The result was the C language and Thompson started to rewrite Unix in it, which he finished in 1973.
With this Thompson and Ritchie created a much more portable operating system, leaving only small parts of the code machine-dependent.

The Unix Philosophy

Douglas McIlroy, head of Bell Labs' Computing Techniques Research Department, had created the concept of 'pipes' - chaining processes by streams, or: the output of one program becomes the input of another. His idea was to have specific tools to do specific jobs, and chain small tools together to do more complicated jobs. This was probably the first idea for "software componentry". He summarized this as follows:
- Write programs that do one thing and do it well
- Write programs to work together
- Write programs to handle text streams, because that is a universal interface
This ultimately became known as "The Unix Philosophy".

M. Douglas McIlroy

So the idea was there, but a syntax was needed to use it. Then Brian Kernighan came up with the vertical bar (|) and pipes were born, which led the way to creating several tools with specific tasks.
In the process, McIlroy developed several Unix tools like diff, spell, tr, and others.

A simple (and well-known) example of chaining two programs is:
echo "IBM 9000" | tr A-Z ZA-Y
Where the first part outputs the text "IBM 9000", which goes as input to tr, which shifts all letters (A-Z) one position and forms the name of a computer from a famous movie (ok, I like Sci-Fi movies...).

Spreading of Unix

Unix was a fact now and AT&T started distributing licenses to universities and the government. In 1976 / 1977 Thompson took a six-month leave from Bell Labs to teach at UCB. And of course he taught Unix. After he left, professors and students improved some parts of Unix, creating what became the Berkeley Software Distribution, or BSD, which was resold to several other universities.
UCB established the Computer Systems Research Group (CSRG), which received a grant from DARPA. They made the TCP/IP protocol available for Unix, opening the way for this operating system to play a key role in the early days of the internet.

The following BSD releases contributed several new tools to Unix, like a visual editor (that became vi), the c-shell, delivermail (which became sendmail) and the curses library, the forefather of ncurses.

For the VAX computer BSD included Virtual Memory Management. The kernel image of this Unix version was named vmunix - a name we can recognize in modern Linux kernels, normally named vmlinuz (the final 'z' because if the zlib-compression).

It is estimated that by 1978, over 600 (!) machines were running Unix.

To be continued...

Labels: , , ,

1 Comments:

Anonymous Anonymous said...

Astounding! More than 600?! By that time there were so many computers?! O:-D

p.s.: I'm not that young... :-x

December 29, 2008 at 2:32 PM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home