📄 589-592.html
字号:
<HTML>
<HEAD>
<TITLE>Using Linux:Managing the Kernel</TITLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=0789716232//-->
<!--TITLE=Using Linux//-->
<!--AUTHOR=William Ball//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Que//-->
<!--CHAPTER=32//-->
<!--PAGES=589-592//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="586-589.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="592-596.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H4 ALIGN="LEFT"><A NAME="Heading20"></A><FONT COLOR="#000077">Before Configuring the Kernel</FONT></H4>
<P>Make sure that you note the following information about your system before configuring a kernel that you intend to use:
</P>
<DL>
<DD><B>•</B> Your processor type.
<DD><B>•</B> Whether your machine is PCI.
<DD><B>•</B> The type of IDE controller in your system (if there is one).
<DD><B>•</B> The type of SCSI controller in your system—manufacturer, model number, chipset number, and revision are important here.
<DD><B>•</B> The type of interface your CD-ROM uses.
<DD><B>•</B> The type of network card that’s in your system. Having the make and model number of the chipset on the network card is also quite handy.
<DD><B>•</B> The make, model, and chip number of your sound card. You should also note the interrupt request line (IRQ, for short), the IO addresses the card uses, and the DMA lines the card uses.
</DL>
<P>PC hardware is a complex thing. Not only is there a myriad of possible combinations of hardware for your computer, but also many manufacturers and their products, although not officially supported by Linux, use chip sets and other components that work just fine. Sometimes it’s a matter of trial and error to figure out what works, but often, the answer can be determined easily by getting the chip numbers from the cards, and looking into the appropriate directory containing similar drivers.
</P>
<P>In fact, the writers of the drivers for Linux often go as far as to include one or more documentation files with the drivers to explain some of the “gotchas” for a particular piece of hardware. Just look in the <TT>drivers</TT> subdirectory of the <TT>linux</TT> directory. The documentation files in the <TT>drivers/sound</TT> and <TT>drivers/net</TT> are particularly detailed.</P>
<P>Also, I recommend that, if you have never built a Linux kernel before, you review all the sections, in particular the <TT>make config</TT> and the <TT>make xconfig</TT> sections. They both deal with the same kernel, but the material (and configuration programs) are organized slightly differently. These differences may shed some light on items that may not be apparent from reading just one section.</P>
<H4 ALIGN="LEFT"><A NAME="Heading21"></A><FONT COLOR="#000077">Using <I>make config</I>
</FONT></H4>
<P>This section describes the classic way to configure the Linux kernel, and is entirely text based. I don’t recommend that you use it, simply because it’s inconvenient—after you make a decision, you must restart the process to change it.
</P>
<TABLE BORDER="2" BORDERCOLOR="#0000" ALIGN="CENTER">
<TR><TD><FONT SIZE="+1"><B>If the descriptions in this section differ from what you see on your system</B></FONT>
<BR>The kernel configuration examples here use a kernel that Red Hat Linux 5 did not ship with. Some additional support for devices has been added to the newer kernels, and the additional information about these devices is included in this section.</TABLE>
<P>To configure your kernel by using <TT>make config</TT>, change to the <TT>/usr/src/linux</TT> directory and, as root or someone with write permissions there, type the following command:</P>
<!-- CODE SNIP //-->
<PRE>
<B>make config</B>
</PRE>
<!-- END CODE SNIP //-->
<P>You are greeted by the following friendly message:
</P>
<!-- CODE //-->
<PRE>
[root@jansmachine linux]# make config
rm -f include/asm
( cd include ; ln -sf asm-i386 asm)
/bin/sh scripts/Configure arch/i386/config.in
#
# Using defaults found in .config
#
*
* Code maturity level options
*
Prompt for development and/or incomplete code/drivers
(CONFIG_EXPERIMENTAL)[Y/n/?]
</PRE>
<!-- END CODE //-->
<P>The questions usually list choices of valid answers, with the default answer in capital letters. If you cannot decide, type a question mark and press Enter. Usually there is some text to help you, but sometimes the answers are quite cryptic.
</P>
<P>In the case of the preceding code, you’ll normally want to answer <TT>Y</TT>, especially if you have a PCI–based PC.</P>
<P>The configuration script continues here:</P>
<!-- CODE SNIP //-->
<PRE>
*
* Loadable module support
*
Enable loadable module support (CONFIG_MODULES)[Y/n/?]
Set version information on all symbols for modules
(CONFIG_MODVERSIONS)[Y/n/?]
Kernel daemon support (e.g. autoload of modules)
(CONFIG_KERNELD)[Y/n/?]
</PRE>
<!-- END CODE SNIP //-->
<P>For normal configurations, answer <TT>Y</TT> to all of the above. If you want to turn off kernel daemon support, here is where it’s done.The configuration script continues here:</P>
<!-- CODE //-->
<PRE>
*
* General setup
*
Kernel math emulation (CONFIG_MATH_EMULATION)[N/y/?]
Networking support (CONFI|G_NET)[Y/n/?]
Limit memory to low 16MB (CONFIG_MAX_16M)[N/y/?]
PCI bios support (CONFIG_PCI)[Y/n/?]
PCI bridge optimization (experimental)
(CONFIG_PCI_OPTIMIZE)[Y/n/?]
</PRE>
<!-- END CODE //-->
<TABLE BORDER="2" BORDERCOLOR="#0000" ALIGN="CENTER">
<TR><TD><FONT SIZE="+1"><B>If you turn off kernel daemon support</B></FONT>
<BR>Turning off kernel daemon support can cause your system to lose network connectivity because there will be nothing to load the drivers when the network cards are configured in the <TT><B>init</B></TT> scripts on system boot. If you turn off this support, either compile the drivers for your network card into the kernel rather than as modules, or modify your <TT><B>init</B></TT> scripts to manually load the modules for your network card before the <TT><B>network</B></TT> script is called.</TABLE>
<P>These questions should be pretty clear. The most notable is the PCI Bridge Optimization option. It’s recommended, despite being experimental, and in my time I have not encountered any problems with this feature.
</P>
<P>The next section of script configures the binary formats the kernel supports, as well as other compatibility options:</P>
<!-- CODE //-->
<PRE>
System V IPC (CONFIG_SYSVIPC)[Y/n/?]
Kernel support for a.out binaries
(CONFIG_BINFMT_AOUT)[Y/m/n/?]
Kernel support for ELF binaries (CONFIG_BINFMT_ELF)[Y/m/n/?]
Kernel support for JAVA binaries
(CONFIG_BINFMT_JAVA)[N/y/m/?]
Compile kernel as ELF - if your GCC is ELF-GCC
(CONFIG_KERNEL_ELF)[Y/n/?]
Processor type (386, 486, Pentium, PPro)[Pentium]
defined CONFIG_M586
</PRE>
<!-- END CODE //-->
<P>These options allow you to set the types of binaries supported by the kernel. Respond <TT>Y</TT> to all options except Java support. Although the <TT>a.out</TT> format is the older Linux binary format, and is not technically required, it can prevent headaches when running older programs. Some kernel options can break Java compatibility, according to some sources, and in addition to this other modifications have to be made to the system to support Java binaries. As far as processor types are concerned, choose the one you have. It does not hurt too much to use a kernel built for a 386 on a Pentium system, but a kernel compiled for a Pentium will not run on a 386. If you have a NexGen processor, compile for 386, and make sure that Math Emulation (previous section) is turned on. If you have any other non-Intel processor, answer 486 here. Some processors ID themselves as Pentium processors, but some differences still exist. Besides, these processors tend to have more advanced features, such as out-of-order instruction execution, and do not need any of the more advanced optimizations to function at peak efficiency.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="586-589.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="592-596.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -