星期六, 十一月 25, 2006

LFS compile Xorg for i180(915GM) trouble shooting

这是安装 BLFS 的一部分,首先按照文档安装 Xorg-6.8.2,但是在编译时出错,出错信息如下:
fbmmx.c: In function 'negate':
fbmmx.c:107: error: incompatible type for argument 1
of '__builtin_ia32_pxor'
fbmmx.c:107: error: incompatible type for argument 2
of '__builtin_ia32_pxor'
fbmmx.c: In function 'expand_alpha':
fbmmx.c:166: error: incompatible type for argument 1
of '__builtin_ia32_por'
fbmmx.c:166: error: incompatible type for argument 2
of '__builtin_ia32_por'
fbmmx.c:166: error: incompatible types in assignment
fbmmx.c:168: error: incompatible type for argument 1
of '__builtin_ia32_por'
fbmmx.c:168: error: incompatible type for argument 2
of '__builtin_ia32_por'
fbmmx.c:168: error: incompatible types in assignment
fbmmx.c: In function 'expand_alpha_rev':
fbmmx.c:181: error: incompatible type for argument 1
of '__builtin_ia32_por'
fbmmx.c:181: error: incompatible type for argument 2
of '__builtin_ia32_por'
fbmmx.c:181: error: incompatible types in assignment
fbmmx.c:183: error: incompatible type for argument 1
of '__builtin_ia32_por'
fbmmx.c:183: error: incompatible type for argument 2
of '__builtin_ia32_por'
fbmmx.c:183: error: incompatible types in assignment
fbmmx.c: In function 'invert_colors':
fbmmx.c:195: error: incompatible type for argument 1
of '__builtin_ia32_pand'
fbmmx.c:195: error: incompatible type for argument 2
of '__builtin_ia32_pand'
fbmmx.c:195: error: incompatible types in assignment
fbmmx.c:196: error: incompatible type for argument 1
of '__builtin_ia32_pand'
fbmmx.c:196: error: incompatible type for argument 2
of '__builtin_ia32_pand'
fbmmx.c:196: error: incompatible types in assignment
fbmmx.c:197: error: incompatible type for argument 1
of '__builtin_ia32_pand'
fbmmx.c:197: error: incompatible type for argument 2
of '__builtin_ia32_pand'
fbmmx.c:197: error: incompatible types in assignment
fbmmx.c:202: error: incompatible type for argument 1
of '__builtin_ia32_por'
fbmmx.c:202: error: incompatible type for argument 2
of '__builtin_ia32_por'
fbmmx.c:202: error: incompatible types in assignment
fbmmx.c:203: error: incompatible type for argument 1
of '__builtin_ia32_por'
fbmmx.c:203: error: incompatible type for argument 2
of '__builtin_ia32_por'
fbmmx.c:203: error: incompatible types in assignment
fbmmx.c: In function 'over_rev_non_pre':
fbmmx.c:237: error: incompatible type for argument 1
of '__builtin_ia32_por'
fbmmx.c:237: error: incompatible type for argument 2
of '__builtin_ia32_por'
fbmmx.c: In function 'expand565':
fbmmx.c:300: warning: ISO C90 forbids mixed
declarations and code
fbmmx.c:303: error: incompatible type for argument 1
of '__builtin_ia32_por'
fbmmx.c:303: error: incompatible type for argument 2
of '__builtin_ia32_por'
fbmmx.c:303: error: incompatible types in assignment
fbmmx.c:304: error: incompatible type for argument 1
of '__builtin_ia32_por'
fbmmx.c:304: error: incompatible type for argument 2
of '__builtin_ia32_por'
fbmmx.c:304: error: incompatible types in assignment
fbmmx.c:305: error: incompatible type for argument 1
of '__builtin_ia32_pand'
fbmmx.c:305: error: incompatible type for argument 2
of '__builtin_ia32_pand'
fbmmx.c:305: error: incompatible types in assignment
fbmmx.c: In function 'pack565':
fbmmx.c:327: error: incompatible type for argument 1
of '__builtin_ia32_pand'
fbmmx.c:327: error: incompatible type for argument 2
of '__builtin_ia32_pand'
fbmmx.c:327: error: incompatible types in assignment
fbmmx.c:328: error: incompatible type for argument 1
of '__builtin_ia32_pand'
fbmmx.c:328: error: incompatible type for argument 2
of '__builtin_ia32_pand'
fbmmx.c:328: error: incompatible types in assignment
fbmmx.c:329: error: incompatible type for argument 1
of '__builtin_ia32_pand'
fbmmx.c:329: error: incompatible type for argument 2
of '__builtin_ia32_pand'
fbmmx.c:329: error: incompatible types in assignment
fbmmx.c:336: error: incompatible type for argument 1
of '__builtin_ia32_pand'
fbmmx.c:336: error: incompatible type for argument 2
of '__builtin_ia32_pand'
fbmmx.c:336: error: incompatible types in assignment
fbmmx.c:338: error: incompatible type for argument 1
of '__builtin_ia32_pand'
fbmmx.c:338: error: incompatible type for argument 2
of '__builtin_ia32_pand'
fbmmx.c:338: error: incompatible types in assignment
fbmmx.c:340: error: incompatible type for argument 1
of '__builtin_ia32_pand'
fbmmx.c:340: error: incompatible type for argument 2
of '__builtin_ia32_pand'
fbmmx.c:340: error: incompatible types in assignment
fbmmx.c:342: error: incompatible type for argument 1
of '__builtin_ia32_pand'
fbmmx.c:342: error: incompatible type for argument 2
of '__builtin_ia32_pand'
fbmmx.c:342: error: incompatible types in assignment
fbmmx.c:344: error: incompatible type for argument 1
of '__builtin_ia32_por'
fbmmx.c:344: error: incompatible type for argument 2
of '__builtin_ia32_por'
fbmmx.c:344: error: incompatible types in assignment
fbmmx.c:345: error: incompatible type for argument 1
of '__builtin_ia32_por'
fbmmx.c:345: error: incompatible type for argument 2
of '__builtin_ia32_por'
fbmmx.c:345: error: incompatible types in assignment
fbmmx.c:347: error: incompatible type for argument 1
of '__builtin_ia32_por'
fbmmx.c:347: error: incompatible type for argument 2
of '__builtin_ia32_por'
fbmmx.c: In function
'fbCompositeSolidMask_nx8x8888mmx':
fbmmx.c:652: warning: ISO C90 does not support 'long
long'
fbmmx.c:695: warning: ISO C90 does not support 'long
long'
fbmmx.c: In function
'fbCompositeSolidMask_nx8x0565mmx':
fbmmx.c:758: warning: ISO C90 does not support 'long
long'
fbmmx.c:818: warning: ISO C90 does not support 'long
long'
make[5]: *** [fbmmx.o] Error 1
make[5]: Leaving directory
`/usr/src/Xorg/xc/programs/Xserver/fb'
make[4]: *** [fb] Error 2
make[4]: Leaving directory
`/usr/src/Xorg/xc/programs/Xserver'
make[3]: *** [all] Error 2
make[3]: Leaving directory
`/usr/src/Xorg/xc/programs'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/src/Xorg/xc'
make[1]: *** [World] Error 2
make[1]: Leaving directory `/usr/src/Xorg/xc'
make: *** [World] Error 2
这里:
http://linuxfromscratch.org/pipermail/blfs-support/2006-August/060856.html
http://linuxfromscratch.org/pipermail/blfs-support/2006-August/060858.html
提供了解决方法,就是使用 Xorg-6.9.0。

于是编译安装 Xorg-6.9.0 成功,但是安装安装提示运行:
# Xorg -configure
时出错:
Fatal server error:
Cannot open log file "/var/log/Xorg.0.log"

Please consult the The X.Org Foundation support
at http://wiki.X.Org
for help.
/var/log 的权限是没有问题的,问题出在 /usr/X11R6/bin/Xorg 上,因为是基于用户的包管理,所以其属主是 Xorg,但 X 需要 root+suid,所以运行时属主变成了 Xorg,当然没有权限写 /var/log/

于是更改 Xorg 属主:
# chown root /usr/X11R6/bin/Xorg
# chmod u+s /usr/X11R6/bin/Xorg

再次运行,得到如下的错误:
(II) LoadModule: "apm"
(II) Loading /usr/X11R6/lib/modules/drivers/apm_drv.so
dlopen: /usr/X11R6/lib/modules/drivers/apm_drv.so: undefined symbol: XvRTPort
(EE) Failed to load /usr/X11R6/lib/modules/drivers/apm_drv.so
(II) UnloadModule: "apm"
(EE) Failed to load module "apm" (loader failed, 7)
使用 X -config /root/xorg.conf.new 则黑屏,键盘无反应,只能关机。

如果仅从上面的提示来提示来看,则会步入误区,因为实际上 apm 模块并没有实质性的影响,它是电源管理的一部分:
Xorg wiki FAQ

正确的做法是,耐心查看由于运行 startx(Xorg -config ~/xorg.conf.new) 而产生的 /var/log/Xorg.0.log,查找其中所有"error","failed"等可能会是一个比较快捷的方式。因为问题很可能是出在芯片组的驱动上。

log 的内容比较多,但是其中可以看到如下几行:
drmOpenDevice: Open failed
[drm] failed to load kernel module "i915"
(II) I810(0): [drm] drmOpen failed
(EE) I810(0): [dri] DRIScreenInit failed. Disabling DRI.
...
Fatal server error:
Caught signal 11. Server aborting

提示找不到内核的 i915 模块,虽然 /lib/modules 中实际上是有这个模块的。因为之前的内核是我直接从主系统拷贝过去的,包括 initrd-$kernel.img 和 /lib/modules/$kernel 以及 /etc/modprobe.conf,所以问题可能就出在这里。

于是重新编译内核。注意在主系统下用 chroot 来进行编译和启动到 LFS 系统下进行编译可能会有差异,我两次都试过,用 md5sum 校验发现不同。建议启动到 LFS 系统进行编译。可能 Xorg 也需要重新编译,移除原来的 /usr/X11R6/bin/Xorg,运行:
# userpack install -a Xorg-6.9.0
即可。

编译内核时,LFS 没有 initrd,所以一些重要模块如 ext3, jbd, scsi 等需要编译到内核中,我写在了这里:
LFS kernel compling

这次启动 X 没有彻底黑屏,键盘还有响应,也可以按 3 键(CTRL+ALT+DEL)重启,但总的来说还是没有成功。有如下报错:
# Xorg -configure
dlopen: /usr/X11R6/lib/modules/drivers/apm_drv.so: undefined symbol: XvRTPort
(EE) Failed to load /usr/X11R6/lib/modules/drivers/apm_drv.so
(EE) Failed to load module "apm" (loader failed, 7)
(++) Using config file: "/root/xorg.conf.new"
(WW) I810: No matching Device section for instance (BusID PCI:0:2:1) found
(WW) ****INVALID MEM ALLOCATION**** b: 0xffe80000 e: 0xffefffff correcting^G
(WW) ****INVALID MEM ALLOCATION**** b: 0xffe40000 e: 0xffe7ffff correcting^G


Xorg detected your mouse at device /dev/mouse.
Please check your config if the mouse is still not
operational, as by default Xorg tries to autodetect
the protocol.

Your xorg.conf file is /root/xorg.conf.new

To test the server, run 'X -config /root/xorg.conf.new'

# X -config ~/xorg.conf.new
...
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is -1, (No such device or address)
drmOpenDevice: open result is -1, (No such device or address)
drmOpenDevice: Open failed
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is -1, (No such device or address)
drmOpenDevice: open result is -1, (No such device or address)
drmOpenDevice: Open failed
drmOpenByBusid: Searching for BusID pci:0000:00:02.0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 11, (OK)
drmOpenByBusid: drmOpenMinor returns 11
drmOpenByBusid: drmGetBusid reports pci:0000:00:02.0
...
(WW) I810(0): Extended BIOS function 0x5f05 failed.
...
Fatal server error:
Caught signal 11. Server aborting

"(WW) I810: No matching Device section for instance (BusID PCI:0:2:1) found"这个错误并没有什么关系,可以看这里:
Xorg wiki FAQ
用 lspci 可以看到这一点:
00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 04)
00:02.0 VGA compatible controller: Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller (rev 04)
00:02.1 Display controller: Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller (rev 04)
所以虽然 0:2:1 找不到,但 0:2:0 可以,如果真的找不到,一般会报告"No screen found"的错误。

只能换一种思路。现尝试编辑配置文件,将 i810 换成 vesa 试试:
# vi /etc/X11/xorg.conf
Section"Device"
Identifier "Card0"
Driver "vesa"
# Driver "i810"
VendorName "Intel Corporation"
BoardName "Mobile 915GM/GMS/910GML Express Graphics Controller"
BusID "PCI:0:2:0"
EndSection
这时候是可以启动 X 的,但只能以 root 身份运行,并且不能解决宽屏问题(915resolution)。

再尝试通过运行 xorgconfig 来获得一个配置文件(先将原来的文件备份),将其 Driver 改成 i810,在运行 915resolution 49 1280 768 之后,startx 竟然可以看到正确的长宽比,但之后就基本上没有什么响应了,twm 的窗口无法正常显示,点击鼠标只显示一些绿色的条纹。

我开始估计是窗口管理器的问题,于是接着安装其他的包,直到将 xfce4 安装之后,再进入 startx,这次可以看到正确的显示了,包括上下两个 panel,但是机器却好像越来越慢,点出来的菜单无法再隐藏,直至最后失去响应。

再使用 vesa 模块,基本上可以,但仍然不能以普通用户身份运行 startx。

所以现在是两个问题:
(1) i810 driver 或 vesa 1280x768
(2) normal user startx 的问题


(1)的 Xorg.0.log:
Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/local/, removing from list!
ADVANCE_LP_RING: outring (0x27) isn't on a QWord boundary(WW) I810(0): Fixing display offsets.
ADVANCE_LP_RING: outring (0x2f) isn't on a QWord boundary(WW) I810(0): Fixing display offsets.
ADVANCE_LP_RING: outring (0x37) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x3f) isn't on a QWord boundaryADVANCE_LP_RING: outring
(0x57) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x5f) isn't on a QWord boundary(WW) I810(0): Fixing display offsets.
ADVANCE_LP_RING: outring (0x67) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x87) isn't on a QWord boundaryADVANCE_LP_RING: outring
(0x8f) isn't on a QWord boundaryADVANCE_LP_RING: outring (0xaf) isn't on a QWord boundaryADVANCE_LP_RING: outring (0xb7) isn't on a QWord
boundaryADVANCE_LP_RING: outring (0xcf) isn't on a QWord boundaryADVANCE_LP_RING: outring (0xe7) isn't on a QWord boundaryADVANCE_LP_RING
: outring (0xff) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x117) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x12f) isn't
on a QWord boundaryADVANCE_LP_RING: outring (0x147) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x15f) isn't on a QWord boundaryAD
VANCE_LP_RING: outring (0x177) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x18f) isn't on a QWord boundaryADVANCE_LP_RING: outring
(0x1a7) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x1bf) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x1d7) isn't on a QW
ord boundaryADVANCE_LP_RING: outring (0x1ef) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x207) isn't on a QWord boundaryADVANCE_LP
_RING: outring (0x21f) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x237) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x24f)
isn't on a QWord boundaryADVANCE_LP_RING: outring (0x267) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x27f) isn't on a QWord boun
daryADVANCE_LP_RING: outring (0x297) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x2af) isn't on a QWord boundaryADVANCE_LP_RING: o
utring (0x2c7) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x2df) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x2f7) isn't o
n a QWord boundaryADVANCE_LP_RING: outring (0x30f) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x327) isn't on a QWord boundaryADVA
NCE_LP_RING: outring (0x33f) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x357) isn't on a QWord boundaryADVANCE_LP_RING: outring (
0x36f) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x387) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x39f) isn't on a QWor
d boundaryADVANCE_LP_RING: outring (0x3b7) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x3cf) isn't on a QWord boundaryADVANCE_LP_R
ING: outring (0x3e7) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x3ff) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x417) i
sn't on a QWord boundaryADVANCE_LP_RING: outring (0x42f) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x447) isn't on a QWord bounda
ryADVANCE_LP_RING: outring (0x45f) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x467) isn't on a QWord boundary(WW) I810(0): Fixing
display offsets.
ADVANCE_LP_RING: outring (0x46f) isn't on a QWord boundary(WW) I810(0): Fixing display offsets.
ADVANCE_LP_RING: outring (0x477) isn't on a QWord boundary(WW) I810(0): Fixing display offsets.
ADVANCE_LP_RING: outring (0x47f) isn't on a QWord boundary(WW) I810(0): Fixing display offsets.
ADVANCE_LP_RING: outring (0x487) isn't on a QWord boundary(WW) I810(0): Fixing display offsets.
ADVANCE_LP_RING: outring (0x48f) isn't on a QWord boundary(WW) I810(0): Fixing display offsets.
ADVANCE_LP_RING: outring (0x497) isn't on a QWord boundary(WW) I810(0): Fixing display offsets.
ADVANCE_LP_RING: outring (0x49f) isn't on a QWord boundary(WW) I810(0): Fixing display offsets.
ADVANCE_LP_RING: outring (0x4a7) isn't on a QWord boundary(WW) I810(0): Fixing display offsets.
ADVANCE_LP_RING: outring (0x4af) isn't on a QWord boundary(WW) I810(0): Fixing display offsets.
ADVANCE_LP_RING: outring (0x4b7) isn't on a QWord boundaryADVANCE_LP_RING: outring (0x7) isn't on a QWord boundary


(2)的 Xorg.0.log:
(==) VESA(0): Write-combining range (0xd0fa0000,0x10000)
(==) VESA(0): Write-combining range (0xd0f80000,0x30000)
(==) VESA(0): Write-combining range (0xd0f00000,0xb0000)
(==) VESA(0): Write-combining range (0xd0e00000,0x1b0000)
(==) VESA(0): Write-combining range (0xd0c00000,0x3b0000)
(==) VESA(0): Write-combining range (0xd0800000,0x7b0000)
(WW) VESA(0): Failed to set up write-combining range (0xd0000000,0xfb0000)
(II) VESA(0): virtual address = 0xb6c2b000,
physical address = 0xd0000000, size = 16449536
...
Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/local/, removing from list!
FreeFontPath: FPE "/usr/X11R6/lib/X11/fonts/misc/" refcount is 2, should be 1; fixing.


(2)的解决
首先推测是不是程序权限的问题,就像前面出现过的,因为使用的是基于用户的包管理。于是运行:
# userpack files Xorg-6.9.0 >/usr/src/xorg.files
# cat !$ | xargs chown root.root
# chmod u+s /usr/X11R6/bin/Xorg
然后以普通用户登录运行 startx,出现一样的问题,所以不是这个原因,改回权限:
# cat /usr/src/xorg.file | xargs chown Xorg.Xorg
# chmod u+s /usr/X11R6/bin/Xorg

这是注意到一个问题,LFS 没有给这个普通用户创建 $HOME 目录,是否会是这个原因?创建 HOME 目录,将 /root/.xinitrc 拷贝到 ~,在运行 startx。OK。

(1)的解决
始终没有成功的配置好 i810 driver,于是只好用 vesa driver:
# gtf 1280x768 60
1280x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 80.14 MHz
Modeline "1280x768_60.00" 80.14 1280 1344 1480 1680 768 769 772 795 -HSync +Vsync
然后复制这一行到 /etc/X11/xorg.conf 的 Monitor 段(一说要将"1280x768_60.00"改为"1280x768"),编辑 Screen 段的 Modes 为 "1280x768"。

然后运行 915resulotion:
# 915resolution 49 1280 768
之后 startx。

配置文件如下(主体是由 xorgconfig 产生的,做了一些修改:
# cat /etc/X11/xorg.conf
# File generated by xorgconfig.

#
# Copyright 2004 The X.Org Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# The X.Org Foundation BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# Except as contained in this notice, the name of The X.Org Foundation shall
# not be used in advertising or otherwise to promote the sale, use or other
# dealings in this Software without prior written authorization from
# The X.Org Foundation.
#

# **********************************************************************
# Refer to the xorg.conf(5x) man page for details about the format of
# this file.
# **********************************************************************

# **********************************************************************
# Module section -- this section is used to specify
# which dynamically loadable modules to load.
# **********************************************************************
#
Section "Module"

# This loads the DBE extension module.

Load "dbe" # Double buffer extension

# This loads the miscellaneous extensions module, and disables
# initialisation of the XFree86-DGA extension within that module.
SubSection "extmod"
Option "omit xfree86-dga" # don't initialise the DGA extension
EndSubSection

# This loads the font modules
Load "type1"
# Load "speedo"
Load "freetype"
# Load "xtt"

# This loads the GLX module
# Load "glx"
# This loads the DRI module
# Load "dri"

# Load "bitmap"
# Load "ddc"
# Load "i2c"
# Load "int10"
# Load "vbe"
# Load "record"

EndSection

# **********************************************************************
# Files section. This allows default font and rgb paths to be set
# **********************************************************************

Section "Files"

# The location of the RGB database. Note, this is the name of the
# file minus the extension (like ".txt" or ".db"). There is normally
# no need to change the default.

RgbPath "/usr/X11R6/lib/X11/rgb"

# Multiple FontPath entries are allowed (which are concatenated together),
# as well as specifying multiple comma-separated entries in one FontPath
# command (or a combination of both methods)
#
#

FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/TTF/"
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/"
FontPath "/usr/X11R6/lib/X11/fonts/local/"
# FontPath "/usr/X11R6/lib/X11/fonts/Speedo/"
# FontPath "/usr/X11R6/lib/X11/fonts/TrueType/"
# FontPath "/usr/X11R6/lib/X11/fonts/freefont/"

# The module search path. The default path is shown here.

# ModulePath "/usr/X11R6/lib/modules"

EndSection

# **********************************************************************
# Server flags section.
# **********************************************************************

Section "ServerFlags"

# Uncomment this to cause a core dump at the spot where a signal is
# received. This may leave the console in an unusable state, but may
# provide a better stack trace in the core dump to aid in debugging

# Option "NoTrapSignals"

# Uncomment this to disable the VT switch sequence
# (where n is 1 through 12). This allows clients to receive these key
# events.

# Option "DontVTSwitch"

# Uncomment this to disable the server abort sequence
# This allows clients to receive this key event.

# Option "DontZap"

# Uncomment this to disable the / mode switching
# sequences. This allows clients to receive these key events.

# Option "Dont Zoom"

# Uncomment this to disable tuning with the xvidtune client. With
# it the client can still run and fetch card and monitor attributes,
# but it will not be allowed to change them. If it tries it will
# receive a protocol error.

# Option "DisableVidModeExtension"

# Uncomment this to enable the use of a non-local xvidtune client.

# Option "AllowNonLocalXvidtune"

# Uncomment this to disable dynamically modifying the input device
# (mouse and keyboard) settings.

# Option "DisableModInDev"

# Uncomment this to enable the use of a non-local client to
# change the keyboard or mouse settings (currently only xset).

# Option "AllowNonLocalModInDev"

EndSection

# **********************************************************************
# Input devices
# **********************************************************************

# **********************************************************************
# Core keyboard's InputDevice section
# **********************************************************************

Section "InputDevice"

Identifier "Keyboard1"
Driver "kbd"

# For most OSs the protocol can be omitted (it defaults to "Standard").
# When using XQUEUE (only for SVR3 and SVR4, but not Solaris),
# uncomment the following line.

# Option "Protocol" "Xqueue"

Option "AutoRepeat" "500 30"

# Specify which keyboard LEDs can be user-controlled (eg, with xset(1))
# Option "Xleds" "1 2 3"

# Option "LeftAlt" "Meta"
# Option "RightAlt" "ModeShift"

# To customise the XKB settings to suit your keyboard, modify the
# lines below (which are the defaults). For example, for a non-U.S.
# keyboard, you will probably want to use:
# Option "XkbModel" "pc105"
# If you have a US Microsoft Natural keyboard, you can use:
# Option "XkbModel" "microsoft"
#
# Then to change the language, change the Layout setting.
# For example, a german layout can be obtained with:
# Option "XkbLayout" "de"
# or:
# Option "XkbLayout" "de"
# Option "XkbVariant" "nodeadkeys"
#
# If you'd like to switch the positions of your capslock and
# control keys, use:
# Option "XkbOptions" "ctrl:swapcaps"

# These are the default XKB settings for Xorg
# Option "XkbRules" "xorg"
# Option "XkbModel" "pc105"
# Option "XkbLayout" "us"
# Option "XkbVariant" ""
# Option "XkbOptions" ""

# Option "XkbDisable"

Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"

EndSection


# **********************************************************************
# Core Pointer's InputDevice section
# **********************************************************************

Section "InputDevice"

# Identifier and driver

Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "Auto" # Auto detect
Option "Device" "/dev/mouse"

# When using XQUEUE, comment out the above two lines, and uncomment
# the following line.

# Option "Protocol" "Xqueue"

# Mouse-speed setting for PS/2 mouse.

# Option "Resolution" "256"

# Baudrate and SampleRate are only for some Logitech mice. In
# almost every case these lines should be omitted.

# Option "BaudRate" "9600"
# Option "SampleRate" "150"

# Mouse wheel mapping. Default is to map vertical wheel to buttons 4 & 5,
# horizontal wheel to buttons 6 & 7. Change if your mouse has more than
# 3 buttons and you need to map the wheel to different button ids to avoid
# conflicts.

Option "ZAxisMapping" "4 5 6 7"

# Emulate3Buttons is an option for 2-button mice
# Emulate3Timeout is the timeout in milliseconds (default is 50ms)

Option "Emulate3Buttons"
# Option "Emulate3Timeout" "50"

# ChordMiddle is an option for some 3-button Logitech mice

# Option "ChordMiddle"

EndSection

Section "InputDevice"
Identifier "Synaptics"
Driver "synaptics"
Option "Device" "/dev/input/mice"
Option "Protocol" "auto-dev"
Option "Emulate3Buttons" "yes"
EndSection


# **********************************************************************
# Other input device sections
# this is optional and is required only if you
# are using extended input devices. This is for example only. Refer
# to the xorg.conf man page for a description of the options.
# **********************************************************************
#
# Section "InputDevice"
# Identifier "Mouse2"
# Driver "mouse"
# Option "Protocol" "MouseMan"
# Option "Device" "/dev/mouse2"
# EndSection
#
# Section "InputDevice"
# Identifier "spaceball"
# Driver "magellan"
# Option "Device" "/dev/cua0"
# EndSection
#
# Section "InputDevice"
# Identifier "spaceball2"
# Driver "spaceorb"
# Option "Device" "/dev/cua0"
# EndSection
#
# Section "InputDevice"
# Identifier "touchscreen0"
# Driver "microtouch"
# Option "Device" "/dev/ttyS0"
# Option "MinX" "1412"
# Option "MaxX" "15184"
# Option "MinY" "15372"
# Option "MaxY" "1230"
# Option "ScreenNumber" "0"
# Option "ReportingMode" "Scaled"
# Option "ButtonNumber" "1"
# Option "SendCoreEvents"
# EndSection
#
# Section "InputDevice"
# Identifier "touchscreen1"
# Driver "elo2300"
# Option "Device" "/dev/ttyS0"
# Option "MinX" "231"
# Option "MaxX" "3868"
# Option "MinY" "3858"
# Option "MaxY" "272"
# Option "ScreenNumber" "0"
# Option "ReportingMode" "Scaled"
# Option "ButtonThreshold" "17"
# Option "ButtonNumber" "1"
# Option "SendCoreEvents"
# E

# **********************************************************************
# Monitor section
# **********************************************************************

# Any number of monitor sections may be present

Section "Monitor"
Identifier "Monitor0"

# HorizSync is in kHz unless units are specified.
# HorizSync may be a comma separated list of discrete values, or a
# comma separated list of ranges of values.
# NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR'S
# USER MANUAL FOR THE CORRECT NUMBERS.

### HorizSync 31.5 - 48.5

# HorizSync 30-64 # multisync
# HorizSync 31.5, 35.2 # multiple fixed sync frequencies
# HorizSync 15-25, 30-50 # multiple ranges of sync frequencies

# VertRefresh is in Hz unless units are specified.
# VertRefresh may be a comma separated
# comma separated list of ranges of values.
# NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR'S
# USER MANUAL FOR THE CORRECT NUMBERS.

### VertRefresh 50-90

# 1280x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 80.14 MHz
### Modeline "1280x768_60.00" 80.14 1280 1344 1480 1680 768 769 772 795 -HSync +Vsync
Modeline "1280x768" 80.14 1280 1344 1480 1680 768 769 772 795 -HSync +Vsync

EndSection


# **********************************************************************
# Graphics device section
# **********************************************************************

# Any number of graphics device sections may be present

# Standard VGA Device:

Section "Device"
Identifier "Standard VGA"
VendorName "Unknown"
BoardName "Unknown"

# The chipset line is optional in most cases. It can be used to override
# the driver's chipset detection, and should not normally be specified.

# Chipset "generic"

# The Driver line must be present. When using run-time loadable driver
# modules, this line instructs the server to load the specified driver
# module. Even when not using loadable driver modules, this line
# indicates which driver should interpret the information in this section.

Driver "vga"
# The BusID line is used to specify which of possibly multiple devices
# this section is intended for. When this line isn't present, a device
# section can only match up with the primary video device. For PCI
# devices a line like the following could be used. This line should not
# normally be included unless there is more than one video device
# intalled.

# BusID "PCI:0:10:0"

# VideoRam 256

# Clocks 25.2 28.3

EndSection

# Device configured by xorgconfig:

Section "Device"
Identifier "Card0"
# Driver "vga"
Driver "vesa"
# unsupported card
#VideoRam 16384
# Insert Clocks lines here if appropriate
Option "HWCursor" "false"
EndSection


# **********************************************************************
# Screen sections
# **********************************************************************

# Any number of screen sections may be present. Each describes
# the configuration of a single screen. A single specific screen section
# may be specified from the X server command line with the "-screen"
# option.
Section "Screen"
Identifier "Screen 1"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24

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

# **********************************************************************
# ServerLayout sections.
# **********************************************************************

# Any number of ServerLayout sections may be present. Each describes
# the way multiple screens are organised. A specific ServerLayout
# section may be specified from the X server command line with the
# "-layout" option. In the absence of this, the first section is used.
# When now ServerLayout section is present, the first Screen section
# is used alone.

Section "ServerLayout"

# The Identifier line must be present
Identifier "Simple Layout"

# Each Screen line specifies a Screen section name, and optionally
# the relative position of other screens. The four names after
# primary screen name are the screens to the top, bottom, left and right
# of the primary screen. In this example, screen 2 is located to the
# right of screen 1.

Screen 0 "Screen 1" 0 0

# Each InputDevice line specifies an InputDevice section name and
# optionally some options to specify the way the device is to be
# used. Those options include "CorePointer", "CoreKeyboard" and
# "SendCoreEvents".

InputDevice "Mouse1" "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"

EndSection

# Section "DRI"
# Mode 0666
# EndSection
很奇怪的事,开始就是不行,但后来突然可以了,在此之前只做过(2)的解决,不知道为什么。但至少保留这个可用的配置文件吧,应该是没什么问题了。

2 条评论:

Unknown 说...

google找到您的blog太好了
感谢博主感谢google!
感谢lfs!!感谢sir!!!!

Unknown 说...

哈哈我的显卡是ati x200m
也遇到了您这样的问题
在您的分析下 我如法炮制
换vesa先启动了x
然后再装显卡驱动呵呵