Introduction to Linux

A brief history of Unix

It all started in 1969 when Ken Thompson wrote his game named Space Travel that simulates travel in the Solar System. He originally wrote it for use on Multics (Multiplexed Information and Computing Service) operating system, but soon after Bell Labs pulled out of the Multics project, he rewrote it for the obsolete and little-used PDP-7 minicomputer that he found at his neighboring department. While writing this game on the PDP-7, he decided to implement his own base code libraries for the game to use including arithmetic, packages and graphics subsystem. These subsystems were coded in Assembly language on the GECOS (General Comprehensive Operating System) system and assembled. Then the output physically was put on punched tapes to be carried over and inserted into the PDP-7. Thompson then wrote an assembler for the PDP-7 to avoid this tedious process. The game ran slowly on the PDP-7 which caused Thompson to design his own file system based on some ideas from Dennis Ritchie who also worked at Bell Labs and had a lot of experiences with the Multics file system. By the time the game was fully ported to the PDP-7, Thompson had expanded his software craft to a full, basic operating system. The operating system was then named Unix in 1970.

The PDP-7 computer had an 18-bit word length (in contrast to modern computers where each of them is nearly eight bit word length) and only four kilo bytes of memory (which is only a small fraction of the capacity of a single modern floppy disk). This extremely small memory was undoubtedly a major factor in Thompson’s keeping his operating system extremely small and providing it with an elegant simplicity that has, in turn, played an important role in the great success of it and its various descendants (including Linux).

Unix systems are characterized by a modular design that is sometimes called the Unix philosophy. According to this philosophy, the operating system should provide a set of simple tools, each of which performs a limited, well-defined function. A unified filesystem (the Unix system) and an inter-process communication mechanism known as “pipes” serve as the main means of communication, and a shell scripting and command language (the Unix shell) is used to combine the tools to perform complex workflows.

In the book The Art of Unix Programming that was first published in 2003, Eric S. Raymond, an American programmer and open source advocate, summarizes the Unix philosophy as KISS Principle of “Keep it Simple, Stupid.” He provides a series of design rules:

  • Build modular programs
  • Write readable programs
  • Use composition
  • Separate mechanisms from policy
  • Write simple programs
  • Write small programs
  • Write transparent programs
  • Write robust programs
  • Make data complicated when required, not the program
  • Build on potential users’ expected knowledge
  • Avoid unnecessary output
  • Write programs which fail in a way that is easy to diagnose
  • Value developer time over machine time
  • Write abstract programs that generate code instead of writing code by hand
  • Prototype software before polishing it
  • Write flexible and open programs
  • Make the program and protocols extensible.

UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity. – Dennis Ritchie

In 1971, the Unix group at Bell Labs attempted to rewrite Unix in a high level programming language so that it would be easier for them to port Unix to other computer architectures. The B programming language was then created. It’s the work of Ken Thompson and Dennis Ritchie. The B programming language then became the precursor to the C language, the original version of which was completed by Dennis Ritchie in 1972.

In 1972, Thompson rewrote the Unix kernel in C with a minimal Assembly code. In subsequent years, Unix was carried out at the University of California at Berkeley.

Many variations were then developed and they are collectively referred to as Unix-like operating systems. Unix and Unix-like operating systems are considered as the best ever created in terms of stability, security, flexibility, scalability and elegance.

Introduction to Linux

In 1991, Linus Torvalds (founder of Linux) while studying at the University of Helsinki (in Finland) was not happy with the MS-DOS operating system. His attempt to retrieve a free licence for Unix failed since Unix was not free. After reading the Operating Systems: Design and Implementation book by Andy Tanenbaum, the book that launched him to new heights, he decided to write his own operating system Linux. Linux eventually became one of the largest open source projects in the world.

Linux actually is a kernel - a main component of the Linux operating system and is the interface that communicate users (while they use applications installed on the operating system) to the computer’s hardware, manage and leverage resources a efficiently as possible.

Linux

Those operating systems that base their code on the Linux kernel are called Linux distributions. There are more than 200 Linux distributions out there among them Red Hat, Ubuntu, Fedora, Debian, Kali Linux, … are most well-known. Their focus ranges from desktop (client) use to server use, target from beginner users to expert users.

Linux vs Unix

Linux is considered as a clone of Unix since it was developed to mimic Unix but none of it’s source code was copied from Unix source code.

Like Unix, Linux is a multiuser, multitasking, highly flexible, secure and robust operating system.

Unlike Unix, Linux is a free software. It was released by Linus Torvalds under GNU General Public License. Everyone is permitted to download Linux from the Internet at no cost and to use it for any desired purpose, make copies as many as desired and even redistribute it.

Software is like sex. It’s better when it’s free. – Linus Torvalds

Linux can run on a wide range of hardware, including handheld devices (including cell phones), game machines, desktop computers, workstations, mainframes, supercomputer, industry robots and even wristwatches.

Linux is used by individuals, corporations, governments, academic institutions and other organizations. Since Linux’s source code is open, everyone can monitor the code for security holes or customize it to suite their need.

People, especially who is studying to become computer professionals, are more and more interested in learning Linux. Having Linux skills is also desirable for many programmers.