home *** CD-ROM | disk | FTP | other *** search
/ Hackers Toolkit v2.0 / Hackers_Toolkit_v2.0.iso / HTML / archive / Unix / HOWTOs / KERNEL-H < prev    next >
Text File  |  1999-11-04  |  57KB  |  1,264 lines

  1.   The Linux Kernel HOWTO
  2.   Brian Ward, bri@blah.math.tu-graz.ac.at
  3.   v0.80, 26 May 1997
  4.  
  5.   This is a detailed guide to kernel configuration, compilation,
  6.   upgrades, and troubleshooting for ix86-based systems.
  7.  
  8.   1.  Introduction
  9.  
  10.   Should you read this document? Well, see if you've got any of the
  11.   following symptoms:
  12.  
  13.   ╖  ``Arg! This wizzo-46.5.6 package says it needs kernel release
  14.      1.8.193 and I still only have release 1.0.9!''
  15.  
  16.   ╖  There's a device driver in one of the newer kernels that you just
  17.      gotta have
  18.  
  19.   ╖  You really have no idea at all how to compile a kernel
  20.  
  21.   ╖  ``Is this stuff in the README really the whole story?''
  22.  
  23.   ╖  You came, you tried, it didn't work
  24.  
  25.   ╖  You need something to give to people who insist on asking you to
  26.      install their kernels for them
  27.  
  28.   1.1.  Read this first! (I mean it)
  29.  
  30.   Some of the examples in this document assume that you have GNU tar,
  31.   find, and xargs. These are quite standard; this should not cause
  32.   problems. It is also assumed that you know your system's filesystem
  33.   structure; if you don't, it is critical that you keep a written copy
  34.   of the mount command's output during normal system operation (or a
  35.   listing of /etc/fstab, if you can read it). This information is
  36.   important, and does not change unless you repartition your disk, add a
  37.   new one, reinstall your system, or something similar.
  38.  
  39.   The latest ``production'' kernel version at the time of this writing
  40.   was 2.0.30, meaning that the references and examples correspond to
  41.   that release. Even though I try to make this document as version-
  42.   independent as possible, the kernel is constantly under development,
  43.   so if you get a newer release, it will inevitably have some
  44.   differences. Again, this should not cause major problems, but it may
  45.   create some confusion.
  46.  
  47.   There are two versions of the linux kernel source, ``production'' and
  48.   ``development.'' Production releases begin with 1.0.x and are
  49.   currently the even-numbered releases; 1.0.x was production, 1.2.x is
  50.   production, as well as 2.0.x. These kernels are considered to be the
  51.   most stable, bug-free versions available at the time of release. The
  52.   development kernels (1.1.x, 1.3.x, etc) are meant as testing kernels,
  53.   for people willing to test out new and possibly very buggy kernels.
  54.   You have been warned.
  55.  
  56.   1.2.  A word on style
  57.  
  58.   Text that looks like this is either something that appears on your
  59.   screen, a filename, or something that can be directly typed in, such
  60.   as a command, or options to a command (if you're looking at a plain-
  61.   text file, it doesn't look any different). Commands and other input
  62.   are frequently quoted (with ` '), which causes the following classic
  63.   punctuation problem: if such an item appears at the end of a sentence
  64.   in quotes, people often type a `.' along with the command, because the
  65.   American quoting style says to put the period inside of the quotation
  66.   marks. Even though common sense (and unfortunately, this assumes that
  67.   the one with the ``common sense'' is used to the so-called American
  68.   style of quotation) should tell one to strip off the punctuation
  69.   first, many people simply do not remember, so I will place it outside
  70.   the quotation marks in such cases. In other words, when indicating
  71.   that you should type ``make config'' I would write `make config', not
  72.   `make config.'
  73.  
  74.   2.  Important questions and their answers
  75.  
  76.   2.1.  What does the kernel do, anyway?
  77.  
  78.   The Unix kernel acts as a mediator for your programs and your
  79.   hardware.  First, it does (or arranges for) the memory management for
  80.   all of the running programs (processes), and makes sure that they all
  81.   get a fair (or unfair, if you please) share of the processor's cycles.
  82.   In addition, it provides a nice, fairly portable interface for
  83.   programs to talk to your hardware.
  84.  
  85.   There is certainly more to the kernel's operation than this, but these
  86.   basic functions are the most important to know.
  87.  
  88.   2.2.  Why would I want to upgrade my kernel?
  89.  
  90.   Newer kernels generally offer the ability to talk to more types of
  91.   hardware (that is, they have more device drivers), they can have
  92.   better process management, they can run faster than the older
  93.   versions, they could be more stable than the older versions, and they
  94.   fix silly bugs in the older versions. Most people upgrade kernels
  95.   because they want the device drivers and the bug fixes.
  96.  
  97.   2.3.  What kind of hardware do the newer kernels support?
  98.  
  99.   See the Hardware-HOWTO. Alternatively, you can look at the `config.in'
  100.   file in the linux source, or just find out when you try `make config'.
  101.   This shows you all hardware supported by the standard kernel
  102.   distribution, but not everything that linux supports; many common
  103.   device drivers (such as the PCMCIA drivers and some tape drivers) are
  104.   loadable modules maintained and distributed separately.
  105.  
  106.   2.4.  What version of gcc and libc do I need?
  107.  
  108.   Linus recommends a version of gcc in the README file included with the
  109.   linux source. If you don't have this version, the documentation in the
  110.   recommended version of gcc should tell you if you need to upgrade your
  111.   libc.  This is not a difficult procedure, but it is important to
  112.   follow the instructions.
  113.  
  114.   2.5.  What's a loadable module?
  115.  
  116.   These are pieces of kernel code which are not linked (included)
  117.   directly in the kernel. One compiles them separately, and can insert
  118.   and remove them into the running kernel at almost any time. Due to its
  119.   flexibility, this is now the preferred way to code certain kernel
  120.   features. Many popular device drivers, such as the PCMCIA drivers and
  121.   the QIC-80/40 tape driver, are loadable modules.
  122.  
  123.   2.6.  How much disk space do I need?
  124.  
  125.   It depends on your particular system configuration. First, the
  126.   compressed linux source is nearly 6 megabytes large at version 2.0.10.
  127.   Most sites keep this even after unpacking.  Uncompressed, it takes up
  128.   24 MB. But that's not the end -- you need more to actually compile the
  129.   thing. This depends on how much you configure into your kernel. For
  130.   example, on one particular machine, I have networking, the 3Com 3C509
  131.   driver, and three filesystems configured, using close to 30 MB. Adding
  132.   the compressed linux source, you need about 36 MB for this particular
  133.   configuration. On another system, without network device support (but
  134.   still with networking support), and sound card support, it consumes
  135.   even more. Also, a newer kernel is certain to have a larger source
  136.   tree than an older one, so, in general, if you have a lot of hardware,
  137.   make sure that you have a big enough hard disk in that mess (and at
  138.   today's prices, I cannot help but to recommend getting another disk
  139.   space as an answer to your storage problems).
  140.  
  141.   2.7.  How long does it take?
  142.  
  143.   For most people, the answer is ``fairly long.'' The speed of your
  144.   system and the amount of memory you have ultimately determines the
  145.   time, but there is a small bit to do with the amount of stuff you
  146.   configure into the kernel. On a 486DX4/100 with 16 MB of RAM, on a
  147.   v1.2 kernel with five filesystems, networking support, and sound card
  148.   drivers, it takes around 20 minutes. On a 386DX/40 (8 MB RAM) with a
  149.   similar configuration, compilation lasts nearly 1.5 hours. It is a
  150.   generally good recommendation to make a little coffee, watch some TV,
  151.   knit, or whatever you do for fun while your machine compiles the
  152.   kernel. You can have someone else with a faster machine compile it for
  153.   you if you really have a slow machine.
  154.  
  155.   3.  How to actually configure the kernel
  156.  
  157.   3.1.  Getting the source
  158.  
  159.   You can obtain the source via anonymous ftp from ftp.funet.fi in
  160.   /pub/Linux/PEOPLE/Linus, a mirror, or other sites.  It is typically
  161.   labelled linux-x.y.z.tar.gz, where x.y.z is the version number. Newer
  162.   (better?) versions and the patches are typically in subdirectories
  163.   such as `v1.1' and `v1.2' The highest number is the latest version,
  164.   and is usually a ``test release,'' meaning that if you feel uneasy
  165.   about beta or alpha releases, you should stay with a major release.
  166.  
  167.   I strongly suggest that you use a mirror ftp site instead of
  168.   ftp.funet.fi. Here is a short list of mirrors and other sites:
  169.  
  170.   USA:         sunsite.unc.edu:/pub/Linux/kernel
  171.   USA:         tsx-11.mit.edu:/pub/linux/sources/system
  172.   UK:          sunsite.doc.ic.ac.uk:/pub/unix/Linux/sunsite.unc-mirror/kernel
  173.   Austria:     ftp.univie.ac.at:/systems/linux/sunsite/kernel
  174.   Germany:     ftp.Germany.EU.net:/pub/os/Linux/Local.EUnet/Kernel/Linus
  175.   Germany:     sunsite.informatik.rwth-aachen.de:/pub/Linux/PEOPLE/Linus
  176.   France:      ftp.ibp.fr:/pub/linux/sources/system/patches
  177.   Australia:   sunsite.anu.edu.au:/pub/linux/kernel
  178.  
  179.   In general, a mirror of sunsite.unc.edu is a good place to look.  The
  180.   file /pub/Linux/MIRRORS contains a list of known mirrors. If you do
  181.   not have ftp access, a list of BBS systems which carry linux is posted
  182.   periodically to comp.os.linux.announce; try to obtain this.
  183.  
  184.   If you were looking for general Linux information and distributions,
  185.   try http://www.linux.org.
  186.  
  187.   3.2.  Unpacking the source
  188.  
  189.   Log in as or su to `root', and cd to /usr/src.  If you installed
  190.   kernel source when you first installed linux (as most do), there will
  191.   already be a directory called `linux' there, which contains the entire
  192.   old source tree.  If you have the disk space and you want to play it
  193.   safe, preserve that directory. A good idea is to figure out what
  194.   version your system runs now and rename the directory accordingly. The
  195.   command `uname -r' prints the current kernel version.  Therefore, if
  196.   `uname -r' said `1.0.9', you would rename (with `mv') `linux' to
  197.   `linux-1.0.9'.  If you feel mildly reckless, just wipe out the entire
  198.   directory. In any case, make certain there is no `linux' directory in
  199.   /usr/src before unpacking the full source code.
  200.  
  201.   Now, in /usr/src, unpack the source with `tar zxpvf linux-
  202.   x.y.z.tar.gz' (if you've just got a .tar  file with no .gz at the end,
  203.   `tar xpvf linux-x.y.z.tar' works.).  The contents of the source will
  204.   fly by. When finished, there will be a new `linux' directory in
  205.   /usr/src. cd to linux and look over the README  file.  There will be a
  206.   section with the label `INSTALLING the kernel'.  Carry out the
  207.   instructions when appropriate -- symbolic links that should be in
  208.   place, removal of stale .o files, etc.
  209.  
  210.   3.3.  Configuring the kernel
  211.  
  212.   Note: Some of this is reiteration/clarification of a similar section
  213.   in Linus' README file.
  214.  
  215.   The command `make config' while in /usr/src/linux starts a configure
  216.   script which asks you many questions. It requires bash, so verify that
  217.   bash is /bin/bash, /bin/sh, or $BASH.
  218.  
  219.   There are some alternatives to `make config' and you may very well
  220.   find them easier and more comfortable to use. For those ``running X,''
  221.   you can try `make xconfig' if you have Tk installed (`click-o-rama' -
  222.   Nat). `make menuconfig' is for those who have (n)curses and would
  223.   prefer a text-based menu. These interfaces have one clear advantage:
  224.   If you goof up and make a wrong choice during configuration, it is
  225.   simple to go back and fix it.
  226.  
  227.   You are ready to answer the questions, usually with `y' (yes) or `n'
  228.   (no). Device drivers typically have an `m' option.  This means
  229.   ``module,'' meaning that the system will compile it, but not directly
  230.   into the kernel, but as a loadable module. A more comical way to
  231.   describe it is as ``maybe.'' Some of the more obvious and non-critical
  232.   options are not described here; see the section ``Other configuration
  233.   options'' for short descriptions of a few others.
  234.  
  235.   In 2.0.x and later, there is a `?' option, which provides a brief
  236.   description of the configuration parameter. That information is likely
  237.   to be the most up-to-date.
  238.  
  239.   3.3.1.  Kernel math emulation
  240.  
  241.   If you don't have a math coprocessor (you have a bare 386 or 486SX),
  242.   you must say `y' to this. If you do have a coprocessor and you still
  243.   say `y', don't worry too much -- the coprocessor is still used and the
  244.   emulation ignored. The only consequence is that the kernel will be
  245.   larger (costing RAM). I have been told that the math emulation is
  246.   slow; although this does not have much to do with this section, it
  247.   might be something to keep in mind when faced with sluggish X window
  248.   system performance.
  249.  
  250.   3.3.2.  Normal (MFM/RLL) disk and IDE disk/cdrom support
  251.  
  252.   You probably need to support this; it means that the kernel will
  253.   support standard PC hard disks, which most people have. This driver
  254.   does not include SCSI drives; they come later in the configuration.
  255.  
  256.   You will then be asked about the ``old disk-only'' and ``new IDE''
  257.   drivers.  You want to choose one of them; the main difference is that
  258.   the old driver only supports two disks on a single interface, and the
  259.   new one supports a secondary interface and IDE/ATAPI cdrom drives. The
  260.   new driver is 4k larger than the old one and is also supposedly
  261.   ``improved,'' meaning that aside from containing a different number of
  262.   bugs, it might improve your disk performance, especially if you have
  263.   newer (EIDE-type) hardware.
  264.  
  265.   3.3.3.  Networking support
  266.  
  267.   In principle, you would only say `y' if your machine is on a network
  268.   such as the internet, or you want to use SLIP, PPP, term, etc to dial
  269.   up for internet access. However, as many packages (such as the X
  270.   window system) require networking support even if your machine does
  271.   not live on a real network, you should say `y'. Later on, you will be
  272.   asked if you want to support TCP/IP networking; again, say `y' here if
  273.   you are not absolutely sure.
  274.  
  275.   3.3.4.  Limit memory to low 16MB
  276.  
  277.   There exist buggy 386 DMA controllers which have problems with
  278.   addressing anything more than 16 MB of RAM; you want to say `y' in the
  279.   (rare) case that you have one.
  280.  
  281.   3.3.5.  System V IPC
  282.  
  283.   One of the best definitions of IPC (Interprocess Communication) is in
  284.   the Perl book's glossary. Not surprisingly, some Perl programmers
  285.   employ it to let processes talk to each other, as well as many other
  286.   packages (DOOM, most notably), so it is not a good idea to say n
  287.   unless you know exactly what you are doing.
  288.  
  289.   3.3.6.  Processor type (386, 486, Pentium, PPro)
  290.  
  291.   (in older kernels: Use -m486 flag for 486-specific optimizations)
  292.  
  293.   Traditionally, this compiled in certain optimizations for a particular
  294.   processor; the kernels ran fine on other chips, but the kernel was
  295.   perhaps a bit larger. In newer kernels, however, this is no longer
  296.   true, so you should enter the processor for which you are compiling
  297.   the kernel. A ``386'' kernel will work on all machines.
  298.  
  299.   3.3.7.  SCSI support
  300.  
  301.   If you have SCSI devices, say `y'. You will be prompted for further
  302.   information, such as support for CD-ROM, disks, and what kind of SCSI
  303.   adapter you have. See the SCSI-HOWTO for greater detail.
  304.  
  305.   3.3.8.  Network device support
  306.  
  307.   If you have a network card, or you would like to use SLIP, PPP, or a
  308.   parallel port adapter for connecting to the Internet, say `y'. The
  309.   config script will prompt for which kind of card you have, and which
  310.   protocol to use.
  311.  
  312.   3.3.9.  Filesystems
  313.  
  314.   The configure script then asks if you wish to support the following
  315.   filesystems:
  316.  
  317.   Standard (minix) - Newer distributions don't create minix filesystems,
  318.   and many people don't use it, but it may still be a good idea to
  319.   configure this one. Some ``rescue disk'' programs use it, and still
  320.   more floppies may have a minix filesystem, since the minix filesystem
  321.   is less painful to use on a floppy.
  322.  
  323.   Extended fs - This was the first version of the extended filesystem,
  324.   which is no longer in widespread use. Chances are that you'll know it
  325.   if you need it and that if you are doubt, you do not need it.
  326.  
  327.   Second extended - This is widely used in new distributions. You
  328.   probably have one of these, and need to say `y'.
  329.  
  330.   xiafs filesystem - At one time, this was not uncommon, but at the time
  331.   of this writing, I did not know of anyone using it.
  332.  
  333.   msdos - If you want to use your MS-DOS hard disk partitions, or mount
  334.   MS-DOS formatted floppy disks, say `y'.
  335.  
  336.   umsdos - This filesystem expands an MS-DOS filesystem with usual Unix-
  337.   like features such as long filenames. It is not useful for people
  338.   (like me) who ``don't do DOS.''
  339.  
  340.   /proc - Another one of the greatest things since powdered milk (idea
  341.   shamelessly stolen from Bell Labs, I guess). One doesn't make a proc
  342.   filesystem on a disk; this is a filesystem interface to the kernel and
  343.   processes. Many process listers (such as `ps') use it. Try `cat
  344.   /proc/meminfo' or `cat /proc/devices' sometime.  Some shells (rc, in
  345.   particular) use /proc/self/fd  (known as /dev/fd on other systems) for
  346.   I/O. You should almost certainly say `y' to this; many important linux
  347.   tools depend on it.
  348.  
  349.   NFS - If your machine lives on a network and you want to use
  350.   filesystems which reside on other systems with NFS, say `y'.
  351.  
  352.   ISO9660 - Found on most CD-ROMs. If you have a CD-ROM drive and you
  353.   wish to use it under Linux, say `y'.
  354.  
  355.   OS/2 HPFS - At the time of this writing, a read-only fs for OS/2 HPFS.
  356.  
  357.   System V and Coherent - for partitions of System V and Coherent
  358.   systems (These are other PC Unix variants).
  359.  
  360.   3.3.9.1.  But I don't know which filesystems I need!
  361.  
  362.   Ok, type `mount'. The output will look something like this:
  363.  
  364.            blah# mount
  365.            /dev/hda1 on / type ext2 (defaults)
  366.            /dev/hda3 on /usr type ext2 (defaults)
  367.            none on /proc type proc (defaults)
  368.            /dev/fd0 on /mnt type msdos (defaults)
  369.  
  370.   Look at each line; the word next to `type' is the filesystem type. In
  371.   this example, my /  and /usr filesystems are second extended, I'm
  372.   using /proc, and there's a floppy disk mounted using the msdos (bleah)
  373.   filesystem.
  374.  
  375.   You can try `cat /proc/filesystems' if you have /proc currently
  376.   enabled; it will list your current kernel's filesystems.
  377.  
  378.   The configuration of rarely-used, non-critical filesystems can cause
  379.   kernel bloat; see the section on modules for a way to avoid this and
  380.   the ``Pitfalls'' section on why a bloated kernel is undesirable.
  381.  
  382.   3.3.10.  Character devices
  383.  
  384.   Here, you enable the drivers for your printer (parallel printer, that
  385.   is), busmouse, PS/2 mouse (many notebooks use the PS/2 mouse protocol
  386.   for their built-in trackballs), some tape drives, and other such
  387.   ``character'' devices. Say `y' when appropriate.
  388.  
  389.   Note: Selection is a program which allows the use of the mouse outside
  390.   of the X window system for cut and paste between virtual consoles.
  391.   It's fairly nice if you have a serial mouse, because it coexists well
  392.   with X, but you need to do special tricks for others. Selection
  393.   support was a configuration option at one time, but is now standard.
  394.  
  395.   Note 2: Selection is now considered obsolete. ``gpm'' is the name of
  396.   the new program. It can do fancier things, such translate mouse
  397.   protocols, handle multiple mice, ..
  398.  
  399.   3.3.11.  Sound card
  400.  
  401.   If you feel a great desire to hear biff bark, say `y', and later on,
  402.   another config program will compile and ask you all about your sound
  403.   board. (A note on sound card configuration: when it asks you if you
  404.   want to install the full version of the driver, you can say `n' and
  405.   save some kernel memory by picking only the features which you deem
  406.   necessary.) I highly recommend looking at the  Sound-HOWTO for more
  407.   detail about sound support if you have a sound card.
  408.  
  409.   3.3.12.  Other configuration options
  410.  
  411.   Not all of the configuration options are listed here because they
  412.   change too often or fairly self-evident (for instance, 3Com 3C509
  413.   support to compile the device drive for this particular ethernet
  414.   card).  There exists a fairly comprehensive list of all the options
  415.   (plus a way to place them into the Configure script) put together by
  416.   Axel Boldt (axel@uni-paderborn.de) with the following URL:
  417.  
  418.        http://math-www.uni-paderborn.de/~axel/config_help.html
  419.  
  420.   or via anonymous FTP at:
  421.  
  422.        ftp://sunsite.unc.edu/pub/Linux/kernel/config/krnl_cnfg_hlp.x.yz.tgz
  423.  
  424.   where the x.yz is the version number.
  425.  
  426.   For later (2.0.x and later) kernels, this has been integrated into the
  427.   source tree.
  428.  
  429.   3.3.13.  Kernel hacking
  430.  
  431.   >From Linus' README:
  432.  
  433.   the ``kernel hacking'' configuration details usually result in a
  434.   bigger or slower kernel (or both), and can even make the kernel less
  435.   stable by configuring some routines to actively try to break bad code
  436.   to find kernel problems (kmalloc()).  Thus you should probably answer
  437.   `n' to the questions for a ``production'' kernel.
  438.  
  439.   3.4.  Now what? (The Makefile)
  440.  
  441.   After you make config, a message tells you that your kernel has been
  442.   configured, and to ``check the top-level Makefile for additional
  443.   configuration,'' etc.
  444.  
  445.   So, look at the Makefile. You probably will not need to change it, but
  446.   it never hurts to look. You can also change its options with the
  447.   `rdev' command once the new kernel is in place.
  448.  
  449.   4.  Compiling the kernel
  450.  
  451.   4.1.  Cleaning and depending
  452.  
  453.   When the configure script ends, it also tells you to `make dep' and
  454.   (possibly) `clean'.  So, do the `make dep'. This insures that all of
  455.   the dependencies, such the include files, are in place. It does not
  456.   take long, unless your computer is fairly slow to begin with.  For
  457.   older versions of the kernel, when finished, you should do a `make
  458.   clean'.  This removes all of the object files and some other things
  459.   that an old version leaves behind. In any case, do not forget this
  460.   step before attempting to recompile a kernel.
  461.  
  462.   4.2.  Compile time
  463.  
  464.   After depending and cleaning, you may now `make zImage' or `make
  465.   zdisk' (this is the part that takes a long time.).  `make zImage' will
  466.   compile the kernel, and leave a file in arch/i386/boot called `zImage'
  467.   (among other things). This is the new compressed kernel. `make zdisk'
  468.   does the same thing, but also places the new zImage on a floppy disk
  469.   which you hopefully put in drive ``A:''.  `zdisk' is fairly handy for
  470.   testing new kernels; if it bombs (or just doesn't work right), just
  471.   remove the floppy and boot with your old kernel. It can also be a
  472.   handy way to boot if you accidentally remove your kernel (or something
  473.   equally as dreadful). You can also use it to install new systems when
  474.   you just dump the contents of one disk onto the other (``all this and
  475.   more! NOW how much would you pay?'').
  476.  
  477.   All even halfway reasonably recent kernels are compressed, hence the
  478.   `z' in front of the names. A compressed kernel automatically
  479.   decompresses itself when executed.
  480.  
  481.   4.3.  Other ``make''ables
  482.  
  483.   `make mrproper' will do a more extensive `clean'ing.  It is sometimes
  484.   necessary; you may wish to do it at every patch. `make mrproper' will
  485.   also delete your configuration file, so you might want to make a
  486.   backup of it (.config) if you see it as valuable.
  487.  
  488.   `make oldconfig' will attempt to configure the kernel from an old
  489.   configuration file; it will run through the `make config' process for
  490.   you. If you haven't ever compiled a kernel before or don't have an old
  491.   config file, then you probably shouldn't do this, as you will most
  492.   likely want to change the default configuration.
  493.  
  494.   See the section on modules for a description of `make modules'.
  495.  
  496.   4.4.  Installing the kernel
  497.  
  498.   After you have a new kernel that seems to work the way you want it to,
  499.   it's time to install it. Most people use LILO (Linux Loader) for this.
  500.   `make zlilo' will install the kernel, run LILO on it, and get you all
  501.   ready to boot, BUT ONLY if lilo is configured in the following way on
  502.   your system: kernel is /vmlinuz, lilo is in /sbin, and your lilo
  503.   config (/etc/lilo.conf) agrees with this.
  504.  
  505.   Otherwise, you need to use LILO directly. It's a fairly easy package
  506.   to install and work with, but it has a tendency to confuse people with
  507.   the configuration file.  Look at the config file (either
  508.   /etc/lilo/config for older versions or /etc/lilo.conf for new
  509.   versions), and see what the current setup is. The config file looks
  510.   like this:
  511.  
  512.       image = /vmlinuz
  513.           label = Linux
  514.           root = /dev/hda1
  515.           ...
  516.  
  517.   The `image =' is set to the currently installed kernel.  Most people
  518.   use /vmlinuz. `label' is used by lilo to determine which kernel or
  519.   operating system to boot, and `root' is the / of that particular
  520.   operating system. Make a backup copy of your old kernel and copy the
  521.   zImage which you just made into place (you would say `cp zImage
  522.   /vmlinuz' if you use `/vmlinuz').  Then, rerun lilo -- on newer
  523.   systems, you can just run `lilo', but on older stuff, you might have
  524.   to do an /etc/lilo/install or even an /etc/lilo/lilo -C
  525.   /etc/lilo/config.
  526.  
  527.   If you would like to know more about LILO's configuration, or you
  528.   don't have LILO, get the newest version from your favorite ftp site
  529.   and follow the instructions.
  530.  
  531.   To boot one of your old kernels off the hard disk (another way to save
  532.   yourself in case you screw up the new kernel), copy the lines below
  533.   (and including) `image = xxx' in the LILO config file to the bottom of
  534.   the file, and change the `image = xxx' to `image = yyy', where `yyy'
  535.   is the full pathname of the file you saved your backup kernel to.
  536.   Then, change the `label = zzz' to `label = linux-backup' and rerun
  537.   lilo. You may need to put a line in the config file saying `delay=x',
  538.   where x is an amount in tenths of a second, which tells LILO to wait
  539.   that much time before booting, so that you can interrupt it (with the
  540.   shift key, for example), and type in the label of the backup boot
  541.   image (in case unpleasant things happen).
  542.  
  543.   5.  Patching the kernel
  544.  
  545.   5.1.  Applying a patch
  546.  
  547.   Incremental upgrades of the kernel are distributed as patches. For
  548.   example, if you have version 1.1.45, and you notice that there's a
  549.   `patch46.gz' out there for it, it means you can upgrade to version
  550.   1.1.46 through application of the patch. You might want to make a
  551.   backup of the source tree first (`make clean' and then `cd /usr/src;
  552.   tar zcvf old-tree.tar.gz linux' will make a compressed tar archive for
  553.   you.).
  554.  
  555.   So, continuing with the example above, let's suppose that you have
  556.   `patch46.gz' in /usr/src. cd to /usr/src  and do a `zcat patch46.gz |
  557.   patch -p0' (or `patch -p0 < patch46' if the patch isn't compressed).
  558.   You'll see things whizz by (or flutter by, if your system is that
  559.   slow) telling you that it is trying to apply hunks, and whether it
  560.   succeeds or not. Usually, this action goes by too quickly for you to
  561.   read, and you're not too sure whether it worked or not, so you might
  562.   want to use the -s flag to patch, which tells patch to only report
  563.   error messages (you don't get as much of the ``hey, my computer is
  564.   actually doing something for a change!'' feeling, but you may prefer
  565.   this..). To look for parts which might not have gone smoothly, cd to
  566.   /usr/src/linux  and look for files with a .rej extension. Some
  567.   versions of patch (older versions which may have been compiled with on
  568.   an inferior filesystem) leave the rejects with a # extension. You can
  569.   use `find' to look for you;
  570.  
  571.       find .  -name '*.rej' -print
  572.  
  573.   prints all files who live in the current directory or any subdirecto¡
  574.   ries with a .rej extension to the standard output.
  575.  
  576.   If everything went right, do a `make clean', `config', and `dep' as
  577.   described in sections 3 and 4.
  578.  
  579.   There are quite a few options to the patch command. As mentioned
  580.   above, patch -s will suppress all messages except the errors. If you
  581.   keep your kernel source in some other place than /usr/src/linux, patch
  582.   -p1 (in that directory) will patch things cleanly. Other patch options
  583.   are well-documented in the manual page.
  584.  
  585.   5.2.  If something goes wrong
  586.  
  587.   (Note: this section refers mostly to quite old kernels)
  588.  
  589.   The most frequent problem that used to arise was when a patch modified
  590.   a file called `config.in' and it didn't look quite right, because you
  591.   changed the options to suit your machine. This has been taken care of,
  592.   but one still might encounter it with an older release.  To fix it,
  593.   look at the config.in.rej  file, and see what remains of the original
  594.   patch.  The changes will typically be marked with `+' and `-' at the
  595.   beginning of the line. Look at the lines surrounding it, and remember
  596.   if they were set to `y' or `n'. Now, edit config.in, and change `y' to
  597.   `n' and `n' to `y' when appropriate. Do a
  598.  
  599.       patch -p0 < config.in.rej
  600.  
  601.   and if it reports that it succeeded (no fails), then you can continue
  602.   on with a configuration and compilation. The config.in.rej file will
  603.   remain, but you can get delete it.
  604.  
  605.   If you encounter further problems, you might have installed a patch
  606.   out of order. If patch says `previously applied patch detected: Assume
  607.   -R?', you are probably trying to apply a patch which is below your
  608.   current version number; if you answer `y', it will attempt to degrade
  609.   your source, and will most likely fail; thus, you will need to get a
  610.   whole new source tree (which might not have been such a bad idea in
  611.   the first place).
  612.  
  613.   To back out (unapply) a patch, use `patch -R' on the original patch.
  614.  
  615.   The best thing to do when patches really turn out wrong is to start
  616.   over again with a clean, out-of-the-box source tree (for example, from
  617.   one of the linux-x.y.z.tar.gz  files), and start again.
  618.  
  619.   5.3.  Getting rid of the .orig files
  620.  
  621.   After just a few patches, the .orig  files will start to pile up. For
  622.   example, one 1.1.51 tree I had was once last cleaned out at 1.1.48.
  623.   Removing the .orig files saved over a half a meg.
  624.  
  625.       find .  -name '*.orig' -exec rm -f {} ';'
  626.  
  627.   will take care of it for you. Versions of patch which use # for
  628.   rejects use a tilde instead of .orig.
  629.  
  630.   There are better ways to get rid of the .orig files, which depend on
  631.   GNU xargs:
  632.  
  633.       find .  -name '*.orig' | xargs rm
  634.  
  635.   or the ``quite secure but a little more verbose'' method:
  636.  
  637.       find . -name '*.orig' -print0 | xargs --null rm --
  638.  
  639.   5.4.  Other patches
  640.  
  641.   There are other patches (I'll call them ``nonstandard'') than the ones
  642.   Linus distributes. If you apply these, Linus' patches may not work
  643.   correctly and you'll have to either back them out, fix the source or
  644.   the patch, install a new source tree, or a combination of the above.
  645.   This can become very frustrating, so if you do not want to modify the
  646.   source (with the possibility of a very bad outcome), back out the
  647.   nonstandard patches before applying Linus', or just install a new
  648.   tree. Then, you can see if the nonstandard patches still work. If they
  649.   don't, you are either stuck with an old kernel, playing with the patch
  650.   or source to get it to work, or waiting (possibly begging) for a new
  651.   version of the patch to come out.
  652.  
  653.   How common are the patches not in the standard distribution? You will
  654.   probably hear of them. I used to use the noblink patch for my virtual
  655.   consoles because I hate blinking cursors (This patch is (or at least
  656.   was) frequently updated for new kernel releases.). With most newer
  657.   device drivers being developed as loadable modules, though, the
  658.   frequecy of ``nonstandard'' patches is decreasing significantly.
  659.  
  660.   6.  Additional packages
  661.  
  662.   Your linux kernel has many features which are not explained in the
  663.   kernel source itself; these features are typically utilized through
  664.   external packages. Some of the most common are listed here.
  665.  
  666.   6.1.  kbd
  667.  
  668.   The linux console probably has more features than it deserves. Among
  669.   these are the ability to switch fonts, remap your keyboard, switch
  670.   video modes (in newer kernels), etc. The kbd package has programs
  671.   which allow the user to do all of this, plus many fonts and keyboard
  672.   maps for almost any keyboard, and is available from the same sites
  673.   that carry the kernel source.
  674.  
  675.   6.2.  util-linux
  676.  
  677.   Rik Faith (faith@cs.unc.edu) put together a large collection of linux
  678.   utilities which are, by odd coincidence, called util-linux. These are
  679.   now maintained by Nicolai Langfeldt (util-linux@math.uio.no).
  680.   Available via anonymous ftp from sunsite.unc.edu in
  681.   /pub/Linux/system/misc, it contains programs such as setterm, rdev,
  682.   and ctrlaltdel, which are relevant to the kernel. As Rik says, do not
  683.   install without thinking; you do not need to install everything in the
  684.   package, and it could very well cause serious problems if you do.
  685.  
  686.   6.3.  hdparm
  687.  
  688.   As with many packages, this was once a kernel patch and support
  689.   programs.  The patches made it into the official kernel, and the
  690.   programs to optimize and play with your hard disk are distributed
  691.   separately.
  692.  
  693.   6.4.  gpm
  694.  
  695.   gpm stands for general purpose mouse. This program allows you to cut
  696.   and paste text between virtual consoles and do other things with a
  697.   large variety of mouse types.
  698.  
  699.   7.  Some pitfalls
  700.  
  701.   7.1.  make clean
  702.  
  703.   If your new kernel does really weird things after a routine kernel
  704.   upgrade, chances are you forgot to make clean before compiling the new
  705.   kernel. Symptoms can be anything from your system outright crashing,
  706.   strange I/O problems, to crummy performance. Make sure you do a make
  707.   dep, too.
  708.  
  709.   7.2.  Huge or slow kernels
  710.  
  711.   If your kernel is sucking up a lot of memory, is too large, and/or
  712.   just takes forever to compile even when you've got your new 786DX6/440
  713.   working on it, you've probably got lots of unneeded stuff (device
  714.   drivers, filesystems, etc) configured. If you don't use it, don't
  715.   configure it, because it does take up memory.  The most obvious
  716.   symptom of kernel bloat is extreme swapping in and out of memory to
  717.   disk; if your disk is making a lot of noise and it's not one of those
  718.   old Fujitsu Eagles that sound like like a jet landing when turned off,
  719.   look over your kernel configuration.
  720.  
  721.   You can find out how much memory the kernel is using by taking the
  722.   total amount of memory in your machine and subtracting from it the
  723.   amount of ``total mem'' in /proc/meminfo  or the output of the command
  724.   `free'. You can also find out by doing a `dmesg' (or by looking at the
  725.   kernel log file, wherever it is on your system).  There will be a line
  726.   which looks like this:
  727.  
  728.   Memory: 15124k/16384k available (552k kernel code, 384k reserved, 324k
  729.   data)
  730.  
  731.   My 386 (which has slightly less junk configured) says this:
  732.  
  733.   Memory: 7000k/8192k available (496k kernel code, 384k reserved, 312k
  734.   data)
  735.  
  736.   If you `just gotta' have a big kernel but the system won't let you,
  737.   you can try `make bzimage'. You may very well have to install a new
  738.   version of LILO if you do this.
  739.  
  740.   7.3.  Kernel doesn't compile
  741.  
  742.   If it does not compile, then it is likely that a patch failed, or your
  743.   source is somehow corrupt. Your version of gcc also might not be
  744.   correct, or could also be corrupt (for example, the include files
  745.   might be in error). Make sure that the symbolic links which Linus
  746.   describes in the README are set up correctly. In general, if a
  747.   standard kernel does not compile, something is seriously wrong with
  748.   the system, and reinstallation of certain tools is probably necessary.
  749.  
  750.   Or perhaps you're compiling a 1.2.x kernel with an ELF compiler (gcc
  751.   2.6.3 and higher). If you're getting a bunch of so-and-so undefined
  752.   messages during the compilation, chances are that this is your
  753.   problem. The fix is in most cases very simple. Add these lines to the
  754.   top of arch/i386/Makefile:
  755.  
  756.   AS=/usr/i486-linuxaout/bin/as
  757.   LD=/usr/i486-linuxaout/bin/ld -m i386linux
  758.   CC=gcc -b i486-linuxaout -D__KERNEL__ -I$(TOPDIR)/include
  759.  
  760.   Then make dep and zImage again.
  761.  
  762.   In rare cases, gcc can crash due to hardware problems. The error
  763.   message will be something like ``xxx exited with signal 15'' and it
  764.   will generally look very mysterious. I probably would not mention
  765.   this, except that it happened to me once - I had some bad cache
  766.   memory, and the compiler would occasionally barf at random. Try
  767.   reinstalling gcc first if you experience problems. You should only get
  768.   suspicious if your kernel compiles fine with external cache turned
  769.   off, a reduced amount of RAM, etc.
  770.  
  771.   It tends to disturb people when it's suggested that their hardware has
  772.   problems. Well, I'm not making this up. There is an FAQ for it -- it's
  773.   at http://www.bitwizard.nl/sig11/.
  774.  
  775.   7.4.  New version of the kernel doesn't seem to boot
  776.  
  777.   You did not run LILO, or it is not configured correctly. One thing
  778.   that ``got'' me once was a problem in the config file; it said `boot =
  779.   /dev/hda1' instead of `boot = /dev/hda' (This can be really annoying
  780.   at first, but once you have a working config file, you shouldn't need
  781.   to change it.).
  782.  
  783.   7.5.  You forgot to run LILO, or system doesn't boot at all
  784.  
  785.   Ooops! The best thing you can do here is to boot off of a floppy disk
  786.   and prepare another bootable floppy (such as `make zdisk' would do).
  787.   You need to know where your root (/) filesystem is and what type it is
  788.   (e.g. second extended, minix). In the example below, you also need to
  789.   know what filesystem your /usr/src/linux source tree is on, its type,
  790.   and where it is normally mounted.
  791.  
  792.   In the following example, / is /dev/hda1, and the filesystem which
  793.   holds /usr/src/linux is /dev/hda3, normally mounted at /usr. Both are
  794.   second extended filesystems. The working kernel image in
  795.   /usr/src/linux/arch/i386/boot is called zImage.
  796.  
  797.   The idea is that if there is a functioning zImage, it is possible to
  798.   use that for the new floppy. Another alternative, which may or may not
  799.   work better (it depends on the particular method in which you messed
  800.   up your system) is discussed after the example.
  801.  
  802.   First, boot from a boot/root disk combo or rescue disk, and mount the
  803.   filesystem which contains the working kernel image:
  804.  
  805.       mkdir /mnt
  806.       mount -t ext2 /dev/hda3 /mnt
  807.  
  808.   If mkdir tells you that the directory already exists, just ignore it.
  809.   Now, cd to the place where the working kernel image was. Note that
  810.  
  811.   /mnt + /usr/src/linux/arch/i386/boot - /usr = /mnt/src/linux/arch/i386/boot
  812.  
  813.   Place a formatted disk in drive ``A:'' (not your boot or root disk!),
  814.   dump the image to the disk, and configure it for your root filesystem:
  815.  
  816.       cd /mnt/src/linux/arch/i386/boot
  817.       dd if=zImage of=/dev/fd0
  818.       rdev /dev/fd0 /dev/hda1
  819.  
  820.   cd to / and unmount the normal /usr filesystem:
  821.  
  822.       cd /
  823.       umount /mnt
  824.  
  825.   You should now be able to reboot your system as normal from this
  826.   floppy.  Don't forget to run lilo (or whatever it was that you did
  827.   wrong) after the reboot!
  828.  
  829.   As mentioned above, there is another common alternative. If you
  830.   happened to have a working kernel image in / (/vmlinuz for example),
  831.   you can use that for a boot disk. Supposing all of the above
  832.   conditions, and that my kernel image is /vmlinuz, just make these
  833.   alterations to the example above: change /dev/hda3 to /dev/hda1 (the /
  834.   filesystem), /mnt/src/linux to /mnt, and if=zImage to if=vmlinuz. The
  835.   note explaining how to derive /mnt/src/linux may be ignored.
  836.  
  837.   Using LILO with big drives (more than 1024 cylinders) can cause
  838.   problems.  See the LILO mini-HOWTO or documentation for help on that.
  839.  
  840.   7.6.  It says `warning: bdflush not running'
  841.  
  842.   This can be a severe problem. Starting with a kernel release after 1.0
  843.   (around 20 Apr 1994), a program called `update' which periodically
  844.   flushes out the filesystem buffers, was upgraded/replaced. Get the
  845.   sources to `bdflush' (you should find it where you got your kernel
  846.   source), and install it (you probably want to run your system under
  847.   the old kernel while doing this). It installs itself as `update' and
  848.   after a reboot, the new kernel should no longer complain.
  849.  
  850.   7.7.  It says stuff about undefined symbols and does not compile
  851.  
  852.   You probably have an ELF compiler (gcc 2.6.3 and up) and the 1.2.x (or
  853.   earlier) kernel source. The usual fix is to add these three lines to
  854.   the top of arch/i386/Makefile:
  855.  
  856.   AS=/usr/i486-linuxaout/bin/as
  857.   LD=/usr/i486-linuxaout/bin/ld -m i386linux
  858.   CC=gcc -b i486-linuxaout -D__KERNEL__ -I$(TOPDIR)/include
  859.  
  860.   This will compile a 1.2.x kernel with the a.out libraries.
  861.  
  862.   7.8.  I can't get my IDE/ATAPI CD-ROM drive to work
  863.  
  864.   Strangely enough, lots of people cannot get their ATAPI drives
  865.   working, probably because there are a number of things that can go
  866.   wrong.
  867.  
  868.   If your CD-ROM drive is the only device on a particular IDE interface,
  869.   it must be jumpered as ``master'' or ``single.'' Supposedly, this is
  870.   the most common error.
  871.  
  872.   Creative Labs (for one) has put IDE interfaces on their sound cards
  873.   now.  However, this leads to the interesting problem that while some
  874.   people only have one interface to being with, many have two IDE
  875.   interfaces built-in to their motherboards (at IRQ15, usually), so a
  876.   common practice is to make the soundblaster interface a third IDE port
  877.   (IRQ11, or so I'm told).
  878.  
  879.   This causes problems with linux in that versions 1.2.x don't support a
  880.   third IDE interface (there is support in starting somewhere in the
  881.   1.3.x series but that's development, remember, and it doesn't auto-
  882.   probe). To get around this, you have a few choices.
  883.  
  884.   If you have a second IDE port already, chances are that you are not
  885.   using it or it doesn't already have two devices on it. Take the ATAPI
  886.   drive off the sound card and put it on the second interface. You can
  887.   then disable the sound card's interface, which saves an IRQ anyway.
  888.  
  889.   If you don't have a second interface, jumper the sound card's
  890.   interface (not the sound card's sound part) as IRQ15, the second
  891.   interface. It should work.
  892.  
  893.   If for some reason it absolutely has to be on a so-called ``third''
  894.   interface, or there are other problems, get a 1.3.x kernel (1.3.57 has
  895.   it, for example), and read over drivers/block/README.ide. There is
  896.   much more information here.
  897.  
  898.   7.9.  It says weird things about obsolete routing requests
  899.  
  900.   Get new versions of the route program and any other programs which do
  901.   route manipulation.  /usr/include/linux/route.h  (which is actually a
  902.   file in /usr/src/linux) has changed.
  903.  
  904.   7.10.  Firewalling not working in 1.2.0
  905.  
  906.   Upgrade to at least version 1.2.1.
  907.  
  908.   7.11.  ``Not a compressed kernel Image file''
  909.  
  910.   Don't use the vmlinux file created in /usr/src/linux as your boot
  911.   image; [..]/arch/i386/boot/zImage is the right one.
  912.  
  913.   7.12.  Problems with console terminal after upgrade to 1.3.x
  914.  
  915.   Change the word dumb to linux in the console termcap entry in
  916.   /etc/termcap. You may also have to make a terminfo entry.
  917.  
  918.   7.13.  Can't seem to compile things after kernel upgrade
  919.  
  920.   The linux kernel source includes a number of include files (the things
  921.   that end with .h) which are referenced by the standard ones in
  922.   /usr/include. They are typically referenced like this (where xyzzy.h
  923.   would be something in /usr/include/linux):
  924.  
  925.       #include <linux/xyzzy.h>
  926.  
  927.   Normally, there is a link called linux in /usr/include to the
  928.   include/linux directory of your kernel source
  929.   (/usr/src/linux/include/linux in the typical system). If this link is
  930.   not there, or points to the wrong place, most things will not compile
  931.   at all. If you decided that the kernel source was taking too much room
  932.   on the disk and deleted it, this will obviously be a problem. Another
  933.   way it might go wrong is with file permissions; if your root has a
  934.   umask which doesn't allow other users to see its files by default, and
  935.   you extracted the kernel source without the p (preserve filemodes)
  936.   option, those users also won't be able to use the C compiler. Although
  937.   you could use the chmod command to fix this, it is probably easier to
  938.   re-extract the include files. You can do this the same way you did the
  939.   whole source at the beginning, only with an additional argument:
  940.  
  941.       blah# tar zxvpf linux.x.y.z.tar.gz linux/include
  942.  
  943.   Note: ``make config'' will recreate the /usr/src/linux link if it
  944.   isn't there.
  945.  
  946.   7.14.  Increasing limits
  947.  
  948.   The following few example commands may be helpful to those wondering
  949.   how to increase certain soft limits imposed by the kernel:
  950.  
  951.   echo 4096 > /proc/sys/kernel/file-max
  952.   echo 12288 > /proc/sys/kernel/inode-max
  953.   echo 300 400 500 > /proc/sys/vm/freepages
  954.  
  955.   8.  Note for upgrade to version 2.0.x
  956.  
  957.   Kernel version 2.0.x introduced quite a bit of changes for kernel
  958.   installation. The file Documentation/Changes in the 2.0.x source tree
  959.   contains information that you should know when upgrading to version
  960.   2.0.x. You will most likely need to upgrade several key packages, such
  961.   as gcc, libc, and SysVInit, and perhaps alter some system files, so
  962.   expect this. Don't panic, though.
  963.  
  964.   9.  Modules
  965.  
  966.   Loadable kernel modules can save memory and ease configuration. The
  967.   scope of modules has grown to include filesystems, ethernet card
  968.   drivers, tape drivers, printer drivers, and more.
  969.  
  970.   9.1.  Installing the module utilities
  971.  
  972.   The module utilities are available from wherever you got your kernel
  973.   source as modules-x.y.z.tar.gz; choose the highest patchlevel x.y.z
  974.   that is equal to or below that of your current kernel. Unpack it with
  975.   `tar zxvf modules-x.y.z.tar.gz', cd to the directory it creates
  976.   (modules-x.y.z), look over the README, and carry out its installation
  977.   instructions (which is usually something simple, such as make
  978.   install). You should now have the programs insmod, rmmod, ksyms,
  979.   lsmod, genksyms, modprobe, and depmod in /sbin. If you wish, test out
  980.   the utilities with the ``hw'' example driver in insmod; look over the
  981.   INSTALL file in that subdirectory for details.
  982.  
  983.   insmod inserts a module into the running kernel. Modules usually have
  984.   a .o extension; the example driver mentioned above is called
  985.   drv_hello.o, so to insert this, one would say `insmod drv_hello.o'. To
  986.   see the modules that the kernel is currently using, use lsmod. The
  987.   output looks like this:
  988.  
  989.       blah# lsmod
  990.       Module:        #pages:  Used by:
  991.       drv_hello          1
  992.  
  993.   `drv_hello' is the name of the module, it uses one page (4k) of mem¡
  994.   ory, and no other kernel modules depend on it at the moment. To remove
  995.   this module, use `rmmod drv_hello'. Note that rmmod wants a module
  996.   name, not a filename; you get this from lsmod's listing. The other
  997.   module utilities' purposes are documented in their manual pages.
  998.  
  999.   9.2.  Modules distributed with the kernel
  1000.  
  1001.   As of version 2.0.30, most of everything is available as a loadable
  1002.   modules. To use them, first make sure that you don't configure them
  1003.   into the regular kernel; that is, don't say y to it during `make
  1004.   config'.  Compile a new kernel and reboot with it. Then, cd to
  1005.   /usr/src/linux again, and do a `make modules'. This compiles all of
  1006.   the modules which you did not specify in the kernel configuration, and
  1007.   places links to them in /usr/src/linux/modules.  You can use them
  1008.   straight from that directory or execute `make modules_install', which
  1009.   installs them in /lib/modules/x.y.z, where x.y.z is the kernel
  1010.   release.
  1011.  
  1012.   This can be especially handy with filesystems. You may not use the
  1013.   minix or msdos filesystems frequently. For example, if I encountered
  1014.   an msdos (shudder) floppy, I would insmod
  1015.   /usr/src/linux/modules/msdos.o, and then rmmod msdos when finished.
  1016.   This procedure saves about 50k of RAM in the kernel during normal
  1017.   operation. A small note is in order for the minix filesystem: you
  1018.   should always configure it directly into the kernel for use in
  1019.   ``rescue'' disks.
  1020.  
  1021.   10.  Other configuration options
  1022.  
  1023.   This section contains descriptions of selected kernel configuration
  1024.   options (in make config) which are not listed in the configuration
  1025.   section.  Most device drivers are not listed here.
  1026.  
  1027.   10.1.  General setup
  1028.  
  1029.   Normal floppy disk support - is exactly that. You may wish to read
  1030.   over the file drivers/block/README.fd; this is especially important
  1031.   for IBM Thinkpad users.
  1032.  
  1033.   XT harddisk support - if you want to use that 8 bit XT controller
  1034.   collecting dust in the corner.
  1035.  
  1036.   PCI bios support - if you have PCI, you may want to give this a shot;
  1037.   be careful, though, as some old PCI motherboards could crash with this
  1038.   option. More information about the PCI bus under linux is found in the
  1039.   PCI-HOWTO.
  1040.  
  1041.   Kernel support for ELF binaries - ELF is an effort to allow binaries
  1042.   to span architectures and operating systems; linux seems is headed in
  1043.   that direction and so you most likely want this.
  1044.  
  1045.   Set version information on all symbols for modules - in the past,
  1046.   kernel modules were recompiled along with every new kernel. If you say
  1047.   y, it will be possible to use modules compiled under a different
  1048.   patchlevel. Read README.modules for more details.
  1049.  
  1050.   10.2.  Networking options
  1051.  
  1052.   Networking options are described in the NET-3-HOWTO (or NET-something-
  1053.   HOWTO).
  1054.  
  1055.   11.  Tips and tricks
  1056.  
  1057.   11.1.  Redirecting output of the make or patch commands
  1058.  
  1059.   If you would like logs of what those `make' or `patch' commands did,
  1060.   you can redirect output to a file. First, find out what shell you're
  1061.   running: `grep root /etc/passwd' and look for something like
  1062.   `/bin/csh'.
  1063.  
  1064.   If you use sh or bash,
  1065.  
  1066.       (command) 2>&1 | tee (output file)
  1067.  
  1068.   will place a copy of (command)'s output in the file `(output file)'.
  1069.  
  1070.   For csh or tcsh, use
  1071.  
  1072.       (command) |& tee (output file)
  1073.  
  1074.   For rc (Note: you probably do not use rc) it's
  1075.  
  1076.       (command) >[2=1] | tee (output file)
  1077.  
  1078.   11.2.  Conditional kernel install
  1079.  
  1080.   Other than using floppy disks, there are several methods of testing
  1081.   out a new kernel without touching the old one. Unlike many other Unix
  1082.   flavors, LILO has the ability to boot a kernel from anywhere on the
  1083.   disk (if you have a large (500 MB or above) disk, please read over the
  1084.   LILO documentation on how this may cause problems). So, if you add
  1085.   something similar to
  1086.  
  1087.       image = /usr/src/linux/arch/i386/boot/zImage
  1088.           label = new_kernel
  1089.  
  1090.   to the end of your LILO configuration file, you can choose to run a
  1091.   newly compiled kernel without touching your old /vmlinuz (after run¡
  1092.   ning lilo, of course). The easiest way to tell LILO to boot a new ker¡
  1093.   nel is to press the shift key at bootup time (when it says LILO on the
  1094.   screen, and nothing else), which gives you a prompt.  At this point,
  1095.   you can enter `new_kernel' to boot the new kernel.
  1096.  
  1097.   If you wish to keep several different kernel source trees on your
  1098.   system at the same time (this can take up a lot of disk space; be
  1099.   careful), the most common way is to name them /usr/src/linux-x.y.z,
  1100.   where x.y.z is the kernel version. You can then ``select'' a source
  1101.   tree with a symbolic link; for example, `ln -sf linux-1.2.2
  1102.   /usr/src/linux' would make the 1.2.2 tree current. Before creating a
  1103.   symbolic link like this, make certain that the last argument to ln is
  1104.   not a real directory (old symbolic links are fine); the result will
  1105.   not be what you expect.
  1106.  
  1107.   11.3.  Kernel updates
  1108.  
  1109.   Russell Nelson (nelson@crynwr.com) summarizes the changes in new
  1110.   kernel releases. These are short, and you might like to look at them
  1111.   before an upgrade. They are available with anonymous ftp from
  1112.   ftp.emlist.com in pub/kchanges or through the URL
  1113.  
  1114.       http://www.crynwr.com/kchanges
  1115.  
  1116.   12.  Other relevant HOWTOs that might be useful
  1117.  
  1118.   ╖  Sound-HOWTO: sound cards and utilities
  1119.  
  1120.   ╖  SCSI-HOWTO: all about SCSI controllers and devices
  1121.  
  1122.   ╖  NET-2-HOWTO: networking
  1123.  
  1124.   ╖  PPP-HOWTO: PPP networking in particular
  1125.  
  1126.   ╖  PCMCIA-HOWTO: about the drivers for your notebook
  1127.  
  1128.   ╖  ELF-HOWTO: ELF: what it is, converting..
  1129.  
  1130.   ╖  Hardware-HOWTO: overview of supported hardware
  1131.  
  1132.   ╖  Module-HOWTO: more on kernel modules
  1133.  
  1134.   ╖  Kerneld mini-HOWTO: about kerneld
  1135.  
  1136.   ╖  BogoMips mini-HOWTO: in case you were wondering
  1137.  
  1138.   13.  Misc
  1139.  
  1140.   13.1.  Author
  1141.  
  1142.   The author and maintainer of the Linux Kernel-HOWTO is Brian Ward
  1143.   (bri@blah.math.tu-graz.ac.at). Please send me any comments, additions,
  1144.   corrections (Corrections are, in particular, the most important to
  1145.   me.).
  1146.  
  1147.   You can take a look at my `home page' at one of these URLs:
  1148.  
  1149.       http://www.math.psu.edu/ward/
  1150.       http://blah.math.tu-graz.ac.at/~bri/
  1151.  
  1152.   Even though I try to be attentive as possible with mail, please
  1153.   remember that I get a lot of it every day, so it may take a little
  1154.   time to get back to you. Especially when emailing me with a question,
  1155.   please try extra hard to be clear and detailed in your message. If
  1156.   you're writing about non-working hardware (or something like that), I
  1157.   need to know what your hardware configureation is. If you report an
  1158.   error, don't just say ``I tried this but it gave an error;'' I need to
  1159.   know what the error was.  I would also like to know what versions of
  1160.   the kernel, gcc, and libc you're using. If you just tell me you're
  1161.   using this-or-that distribution, it won't tell me much at all. I don't
  1162.   care if you ask simple questions; remember, if you don't ask, you may
  1163.   never get an answer! I'd like to thank everyone who has given me
  1164.   feedback.
  1165.  
  1166.   If you mailed me and did not get an answer within a resonable amount
  1167.   of time (three weeks or more), then chances are that I accidentally
  1168.   deleted your message or something (sorry). Please try again.
  1169.  
  1170.   I get a lot of mail about thing which are actually hardware problems
  1171.   or issues. That's OK, but please try to keep in mind that I'm not
  1172.   familiar with all of the hardware in the world and I don't know how
  1173.   helpful I can be; I personally use machines with IDE and SCSI disks,
  1174.   SCSI CD-ROMs, 3Com and WD ethernet cards, serial mice, motherboards
  1175.   with PCI, NCR 810 SCSI controllers, AMD 386DX40 w/Cyrix copr., AMD
  1176.   5x86, AMD 486DX4, and Intel 486DX4 processors (This is an overview of
  1177.   what I use and am familiar with, certainly not a recommendation, but
  1178.   if you want that, you're more than welcome to ask :-) ).
  1179.  
  1180.   Version -0.1 was written on October 3, 1994. This document is
  1181.   available in SGML, PostScript, TeX, roff, and plain-text formats.
  1182.  
  1183.   13.2.  To do
  1184.  
  1185.   The ``Tips and tricks'' section is a little small. I hope to expand on
  1186.   it with suggestions from others.
  1187.  
  1188.   So is ``Additional packages.''
  1189.  
  1190.   More debugging/crash recovery info needed.
  1191.  
  1192.   13.3.  Contributions
  1193.  
  1194.   A small part of Linus' README (kernel hacking options) is inclusive.
  1195.   (Thanks, Linus!)
  1196.  
  1197.   uc@brian.lunetix.de (Ulrich Callmeier): patch -s and xargs.
  1198.  
  1199.   quinlan@yggdrasil.com (Daniel Quinlan): corrections and additions in
  1200.   many sections.
  1201.  
  1202.   nat@nat@nataa.fr.eu.org (Nat Makarevitch): mrproper, tar -p, many
  1203.   other things
  1204.  
  1205.   boldt@math.ucsb.edu (Axel Boldt): collected descriptions of kernel
  1206.   configuration options on the net; then provided me with the list
  1207.  
  1208.   lembark@wrkhors.psyber.com (Steve Lembark): multiple boot suggestion
  1209.  
  1210.   kbriggs@earwax.pd.uwa.edu.au (Keith Briggs): some corrections and
  1211.   suggestions
  1212.  
  1213.   rmcguire@freenet.columbus.oh.us (Ryan McGuire): makeables additions
  1214.  
  1215.   dumas@excalibur.ibp.fr (Eric Dumas): French translation
  1216.  
  1217.   simazaki@ab11.yamanashi.ac.jp (Yasutada Shimazaki): Japanese
  1218.   translation
  1219.  
  1220.   jjamor@lml.ls.fi.upm.es (Juan Jose Amor Iglesias): Spanish translation
  1221.  
  1222.   mva@sbbs.se (Martin Wahlen): Swedish translation
  1223.  
  1224.   jzp1218@stud.u-szeged.hu (Zoltan Vamosi): Hungarian translation
  1225.  
  1226.   bart@mat.uni.torun.pl (Bartosz Maruszewski): Polish translation
  1227.  
  1228.   donahue@tiber.nist.gov (Michael J Donahue): typos, winner of the
  1229.   ``sliced bread competition''
  1230.  
  1231.   rms@gnu.ai.mit.edu (Richard Stallman): ``free'' documentation
  1232.   concept/distribution notice
  1233.  
  1234.   dak@Pool.Informatik.RWTH-Aachen.DE (David Kastrup): NFS thing
  1235.  
  1236.   esr@snark.thyrsus.com (Eric Raymond): various tidbits
  1237.  
  1238.   The people who have sent me mail with questions and problems have also
  1239.   been quite helpful.
  1240.  
  1241.   13.4.  Copyright notice, License, and all that stuff
  1242.  
  1243.   Copyright ⌐ Brian Ward, 1994-1997.
  1244.  
  1245.   Permission is granted to make and distribute copies of this manual
  1246.   provided the copyright notice and this permission notice are preserved
  1247.   on all copies.
  1248.  
  1249.   Permission is granted to copy and distribute modified versions of this
  1250.   manual under the conditions for verbatim copying, provided that the
  1251.   derived work is distributed under the terms of a permission notice
  1252.   identical to this one. Translations fall under the catagory of
  1253.   ``modified versions.''
  1254.  
  1255.   Warranty: None.
  1256.  
  1257.   Recommendations: Commercial redistribution is allowed and encouraged;
  1258.   however, it is strongly recommended that the redistributor contact the
  1259.   author before the redistribution, in the interest of keeping things
  1260.   up-to-date (you could send me a copy of the thing you're making while
  1261.   you're at it). Translators are also advised to contact the author
  1262.   before translating. The printed version looks nicer. Recycle.
  1263.  
  1264.