The magazine of the Melbourne PC User Group

Linux at home
Peter Kostouros

Linux is a free independent implementation of UNIX for Intel's i386 processor. Initially written by Linus Torvalds as a student project in the early 1990s, Linux has developed, through international collaborative effort, into an operating system that has industrial, academic, and government application.

Linux has many features expected from a modern operating system: meltitasking, meltiuser, networking, advanced memory management, virtual memory, dynamic libraries, POSIX compliance, and support for many hardware devices. I first heard of Linux several years ago, and what appealed to me was that it could coexist with MS-Windows. This article describes how I installed Linux and its accompanying software, and how I use it at home for most of my computing.

Linux distributions

Linux requires many utilities (such as files, libraries, and programs) to run. Several people and companies have organised these utilities and complementary Linux software into distributions that make for easy installation. Some popular Linux distributions include Slackware, RedHat, and Debian, and are available at many Internet sites or on CD-ROMs. Infomagic's Linux Developer's Resource is a six disc set with several Linux distributions and a collection of Linux, UNIX, and X software. I will be referring to the April 1996 Linux Developer's Resource and the Slackware 3.0 distribution in this article.

Installation

Before Linux, my UNIX experience was limited to running UNIX applications and basic UNIX file management. I thought UNIX installation and system and network administration was for experts. My attitude changed when I was prepared to go where there be dragons.

The hardware and installation notes describe Linux requirements and loading options: a typical IBM PC i386 clone with 4 MB RAM and 40-80 MB of free hard disk space is sufficient, and can be loaded to an MS-DOS directory, for example, C:\LINUX, another partition, another drive, or run from the CD-ROM (with minimal installation on the hard disk). I chose to install Linux onto my second drive.

A pair of Linux installation disks must be created to boot Linux from and then proceed to install the Slackware distribution. The installation disks, boot kernel and root disk, can be created from MS-Windows by lininst, MS-DOS, or another UNIX system. Once I had the installation disks (created with lininst), I inserted the boot kernel disk into the floppy drive and safely restarted the computer.

The system began in text mode and after a while it presented a "boot:" prompt. At this stage, entries such as SCSI controller IRQ and address, may be given to force hardware detection, just in case Linux probing misses some gear; there are documents and examples describing many entries accepted by Linux for hardware detection. I hit the return key as I had nothing to enter; Linux began to boot. When the system boots, Linux prompts the user to replace the boot disk with the root disk in the floppy drive, and hit the return key. Once Linux completed its boot/root process, it presented a login prompt; I logged in as "root".

The first thing I did was prepare the hard disk. I created four partitions using (Linux's) fdisk: the partitions were to hold the
  • System files (32 MB)
  • Program files (380 MB)
  • User files (55 MB)
  • Swap drive (32 MB).
I created these partitions to separate system files from user files. I found out later that if the system files are on a separate partition, it is easier to fix the file system should it break into pieces (crash).

Once the hard disk was ready, I began the main installation with setup, which is a text-based, menu-driven program that automates the install process. It
  • Performs pre-installation (disk formatting, sets up destination directories, makes MS-DOS directories visible to Linux)
  • Loads software
  • Configures the system and network.
T he Slackware distribution comes as disk sets and includes
  • The base system (programs to get a Linux system running)
  • Applications (editors and online manuals)
  • Program development tools, networking software (news and mail readers)
  • TeX (typesetting software)
  • X (graphical user environment)
  • X development tools and applications
  • Games
A complete installation requires about 200 MB. The CD-ROM installation took about an hour and transformed my PC into a UNIX workstation.

A UNIX workstation? Well you might ask. A workstation, from a PC perspective, is a high-end system usually with the tag "Sun" or "Silicon Graphics" attached. Since some people have observed that their Linux/PC systems outperform certain workstations (worth tens of thousands of dollars), I can make some claims.

Running Linux

There are several ways to boot Linux. I installed LILO, a boot loader, and organised it to load either Linux or MS-Windows95; the selection is made at boot time.

The super-user of the system is "root" who has unlimited privileges. On my system, root's responsibilities include system maintenance, (un)installing software, and establishing Internet connections. Although I am the only user of the system, hence the super-user, I set up another account, peter, from which I do ordinary work (that is, no system administration). An ordinary user (peter) does not have unlimited privileges. Although users can be given super-user privileges, in which case they can access normally inaccessible areas, it is not advisable. Warning: this can lead to irreversible damage.

Since Linux is meltitasking and melti user, my system can have many users on it simultaneously (say root and peter) and I (as "peter" and "root") can switch between login sessions using hot-key combinations. For example, if, as "root" (that is me), I am installing software that is taking a while to load, I can switch to another login session, where "peter" (that is me, again) can log on and read the latest news.

Linux can access MS-DOS partitions so I have access to my MS-DOS data and can copy files to and from my Linux partitions. Linux, in its file hierarchy, sees the MS-DOS partitions as ordinary directories: I can switch to MS-DOS C drive by issuing "cd /dosC" (note the forward slash delimits directories in UNIX). Linux also has an MS-DOS emulator, dosemu, that enables some MS-DOS programs to run from Linux.

Although many programs are text based, Linux also runs a graphical environment, X.

The X window system (X)

X is a network transparent window system. Basically, X is a program that sits on top of Linux where it offers a graphical window environment. X has many programs written for it - mostly in the spirit of Linux contributed - such as
  • Window managers (fvwm, olvwm)
  • File managers (TkDesk, xfm)
  • Graphics, rendering and image processing programs (Xpaint, zgv, BMRT, XV, Khoros)
  • Word processors (ez, Xemacs)
  • News and mail readers (GNUs, Xmail)
  • WWW browsers (Navigator)
  • Scientific programs (Octave).
M any text-based programs can be run from xterm, a terminal emulator. The Slackware distribution has a collection of popular X programs; most X applications are on the accompanying CD-ROMs or can be downloaded from the Internet. There are commercial packages for Linux/X too, such as WordPerfect, StarOffice, and Mathematica.

Window managers provide styles for windows (Figure 1) and multiple virtual desktops (Figure 2). A desktop is a work area that can be larger than the physical screen: my desktop size is 1600 x 1200 (my monitor's resolution is 1024 x 768 pixels). I have six virtual desktops so I do not clutter my workspace with overlapping windows and minimised windows. Window managers are also configurable and can give windows and applications a familiar look.


Figure 1. TkDesk, a file manager running in the fvwm window


Figure 2. Partial screen shot of an X session. Top left corner window shows virtual desktops

X applications are referred to as clients and may be running on the same machine as the X server or on another. For example, I ran and interacted with a demonstration GUI program - the Andrew User Interface System (Andrew), an integrated suite of programs featuring a wordprocessor, a spreadsheet, and drawing programs - from the US that was on an RS/6000 running AIX 3.2.5. No software installation was done at my end.

Although Linux can run with about 2 MB RAM, I found that when running X with 8 MB RAM there was a lot of paging (the swap file was used regularly). When I upgraded to 16 MB RAM (and to an i486), X worked well with some xterms running; programs began to slow (due to paging) when I ran several memory hungry applications, such as a combination of gcc, Geomview, or ObjectBuilder. With 32 MB RAM I run several applications (xterms, Navigator, and Andrew) without the system using virtual memory.

Upgrading

Linux kernels are released regularly over the Internet, sometimes, a few minor revisions a week. The kernel is the heart of an (UNIX) operating system: its responsibilities include handling tasks, the file system, and security. Upgrading a kernel involves getting the version you want (as source code), compiling it (by issuing "make mrproper; make config; make dep; make zImage") and installing it. As my confidence and familiarity with Linux grew, I began to create custom kernels: kernels tuned for my system. The Linux kernels supplied on the installation disks support a lot of hardware. Obviously, I did not require all the support (for example, I have no Ethernet), so I trimmed off the fat. The trimming is done during the "make config" stage. Note, newer kernels may require some libraries and programs to be upgraded too.

There are several ways of upgrading the Slackware distribution. I found the simplest was to back up my configuration files and the utilities I wrote, and format the partitions containing the system files and program files, kind of getting a fresh start. The user's directory (/home) remains unaltered as it is on a partition not to be formatted. Once I installed the new distribution, I set up the user accounts, loaded the backup files, and over time, reloaded programs and application suites.

Connecting to the Internet

To connect to the Internet I created a kernel with PPP support and installed a suite of supporting PPP programs. Initially I connected using minicom - a communications program - and manually answering the login and password prompts. When Melb PC (my ISP) offered Password Authentication Protocol logins (PAP), I posted a message to a Melb PC newsgroup requesting PAP information. Sure enough, I was directed to the Linux specific PAP set up notes at the Melb PC web site. Once I created some preliminary files using the Melb PC PAP notes as a guide, and set up access permissions to them (for security), I now just issue "pppd &" to connect.

Availability

I bought the April 1996 LINUX Developer's Resource CD-ROM for $39.95 from Pacific MicroLabs Computer Centre a few months ago, and have since seen the latest version (December 1996) for $27.00 (plus postage and handling) from Cetus Technology (www.zip.com.au/~lychan). The Developer's Resource CD-ROM has the Slackware, Debian, and Red Hat distributions, several commercial demonstration applications, and plenty of supplementary Linux/UNIX/X software.

As mentioned earlier, a distribution (or partial distribution) can also be downloaded from various sites, for example, sunsite.anu.edu.au:pub/linux. A complete download is usually prohibitive: 115 MB for Slackware. If you decide on a partial distribution, the distribution's readme or installation files indicate which files are required.

Conclusion

Linux is an operating system that turns the PC into a UNIX workstation, and with X, gives a familiar graphical window environment. Installing and setting up Linux for the home is easy, even for a novice. There may be some difficulties setting up a network, configuring X, or setting up mail or news readers, however, most problems can be overcome by reading the howto documents or posting to the relevant news groups. And, as you may recall, Linux is free.

Reprinted from the March 1997 issue of PC Update, the magazine of Melbourne PC User Group, Australia

[About Melbourne PC User Group]