UNIT 1

A Brief History of Linux

Unix is one of the most popular operating systems worldwide because of its large support base and distribution. It was originally developed as a multitasking system for minicomputers and mainframes in the mid-1970s. It has since grown to become one of the most widely used operating systems anywhere, despite its sometimes confusing interface and lack of central standardization. There is no single implementation of Unix. Originally developed by Bell Labs, Unix eventually forked into several versions, including a popular distribution from the University of California at Berkeley, called BSD. Over the years, many vendors have developed their own implementations of Unix, either from scratch or starting with another version. Linux was built from the ground up, although earlier versions included some code from BSD as well.

While Unix underwent a dip in market strength during the early 1990s, under the onslaught of the new Windows NT system, it came back strong and has become the mainstay of large computers.

Unix has quite a cult following in the operating systems community. Many hackers feel that Unix is the Right Thing — the One True Operating System. Hence, the development of Linux by an expanding group of Unix hackers who want to get their hands dirty with their own system. Moreover, Linux is not a "product" that ties you to a particular vendor or software developer. Because Linux is free, and all the source code is available (more on that later), anyone can modify the system to fit their own needs. Rather than waiting for some large company to release the latest features and service packs, the Linux user community is empowered to improve, adapt, and fix the system themselves. It's this empowerment that has helped Linux become so powerful.

Linux is a freely distributable version of Unix, originally developed by LinusTorvalds, who began work on Linux in 1991 as a student at the University of Helsinki in Finland. Linus now works for Transmeta Corporation, a company in Santa Clara, California, and continues to

maintain the Linux kernel, that is, the lowest-level core component of the operating system.

Linus released the initial version of Linux for free on the Internet, inadvertently spawning one of the largest software development phenomena of all time. Today, Linux is authored and maintained by thousands of developers loosely collaborating across the Internet. Companies have sprung up to provide Linux support, to package it into easy-to-install distributions, and to sell workstations preinstalled with the Linux software. In March 1999, the first Linux World Expo trade show was held in San Jose, California, with reportedly well over 12,000 people in attendance. These days, most estimates place the number of Linux users in the millions.

Inspired by Andrew Tanenbaum'sMinix operating system (one of the original Unix systems for PCs, intended for teaching operating system design), Linux began as a class project in which Linus wanted to build a simple Unix system that could run on a '386-based PC. The first discussions about Linux were on the Usenet newsgroup,comp.os.minix. These discussions were concerned mostly with the development of a small, academic Unix system for Minix users who wanted more.

The very early development of Linux dealt mostly with the task-switching features of the 80386 protected-mode interface, all written in assembly code. Linus writes:

After that it was plain sailing: hairy coding still, but I had some devices, and debugging was easier. I started using C at this stage, and it certainly speeds up development. This is also when I start to get serious about my megalomaniac ideas to make "a better Minix than Minix." I was hoping I'd be able to recompilegcc under Linux some day ...

Two months for basic setup, but then only slightly longer until I had a disk driver (seriously buggy, but it happened to work on my machine) and a small filesystem. That was about when I made 0.01 available [around late August of 1991]: it wasn't pretty, it had no floppy driver, and it couldn't do much anything. I don't think anybody ever compiled that version. But by then I was hooked, and didn't want to stop until I could chuck out Minix.

No announcement was ever made for Linux Version 0.01. The 0.01 release wasn't even executable: it contained only the bare rudiments of the kernel source and assumed that you had access to a Minix machine to compile and play with them.

On October 5, 1991, Linus announced the first "official" version of Linux, Version 0.02. At this point, Linus was able to run bash (the GNU Bourne Again Shell) andgcc (the GNU C compiler), but not much else was working. Again, this was intended as a hacker's system. The primary focus was kernel development; none of the issues of user support, documentation, distribution, and so on had even been addressed. Today, the situation is quite different — the real excitement in the Linux world deals with graphical user environments, easy-to-install distribution packages, and high-level applications such as graphics utilities and productivity suites.

Linus wrote incomp.os.minix :

Do you pine for the nice days of Minix-1.1, when men were men and wrote their own device drivers? Are you without a nice project and just dying to cut your teeth on an OS you can try to modify for your needs? Are you finding it frustrating when everything works on Minix? No more all-nighters to get a nifty program working? Then this post might be just for you.

As I mentioned a month ago, I'm working on a free version of a Minix- lookalike for AT-386 computers. It has finally reached the stage where it's even usable (though may not be depending on what you want), and I am willing to put out the sources for wider distribution. It's just version 0.02 ... but I've successfully run bash,gcc, GNU make, GNUsed, compress, etc. under it.

After Version 0.03, Linus bumped the version number up to 0.10, as more people started to work on the system. After several further revisions, Linus increased the version number to 0.95, to reflect his expectation that the system was ready for an "official" release very soon. (Generally, software is not assigned the version number 1.0 until it's theoretically complete or bug-free.) This was in March 1992. It wasn't until two years later, in March 1994, that Version 1.0 finally appeared. As of the time of this writing (September 2002), the current kernel version is 2.4.19, while the 2.5 kernel versions are being concurrently developed.

(We'll explain the Linux versioning conventions in detail later.)

Linux could not have come into being without the GNU tools created by the Free Software Foundation. The Free Software Foundation is a group formed in 1984 by Richard Stallman to promote the development of software that can be developed, redistributed, and modified by anyone — here, "free" refers to freedom, not just cost. Underlying the Free Software Foundation's philosophy is a deep-rooted moral conviction that all software should be free (again, in the sense of freedom); this philosophy is shared by many in the Linux community. This ideal is embodied in the GNU General Public License (or GPL), the copyright license under which Linux is released. We'll discuss this in more detail later in the chapter.

The GNU Project, which is the main result of the Free Software Foundation's efforts, has produced many invaluable tools and applications that Linux has depended upon, including the Emacs text editor,gcc compiler suite, and many others. GNU tools have been intertwined with the development of Linux from the beginning. Because of the critical contributions of the GNU Project, the Free Software Foundation even requests that distributions of Linux with accompanying utilities be called GNU/Linux.

Berkeley Unix (BSD) has also played an important role in Linux — not so much in its creation, but in providing the tools that make it popular. The so-called Berkeley Software Distribution was developed at the University of California, Berkeley in the late 1970s by a group of developers working from the original AT&T Unix sources. The BSD group made a number of enhancements to the core Unix design, and soon, BSD took on a life of its own. These days, many variants of the BSD system are available for a range of hardware platforms, and the BSD community rivals that of Linux in terms of popularity. The Mac OS X operating system is even based on a variant of BSD! Some of the networking utilities and daemons used by Linux are derived from original BSD sources.

Today, Linux is a full-featured, complete implementation of Unix, with a vast array of applications, programming languages, tools, and hardware support. Linux supports the X Window System GUI, TCP/IP networking, multiprocessor machines, advanced hardware and software for scientific and parallel computing, and much more. Nearly every major free software package has been ported to Linux, and a great deal of commercial software is available. In fact, many developers start by writing applications for Linux, and port them to other Unix systems later. More hardware is supported than in original versions of the kernel. Many people have executed benchmarks on Linux systems and found them to be faster than expensive workstations, and Linux performs better than or as well as Windows NT/2000/XP

on a wide range of benchmarks. Who would have ever guessed that his "little" Unix clone would have grown up to take on the entire world of personal and server computing?

Preparing to Install Linux

This chapter represents your first step in installing Linux. We'll describe how to obtain the Linux software, in the form of one of the various prepackaged distributions, and how to prepare your system. We'll include ways to partition disks so that Linux can coexist with Windows, or another operating system.

As we have mentioned, there is no single "official" distribution of the Linux software; there are, in fact, many distributions, each serving a particular purpose and set of goals. These distributions are available via anonymous FTP from the Internet and via mail on CD-ROM and DVD, as well as in retail stores.

2.1 Distributions of Linux

Because Linux is free software, no single organization or entity is responsible for releasing and distributing the software. Therefore, anyone is free to put together and distribute the Linux software, as long as the restrictions in the GPL are observed. The upshot of this is that there are many distributions of Linux, available via anonymous FTP or mail order.

You are now faced with the task of deciding on a particular distribution of Linux that suits your needs. Not all distributions are alike. Many of them come with just about all the software you'd need to run a complete system — and then some. Other Linux distributions are "small" distributions intended for users without copious amounts of disk space.

You might also want to consider that distributions have different target groups. Some are meant more for businesses, others more for the home user. Some put more emphasis on server use, others on desktop use.

The Linux Distribution HOWTO contains a list of Linux distributions available via the Internet as well as mail order.

How can you decide among all these distributions? If you have access to Usenet news, or another computer conferencing system, you might want to ask there for opinions from people who have installed Linux. Even better, if you know someone who has installed Linux, ask him for help and advice. In actuality, most of the popular Linux distributions contain roughly the same set of software, so the distribution you select is more or less arbitrary.

2.2 Preparing to Install Linux

After you have obtained a distribution of Linux, you're ready to prepare your system for installation. This takes a certain degree of planning, especially if you're already running other operating systems. In the following sections, we'll describe how to plan for the Linux installation.

2.2.1 Installation Overview

While each release of Linux is different, in general the method used to install the software is

as follows:

1. Repartition your hard drive(s). If you have other operating systems already installed,

you will need to repartition the drives in order to allocate space for Linux. This is discussed in Section 2.2.4 later in this chapter. In some distributions, this step is integrated into the installation procedure. Check the documentation of your distribution to see whether this is the case. Still, it won't hurt you to follow the steps given here and repartition your hard drive in advance.

2. Boot the Linux installation media. Each distribution of Linux has some kind of

installation media — usually a "boot floppy" or a bootable CD-ROM — that is used to install the software. Booting this media will either present you with some kind of installation program, which will step you through the Linux installation, or allow you to install the software by hand.

3. Create Linux partitions. After repartitioning to allocate space for Linux, you create Linux partitions on that empty space. This is accomplished with the Linuxfdiskprogram, covered in Section 3.1.3 in Chapter 3, or with some other distribution- specific program, such as the Disk Druid, that comes with Red Hat Linux.

4. Create filesystems and swap space. At this point, you will create one or more

filesystems, used to store files, on the newly created partitions. In addition, if you plan to use swap space (which you should, unless you have really huge amounts of physical memory, or RAM), you will create the swap space on one of your Linux partitions.

This is covered in the sections Section 3.1.4 and Section 3.1.3, both in Chapter 3.

5. Install the software on the new filesystems. Finally, you will install the Linux software on your newly created filesystems. After this, if all goes well, it's smooth sailing. This chapter 2. Preparing to Install Linux is covered in Section 3.1.6 in Chapter 3. Later, in Section 3.3, also in Chapter 3, we describe what to do if anything goes wrong.

People who want to switch back and forth between different operating systems sometimes wonder which to install first: Linux or the other system? We can testify that some people have had trouble installing Windows 95/98/ME after Linux. Windows 95/98/ME tends to wipe out existing boot information when it's installed, so you're safer installing it first and then installing Linux afterward using the information in this chapter. Windows NT/2000 seems to be more tolerant of existing boot information. We would assume that this is the same for Windows XP, being an evolution of Windows 2000, but we don't have any personal experiences (no pun intended) with this yet.

Many distributions of Linux provide an installation program that will step you through the installation process and automate one or more of the previous steps for you. Keep in mind throughout this chapter and the next that any number of the previous steps may be automated for you, depending on the distribution.

While preparing to install Linux, the best advice we can give is to take notes during the entire procedure. Write down everything you do, everything you type, and everything you see that might be out of the ordinary. The idea here is simple: if (or when!) you run into trouble, you want to be able to retrace your steps and find out what went wrong. Installing Linux isn't difficult, but there are many details to remember. You want to have a record of all these details so that you can experiment with other methods if something goes wrong. Also, keeping a notebook of your Linux installation experience is useful when you want to ask other people for help — for example, when posting a message to one of the Linux-related Usenet groups. Your notebook is also something you'll want to show to your grandchildren someday.2

2.2.2 Repartitioning Concepts

In general, hard drives are divided into partitions, with one or more partitions devoted to an operating system. For example, on one hard drive you may have several separate partitions — one devoted to, say, Windows, another to OS/2, and another two to Linux.

If you already have other software installed on your system, you may need to resize those partitions in order to free up space for Linux. You will then create one or more Linux partitions on the resulting free space for storing the Linux software and swap space. We call this process repartitioning.