4.2. Xorg

Last update: 2004年10月25日 周一 11時06分40秒 CST

在 FreeBSD 5.3-RELEASE 之後,Xorg 成為預設的 X11 系統。 Xorg 是由 X.Org 機構發布的,根據 X11R6.7 所製作的 X11 伺服器。 X11R6.7 是基於 XFree86 4.4RC2 的程式碼和 X11R6.6。

安裝 x11/xorg

# pkg_add -r xorg

或是以 ports collection 的方式安裝:

# cd /usr/ports/x11/xorg
# make install clean

Note: 與 XFree86 的差異只有幾個設定方式改變。像是設定程式 XFree86(1) 變成 Xorg(1)xf86cfg(1) 變成 xorgcfg(1)xf86config(1) 變成 xorgconfig(1)。 設定檔 XF86Config 變成 xorg.conf。 紀錄檔 XFree86.0.log 變成 Xorg.0.log

先用 Xorg -configure 產生 xorg.conf.new 並且搬移到 /etc/X11/xorg.conf,或是用選單模式的 xorgcfg -textmode 產生 xorg.conf,然後用 Xorg -xf86config xorg.conf 來測試這個檔案能不能正常的運作。

# Xorg -configure
# mv xorg.conf.new /etc/X11/xorg.conf

由於筆者通常使用三鍵滑鼠,所以會設定一下, 接著編輯 /etc/X11/xorg.conf, 在 Section "InputDevice" 區段, 加入 Option "ZAxisMapping" "4 5"。 並且用 /stand/sysinstall 來設定好 moused, 以便讓 /dev/sysmouse 有作用。 Configure → Mouse → Enable

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Protocol" "MouseSystems"
        Option      "Device" "/dev/sysmouse"
        Option      "ZAxisMapping" "4 5"
EndSection

通常都需要指定 HorizSync 和 VertSync 才能讓解析度設定的高一點, 像是使用 1024x768 的解析度, 在 Section "Monitor" 區段, 加入 HorizSync 31.5 - 57.0VertRefresh 50.0 - 100.0

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model" 
        HorizSync    31.5 - 57.0
        VertRefresh  50.0 - 100.0
EndSection

筆者通常都用 16bpp 和 1024x768 的螢幕, 在 Section "Screen" 區段, 加入 DefaultDepth 16,並在 SubSection "Display" 中, Depth 16 的地方加上 Modes "1024x768"

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"  
        Monitor    "Monitor0"
        DefaultDepth    16   
        SubSection "Display" 
                Depth     16 
                Modes     "1024x768"
        EndSubSection
EndSection