39. Configuring X for your Hardware
Introduction to FreeBSD
39.1.  xf86config
39.2.  XF86Setup

Before you can configure X to use your hardware, you need to know what your hardware is. There are three things you absolutely have to know (or at least be able to guess correctly):

  • The type of mouse and where its connected. (ie. PS/2 or Serial on COM1)

  • The brand of video card you have. (Needs to be a supported type.)

  • The horizontal and vertical sync limits of your monitor.(Found in your monitor manual.)

If you know these three things, setting up X is easy. The rest is just a matter of personal taste and geographic/language requirements. Once you have obtained this data, you will need to run either the text based config program (xf86config), or the graphical config program (XF86Setup). You do not need to run both.

39.1.   xf86config

xf86config is located in /usr/X11R6/bin/. If that is part of your path, you can just type xf86config and begin the configuration. Otherwise, you can type /usr/X11R6/bin/xf86config. You need to be root to do this.

The first thing it is going to ask you is which kind of mouse you have attached to the computer:

First specify a mouse protocol type. Choose one from the following list:

 1.  Microsoft compatible (2-button protocol)
 2.  Mouse Systems (3-button protocol)
 3.  Bus Mouse
 4.  PS/2 Mouse
 5.  Logitech Mouse (serial, old type, Logitech protocol)
 6.  Logitech MouseMan (Microsoft compatible)
 7.  MM Series
 8.  MM HitTablet
 9.  Microsoft IntelliMouse     

Select 1 - 9 based on which type of mouse you have. If you select a mouse that has 3 buttons, it will ask you if you want to enable the center button, its called ChordMiddle:

Please answer the following question with either 'y' or 'n'.
Do you want to enable ChordMiddle?     

If you don't enable the Middle Button, it will ask you if you want to emulate the middle button. With the 3 button emulation enabled, if you press both mouse buttons simultaneously, X will pretend that you have pressed the center mouse button.

Please answer the following question with either 'y' or 'n'.
Do you want to enable Emulate3Buttons?      

Next it wants to know where the mouse is plugged into.

Now give the full device name that the mouse is connected to, for example
/dev/tty00. Just pressing enter will use the default, /dev/mouse.

Mouse device:     

A mouse is usually plugged into either COM1, COM2, or the PS/2 Port.

  • /dev/ttyd0 (COM1)

  • /dev/ttyd1 (COM2)

  • /dev/psm0 (PS/2 Port)

Now it will ask you if you need to be able to re-map keyboard keys. If you don't know, just press ENTER

Please answer the following question with either 'y' or 'n'.
Do you want to use XKB?  

This if for special language support, if you speak only English, just press ENTER.

If you want your keyboard to generate non-ASCII characters in X, because
you want to be able to enter language-specific characters, you can
set the left Alt key to Meta, and the right Alt key to ModeShift.

Please answer the following question with either 'y' or 'n'.
Do you want to enable these bindings for the Alt keys?      

These are the Horizontal Refresh rates found in your Monitor manual. #2 is pretty safe if you don't know what your monitor does. You don;t want to selct a setting higher than your monitor is capable of. It is likely to damage an older monitor.

   hsync in kHz; monitor type with characteristic modes
 1  31.5; Standard VGA, 640x480 @ 60 Hz
 2  31.5 - 35.1; Super VGA, 800x600 @ 56 Hz
 3  31.5, 35.5; 8514 Compatible, 1024x768 @ 87 Hz interlaced (no 800x600)
 4  31.5, 35.15, 35.5; Super VGA, 1024x768 @ 87 Hz interlaced, 800x600 @ 56 Hz
 5  31.5 - 37.9; Extended Super VGA, 800x600 @ 60 Hz, 640x480 @ 72 Hz
 6  31.5 - 48.5; Non-Interlaced SVGA, 1024x768 @ 60 Hz, 800x600 @ 72 Hz
 7  31.5 - 57.0; High Frequency SVGA, 1024x768 @ 70 Hz
 8  31.5 - 64.3; Monitor that can do 1280x1024 @ 60 Hz
 9  31.5 - 79.0; Monitor that can do 1280x1024 @ 74 Hz
10  31.5 - 82.0; Monitor that can do 1280x1024 @ 76 Hz
11  Enter your own horizontal sync range

Enter your choice (1-11):            

You need to enter the Vertical refresh rate of your monitor. #2 is a very common SVGA setting.

 1  50-70
 2  50-90
 3  50-100
 4  40-150
 5  Enter your own vertical sync range

Enter your choice:                    

Answer y to this next question and find your card in the card database.

Do you want to look at the card database? 

On the Left is the name of the card, and on the right is the card chipset.

 0  2 the Max MAXColor S3 Trio64V+                    S3 Trio64V+
  1  928Movie                                          S3 928
  2  AGX (generic)                                     AGX-014/15/16
  3  ALG-5434(E)                                       CL-GD5434
  4  ASUS PCI-AV264CT                                  ATI-Mach64
  5  ASUS PCI-V264CT                                   ATI-Mach64
  6  ASUS Video Magic PCI V864                         S3 864
  7  ASUS Video Magic PCI VT64                         S3 Trio64
  8  ATI 3D Pro Turbo                                  ATI-Mach64
  9  ATI 3D Xpression                                  ATI-Mach64
 10  ATI 3D Xpression+ PC2TV                           ATI-Mach64
 11  ATI 8514 Ultra (no VGA)                           ATI-Mach8
 12  ATI All-in-Wonder                                 ATI-Mach64
 13  ATI Graphics Pro Turbo                            ATI-Mach64
 14  ATI Graphics Pro Turbo 1600                       ATI-Mach64
 15  ATI Graphics Ultra                                ATI-Mach8
 16  ATI Graphics Ultra Pro                            ATI-Mach32
 17  ATI Graphics Xpression with 68875 RAMDAC          ATI-Mach64

Enter a number to choose the corresponding card definition.
Press enter for the next page, q to continue configuration.
                                                                  

The term X server used in this next section makes more sense if you think of it as ``video card driver'' instead. The driver suggested by the card database definition will always perform better. However if the card is not in the database, choose the next best card driver. #5 will contain the X server suggested by the card definition.

 1  The XF86_Mono server. This a monochrome server that should work on any
    VGA-compatible card, in 640x480 (more on some SVGA chipsets).
 2  The XF86_VGA16 server. This is a 16-color VGA server that should work on
    any VGA-compatible card.
 3  The XF86_SVGA server. This is a 256 color SVGA server that supports
    a number of SVGA chipsets. On some chipsets it is accelerated or
    supports higher color depths.
 4  The accelerated servers. These include XF86_S3, XF86_Mach32, XF86_Mach8,
    XF86_8514, XF86_P9000, XF86_AGX, XF86_W32, XF86_Mach64, XF86_I128 and
    XF86_S3V.

These four server types correspond to the four different "Screen" sections in
XF86Config (vga2, vga16, svga, accel).

 5  Choose the server from the card definition, XF86_S3.

Which one of these screen types do you intend to run by default (1-5)?      

Now it needs to point startup code to the driver you have just chosen. Ifyou want it to be done automatically, press 'y'. If you want to do it your self later, press 'n'.

Please answer the following question with either 'y' or 'n'.
Do you want me to set the symbolic link?      

If you don't know, just press ENTER. It is automatically autodetected.

How much video memory do you have on your video card:

 1  256K
 2  512K
 3  1024K
 4  2048K
 5  4096K
 6  Other

Enter your choice:     

Unless the card definition tells you what to put, just press 'q'.

  1  ATT 20C490 (S3 and AGX servers, ARK driver)                att20c490
  2  ATT 20C498/21C498/22C498 (S3, autodetected)                att20c498
  3  ATT 20C409/20C499 (S3, autodetected)                       att20c409
  4  ATT 20C505 (S3)                                            att20c505
  5  BrookTree BT481 (AGX)                                       bt481
  6  BrookTree BT482 (AGX)                                       bt482
  7  BrookTree BT485/9485 (S3)                                   bt485
  8  Sierra SC15025 (S3, AGX)                                    sc15025
  9  S3 GenDAC (86C708) (autodetected)                           s3gendac
 10  S3 SDAC (86C716) (autodetected)                             s3_sdac
 11  STG-1700 (S3, autodetected)                                 stg1700
 12  STG-1703 (S3, autodetected)                                 stg1703

The card definition has Ramdac "bt485".


Enter a number to choose the corresponding RAMDAC.
Press enter for the next page, q to quit without selection of a RAMDAC.
                                                             

Unless the card definitions tells you which to pick, just press ENTER.

 1  Chrontel 8391                                               ch8391
 2  ICD2061A and compatibles (ICS9161A, DCS2824)                icd2061a
 3  ICS2595                                                     ics2595
 4  ICS5342 (similar to SDAC, but not completely compatible)    ics5342
 5  ICS5341                                                     ics5341
 6  S3 GenDAC (86C708) and ICS5300 (autodetected)               s3gendac
 7  S3 SDAC (86C716)                                            s3_sdac
 8  STG 1703 (autodetected)                                     stg1703
 9  Sierra SC11412                                              sc11412
10  TI 3025 (autodetected)                                      ti3025
11  TI 3026 (autodetected)                                      ti3026
12  IBM RGB 51x/52x (autodetected)                              ibm_rgb5xx

The card definition has Clockchip "icd2595"

Just press enter if you don't want a Clockchip setting.
What Clockchip setting do you want (1-12)?   

Unless the card definition says NOT to, go ahead and press y. This is an example of when NOT to probe for clocks.

You must be root to be able to run X -probeonly now.

The card definition says to NOT probe clocks.
Do you want me to run 'X -probeonly' now?   

These are the list of resolutions that you can switch between. The defaults usually work. Unless you want to change these, just press ENTER.

Currently it is set to:

"640x480" "800x600" "1024x768" "1280x1024" for 8bpp
"640x480" "800x600" "1024x768" "1280x1024" for 16bpp
"640x480" "800x600" "1024x768" "1280x1024" for 24bpp
"640x480" "800x600" "1024x768" for 32bpp

Note that 16, 24 and 32bpp are only supported on a few configurations.
Modes that cannot be supported due to monitor or clock constraints will
be automatically skipped by the server.

 1  Change the modes for 8pp (256 colors)
 2  Change the modes for 16bpp (32K/64K colors)
 3  Change the modes for 24bpp (24-bit color, packed pixel)
 4  Change the modes for 32bpp (24-bit color)
 5  The modes are OK, continue.

Enter your choice:                

You need to press y here to save your configuration.

I am going to write the XF86Config file now. Make sure you don't accidently
overwrite a previously configured one.

Shall I write it to /etc/XF86Config? 

There is a parameter in the /etc/XF86Config file that allows you to select the number of colors your screen will display. It's the ``DefaultColorDepth'' parameter. This parameter is not set by xf86config and will need to be added by hand. It is, however, set by XF86Setup You can set it to 8, 16, 24, or 32. Each has a corresponding subsection. The default it 8 bit color, or 256 colors. Inorder to achieve 16 Million colors, you would need to set it to 24 bit color.

In each subsection, you can set the resolutions you wish that color depth to use. Only accelerated graphics cards, and a very few svga cards can do color depths greater than 8. Most cards with 1MB of ram can only do 8 bit color at 1024 x 768.

Section "Screen"
    Driver      "accel"
    Device      "Trident TGUI9680 (generic)"
    Monitor     "My Monitor"
    DefaultColorDepth 8
    Subsection "Display"
        Depth       8
        Modes       "640x480" "800x600" "1024x768"
        ViewPort    0 0
    EndSubsection
    Subsection "Display"
        Depth       16
        Modes       "640x480" "800x600"
        ViewPort    0 0
    EndSubsection
    Subsection "Display"
        Depth       24
        Modes       "640x480"
        ViewPort    0 0
    EndSubsection
    Subsection "Display"
        Depth       32
        Modes       "640x400"
        ViewPort    0 0
    EndSubsection
EndSection

39.2.   XF86Setup

There is now a graphical interface for setting up X. It's XF86Setup and located in /usr/X11R6/bin.

It will switch you into graphics mode and let you point and click your way through the configuration. It requires all the same information that xf86config does. If you fail to get X running with XF86Setup you can always try xf86config.

Return to Table of Contents

Visit the Gifcom