home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-21 | 97.0 KB | 1,735 lines |
-
-
- Author's Note:
-
- This is version 2.2.2 of the book, "Linux Installation and Getting
- Started", formatted in plain ASCII for those readers without access
- to PostScript printers. This document was generated by a set of tools
- from LaTeX source, so there may be a number of formatting problems.
- This is not the "official" version of the book! Please see
- sunsite.unc.edu:/pub/Linux/docs/LDP/install-guide
- for PostScript, DVI, HTML, and other (nicely formatted) versions.
- If you have the ability to print the guide or view it on-line,
- I suggest you do so. This ASCII version is meant only for previewing
- purposes.
-
- This book may be freely distributed under certain conditions, and
- you can order a printed and bound copy from a number of publishers.
- The README file at the FTP site given above gives all the details.
-
- -- M. Welsh
-
-
-
-
-
-
-
-
-
-
-
-
-
- Linux Installation and Getting Started
- _______________________________________________________________________
- Copyright (c) 1992--1994 Matt Welsh
-
-
-
-
-
-
- Version 2.2.2, 11 February 1995.
-
- This book is an installation and new-user guide for the
- Linux system, meant for UNIX novices and gurus alike. Contained
- herein is information on how to obtain Linux, installation of the
- software, a beginning tutorial for new UNIX users, and an introduction
- to system administration. It is meant to be general enough to be
- applicable to any distribution of the Linux software.
-
- This book is freely distributable; you may copy and redistribute it
- under certain conditions. Please see the copyright and distribution
- statement on page x.
-
-
-
-
-
-
-
-
-
- Contents
-
-
-
-
- Preface vi
- Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi
- Organization . . . . . . . . . . . . . . . . . . . . . . . . . . vii
- Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . vii
- Credits and Legalese . . . . . . . . . . . . . . . . . . . . . . viii
- Documentation Conventions . . . . . . . . . . . . . . . . . . . . xi
- 1 Introduction to Linux 1
- 1.1 About This Book . . . . . . . . . . . . . . . . . . . . . . . 1
- 1.2 A Brief History of Linux . . . . . . . . . . . . . . . . . . 3
- 1.3 System Features . . . . . . . . . . . . . . . . . . . . . . . 5
- 1.4 Software Features . . . . . . . . . . . . . . . . . . . . . . 6
- 1.4.1 Basic commands and utilities . . . . . . . . . . . . . . 7
- 1.4.2 Text processing and word processing . . . . . . . . . . . 8
- 1.4.3 Programming languages and utilities . . . . . . . . . . . 11
- 1.4.4 The X Window System . . . . . . . . . . . . . . . . . . . 12
- 1.4.5 Networking . . . . . . . . . . . . . . . . . . . . . . . 14
- 1.4.6 Telecommunications and BBS software . . . . . . . . . . . 15
- 1.4.7 Interfacing with MS-DOS . . . . . . . . . . . . . . . . . 16
- 1.4.8 Other applications . . . . . . . . . . . . . . . . . . . 16
- 1.5 About Linux's Copyright . . . . . . . . . . . . . . . . . . . 18
- 1.6 The Design and Philosophy of Linux . . . . . . . . . . . . . 19
- 1.6.1 Hints for UNIX novices . . . . . . . . . . . . . . . . . 22
- 1.6.2 Hints for UNIX gurus . . . . . . . . . . . . . . . . . . 22
- 1.7 Differences Between Linux and Other Operating Systems . . . . 23
- 1.7.1 Why use Linux? . . . . . . . . . . . . . . . . . . . . . 23
- 1.7.2 Linux vs. MS-DOS . . . . . . . . . . . . . . . . . . . . 24
- 1.7.3 Linux vs. The Other Guys . . . . . . . . . . . . . . . . 25
- 1.7.4 Other implementations of UNIX . . . . . . . . . . . . . . 25
- 1.8 Hardware Requirements . . . . . . . . . . . . . . . . . . . . 27
- 1.8.1 Motherboard and CPU requirements . . . . . . . . . . . . 28
- 1.8.2 Memory requirements . . . . . . . . . . . . . . . . . . . 28
- 1.8.3 Hard drive controller requirements . . . . . . . . . . . 29
- 1.8.4 Hard drive space requirements . . . . . . . . . . . . . . 29
- 1.8.5 Monitor and video adapator requirements . . . . . . . . . 30
- 1.8.6 Miscellaneous hardware . . . . . . . . . . . . . . . . . 30
- 1.8.7 Ethernet cards . . . . . . . . . . . . . . . . . . . . . 31
- 1.9 Sources of Linux Information . . . . . . . . . . . . . . . . 32
- 1.9.1 Online documents . . . . . . . . . . . . . . . . . . . . 32
-
-
- i
-
-
- 1.9.2 Linux on the World Wide Web . . . . . . . . . . . . . . . 33
- 1.9.3 Books and other published works . . . . . . . . . . . . . 33
- 1.9.4 USENET newsgroups . . . . . . . . . . . . . . . . . . . . 34
- 1.9.5 Internet mailing lists . . . . . . . . . . . . . . . . . 36
- 1.10 Getting Help . . . . . . . . . . . . . . . . . . . . . . . . 37
-
- 2 Obtaining and Installing Linux 40
- 2.1 Distributions of Linux . . . . . . . . . . . . . . . . . . . 40
- 2.1.1 Getting Linux from the Internet . . . . . . . . . . . . . 41
- 2.1.2 Getting Linux from other online sources . . . . . . . . . 42
- 2.1.3 Getting Linux via mail order . . . . . . . . . . . . . . 42
- 2.1.4 Getting Slackware . . . . . . . . . . . . . . . . . . . . 43
- 2.2 Preparing to Install Linux . . . . . . . . . . . . . . . . . 50
- 2.2.1 Installation overview . . . . . . . . . . . . . . . . . . 50
- 2.2.2 Repartitioning concepts . . . . . . . . . . . . . . . . . 52
- 2.2.3 Linux partition requirements . . . . . . . . . . . . . . 52
- 2.2.4 Repartitioning your drives . . . . . . . . . . . . . . . 54
- 2.3 Installing the Linux software . . . . . . . . . . . . . . . . 56
- 2.3.1 Booting Linux . . . . . . . . . . . . . . . . . . . . . . 56
- 2.3.2 Drives and partitions under Linux . . . . . . . . . . . . 58
- 2.3.3 Creating Linux partitions . . . . . . . . . . . . . . . . 60
- 2.3.4 Creating the swap space . . . . . . . . . . . . . . . . . 63
- 2.3.5 Creating the filesystems . . . . . . . . . . . . . . . . 64
- 2.3.6 Installing the software . . . . . . . . . . . . . . . . . 65
- 2.3.7 Creating the boot floppy or installing LILO . . . . . . . 69
- 2.3.8 Additional installation procedures . . . . . . . . . . . 70
- 2.4 Postinstallation procedures . . . . . . . . . . . . . . . . . 70
- 2.5 Running Into Trouble . . . . . . . . . . . . . . . . . . . . 71
- 2.5.1 Problems with booting the installation media . . . . . . 72
- 2.5.2 Hardware problems . . . . . . . . . . . . . . . . . . . . 74
- 2.5.3 Problems installing the software . . . . . . . . . . . . 79
- 2.5.4 Problems after installing Linux . . . . . . . . . . . . . 81
- 3 Linux Tutorial 85
- 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . 85
- 3.2 Basic UNIX Concepts . . . . . . . . . . . . . . . . . . . . . 86
- 3.2.1 Creating an account . . . . . . . . . . . . . . . . . . . 86
- 3.2.2 Logging in . . . . . . . . . . . . . . . . . . . . . . . 86
- 3.2.3 Virtual consoles . . . . . . . . . . . . . . . . . . . . 87
- 3.2.4 Shells and commands . . . . . . . . . . . . . . . . . . . 87
- 3.2.5 Logging out . . . . . . . . . . . . . . . . . . . . . . . 89
- 3.2.6 Changing your password . . . . . . . . . . . . . . . . . 89
- 3.2.7 Files and directories . . . . . . . . . . . . . . . . . . 89
- 3.2.8 The directory tree . . . . . . . . . . . . . . . . . . . 90
- 3.2.9 The current working directory . . . . . . . . . . . . . . 90
- 3.2.1 0Referring to home directories . . . . . . . . . . . . . 92
- 3.3 First Steps into UNIX . . . . . . . . . . . . . . . . . . . . 92
- 3.3.1 Moving around . . . . . . . . . . . . . . . . . . . . . . 92
- 3.3.2 Looking at the contents of directories . . . . . . . . . 93
- 3.3.3 Creating new directories . . . . . . . . . . . . . . . . 95
- 3.3.4 Copying files . . . . . . . . . . . . . . . . . . . . . . 96
-
-
- 3.3.5 Moving files . . . . . . . . . . . . . . . . . . . . . . 96
- 3.3.6 Deleting files and directories . . . . . . . . . . . . . 96
- 3.3.7 Looking at files . . . . . . . . . . . . . . . . . . . . 97
- 3.3.8 Getting online help . . . . . . . . . . . . . . . . . . . 97
- 3.4 Summary of Basic Commands . . . . . . . . . . . . . . . . . . 98
- 3.5 Exploring the File System . . . . . . . . . . . . . . . . . 100
- 3.6 Types of shells . . . . . . . . . . . . . . . . . . . . . . 105
- 3.7 Wildcards . . . . . . . . . . . . . . . . . . . . . . . . . 106
- 3.8 UNIX Plumbing . . . . . . . . . . . . . . . . . . . . . . . 108
- 3.8.1 Standard input and output . . . . . . . . . . . . . . . 108
- 3.8.2 Redirecting input and output . . . . . . . . . . . . . . 109
- 3.8.3 Using pipes . . . . . . . . . . . . . . . . . . . . . . 110
- 3.8.4 Non-destructive redirection . . . . . . . . . . . . . . 112
- 3.9 File Permissions . . . . . . . . . . . . . . . . . . . . . . 112
- 3.9.1 Concepts of file permissions . . . . . . . . . . . . . . 112
- 3.9.2 Interpreting file permissions . . . . . . . . . . . . . 113
- 3.9.3 Dependencies . . . . . . . . . . . . . . . . . . . . . . 114
- 3.9.4 Changing permissions . . . . . . . . . . . . . . . . . . 115
- 3.10 Managing file links . . . . . . . . . . . . . . . . . . . . 115
- 3.10.1 Hard links . . . . . . . . . . . . . . . . . . . . . . 115
- 3.10.2 Symbolic links . . . . . . . . . . . . . . . . . . . . 117
- 3.11 Job Control . . . . . . . . . . . . . . . . . . . . . . . . 117
- 3.11.1 Jobs and processes . . . . . . . . . . . . . . . . . . 117
- 3.11.2 Foreground and background . . . . . . . . . . . . . . . 118
- 3.11.3 Backgrounding and killing jobs . . . . . . . . . . . . 119
- 3.11.4 Stopping and restarting jobs . . . . . . . . . . . . . 121
- 3.12 Using the vi Editor . . . . . . . . . . . . . . . . . . . . 123
- 3.12.1 Concepts . . . . . . . . . . . . . . . . . . . . . . . 124
- 3.12.2 Starting vi . . . . . . . . . . . . . . . . . . . . . . 124
- 3.12.3 Inserting text . . . . . . . . . . . . . . . . . . . . 125
- 3.12.4 Deleting text . . . . . . . . . . . . . . . . . . . . . 126
- 3.12.5 Changing text . . . . . . . . . . . . . . . . . . . . . 127
- 3.12.6 Moving commands . . . . . . . . . . . . . . . . . . . . 128
- 3.12.7 Saving files and quitting vi . . . . . . . . . . . . . 128
- 3.12.8 Editing another file . . . . . . . . . . . . . . . . . 129
- 3.12.9 Including other files . . . . . . . . . . . . . . . . . 129
- 3.12.10 Running shell commands . . . . . . . . . . . . . . . . 130
- 3.12.11 Getting help . . . . . . . . . . . . . . . . . . . . . 130
- 3.13Customizing your Environment . . . . . . . . . . . . . . . . 130
- 3.13.1 Shell scripts . . . . . . . . . . . . . . . . . . . . . 131
- 3.13.2 Shell variables and the environment . . . . . . . . . . 132
- 3.13.3 Shell initialization scripts . . . . . . . . . . . . . 135
- 3.14 So You Want to Strike Out on Your Own? . . . . . . . . . . 135
-
- 4 System Administration 137
- 4.1 About Root, Hats, and the Feeling of Power . . . . . . . . 137
- 4.1.1 The root account . . . . . . . . . . . . . . . . . . . . 137
- 4.1.2 Abusing the system . . . . . . . . . . . . . . . . . . . 139
- 4.1.3 Dealing with users . . . . . . . . . . . . . . . . . . . 139
- 4.1.4 Setting the rules . . . . . . . . . . . . . . . . . . . 140
- 4.1.5 What it all means . . . . . . . . . . . . . . . . . . . 140
-
-
- 4.2 Booting the System . . . . . . . . . . . . . . . . . . . . 141
- 4.2.1 Using a boot floppy . . . . . . . . . . . . . . . . . . 141
- 4.2.2 Using LILO . . . . . . . . . . . . . . . . . . . . . . . 142
- 4.3 Shutting Down . . . . . . . . . . . . . . . . . . . . . . . 143
- 4.4 Managing Users . . . . . . . . . . . . . . . . . . . . . . . 144
- 4.4.1 User management concepts . . . . . . . . . . . . . . . . 144
- 4.4.2 Adding users . . . . . . . . . . . . . . . . . . . . . . 146
- 4.4.3 Deleting users . . . . . . . . . . . . . . . . . . . . . 146
- 4.4.4 Setting user attributes . . . . . . . . . . . . . . . . 146
- 4.4.5 Groups . . . . . . . . . . . . . . . . . . . . . . . . . 147
- 4.5 Archiving and Compressing Files . . . . . . . . . . . . . . 147
- 4.5.1 Using tar . . . . . . . . . . . . . . . . . . . . . . . 148
- 4.5.2 gzip and compress . . . . . . . . . . . . . . . . . . . 149
- 4.5.3 Putting them together . . . . . . . . . . . . . . . . . 149
- 4.6 Using Floppies and Making Backups . . . . . . . . . . . . . 151
- 4.6.1 Using floppies for backups . . . . . . . . . . . . . . . 151
- 4.6.2 Using floppies as filesystems . . . . . . . . . . . . . 151
- 4.7 Upgrading and Installing New Software . . . . . . . . . . . 152
- 4.7.1 Upgrading the kernel . . . . . . . . . . . . . . . . . . 153
- 4.7.2 Upgrading the libraries . . . . . . . . . . . . . . . . 154
- 4.7.3 Upgrading gcc . . . . . . . . . . . . . . . . . . . . . 155
- 4.7.4 Upgrading other software . . . . . . . . . . . . . . . . 156
- 4.8 Managing Filesystems . . . . . . . . . . . . . . . . . . . . 156
- 4.8.1 Mounting filesystems . . . . . . . . . . . . . . . . . . 156
- 4.8.2 Checking filesystems . . . . . . . . . . . . . . . . . . 158
- 4.9 Using a swap file . . . . . . . . . . . . . . . . . . . . . 159
- 4.10 Miscellaneous Tasks . . . . . . . . . . . . . . . . . . . . 160
- 4.10.1 System startup files . . . . . . . . . . . . . . . . . 160
- 4.10.2 Setting the hostname . . . . . . . . . . . . . . . . . 161
- 4.11 What To Do In An Emergency . . . . . . . . . . . . . . . . 162
- 4.11.1 Recovering using a maintenance diskette . . . . . . . . 162
- 4.11.2 Fixing the root password . . . . . . . . . . . . . . . 163
- 4.11.3 Fixing trashed filesystems . . . . . . . . . . . . . . 163
- 4.11.4 Recovering lost files . . . . . . . . . . . . . . . . . 164
- 4.11.5 Fixing trashed libraries . . . . . . . . . . . . . . . 164
-
- 5 Advanced Features 165
- 5.1 The X Window System . . . . . . . . . . . . . . . . . . . . 165
- 5.1.1 Hardware requirements . . . . . . . . . . . . . . . . . 166
- 5.1.2 Installing XFree86 . . . . . . . . . . . . . . . . . . . 168
- 5.1.3 Configuring XFree86 . . . . . . . . . . . . . . . . . . 170
- 5.1.4 Filling in video card information . . . . . . . . . . . 178
- 5.1.5 Running XFree86 . . . . . . . . . . . . . . . . . . . . 182
- 5.1.6 Running into trouble . . . . . . . . . . . . . . . . . . 183
- 5.2 Accessing MS-DOS Files . . . . . . . . . . . . . . . . . . . 184
- 5.3 Networking with TCP/IP . . . . . . . . . . . . . . . . . . . 185
- 5.3.1 Hardware Requirements . . . . . . . . . . . . . . . . . 186
- 5.3.2 Configuring TCP/IP on your system . . . . . . . . . . . 186
- 5.3.3 SLIP Configuration . . . . . . . . . . . . . . . . . . . 194
- 5.3.4 Using dip . . . . . . . . . . . . . . . . . . . . . . . 197
- 5.4 Networking with UUCP . . . . . . . . . . . . . . . . . . . . 199
- v
- _______________________________________________________________________
-
- 5.5 Electronic Mail . . . . . . . . . . . . . . . . . . . . . . 200
- 5.6 News and USENET . . . . . . . . . . . . . . . . . . . . . . 200
-
- A Sources of Linux Information 203
- A.1 Online Documents . . . . . . . . . . . . . . . . . . . . . . 203
- A.2 Linux Documentation Project Manuals . . . . . . . . . . . . 205
- A.3 Books and Other Published Works . . . . . . . . . . . . . . 206
- A.3.1 Using UNIX . . . . . . . . . . . . . . . . . . . . . . . 207
- A.3.2 Systems Administration . . . . . . . . . . . . . . . . . 207
- A.3.3 The X Window System . . . . . . . . . . . . . . . . . . 208
- A.3.4 Programming . . . . . . . . . . . . . . . . . . . . . . 208
- A.3.5 Kernel Hacking . . . . . . . . . . . . . . . . . . . . . 209
- B Linux Vendor List 211
-
- C FTP Tutorial and Site List 214
- C.1 Starting ftp . . . . . . . . . . . . . . . . . . . . . . . . 214
- C.2 Logging In . . . . . . . . . . . . . . . . . . . . . . . . . 215
- C.3 Poking Around . . . . . . . . . . . . . . . . . . . . . . . 215
- C.4 Downloading files . . . . . . . . . . . . . . . . . . . . . 217
- C.5 Quitting FTP . . . . . . . . . . . . . . . . . . . . . . . 219
- C.6 Using ftpmail . . . . . . . . . . . . . . . . . . . . . . . 220
- C.7 Linux FTP Site List . . . . . . . . . . . . . . . . . . . . 220
- D Linux BBS List 222
- D.1 United States . . . . . . . . . . . . . . . . . . . . . . . 222
- D.2 Outside of the United States . . . . . . . . . . . . . . . . 224
-
- E The GNU General Public License 227
- E.1 Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . 227
- E.2 Terms and Conditions for Copying, Distribution, and
- Modification . . . . . . . . . . . . . . . . . . . . . . . . 228
- E.3 Appendix: How to Apply These Terms to Your New Programs . . 233
-
-
-
-
-
-
-
-
-
- Preface
-
-
-
- ``You are in a maze of twisty little passages, all alike.''
- Before you looms one of the most complex and utterly intimidating
- systems ever written. Linux, the free UNIX clone for the personal
- computer, produced by a mishmash team of UNIX gurus, hackers, and the
- occasional loon. The system itself reflects this complex heritage,
- and although the development of Linux may appear to be a disorganized
- volunteer effort, the system is powerful, fast, and free. It is a
- true 32-bit operating system solution.
- My own experiences with Linux began several years ago, when I
- sat down to figure out how to install the only ``distribution''
- available at the time---a couple of diskettes made available by H.J.
- Lu. I downloaded a slew of files and read pages upon pages of
- loosely-organized installation notes. Somehow, I managed to install
- this basic system and get everything working together. This was
- long before you could buy the Linux software on CD-ROM from worldwide
- distributors; before, in fact, Linux even knew how to access a CD-ROM
- drive. This was before XFree86, before Emacs, before commercial
- software support, and before Linux became a true rival to MS-DOS,
- Microsoft Windows, and OS/2 in the personal computer market.
- You hold in your very hands the map and guidebook to the world of
- Linux. It is my hope that this book will help you to get rolling with
- what I consider to be the fastest, most powerful operating system for
- the personal computer. Setting up your own Linux system can be a
- great deal of fun---so grab a cup of coffee, sit back, and read on.
- Grab a cup for me, too, while you're at it. I've been up hacking
- Linux for days.
-
-
- Audience
-
- This book is for any personal computer user who wants to install and
- use Linux on their system. We assume that you have basic knowledge
- about personal computers and operating systems such as MS-DOS. No
- previous knowledge about Linux or UNIX is assumed.
- Despite this, we strongly suggest that UNIX novices invest in one
- of the many good UNIX books out there. Several of them are listed in
- Appendix A.
-
-
-
-
- vi
- vii
- _______________________________________________________________________
-
- Organization
-
- This book contains the following chapters.
- Chapter 1, Introduction to Linux, gives a general introduction to
- what Linux is, what it can do for you, and what is required to run it
- on your system. It also provides helpful hints for getting help and
- reducing overall stress.
- Chapter 2, Obtaining and Installing Linux, explains how to obtain
- the Linux software, as well as how to install it---from repartitioning
- your drive, creating filesystems, and loading the software on the
- system. It contains instructions meant to be general for any
- distribution of Linux, and relies on the documentation provided for
- your particular release to fill in any gaps.
- Chapter 3, Linux Tutorial, is a complete introduction to using the
- Linux system for UNIX novices. If you have previous UNIX experience,
- most of this material should be familiar.
- Chapter 4, System Administration, introduces many of the important
- concepts of system administration under Linux. This will also be
- of interest to UNIX system administrators who want to know about the
- Linux-specific issues of running a system.
- Chapter 5, Advanced Features, introduces the reader to a number of
- advanced features supported by Linux, such as the X Window System and
- TCP/IP networking. A complete guide to configuring XFree86-3.1 is
- included.
- Appendix A, Sources of Linux Information, is a listing of other
- sources of information about Linux, including newsgroups, mailing
- lists, online documents, and books.
- Appendix B, Linux Vendor List, provides a short list of software
- vendors offering Linux software and services.
- Appendix C, FTP Tutorial and Site List, is a tutorial for
- downloading files from the Internet with FTP. This appendix also
- includes a listing of FTP archive sites which carry Linux software.
- Appendix D, Linux BBS List, is a listing of bulletin board systems
- worldwide which carry Linux software. Because most Linux users are do
- not have access to the Internet, it is important that information on
- BBS systems becomes available.
- Appendix E, The GNU General Public License, contains a copy of
- the GNU GPL, the license agreement under which Linux is distributed.
- It is very important that Linux users understand the GPL; many
- disagreements over the terms of the GPL have been raised in recent
- months.
-
-
- Acknowledgments
-
- This book has been long in the making, and many people are responsible
- for the outcome. In particular, I would like to thank Larry
- Greenfield and Karl Fogel for their work on the first version of
- Chapter 3, and to Lars Wirzenius for his work on Chapter 4. Thanks
- to Michael K. Johnson for his assistance with the LDP and the LaTeX
- viii
- _______________________________________________________________________
-
- conventions used in this manual, and to Ed Chi, who sent me a printed
- copy of the book for edition.
- Thanks to Melinda A. McBride at SSC, Inc., who did an excellent job
- completing the index for Chapters 3, 4, and 5. I would also like to
- thank Andy Oram, Lar Kaufman, and Bill Hahn at O'Reilly and Associates
- for their assistance with the Linux Documentation Project.
- Thanks to Linux Systems Labs, Morse Telecommunications, Yggdrasil
- Computing, and others for their support of the Linux Documentation
- Project through sales of this book and other works.
- Much thanks to the many activists, including (in no particular
- order) Linus Torvalds, Donald Becker, Alan Cox, Remy Card, Ted T'so,
- H.J. Lu, Ross Biro, Drew Eckhardt, Ed Carp, Eric Youngdale, Fred van
- Kempen, Steven Tweedie, and a score of others, for devoting so much
- time and energy to this project, and without whom there wouldn't be
- anything to write a book about.
- Special thanks to the myriad of readers who have sent their helpful
- comments and corrections. There are far too many to list here. Who
- needs a spell checker, when you have an audience?
-
- Matt Welsh
- 13 January 1994
-
-
- Credits and Legalese
-
- The Linux Documentation Project is a loose team of writers,
- proofreaders, and editors who are working on a set of definitive Linux
- manuals. The overall coordinator of the project is Matt Welsh, aided
- by Lars Wirzenius and Michael K. Johnson.
- This manual is but one in a set of several being distributed
- by the Linux Documentation Project, including a Linux User's Guide,
- System Administrator's Guide, and Kernel Hacker's Guide. These
- manuals are all available in LaTeX source format and Postscript
- output for anonymous FTP from sunsite.unc.edu, in the directory
- /pub/Linux/docs/LDP.
- We encourage anyone with a penchant for writing or editing to join
- us in improving Linux documentation. If you have Internet e-mail
- access, you can join the DOC channel of the Linux-Activists mailing
- list by sending mail to
-
- linux-activists-request@niksula.hut.fi
-
- with the line
-
- X-Mn-Admin: join DOC
-
- as the first line of the message body.
- Feel free to get in touch with the author and coordinator of this
- manual if you have questions, postcards, money, or ideas. Matt Welsh
- can be reached via Internet e-mail at mdw@sunsite.unc.edu, and in real
- ix
- _______________________________________________________________________
-
- life at
-
- 205 Gray Street
- Wilson, N.C. 27896
- U.S.A.
- x
- _______________________________________________________________________
-
- UNIX is a trademark of X/Open.
- Linux is not a trademark, and has no connection to UNIXTM or X/Open.
- The X Window System is a trademark of the Massachusetts Institute of
- Technology.
- MS-DOS and Microsoft Windows are trademarks of Microsoft, Inc.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Copyright cO1992--1994 Matt Welsh
- 205 Gray Street NE, Wilson NC, 27893 USA
- mdw@sunsite.unc.edu
-
- Linux Installation and Getting Started may be reproduced and
- distributed, in whole or in part, subject to the following conditions:
-
- 0. The copyright notice above and this permission notice must be
- preserved complete on all complete or partial copies.
-
- 1. Any translation or derivative work of Linux Installation and
- Getting Started must be approved by the author in writing before
- distribution.
-
- 2. If you distribute Linux Installation and Getting Started in part,
- instructions for obtaining the complete version of this manual
- must be included, and a means for obtaining a complete version
- provided.
-
- 3. Small portions may be reproduced as illustrations for reviews or
- quotes in other works without this permission notice if proper
- citation is given.
-
- 4. The GNU General Public License referenced below may be reproduced
- under the conditions given within it.
-
- 5. Several sections of this document are held under separate
- copyright. When these sections are covered by a different
- copyright, the separate copyright is noted. If you distribute
- Linux Installation and Getting Started in part, and that part
- is, in whole, covered under a separate, noted copyright, the
- conditions of that copyright apply.
- xi
- _______________________________________________________________________
-
- Exceptions to these rules may be granted for academic
- purposes: Write to Matt Welsh, at the above address, or email
- mdw@sunsite.unc.edu, and ask. These restrictions are here to protect
- us as authors, not to restrict you as educators and learners.
- The author encourages distributors of Linux software in any medium
- to use the book as an installation and new user guide. Given the
- copyright above, you are free to print and distribute copies of this
- book with your software. You may either distribute this book free of
- charge, or for profit. If doing so, you may wish to include a short
- ``installation supplement'' for your release.
- The author would like to know of any plans to publish and
- distribute this book commercially. In this way, we can ensure that
- you are kept up-to-date with new revisions. And, should a new version
- be right around the corner, you might wish to delay your publication
- of the book until it is available.
- If you are distributing this book commercially, donations,
- royalties, and/or printed copies are greatly appreciated by the
- author. Contributing in this way shows your support for free software
- and the Linux Documentation Project.
-
- All source code in Linux Installation and Getting Started is placed
- under the GNU General Public License. See Appendix E for a copy of
- the GNU ``GPL.''
-
-
- Documentation Conventions
-
- These conventions should be obvious, but we'll include them here for
- the pedantic.
-
- Bold Used to mark new concepts, WARNINGS, and keywords in a
- language.
-
- italics Used for emphasis in text, and occasionally for quotes or
- introductions at the beginning of a section. Also used to
- indicate commands for the user to type when showing screen
- interaction (see below).
- <slanted> Used to mark meta-variables in the text, especially in
- representations of the command line. For example,
-
-
- ls -l <foo>
-
- where <foo> would ``stand for'' a filename, such as
- /bin/cp.
-
- Typewriter Used to represent screen interaction, as in
-
-
- $ ls --l /bin/cp
- -rwxr-xr-
- xii
- _______________________________________________________________________
-
- x 1 root wheel 12104 Sep 25 15:53 /bin/cp
-
-
- Also used for code examples, whether it is C code, a shell
- script, or something else, and to display general files,
- such as configuration files. When necessary for clarity's
- sake, these examples or figures will be enclosed in thin
- boxes.
- [Key] Represents a key to press. You will often see it in this
- form:
-
-
- Press [return] to continue.
-
- ! A diamond in the margin, like a black diamond on a ski
- hill, marks ``danger'' or ``caution.'' Read paragraphs
- marked this way carefully.
-
-
-
-
-
-
-
-
- Chapter 1
-
-
-
-
- Introduction to Linux
-
-
-
- Linux is quite possibly the most important achievement of free
- software since the original Space War, or, more recently, Emacs. It
- has developed into the operating system for businesses, education, and
- personal productivity. Linux is no longer just for UNIX wizards who
- sit for hours in front of the glowing console (although we assure you
- that quite a number of users fall into this category). This book will
- help you get the most out of it.
- Linux (pronounced with a short i, as in LIH-nucks) is a clone
- of the UNIX operating system that runs on Intel 80386 and 80486
- computers. It supports a wide range of software, from TeX to
- X Windows to the GNU C/C++ compiler to TCP/IP. It's a versatile, bona
- fide implementation of UNIX, freely distributed by the terms of the
- GNU General Public License (see Appendix E).
- Linux can turn any 386 or 486 PC into a workstation. It will
- give you the full power of UNIX at your fingertips. Businesses are
- installing Linux on entire networks of machines, using the operating
- system to manage financial and hospital records, a distributed user
- computing environment, telecommunications, and more. Universities
- worldwide are using Linux for teaching courses on operating systems
- programming and design. And, of course, computing enthusiasts
- everywhere are using Linux at home, for programming, productivity, and
- all-around hacking.
- What makes Linux so different is that it is a free implementation
- of UNIX. It was and still is developed by a group of volunteers,
- primarily on the Internet, exchanging code, reporting bugs, and fixing
- problems in an open-ended environment. Anyone is welcome to join in
- the Linux development effort: all it takes is interest in hacking a
- free UNIX clone and some kind of programming know-how. The book that
- you hold in your hands is your tour guide.
-
- 1.1 About This Book
-
- This book is an installation and entry-level guide to the Linux
- system. The purpose is to get new users up and running with the
- system by consolodating as much important material as possible into
-
-
- 1
- 1.1. About This Book 2
- _______________________________________________________________________
-
- one book. Instead of covering many of the volatile technical details,
- those things which tend to change with rapid development, we give you
- enough background to find out more on your own.
- Linux is not difficult to install and use. However, as with any
- implementation of UNIX, there is often some black magic involved to
- get everything working correctly. We hope that this book will get you
- on the Linux tourbus and show you how groovy this operating system can
- be.
- In this book, we cover the following topics.
-
- o What is Linux? The design and philosophy of this unique operating
- system, and what it can do for you.
-
- o All of the details of what is needed to run Linux, including
- suggestions on what kind of hardware configuration is recommended
- for a complete system.
-
- o How to obtain and install Linux. There are many distributions
- of the Linux software. We present a general discussion
- of Linux software distributions, how to obtain them, and
- generic instructions for installing the software (which should be
- applicable to any distribution).
-
- This edition also contains specific instructions for the Slackware
- distribution of Linux.
-
- o A brief introductory UNIX tutorial, for those users who have never
- had experience with UNIX before. This tutorial should, hopefully,
- provide enough material for complete novices to have enough basic
- know-how to find their way around the system.
-
- o An introduction to systems administration with Linux. This covers
- the most important tasks that new Linux administrators will need
- to be familiar with, such as creating users, managing filesystems,
- and so forth.
-
- o Information on configuring more advanced aspects of Linux, such
- as the X Window System, networking with TCP/IP and SLIP, and the
- setup of electronic mail and news systems.
-
- This book is for the personal computer user wishing to get started
- with Linux. We don't assume previous UNIX experience, but do expect
- novices to refer to other materials along the way. For those
- unfamiliar with UNIX, a list of useful sources of information is given
- in Appendix A. In general, this book is meant to be read along with
- another book on basic UNIX concepts.
- 1.2. A Brief History of Linux 3
- _______________________________________________________________________
-
- 1.2 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-1970's, but has since grown to become one of the most widely used
- operating systems anywhere, despite its sometimes confusing interface
- and lack of central standardization.
- The real reason for UNIX's popularity? 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.
- Versions of UNIX exist for many systems---ranging from personal
- computers to supercomputers such as the Cray Y-MP. Most versions of
- UNIX for personal computers are quite expensive and cumbersome. At
- the time of this writing, a one-machine version of AT&T's System V for
- the 386 runs at about US$1500.
- Linux is a freely distributable version of UNIX developed primarily
- by Linus Torvalds (1) at the University of Helsinki in Finland. Linux
- was developed with the help of many UNIX programmers and wizards
- across the Internet, allowing anyone with enough know-how and gumption
- the ability to develop and change the system. The Linux kernel
- uses no code from AT&T or any other proprietary source, and much of
- the software available for Linux is developed by the GNU project at
- the Free Software Foundation in Cambridge, Massachusetts. However,
- programmers all over the world have contributed to the growing pool of
- Linux software.
- Linux was originally developed as a hobby project by Linus
- Torvalds. It was inspired by Minix, a small UNIX system developed
- by Andy Tanenbaum, and 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 was mostly dealing 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 developement.
- 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 recompile gcc 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]:
-
- ----------------------------
- 1. torvalds@kruuna.helsinki.fi.
- 1.2. A Brief History of Linux 4
- _______________________________________________________________________
-
- 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 sources weren't even executable: they 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 5 October 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) and gcc (the GNU C compiler), but not
- very 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 Linux community still seems to treat these
- ergonomic issues as secondary to the ``real programming''---kernel
- development.
- Linus wrote in comp.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 a 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 is just
- version 0.02...but I've successfully run bash, gcc, gnu-make,
- gnu-sed, 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 is theoretically complete or bug-free.) This was in
- March of 1992. Almost a year and a half later, in late December of
- 1993, the Linux kernel was still at version 0.99.pl14---asymptotically
- approaching 1.0. As of the time of this writing, the current kernel
- version is 1.1 patchlevel 52, and 1.2 is right around the corner.
- Today, Linux is a complete UNIX clone, capable of running
- X Windows, TCP/IP, Emacs, UUCP, mail and news software, you name
- it. Almost all of the major free software packages have been ported
- to Linux, and commercial software is becoming available. Much more
- hardware is supported than in original versions of the kernel. Many
- people have executed benchmarks on 80486 Linux systems and found
- 1.3. System Features 5
- _______________________________________________________________________
-
- them comparable with mid-range workstations from Sun Microsystems and
- Digital Equipment Corporation. Who would have ever guessed that this
- ``little'' UNIX clone would have grown up to take on the entire world
- of personal computing?
-
-
- 1.3 System Features
-
- Linux supports most of the features found in other implementations of
- UNIX, plus quite a few that aren't found elsewhere. This section is a
- nickel tour of the Linux kernel features.
- Linux is a complete multitasking, multiuser operating system (just
- like all other versions of UNIX). This means that many users can
- be logged into the same machine at once, running multiple programs
- simultaneously.
- The Linux system is mostly compatible with a number of UNIX
- standards (inasmuch as UNIX has standards) on the source level,
- including IEEE POSIX.1, System V, and BSD features. It was
- developed with source portability in mind: therefore, you are most
- likely to find commonly-used features in the Linux system which are
- shared across multiple implementations. A great deal of free UNIX
- software available on the Internet and elsewhere compiles on Linux
- out of the box. In addition, all source code for the Linux system,
- including the kernel, device drivers, libraries, user programs, and
- development tools, is freely distributable.
- Other specific internal features of Linux include POSIX job
- control (used by shells such as csh and bash), pseudoterminals (pty
- devices), and support for national or customized keyboards using
- dynamically-loadable keyboard drivers. Linux also supports virtual
- consoles, which allow you to switch between multiple login sessions
- from the system console in text mode. Users of the ``screen'' program
- will find the Linux virtual console implementation familiar.
- The kernel is able to emulate 387-FPU instructions itself, so that
- systems without a math coprocessor can run programs that require
- floating-point math instructions.
- Linux supports various filesystem types for storing data. Various
- filesystems, such as the ext2fs filesystem, have been developed
- specifically for Linux. Other filesystem types, such as the Minix-1
- and Xenix filesystems, are also supported. The MS-DOS filesystem has
- been implemented as well, allowing you to access MS-DOS files on hard
- drive or floppy directly. The ISO 9660 CD-ROM filesystem type, which
- reads all standard formats of CD-ROMs, is also supported. We'll talk
- more about filesystems in Chapters 2 and 4.
- Linux provides a complete implementation of TCP/IP networking.
- This includes device drivers for many popular Ethernet cards, SLIP
- (Serial Line Internet Protocol, allowing you to access a TCP/IP
- network via a serial connection), PLIP (Parallel Line Internet
- Protocol), PPP (Point-to-Point Protocol), NFS (Network File System),
- and so on. The complete range of TCP/IP clients and services is
- supported, such as FTP, telnet, NNTP, and SMTP. We'll talk more about
- networking in Chapter 5.
- 1.4. Software Features 6
- _______________________________________________________________________
-
- The Linux kernel is developed to use the special protected-mode
- features of the Intel 80386 and 80486 processors. In particular,
- Linux makes use of the protected-mode descriptor-based memory
- management paradigm and many of the other advanced features of these
- processors. Anyone familiar with 80386 protected-mode programming
- knows that this chip was designed for a multitasking system such as
- UNIX (or, actually, Multics). Linux exploits this functionality.
- The Linux kernel supports demand-paged loaded executables. That
- is, only those segments of a program which are actually used are
- read into memory from disk. Also, copy-on-write pages are shared
- among executables, meaning that if several instances of a program are
- running at once, they will share pages in physical memory, reducing
- overall memory usage.
- In order to increase the amount of available memory, Linux also
- implements disk paging: that is, up to 256 megabytes of ``swap
- space''(2) can be allocated on disk. When the system requires
- more physical memory, it will swap out inactive pages to disk, thus
- allowing you to run larger applications and support more users at
- once. However, swap is no substitute for physical RAM---it is much
- slower due to drive access latency times.
- The kernel also implements a unified memory pool for user programs
- and disk cache. In this way, all free memory is used for caching, and
- the cache is reduced when running large programs.
- Executables use dynamically linked shared libraries, meaning that
- executables share common library code in a single library file found
- on disk, not unlike the SunOS shared library mechanism. This allows
- executable files to occupy much less space on disk, especially those
- that use many library functions. There are also statically-linked
- libraries for those who wish to use object debugging or maintain
- ``complete'' executables without the need for shared libraries to be
- in place. Linux shared libraries are dynamically linked at run-time,
- allowing the programmer to replace modules of the libraries with their
- own routines.
- To facilitate debugging, the Linux kernel does core dumps for
- post-mortem analysis. Using a core dump and an executable linked with
- debugging support, it is possible to determine what caused a program
- to crash.
-
-
- 1.4 Software Features
-
- In this section, we'll introduce you to many of the software
- applications available for Linux, and talk about a number of common
- computing tasks. After all, the most important part of the system is
- ----------------------------
- 2. Swap space is inappropriately named: entire processes are not
- swapped, but rather individual pages. Of course, in many cases entire
- processes will be swapped out, but this is not neccessarily always the
- case.
- 1.4. Software Features 7
- _______________________________________________________________________
-
- the wide range of software available for it. The fact that most of
- this software is freely distributable is even more impressive.
-
- 1.4.1 Basic commands and utilities
-
- Virtually every utility that you would expect to find on standard
- implementations of UNIX has been ported to Linux. This includes basic
- commands such as ls, awk, tr, sed, bc, more, and so on. You name
- it, Linux has it. Therefore, you can expect your familiar working
- environment on other UNIX systems to be duplicated on Linux. All
- of the standard commands and utilities are there. (Novice Linux
- users should see Chapter 3 for an introduction to these basic UNIX
- commands.)
- Many text editors are available, including vi, ex, pico, jove, as
- well as GNU Emacs and variants such as Lucid Emacs (which incorporates
- extensions for use under X Windows) and joe. Whatever text editor
- you're accustomed to using has more than likely been ported to Linux.
-
- The choice of a text editor is an interesting one. Many UNIX users
- still use ``simple'' editors such as vi (in fact, the author wrote
- this book using vi under Linux). However, vi has many limitations,
- due to its age, and more modern (and complex) editors such as
- Emacs are gaining popularity. Emacs supports a complete LISP-based
- macro language and interpreter, a powerful command syntax, and other
- fun-filled extensions. Emacs macro packages exist to allow you to
- read electronic mail and news, edit the contents of directories,
- and even engage in an artificially intelligent psychotherapy session
- (indispensible for stressed-out Linux hackers).
- One interesting note is that most of the basic Linux utilities
- are GNU software. These GNU utilities support advanced features not
- found in the standard versions from BSD or AT&T. For example, GNU's
- version of the vi editor, elvis, includes a structured macro language
- which differs from the original AT&T implementation. However, the
- GNU utilities strive to remain compatible with their BSD and System V
- counterparts. Many people consider the GNU versions of these programs
- superior to the originals.
- The most important utility to many users is the shell. The
- shell is a program which reads and executes commands from the
- user. In addition, many shells provide features such as job control
- (allowing the user to manage several running processes at once---not
- as Orwellian as it sounds), input and output redirection, and a
- command language for writing shell scripts. A shell script is a file
- containing a program in the shell command language, analogous to a
- ``batch file'' under MS-DOS.
- There are many types of shells available for Linux. The most
- important difference between shells is the command language. For
- example, the C Shell (csh) uses a command language somewhat like the
- C programming language. The classic Bourne Shell uses a different
- command language. One's choice of a shell is often based on the
- command language that it provides. The shell that you use defines, to
- 1.4. Software Features 8
- _______________________________________________________________________
-
- some extent, your working environment under Linux.
- No matter what shell you're accustomed to, some version of it has
- probably been ported to Linux. The most popular shell is the GNU
- Bourne Again Shell (bash), a Bourne shell variant which includes many
- advanced features, such as job control, command history, command and
- filename completion, an Emacs-like interface for editing the command
- line, and powerful extensions to the standard Bourne shell language.
- Another popular shell is tcsh, a version of the C Shell with advanced
- functionality similar to that found in bash. Other shells include
- zsh, a small Bourne-like shell; the Korn shell (ksh); BSD's ash; and
- rc, the Plan 9 shell.
- What's so important about these basic utilities? Linux gives you
- the unique opportunity to tailor a custom system to your needs. For
- example, if you're the only person who uses your system, and you
- prefer to exclusively use the vi editor, and bash as your shell,
- there's no reason to install other editors or shells. The ``do it
- yourself'' attitude is prevalent among Linux hackers and users.
-
- 1.4.2 Text processing and word processing
-
- Almost every computer user has a need for some kind of document
- preparation system. (How many computer enthusiasts do you know who
- still use pen and paper? Not many, we'll wager.) In the PC world,
- word processing is the norm: it involves editing and manipulating
- text (often in a ``What-You-See-Is-What-You-Get'' environment) and
- producing printed copies of the text, complete with figures, tables,
- and other garnishes.
- In the UNIX world, text processing is much more common, which
- is quite different than the classical concept of word processing.
- With a text processing system, text is entered by the author using
- a ``typesetting language'', which describes how the text should be
- formatted. Instead of entering the text within a special word
- processing environment, the source may be modified with any text
- editor such as vi or Emacs. Once the source text (in the typesetting
- language) is complete, the user formats the text with a separate
- program, which converts the source to a format suitable for printing.
- This is somewhat analogous to programming in a language such as C, and
- ``compiling'' the document into a printable form.
- There are many text processing systems available for Linux. One is
- groff, the GNU version of the classic nroff text formatter originally
- developed by Bell Labs and still used on many UNIX systems worldwide.
- Another modern text processing system is TeX, developed by Donald
- Knuth of computer science fame. Dialects of TeX, such as LaTeX, are
- also available.
- Text processors such as TeX and groff differ mostly in the syntax
- of their formatting languages. The choice of one formatting system
- over another is also based upon what utilities are available to
- satisfy your needs, as well as personal taste.
- For example, some people consider the groff formatting language to
- be a bit obscure, so they use TeX, which is more readable by humans.
- 1.4. Software Features 9
- _______________________________________________________________________
-
- However, groff is capable of producing plain ASCII output, viewable on
- a terminal, while TeX is intended primarily for output to a printing
- device. However, various programs exist to produce plain ASCII from
- TeX-formatted documents, or to convert TeX to groff, for example.
- Another text processing system is texinfo, an extension to TeX used
- for software documentation by the Free Software Foundation. texinfo
- is capable of producing a printed document, or an online-browsable
- hypertext ``Info'' document from a single source file. Info files are
- the main format of documentation used by GNU software such as Emacs.
- Text processors are used widely in the computing community for
- producing papers, theses, magazine articles, and books (in fact, this
- book was produced using LaTeX). The ability to process the source
- language as a plain text file opens the door to many extensions
- to the text processor itself. Because source documents are not
- stored in an obscure format, readable only by a particular word
- processor, programmers are able to write parsers and translators for
- the formatting language, extending the system.
- What does such a formatting language look like? In general,
- the formatting language source consists mostly of the text itself,
- along with ``control codes'' to produce a particular effect, such as
- changing fonts, setting margins, creating lists, and so on.
- As an example, take the following text:
-
- Mr. Torvalds:
-
- We are very upset with your current plans to implement
- post-hypnotic suggestion in the Linux terminal driver code.
- We feel this way for three reasons:
-
-
- 1. Planting subliminal messages in the terminal driver is not
- only immoral, it is a waste of time;
-
- 2. It has been proven that ``post-hypnotic suggestions'' are
- ineffective when used upon unsuspecting UNIX hackers;
-
- 3. We have already implemented high-voltage electric shocks,
- as a security measure, in the code for login.
-
-
- We hope you will reconsider.
-
- This text would appear in the LaTeX formatting language as the
- following:
-
- \begin{quote}
- Mr. Torvalds:
-
- We are very upset with your current plans to implement {\em post-
- hypnotic
- 1.4. Software Features 10
- _______________________________________________________________________
-
- suggestion\/} in the {\bf Linux} termi-
- nal driver code. We feel this
- way for three reasons:
- \begin{enumerate}
- \item Planting subliminal messages in the ker-
- nel driver is not only
- immoral, it is a waste of time;
- \item It has been proven that ``post-hypnotic sugges-
- tions'' are ineffective
- when used upon unsuspecting UNIX hackers;
- \item We have already implemented high-voltage elec-
- tric shocks, as a
- security measure, in the code for {\tt login}.
- \end{enumerate}
- We hope you will reconsider.
- \end{quote}
-
- The author enters the above ``source'' text using any text editor,
- and generates the formatted output by processing the source with
- LaTeX. At first glance, the typesetting language may appear to be
- obscure, but it's actually quite easy to learn. Using a text
- processing system enforces typographical standards when writing. For
- example, all enumerated lists within a document will look the same,
- unless the author modifies the definition of the enumerated list
- ``environment''. The primary goal is to allow the author to
- concentrate on writing the actual text, instead of worrying about
- typesetting conventions.
- WYSIWYG word processors are attractive for many reasons; they
- provide a powerful (and sometimes complex) visual interface for
- editing the document. However, this interface is inherently limited
- to those aspects of text layout which are accessible to the user. For
- example, many word processors provide a special ``format language''
- for producing complicated expressions such as mathematical formulae.
- This is identical text processing, albeit on a much smaller scale.
- The subtle benefit of text processing is that the system allows you
- to specify exactly what you mean. Also, text processing systems allow
- you to edit the source text with any text editor, and the source is
- easily converted to other formats. The tradeoff for this flexibility
- and power is the lack of a WYSIWYG interface.
- Many users of word processors are used to seeing the formatted
- text as they edit it. On the other hand, when writing with a text
- processor, one generally does not worry about how the text will appear
- when formatted. The writer learns to expect how the text should look
- from the formatting commands used in the source.
- There are programs which allow you to view the formatted document
- on a graphics display before printing. For example, the xdvi program
- displays a ``device independent'' file generated by the TeX system
- under the X Windows environment. Other software applications, such
- as xfig, provide a WYSIWYG graphics interface for drawing figures
- and diagrams, which are subsequently converted to the text processing
- 1.4. Software Features 11
- _______________________________________________________________________
-
- language for inclusion in your document.
- Admittedly, text processors such as nroff were around long before
- word processing was available. However, many people still prefer to
- use text processing, because it is more versatile and independent of
- a graphics environment. In either case, the idoc word processor is
- also available for Linux, and before long we expect to see commercial
- word processors becoming available as well. If you absolutely don't
- want to give up word processing for text processing, you can always
- run MS-DOS, or some other operating system, in addition to Linux.
- There are many other text-processing-related utilities available.
- The powerful METAFONT system, used for designing fonts for TeX, is
- included with the Linux port of TeX. Other programs include ispell,
- an interactive spell checker and corrector; makeindex, used for
- generating indicies in LaTeX documents; as well as many groff and
- TeX-based macro packages for formatting many types of documents and
- mathematical texts. Conversion programs to translate between TeX or
- groff source to a myriad of other formats are available.
-
- 1.4.3 Programming languages and utilities
-
- Linux provides a complete UNIX programming environment, including all
- of the standard libraries, programming tools, compilers, and debuggers
- that you would expect to find on other UNIX systems. Within the UNIX
- software development world, applications and systems programming is
- usually done in C or C++. The standard C and C++ compiler for Linux
- is GNU's gcc, which is an advanced, modern compiler supporting many
- options. It is also capable of compiling C++ (including AT&T 3.0
- features) as well as Objective-C, another object-oriented dialect of
- C.
- Besides C and C++, many other compiled and interpreted programming
- languages have been ported to Linux, such as Smalltalk, FORTRAN,
- Pascal, LISP, Scheme, and Ada (if you're masochistic enough to
- program in Ada---we're not going to stop you). In addition, various
- assemblers for writing protected-mode 80386 code are available, as are
- UNIX hacking favorites such as Perl (the script language to end all
- script languages) and Tcl/Tk (a shell-like command processing system
- including support for developing simple X Windows applications).
- The advanced gdb debugger has been ported, which allows you to
- step through a program to find bugs, or examine the cause for a
- crash using a core dump. gprof, a profiling utility, will give
- you performance statistics for your program, letting you know where
- your program is spending most of its time executing. The Emacs text
- editor provides an interactive editing and compilation environment for
- various programming languages. Other tools include GNU make and
- imake, used to manage compilation of large applications; and RCS, a
- system for source locking and revision control.
- Linux implements dynamically-linked shared libraries, which allow
- binaries to be much smaller as the subroutine code is linked at
- run-time. These DLL libraries also allow the applications programmer
- to override function definitions with their own code. For example,
- 1.4. Software Features 12
- _______________________________________________________________________
-
- if a programmer wished to write her own version of the malloc()
- library routine, the linker would use the programmer's new routine
- instead of the one found in the libraries.
- Linux is ideal for developing UNIX applications. It provides a
- modern programming environment with all of the bells and whistles.
- Various standards such as POSIX.1 are supported, allowing software
- written for Linux to be easily ported to other systems. Professional
- UNIX programmers and system administrators can use Linux to develop
- software at home, and then transfer the software to UNIX systems at
- work. This not only can save a great deal of time and money, but
- will also let you work in the comfort of your own home.(3) Computer
- Science students can use Linux to learn UNIX programming and to
- explore other aspects of the system, such as kernel architecture.
- With Linux, not only do you have access to the complete set of
- libraries and programming utilities, but you also have the complete
- kernel and library source code at your fingertips.
-
- 1.4.4 The X Window System
-
- The X Window System is the standard graphics interface for UNIX
- machines. It is a powerful environment supporting many applications.
- Using X Windows, the user can have multiple terminal windows on the
- screen at once, each one containing a different login session. A
- pointing device such as a mouse is often used with the X interface,
- although it isn't required.
- Many X-specific applications have been written, such as games,
- graphics utilities, programming and documentation tools, and so on.
- With Linux and X, your system is a bona fide workstation. Coupled
- with TCP/IP networking, you can even display X applications running
- on other machines on your Linux display, as is possible with other
- systems running X.
- The X Window System was originally developed at MIT, and is freely
- distributable. However, may commercial vendors have distributed
- proprietary enhancements to the original X Windows software. The
- version of X Windows available for Linux is known as XFree86, a port
- of X11R5 made freely distributable for 80386-based UNIX systems such
- as Linux. XFree86 supports a wide range of video hardware, including
- VGA, Super VGA, and a number of accelerated video adaptors. This is
- a complete distribution of the X Windows software, containing the X
- server itself, many applications and utilities, programming libraries,
- and documentation.
- Standard X applications include xterm (a terminal emulator used for
- most text-based applications within an X window); xdm (the X Session
- Manager, which handles logins); xclock (a simple clock display); xman
- (an X-based man page reader), and more. The many X applications
-
- ----------------------------
- 3. The author uses his Linux system to develop and test X Windows
- applications at home, which can be directly compiled on workstations
- elsewhere.
- 1.4. Software Features 13
- _______________________________________________________________________
-
- available for Linux are too numerous to mention here, but the base
- XFree86 distribution includes the ``standard'' applications found in
- the original MIT release. Many others are available separately, and
- theoretically any application written for X Windows should compile
- cleanly under Linux.
- The look and feel of the X Windows interface is controlled to a
- large extent by the window manager. This friendly program is in
- charge of the placement of windows, the user interface for resizing,
- iconifying, and moving windows, the appearance of window frames, and
- so on. The standard XFree86 distribution includes twm, the classic
- MIT window manager, although more advanced window managers such as the
- Open Look Virtual Window Manager (olvwm) are available as well. One
- window manager that is popular among Linux users is fvwm. This is
- a small window manager, requiring less than half of the memory used
- by twm. It provides a 3-D appearance for windows, as well a virtual
- desktop---if the user moves the mouse to the edge of the screen, the
- entire desktop is shifted as if the display were much larger than it
- actually is. fvwm is greatly customizable, and allows all functions
- to be accessed from the keyboard as well as the mouse. Many Linux
- distributions use fvwm as the standard window manager.
- The XFree86 distribution contains programming libraries and include
- files for those wily programmers who wish to develop X applications.
- Various widget sets, such as Athena, Open Look, and Xaw3D are
- supported. All of the standard fonts, bitmaps, man pages, and
- documentation are included. PEX (a programming interface for 3-D
- graphics) is also supported.
- Many X applications programmers use the proprietary Motif widget
- set for development. Several vendors sell single and multiple-user
- licenses for a binary version of Motif for Linux. Because
- Motif itself is relatively expensive, not many Linux users own it.
- However, binaries statically linked with Motif routines may be freely
- distributed. Therefore, if you write a program using Motif and wish
- to distribute it freely, you may provide a binary so that users
- without Motif can use the program.
- The only major caveats with X Windows are the hardware and memory
- requirements. A 386 with 4 megabytes of RAM is capable of running
- X, but 8 megabytes or more of physical RAM are needed to use it
- comfortably. A faster processor is nice to have as well, but having
- enough physical RAM is much more important. In addition, to achieve
- really slick video performance, an accelerated video card (such as
- a local bus S3-chipset card) is strongly recommended. Performance
- ratings in excess of 140,000 xstones have been acheived with Linux
- and XFree86. With sufficient hardware, you'll find that running
- X and Linux is as fast, or faster, than running X on other UNIX
- workstations.
- In Chapter 5 we'll discuss how to install and use X on your system.
- 1.4. Software Features 14
- _______________________________________________________________________
-
- 1.4.5 Networking
-
- Interested in communicating with the world? Yes? No? Maybe?
- Linux supports the two primary networking protocols for UNIX systems:
- TCP/IP and UUCP. TCP/IP (Transmission Control Protocol/Internet
- Protocol, for acronym aficionados) is the set of networking paradigms
- that allow systems all over the world to communicate on a single
- network known as the Internet. With Linux, TCP/IP, and a connection
- to the network, you can communicate with users and machines across the
- Internet via electronic mail, USENET news, file transfers with FTP,
- and more. There are many Linux systems currently on the Internet.
- Most TCP/IP networks use Ethernet as the physical network
- transport. Linux supports many popular Ethernet cards and interfaces
- for personal computers, including the D-Link pocket Ethernet adaptor
- for laptops.
- However, because not everyone has an Ethernet drop at home, Linux
- also supports SLIP (Serial Line Internet Protocol), which allows you
- to connect to the Internet via modem. In order to use SLIP, you'll
- need to have access to a SLIP server, a machine connected to the
- network which allows dial-in access. Many businesses and universities
- provide such SLIP servers. In fact, if your Linux system has an
- Ethernet connection as well as a modem, you can configure it as a SLIP
- server for other hosts.
- NFS (Network File System) allows your system to seamlessly share
- files with other machines on the network. FTP (File Transfer
- Protocol) allows you to transfer files between other machines. Other
- applications include sendmail, a system for sending and receiving
- electronic mail using the SMTP protocol; NNTP-based electronic news
- systems such as C-News and INN; telnet, rlogin, and rsh, which allow
- you to login and execute commands on other machines on the network;
- and finger, which allows you to get information on other Internet
- users. There are literally tons of TCP/IP-based applications and
- protocols out there.
- The full range of mail and news readers are available for Linux,
- such as elm, pine, rn, nn, and tin. Whatever your preference, you can
- configure your Linux system to send and receive electronic mail and
- news from all over the world.
- If you have experience with TCP/IP applications on other UNIX
- systems, Linux will be very familiar to you. The system provides a
- standard socket programming interface, so virtually any program which
- uses TCP/IP can be ported to Linux. The Linux X server also supports
- TCP/IP, allowing you to display applications running on other systems
- on your Linux display.
- In Chapter 5 we'll discuss configuration and setup of TCP/IP,
- including SLIP, for Linux.
- UUCP (UNIX-to-UNIX Copy) is an older mechanism used to transfer
- files, electronic mail, and electronic news between UNIX machines.
- Classically, UUCP machines connected to each other over the phone
- lines via modem, but UUCP is able to transport over a TCP/IP network
- as well. If you do not have access to a TCP/IP network or a SLIP
- 1.4. Software Features 15
- _______________________________________________________________________
-
- server, you can configure your system to send and receive files and
- electronic mail using UUCP. See Chapter 5 for more information.
-
- 1.4.6 Telecommunications and BBS software
-
- If you have a modem, you will be able to communicate with other
- machines using one of the telecommunications packages available for
- Linux. Many people use telecommunications software to access bulletin
- board systems (BBSs), as well as commercial online services such as
- Prodigy, CompuServe, and America On-Line. Other people use their
- modems to connect to a UNIX system at work or school. You can
- even use your modem and Linux system to send and receive facsimiles.
- Telecommunications software under Linux is very similar to that found
- under MS-DOS or other operating systems. Anyone who has ever used a
- telecommunications package will find the Linux equivalent familiar.
- One of the most popular communications packages for Linux is
- Seyon, an X application providing a customizable, ergonomic interface,
- with built-in support for various file transfer protocols such as
- Kermit, ZModem, and so on. Other telecommunications programs include
- C-Kermit, pcomm, and minicom. These are similar to communications
- programs found on other operating systems, and are quite easy to use.
- If you do not have access to a SLIP server (see the previous
- section), you can use term to multiplex your serial line. term will
- allow you to open multiple login sessions over the modem connection
- to a remote machine. term will also allow you to redirect X client
- connections to your local X server, through the serial line, allowing
- you to display remote X applications on your Linux system. Another
- software package, KA9Q, implements a similar SLIP-like interface.
- Running a bulletin board system (BBS) is a favorite hobby (and
- means of income) for many people. Linux supports a wide range of BBS
- software, most of which is more powerful than what is available for
- other operating systems. With a phone line, a modem, and Linux, you
- can turn your system into a BBS, providing dial-in access to your
- system to users worldwide. BBS software for Linux includes XBBS and
- the UniBoard BBS packages.
- Most BBS software locks the user into a menu-based system where
- only certain functions and applications are available. An alternative
- to BBS access is full UNIX access, which would allow users to dial
- into your system and login as a regular user. While this would
- require a fair amount of maintenance on the part of the system
- administrator, it can be done, and providing public UNIX access from
- your Linux system is not difficult to do. Along with a TCP/IP
- network, you can provide electronic mail and news access to users on
- your system.
- If you do not have access to a TCP/IP network or UUCP feed, Linux
- will also allow you to communicate with a number of BBS networks,
- such as FidoNet, with which you can exchange electronic news and mail
- via the phone line. More information on telecommunications and BBS
- software under Linux can be found in Chapter 5.
- 1.4. Software Features 16
- _______________________________________________________________________
-
- 1.4.7 Interfacing with MS-DOS
-
- Various utilities exist to interface with the world of MS-DOS. The
- most well-known application is the Linux MS-DOS Emulator, which allows
- you to run many MS-DOS applications directly from Linux. Although
- Linux and MS-DOS are completely different operating systems, the 80386
- protected-mode environment allows certain tasks to behave as if they
- were running in 8086-emulation mode, as MS-DOS applications do.
- The MS-DOS emulator is still under development, yet many popular
- applications run under it. Understandably, however, MS-DOS
- applications which use bizarre or esoteric features of the system may
- never be supported, because it is only an emulator. For example,
- you wouldn't expect to be able to run any programs which use 80386
- protected-mode features, such as Microsoft Windows (in 386 enhanced
- mode, that is).
- Applications which run successfully under the Linux MS-DOS Emulator
- include 4DOS (a command interpreter), Foxpro 2.0, Harvard Graphics,
- MathCad, Stacker 3.1, Turbo Assembler, Turbo C/C++, Turbo Pascal,
- Microsoft Windows 3.0 (in real mode), and WordPerfect 5.1. Standard
- MS-DOS commands and utilities (such as PKZIP, and so on) work with the
- emulator as well.
- The MS-DOS Emulator is meant mostly as an ad hoc solution for those
- people who need MS-DOS only for a few applications, but use Linux for
- everything else. It's not meant to be a complete implementation of
- MS-DOS. Of course, if the Emulator doesn't satisfy your needs, you can
- always run MS-DOS as well as Linux on the same system. Using the LILO
- boot loader, you can specify at boot time which operating system to
- start. Linux can coexist with other operating systems, such as OS/2,
- as well.
- Linux provides a seamless interface for transferring files between
- Linux and MS-DOS. You can mount an MS-DOS partition or floppy under
- Linux, and directly access MS-DOS files as you would any other.
- Currently under development is a project known as WINE---a
- Microsoft Windows emulator for the X Window System under Linux. Once
- WINE is complete, users will be able to run MS-Windows applications
- directly from Linux. This is similar to the proprietary WABI Windows
- emulator from Sun Microsystems. At the time of this writing, WINE is
- still in the early stages of development, but the outlook is good.
- In Chapter 5 we'll talk about the MS-DOS tools available for
- Linux.
-
- 1.4.8 Other applications
-
- A host of miscellany is available for Linux, as one would expect
- from such a hodgepodge operating system. Linux's primary focus
- is currently for personal UNIX computing, but this is rapidly
- changing. Business and scientific software is expanding, and
- commercial software vendors are beginning to contribute to the growing
- pool of applications.
- Several relational databases are available for Linux, including
- 1.4. Software Features 17
- _______________________________________________________________________
-
- Postgres, Ingres, and Mbase. These are full-featured, professional
- client/server database applications similar to those found on other
- UNIX platforms. /rdb, a commercial database system, is available as
- well.
- Scientific computing applications include FELT (a finite element
- analysis tool); gnuplot (a plotting and data analysis application);
- Octave (a symbolic mathematics package, similar to MATLAB); xspread (a
- spreadsheet calculator); xfractint, an X-based port of the popular
- Fractint fractal generator; xlispstat (a statistics package), and
- more. Other applications include Spice (a circuit design and analysis
- tool) and Khoros (an image/digital signal processing and visualization
- system).
- Of course, there are many more such applications which have been,
- and can be, ported to run on Linux. Whatever your field, porting
- UNIX-based applications to Linux should be quite straightforward.
- Linux provides a complete UNIX programming interface, sufficient to
- serve as the base for any scientific application.
- As with any operating system, Linux has its share of games. These
- include classic text-based dungeon games such as Nethack and Moria;
- MUDs (multi-user dungeons, which allow many users to interact in a
- text-based adventure) such as DikuMUD and TinyMUD; as well as a slew
- of X games such as xtetris, netrek, and Xboard (the X11 version of
- gnuchess). The popular shoot-em-up arcade-style Doom has also been
- ported to Linux.
- For audiophiles, Linux has support for various sound cards and
- related software, such as CDplayer (a program which can control a
- CD-ROM drive as a conventional CD player, surprisingly enough), MIDI
- sequencers and editors (allowing you to compose music for playback
- through a synthesizer or other MIDI-controlled instrument), and sound
- editors for digitized sounds.
- Can't find the application you're looking for? The Linux Software
- Map, described in Appendix A, contains a list of many software
- packages which have been written and ported to Linux. While this list
- is far from complete, it contains a great deal of software. Another
- way to find Linux applications is to look at the INDEX files found on
- Linux FTP sites, if you have Internet access. Just by poking around
- you'll find a great deal of software just waiting to be played with.
- If you absolutely can't find what you need, you can always attempt
- to port the application from another platform to Linux. Most freely
- distributable UNIX-based software will compile on Linux with few
- problems. Or, if all else fails, you can write the application
- yourself. If it's a commercial application you're looking for,
- there may be a free ``clone'' available. Or, you can encourage
- the software company to consider releasing a Linux binary version.
- Several individuals have contacted software companies, asking them to
- port their applications to Linux, and have met with various degrees of
- success.
- 1.5. About Linux's Copyright 18
- _______________________________________________________________________
-
- 1.5 About Linux's Copyright
-
- Linux is covered by what is known as the GNU General Public License,
- or GPL. The GPL was developed for the GNU project by the Free Software
- Foundataion. It makes a number of provisions for the distribution
- and modification of ``free software''. ``Free'' in this sense refers
- to freedom, not just cost. The GPL has always been subject to
- misinterpretation, and we hope that this summary will help you to
- understand the extent and goals of the GPL and its effect on Linux. A
- complete copy of the GPL is included in Appendix E.
- Originally, Linus Torvalds released Linux under a license more
- restrictive than the GPL, which allowed the software to be freely
- distributed and modified, but prevented any money changing hands for
- its distribution and use. On the other hand, the GPL allows people to
- sell and make profit from free software, but does not allow them to
- restrict the right for others to distribute the software in any way.
- First, it should be explained that ``free software'' covered by the
- GPL is not in the public domain. Public domain software is software
- which is not copyrighted, and is literally owned by the public.
- Software covered by the GPL, on the other hand, is copyrighted to
- the author or authors. This means that the software is protected
- by standard international copyright laws, and that the author of the
- software is legally defined. Just because the software may be freely
- distributed does not mean that it is in the public domain.
- GPL-licensed software is also not ``shareware''. Generally,
- ``shareware'' software is owned and copyrighted by the author, but the
- author requires users to send in money for its use after distribution.
- On the other hand, software covered by the GPL may be distributed and
- used free of charge.
- The GPL also allows people to take and modify free software, and
- distribute their own versions of the software. However, any derived
- works from GPL software must also be covered by the GPL. In other
- words, a company could not take Linux, modify it, and sell it under
- a restrictive license. If any software is derived from Linux, that
- software must be covered by the GPL as well.
- The GPL allows free software to be distributed and used free
- of charge. However, it also allows a person or organization to
- distribute GPL software for a fee, and even to make a profit from
- its sale and distribution. However, in selling GPL software, the
- distributor cannot take those rights away from the purchaser; that is,
- if you purchase GPL software from some source, you may distribute the
- software for free, or sell it yourself as well.
- This might sound like a contradiction at first. Why sell software
- for profit when the GPL allows anyone to obtain it for free? As
- an example, let's say that some company decided to bundle a large
- amount of free software on a CD-ROM and distribute it. That company
- would need to charge for the overhead of producing and distributing
- the CD-ROM, and the company may even decide to make profit from the
- sales of software. This is allowed by the GPL.
- Organizations which sell free software must follow certain
- 1.6. The Design and Philosophy of Linux 19
- _______________________________________________________________________
-
- restrictions set forth in the GPL. First, they cannot restrict the
- rights of users who purchase the software. This means that if you
- buy a CD-ROM of GPL software, you can copy and distribute that CD-ROM
- free of charge, or resell it yourself. Secondly, distributors must
- make it obvious to users that the software is indeed covered by
- the GPL. Thirdly, distributors must provide, free of charge, the
- complete source code for the software being distributed. This will
- allow anyone who purchases GPL software to make modifications of that
- software.
- Allowing a company to distribute and sell free software is a very
- good thing. Not everyone has access to the Internet to download
- software, such as Linux, for free. The GPL allows companies to
- sell and distribute software to those people who do not have free
- (cost-wise) access to the software. For example, many organizations
- sell Linux on diskette, tape, or CD-ROM via mail order, and make
- profit from these sales. The developers of Linux may never see any
- of this profit; that is the understanding that is reached between the
- developer and the distributor when software is licensed by the GPL.
- In other words, Linus knew that companies may wish to sell Linux, and
- that he may not see a penny of the profits from those sales.
- In the free software world, the important issue is not money. The
- goal of free software is always to develop and distribute fantastic
- software and to allow anyone to obtain and use it. In the next
- section, we'll discuss how this applies to the development of Linux.
-
-
- 1.6 The Design and Philosophy of Linux
-
- When new users encounter Linux, they often have a few misconceptions
- and false expectations of the system. Linux is a unique operating
- system, and it is important to understand its philosophy and design in
- order to use it effectively. Time enough for a soapbox. Even if you
- are an aged UNIX guru, what follows is probably of interest to you.
- In commercial UNIX development houses, the entire system is
- developed with a rigorous policy of quality assurance, source and
- revision control systems, documentation, and bug reporting and
- resolution. Developers are not allowed to add features or to change
- key sections of code on a whim: they must validate the change as a
- response to a bug report and consequently ``check in'' all changes to
- the source control system, so that the changes can be backed out if
- necessary. Each developer is assigned one or more parts of the system
- code, and only that developer may alter those sections of the code
- while it is ``checked out''.
- Internally, the quality assurance department runs rigorous
- regression test suites on each new pass of the operating system, and
- reports any bugs. It is the responsibility of the developers to fix
- these bugs as reported. A complicated system of statistical analysis
- is employed to ensure that a certain percentage of bugs are fixed
- before the next release, and that the operating system as a whole
- passes certain release criteria.
- In all, the process used by commercial UNIX developers to maintain
- 1.6. The Design and Philosophy of Linux 20
- _______________________________________________________________________
-
- and support their code is very complicated, and quite reasonably so.
- The company must have quantitative proof that the next revision of
- the operating system is ready to be shipped; hence, the gathering
- and analysis of statistics about the operating system's performance.
- It is a big job to develop a commercial UNIX system, often large
- enough to employ hundreds (if not thousands) of programmers, testers,
- documentors, and administrative personel. Of course, no two
- commercial UNIX vendors are alike, but you get the general picture.
- With Linux, you can throw out the entire concept of organized
- development, source control systems, structured bug reporting, or
- statistical analysis. Linux is, and more than likely always will be,
- a hacker's operating system.(4)
- Linux is primarily developed as a group effort by volunteers on the
- Internet from all over the world. Across the Internet and beyond,
- anyone with enough know-how has the opportunity to aid in developing
- and debugging the kernel, porting new software, writing documentation,
- or helping new users. There is no single organization responsible
- for developing the system. For the most part, the Linux community
- communicates via various mailing lists and USENET newsgroups. A
- number of conventions have sprung up around the development effort:
- for example, anyone wishing to have their code included in the
- ``official'' kernel should mail it to Linus Torvalds, which he will
- test and include in the kernel (as long as it doesn't break things or
- go against the overall design of the system, he will more than likely
- include it).
- The system itself is designed with a very open-ended, feature-
- minded approach. While recently the number of new features and
- critical changes to the system have diminished, the general rule is
- that a new version of the kernel will be released about every few
- months (sometimes even more frequently than this). Of course, this is
- a very rough figure: it depends on a several factors including the
- number of bugs to be fixed, the amount of feedback from users testing
- pre-release versions of the code, and the amount of sleep that Linus
- has had this week.
- Let it suffice to say that not every single bug has been fixed,
- and not every problem ironed out between releases. As long as the
- system appears to be free of critical or oft-manifesting bugs, it is
- considered ``stable'' and new revisions will be released. The thrust
- behind Linux development is not an effort to release perfect, bug-free
- code: it is to develop a free implementation of UNIX. Linux is for
- the developers, more than anyone else.
- Anyone who has a new feature or software application to add to the
- system generally makes it available in an ``alpha'' stage---that is,
- a stage for testing by those brave or unwary users who want to bash
-
- ----------------------------
- 4. What I mean by ``hacker'' is a feverishly dedicated programmer, a
- person who enjoys exploiting computers and generally doing interesting
- things with them. This is in contrast to the common denotation of
- ``hacker'' as a computer wrongdoer or outlaw.
- 1.6. The Design and Philosophy of Linux 21
- _______________________________________________________________________
-
- out problems with the initial code. Because the Linux community is
- largely based on the Internet, alpha software is usually uploaded to
- one or more of the various Linux FTP sites (see Appendix C) and a
- message posted to one of the Linux USENET newsgroups about how to get
- and test the code. Users who download and test alpha software can
- then mail results, bug fixes, or questions to the author.
- After the initial problems in the alpha code have been fixed, the
- code enters a ``beta'' stage, in which it is usually considered
- stable but not complete (that is, it works, but not all of the
- features may be present). Otherwise, it may go directly to a
- ``final'' stage in which the software is considered complete and
- usable. For kernel code, once it is complete the developer may ask
- Linus to include it in the standard kernel, or as an optional add-on
- feature to the kernel.
- Keep in mind that these are only conventions---not rules. Some
- people feel so confident with their software that they don't need to
- release an alpha or test version. It is always up to the developer to
- make these decisions.
- You might be amazed that such a nonstructured system of volunteers,
- programming and debugging a complete UNIX system, could get anything
- done at all. As it turns out, it is one of the most efficient and
- motivated development efforts ever employed. The entire Linux kernel
- was written from scratch, without employing any code from proprietary
- sources. A great deal of work was put forth by volunteers to port all
- of the free software under the sun to the Linux system. Libraries
- were written and ported, filesystems developed, and hardware drivers
- written for many popular devices.
- The Linux software is generally released as a distribution, which
- is a set of pre-packaged software making up an entire system. It
- would be quite difficult for most users to build a complete system
- from the ground up, starting with the kernel, adding utilities, and
- installing all of the necessary software by hand. Instead, there
- are a number of software distributions including everything that you
- need to install and run a complete system. Again, there is no
- standard distribution---there are many, each with their own advantages
- and disadvantages. We'll talk more about the various available Linux
- distributions in Section 2.1.
- Despite the completeness of the Linux software, you will still need
- a bit of UNIX know-how to install and run a complete system. No
- distribution of Linux is completely bug-free, so you may be required
- to fix small problems by hand after installation. Running a UNIX
- system is not an easy task, not even for commercial versions of UNIX.
- If you're serious about Linux, bear in mind that it will take a
- considerable amount of effort and attention on your part to keep the
- system running and take care of things: this is true of any UNIX
- system, and Linux is no exception. Because of the diversity of the
- Linux community and the many needs which the software is attempting to
- meet, not eveything can be taken care of for you all of the time.
- 1.6. The Design and Philosophy of Linux 22
- _______________________________________________________________________
-
- 1.6.1 Hints for UNIX novices
-
- Installing and using your own Linux system does not require a great
- deal of background in UNIX. In fact, many UNIX novices successfully
- install Linux on their systems. This is a worthwhile learning
- experience, but keep in mind that it can be very frustrating to some.
- If you're lucky, you will be able to install and start using your
- Linux system without any UNIX background. However, once you are ready
- to delve into the more complex tasks of running Linux---installing
- new software, recompiling the kernel, and so forth---having background
- knowledge in UNIX is going to be a necessity.
- Fortunately, by running your own Linux system you will be
- able to learn the essentials of UNIX necessary for these tasks.
- This book contains a good deal of information to help you get
- started---Chapter 3 is a tutorial covering UNIX basics, and Chapter 4
- contains information on Linux system administration. You may wish to
- read these chapters before you attempt to install Linux at all---the
- information contained therein will prove to be invaluable should you
- run into problems.
- Nobody can expect to go from being a UNIX novice to a UNIX system
- administrator overnight. No implementation of UNIX is expected to run
- trouble- and maintenance-free. You must be aptly prepared for the
- journey which lies ahead. Otherwise, if you're new to UNIX, you may
- very well become overly frustrated with the system.
-
- 1.6.2 Hints for UNIX gurus
-
- Even those people with years of UNIX programming and systems
- administration experience may need assistance before they are able to
- pick up and install Linux. There are still aspects of the system that
- UNIX wizards will need to be familiar with before diving in. For one
- thing, Linux