X の設定

[サーバの実験室 Slackware]

作成 : 2003/01/12

"サーバの実験室"の検索


xf86config

XFree86 のインストールが終了したら、設定をするため xf86config を実行する。

xf86config を実行すると、最初に説明が表示される。 そのまま Enter キーを押す。


  This program will create a basic XF86Config file, based on menu selections you
  make.

  The XF86Config file usually resides in /usr/X11R6/etc/X11 or /etc/X11. A sample  
  XF86Config file is supplied with XFree86; it is configured for a standard
  VGA card and monitor with 640x480 resolution. This program will ask for a
  pathname when it is ready to write the file.

  You can either take the sample XF86Config as a base and edit it for your
  configuration, or let this program produce a base XF86Config file for your
  configuration and fine-tune it.

  Before continuing with this program, make sure you know what video card
  you have, and preferably also the chipset it uses and the amount of video
  memory on your video card. SuperProbe may be able to help with this.

  Press enter to continue, or ctrl-c to abort.
  (Enter)

マウスの種類を選択する。 "Microsoft compatible" と "PS/2 Mouse" ってなにが違うんだろう? ふつうのホイール付 2 ボタンマウスを使用しているので、とりあえず "4. PS/2" を選択する。 (あとで設定ファイルを編集することで、ホイールを中央ボタンとして扱えるようになる)


  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

  If you have a two-button mouse, it is most likely of type 1, and if you have
  a three-button mouse, it can probably support both protocol 1 and 2. There are  
  two main varieties of the latter type: mice with a switch to select the
  protocol, and mice that default to 1 and require a button to be held at
  boot-time to select protocol 2. Some mice can be convinced to do 2 by sending
  a special sequence to the serial port (see the ClearDTR/ClearRTS options).

  Enter a protocol number: 4

2ボタンマウスを使用している場合、3ボタンマウスをエミュレーションするか選択する。 左ボタンと右ボタンを同時に押すことで、真ん中のボタンを押したのと同じ効果が得られる。 ホイールを中央ボタンとして使用するので、"n" を入力する。


  If your mouse has only two buttons, it is recommended that you enable  
  Emulate3Buttons.

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

マウスデバイスの名前を入力する。 そのまま Enter キーを押すと、デフォルトの "/dev/mouse" が使用される。 デフォルトのままで問題ないので、そのまま Enter キーを押す。


  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: (Enter)

キーボードの種類を選択する。 109 日本語キーボードを使用しているので、"Japanese 106-key" になる。 "11"(Japanese 106-key) を入力する。


  Please select one of the following keyboard types that is the better  
  description of your keyboard. If nothing really matches,
  choose 1 (Generic 101-key PC)

    1  Generic 101-key PC
    2  Generic 102-key (Intl) PC
    3  Generic 104-key PC
    4  Generic 105-key (Intl) PC 
    5  Dell 101-key PC
    6  Everex STEPnote
    7  Keytronic FlexPro
    8  Microsoft Natural
    9  Northgate OmniKey 101
   10  Winbook Model XP5
   11  Japanese 106-key
   12  PC-98xx Series
   13  Brazilian ABNT2
   14  HP Internet
   15  Logitech iTouch
   16  Logitech Cordless Desktop Pro
   17  Logitech Internet Keyboard
   18  Logitech Internet Navigator Keyboard
   19  Compaq Internet
   20  Microsoft Natural Pro
   21  Genius Comfy KB-16M
   22  IBM Rapid Access
   23  IBM Rapid Access II
   24  Chicony Internet Keyboard
   25  Dell Internet Keyboard

  Enter a number to choose the keyboard.

  11

キーボードレイアウトを選択する。 Enter キーを押すと次画面に進む。 "39"(Japanese)を入力する。


  Please select the layout corresponding to your keyboard  

    1  U.S. English
    2  U.S. English w/ ISO9995-3
    3  U.S. English w/ deadkeys
    4  Albanian
    5  Arabic
    6  Armenian
    7  Azerbaidjani
    8  Belarusian
    9  Belgian
   10  Bengali
   11  Brazilian
   12  Bulgarian
   13  Burmese
   14  Canadian
   15  Croatian
   16  Czech
   17  Czech (qwerty)
   18  Danish

  Enter a number to choose the country.
  Press enter for the next page
  (Enter)

  ....
   39  Japanese
  ....

  39

キーボードレイアウトにつける名前を入力する。 そのまま Enter キーを押すと、デフォルトの "jp" が使用される。 デフォルトのままで問題ないので、そのまま Enter キーを押す。


  Please enter a variant name for 'jp' layout. Or just press enter  
  for default variant

  (Enter)

XKB を使用するかを選択する。 XKB は、X クライアント共通で使用するキーボードレイアウトを設定する(らしい)。 よくわからんので、"n" を入力する。


  Please answer the following question with either 'y' or 'n'.
  Do you want to select additional XKB options (group switcher,  
  group indicator, etc.)? n

モニタの設定に関する説明が表示される。 そのまま Enter キーを押す。


  Now we want to set the specifications of the monitor. The two critical
  parameters are the vertical refresh rate, which is the rate at which the
  the whole screen is refreshed, and most importantly the horizontal sync rate,  
  which is the rate at which scanlines are displayed.

  The valid range for horizontal sync and vertical sync should be documented
  in the manual of your monitor. If in doubt, check the monitor database
  /usr/X11R6/lib/X11/doc/Monitors to see if your monitor is there.

  Press enter to continue, or ctrl-c to abort.

  (Enter)

モニタの水平同期周波数を設定する。 水平同期周波数と次の垂直同期周波数は、モニタのマニュアルで確認できる。 許容を超える値を選択しないこと! Acer VUEGO 76i モニタは、水平同期周波数が 24-64KHz となっているので、"31.5 - 64.3; Monitor that can do 1280x1024 @ 60 Hz" を選択する。 (自分で任意の数値を入力することもできる) "8" を入力する。


  You must indicate the horizontal sync range of your monitor. You can either
  select one of the predefined ranges below that correspond to industry-
  standard monitor types, or give a specific range.

  It is VERY IMPORTANT that you do not specify a monitor type with a horizontal
  sync range that is beyond the capabilities of your monitor. If in doubt,
  choose a conservative setting.

      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): 8

モニタの垂直同期周波数を設定する。 許容を超える値を選択しないこと! Acer VUEGO 76i モニタは、垂直同期周波数が 50-100MHz となっているので、"50-100" を選択する。 (自分で任意の数値を入力することもできる) "3" を入力する。


  You must indicate the vertical sync range of your monitor. You can either  
  select one of the predefined ranges below that correspond to industry-
  standard monitor types, or give a specific range. For interlaced modes,
  the number that counts is the high one (e.g. 87 Hz rather than 43 Hz).

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

  Enter your choice: 3

モニタを定義する名前を入力する。 そのまま Enter キーを押すと、デフォルトの名前(My Monitor?)が使用される。 デフォルトのままで問題ないので、そのまま Enter キーを押す。


  You must now enter a few identification/description strings, namely an
  identifier, a vendor name, and a model name. Just pressing enter will fill  
  in default names.

  The strings are free-form, spaces are allowed.
  Enter an identifier for your monitor definition: 

  (Enter)

ビデオカードの設定に関する説明が表示される。 ビデオカードのデータベースから選択したい場合は、"y" を入力する。 "y" を入力する。


  Now we must configure video card specific settings. At this point you can
  choose to make a selection out of a database of video card definitions.
  Because there can be variation in Ramdacs and clock generators even
  between cards of the same model, it is not sensible to blindly copy
  the settings (e.g. a Device section). For this reason, after you make a
  selection, you will still be asked about the components of the card, with
  the settings from the chosen database entry presented as a strong hint.

  The database entries include information about the chipset, what driver to
  run, the Ramdac and ClockChip, and comments that will be included in the
  Device section. However, a lot of definitions only hint about what driver
  to run (based on the chipset the card uses) and are untested.

  If you can't find your card in the database, there's nothing to worry about.  
  You should only choose a database entry that is exactly the same model as
  your card; choosing one that looks similar is just a bad idea (e.g. a
  GemStone Snail 64 may be as different from a GemStone Snail 64+ in terms of
  hardware as can be).

  Do you want to look at the card database? y

ビデオカードを選択する。 正確には、ビデオカードに使用されているチップを選択する。 チップの種類は、ビデオカードのマニュアルで確認できる。 たとえば、Canopus Power Window 864 ビデオカードは、S3 864 チップを搭載している。 (lspci でも見られるかも) Enter キーを押すと、次画面を表示する。 "375"(S3 864 (generic))を入力する。


    0  * Generic VESA compatible                         (null)
    1  * Generic VGA compatible                          (null)
    2  * Unsupported VGA compatible                      (null)
    3  2 the Max MAXColor S3 Trio64V+                    (null)
    4  2-the-Max MAXColor 6000                           ET6000
    5  3DLabs Oxygen GMX                                 PERMEDIA 2
    6  928Movie                                          S3 928
    7  AGX (generic)                                     AGX-014/15/16  
    8  ALG-5434(E)                                       CL-GD5434
    9  AOpen PA2010                                      Voodo Banshee
   10  ASUS 3Dexplorer                                   RIVA128
   11  ASUS PCI-AV264CT                                  ati
   12  ASUS PCI-V264CT                                   ati
   13  ASUS Video Magic PCI V864                         (null)
   14  ASUS Video Magic PCI VT64                         (null)
   15  AT25                                              Alliance AT3D
   16  AT3D                                              Alliance AT3D
   17  ATI 3D Pro Turbo                                  ati

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

  (Enter)

  ....
  375  S3 864 (generic)                                  (null)
  ....

  375

選択したビデオカードの情報が表示される。 よく見ると、このカードは基本的にサポートされないらしい。 とりあえず、Enter キーを押して、先に進む。


  Your selected card definition:

  Identifier: S3 864 (generic)
  Chipset:    (null)
  Driver:     vga
  This card is basically UNSUPPORTED. It may only work as a generic
  VGA-compatible card. If you have an XFree86 version more recent than what  
  this card definition was based on, there's a chance that it is now
  supported.

  Press enter to continue, or ctrl-c to abort.

  (Enter)

ビデオカードのメモリを選択する。 ビデオカードのメモリは、ビデオカードのマニュアルで確認できる。 メモリのサイズがわからない場合は、とりあえず最低の値を選択しておき、後でだましだまし設定ファイルを修正すればいいかもしれない。 Canopus Power Window 864 ビデオカードは 2MB のメモリを搭載している。 "4"(2048K)を入力する。


  Now you must give information about your video card. This will be used for
  the "Device" section of your video card in XF86Config.

  You must indicate how much video memory you have. It is probably a good
  idea to use the same approximate amount as that detected by the server you  
  intend to use. If you encounter problems that are due to the used server
  not supporting the amount memory you have (e.g. ATI Mach64 is limited to
  1024K with the SVGA server), specify the maximum amount supported by the
  server.

  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: 4

ビデオカードを定義する名前を入力する。 そのまま Enter キーを押すと、デフォルトの名前が使用される。 デフォルトの名前で問題ないので、そのまま Enter キーを押す。


  You must now enter a few identification/description strings, namely an
  identifier, a vendor name, and a model name. Just pressing enter will fill  
  in default names (possibly from a card definition).

  Your card definition is S3 864 (generic).

  The strings are free-form, spaces are allowed.
  Enter an identifier for your video card definition: 

  (Enter)

デフォルトの色数を選択する。 使用できる色数は、ビデオカードのメモリサイズによる。 2MB なら、800*600 と 640*480 の解像度で 1600万(24bits)色表示できるはず。 "5"(24 bits (16 million colors))を入力する。


  Please specify which color depth you want to use by default:  

    1  1 bit (monochrome)
    2  4 bits (16 colors)
    3  8 bits (256 colors)
    4  16 bits (65536 colors)
    5  24 bits (16 million colors)

  Enter a number to choose the default depth.

  5

設定ファイルを保存するか聞いてくる。 /etc/X11/XF86Config でよいので、"y" を入力する。


  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/X11/XF86Config? y

とりあえず、設定はこれで終了。


  File has been written. Take a look at it before running 'startx'. Note that
  the XF86Config file must be in one of the directories searched by the server  
  (e.g. /etc/X11) in order to be used. Within the server press
  ctrl, alt and '+' simultaneously to cycle video resolutions. Pressing ctrl,
  alt and backspace simultaneously immediately exits the server (use if
  the monitor doesn't sync for a particular mode).

  For further configuration, refer to the XF86Config(5) manual page.

startx

startx を実行して、X を起動してみる。

# startx

....
Fatal server error:
AddScreen/ScreenInit failed for driver 0

When reporting a problem related to a server crash, please send
the full server output, not just the last messages.
This can be found in the log file "/var/log/XFree86.0.log".
Please report problems to xfree86@xfree86.org.

XIO:  fatal IO error 104 (Connection reset by peer) on X server ":0.0"
      after 0 requests (0 known processed) with 0 events remaining.

エラーになって起動しない。 "driver 0" とかなので、ビデオカードのドライバのせい? 起動する際の詳細なログは、/var/log/XFree86.0.log に出力される。

XFree86 -configure

XFree86 -configure を実行すると、ビデオデバイスを検出して、ホームディレクトリに XF86config.new という設定ファイルを作成してくれる。

# XF86config -configure

~/XF86config.new のビデオデバイスのセクションはこんな感じ。 ビデオカードが XFree86 でサポートされていなくても、VESA(Video Electronics Standards Association) version 2.0に対応していれば、汎用ドライバである "vesa" を使用できるらしい。

Section "Device"
    Identifier  "Card0"
    Driver      "vesa"
    VendorName  "S3"
    BoardName   "864"
    BusID       "PCI:0:13:0"
EndSection

xf86config で作成した /etc/X11/XF86Config のデバイスセクションでは、"vga" ドライバを使用するようになっていた。

Section "Device"
    Identifier  "S3 864 (generic)"
    Driver      "vga"
        # unsupported card
    #VideoRam    2048
    # Insert Clocks lines here if appropriate
EndSection

ドライバの変更 & startx

/etc/X11/XF86Config のビデオデバイスセクションのドライバを、"vga" から "vesa" に変更する。

Section "Device"
    Identifier  "S3 864 (generic)"
    Driver      "vga"    <---削除
    Driver      "vesa"    <---追加
        # unsupported card
    #VideoRam    2048
    # Insert Clocks lines here if appropriate
EndSection

再度、startx。

# startx

....
(EE) VESA(0): No matching modes
(EE) Screen(s) found, but none have a usable configuration.

Fatal server error:
no screens found

When reporting a problem related to a server crash, please send
the full server output, not just the last messages.
This can be found in the log file "/var/log/XFree86.0.log".
Please report problems to xfree86@xfree86.org.

XIO:  fatal IO error 104 (Connection reset by peer) on X server ":0.0"
      after 0 requests (0 known processed) with 0 events remaining.

またエラーでストップ。 どうやら vesa にそんなモードはない、と言われているらしい。 モードって、XF86Config のこのへんのこと?

Section "Screen"
    Identifier  "Screen 1"
    Device      "S3 864 (generic)"
    Monitor     "My Monitor"
    DefaultDepth 24

    Subsection "Display"
        Depth       8
        Modes       "640x480" "800x600" "1024x768" "1280x1024"
        ViewPort    0 0
    EndSubsection
    Subsection "Display"
        Depth       16
        Modes       "640x480" "800x600" "1024x768"
        ViewPort    0 0
    EndSubsection
    Subsection "Display"
        Depth       24
        Modes       "640x480" "800x600"
        ViewPort    0 0
    EndSubsection
EndSection

DefaultDepth の変更 & startx

どうやら、DefaultDepth の 24(bits)がだめらしい。 XF86Config の DefaultDepth を 16 にしてみる。

Section "Screen"
    Identifier  "Screen 1"
    Device      "S3 864 (generic)"
    Monitor     "My Monitor"
    DefaultDepth 24    <---削除
    DefaultDepth 16    <---追加

再度、startx。

# startx

エラーはでなくなったものの、画面がめちゃくちゃ。 「Ctrl」+「Alt」+「+/-」を何回か押して解像度を変更すると、ちゃんと表示されることもある。 とりあえず、「Ctrl」+「Alt」+「BackSpace」で X を強制終了。

解像度の設定

ちゃんと表示できる解像度と、できない解像度がある。 しかも、色数 16bits のときは "640x480" が表示できないわけでなく、/etc/X11/XF86Config の書き方によって、表示できる解像度が違う。

Subsection "Display" Depth 16 Modes "640x480" "800x600" "1024x768" ViewPort 0 0 EndSubsection
640x480800x6001024x768
××
Subsection "Display" Depth 16 Modes "640x480" "800x600" ViewPort 0 0 EndSubsection
640x480800x600
×
Subsection "Display" Depth 16 Modes "640x480" ViewPort 0 0 EndSubsection
640x480

使用可能に設定した解像度の中で、もっとも高い解像度だけ、ちゃんと表示されるように見える。 他の Depth でも同様だった。 XF86Config で、自分が使用したい解像度だけ残して、後は削除してしまった。

Section "Screen"
    Identifier  "Screen 1"
    Device      "S3 864 (generic)"
    Monitor     "My Monitor"
    DefaultDepth 16

    Subsection "Display"
        Depth       8
        Modes       "640x480" "800x600" "1024x768" "1280x1024"    <---削除
        Modes       "1280x1024"    <---追加
        ViewPort    0 0
    EndSubsection
    Subsection "Display"
        Depth       16
        Modes       "640x480" "800x600" "1024x768"    <---削除
        Modes       "1024x768"    <---追加
        ViewPort    0 0
    EndSubsection
    Subsection "Display"
        Depth       24
        Modes       "640x480" "800x600"    <---削除
        Modes       "800x600"    <---追加
        ViewPort    0 0
    EndSubsection
EndSection

これでちゃんと表示できるようになった。


[サーバの実験室 slackware]