⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 569-573.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 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=569-573//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="../ch31/567-568.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="573-575.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H2><A NAME="Heading1"></A><FONT COLOR="#000077">CHAPTER 32<BR>Managing the Kernel

</FONT></H2>

<P><I>By Jan Walter</I></P>

<DL>

<DD>Using the Red Hat <TT>kernelcfg</TT> tool

<DD>Editing the Linux kernel configuration files

<DD>Managing modules

<DD>Managing processes

<DD>Recompiling the kernel

</DL>

<P>The <I>kernel</I> is the core component of every operating system. The performance of the kernel determines the most fundamental properties of the operating system, as it is an application&#146;s gateway to the computer hardware. Modern kernels provide <I>preemptive multitasking</I> capability, which allows multiple programs to operate seemingly at the same time. This is physically impossible with only one system processor, but the kernel schedules the processes in such a way that they seem to be running concurrently.</P>

<P>While the Linux kernel is a complicated piece of software, it is one of the most simple 32-bit kernel designs in common use. Linux has always been on the leading edge of feature support, as well as performance&#151;a truly rare combination. The simplicity of the kernel also increases the system&#146;s reliability, which is another of Linux&#146;s hallmarks.</P>

<P>The Linux kernel requires very little maintenance after it is set up to run correctly. It&#146;s the process of getting it that way, however, that many newcomers to Linux have complained about.</P>

<P>Red Hat Linux is almost completely configurable at run-time, with few reboots required. This means that networking, sound cards, file systems, and even device support can be dynamically reconfigured, added, and removed from the system as necessary to facilitate almost any configuration.</P>

<H3><A NAME="Heading2"></A><FONT COLOR="#000077">Using the Red Hat <I>kernelcfg</I> Tool

</FONT></H3>

<P><TT>kernelcfg</TT> is the graphical management utility included with Red Hat Linux that manages <TT>kerneld</TT>. <TT>kerneld</TT> manages the automatic loading and unloading of kernel device driver modules&#151;for instance, the Zip drive driver is loaded into memory only when a program needs to use the Zip drive.</P>

<P>In particular, <TT>kerneld</TT> is very useful for dealing with filesystem drivers, since these are loaded and unloaded often in general use. <TT>kerneld</TT> knows about file system modules, and is usually smart enough to figure out if it needs to load one to access a file system. It gets this information from <TT>/etc/fstab</TT>, the file system configuration file.</P>

<P>As of this writing, the <TT>kernelcfg</TT> program has a number of problems, especially with regard to saving the configuration file. The following sections document how <TT>kernecfg</TT> is <I>supposed</I> to work. Keep an eye on the Red Hat Linux Web site for updates to <TT>kernecfg</TT>.</P>

<H4 ALIGN="LEFT"><A NAME="Heading3"></A><FONT COLOR="#000077">Adding a Module to the Kernel Configuration</FONT></H4>

<P>Only SCSI host and ethernet device modules need to be added to the kernel configuration. Most of these devices benefit from command-line arguments, and using <TT>kernelcfg</TT> is a good way to keep things consistent and reduce the amount of searching the driver has to do to find your particular hardware.</P>



<TABLE BORDER="2" BORDERCOLOR="#0000" ALIGN="CENTER">

<TR><TD><FONT SIZE="+1"><B>Booting from a SCSI device</B></FONT>

<BR>If your system is booting from a SCSI device, the Linux kernel must load the SCSI device driver module before <TT>kerneld</TT> is even running. This is achieved by using an initial ramdisk, from which the driver is loaded. By convention, this SCSI adapter is still configured for <TT>kerneld</TT>, but in reality it has no effect because the driver is vital to system operation.</TABLE>



<DL>

<DD><B>1.</B>&nbsp;&nbsp;Log on as root and start X Window.

<DD><B>2.</B>&nbsp;&nbsp;From the Control Panel, select Kernel Daemon Configuration. You might have to start the Control Panel application yourself before doing this. Open an X Terminal window and enter <TT>control-panel &#38;</TT> to open the Control Panel, shown in Figure 32.1.

<P><A NAME="Fig1"></A><A HREF="javascript:displayWindow('images/32-01.jpg',112,444 )"><IMG SRC="images/32-01t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/32-01.jpg',112,444)"><FONT COLOR="#000077"><B>Figure 32.1</B></FONT></A>&nbsp;&nbsp;Clicking the topmost icon in the Control Panel starts the <TT>kernel</TT> Daemon Configuration applet.

</P>

<DD><B>3.</B>&nbsp;&nbsp;Click the topmost icon in the Control Panel to open the Kernel Configurator applet, shown in Figure 32.2. Click the Add button.

<P><A NAME="Fig2"></A><A HREF="javascript:displayWindow('images/32-02.jpg',445,258 )"><IMG SRC="images/32-02t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/32-02.jpg',445,258)"><FONT COLOR="#000077"><B>Figure 32.2</B></FONT></A>&nbsp;&nbsp;This is how the Kernel Configurator applet looks on the author&#146;s system.</P>

<DD><B>4.</B>&nbsp;&nbsp;From the dialog box shown in Figure 32.3, choose the module type that you want to add (click the Module Types button to get a list of them). The most common additions are ethernet devices (<TT>eth</TT>) and SCSI host adapters (<TT>scsi_hostadapter</TT>). Occasionally, a proprietary-interface CD-ROM must be configured (<TT>cdrom</TT>). The remainder of the additions deal with Token-Ring networks, parallel-port networking, and other more advanced configuration topics.

<P><A NAME="Fig3"></A><A HREF="javascript:displayWindow('images/32-03.jpg',246,101 )"><IMG SRC="images/32-03t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/32-03.jpg',246,101)"><FONT COLOR="#000077"><B>Figure 32.3</B></FONT></A>&nbsp;&nbsp;Click the module type you want to add to your system&#146;s configuration.</P>

<BR>For this example, configure <TT>kerneld</TT> to automatically load and unload the device driver for our parallel port Zip drive. Choose <TT>scsi_hostadapter</TT>, and then click OK.

<DD><B>5.</B>&nbsp;&nbsp;The Kernel Configurator now requires the exact module name. In this example, it is <TT>ppa</TT>. Click the Which Module? button in the Define Module dialog box (shown in Figure 32.4) to find the module you want. Click OK to proceed.

<P><A NAME="Fig4"></A><A HREF="javascript:displayWindow('images/32-04.jpg',251,101 )"><IMG SRC="images/32-04t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/32-04.jpg',251,101)"><FONT COLOR="#000077"><B>Figure 32.4</B></FONT></A>&nbsp;&nbsp;In this case, the <TT>ppa</TT> module was selected.

</P>

<DD><B>6.</B>&nbsp;&nbsp;Now comes the module-specific part. Most modules accept a number of arguments, like device addresses and interrupt numbers. These depend on the device, and most device drivers are able to autodetect the device parameters. Autodetection of device parameters is not fool-proof, however, and can cause your machine to hang, crash, or do other undesirable things. Fortunately, the Kernel Configurator seems to know about the parameters a particular module can take. Click Done when you&#146;re satisfied that everything is set up correctly.

<BR>Figure 32.5 shows the options available for the <TT>ppa</TT> parallel port Zip drive.

<P><A NAME="Fig5"></A><A HREF="javascript:displayWindow('images/32-05.jpg',321,249 )"><IMG SRC="images/32-05t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/32-05.jpg',321,249)"><FONT COLOR="#000077"><B>Figure 32.5</B></FONT></A>&nbsp;&nbsp;Entering the module options for the <TT>ppa</TT> module.

</P>

<DD><B>7.</B>&nbsp;&nbsp;To get <TT>kerneld</TT> to recognize the changes to the configuration, click the Restart <TT>kerneld</TT> button.

</DL>



<TABLE BORDER="2" BORDERCOLOR="#0000" ALIGN="CENTER">

<TR><TD><FONT SIZE="+1"><B>Finding information on module parameters</B></FONT>

<BR>Module documentation has always been something of a weak point in Linux. The most up-to-date information is always included in the kernel, but some repositories on the Internet are also starting to keep this information. (A good place to start looking is the Linux Documentation Project, at <A HREF="http://sunsite.unc.edu/ldp/">http://sunsite.unc.edu/LDP/</A>.) The problem with the information included with the kernel source itself is that it is scattered in all the directories in various <TT><B>Readme</B></TT> files, and for some modules the only way to find out what the parameters are called is to read the source code for the module.</TABLE>



<P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="../ch31/567-568.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="573-575.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 + -