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

📄 103-106.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Linux Configuration and Installation:Installing Linux</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=1558285660//-->

<!--TITLE=Linux Configuration and Installation//-->

<!--AUTHOR=Patrick Volkerding//-->

<!--AUTHOR=Kevin Reichard//-->

<!--AUTHOR=Eric Foster//-->

<!--PUBLISHER=IDG Books Worldwide, Inc.//-->

<!--IMPRINT=M & T Books//-->

<!--CHAPTER=2//-->

<!--PAGES=103-106//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="099-103.html">Previous</A></TD>

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

<TD><A HREF="106-109.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H4 ALIGN="LEFT"><A NAME="Heading27"></A><FONT COLOR="#000077">Using Kernel Modules</FONT></H4>

<P>The kernels used in Slackware are designed to support the hardware needed to get Linux installed. Once you&#146;ve installed and rebooted your system, you may find that your kernel lacks support for some of your hardware, such as a CD-ROM drive or Ethernet card. In this case, there are a couple of ways you can add this support. The traditional way would be to compile a custom Linux kernel that includes drivers for all your hardware. This requires that you have the Linux source code and C compiler installed and that you know exactly which options need to be compiled into your kernel. In short, compiling a custom kernel can be a rather difficult task for Linux beginners.

</P>

<P>Kernel modules to the rescue! If you&#146;ve installed device drivers before on MS-DOS, you&#146;ll probably find this a familiar way of adding support&#151;just think of the module configuration file <B>/etc/rc.d/rc. modules</B> as being the Linux counterpart of DOS&#146;s <B>CONFIG.SYS</B> file. To add support for new hardware, you need to edit the file and uncomment the lines that load the needed support. As an example, let&#146;s look at the section of the file used to load CD-ROM support, as shown in Figure 2.5.</P>

<!-- CODE //-->

<PRE>

# These modules add CD-ROM drive support. Most of these drivers will probe

# for the I/O address and IRQ of the drive automatically if the parameters

# to configure them are omitted. Typically the I/O address will be specified

# in hexadecimal, e.g.: cm206=0x300,11

#

#/sbin/modprobe aztcd aztcd=&lt;I/O address&gt;

#/sbin/modprobe cdu31a cdu31a_port=&lt;I/O address&gt; cdu31a_irq=&lt;interrupt&gt;

#/sbin/modprobe cm206 cm206=&lt;I/O address&gt;,&lt;IRQ&gt;

#/sbin/modprobe gscd gscd=&lt;I/O address&gt;

#/sbin/modprobe mcd mcd=&lt;I/O address&gt;,&lt;IRQ&gt;

#/sbin/modprobe mcdx mcdx=&lt;I/O address&gt;,&lt;IRQ&gt;

#/sbin/modprobe optcd optcd=&lt;I/O address&gt;

# Below, this last number is "1" for SoundBlaster Pro card, or "0" for a clone.

#/sbin/modprobe sbpcd sbpcd=&lt;I/O address&gt;,1

#/sbin/modprobe sonycd535 sonycd535=&lt;I/O address&gt;

#/sbin/modprobe sjcd sjcd=&lt;I/O address&gt;

</PRE>

<!-- END CODE //-->

<P><B><U>Figure 2.5</U></B> A section of the <B>/etc/rc.d/rc.modules</B> file.</P>

<P>You&#146;ll notice that each of the lines starts with <TT>#</TT>. In most Linux configuration files, any line beginning with <TT>#</TT> is ignored, much like lines in DOS configuration files that begin with <TT>REM</TT>. To activate support for one of these devices, you&#146;ll need to remove the <TT>#</TT> from the beginning of the line and edit the line to include any extra information about your hardware needed by the kernel module. For example, if your machine needs support for a SoundBlaster CD-ROM drive on port 0x300, you&#146;d need to edit the line for <B>sbpcd</B> support so that it looks like this:</P>

<!-- CODE SNIP //-->

<PRE>

     /sbin/modprobe sbpcd sbpcd=0x300,1

</PRE>

<!-- END CODE SNIP //-->

<P>Then, the next time you boot your machine, the <B>sbpcd</B> module will be loaded, and you&#146;ll be able to use your drive. Drivers for nearly every device supported by Linux can be added in a similar fashion.</P>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR><B>NOTE:&nbsp;&nbsp;</B>If you use kernel modules and decide later to upgrade your kernel, you&#146;ll need to upgrade your kernel modules as well. When configuring the kernel, select <B>M</B> instead of <B>Y</B> to build selected drivers as kernel modules instead of building them into the kernel. Once you&#146;ve compiled your kernel with:

<!-- CODE SNIP //-->

<PRE>

make dep ; make clean ; make zImage

</PRE>

<!-- END CODE SNIP //-->

<P>you can compile and install the kernel modules with the command:

</P>

<!-- CODE SNIP //-->

<PRE>

make modules ; make modules_install

</PRE>

<!-- END CODE SNIP //-->

<P>The modules will be installed in a directory named for the running kernel&#151;if you&#146;re running Linux 2.0.0, you&#146;ll find them under <B>/lib/modules/2.0.0</B>.<HR></FONT>

</BLOCKQUOTE>

</P>

<H4 ALIGN="LEFT"><A NAME="Heading28"></A><FONT COLOR="#000077">Looking for Help</FONT></H4>

<P>Most UNIX systems have an online-manual page system, and Linux is no exception. You can use the <B>man</B> command to summon information about specific commands:</P>

<!-- CODE SNIP //-->

<PRE>

     darkstar:~# man man

</PRE>

<!-- END CODE SNIP //-->

<P>Online-manual pages aren&#146;t organized by topic; they&#146;re organized by specific command.

</P>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR><B>NOTE:&nbsp;&nbsp;</B>There are other informational sources included with the Linux operating system. They&#146;ll be discussed in Chapter 5.<HR></FONT>

</BLOCKQUOTE>

<H3><A NAME="Heading29"></A><FONT COLOR="#000077">Shutting Linux Down</FONT></H3>

<P>Like any good UNIX, Linux responds to the <B>shutdown</B> command. You&#146;ll need to provide it with a command-like parameter and an amount of time to wait before actually shutting the system down. This may seem odd if you&#146;re used to working alone on a PC, but the <B>shutdown</B> command is usually saved for serious shutdowns, as most UNIX installations support many users and rarely shutdown. In fact, you must be logged in as <B>root</B> in order to use the <B>shutdown</B> command. Use the following command line:</P>

<!-- CODE SNIP //-->

<PRE>

     $ shutdown -r now

</PRE>

<!-- END CODE SNIP //-->

<P>This shuts down the system immediately.

</P>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR><B>WARNING:&nbsp;&nbsp;</B>Don&#146;t just turn off the power to turn off a Linux system. This can cause damage to important files.<HR></FONT>

</BLOCKQUOTE>

<P>An alternative method of shutting down Linux is the old tried-and-true PC <B>Ctrl-Alt-Del</B> sequence, which is used to reboot a system. When running Linux, this sequence performs the same functions as <B>shutdown -r now</B>. When the PC cycles to reboot, simply turn it off. Despite what others may claim, this is a perfectly acceptable way to shutdown a Linux system.</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="099-103.html">Previous</A></TD>

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

<TD><A HREF="106-109.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 + -