Once you have selected an X-server, the next task is to configure it. This is done by creating the configuration file:
/etc/XF86Config
Before you even think about doing this, let me first warn you that it is possible to create a configuration file that can drive your display monitor outside its operating specification. If you do this, there is every chance that you could cause permanent damage to your monitor. For this reason, please exercise the utmost caution when setting up the XF86Config file. The configuration file itself consists of several sections of information about various aspects of your hardware layout. These sections are:
The manual page for XF86Config is particularly useful in creating this file along with the contents of the file:
/usr/X11R6/lib/X11/XF86Config.eg
as a guide. This file contains an example X-configuration. The simplest way to set up your own X-configuration file is probably to take a copy of this example file and make suitable modifications to it. Do not attempt to use the example configuration file without modifying it for your own setup.
In this section you will find definitions for Rgbpath and FontPath similar to the following:
Section "Files" Rgbpath "/usr/X11R6/lib/X11/rgb" FontPath "/usr/X11R6/lib/X11/fonts/75dpi/" EndSection
For the RgbPath definition, the specified pathname should not need to be changed. The FontPath definition specifies the pathname to X-windows character font files. As there can be several different sets of fonts, there can be several matching FontPath definitions. You just need to make sure that each font directory that appears in /usr/X11R6/lib/X11/fonts has a corresponding FontPath definition here.
This section can specify some global flags for the server. In general, however, the default values are the ones you will want to operate with, so that no server flags need be specified. Even if no flags are specified, the section still needs to be present in the X-configuration file:
Section "ServerFlags" EndSection
This section specifies some parameters associated with the keyboard. In general, the values in the example configuration file should be just fine:
Section "Keyboard" Protocol "Standard" AutoRepeat 500 5 EndSection
Several parameters are specified in this section usually relating to the mouse (or track ball, track pad, etc.) First is a specification of what kind of device the pointer is to be, followed by information specifying to which hardware device the mouse is connected. For serial mice, the next item specifies the baud rate (standard is 1200 baud) at which the device operates. Finally, some pointer-related flags can be specified such as Emulate3Buttons, which allows the middle button of a three-button mouse to be emulated on a two-button mouse, by pressing both buttons at the same time.
A typical pointer section could be:
Section "Pointer" Protocol "Microsoft" Device "/dev/mouse" Emulate3Buttons EndSection
This section specifies the characteristics of your monitor. You should pay particular attention to getting the values in this section right, as the X-server will check to ensure that it does not try to drive your display monitor outside the specifications you give here.
The important values in this section are Bandwidth, HorizSync and VertRefresh, which are taken straight from your monitor manual, and the ModeLine entries, which specify each of the resolution modes in which you will operate the monitor:
Section "Monitor" Identifier "My monitor" Bandwidth 65 HorizSync 31-49 VertRefresh 56-87 ModeLine "640x480" 25 640 672 768 800 480 491 493 525 ModeLine "800x600" 36 800 864 936 1024 600 600 602 625 ModeLine "1024x768" 65 i024 1088 1248 1344 768 768 777 806 EndSection
Under NO circumstances should you copy the values given here verbatim; they are listed purely for illustrative purposes.
The Identifier definition is just to associate a string label, "My monitor" in this example, with this monitor section so that it can be referenced again later in the file.
One of the most difficult parts to sort out in the X-configuration file is the ModeLine entries specified in this section. These entries just list sets of closely connected values which are associated with the various screen resolutions available. Again, an examples file is available to give lists of many common ModeLine entries:
/usr/X11R6/lib/X11/doc/modeDB.txt
If necessary, these values can be calculated, given enough information about all the hardware, but it is beyond the scope of these tutorials to delve so deeply into the workings of X windows, especially when some of the required data about the monitor typically is not available in its specification sheet.
However, if you can't find suitable ModeLines in the example file, you should read the documentation in the file:
/usr/X11R6/lib/X11/doc/VideoModes.doc
The contents of the quotes (") in each ModeLine entry is just a label to allow reference to be made to these lines later in the file. By convention, these labels are given mnemonic significance, though this is not strictly necessary.
This is the section which describes your video card and its characteristics to the X-server. Initially, you need not put many values in this section, as, in general, the X-server is capable of probing the hardware to discover most of the values for itself.
The only entry you must supply is the Identifier definition, which is, again, just a label by which this section can be referenced later.
Once you have used the server to probe the hardware (we'll look at how to do this a little later), then extra details can be filled in to give a device section which could look as follows:
Section "Device" Identifier "My video card" Chipset "et4OOO" VideoRam 1024 Clocks 25.20 28.32 32.50 36.00 40.00 44.90 31.50 37.50 Clocks 50.30 56.70 64.90 72.po 80.00 89.80 63.00 75.10 EndSection
This final section is the place where all the labels from previous sections are drawn together:
Section "Screen" Driver "SVGA" Device "My video card" Monitor "My monitor" Subsection "Display" Depth 8 Virtual 1024 1024 ViewPort 00 Modes "800x600" "1024x768" " 640x480" EndSubsection EndSection
The Driver definition specifies which X server you are using - SVGA specifies the XF86_SVGA server. The Device and Monitor use previously defined symbolic names to refer back to the appropriate sections. Then, in the Display subsection, more display related details are given. Depth specifies the number of bits per pixel. Virtual specifies the size of the virtual screen in pixels. The size of the virtual screen must fit into the size of display memory on your video card. ViewPort says where on the virtual screen the top left corner of the physical screen will appear. If the current screen resolution is less than the virtual screen size, then it is possible to pan around the virtual screen under the control of the mouse. Finally, Modes gives a list of the video modes that you want to be able to use. The first mode in the list will be the default screen resolution when X-windows first executes.
Once X-windows is running, the other video modes can be accessed using the Ctrl-Alt-Plus and Ctrl-Alt-Minus key combinations. The Plus and Minus keys in these combinations are the + and - keys on the keyboard's numeric keypad.
When you get to this stage, it is a good idea to start the X-server. However, for the time being, it should be set up only to probe the hardware, so that you can extract the information required to fill in the details in the device section that we left out earlier. This is easily done with the X command:
$ X -probeonly
The following listing gives some typical output for the previous command:
XF86Config: /etc/XF86Config (**) standsfor supplied, (--) stands for probed/default values (**) Mouse: type: MouseSystems, device: Idevimouse, baudrate: 1200 (**) SVGA: Graphics device ID: "ET4OOO" (**) SVGA: Monitor ID: "Tatung XGA" (**) FontPath set to "/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/ X11/fonts/Type1/ /usr/X11R6/lib/X11/fonts/Speedo/ ,/usr/X11R6/lib/X11/fonts/T5dpi/" (--) SVGA:ET4OOO: Initial hibit state: high (--) SVGA:chipset: et4OOO (--) SVGA:videoram: 1024k (--) SVGA:clocks: 25.14 28.32 32.43 35.93 39.95 44.85 31.44 37.52 (--) SVGA:clocks: 50.28 56.55 64.86 71.96 79~97 89.75 62.94 74.91 (--) SVGA:Maximum allowed dot-clock: 90.000 MHz (**) SVGA:Mode ·'800x600": mode clock = 36.000, clock used = 35.930 (**) SVGA:Mode "640x480": mode clock = 25.000, clock used = 25.140 (**) SVGA:Node "1024x768": mode clock = 65.000, clock used = 64.860 (**) SVGA:Virtual resolution set to 1024x1024 (--) SVGA:Generic Speedups selected (Flags=0x30) (--) SVGA:ET4OOO: Speedups selected (Flags=Oxf)
As indicated by the second line of the output, lines preceded by (**) are for values that have been specified in the XF86Config file, while lines preceded with (--) contain values which the server discovered by probing the hardware. This shows where to obtain the values which are subsequently plugged back into the device section of the XF86Config file. Once the values have been added to the configuration file, the X-server will not probe the hardware for the values when it is run on subsequent occasions.