Rick Roberts is president of Wintech Solutions, a technical software consulting company in Arlington, Texas, specializing in user friendly custom technical software and embedded system design. He can be reached via email at ricrob@metronet.com or by phone at (817) 860-7591.
What is Linux?
UNIX for free? Yes, if you have access to the Internet, you can obtain a fully functional, 32-bit, UNIX operating system for nothing. If you don't have access to the Internet, there are several other ways of acquiring it, with the cost depending on the method you choose, as I explain later.This UNIX clone, called Linux, is designed specifically for 386/486 ISA-bus machines. Linux includes the following features: X-Window (based on the Xfree86 X server), the GNU C compiler, the GNU shell Bash, man pages, support for up to four virtual terminals, network and mail support, and all of the standard UNIX utilities. Hardware supported includes AT-type MFM, RLL, ESDI, and IDE hard disks, high density 3.5 and 5.25 inch floppy drives, SCSI, serial and bus mice, and several VGA cards at up to 1028x768x256 resolution. A typical Linux distribution will also include some application programs as well, such as spreadsheets, TeX, various games, communication programs, and others.
Linux is POSIX-compliant and implements a subset of System V, so it's usually very easy to port applications written for other UNIX systems to run under Linux. For instance, I have compiled and run some of the X-Window code examples from the O'Reilly books without any modifications. You may even be able to use some commercial applications if they are distributed with source code so that you can compile them under Linux.
Linux (the 'i' is pronounced as the 'i' in UNIX) was created by Linus Torvalds. It began as a simple task switcher running two processes, which printed "AAAA" and "BBBB." Gradually, the task switcher grew until it evolved into a full UNIX-compatible kernel. Over the years, many people on the Internet have contributed code to make it what it is today. Linux is not public domain; it is copyrighted by Linus Torvalds. Fortunately, Torvalds' copyright is the same as the GNU General Public Licence, a relatively liberal set of restrictions that actually promote the free distribution of software (see the sidebar, "The Linux Copyright"). Since Linux was totally written from scratch, all of its source code can be distributed without royalties.
System Requirements
You will need at least 4 Mb of memory to run Linux. After that, your memory requirements will vary, depending upon what applications you use and upon your patience: while you may get by on 4 MB (Linux implements virtual memory), some tasks will cause your machine to run noticeably slower, as Linux constantly swaps to disk when you run out of memory. Two such applications are the C compiler and X-Window. Your hard disk should have a minimum of 40 MB free, 65 MB if you want X-Window. You will probably want to set aside at least an extra 10 MB for user files.
Getting Linux from the Internet
Linux is available via anonymous ftp at several Internet sites. Some of these are shown in Table 1. Not all sites carry exactly the same distribution. As Linux is a product of the Internet, it has grown through the contributions of many different people; so you will find several different flavors of it on the net. Usually, the difference in flavor will be in the kernEl's revision number; you can expect different flavors to have different functionality. Other variances occur in the hardware supported (for example, one version supports Sound Blaster cards), enhanced features and code improvements, which bugs got fixed, application programs included, and the installation procedure.A typical Linux distribution includes the binaries (compiled executables), so all you need to do is follow the installation procedure and the directory structure will be setup for you automatically. You will be ready to run Linux without having to compile it. Two of my favorite Linux distributions are SlackWare's and Texas A&M University's (TAMU). Both have an easy installation procedure and come with lots of auxiliary programs. The following session log shows a user connecting to the TAMU site and getting one of the disk images:
bash$ ftp net.tamu.edu Connected to net.tamu.edu. 220 saturn FTP server (Version wu-2.1c(5) Fri Jan 14 16:46:43 CST 1994) ready. Name (net.tamu.edu:ricrob): anonymous 331 Guest login ok, send your complete e-mail address as password. Password: Remote system type is UNIX. Using binary mode to transfer files. ftp> cd /pub/linux/TAMU.99p12/image.3inch 250 CWD command successful. ftp> binary 200 Type set to I. ftp> get bin.01 200 PORT command successful. 150 Opening BINARY mode data connection for bin.01 (1474560 bytes). 226 Transfer complete. 1474560 bytes received in 80.33 seconds (17.93 Kbytes/s) ftp> quit 221 Goodbye.Installing Linux
Once you have downloaded all the disk images, you must place them on individual floppy disks. Some sites use MS-DOS compatible files while others use Linux-format files. Even if the site uses DOS-format disks, you will still need a Linux formatted installation boot disk (this is usually the disk made from the file a1). You can prepare this disk using a raw disk writing utility, such as rawrite.exe; or if you already have Linux running on another machine, you can use that machine to make up the disks using the UNIX dd command. You can get rawrite.exe from wcarchive.cdrom.com in the pub/linux/old_slackware directory.After making up the set of installation floppies, boot your computer using the installation boot disk. During the boot process, the Linux kernel will be loaded into memory. If all goes well during the boot, you should see a login prompt. At this point Linux is running and you will need to be familiar with UNIX commands to proceed. Login as root and search the directory for read.me files that will give you information on the installation process. Also, be sure to read any read.me files and the FAQ (frequently asked questions) file from the distribution site.
The first thing you must do before going any further is create a partition on your hard disk for Linux. Creating a Linux partition will destroy all data on your hard disk, so you may as well start with an empty hard disk. To create the partition, use the fdisk program from the boot disk. After fdisk, you will need to reboot. At this point, it is a good idea to have an understanding of UNIX system administration. UNIX is a much more complicated and unforgiving operating system than MSDOS. UNIX uses disk caches which must be flushed prior to rebooting. Before you reboot, run the sync command a couple of times to write the cache to disk. Also, if halt is on the boot floppy, run that after the sync command. halt prepares the operating system for a power off.
After rebooting, run the installation shell script. It probably will be named something like setup. Simply follow all the prompts and that's all there is to it.
One nice thing about the TAMU distribution is that it will install LILO (LInux LOader), the disk boot loader program. This program enables you to boot Linux from a hard disk instead of a floppy. As your computer boots up, LILO will ask you which partition you wish to boot from, which allows you to boot either DOS or Linux. If you don't select anything LILO times out and boots from your first partition. TAMU also includes a menu system that makes it easy to do things like format disks and setup new users.
Although the TAMU release has a very straightforward installation procedure, I found some peculiarities as well. The TAMU release is supposed to work with 4 MB memory, but I could not get the installation to complete successfully with only 4 MB. The installation would fail and display an "out of memory" message during the mkefs part of the installation. When I added more memory (16 more MB), I was able to get through the file system creation but bombed out while loading from the second installation disk. This second blowup, I learned, was probably due to a peculiarity with my computer. Evidently, I had installed too much memory. I dropped down to 8 MB and had no more problems. Once Linux was installed, it was able to run with 4 MB of memory, but as it was booting up, an out-of-memory message was displayed. After that I ran the system with 4 MB for a while, and didn't seem to have any difficulties, even while running X-Window. However, the system was constantly swapping out memory to the hard disk and ran very slow, so I would be wary of running the system with only 4 MB.
Using Linux
Once you have successfully installed Linux and are up and running, find and read all of the read.me files and FAQs. You should add a new user account as soon as possible and login with it, so you don't have to login as root with superuser privileges. Since you will be the system administrator, I suggest you get a good book on system administration such as the UNIX System Administration Handbook by Nemeth, Snyder, and Seebass. [1]Linux provides a wonderful opportunity for those wanting to learn about UNIX or operating systems in general. Because the source code is available you can learn all the ins and outs of operating system design you can even add your own embellishments. If you come up with something really useful, you can submit it as a contribution for the next release. You can also learn a lot about UNIX system administration. Linux will allow your 386/486 to do true multitasking with multiuser capabilities, and since it is POSIX compatible, you will be able to run lots of the free UNIX software available on the Internet.
If you can connect to the Internet, a newsgroup named comp.os.linux devoted to Linux can provide current information about it. Another useful newsgroup for general UNIX questions such as how to create a directory, etc. is comp.unix.questions.
Other Linux Sources
If you cannot access the Internet, you can obtain Linux from several commercial sources. Some companies sell Linux already installed and runnable on a CDROM. Table 2 lists several commercial sources of Linux. Also, several computer magazines have advertisements for companies selling Linux. As mentioned before, because Linux is a product of the Internet and is in a constant state of flux, different sources will carry different versions and kernel patch levels. So before spending any money be sure to find out if their version is compatible with your hardware.
Bibliography
[1] Nemeth, Snyder, and Seebas. Unix System Administration Handbook. Prentice Hall, ISBN 0-13-933441-6.