X配置文件(xorg.conf)分析

    技术2022-05-12  6

    X的配置,实际上就是生成 /etc/X11/xorg.conf 这个文件。 通常的配置主要对以下的Section作操作: a. 显示器的信息写在该节 Section “Monitor” Identifier “monitor0” VendorName “VSC” ModelName “VSC1609 ” HorizSync 30 – 70 VertRefresh 50 - 160 ModeLine “...” --------->指定显示器的显示模式,很重要。 ... ModeLine “...” Endsection ModeLine 可以用ddcxinfo-knoppix直接生成。(通过检测你的显卡和显示器) 或者通过gtf 直接计算标准的VESA mode lines。如: gtf 1024 768 85 则生成: # 1024x768 @ 85.00 Hz (GTF) hsync: 68.60 kHz; pclk: 94.39 MHz Modeline "1024x768_85.00" 94.39 1024 1088 1200 1376 768 769 772 807 -HSync +Vsync 要成为高手,能手工微调的话参考: http://www.tldp.org/HOWTO/XFree86-Video-Timings-HOWTO/ 中文版: http://man.chinaunix.net/linux/how/XFree86-Video-Timings-HOWTO.html 作者Eric S. Raymond,勿须多言了。 b. 显卡信息写在该节 Section “Device” Identifier “card0” VendorName “Intel” BoardName “Intel Corporation 82845G/GL/GE Chipset Integrated Graphics Device” Driver “i810” BusID “PCI:0:2:0” Endseciton PS: 一个PCI外设由BusID(8bit):DeviceID(5bit):FunctionID(3bit)来描述。在xorg.conf 中需用十进制表示。 一般PCI接口的显卡的总线编号为0,AGP接口的显卡的总线编号为1。 单显卡的情况下可以没有BusID这一行。 X所用之所有驱动都安装在/usr/X11R6/lib/modules/drivers/ ,官方驱动亦是。 (注: 最新版本的Xorg,其驱动位于 /usr/lib/xorg/modules/drivers/ ) 比如安装了官方的nvidia驱动后,会在上述目录中放置nvidia_drv.o文件,则在上节中指定: Driver “nvidia” (X自带的驱动为nv,相应的文件为nv_drv.so) c. 一个显卡和一个显示器则组成一个screen,用Section “Screen” 描述。 Section “Screen” Identifier “screen0” Device “card0” Monitor “monitor0” DefaultDepth 24 SubSection “Display” Depth 24 Modes “1024x768” “800x600” “640x480” EndSubSection ... EndSection 若还有一块显卡,其上也接一显示器则再加一Section “Screen”描述。 Section “Screen” Identifier “screen1” Device “card1” Monitor “monitor1” DefaultDepth 24 SubSection “Display” Depth 24 Modes “1024x768” “800x600” “640x480” EndSubSection ... EndSection d. 若有两套独立的显卡显示器,则需在Section “ServerLayout”中对多个screen进行组织。 Section “ServerLayout” Identifier “multihead layout” Screen 0 “screen0” 0 768 Screen 1 “screen1” 0 0 ... Option “Xinerama” “on” ------------------->扩展桌面,off则为个体桌面 EndSection PS: 其他常用的Option : Option "DontZap" 屏蔽 <Ctrl>+<Alt>+<Backspace> Option "DontVTSwitch" 屏蔽<Ctrl>+<Alt>+<Fn> 的控制台的切换

    最新回复(0)