old-www/LDP/gs/node7.html

862 lines
44 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!--Converted with LaTeX2HTML 96.1-h (September 30, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
<HTML>
<HEAD>
<TITLE>5 The X Window System</TITLE>
<META NAME="description" CONTENT="5 The X Window System">
<META NAME="keywords" CONTENT="gs">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<LINK REL=STYLESHEET HREF="gs.css">
</HEAD>
<BODY LANG="EN" >
<A NAME="tex2html868" HREF="node8.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A> <A NAME="tex2html866" HREF="gs.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A> <A NAME="tex2html860" HREF="node6.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <A NAME="tex2html870" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html869" HREF="node8.html">6 Networking</A>
<B>Up:</B> <A NAME="tex2html867" HREF="gs.html">Linux Installation and Getting </A>
<B> Previous:</B> <A NAME="tex2html861" HREF="node6.html">4 System Administration</A>
<BR> <P>
<H1><A NAME="SECTION00700000000000000000">5 The X Window System</A></H1>
<A NAME="chapxwindows">&#160;</A>
<P>
<A NAME="5624">&#160;</A>
<A NAME="5625">&#160;</A>
<P>
The X&nbsp;Window System is a graphical user interface (GUI) that was
originally developed at the Massachusetts Institute of
Technology. Commercial vendors have since made X the industry standard
GUI for UNIX platforms. Virtually every UNIX workstation in the world
now runs some form of X.
<P>
<A NAME="5628">&#160;</A>
<A NAME="5629">&#160;</A>
A free port of the MIT X&nbsp;Window System version 11, release 6 (X11R6)
for 80386, 80486, and Pentium UNIX systems was developed by a team of
programmers that was originally headed by David Wexelblat. This
release, known as XFree86<A NAME="tex2html427" HREF="footnode.html#5630"><IMG ALIGN=BOTTOM ALT="gif" SRC="foot_motif.gif"></A>, is available for System V/386, 386BSD, and
other Intel x86 UNIX implementations, including Linux. It provides all
of the binaries, support files, libraries, and tools required for
installation.
<P>
Some features offered by this release are:
<UL>
<LI> complete inclusion of the X Consortium's X11R6.3 release;
<LI> a new DPMS extension, donated by Digital Equipment Corporation;
<LI> the Low Bandwidth X (LBX) extension in all X servers;
<LI> Microsoft IntelliMouse support;
<LI> support for <TT>gzip</TT> font compression.
</UL>
<P>
To use the X Window System, you are encouraged to read <EM>The
X&nbsp;Window System: A User's Guide</EM> (see Appendix&nbsp;<A
HREF="app-sources/node1.html">A</A>).
Here, we describe step-by-step an XFree86 installation under Linux.
You still need to fill in some of the details by reading the XFree86
documentation, which is discussed below. The Linux <EM>XFree86 HOW
TO</EM> is another good information source.
<P>
<H1><A NAME="SECTION00710000000000000000">5.1 X Window Hardware requirements.</A></H1>
<P>
<A NAME="secxwindowsreqs">&#160;</A>
<H2><A NAME="SECTION00711000000000000000">5.1.1 Video display.</A></H2>
<P>
<A NAME="5640">&#160;</A>
<A NAME="5641">&#160;</A>
<A NAME="5642">&#160;</A>
The documentation for your video adaptor should specify the chip
set. If you are in the market for a new video card, or are buying a
machine that comes with a video card, ask the vendor to find out
exactly what make, model, and chip set the video card comes with. The
vendor may need to call the manufacturer's technical support
department. Many personal computer hardware vendors state their video
card is a ``standard SVGA card,'' that ``should work,'' with your
system. Explain that your software (mention Linux and XFree86!) does
not support all video chip sets, and that you must have detailed
information.
<P>
You can also determine your video card chip set by running the <TT>
SuperProbe</TT> program which is included with the XFree86
distribution. This is described below.
<P>
Video cards using these chip sets are supported on all bus types.
Virtually all of the cards support 256-color graphics
modes. In addition, some of the cards support color modes like
monochrome, 15-bit, 16-bit, 24-bit and 32-bit. For color depths greater than
256 (8-bit), you must have the requisite amount of video dynamic RAM
(DRAM) installed. The usual configuration is 16 bits per pixel
(65536 colors).
<P>
The monochrome server also supports generic VGA cards, the Hercules
monochrome card, the Hyundai HGC1280, Sigma LaserView, and Apollo
monochrome cards.
<P>
The release notes for the current version of XFree86 should contain
the complete list of supported video chip sets. The XFree86
distribution has chip set-specific README files that give detailed
information on the state of support for each chip set.
<P>
One problem faced by the XFree86 developers is that some video card
manufacturers use non-standard mechanisms to determine the clock
frequencies that are used to drive their card. They either don't
release specifications which describe how to program the card or
require developers to sign non-disclosure statements to get the
information. This practice restricts the free distribution of XFree86,
and the XFree86 development team is unwilling to accept it. This has
been a problem with older video cards manufactured by Diamond, but
as of release 3.3, Diamond actively supports the XFree86 Project, Inc.
<P>
We also suggest using an accelerated card,
like a S3 chip set card. You should check the XFree86 documentation
and verify that your particular card is supported before you take the
plunge and purchase expensive hardware. Benchmark comparisons of video
cards under XFree86 are posted routinely to the Usenet news groups
<TT>comp.windows.x.i386unix</TT> and <TT>comp.os.linux.misc</TT>.
<P>
It is important to note that the average accelerated video card is
significantly faster than the standard graphics card of most
workstations. An 80486DX2, 66-MHz Linux System with 20 megabytes of
RAM, equipped with a VESA Local Bus (VLB) S3-864 chip set card with 2
megabytes of DRAM, will consistently be about 7 times as fast a Sun
Sparc IPX workstation on X benchmarks with the XFree86 server version
3.1. Version 3.3 is even faster. In general, a Linux system with an
accelerated SVGA card will give you much greater performance than
commercial UNIX workstations, which usually employ simple frame
buffers for graphics.
<P>
<H2><A NAME="SECTION00712000000000000000">5.1.2 Memory, CPU, and disk space.</A></H2>
<P>
The suggested setup for XFree86 under Linux is a 80486 or faster machine with at
least 16 megabytes of RAM.
The more physical RAM
installed, the less the system must swap to and from the disk when
memory is low. Because swapping is inherently slow (disks are very
slow compared to memory), having 16 megabytes of RAM or more is
necessary to run XFree86 comfortably. A system with 4 megabytes of
physical RAM could run 10 to 100 times more slowly than one with 16 megabytes
or more.
<P>
A standartd, out-of-the-box XFree86 installation requires 60-80 megabytes
of disk space, at a minimum. This includes space for the X server(s),
fonts, libraries, and standard utilities. If you plan to add
applications, you can probably run XFree86 comfortably in 200
megabytes of disk space.
<P>
<H1><A NAME="SECTION00720000000000000000">5.2 XFree86 installation.</A></H1>
<P>
<A NAME="5648">&#160;</A>
<P>
The Linux binary distribution of XFree86 is found on all CD Linux
distributions and can also be found at a number of
FTP sites. On <TT>sunsite.unc.edu</TT>, it is found in the directory <TT>
/pub/X11/XFree86</TT>. At of the time of this writing, the current
version is 3.3.1. Newer versions are released periodically. If you
obtain XFree86 as part of a Linux distribution, downloading the
software separately is not necessary.
<P>
These files are included in the XFree86-3.3.1 distribution.
<P>
One of the following servers is required:
<BR><IMG WIDTH=399 HEIGHT=307 ALIGN=BOTTOM ALT="tabular5652" SRC="img329.gif"><BR>
<P>
All of the following files are required:
<BR><IMG WIDTH=482 HEIGHT=220 ALIGN=BOTTOM ALT="tabular5670" SRC="img330.gif"><BR>
<P>
The following is required for new installations, and optional for
existing installations:
<BR><IMG WIDTH=345 HEIGHT=46 ALIGN=BOTTOM ALT="tabular5684" SRC="img331.gif"><BR>
<P>
Do not install <TT>X33cfg.tgz</TT> over an existing XFree86 installation
without first backing up the configuration files. Unpacking <TT>
X33cfg.tgz </TT> overwrites these and other files. If you do have
customized configuration files, there is no need to install this
package anyway.
<P>
The bit mapped fonts distributed with release 3.3.1 are compressed
with the <TT>gzip</TT> program rather than <TT>compress</TT>. You will
probably want to remove the old fonts after you back them up. The X
servers and font servers in previous releases cannot read fonts
compressed by <TT>gzip</TT>, so keep a copy of the old fonts if you want
to use older servers.
<P>
The following files are optional:
<BR><IMG WIDTH=490 HEIGHT=328 ALIGN=BOTTOM ALT="tabular5695" SRC="img332.gif"><BR>
<P>
The XFree86 directory should contain <TT>README</TT> files and
installation notes for the current version.
<P>
Next, as root, create the directory <TT>/usr/X11R6</TT> if it doesn't
already exist. Then run the pre-installation script, <TT>
preinst.sh</TT>. You should copy the script, and all of the archive files
for your system to the <TT>/var/tmp</TT> directory before you run <TT>
preinst.sh</TT>. <TT>/usr/X11R6</TT> must be your current directory when you
run the pre-installation script and unpack the archives.
<P>
<BR><IMG WIDTH=205 HEIGHT=34 ALIGN=BOTTOM ALT="tscreen5719" SRC="img333.gif"><BR>
<P>
You should then unpack the files from <TT>/var/tmp</TT> to <TT>
/usr/X11R6</TT> with a command like:
<BR><IMG WIDTH=372 HEIGHT=15 ALIGN=BOTTOM ALT="tscreen5723" SRC="img334.gif"><BR>
<P>
These <TT>tar</TT> files are packed relative to <TT>/usr/X11R6</TT>. You
must unpack the files there. On some Linux distributions, the parent
directory is <TT>/var/X11R6</TT> instead.
<P>
After you have upacked the required files and any optional files you
selected, run the post-installation script <TT>postinst.sh</TT>.
<BR><IMG WIDTH=213 HEIGHT=34 ALIGN=BOTTOM ALT="tscreen5729" SRC="img335.gif"><BR>
<P>
Now link the file <TT>/usr/X11R6/bin/X</TT> to the server that supports
your video card. For example, the SVGA color server, <TT>
/usr/bin/X11/X</TT> should be linked to <TT>
/usr/X11R6/bin/XF86_SVGA</TT>. To use the monochrome server instead,
relink <TT>X</TT> to <TT>XF86_MONO</TT> with the command
<BR><IMG WIDTH=442 HEIGHT=9 ALIGN=BOTTOM ALT="tscreen5736" SRC="img336.gif"><BR>
The same holds true for the other servers.
<P>
You also need to ensure that the directory, <TT>/usr/X11R6/bin</TT>,
is on your path. This can be done by editing your system default <TT>
/etc/profile</TT> or <TT>/etc/csh.login</TT> (based on the shell that you, or
other users on your system, use). Or you can simply add the directory
to your personal path by modifying <TT>/etc/.bashrc</TT> or <TT>
/etc/.cshrc</TT>, based on your shell.
<P>
Finally, ensure that <TT>/usr/X11R6/lib</TT> can be located by <TT>
ld.so</TT>, the run time linker. To do this, add the line
<BR><IMG WIDTH=118 HEIGHT=9 ALIGN=BOTTOM ALT="tscreen5745" SRC="img337.gif"><BR>
to the file <TT>/etc/ld.so.conf</TT>, and run <TT>/sbin/ldconfig</TT>, as
<TT>root</TT>.
<P>
<H1><A NAME="SECTION00730000000000000000">5.3 Probing the hardware configuration.</A></H1>
<P>
If you aren't sure which server to use or don't know the video card's
chip set, the <TT>SuperProbe</TT> program, which is found in <TT>
/usr/X11R6/bin</TT>, can attempt to determine the video chip set and other
information. Write down its output for later reference.
<P>
To run SuperProbe from the command line, simply enter
<BR><IMG WIDTH=102 HEIGHT=12 ALIGN=BOTTOM ALT="tscreen5753" SRC="img338.gif"><BR>
<P>
It is possible that <TT>SuperProbe</TT> will confuse hardware
that uses I/O port addresses that might be used by video cards. To
prevent SuperProbe from checking these addresses, use the <TT>excl</TT>
argument, followed by a list of addresses that <TT>SuperProbe</TT> should
not examine. For example:
<BR><IMG WIDTH=307 HEIGHT=12 ALIGN=BOTTOM ALT="tscreen5758" SRC="img339.gif"><BR>
The addresses are given as hexadecimal numbers that are prefixed by
<TT>0x</TT>.
<P>
To display a list of video devices that SuperProbe knows about, use
the command
<BR><IMG WIDTH=153 HEIGHT=12 ALIGN=BOTTOM ALT="tscreen5761" SRC="img340.gif"><BR>
<P>
<TT>SuperProbe</TT> can print lots of information if you provide it with
the <TT>-verbose</TT> argument. You can redirect the output to a file:
<BR><IMG WIDTH=315 HEIGHT=12 ALIGN=BOTTOM ALT="tscreen5765" SRC="img341.gif"><BR>
<P>
Running SuperProbe can cause the system to hang. Make
certain that any non-essential applications are not running, or at
least have all of their data safely saved to disk, and ensure that any
users are logged off. Also, a loaded system (one that is printing in
the background, for example), can skew the output of software like
SuperProbe or an X server that is trying to measure the video card's
timing specifications.
<P>
<H1><A NAME="SECTION00740000000000000000">5.4 Automatically generating the <TT>XF86Config</TT> file.</A></H1>
<P>
Creating the <TT>XF86Config</TT> file by hand is an arduous task, but it
is not impossible. Several tools in the XFree86 version 3.3.1 can
assist you. One of them, the <TT>XF86Setup</TT> program, can
automatically generate an XF86Config file in the correct format. You
must know the exact specifications of your video board and the
Vertical and Horizontal refresh values of your monitor. Most of the
information can be found in the owner's manuals.
<P>
Several other configuration programs are available as well, depending
on the Linux distribution. The most common ones are <TT>
Xconfigurator</TT> and <TT>xf86config</TT>. The latter program is an older
version of <TT>XF86Setup</TT> and is included in older releases of
XFree86. You should always use <TT>XF86Setup</TT> if both it and <TT>
xf86config</TT> are available.
<P>
<H1><A NAME="SECTION00750000000000000000">5.5 Configuring XFree86.</A></H1>
<P>
<A NAME="5776">&#160;</A>
<P>
In this section, we describe how to create and edit the <TT>
XF86Config</TT> file, which configures the XFree86 server. In many cases,
it is best to start with an XFree86 configuration that uses a low
resolution like 640x480 that is supported by nearly all video cards
and monitors. Once XFree86 works at a lower, standard resolution, you
can tweak the configuration to exploit the capabilities of your video
hardware. This ensures that XFree86 works on your system, and that the
installation is essentailly correct, before you attempt the sometimes
difficult task of setting up XFree86 for high-performance use.
<P>
In addition to the information listed here, you should read the following
documents:
<UL>
<LI> The XFree86 documentation in <TT>/usr/X11R6/lib/X11/doc</TT> (from
the <TT>XFree86-3.1-doc</TT> package). You should especially see the file
<TT>README.Config</TT>, which is an XFree86 configuration tutorial.
<LI> Several video chip sets have separate <TT>README</TT> files in the
above directory (like <TT>README.Cirrus</TT> and <TT>README.S3</TT>). Read
the file that applies to your video card.
<LI> The manual page for <TT>XFree86</TT>.
<LI> The manual page for <TT>XF86Config</TT>.
<LI> The manual page for the server that you are using, like
<TT>XF86_SVGA</TT> or <TT>XF86_S3</TT>.
</UL>
<P>
<A NAME="5790">&#160;</A>
<A NAME="6152">&#160;</A>
<A NAME="6153">&#160;</A>
The main XFree86 configuration file is <TT>
/usr/X11R6/lib/X11/XF86Config</TT>. This file contains information for
your mouse, video card parameters, and so on. The file <TT>
XF86Config.eg</TT> is provided with the XFree86 distribution as an
example. Copy this file to <TT>XF86Config</TT> and edit it as a starting
point.
<P>
The <TT>XF86Config</TT> manual page explains the format of the <TT>
XF86Config</TT> file. Read the manual page if you have not done so
already.
<P>
We are going to describe a sample <TT>XF86Config</TT> file, a section at
a time. This file may not look exactly like the sample file included
in the XFree86 distribution, but the structure is the same.
<P>
Note that the <TT>XF86Config</TT> file format may change
with each version of XFree86. See your distribution's release notes
for errata.
<P>
<B>Do not copy the configuration file
listed here to your system and try to use it.</B> A configuration file
that does not correspond to your hardware can drive the monitor at a
frequency which is too high. There have been reports of damage to
monitors, especially fixed-frequency monitors, that has been caused by
incorrectly configured <TT>XF86Config</TT> files. <B>Make absolutely
sure that your <TT>XF86Config</TT> file corresponds to your hardware
before you use it.</B>
<P>
Each section of the <TT>XF86Config</TT> file is surrounded by a pair of
lines with the syntax, <TT>Section &quot;section-name&quot;</TT>...<TT>
EndSection</TT>.
<P>
The first section of the <TT>XF86Config</TT> file is <TT>Files</TT>, which
looks like this:
<P>
<BR><IMG WIDTH=419 HEIGHT=89 ALIGN=BOTTOM ALT="tscreen5808" SRC="img342.gif"><BR>
The <TT>RgbPath</TT> line sets the path to the X11R6 RGB color database,
and each <TT>FontPath</TT> line sets the path to a directory containing
X11 fonts. You shouldn't have to modify these lines. Simply ensure
that a <TT>FontPath</TT> entry exists for each font type that you have
installed; that is, for each directory in <TT>
/usr/X11R6/lib/X11/fonts</TT>.
<P>
The next section is <TT>ServerFlags</TT>, which specifies several global
flags for the server. In general this section is empty.
<BR><IMG WIDTH=591 HEIGHT=169 ALIGN=BOTTOM ALT="tscreen5815" SRC="img343.gif"><BR>
In this <TT>ServerFlags</TT> section, all of the lines are commented out.
<P>
The next section is <TT>Keyboard</TT>. This example shows a basic
configuration that should work on most systems. The <TT>XF86Config</TT>
file describes how to modify the configuration.
<BR><IMG WIDTH=220 HEIGHT=89 ALIGN=BOTTOM ALT="tscreen5820" SRC="img344.gif"><BR>
<P>
The next section is <TT>Pointer</TT>, which specifies parameters for the
mouse device:
<BR><IMG WIDTH=496 HEIGHT=308 ALIGN=BOTTOM ALT="tscreen5823" SRC="img345.gif"><BR>
For the moment, the only options that should concern you are <TT>
Protocol</TT> and <TT>Device</TT>. <TT>Protocol</TT> specifies the mouse <EM>
protocol,</EM> which is not necessarily the same as the manufacturer.
XFree86 under Linux recognizes these mouse protocols:
<UL>
<LI> <TT>BusMouse</TT>
<LI> <TT>Logitech</TT>
<LI> <TT>Microsoft</TT>
<LI> <TT>MMSeries</TT>
<LI> <TT>Mouseman</TT>
<LI> <TT>MouseSystems</TT>
<LI> <TT>PS/2</TT>
<LI> <TT>MMHitTab</TT>
</UL>
<TT>BusMouse</TT> should be used for the Logitech bus mice. Older
Logitech mice use <TT>Logitech</TT>, and newer Logitech serial mice use
either <TT>Microsoft</TT> or <TT>Mouseman</TT> protocols.
<P>
<TT>Device</TT> specifies the device file by which the mouse can be
accessed. On most Linux systems, this is <TT>/dev/mouse</TT>, which is
usually a link to the appropriate serial port, like <TT>/dev/cua0</TT>
for serial mice and the appropriate bus mouse device for bus mice. At
any rate, be sure that the device file exists.
<P>
The next section is <TT>Monitor</TT>, which specifies the characteristics
of your monitor. As with other sections in the <TT>XF86Config</TT> file,
there may be more than one <TT>Monitor</TT> section. This is useful if
you have multiple monitors connected to a system, or use the same <TT>
XF86Config</TT> file for multiple hardware configurations.
<P>
<BR><IMG WIDTH=590 HEIGHT=348 ALIGN=BOTTOM ALT="tscreen5850" SRC="img346.gif"><BR>
<TT>Identifier</TT> is an arbitrary name for the <TT>Monitor</TT>
entry. This can be any string and is used to refer to the <TT>
Monitor</TT> entry later in the <TT>XF86Config</TT> file.
<P>
<TT>HorizSync</TT> specifies the valid horizontal sync frequencies for
your monitor, in kHz. Multisync monitors may have a range of values,
or several, comma separated ranges. Fixed-frequency monitors require
a list of discrete values; for example:
<BR><IMG WIDTH=358 HEIGHT=12 ALIGN=BOTTOM ALT="tscreen5857" SRC="img347.gif"><BR>
The monitor manual should list these values in the technical
specifications section. If it does not, contact the manufacturer or
vendor of your monitor to obtain it.
<P>
<TT>VertRefresh</TT> specifies the valid vertical refresh rates (or
vertical synchronization frequencies) for your monitor, in kHz. Like
<TT>HorizSync</TT>, this can be a range or a list of discrete values.
Your monitor manual should list them.
<P>
<TT>HorizSync</TT> and <TT>VertRefresh</TT> are used only to double-check
that the monitor resolutions are in valid ranges. This reduces the
chance that you will damage your monitor by driving it at a frequency
which it was not designed for.
<P>
The <TT>ModeLine</TT> directive is used to specify resolution modes for
your monitor. The format is
<BR><IMG WIDTH=299 HEIGHT=10 ALIGN=BOTTOM ALT="tscreen5864" SRC="img348.gif"><BR>
<i>name</i> is an arbitrary string which you will use to refer to the
resolution mode later in the file. <i>dot-clock</i> is the driving
clock frequency, or ``dot clock'' associated with the resolution mode.
A dot clock is usually specified in MHz. It is the rate at which the
video card must send pixels to the monitor at this resolution.
<i>horiz-values</i> and <i>vert-values</i> are four numbers each
that specify when the electron gun of the monitor should fire, and
when the horizontal and vertical sync pulses fire during a sweep.
<P>
The file <TT>VideoModes.doc</TT>, included with the XFree86 distribution,
describes in detail how to determine the <TT>ModeLine</TT> values for
each resolution mode that your monitor supports. <i>clock</i> must
correspond to one of the dot clock values that your video card
supports. Later in the <TT>XF86Config</TT> file, you will specify these
clocks.
<P>
Two files, <TT>modeDB.txt</TT> and <TT>Monitors</TT>, may have <TT>
ModeLine</TT> information for your monitor. They are located in <TT>
/usr/X11R6/lib/X11/doc</TT>.
<P>
Start with <TT>ModeLine</TT> values for VESA-standard monitor timings,
because most monitors support them. <TT>ModeDB.txt</TT> includes the
timing values for VESA-standard resolutions. For example, this entry,
<BR><IMG WIDTH=599 HEIGHT=109 ALIGN=BOTTOM ALT="tscreen5884" SRC="img349.gif"><BR>
is the VESA-standard timing for a 640x480 video mode. It has a dot
clock of 25.175, which your video card must support. This is
described below. To include this entry in the <TT>XF86Config</TT> file,
use the line
<BR><IMG WIDTH=471 HEIGHT=31 ALIGN=BOTTOM ALT="tscreen5887" SRC="img350.gif"><BR>
The <i>name</i> argument to <TT>ModeLine</TT> (<TT><code>&quot;640x480&quot;</code></TT>)
is an arbitrary string. By convention modes are named by their
resolutions, but <i>name</i> can, technically, be any descriptive
label.
<P>
For each <TT>ModeLine</TT>, the server checks the mode specifications and
ensures that they fall in the range of values specified for <TT>
Bandwidth</TT>, <TT>HorizSync</TT>, and <TT>VertRefresh</TT>. If they do not,
the server complains when you attempt to start X. For one thing, the
dot clock used by the mode should not be greater than the value used
for <TT>Bandwidth</TT>. However, in many cases, it is safe to use a mode
that has a slightly higher bandwidth than your monitor can support.
<P>
If the VESA standard timings do not work, (you'll know after you try
to use them), then look in the files <TT>modeDB.txt</TT> and <TT>
Monitors</TT>, which include specific mode values for many monitor types.
You can create <TT>ModeLine</TT> entries from these values as well. Be
sure only to use values for your specific monitor. Many 14 and 15-inch
monitors do not support higher resolution modes, and often resolutions
of 1024x768 at low dot clocks. If you can't find high-resolution modes
for your monitor in these files, then your monitor probably does not
support them.
<P>
If you are completely at a loss and can't find <TT>ModeLine</TT> values
for your monitor, follow the instructions in the <TT>VideoModes.doc</TT>
file, which is included in the XFree86 distribution, and generate
values from the specifications in your monitor's manual. Your mileage
will certainly vary when you attempt to generate <TT>ModeLine</TT> values
by hand. But this is a good place to look if you can't find the values
that you need. <TT>VideoModes.doc</TT> also describes the format of the
<TT>ModeLine</TT> directive, and other aspects of the XFree86 server in
gory detail.
<P>
Lastly, if you do obtain <TT>ModeLine</TT> values that are almost but not
exactly right, you may possibly be able to modify the values a little
to obtain the desired result. For example, if the XFree86 display
image is shifted slightly, or the image seems to ``roll,'' then follow
the instructions in the <TT>VideoModes.doc</TT> file and fix the
values. Be sure to check the controls on the monitor itself. In many
cases, you must change the horizontal or vertical size of the display
after XFree86 starts, to center and size the image.
<P>
Don't use monitor timing values or <TT>ModeLine</TT>
values for monitors other than your model. If you try to drive a
monitor at a frequency for which it was not designed, you can damage
or even destroy it.
<P>
The next section of the <TT>XF86Config</TT> file is <TT>Device</TT>,
which specifies parameters for your video card. Here is an example.
<BR><IMG WIDTH=451 HEIGHT=109 ALIGN=BOTTOM ALT="tscreen5911" SRC="img351.gif"><BR>
<P>
This section defines properties for a particular video card. <TT>
Identifier</TT> is an arbitrary, descriptive string. You will use this
string to refer to the card later.
<P>
Initially, you don't need to include anything in the <TT>Device</TT>
section except the <TT>Identifier</TT>. We will use the X server itself
to probe for the properties of the video card and enter them into the
<TT>Device</TT> section later. The XFree86 server is capable of probing
for the video chip set, clocks, RAMDAC, and amount of video RAM on the
board. This is described in Section&nbsp;<A HREF="node7.html#secvideocardinfo">5.6</A>.
<P>
Before we do this, however, we need to finish writing the <TT>XF86Config</TT>
file. The next section is <TT>Screen</TT>, which specifies the monitor/video
card combination to use for a particular server.
<P>
<BR><IMG WIDTH=417 HEIGHT=209 ALIGN=BOTTOM ALT="tscreen5920" SRC="img352.gif"><BR>
<P>
The <TT>Driver</TT> line specifies the X server that you will be using.
Valid <TT>Driver</TT> values are:
<UL>
<LI> <TT>Accel</TT>: For the <TT>XF86_S3</TT>, <TT>XF86_Mach32</TT>, <TT>XF86_Mach8</TT>,
<TT>XF86_8514</TT>, <TT>XF86_P9000</TT>, <TT>XF86_AGX</TT>, and <TT>XF86_W32</TT>
servers;
<LI> <TT>SVGA</TT>: For the <TT>XF86_SVGA</TT> server;
<LI> <TT>VGA16</TT>: For the <TT>XF86_VGA16</TT> server;
<LI> <TT>VGA2</TT>: For the <TT>XF86_Mono</TT> server;
<LI> <TT>Mono</TT>: For the non-VGA monochrome drivers in the <TT>XF86_Mono</TT>
and <TT>XF86_VGA16</TT> servers.
</UL>
Be sure that <TT>/usr/X11R6/bin/X</TT> is a symbolic link to this server.
<P>
The <TT>Device</TT> line specifies the <TT>Identifier</TT> of the <TT>
Device</TT> section that corresponds to the video card to use for this
server. Above, we created a <TT>Device</TT> section with the line
<BR><IMG WIDTH=184 HEIGHT=9 ALIGN=BOTTOM ALT="tscreen5948" SRC="img353.gif"><BR>
Therefore, we use <TT><code>&quot;#9 GXE 64&quot;</code></TT> on the <TT>Device</TT> line here.
<P>
Similarly, the <TT>Monitor</TT> line specifies the name of the <TT>Monitor</TT>
section to be used with this server. Here, <TT><code>&quot;CTX 5468 NI&quot;</code></TT> is
the <TT>Identifier</TT> used in the <TT>Monitor</TT> section described above.
<P>
<TT><code>Subsection &quot;Display&quot;</code></TT> defines several properties of the
XFree86 server corresponding to your monitor/video card combination.
The <TT>XF86Config</TT> file describes all of these options in detail.
Most of them are not necessary to get the system working.
<P>
The options that you should know about are:
<UL>
<LI> <TT>Depth</TT>. Defines the number of color planes; that is, the number of
bits per pixel. Usually, <TT>Depth</TT> is set to 16. For the <TT>VGA16</TT>
server, you would use a depth of 4, and for the monochrome server a
depth of 1. If you use an accelerated video card with enough memory to
support more bits per pixel, you can set <TT>Depth</TT> to 24, or 32.
If you have problems with depths higher than 16, set it back to 16 and
attempt to debug the problem later.
<LI> <TT>Modes</TT>. This is the list of mode names which have
been defined using the <TT>ModeLine</TT> directive(s) in the <TT>
Monitor</TT> section. In the above section, we used <TT>ModeLine</TT>s named
<TT><code>&quot;1024x768&quot;</code></TT>, <TT><code>&quot;800x600&quot;</code></TT>, and
<TT><code>&quot;640x48&quot;0</code></TT>. Therefore, we use a <TT>Modes</TT> line of
<BR><IMG WIDTH=333 HEIGHT=9 ALIGN=BOTTOM ALT="tscreen5972" SRC="img354.gif"><BR>
The first mode listed on this line is the default when XFree86
starts. After XFree86 is running, you can switch between the modes
listed here using the keys Ctrl-Alt-Numeric + and
Ctrl-Alt-Numeric -.
<P>
It might be best, when you initially configure XFree86, to use lower
resolution video modes like 640x480, which tend to work with most
systems. Once you have the basic configuration working, you can modify
<TT>XF86Config</TT> to support higher resolutions.
<LI> <TT>Virtual</TT>. Set the virtual desktop size. XFree86 can
use additional memory on your video card to extend the size of the
desktop. When you move the mouse pointer to the edge of the display,
the desktop scrolls, bringing the additional space into view. Even if
you run the server at a lower video resolution like 800x600, you can
set <TT>Virtual</TT> to the total resolution that your video card can
support. A 1-megabyte video card can support 1024x768 at a depth of 8
bits per pixel; a 2-megabyte card 1280x1024 at depth 8, or 1024x768 at
depth 16. Of course, the entire area will not be visible at once,
but it can still be used.
<P>
The <TT>Virtual</TT> feature is rather limited. If you want to use a true
virtual desktop, <TT>fvwm</TT> and similar window managers allow you to
have large, virtual desktops by hiding windows and using other
techniques, instead of storing the entire desktop in video memory. See
the manual pages for <TT>fvwm</TT> for more details about this. Many
Linux systems use <TT>fvwm</TT> by default.
<LI> <TT>ViewPort</TT>. If you are using the <TT>Virtual</TT> option which
is described above, <TT>ViewPort</TT> sets the coordinates of the
upper-left-hand corner of the virtual desktop when XFree86 starts
up. <TT>Virtual 0 0</TT> is often used. If this is unspecified, then the
desktop is centered on the virtual desktop display, which may be
undesirable to you.
<P>
</UL>
<P>
Many other options for this section exist; see the <TT>XF86Config</TT>
manual page for a complete description. In practice, these options are
not necessary to get XFree86 working initially.
<P>
<H1><A NAME="SECTION00760000000000000000">5.6 Filling in video card information.</A></H1>
<P>
<A NAME="secvideocardinfo">&#160;</A>
<P>
Your <TT>XF86Config</TT> file is now ready, with the exception of
complete information on the video card. We'll use the X server to
probe for this information, and add it to <TT>XF86Config</TT>.
<P>
Instead of probing for this information with the X server, <TT>
XF86Config</TT> values for many cards are listed in the files <TT>
modeDB.txt</TT>, <TT>AccelCards</TT>, and <TT>Devices</TT>. These files are all
found in <TT>/usr/X11R6/lib/X11/doc</TT>. In addition, there are various
<TT>README</TT> files for certain chip sets. You should look at these
files for information on your video card and use that information (the
clock values, chip set type, and any options) in the <TT>XF86Config</TT>
file. If any information is missing, you can probe for it.
<P>
In most of these examples we demonstrate configuration of a
#9 GXE 64 video card, which uses the <TT>XF86_S3</TT> chipset.
First, determine the video chip set on the card. Running <TT>
SuperProbe</TT> (found in <TT>/usr/X11R6/bin</TT>) tells you this
information, but you need to know the chip set name as it is known to
the X server.
<P>
To do this, run the command
<BR><IMG WIDTH=110 HEIGHT=12 ALIGN=BOTTOM ALT="tscreen6007" SRC="img355.gif"><BR>
This gives the chip set names known to the X server. (The manual pages
for each X server list these, too.) For example, with the
accelerated <TT>XF86_S3</TT> server, we get:
<BR><IMG WIDTH=545 HEIGHT=112 ALIGN=BOTTOM ALT="tscreen6010" SRC="img356.gif"><BR>
<P>
The valid chip set names for this server are <TT>mmio_928</TT> and <TT>
s3_generic</TT>. The <TT>XF86_S3</TT> man page describes these chip sets
and video cards that use them. In the case of the #9 GXE 64 video
card, <TT>mmio_928</TT> is appropriate.
<P>
If you don't know which chip set is in use, the X server can probe it
for you. To do this, run the command
<BR><IMG WIDTH=266 HEIGHT=12 ALIGN=BOTTOM ALT="tscreen6016" SRC="img357.gif"><BR>
if you use <TT>bash</TT> as your shell.
If you use <TT>csh</TT>, try:
<BR><IMG WIDTH=232 HEIGHT=12 ALIGN=BOTTOM ALT="tscreen6020" SRC="img358.gif"><BR>
<P>
You should run this command while the system is unloaded; that is,
while no other activity occurs on the system. This command also probes
for your video card dot clocks (as seen below), and system load can
throw off this calculation.
<P>
The output from the above, in <TT>/tmp/x.out</TT>, should contain lines
like:
<BR><IMG WIDTH=559 HEIGHT=208 ALIGN=BOTTOM ALT="tscreen6023" SRC="img359.gif"><BR>
Here, we see that the two valid chip sets for this server (in this
case, <TT>XF86_S3</TT>) are <TT>mmio_928</TT> and <TT>s3_generic</TT>. The
server probed for and found a video card that has the <TT>mmio_928</TT>
chipset.
<P>
In the <TT>Device</TT> section of the <TT>XF86Config</TT> file, add a <TT>
Chipset</TT> line that has the name of the chip set as determined
above. For example,
<BR><IMG WIDTH=365 HEIGHT=109 ALIGN=BOTTOM ALT="tscreen6033" SRC="img360.gif"><BR>
<P>
Now, we need to determine the driving clock frequencies used by the
video card. A driving clock frequency, or dot clock, is simply a rate
at which the video card can send pixels to the monitor. As described
above, each monitor resolution has a dot clock associated with it. We
need to determine which dot clocks are made available by the video
card.
<P>
First, you should look at the documentation mentioned above and see if
the card's clocks are listed there. The dot clocks are usually a list
of 8 or 16 values, all of which are in MHz. For example, when looking
at <TT>modeDB.txt</TT>, we see an entry for the Cardinal ET4000 video
card, which looks like:
<BR><IMG WIDTH=667 HEIGHT=29 ALIGN=BOTTOM ALT="tscreen6036" SRC="img361.gif"><BR>
The dot clocks for this card are 25, 28, 38, 36, 40, 45, 32, and 0
MHz.
<P>
In the <TT>Devices</TT> section of the <TT>XF86Config</TT> file, add a <TT>
Clocks</TT> line containing the list of dot clocks for your card. For
example, for the clocks above, add the line
<BR><IMG WIDTH=246 HEIGHT=9 ALIGN=BOTTOM ALT="tscreen6041" SRC="img362.gif"><BR>
to the <TT>Devices</TT> section of the file, after <TT>Chipset</TT>.
<P>
<B>The order of the dot clocks is important.</B> Don't
re-sort the list or remove duplicates.
<P>
If you cannot find the dot clocks associated with your card, the X
server can probe for these, too. Use <TT>X -probeonly</TT> as described
above. The output should contain lines which look like the following:
<BR><IMG WIDTH=613 HEIGHT=11 ALIGN=BOTTOM ALT="tscreen6047" SRC="img363.gif"><BR>
We can then add a <TT>Clocks</TT> line which contains all of these
values, as printed. You can use more than one <TT>Clocks</TT> line in
<TT>XF86Config</TT> if all of the values (sometimes there are more than 8
clock values printed) do not fit onto one line. Again, be sure to keep
the list of clocks in the order that they are displayed.
<P>
Be sure that there is no <TT>Clocks</TT> line (or that it is commented
out) in the <TT>Devices</TT> section of the file when using <TT>X
-probeonly</TT>. If there is a <TT>Clocks</TT> line present, the server does
not probe for the clocks--it uses the values given in <TT>
XF86Config</TT>.
<P>
Some video boards use a programmable clock chip. See the manual page
for your X server or the XFree86 <TT>README</TT> file that describes your
video card. The chip essentially allows the X server to tell the card
the dot clocks to use. For video cards that have clock chips, you may
not find a list of dot clocks for the card in any of the above
files. Or, the list of dot clocks printed when using <TT>X
-probeonly</TT> will only contain one or two discrete clock values, with
the rest being duplicates or zero. Or, the X server may provide an
explicit warning that the video card has a programmable clock chip,
like:
<BR><IMG WIDTH=649 HEIGHT=12 ALIGN=BOTTOM ALT="tscreen6059" SRC="img364.gif"><BR>
This example is taken from a <TT>XF86_SVGA</TT> server running a Cirrus
Logic PCI card.
<P>
For boards which use programmable clock chips, you use a <TT>
ClockChip</TT> line instead of a <TT>Clocks</TT> line in the <TT>XF86Config</TT>
file. <TT>ClockChip</TT> is the name of the clock chip as used by the
video card; the manual pages for each server describe them. For
example, in the file <TT>README.S3</TT>, we see that several S3-864 video
cards use an ``ICD2061A'' clock chip, and that we should use the line
<BR><IMG WIDTH=249 HEIGHT=12 ALIGN=BOTTOM ALT="tscreen6067" SRC="img365.gif"><BR>
instead of <TT>Clocks</TT> in the <TT>XF86Config</TT> file. As with <TT>
Clocks</TT>, this line goes in the <TT>Devices</TT> section, after <TT>
Chipset</TT>.
<P>
Similarly, some video cards require that you specify the RAMDAC chip
type in the <TT>XF86Config</TT> file. This is done with a <TT>Ramdac</TT>
line. The <TT>XF86_Accel</TT> man page describes this option. Often the
X server will correctly probe for the RAMDAC.
<P>
Some video card types require that you specify several options in the
<TT>Devices</TT> section of <TT>XF86Config</TT>. These options are described
in the manual page for your server, as well as in the various files
like <TT>README.cirrus</TT> and <TT>README.S3</TT>. These options are
enabled using an <TT>Option</TT> line. For example, the #9 GXE 64 card
requires two options:
<BR><IMG WIDTH=249 HEIGHT=34 ALIGN=BOTTOM ALT="tscreen6082" SRC="img366.gif"><BR>
An X server may work without the <TT>Option</TT> lines, but they are
necessary to get the best performance out of the card. There are too
many options to list here. They are different for each card. If you
must use one, the X server manual pages and various files in <TT>
/usr/X11R6/lib/X11/doc</TT> will tell you what they are.
<P>
When you finish, you should have a <TT>Devices</TT> section that looks
something like:
<BR><IMG WIDTH=417 HEIGHT=164 ALIGN=BOTTOM ALT="tscreen6087" SRC="img367.gif"><BR>
There are other options which you can include in the <TT>Devices</TT>
entry. The X server manual pages provide the gritty details.
<P>
<H1><A NAME="SECTION00770000000000000000">5.7 Running XFree86.</A></H1>
<P>
With your <TT>XF86Config</TT> file configured, you can fire up the X
server and give it a spin. Again, be sure that the <TT>
/usr/X11R6/bin</TT> directory is on your path.
<P>
The command to start XFree86 is
<BR><IMG WIDTH=50 HEIGHT=8 ALIGN=BOTTOM ALT="tscreen6093" SRC="img368.gif"><BR>
This is a front end to <TT>xinit</TT>. It starts the X server and
executes the commands in the file <TT>.xinitrc</TT> in your home
directory. <TT>.xinitrc</TT> is a shell script that contains the command
lines of the X clients to run when the X server starts. If this file
does not exist, the system default <TT>
/usr/X11R6/lib/X11/xinit/xinitrc</TT> is used.
<P>
A simple <TT>.xinitrc</TT> file looks like this:
<BR><IMG WIDTH=358 HEIGHT=149 ALIGN=BOTTOM ALT="tscreen6100" SRC="img369.gif"><BR>
This script starts two <TT>xterm</TT> clients and an <TT>oclock</TT>, and
sets the root window (background) color to <TT>midnightblue</TT>. It
starts <TT>twm</TT>, the window manager. <TT>twm</TT> is executed with the
shell's <TT>exec</TT> statement. This causes the <TT>xinit</TT> process to
be replaced by <TT>twm</TT>. After the <TT>twm</TT> process exits, the X
server shuts down. You can cause <TT>twm</TT> to exit by using the root
menu. Depress mouse button 1 on the desktop background. This displays
a pop-up menu that allows you to <TT>Exit Twm</TT>.
<P>
Be sure that the last command in <TT>.xinitrc</TT> is started with <TT>
exec</TT>, and that it is not placed into the background (no ampersand at
the end of the line). Otherwise the X server will shut down
immediately after it starts the clients in the <TT>.xinitrc</TT> file.
<P>
Alternately, you can exit X by pressing
Ctrl-Alt-Backspace in combination. This kills the X
server directly, exiting the window system.
<P>
The above is a only a simple desktop configuration.
Again, we suggest that you read a book like <EM>The X&nbsp;Window System:
A User's Guide</EM> (see Appendix <A HREF="app-sources/node1.html">A</A>). The possible
variations of X usage and configuration are too many to describe
here. The <TT>xterm</TT>, <TT>oclock</TT>, and <TT>twm</TT> manual pages will
provide you clues on how to begin.
<P>
<H1><A NAME="SECTION00780000000000000000">5.8 When you run into trouble.</A></H1>
<P>
Often, something will not be quite right when you first start the X
server. This is nearly always caused by something in your <TT>
XF86Config</TT> file. Usually, the monitor timing values or the video card
dot clocks are set incorrectly. If the display seems to roll, or the
edges are fuzzy, this indicates that the monitor timing values or dot
clocks are wrong. Also, be sure that you correctly specified the video
card chip set and options in the <TT>Device</TT> section of <TT>
XF86Config</TT>. Be absolutely sure that you are using the correct X
server and that <TT>/usr/X11R6/bin/X</TT> is a symbolic link to it.
<P>
If all else fails, try to start X ``bare''; that is, with a command
like:
<BR><IMG WIDTH=172 HEIGHT=12 ALIGN=BOTTOM ALT="tscreen6129" SRC="img370.gif"><BR>
You can then kill the X server (using
Ctrl-Alt-Backspace) and examine the
contents of <TT>/tmp/x.out</TT>. The X server reports any warnings or
errors--for example, if your video card doesn't have a dot clock
corresponding to a mode supported by your monitor.
<P>
The file <TT>VideoModes.doc</TT>, which is included in the XFree86
distribution, contains many hints for adjusting the values in your
<TT>XF86Config</TT> file.
<P>
Remember that you can use Ctrl-Alt-Numeric + and
Ctrl-Alt-Numeric - to switch between the video modes
listed on the <TT>Modes</TT> line of the <TT>Screen</TT> section of <TT>
XF86Config</TT>. If the highest resolution mode doesn't look right, try
switching to a lower resolution. This lets you know, at least, that
those parts of your X configuration are working correctly.
<P>
Also, adjust the vertical and horizontal size/hold knobs on your
monitor. In many cases, it is necessary to adjust these when starting
up X. For example, if the display seems to be shifted slightly to one
side, you can usually correct this using the monitor controls.
<P>
Again, the USENET newsgroup <TT>comp.windows.x.i386unix</TT> is devoted
to discussions about XFree86. It might be a good idea to read the
newsgroups for postings related to video configuration. You might run
across someone with the same problem.
<P>
There are also sample <TT>XF86Config</TT> files which have been
contributed by users. Some of these are available on the <TT>
sunsite.unc.edu</TT> archive in the <TT>/pub/Linux/X11</TT> directory, and
elsewhere. You might find a configuration file that somebody has
already written for your hardware.
<P>
<A NAME="6150">&#160;</A>
<P>
<HR><A NAME="tex2html868" HREF="node8.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A> <A NAME="tex2html866" HREF="gs.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A> <A NAME="tex2html860" HREF="node6.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <A NAME="tex2html870" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html869" HREF="node8.html">6 Networking</A>
<B>Up:</B> <A NAME="tex2html867" HREF="gs.html">Linux Installation and Getting </A>
<B> Previous:</B> <A NAME="tex2html861" HREF="node6.html">4 System Administration</A>
<P><ADDRESS>
<I>Clarica Grove <BR>
Wed Mar 4 10:46:42 PST 1998</I>
</ADDRESS>
</BODY>
</HTML>