new entry

This commit is contained in:
gferg 2000-07-24 15:32:43 +00:00
parent e21a14e438
commit aa451d9d84
2 changed files with 1060 additions and 0 deletions

View File

@ -0,0 +1,590 @@
<!doctype linuxdoc system>
<!-- TODO: loader= -->
<!-- Lilo mini-howto -->
<article>
<!-- Title information -->
<title>Lilo mini-Howto
<author>Miroslav Skoric (<tt/m.skoric@eunet.yu/)
<date>v3.00, 24 July 2000
<abstract>
LILO is the most used <bf/Li/nux <bf/Lo/ader for the x86 flavour of
Linux; I'll call it Lilo rather than LILO here because I don't
appreciate uppercase. This file describes some typical Lilo
installations. It's intended as a supplement to the Lilo User's
Guide. I think examples are informative even if your setup isn't much
like mine. I hope this saves you trouble. Since Lilo's own
documentation is very good, who's interested in the details is
referred to /usr/doc/lilo*
<p>
This version of Lilo mini-HOWTO is based on work of Cameron Spitzer
(<tt/cls@truffula.sj.ca.us/) and Alessandro Rubini (<tt/rubini@linux.it/).
</abstract>
<!-- Table of contents -->
<toc>
<!-- Begin the document -->
<sect>Introduction
<p>
Although the documentation found in Lilo's sources (the one installed
in <tt>/usr/doc/lilo</tt>-version) is very comprehensive, most Linux
users experience some trouble in building their own
<tt>/etc/lilo.conf</tt> file. This document is meant to support them
by giving the minimal information and by showing five sample
installations:
<itemize>
<item>The first example is the classical ``Linux and other'' installation.
<item>The next one shows how to install Lilo on a hard drive
connected as <tt>/dev/hdc</tt> that will boot as <tt>/dev/hda</tt>.
This is usually needed when you install a new Linux drive from
your own running system. This also tells how to boot from SCSI
disks when your BIOS is modern enough.
<item>The third example shows how to boot a Linux system whose root
partition can't be accessed by the BIOS.
<item>The next sample file is used to access huge disks, that neither the
BIOS nor DOS can access easily (this one is somehow outdated).
<item>The last example shows how to restore a damaged disk,
if the damage resulted from installing another
operating system).
</itemize>
<p>
The last three examples are by Cameron, <tt/cls@truffula.sj.ca.us/>,
who wrote the original document. Alessandro <tt/rubini@linux.it/>
doesn't run anything but Linux, so he can't check
nor update them by himself. Needless to say, any feedback is welcome.
<sect>Background Information and Standard Installation
<p>
When Lilo boots the system, it uses BIOS calls to load the Linux
kernel off the disk (IDE drive, floppy or whatever). Therefore, the
kernel must live in some place that can be accessed by the bios.
<p>
At boot time, Lilo is not able to read filesystem data, and any
pathname you put in <tt>/etc/lilo.conf</tt> is resolved at
installation time (when you invoke <em>/sbin/lilo</em>). Installation
time is when the program builds the tables that list which sectors are
used by the files used to load the operating system. As a consequence,
all of these files must live in a partition that can be accessed by
the BIOS (the files are usually located in the <tt>/boot</tt>
directory, this means that only the root partition of your Linux
system needs to be accessed via the BIOS).
<p>
Another consequence of being BIOS-based is that you must reinstall the
loader (i.e., you must reinvoke <em>/sbin/lilo</em>) any time you
modify the Lilo setup. Whenever you recompile your kernel and
overwrite your old image you must reinstall Lilo.
<sect1>Where Should I Install Lilo?
<p>
The <tt/boot=/ directive in <tt>/etc/lilo.conf</tt> tells Lilo where
it should place its primary boot loader. In general, you can either
specify the master boot record (<tt>/dev/hda</tt>) or the root
partition of your Linux installation (is usually is <tt>/dev/hda1</tt>
or <tt>/dev/hda2</tt>).
<p>
If you have another operating system installed in your hard drive,
you'd better install Lilo to the root partition instead of the MBR. In
this case, you must mark the partition as ``bootable'' using the ``a''
command of <em>fdisk</em> or the ``b'' command of <em>cfdisk</em>. If
you don't overwrite the master boot sector you'll find it easier to
uninstall Linux and Lilo if needed.
<p>
Of course, you always have a way to avoid some "rules" like above. Well,
you may install Lilo to the MBR even if you already have another operating
system installed there. For example, if you installed Windows NT 4.0 as the
first operating system on your machine, then NT's boot loader was placed into
the MBR so you were able to boot NT without problems. After you installed
Linux and chose to install Lilo to the MBR, Lilo rewrote NT's boot loader.
Next time you boot your machine, you won't be able to boot NT. But, there
is no problem. You just should edit your /etc/lilo.conf and add a new entry
for NT. Next time you re-boot your system, there will be the new added entry
for NT under Lilo.
<sect1>How Should I Configure my IDE Hard Drives?
<p>
I personally don't use LBA or LARGE settings in the BIOS (but I only
run Linux); they are horrible kludges forced on by design deficiencies
in the PC world. This requires that the kernel lives in the first 1024
cylinders, but this is not a problem as long as you partition your
hard drives and keep root small (as you should do anyways).
<p>
If your hard disk already carries another operating system, you won't
be able to modify the BIOS settings, or the old system won't work any
more. All recent Lilo distribution are able to deal with LBA and LARGE
disk settings.
<p>
Note that the "<tt/linear/" keyword in <tt>/etc/lilo.conf</tt> can
help in dealing with geometry problems. The keyword instructs Lilo to
use linear sector addresses instead of sector/head/cylinder tuples.
Conversion to 3D addresses is delayed to run-time, therefore making
the setup more immune to geometry problems.
<p>
If you have more than one hard disk and some of them are only used by
Linux and are not involved in the boot process, you can tell your BIOS
that they are not installed. Your system will boot more quickly and
Linux will autodetect all the disks in no time. I often switch disks
in my computers, but I never touch the BIOS configuration.
<sect1>How Can I Interact at Boot Time?
<p>
When you see the Lilo prompt, you can hit the &lt;Tab&gt; key to show
the list of possible choices. If Lilo is not configured to be
interactive, press and hold the &lt;Alt&gt; or &lt;Shift&gt; key
before the ``LILO'' message appears.
<p>
If you choose to boot a Linux kernel, you can add command-line
arguments after the name of the system you choose. The kernel accepts
many command-line arguments. All the arguments are listed in the
``BootPrompt-HOWTO'' by Paul Gortmaker, and I won't replicate it
here. A few command line arguments, however, are particularly
important and worth describing here:
<itemize>
<item><tt/root=/: you can tell the Linux kernel to mount as root
a different partition than the one appearing in <tt/lilo.conf/.
For example, my system has a tiny partition hosting a minimal Linux
installation, and I've been able to boot the system after
destroying my root partition by mistake.
<item><tt/init=/: verson 1.3.43 and newer of the Linux kernel can
execute another command instead of <tt>/sbin/init</tt>, as specified
on the command line. If you experience bad problems
during the boot process, you can access the bare system by
specifying <tt>init=/bin/sh</tt> (when you are at the shell
prompt you most likely will need to mount your disks: try
``<tt>mount -w -n -o remount /; mount -a</tt>'',
and remember to ``<tt>umount -a</tt>'' before turning off
the computer).
<item>A number: by specifying a number on the kernel command line, you
instruct <em>init</em> to enter a specific run-level (the
default is usually 3 or 2, according to the distribution you chose).
Refer to the <em>init</em> documentation, to <tt>/etc/inittab</tt>
and to <tt>/etc/rc*.d</tt> to probe further.
</itemize>
<sect1>How Can I Uninstall Lilo?
<p>
When Lilo overwrites a boot sector, it saves a backup copy in
<tt>/boot/boot.</tt><em/xxyy/, where <em/xxyy/ are the major and minor
numbers of the device, in hex. You can see the major and minor numbers
of your disk or partition by running ``<tt>ls -l
/dev/</tt><em/device/''. For example, the first sector of
<tt>/dev/hda</tt> (major 3, minor 0) will be saved in
<tt>/boot/boot.0300</tt>, installing Lilo on <tt>/dev/fd0</tt> creates
<tt>/boot/boot.0200</tt> and installing on <tt>/dev/sdb3</tt> (major
8, minor 19) creates <tt>/boot/boot.0813</tt>. Note that Lilo won't
create the file if there is already one so you don't need to care about
the backup copy whenever you reinstall Lilo (for example, after
recompiling your kernel). The backup copies found in <tt>/boot/</tt>
are always the snapshot of the situation before installing any Lilo.
<p>
If you ever need to uninstall Lilo (for example, in the unfortunate
case you need to uninstall Linux), you just need to restore the
original boot sector. If Lilo is installed in <tt>/dev/hda</tt>, just
do ``<tt>dd if=/boot/boot.0300 of=/dev/hda bs=446 count=1</tt>'' (I
personally just do ``<tt>cat /boot/boot.0300 > /dev/hda</tt>'', but
this is not safe, as this will restore the original partition table as
well, which you might have modified in the meanwhile). This command is
much easier to run than trying ``<tt>fdisk /mbr</tt>'' from a DOS
shell: it allows you to cleanly remove Linux from a disk without ever
booting anything but Linux. After removing Lilo remember to run Linux'
<em>fdisk</em> to destroy any Linux partition (DOS' <em>fdisk</em> is
unable to remove non-dos partitions).
<p>
If you installed Lilo on your root partition (e.g., <tt>/dev/hda2</tt>),
nothing special needs to be done to uninstall Lilo. Just run Linux'
<em>fdisk</em> to remove Linux partitions from the partition
table. You must also mark the DOS partition as bootable.
<sect>The Simple Configuration
<p>
Most Lilo installations use a configuration file like the
following one:
<verb>
boot = /dev/hda # or your root partition
delay = 10 # delay, in tenth of a second (so you can interact)
vga = 0 # optional. Use "vga=1" to get 80x50
#linear # try "linear" in case of geometry problems.
image = /boot/vmlinux # your zImage file
root = /dev/hda1 # your root partition
label = Linux # or any fancy name
read-only # mount root read-only
other = /dev/hda4 # your dos partition, if any
table = /dev/hda # the current partition table
label = dos # or any non-fancy name
</verb>
<p>
You can have multiple ``image'' and ``other'' sections if you want. It's
not uncommon to have several kernel images configured in your
<em>lilo.conf</em>, at least if you keep up to date with kernel
development.
<sect1>How to Deal with Big Kernels
<p>
If you compile a ``zImage'' kernel and it is too big to fit in half a
megabyte (this is commong with new 2.1 kernels), you should build a
``big zImage'' instead: ``<tt>make bzImage</tt>''. To boot a big
kernel image nothing special is needed, but you need version 18 or
newer of Lilo. If your installation is older, you should upgrade your
Lilo package.
<sect1>Other Sources of Information
<p>
In addition to the Lilo docs, there are a number of mini-howto's that
can be useful for your needs. All of them are called
``Linux+<em/foobarOS/'', for some <em/foobarOS/, they deal with
coexistence of Linux and other operationg system(s). For example,
"NT OS Loader + Linux mini-HOWTO" by Bernd Reichert, describes how to
add an entry for Linux under existing Windows NT Loader's menu. Also,
``Multiboot-with-LILO'' describes how the various Windows flavours can
be made to coexist with Linux. Here we will talk about adding an entry
for Windows NT under the existing Lilo menu.
<sect1>How to Boot Windows NT from Lilo menu
<p>
Here I will give you an order of routines you have to do if you want
to have both Linux and NT entries under Lilo menu:
<itemize>
<item>First of all, I would suggest you to install a fresh copy of
Windows NT 4.0 on your hard disk. I suppose that you already
made a backup of your important data, so the NT installation
shouldn't be a problem. During the NT installation, setup is
not going to ask you where to place NT's boot loader, so it
would be placed into the MBR (Master Boot Record) of your hard
disk. But, there is a possibility for a previous content of
the MBR to remain within the MBR (especially any previous
Lilo), so I would suggest you (befrre installation of NT) to
boot the computer with a DOS floppy diskette having DOS version
of FDISK. At the prompt a:\ just enter the command: fdisk /mbr
and restart the computer again (without that floppy).
<item>After you have successfully installed your NT, you will see that
it uses the whole hard disk or a specific partition of the hard
disk (depending on what you decided during the setup process).
So, it is advisible to 'shrink' the partition where NT resides
in order to make some free space on the disk. Onto that free space
you will install your Linux. After you have your NT configured
and running, you have to boot your computer using a floppy
diskette with Partition Magic utility by Power Quest. It is a
graphical tool able to see all partitions on all hard disks you
have. The best thing is that you can make some changes with your
partitions but not to destroy your existing data. One of the
available changes is to make your existing partition(s) smaller,
so to get some free space on the disk(s) for other purposes.
Although you are advised to make a backup before you make any
changes to the partitions, I usually practise to 'shrink' NT's
partition before I installed anything but NT itself (so, if
needed, a repetitive re-installation wouldn't be a problem).
Well, Partition Magic (or any other similar utility you are
familiar with) will shrink your NT's partition (either NTFS or
FAT) to a smaller measure and place it to either the beginning
or to the end of the previous measure. It means that you may
choose to have your 'shrinked' NT partition at the beginning
or at the end of your disk (I usually choose NT to be at the
beginning, so the ending part of the disk will become a 'free
space'). After the 'shrinkin' is finished, you may re-boot your
NT in order to check the new situation: you may use Windows
Explorer or Disk Administrator for that.
<item>So far so good. Next step is to install your Linux. Case you
are familiar with RedHat distribution (I hope with other distros
is the same or similar), you start by putting your installation
CD in the drive and re-boot the computer). Well, when you are about
to choose what type of installation it will be (Gnome or KDE
Workstation, Custom, etc.) you may choose whatever you planned
before, but I would suggest to install a Workstation at first.
This is good because Linux setup will find automatically the
free space on the (first) hard disk, make all partitions needed
for Linux, format them properly, make majority of option by
default so you won't have much pain during the setup (later, if
you want, you may either to add missing components or re-install
Linux as Custom over the existing linux partitions). Lilo should
go to the MBR.
<item>After it looks that Linux installation is finished, you are going
to re-start the computer and there there you will only see Lilo
with one Linux entry to boot (or maybe more than one Linux
entry, in case your hardware is multi-processor one). But, don't
panic! Your Windows NT is still there where you had installed it
before Linux. You should become some familiar with Linux as soon
as possible, in order to be able to find and edit your new
/etc/lilo.conf file. When you open this file for the first time,
you'll see that there is only one (or more) Linux entry. Well,
you should know the exact position (read: a partition) where
Windows NT has been installed, so you could add an appropriate
entry into /etc/lilo.conf file. After you do that, restart Lilo
and, after the next re-boot, you will have both 'linux' and 'nt'
entries under Lilo menu.
<sect>Installing <tt/hdc/ to Boot as <tt/hda/ and Using <tt>bios=</tt>
<p>
Lilo allows to map the kernel image from one disk and instruct the
BIOS to retrieve it from another disk. For example, it's common for me
to install Linux on a disk I connect to <tt/hdc/ (master disk of
secondary controller) and boot it as a standalong system on the primary
IDE controller of another computer. I copied the installation floppy
to a tiny partition, so I can run <em>chroot</em> in a virtual
console to install <tt/hdc/ while I use the system to do something else.
<p>
The <em>lilo.conf</em> file I use to install Lilo looks like:
<verb>
# This file must be used from a system running off /dev/hdc
boot = /dev/hdc # overwrite MBR of hdc
disk = /dev/hdc # tell how hdc will look like:
bios = 0x80 # the bios will see it as first drive
delay = 0
vga = 0
image = /boot/vmlinux # this is on /dev/hdc1
root = /dev/hda1 # but at boot it will be hda1
label = Linux
read-only
</verb>
<p>
This configuration file must be read by a Lilo running <bf>off
/dev/hdc1</bf>. The Lilo maps that get written the boot sector
(<tt>/dev/hdc</tt>) must refer to the files in <tt>/boot</tt>
(currently installed as hdc); such files will be accessed under hda
when this disk will be booted as a standalone system.
<p>
I call this configuration file <tt>/mnt/etc/lilo.conf.hdc</tt>
(<tt>/mnt</tt> is where hdc is mounted during the installation. I
install Lilo by invoking ``<tt>cd /mnt; chroot . sbin/lilo -C
/etc/lilo.conf.hdc</tt>''. Refer to the manual page for
<em>chroot</em> if this looks magic.
<p>
The ``<tt>bios=</tt>'' directive in <tt>lilo.conf</tt> is used to tell
Lilo what the BIOS thinks of your devices. BIOS calls identify floppy
disks and hard drives with a number: 0x00 and 0x01 select the floppy
drives, 0x80 and the following numbers select hard disks (old BIOSes
can only access two disks). The meaning of ``<tt>bios = 0x80</tt> in
the previous sample file is therefore ``use 0x80 in your BIOS calls
for <tt>/dev/hdc</tt>''.
<p>
This Lilo directive can be handy in other situations, for example when
your BIOS is able to boot from SCSI disks instead of IDE ones. When
both IDE and SCSI devices are there, Lilo can't tell whether 0x80 will
refer to one or the other because the user is able to choose it in the
BIOS configuration menus, and the BIOS can't be accessed while Linux
is running.
<p>
By default, Lilo assumes that IDE drives are mapped first by the BIOS,
but this can be overridden by using instructions like these in
<tt>/etc/lilo.conf</tt>:
<verb>
disk = /dev/sda
bios = 0x80
</verb>
<sect>Using Lilo When the BIOS Can't See the Root Partition
<p>
I have two IDE drives, and a SCSI drive. The SCSI drive can't be seen
from BIOS. The Linux Loader, Lilo, uses BIOS calls and can only see
drives that BIOS can see. My stupid AMI BIOS will only boot from "A:"
or "C:" My root file system is on a partition on the SCSI drive.
<p>
The solution consists in storing the kernel, map file, and chain
loader in a Linux partition on the first IDE. Notice that it is not
necessary to keep your kernel on your root partition.
<p>
The second partition on my first IDE (<tt>/dev/hda2</tt>, the Linux
partition used to boot the system) is mounted on <tt>/u2</tt>. Here
is the <tt>/etc/lilo.conf</tt> file I used.
<verb>
# Install Lilo on the Master Boot Record
# on the first IDE.
#
boot = /dev/hda
# /sbin/lilo (the installer) copies the Lilo boot record
# from the following file to the MBR location.
install = /u2/etc/lilo/boot.b
#
# I wrote a verbose boot menu. Lilo finds it here.
message = /u2/etc/lilo/message
# The installer will build the following file. It tells
# the boot-loader where the blocks of the kernels are.
map = /u2/etc/lilo/map
compact
prompt
# Wait 10 seconds, then boot the 1.2.1 kernel by default.
timeout = 100
# The kernel is stored where BIOS can see it by doing this:
# cp -p /usr/src/linux/arch/i386/boot/zImage /u2/z1.2.1
image = /u2/z1.2.1
label = 1.2.1
# Lilo tells the kernel to mount the first SCSI partition
# as root. BIOS does not have to be able to see it.
root = /dev/sda1
# This partition will be checked and remounted by /etc/rc.d/rc.S
read-only
# I kept an old Slackware kernel lying around in case I built a
# kernel that doesn't work. I actually needed this once.
image = /u2/z1.0.9
label = 1.0.9
root = /dev/sda1
read-only
# My DR-DOS 6 partition.
other = /dev/hda1
loader=/u2/etc/lilo/chain.b
label = dos
alias = m
</verb>
<sect>Accessing Huge Disks When the BIOS Can't
<p>
The system in my office has a 1GB IDE drive. The BIOS can only see
the first 504 MB of the IDE. (Where MB means 2**10 bytes, not 10**6
bytes.) So I have MS-DOS on a 350 MB partition <tt>/dev/hda1</tt> and
my Linux root on a 120 MB partition <tt>/dev/hda2</tt>.
<p>
MS-DOS was unable to install itself correctly when the drive was
fresh. Novell DOS 7 had the same problem. Luckily for me, "Options
by IBM" forgot to put the "OnTrack" diskette in the box with the
drive. The drive was supposed to come with a product called "OnTrack
Disk Manager." If you only have MSDOS, I guess you have to use it.
<p>
So I made a partition table with Linux' fdisk. MSDOS-6.2 refused to
install itself in <tt>/dev/hda1</tt>. It said something like ``this
release of MS-DOS is for new installations. Your computer already has
MS-DOS so you need to get an upgrade release from your dealer.''
Actually, the disk was brand new.
<p>
What a crock! So I ran Linux' fdisk again and deleted partition 1
from the table. This satisfied MS-DOS 6.2 which proceeded to create
the exact same partition 1 I had just deleted and installed itself.
MS-DOS 6.2 wrote its Master Boot Record on the drive, but it couldn't
boot.
<p>
Luckily I had a Slackware kernel on floppy (made by the Slackware
installation program "setup"), so I booted Linux and wrote Lilo over
MS-DOS' broken MBR. This works. Here is the <tt>/etc/lilo.conf</tt>
file I used:
<verb>
boot = /dev/hda
map = /lilo-map
delay = 100
ramdisk = 0 # Turns off ramdisk in Slackware kernel
timeout = 100
prompt
disk = /dev/hda # BIOS only sees first 500 MB.
bios = 0x80 # specifies the first IDE.
sectors = 63 # get the numbers from your drive's docs.
heads = 16
cylinders = 2100
image = /vmlinuz
append = "hd=2100,16,63"
root = /dev/hda2
label = linux
read-only
vga = extended
other = /dev/hda1
label = msdos
table = /dev/hda
loader = /boot/chain.b
</verb>
<p>
After I installed these systems, I verified that the partition
containing the zImage, boot.b, map, chain.b, and message files can use
an msdos file system, as long as it is not "stackered" or
"doublespaced." So I could have made the DOS partition on
<tt>/dev/hda1</tt> 500 MB.
<p>
I have also learned that "OnTrack" would have written a partition
table starting a few dozen bytes into the drive, instead of at the
beginning, and it is possible to hack the Linux IDE driver to work
around this problem. But installing would have been impossible with
the precompiled Slackware kernel. Eventually, IBM sent me an
"OnTrack" diskette. I called OnTrack's technical support. They told
me Linux is broken because Linux doesn't use BIOS. I gave their
diskette away.
<sect>Booting from a Rescue Floppy
<p>
Next, I installed Windows-95 on my office system. It blew away my nice
Lilo MBR, but it left my Linux partitions alone. Kernels take a long
time to load from floppy, so I made a floppy with a working Lilo setup
on it, which could boot my kernel from the IDE.
I made the lilo floppy like so:
<verb>
fdformat /dev/fd0H1440 # lay tracks on virgin diskette
mkfs -t minix /dev/fd0 1440 # make file system of type minix
mount /dev/fd0 /mnt # mount in the standard tmp mount point
cp -p /boot/chain.b /mnt # copy the chain loader over
lilo -C /etc/lilo.flop # install Lilo and the map on the diskette.
umount /mnt
</verb>
<p>
Notice that the diskette <bf>must be mounted when you run the
installer</bf> so that Lilo can write its map file properly.
<P>
This file is /etc/lilo.flop. It's almost the same as the last one:
<verb>
# Makes a floppy that can boot kernels from HD.
boot = /dev/fd0
map = /mnt/lilo-map
delay = 100
ramdisk = 0
timeout = 100
prompt
disk = /dev/hda # 1 GB IDE, BIOS only sees first 500 MB.
bios=0x80
sectors = 63
heads = 16
cylinders = 2100
image = /vmlinuz
append = "hd=2100,16,63"
root = /dev/hda2
label = linux
read-only
vga = extended
other = /dev/hda1
label = msdos
table = /dev/hda
loader = /mnt/chain.b
</verb>
<p>
Finally, I needed MS-DOS 6.2 on my office system, but I didn't
want to touch the first drive. I added a SCSI controller and
drive, made an msdos file system on it with Linux' mkdosfs, and
Windows-95 sees it as "D:". But of course MSDOS will not boot
off of D:. This is not a problem when you have Lilo. I added
the following to the <tt>lilo.conf</tt> in Example 2.
<verb>
other = /dev/sda1
label = d6.2
table = /dev/sda
loader = /boot/any_d.b
</verb>
With this modification MSDOS-6.2 runs, and it thinks it is on C: and
Windows-95 is on D:.
</article>

View File

@ -0,0 +1,470 @@
<!doctype linuxdoc system>
<article>
<title>Programming Languages mini-HOWTO
</title>
<author>Risto S. Varanka
</author>
<date>Jul 22nd 2000
</date>
<abstract>A brief comparison of major programming languages for
Linux and major libraries for creating graphical user interfaces
(GUIs) under Linux
</abstract>
<toc>
<sect>Introduction
<p>Linux is a fascinating operating system because it lets any
user participate in its development. The variety of available
languages, however, can be confusing to beginning Linux
developers. This document lists the most common options for
everyday development and states some key facts about them. (Well,
``most common'' and ``key'' as I perceive them.)</p>
<!-- point to possible larger howto -->
<p>My aim is neither to review the languages nor to determine
which one is the best. Each language is a tool that fits some
jobs and some tastes. You can get further (often conflicting)
information easily, if you ask around or keep your ears open. The
Links sections in this document will give you some pointers for
your own research.</p>
<!-- perhaps there should be some freeform discussion in the
Comments part of the tables -->
<!-- why is my language not included? perhaps explain that in
detail -->
<p>There is a plethora of languages and libraries for Linux, so
this document only covers the most common languages and GUI
(Graphical User Interface) toolkits at the moment. This document
is intended to be fairly neutral, but I haven't included all
languages available. Since my judgment is undoubtedly biased in
many ways, I advise serious developers to check out the sites that
do a better job in listing all languages and libraries. Also note
that only the Linux implementations of the languages and GUI
toolkits are covered, their features on other platforms are not
discussed or implied.</p>
<p>This document is a recent addition to the LDP, so there has not
been opportunity for much community feedback. However, it is
released in hopes that it will prove useful for people interested
in programming under Linux, especially beginners. A question mark
in the tables indicates lack of information. If you can fill it
in, please contact the author. </p>
<sect1>Latest Version of the Document
<p>You can find the latest modifications at <url
url="http://www.helsinki.fi/~rvaranka/Computer/Linux/HOWTO/"
name="http://www.helsinki.fi/~rvaranka/Computer/Linux/HOWTO/"></p>
<sect1>Copyright
<p>Copyright (c) 2000 Risto Varanka.</p>
<sect1>License
<p>The following license terms apply to all LDP documents, unless
otherwise stated in the document. The LDP documents may be
reproduced and distributed in whole or in part, in any medium
physical or electronic, provided that this license notice is
displayed in the reproduction. Commercial redistribution is
permitted and encouraged. Thirty days advance notice via email to
the author(s) of redistribution is appreciated, to give the
authors time to provide updated documents. </p>
<sect2>Requirements of Modified Works
<p>All modified documents, including translations, anthologies,
and partial documents, must meet the following requirements:</p>
<p>
<enum>
<item>The modified version must be labeled as such.
<item>The person making the modifications must be identified.
<item>Acknowledgement of the original author must be retained.
<item>The location of the original unmodified document be identified.
<item>The original author's (or authors') name(s) may not be used to
assert or imply endorsement of the resulting document without
the original author's (or authors') permission.
</enum>
</p>
<p>In addition it is requested that:</p>
<p>
<enum>
<item>The modifications (including deletions) be noted.
<item>The author be notified by email of the modification in
advance of redistribution, if an email address is provided
in the document.
</enum>
</p>
<p>As a special exception, anthologies of LDP documents may
include a single copy of these license terms in a conspicuous
location within the anthology and replace other copies of this
license with a reference to the single copy of the license without
the document being considered ``modified'' for the purposes of
this section.</p>
<p>Mere aggregation of LDP documents with other documents or
programs on the same media shall not cause this license to apply
to those other works.
</p>
<p>All translations, derivative documents, or modified documents
that incorporate any LDP document may not have more restrictive
license terms than these, except that you may require distributors
to make the resulting document available in source format.</p>
<sect1>Disclaimer
<p>THIS DOCUMENT COVERS A LARGE AND CONSTANTLY CHANGING
DOMAIN. THEREFORE, THE INFORMATION CONTAINED IN THIS DOCUMENT MAY
BE INCORRECT OR OUTDATED. ALL USE OF THIS DOCUMENT AND ALL
INFORMATION CONTAINED IN IT IS AT YOUR OWN RISK. THE AUTHOR DOES
NOT GIVE ANY WARRANTY OR GUARANTEE, EITHER EXPLICIT OR
IMPLIED. </p>
<sect1>Author
<p>You are welcome to send feedback to the author at: <url
url="mailto:risto.varanka@helsinki.fi"
name="risto.varanka@helsinki.fi">.</p>
<p>Author's web site can be found at <url
url="http://www.helsinki.fi/~rvaranka/"
name="http://www.helsinki.fi/~rvaranka/">.</p>
<sect1>Credits
<p>I am thankful to several people who commented on language
issues. These conversations have given me a better view of the
different languages, and I hope future conversations will allow
this mini-HOWTO to mature over time. Especially I would like to
thank the people at the IRCNet channel #linux: Morphy, Bluesmurf,
Vadim, Zonk^, Rikkus and others whose names I have
forgotten. Thanks go also to Stig Erik Sandoe for helpful
comments.</p>
<sect1>Links
<p>Exhaustive lists of Linux development libraries and tools:</p>
<p>
<itemize>
<item><url url="http://www.freshmeat.net/appindex/development/"
name="Freshmeat">
<item><url url="http://www.hotfeet.ch/~gemi/LDT/" name="Linux
Development Tools">
<item><url url="http://www.linuxprogramming.com/"
name="linuxprogramming.com">
</itemize>
</p>
<p>The <url
url="http://www.tuxedo.org/~esr/faqs/hacker-howto.html"
name="Hacker FAQ"> by Eric S. Raymond is another interesting text
for novice Linux developers. It concentrates on some cultural and
psychological aspects of open source development. </p>
<p>Other <url url="http://www.linuxdoc.org/" name="LDP documents">
covering general programming subjects include the Reading List
HOWTO and the Linux Programmer's Guide - several more have been
written on specific subjects.</p>
<sect>Programming Languages
<!-- explain concept? -->
<p>C, Lisp and Perl are traditional hacking languages in the
GNU/Linux culture; Python, PHP, Java and C++ have gained new
ground recently.</p>
<sect1>Concepts in the Table
<p>
<descrip>
<tag>Language</tag>
A common name of the language.
<tag>Beginner</tag> Indicates how well suited the language is for
people with little programming experience. A language marked with
``yes'' should be viable for a beginner's first programming
language.
<tag>Performance</tag> How fast your applications are likely to
run when you put them into production use. Performance depends
more on your algorithmic programming skills than the actual
language. As a rule of thumb, C, C++ and Fortran are sometimes
necessary because they can offer better performance than other
languages - at other times they might be unwieldy for the desired
purpose. (One idea for unscientific ``benchmarking'' of the
languages would be to implement a simple sorting algorithm in all
of them and compare running times. This of course does not measure
the performance of the actual language - since that concept does
not make sense - but only the implementation. Of course it's also
not a very reliable or thorough method, but it would give an
example how running times in different languages can
differ. Anybody want to help me with this?)
<tag>OOP, Object-Oriented Programming vs. other paradigms</tag>
Object-oriented programming is an important programming paradigm
that is gaining popularity. In object oriented programming, data
structures and algorithms are integrated into units, often called
classes. OOP is often contrasted with procedural programming
(which uses separate algorithms and data structures). It is not
strictly dependent on language: you can do OOP in languages not
listed as such (C for example), and program in the procedural
style in languages that are listed as OOP. I've listed as OOP
languages that have special features or add-ons to facilitate OOP.
Functional languages (Lisp for example) are a bit different breed
- among other things, functional programming is a superset of
OOP. Logic programming (Prolog), also called declarative
programming, on the other hand, is not related to the other types
of programming in a similar sense.
<tag>RAD, Rapid Application Development</tag> More dependent on
the tools you are using than the actual language. There is a
HOWTO on GUI development tools for Linux, although it's out of
date. With a good graphical tool you can do RAD. RAD can be
powerful when based on code reuse as well, so free software could
provide a good starting point.
<tag>Examples</tag> Mentions fields of programming the language is
most often used in. Other good (and bad) uses exist, but they are
less typical.
<!-- explain categories in a future version -->
<tag>Comments</tag> Additional information on the language, like
capacities and dialects.
</descrip>
</p>
<!-- Check case of languages: UPPER or Capital? -->
<sect1>Major Languages
<p>
<verb>
Perl
Beginner: Yes - OOP: Yes
Examples: Scripting, sysadmin, www
Comments: Powerful for handling text and strings
Python
Beginner: Yes - OOP: Yes
Examples: Scripting, application scripting, www
Comments:
TCL
Beginner: Yes - OOP: No
Examples: Scripting, sysadmin, applications
Comments:
PHP
Beginner: Yes - OOP: Yes
Examples: Www
Comments: Popular for web databases
Java
Beginner: Yes - OOP: Yes
Examples: Cross-platform applications, www
Comments: Spreading to new areas, eg. e-commerce infrastructure
Lisp
Beginner: Yes - OOP: Functional
Examples: Emacs modes (for Elisp), AI
Comments: Variants Elisp, Clisp and Scheme
Fortran
Beginner: No - OOP: No
Examples: Mathematical (scientific) applications
Comments: Variants f77 and f90/95
C
Beginner: No - OOP: No
Examples: System programming, applications
Comments:
C++
Beginner: No - OOP: Yes
Examples: Applications
Comments:
</verb>
</p>
<!-- is Prolog really major?
Prolog
Beginner: Yes? - OOP: Declarative
Examples: Databases, AI
Comments:
-->
<sect1>Shell Programming
<p>Shells are an important programming environment, too. I haven't
covered them because I don't understand the field very thoroughly
yet. Knowledge of shells is important for anyone who works on
Linux regularly, more so for system administrators. There are
similarities between shell programming and other kinds of
scripting - often they can achieve the same goals, and you have
the option of choosing between native shell and a separate
scripting language. Among the most popular shells are bash, tcsh,
csh, ksh and zsh. You can get basic information on your shell with
the <em>man</em> command, <em>man bash</em> for example.</p>
<sect1>Other Languages
<p>Other languages of note: AWK, SED, Smalltalk, Eiffel, Ada,
Prolog, assembler, Objective C, Logo, Pascal (p2c converter)</p>
<sect1>Links
<!-- integrate these in the "table" perhaps -->
<p>
<itemize>
<item><url url="http://www.tunes.org/Review/Languages.html"
name="A general info site"> on programming languages, lots of info
and opinions
<item><url url="http://dev.scriptics.com/" name="TCL">
<item><url url="http://www.perl.org/" name="Perl">
<item><url url="http://www.python.org/" name="Python">
<item><url url="http://www.php.net" name="PHP">
<item><url url="http://www.javasoft.com/" name="Java">
<item><url url="http://clisp.cons.org/~haible/packages-clisp.html"
name="clisp">
</itemize>
</p>
<sect>GUI Toolkits
<p>The standard graphical subsystem for UNIX and Linux, called X,
has its own libraries for GUI development. They provide a
low-level programming interface to X, but tend to be hard to
use. Old end-user applications and other toolkits of course make
good use of them. Nowadays the Linux GUI scene is dominated by
GTK+ and Qt, since two popular, complete user environments - GNOME
and KDE - are based on them.</p>
<!-- Explain concept? -->
<sect1>Concepts in the Table
<p>
<descrip>
<tag>Library</tag>
Common name or abbreviation of the toolkit.
<tag>Beginner</tag>
Whether the toolkit is suitable for a newbie programmer.
<tag>License</tag>
Different licenses for different GUI toolkits have practical
significance. GTK+, TK and GNUstep licenses allow you to develop both open
source and closed source applications without paying for a
license. Motif license requires payment, while the QT license
requires payment only if you write closed source programs.
<!-- refer to freedom as in free speech, check validity -->
<tag>Language</tag>
The language that is most often used with the toolkit.
<tag>Bindings</tag>
Other languages which can use the toolkit.
<tag>Examples</tag>
Applications that use the toolkit.
<tag>Comments</tag>
Additional information on the toolkit.
</descrip>
</p>
<sect1>Major GUI Toolkits
<!-- Change to the other format? Would be good since could include
more info on WINGS and the GNUstep project. -->
<p>
<table>
<tabular ca="llllll">Library|Beginner|License|Language|Bindings
|Examples|Comments@
TK|
Yes|
Free|
TCL|
Perl, Python, others|
make xconfig, TKDesk|
@
GTK+|
No|
Free (LGPL)|
C|
Perl, C++, Python, many others|
GNOME, Gimp|
Very popular@
QT|
No|
Free for open source|
C++|
Python, Perl, C, others?|
KDE|
Very popular@
Motif|
No|
Non-free|
C/C++|
Python, others?|
Netscape, Wordperfect|
<url url="http://www.lesstif.org/" name="Lesstif"> is
a free replacement@
GNUstep|
No|
Free (LGPL)|
Objective C|
Guile, Java?|
None widely known, but see the
<url url="http://www.gnustep.org/resources/apps.html"
name="application list">|
GNUstep is still under development@
</tabular>
</table>
</p>
<p></p>
<sect1>Links
<p>
<itemize>
<item><url url="http://dev.scriptics.com/" name="TK">
<item><url url="http://www.gtk.org/" name="GTK+">
<item><url url="http://www.troll.no/" name="QT">
<item><url url="http://www.metrolink.com/" name="Motif">
<item><url url="http://www.gnustep.org/" name="GNUstep">
</itemize>
</p>
</article>