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

XFree86 in depth

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

The Module section

The Module section describes binary modules that the server loads:

Section "Module "
    Load      "extmod "
    Load      "xie "
    Load      "pex5 "
    Load      "glx "
    Load      "GLcore "
    Load      "dbe "
    Load      "record "
    Load      "type1 "

We won't look at modules in more detail; see the XFree86 documentation.

The InputDevice section

The InputDevice section specifies each input device, typically mice and keyboards. Older versions of XFree86 had separate Mouse and Keyboard sections to describe these details. The default XF86Config looks something like this:

Section "InputDevice "
    Identifier    "keyboard0 "
    Identifier    "keyboard "

Section "InputDevice "
    Identifier    "Mouse0 "
    Driver        "mouse "
    Option        "Protocol " "auto "
    Option        "Device " "/dev/mouse "

There's not much to be said for the keyboard. Previous versions of XFree86 allowed you to set things like NumLock handling and repeat rate, but the former is no longer needed, and the latter is easier to handle with the xset program.

Mice are still not as standardized as keyboards, so you still need a Protocol line and a device name. The defaults shown here are correct for most modern mice; the mouse driver can detect the mouse type correctly. If you're using the mouse daemon, moused, change this entry to the moused device, /dev/sysmouse.

If you're using a serial mouse or one with only two buttons, and if you're not using moused, you need to change the device entries and specify the Emulate3Buttons option. That's all described in the man page, but in general it's easier to use moused.

The Monitor section

Next comes the description of the monitor. Modern monitors can identify themselves to the system. In that case, you get a section that looks like this:

Section "Monitor "
    Identifier    "Monitor0 "
    VendorName    "IBM "
    ModelName     "P260 "
    HorizSync     30.0-121.0
    VertRefresh   48.0-160.0

This tells the server that the monitor is an IBM P260, that it can handle horizontal frequencies between 30 kHz and 121 kHz, and vertical frequencies between 48 Hz and 160 Hz. Less sophisticated monitors don't supply this information, so you might end up with an entry like this:

Section "Monitor "
    Identifier   "MonitorO "
    VendorName   "Monitor Vendor "
    ModelName    "Monitor Model "

This may seem like no information at all, but in fact it does give the identifier. Before you use it, you should add at least the horizontal and vertical frequency range, otherwise the server assumes it's a standard (and obsolete) VGA monitor capable of only 640x480 resolution.

This is also the place where you can add mode lines. For example, if you have created a mode line as described in the first part of this chapter, you should add it here:

Section "Monitor "
      Identifier      "right "
      VendorName      "iiyama "
      ModelName      "8221T "
      HorizSync      24.8-94.0
      VertRefresg      50.0-160.0
ModeLine    "640x480 "  73  640  672  768  864  480  488  494  530
# 62 Hz!
ModeLine   "800x600 "  111  800  864  928  1088  600  604  610  640
# 143 Hz
ModeLine "1024x768 "  165  1024  1056  1248  1440  768  771  781  802
# 96 Hz
ModeLine "1280x1024 "  195  1280  1312  1440  1696  1024  1031  1046  1072 -hsync -vsync
# 76 Hz
ModeLine "1600x1200 "  195  1600  1616  1808  2080  1200  1204  1207  1244+hsync +vsync
# 56 Hz  
ModeLine "1600x1200 "  200  1920  1947  2047  2396  1440  1441  1444  1483 - hsync +vsync
# 61 Hz
ModeLine "1600x1200 "  220  1920  1947  2047  2448  1440  1441  1483- hsync +vsync

It's possible to have multiple mode lines for a single frequency, and this even makes sense. The examples for 1920x1440 above have different pixel clocks. If you use this monitor with a card with a pixel clock that only goes up to 200 MHz, the server chooses the first mode line. If you use a card with up to 250 MHz pixel clock, it uses the second and gets a better page refresh rate.

The X server has a number of built-in mode lines, so it's quite possible to have a configuration file with no mode lines at all. The names correspond to the resolutions, and there can be multiple mode lines with the same name. The server chooses the mode line with the highest frequency compatible with the hardware.

The Device section

The Device section describes the video display board:

Section "Device "
    ### Available Driver options are:-
    ### Values: <i>: integer, <f>: float, <bool>: "True "/ "False ",
    ### <string>: "String ", <freq>: "<f> Hz/kHz/MHz "
    ### [arg]: arg optional
    #Option  "SWcurcor "  #[<bool>]
    #Option  "HWcursor "  #[<bool>]
    #Option  "PciRetry "  #[<bool>]
    #Cption  "SyncOnGreen "  #[<bool>
    #Option  "NoAcce "  #[<bool>
    #Option  "ShowCache "  #[<bool>
    #Option  "Overlay "  #[<str>]
    #Option  "MGASDRAM "  #[<bool>
    #Option  "ShadowFB "  #[<bool>
    #Option  "UseFBDev "  #[<bool>
    #Option  "ColorKey "  #<i>
    #Option  "SetMclk "  #<freq>
    #Option  "OverclockMem "  #[<bool>
    #Option  "VideoKey "  #<i>
    #Option  "Rotate quot "  #[<str>]
    #Option  "TexturedVideo "  #[<bool>
    #Option  "Crtc2Half "  #[<bool>
    #Option  "Crtc2Ram "  #<i>
    #Option  "Int10 "  #[<bool>
    #Option  "AGPMode "  #<i>
    #Option  "DigitalScreen "  #[<bool>
    #Option  "TV "	#[<bool>
    #Option  "TVStandard "  #[<str>]
    #Option  "CableType "  #[<str>]
    #Option  "NoHal "  #[<bool>
    #Option  "SwappedHead "  #[<bool>
   #Option  "DRI "  #[<bool>
    Identifier  "Card0 "  
    Driver  "mga "	
    VendorName  "Matrox " 
    BoardName  "MGA G200 AGP " 
    BusID  "PCI:1:0:0 "

This example shows a Matrox G200 AGP display board. It includes a number of options that you can set by removing the comment character (#). Many of these options are board dependent, and none of them are required. See the X documentation for more details.

Note particularly the last line, BusID. This is a hardware-related address that tells the X server where to find the display board. If you move the board to a different PCI slot, the address will probably change, and you will need to re-run X-configure to find the new busID.

If your display board is older, much of this information will not be available, and you'll have to add it yourself. Unlike older monitors, it's hardly worth worrying about older boards, though: modern boards have become extremely cheap, and they're so much faster than older boards that it's not worth the trouble.

< Лекция 27 || Лекция 28: 1234 || Лекция 29 >
Динар Шакиров
Динар Шакиров
Россия, Самара
Berkut Molodoy
Berkut Molodoy