Опубликован: 06.08.2012 | Доступ: свободный | Студентов: 1331 / 47 | Оценка: 5.00 / 5.00 | Длительность: 53:41:00
Лекция 28:

XFree86 in depth

< Лекция 27 || Лекция 28: 1234 || Лекция 29 >


The main configuration file for XFree86 is called XF86Config. It has had a long and varied journey through the file system. At the time of writing, it's located at /usr/X11R6/lib/X11/XF86Config, but previously it has been put in /etc/X11/XF86Config, /etc/XF86Config or /usr/X11R6/etc/X11/XF86Config, and the server still looks for it in many of these places. If you're upgrading a system, you should ensure that you don't have old configuration files in one of the alternative places.

As we saw on page 102, there are a couple of ways to automatically create an XF86Config file. On that page we saw how to do it with x/86c/g. An alternative way is to run the X server in configuration mode:

# X-configure
XFree86 Version 4.2.0 / X Window System
(protocol Version 11, revision 0, vendor release 6600)
Release Date: 18 January 2002
      If the server is older than 6-12 months, or if your card is
      newer than the above date, look for a newer version before
reporting problems. (See http://www.XFree86.Org/)
Build Operating System: FreeBSD 5.0-CURRENT i386 [ELF]
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
      (++) from command line, (!!) notice, (II) informational,
      (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/XFree86.0.log ", Time: Sat Apr 613:51:10 2002
List of video drivers:
(the list is long,and will change; it'somitted here)
(++) Using config file: "/root/XF86Config.new "
Your XF86Config file is /root/XF86Config.new
To test the server, run "XFree86 -xf86config /root/XF86Config.new "

Note that X does not place the resultant configuration file in the default location. The intention is that you should test it first and then move it to the final location when you're happy with it. As generated above, it's good enough to run XFree86, but you'll possibly want to change it. For example, it only gives you a single resolution, the highest it can find. In this section we'll look at the configuration file in more detail, and how to change it.

XF86Config is divided into several sections, as shown in Table 28-1 . We'll look at them in the order they appear in the generated XF86Config file, which is not the same order as in the man page.

Таблица 28.1. XF86Config sections
Section Description
ServerLayout Describes the overall layout of the X configuration. X can handle more than one display card and monitor. This section is the key to the other sections
Files Sets the default font and RGB paths.
ServerFlags Set some global options.
Module Describes the software modules to load for the configuration.
InputDevice Sets up keyboards, mice and other input devices.
Monitor Describes your monitor to the server.
Device Describes your video hardware to the server.
Screen Describes how to use the monitor and video hardware.
Device Describes your video hardware to the server.
Screen Describes how to use the monitor and video hardware.

The server layout

The ServerLayout section describes the relationships between the individual hardware components under the control of an X server. For typical hardware, X -configure might generate:

Section "ServerLayout "
    Identifier       "XFree86 Configured "
    Screen       0   "Screen0 " 0 0
    InputDevice      "Mouse0 " "CorePointer "
    InputDevice      "Keyboard0 " "CoreKeyboard "

This shows that the server has one screen and two input devices. The names Mouse0 and Keyboard0 suggest that they're a mouse and a keyboard, but any name is valid. These entries are pointers to sections elsewhere in the file, which must contain definitions for Screen0, Mouse0 and Keyboard0.

Normally you only have one screen, one mouse and one keyboard, so this section might seem rather unnecessary. As we will see when we look at multiple monitor configurations, it's quite important to be able to describe these relationships.

The Files section

The Files section of the XF86Config file contains the path to the RGB database file, which should never need to be changed, and the default font path. You may want to add more font paths, and some ports do so: the FontPath lines in your XF86Config are concatenated to form a search path. Ensure that each directory listed exists and is a valid font directory.

The standard Files section looks like:

Section "Files "
    RgbPath       "/usr/X11R6/lib/X11/rgb "
    ModulePath    "/usr/X11R6/lib/modules "
    FontPath      "/usr/X11R6/lib/X11/fonts/misc/ "
    FontPath      "/usr/X11R6/lib/X11/fonts/Speedo/ "
    FontPath      "/usr/X11R6/lib/X11/fonts/Type1/ "
    FontPath      "/usr/X11R6/lib/X11/fonts/CID/ "
    FontPath      "/usr/X11R6/lib/X11/fonts/75dpi/ "
    FontPath      "/usr/X11R6/lib/X11/fonts/100dpi/ "

If you are running a high-resolution display, this sequence may be sub-optimal. For example, a 21 " monitor running at 1600x1200 pixels has a visible display of approximately 16" wide and 12 " high, exactly 100 dpi (dots per inch, really pixels per inch). As a result, you'll probably be happier with the 100 dpi fonts. You can change this by swapping the last two lines in the section:

FontPath    "/usr/X11R6/lib/X11/fonts/100dpi/ "
FontPath    "/usr/X11R6/l:Lb/X11/ionts/75dpi/ "

Don't just remove the 75 dpi fonts: some fonts may be available only in the 75 dpi directory.

Sometimes the server complains:

Can't open default font 'fixed'

This is almost certainly the result of an invalid entry in your font path. Try running mkfontdir in each directory if you are certain that each one is correct. The XF86Config man page describes other parameters that may be in this section of the file.

The ServerFlags section

The ServerFlags section allows you to specify a number of global options. By default it is not present, and you will probably not find any reason to set it. See the man page XF86Config(5) for details of the options.

< Лекция 27 || Лекция 28: 1234 || Лекция 29 >