posted by Clinton De Young on Mon 3rd Mar 2003 03:07 UTC

"Configuring the kernel"

STARTING THE LINUX KERNEL CONFIGURATION TOOL

Assuming you are still in the "/usr/src" directory and have followed the instructions above, enter "cd linux" to change directories into the linux directory (which you may recall is a symbolic link to the linux-2.4.20 directory).

Once you are in the "/usr/src/linux" directory, you are ready to start the kernel configuration tool. Enter "make xconfig" at the command line to start the Linux Kernel Configuration tool.

If you would rather use the command line version of this tool instead of a graphical window, you need to enter "make menuconfig" at the command prompt. I'm not going to cover this tool in this walkthrough, but I think you should be able to follow along since the two tools are somewhat similar.

You should now be looking at a gray screen with a lot of buttons on it. If you received an error at the command line, and the tool didn't launch, open up another terminal window and enter "xhost +" as your regular user in order to allow other users (in this case root) to launch graphical applications from within your X environment. Once you have done this, enter "make xconfig" as root again to launch the Linux Kernel Configuration tool.

If the Linux Kernel Configuration tool still won't start, and you are still getting an error, make sure you installed all the necessary tools mentioned above. These are:

tk8.2, make, gcc, bin86, libc6-dev, kernel-package, libncurses5-dev (only necessary if you want to use the command line configuration tool)

If you have been able to successfully launch the Linux Kernel Configuration tool, we can continue to the next section.

CONFIGURING THE LINUX KERNEL

You should now have the Linux Kernel Configuration tool open. Before we begin, I recommend moving the Linux Kernel Configuration window up to the top of your screen. We will be opening up many child windows during the process of configuring the kernel, and those windows will pop up in relation to the main window (the one with all the buttons on it). If you place the main window towards the bottom of the screen, many of the child windows will appear mostly off the screen and you will forever be dragging them up so you can see them. You can save yourself a lot of clicking, dragging, and cursing by moving the main Linux Kernel Configuration window to the top of the screen.

Configuring the kernel sounds like a very scary task to some, but in reality, all you are doing is answering a whole bunch of multiple choice questions. For the most part, the Linux Kernel Configuration tool will ask you if you want to load support for something, and you will answer 'Y' (Yes) to load support for that item, 'N' (No) to not load support for that item, and 'M' (Module) to load support for that item as a module.

The benefit of loading things as modules is that the kernel is smaller (and probably faster) and you can load and unload that module at will without having to recompile your kernel. For the first time, however, I recommend selecting 'Y' for things you want to support. You can read about how to use modules later; once you are familiar and comfortable with recompiling your kernel.

Now, there is really no way for me to walk through every setting of the Linux kernel, since everyone's hardware is different. However, the Linux Kernel Configuration tool has a lot of help available. In fact, every multiple choice line of the Linux Kernel Configuration tool has a help button associated with it, and there is almost always good information in the help dialogs. I highly recommend reading the help dialogs for each line as you go through the kernel. It will help you make the right choices for your hardware, and also help you get familiar with the services the kernel provides.

Code maturity level options:
To see an example of the Linux Kernel Configuration tool and how it works, including the help dialogs, click on the "Code maturity level options" button, which is at the top left corner of the Linux Kernel Configuration window. You will notice that a new dialog window appears. In the case of the "Code maturity level options" dialog, there is only one question you need to answer, "Prompt for development and/or incomplete code/drivers".

Before we decide whether or not we want support for this item in our kernel, let's look at the help dialog. To do so, click on the "Help" button to the right of the "Prompt for development and/or incomplete code/drivers" text.

After you have read the help dialog, go back to the last paragraph and look at the first sentence again. It reads, "Unless you intend to help test and develop a feature or driver that falls into this category, or you have a situation that requires using these features, you should probably say N here." Many of the helps that are available in the Linux Kernel Configuration tool will explain what you are currently looking at and also suggest answers to you. I think this is very useful for those who are not familiar with compiling their own kernel. If you are unsure about a particular line item, I recommend following the suggestion offered by the help dialog. If no suggestion is given, the default value is usually a safe bet.

Just in case anybody has a question about this, by enabling the "Prompt for development and/or incomplete code/drivers", you enable sections in the Linux Kernel Configuration utility which are considered experimental or still a bit unstable. Firewire support is an example of this. If you look at the main window of the Linux Kernel Configuration tool, you will notice that there is a button for Firewire support that is disabled (meaning you can't click on it). If you were to select 'Y' for "Prompt for development and/or incomplete code/drivers" and then look at the main window again, you would see that the Firewire support button is now enabled. I don't recommend enabling this for now. Wait until you are more familiar with configuring your kernel.

Now that we know what the "Prompt for development and/or incomplete code/drivers" line item is, we can safely select 'N' (which is the default) at the left side of the line. You will also notice that there are only options for Y (Yes) and N (No). M (Module) is missing. If any of the three choices (Y, N, or M) are unavailable for a specific kernel option, it will not be displayed.

Since there are no more kernel settings on this dialog, click the "Next" button at the bottom of the dialog to go to the next dialog in the list. You could also click the "Main Menu" button and then select the next button below the "Code maturity level options" button, which is the "Loadable module support" button, but it is easier in my opinion to simply click the "Next" button when you are done with each dialog, and move through the configuration process in a linear fashion.

Loadable Module Support:
On the "Loadable module support" dialog, you will notice that there are three kernel options you need to set. Please read the descriptions of all three options and then select 'Y' for each of them. Press the "Next" button when you are finished.

Processor Type and Features:
This is the point of the kernel configuration where it gets specific to your hardware. The only reason I am bringing this dialog up is to show the drop down lists that also exist in the Linux Kernel Configuration tool, and help you out with a couple of the more cryptic options.

The very first item on this dialog is the "Processor family" option. You will notice, however, that instead of the standard Y - M - N choice that you have previously seen, you are presented with a button instead (I believe the default, and therefore the title currently displayed on the button, is "Pentium-III/Celeron (Coppermine). Click this button and select your computers processor from the list. If you don't know what kind of processor you have, the default will work, but it won't be optimized for your machine. My machine, for example, uses an AMD Athlon processor, so I will select the line that says "Athlon/Duron/K7" from the drop down list. If you don't know what processor you have, 386 is a safe, but un-optimized choice.

Please read the help dialogs available for each of the remaining options and chose the appropriate Y (Yes), N (No), or (M) Module settings for each. When you are finished, press the "Next" button. Also notice that some of the options you mill run into are not checkboxes or drop-down lists, but are actually buttons that bring up new windows. Make sure you click on all of these. Also, if you always click the "Next" button at the bottom of each window, you are guaranteed to see all aspects of the kernel. If you don't do this, you might miss something.

I will help configure CD-R/RW drives, Journaling file systems, and sound cards in a minute, but in the meantime, continue the procedure of reading the help for each line, making the appropriate selection (Y - N - or M), and selecting "Next" at the bottom of each window until you have gone completely through the kernel configuration. This will take some time, but it is well worth it.

I wish I could offer more help during this process, but I don't know your hardware, nor do I know what specifically you want to do with your machine. Therefore, I leave you in the competent hands of the help screens.

I would like to suggest that you adhere to the following guidelines, at least until you become familiar and comfortable with the Linux kernel. Often times, people think, "I'll just install support for everything". This is a very bad idea. Only compile support in for things you know you want or need. Also, if you don't know what something is, just accept the default. If you have questions, please use a good internet search engine, such as Google, to look for help. You may also email me if you'd like and I will help out where I can.

Please go through the entire kernel once before continuing.

Table of contents
  1. "Intro, Downloading the kernel"
  2. "Step by Step Kernel building, requirements"
  3. "Configuring the kernel"
  4. "Configuring for sound, ext3 and burners"
  5. "Compilation, Installing the kernel"
  6. "ext3 journaling, troubleshooting, conclusion"
e p (0)    59 Comment(s)

Technology White Papers

See More