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

📄 116-120.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 and Configuring XFree86</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=3//-->

<!--PAGES=116-120//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="113-116.html">Previous</A></TD>

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

<TD><A HREF="120-122.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H3><A NAME="Heading5"></A><FONT COLOR="#000077">X on Linux</FONT></H3>

<P>X is very hardware-dependent. In the UNIX workstation world, you don&#146;t see many problems with this, because the UNIX vendors maintain tight control over the hardware and do the hard work of supporting X for that hardware.

</P>

<P>The PC realm, though, is different. You have zillions of vendors and a huge number of combinations of various graphics cards, monitors, buses, even lowly mice. So, as we&#146;ll repeat again and again, you need to know the intimate details of your hardware in order to get the X Window System up and running. If you&#146;re used to the UNIX workstation world, this will come as a rude surprise. If you&#146;ve already charted Chapters 1 and 2 of this book, it will less of a surprise.</P>

<P>X on Linux is actually in the form of XFree86, a public project devoted to bringing X Window to PC-based Unices. While there are some changes between a straight X Window System installation on a workstation and XFree86, you probably won&#146;t notice these differences.</P>

<H4 ALIGN="LEFT"><A NAME="Heading6"></A><FONT COLOR="#000077">How XFree86 Works</FONT></H4>

<P>Remember that X is both the X server (also named <B>X</B>) and a number of X application programs (also called <I>clients</I>). To get X going, you must first start the X server and then start a number of X applications. Almost always, one of these X applications will be a window manager.</P>

<P>To start X, you must first login your Linux system, such as in the following:</P>

<!-- CODE SNIP //-->

<PRE>

  Welcome to Linux 2.0.29

  yonsen login:

  Password:

</PRE>

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

<P>Once you login and get the Linux shell prompt, you can start X with the <B>startx</B> script:</P>

<!-- CODE SNIP //-->

<PRE>

     yonsen~#: startx

</PRE>

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

<P>This assumes that XFree86 has been configured correctly for your Linux installation, a process we&#146;ll go over in a bit.

</P>

<P>The <B>startx</B> script runs a program called <B>xinit</B>, which starts up the X server, <B>/usr/X11R6/bin/X</B> (you may be more familiar with <B>/usr/bin/X</B> on most other UNIX systems), and looks for a file named <B>.xinitrc</B> (note the leading dot) in your home directory. The <B>.xinitrc</B> file is a shell script that launches all the X applications you want. For example, our .<B>xinitrc</B> file launches a number of instances of the <B>xterm</B> program, which provides a shell window, and the rounded clock called <B>oclock</B>, as shown in Figure 3.4.</P>

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

<BR><A HREF="javascript:displayWindow('images/03-04.jpg',999,746)"><FONT COLOR="#000077"><B>Figure 3.4</B></FONT></A>&nbsp;&nbsp;A typical X environment started from the <B>.xinitrc</B> file.

</P>

<P>Before any of these programs is launched, though, the X server must be started, a task also handled by <B>xinit</B>.</P>

<P>The X server looks for the XFree86 configuration file&#151;the most critical file for X on your system. This file, usually named <B>XF86Config</B> and stored in <B>/usr/X11R6/lib/X11</B> (symbolically linked to <B>/var/X11R6/lib</B>), is a specially formatted file that tells XFree86 about your system&#146;s hardware.</P>

<P>The hardest part about installing XFree86 on your system will be in fleshing out this file. There are tools that help, but the process is still dangerous and fraught with error.</P>

<P>The <B>XF86Config</B> file contains six sections, each of which describes some part of your system to the X server. We list these sections in Table 3.2.</P>

<TABLE WIDTH="100%"><CAPTION><B>Table 3.2</B> Sections in the <B>XF86Config</B> File

<TR>

<TH WIDTH="30%" ALIGN="LEFT">Section

<TH WIDTH="70%" ALIGN="LEFT">Usage

<TR>

<TH COLSPAN="2"><HR>

<TR>

<TD><B>Files</B>

<TD>Tells where font and RGB files are located

<TR>

<TD VALIGN="TOP"><B>ServerFlags</B>

<TD>Special X server flags like DontZap, which turns off the <B>Ctrl-Alt-Backspace</B> sequence that aborts the X server

<TR>

<TD><B>Keyboard</B>

<TD>What kind of keyboard you have

<TR>

<TD><B>Pointer</B>

<TD>Information on your mouse

<TR>

<TD><B>Monitor</B>

<TD>Excruciating details about your monitor

<TR>

<TD><B>Device</B>

<TD>Graphics card

<TR>

<TD><B>Screen</B>

<TD>Combined card and monitor

<TR>

<TD COLSPAN="2"><HR>

</TABLE>

<P><FONT SIZE="+1"><B>Installing XFree86</B></FONT></P>

<P>To install and properly set up XFree86, a scary task under the best of conditions, you need to go through the following steps:

</P>

<DL>

<DD><B>&#149;</B>&nbsp;&nbsp;Determine your system configuration.

<DD><B>&#149;</B>&nbsp;&nbsp;Set up the proper X server for your graphics card.

<DD><B>&#149;</B>&nbsp;&nbsp;Fill out the <B>XF86Config</B> file.

<DD><B>&#149;</B>&nbsp;&nbsp;Test that you can run X.

<DD><B>&#149;</B>&nbsp;&nbsp;Tune your <B>XF86Config</B> file.

</DL>

<P>We&#146;ll cover all these steps in the rest of this chapter.

</P>

<P>Virtually all of XFree86&#151;including the version with the Slackware Linux on the accompanying CD-ROMs&#151;installs into the <B>/usr/X11R6</B> directory. Note that many other directories, such as <B>/usr/bin/X11</B> and <B>/usr/lib/X11</B>, will be symbolic links into locations in <B>/usr/X11R6</B>.</P>

<P>If you installed Linux and XFree86 from the accompanying CD-ROM, all the files are in the right place.</P>

<P>If you picked up an update to XFree86 from the Internet, then you&#146;ll likely need to unpack the collected files. Check the <B>README</B> file that was in the same directory as the XFree86 files you grabbed. Most likely, the files are compressed <B>tar</B> archives. For example, if you see a file like <B>X312bin.tar.gz</B>, you know that this file was compressed with GNU zip (<B>.gz</B>) from a tar file (<B>.tar</B>). To extract this file, use the following commands:</P>

<!-- CODE SNIP //-->

<PRE>

     mv X312bin.tar.gz /usr/X11R6

     cd /usr/X11R6

     gunzip X312bin.tar.gz

     tar xvof X312bin.tar

</PRE>

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

<P>The first two commands move the <B>XFree86</B> file (and your current working directory) to the <B>/usr/X11R6</B> directory, where Linux expects X files to be located.</P>

<P>Especially if you acquired XFree86 over the Internet, you must untar any XFree86 archives as the root user. Otherwise, you&#146;ll find that XFree86 does not install properly.</P>

<P>If you load XFree86 from the Slackware CD-ROM and use Slackware&#146;s installation program, you shouldn&#146;t have any problems.</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="113-116.html">Previous</A></TD>

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

<TD><A HREF="120-122.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 + -