Complete.Org: Mailing Lists: Archives: discussion: July 1999:
[aclug-L] Two questions...
Home

[aclug-L] Two questions...

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: aclug-L@xxxxxxxxxxxx
Subject: [aclug-L] Two questions...
From: "Maverick, Ven-Han Ieong" <vhieong@xxxxxxxxxxxxxxxxxx>
Date: Sun, 25 Jul 1999 11:42:20 -0600 (CST)
Reply-to: aclug-L@xxxxxxxxxxxx

Hi, Patrick,

I got a general instruction from Tom Wallis regarding  compiling the
kernel, it is pretty helpful, since I follow the instruction and
compile my kernel. Any mistakes on the instruction, free to
point out.
Thank you.

                                        Mav
---------- Forwarded message ----------
Date: Fri, 25 Jun 1999 11:02:11 -0500
From: Tom W Wallis <wallis@xxxxxxxxxxx>
To: vxieong@xxxxxxxxxxx

        Here are some tips on kernel compiling:

        Download the newest kernel source (like linux-2.2.5.tar.gz).


1. Copy the source into /usr/src 

        (ex. cp /home/wallis/linux-2.2.5.tar.gz /usr/src)

2. cd /usr/src

3. mkdir linux-2.2.5

4. Make a symlink from linux-2.2.5 to linux .  Remove any old link of the 
   name linux before you do this:

   rm linux
   ln -s linux-2.2.5 linux

5. Unarchive the tar file:

   tar -xvzf ./linux-2.2.5.tar.gz 

6. cd linux  
   this goes into the new source tree

7. make menuconfig

   This will take you into the menu-based kernel configurator.  

   This is a big step.  There are lots of sections and subsections.  

8. The first section is "Code maturity level options" 
  
   This section is simple , tell it you DO want to be prompted for
   incomplete, etc. stuff.  You get more choices this way. 

9. The next section is processor type and features.  The first line of
the menus gives you a choice of processors.  I use Pentium/K6/TSC.  If
you have anything lower than a Pentium, turn math emulation on,
otherwise leave it off.  SMP is on by default , you can leave it that
way.  Exit this menu, go into
   

10. Loadable module support.  I hate loadable modules, but you will need
them if you want it to work.  Enable loadable modules and set version
info.  Disable the kernel module loader.  The kernel module loader is
beyond my capacity to explain.  


MODULES INTRO:  

    If you make something a module, it doesn't eat kernel memory or space
until you need it, but it has to be loaded by hand or by a boot script of
some kind.  If you make it "*" built-in, the kernel will have it
automatically, but it eats more memory.  Sometimes it is hard to tell the
kernel what parameters to use etc (IRQ, etc). when the item is built-in to
the kernel (it isn't flexible enough that way) .  I use modules for tricky
things like sound cards, little used things, and sometimes network cards. 
I often build in SCSI controllers, but in your case we WONT do this.

11.  Under general setup, there are several items of little importance,
except for parallel support.  I make mine a module, to save kernel memory
and also because I don't have a printer now.  If you do compile the
Parallel port, make sure to also compile PC-style hardware.  
There are some other items that aren't that important (APM, etc.) 

12. PNP support.  Say Yes here.  

13. Block devices:  I am using IDE now, so I compile hard into the kernel
(no module) IDE support for DISK, CDROM, and FLOPPY (LS-120).  I don't use
modules here because I want to make sure my kernel knows about my hard
drive.   You can mostly use the defaults here.  Turn on anything that you
feel you might need, keeping in mind not to turn on too much (kernel size
increases beyond the 640K or so limit if too much is turned on without
using modules).  

14. Networking Options: I usually use the defaults here.  Don't change
much.  

15. SCSI Support .  I would check (non-module) SCSI support, SCSI Disk,
Tape, CDROM, and Generic.  Under SCSI low-level drivers , I would select
GENERIC NCR5380/53c400 support for sure (as a module).  You can make
almost all of these modules and it wouldn't hurt anything.  That way, if
you change SCSI controllers, you'll have the modules prebuilt.  You
wouldn't want to compile them into the kernel, otherwise it will get way
too big.  Some of them conflict with each other (NCR53c7, 8xx and
NCR53C8XX drivers may not work together, I don't know).  When I do it, I
normally compile in hard non-module the card I know I have plus disk
support, because my servers require it and I know exactly my card
configuration.  

16. Network device support.  I would use this and make a module for any
card that you might put in the machine (NE2000, PCI NE2000, 3COM etc).  

17.  Amateur Radio support.  Forget it.  

18. Skip IRDA, ISDN, Old CDROM (non IDE, non SCSI) unless you have one 
of these type of CDROMs.  

19. Character Devices: Leave mostly as default, compile in Parallel
printer support as a module.  If you are using a PS/2 mouse, be sure
to compile this in under mice support (compile-in, no module).  Ignore
video for LINUX or Joystick ,etc.

20. Filesystems: Leave mostly as default.  You can compile FAT,
etc.. as modules, leave ISO9660 compiled in, no module.  Compile NFS
filesystem support in, no module.  NFS is important.

21. ignore partition types and native languages support.  

22.  Back out of filesystems, back to Console Drivers.  Skip this.  

23.  Sound:  I would compile as much as I could as a module, if you want
to use a sound card.  If not, forget it.  

On the main Menu, select EXIT
It says, DO YOU WANT TO SAVE YOUR NEW KERNEL CONFIG.  Say Yes if you are
happy with your choices, NO if not.  



PART 2:  MAKE

As root, in /usr/src/linux (do this each time you make a kernel) 

type:

make dep            - this makes the dependancy files, telling the
compiler later what to do.

make clean          - this wipes out old cruft from previous runs.

make zImage         - this makes the kernel, modules will be done later.  

This might fail if you don't have the 16 bit assembler loaded.  I don't
know if RH loads it by default, Debian 2.1 calls the package  bin86    

If it succeeds (sp?), there will be a file in 

/usr/src/linux/arch/i386/boot 

called zImage (a large file).  We will need it later.  

If it complains about it being too big, try  

make bzImage

instead of 

make zImage

It won't hurt to try.  You might need to load the bzip2 package
beforehand.  bzip is stronger than gzip, compresses more.  If it still
complains, you will have to redo it, compiling more as modules and
less built-in.

Once you get a good kernel image, then do:

make modules     - this will compile the parts of the kernel you told it 
                   to make as modules  

make modules_install - this sticks the modules in the directory

/lib/modules/(kernel-number)  (on mine /lib/modules/2.2.5)  

You can look around in this directory tree.  It is neat to see what
modules have actually been compiled and what their names are.

copy the bzImage or zImage file from /usr/src/linux/arch/i386/boot into
/boot/bzImage-new or something that isn't in use in /boot.  Remember this
file name under /boot, we'll need it later. 

Now, here is the next part, LILO (ugh).  

Here is MY /etc/lilo.conf file (with my comments in CAPS, comments are not
allowed in the file, AFAIK) 

boot=/dev/hda1                   TELLS THE BOOT DEVICE WHERE WILL LILO
                                 LOAD . LOADS LILO INTO PARTITION 1 OF
                                 FIRST IDE DRIVE. 

root=/dev/hda1                   TELLS LILO WHERE THE ROOT PARTITION IS. 

install=/boot/boot.b             DONT KNOW WHAT THIS DOES

map=/boot/map                    DITTO 

vga=normal                       DITTO 

delay=20                         SETS THE DELAY FOR PROMPT I THINK 

prompt                           PROMPTS ME FOR LILO PARAMETERS AT BOOT 

timeout=120                      I THINK THIS IS THE TIMEOUT FOR INPUT

                                 IMPORTANT STUFF BELOW 

image=/boot/bzImage-2.2.5        MY DEFAULT KERNEL FILE LOCATION 
        label=Linux225           WHAT DO I CALL IT AT BOOT 
        read-only                GENERIC , ALWAYS USE READ-ONLY 

image=/vmlinuz                   MY DEFAULT STOCK KERNEL CAME WITH DEBIAN
                                 THIS FILE IS ACTUALLY A SYMLINK FROM 
                                 /vmlinuz TO /boot/vmlinuz-2.0.36 ON
                                 MY SYSTEM 
        label=Linux              WHAT DO I CALL IT AT BOOT
        read-only                ALWAYS USE READ-ONLY 

after running LILO and rebooting, LILO prompts me for which kernel to
boot.  I can type in Linux225 or Linux .  If I hit enter, I get the
FIRST kernel listed in the file.  You can put as many kernels in the
lilo.conf file as you like, just give each one a name and a path to it
and run lilo.  other things can go after a kernel : example:

         append="mem=256M" 

can go after the kernel image line.  This tells lilo to tell the kernel an
OPTIONAL parameter, telling it how much memory I have.  This is necessary
on some of my servers, since the older LINUX kernels can't always detect
memory over 64M without being told.  You can put lots of other stuff into 
append lines, stuff you might otherwise type on the boot command line
(at the lilo: prompt).  This is a lot like typing:

lilo: Linux225 mem=256M 

As far as the modules go, I put them into /etc/modules.  This is probably
not the "correct" way of doing it, but it works.  My /etc/modules looks
like this:

# /etc/modules: kernel modules to load at boot time.
#
# This file should contain the names of kernel modules that are
# to be loaded at boot time, one per line.  Comments begin with
# a `#', and everything on the line after them are ignored.
# An entry named `auto' will cause the system to start kerneld
# immediately.
# Kerneld then loads modules on demand. `noauto' disables kerneld
completely.

#auto
uart401
sb io=0x220 irq=5 dma=0 dma16=5 mpu_io=0x300

I have auto commented out, it doesn't work, I can't figure it out.  I
load two modules.  One for the uart on the sound card and one for the
SB 16.  Generic sound support is compiled into my kernel as a
non-module.  This is where the dirty work for your SCSI card would be.
If you get it right, your card WILL be seen by LINUX at boot time,
assuming you use your new kernel and got the modules compiled
correctly.  


The LINUX kernel system is quite elegant and flexible.  You can make a
very custom kernel with no modules tailored exactly for your environment,
or you can make one with modules to support a more generic, flexible,
changing environment.  It is really up to the user.  

Once you play with this for a while, you'll start to get it.  It was hard
for me to start out, plus I was building a kernel on a 386/25.  It took
hours.  Now it takes about 10-15 minutes, depending on the speed of your
hard drive.  

Make sure to keep as an option your original kernel, so you can choose it
with LILO at boot time.  Even if your new kernel doesn't work, your old
one will.  

        The last thing you need to worry about is the PNP sound card.
You may need to play around with ISAPNPTOOLS.  


                        Hope this helps,

                        Tom Wallis

   




[Prev in Thread] Current Thread [Next in Thread]