startupunix 发表于 2013-05-15 16:07

为什么我的键盘和鼠标在freebsd-8.3-release下的command mode line

为什么我的键盘和鼠标在FreeBSD-8.3-RELEASE-amd64 在command mode line 模式下运行正常,但是配置了xorg之后然后安装kde安startx进入,键盘和鼠标就不会动了,我个人感觉应该是驱动的原因,但是不知道应该怎么做,在安装xorg的时候需要一个xorg的配置文件就是xorg.conf然后里边也改了,按着手册里边的设置了,但是只弄好了显示器的分辨率以及刷新率,其他的没有弄好。不知道怎么弄。请大神指教。

oily1314 发表于 2013-05-15 16:10

xf86-input-keyboard,xf86-input-mouse这两个驱动没装?

mirnshi 发表于 2013-05-15 19:27

本帖最后由 mirnshi 于 2013-05-15 19:28 编辑

配置或者驱动问题

startupunix 发表于 2013-05-16 14:15

回复 2# oily1314


    但是他在命令行模式下键盘和鼠标都可以用啊

startupunix 发表于 2013-05-16 14:16

回复 3# mirnshi


    那应该怎么弄呢?对这一块不懂。如果是配置的问题应该怎么该,如果是驱动的问题,驱动怎么安装,安装那个驱动。

lsstarboy 发表于 2013-05-16 20:42

X自已有键盘鼠标驱动,你再加上一个,他们麻烦就大了。
在X设置里指定类型,有时能解决。

zeissoctopus 发表于 2013-05-16 21:17

本帖最后由 zeissoctopus 于 2013-05-16 21:52 编辑

樓主請提供以下資料: (紅字是我目前某一部筆電答案,作為例子)

1. 樓主是使用那種鍵盤和鼠標?例如有線還是無線類型

筆電上有 AT 兼容鍵盤
筆電上有觸控板連接在 PS2 埠
我平常是使用羅技 USB 無線鍵盤
我平常是使用羅技 USB 無線鼠標

2. 請用以下命令,在文字模式下檢查 /dev 有關鍵盤和鼠標設備接口,然後把結果告訴大家
檢查鍵盤ls -l /dev/kbd*

當我接上羅技無線鍵盤後 ls -l /dev/kbd* 答案如下
lrwxr-xr-x1 rootwheel-    6B5 16 19:12 kbd0@ -> atkbd0
lrwxr-xr-x1 rootwheel-    7B5 16 19:12 kbd1@ -> kbdmux0
lrwxr-xr-x1 rootwheel-    5B5 16 19:12 kbd2@ -> ukbd0

kbd0 是筆電的 AT 鍵盤連接 atkbd 埠
kbd1 是 kernel 的 kbdmux 元件
kbd2 是羅技 USB 鍵盤的

檢查鼠標ls -l /dev/psm*當我接上羅技無線鍵盤後 ls -l /dev/psm* 答案如下
crw-rw-rw-1 rootwheel-   0,365 16 19:12 /dev/psm0

psm0 是我筆電上的觸控板

檢查鼠標ls -l /dev/sysmouse當我接上羅技無線鍵盤後 ls -l /dev/sysmouse* 答案如下
crw-------1 rootwheel-   0,295 16 19:12 sysmouse
我有一個 sysmouse,那是 /etc/devd.conf 自動產生的結果,我並沒有在 /etc/rc.conf 加入 moused


3. 請樓主提供完整 /etc/rc.conf
以下是我的 /etc/conf
hostname="mybsd"
dumpdev="NO"
ifconfig_bge0="up"
ifconfig_ath0="ether 11:77:00:AC:8D:11"
wlans_ath0="wlan0"
ifconfig_wlan0="WPA"
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto failover laggport bge0 laggport wlan0 SYNCDHCP"
powerd_flags="-a adp -b hadp -n hadp -m 800 -M 1800 -i 25 -p 1500"
powerd_enable="YES"
syslogd_flags="-ss"
lpd_enable="NO"
sendmail_enable="NONE"
mixer_enable="YES"
devfs_system_ruleset="desktop"
hald_enable="YES"
dbus_enable="YES"
webcamd_enable="YES"
linux_enable="YES"
samba_enable="NO"
cupsd_enable="YES"
fusefs_enable="YES"
vboxnet_enable="YES"
avahi_daemon_enable="YES"
avahi_dnsconfd_enable="YES"
kdm4_enable="YES"

4. 樓主用 hal 還是不是 hal ? 這會影響如何編寫/etc/X11/xorg.conf
我是完全使用 hal 替 Xorg 找硬件,以下是我的 /etc/X11/xorg.conf
Section "ServerLayout"
      Identifier   "X.org Configured"
      Screen         0"Screen0" 0 0
      Option         "AIGLX"          "True"
      Option         "DRI2"         "True"
      Option         "DontZap"      "off"   
EndSection

Section "Files"
      ModulePath   "/usr/local/lib/xorg/modules"
      FontPath   "/usr/local/lib/X11/fonts/100dpi/"
      FontPath   "/usr/local/lib/X11/fonts/75dpi/"
      FontPath   "/usr/local/lib/X11/fonts/local/"
      FontPath   "/usr/local/lib/X11/fonts/OTF/"
      FontPath   "/usr/local/lib/X11/fonts/Type1/"
      FontPath   "/usr/local/lib/X11/fonts/TTF/"
      FontPath   "/usr/local/lib/X11/fonts/TrueType/"
      FontPath   "/usr/local/lib/X11/fonts/misc/:unscaled"
      FontPath   "/usr/local/lib/X11/fonts/misc/"
      FontPath   "/usr/local/lib/X11/fonts/alee-ttf/"
      FontPath   "/usr/local/lib/X11/fonts/bitstream-vera/"
      FontPath   "/usr/local/lib/X11/fonts/ChromeOS/"
      FontPath   "/usr/local/lib/X11/fonts/cyrillic/"
      FontPath   "/usr/local/lib/X11/fonts/Droid/"
      FontPath   "/usr/local/lib/X11/fonts/dejavu/"
      FontPath   "/usr/local/lib/X11/fonts/fonts-te/"
      FontPath   "/usr/local/lib/X11/fonts/GentiumBasic/"
      FontPath   "/usr/local/lib/X11/fonts/GentiumPlus/"
      FontPath   "/usr/local/lib/X11/fonts/Hana/"
      FontPath   "/usr/local/lib/X11/fonts/hebrew/"
      FontPath   "/usr/local/lib/X11/fonts/junicode/"
      FontPath   "/usr/local/lib/X11/fonts/stix/"
      FontPath   "/usr/local/lib/X11/fonts/terminus-font/"
      FontPath   "/usr/local/lib/X11/fonts/ubuntu-font/"
      FontPath   "/usr/local/lib/X11/fonts/unfonts-core/"
      FontPath   "/usr/local/lib/X11/fonts/unfonts-extra/"
      FontPath   "/usr/local/lib/X11/fonts/urwfonts-ttf/"
      FontPath   "/usr/local/lib/X11/fonts/webfonts/"
      FontPath   "/usr/local/lib/X11/fonts/wqy/"
      FontPath   "/usr/local/share/fonts/amsfonts/"
      FontPath   "/usr/local/share/fonts/cantarell/"
      FontPath   "/usr/local/share/fonts/cm-super/"
      FontPath   "/usr/local/share/fonts/shinonome/"
      FontPath   "/usr/local/share/fonts/std.zh_CN/"
      FontPath   "/usr/local/share/fonts/TrueType/"
      FontPath   "/usr/local/share/fonts/TTF/"
      FontPath   "/usr/local/share/fonts/OTF/"
EndSection

Section "Monitor"
      #DisplaySize      340   190   # mm
      Identifier   "Monitor0"
      VendorName   "LCD"
      ModelName    "d801"
EndSection

Section "Device"
      Identifier"Card0"
      Driver      "radeon"
      VendorName"Advanced Micro Devices nee ATI"
      BoardName   "RS880M "
      BusID       "PCI:1:5:0"
      #Option      "AccelMethod"   "EXA"
      #Option      "AGPFastWrite""true"
EndSection

Section "Screen"
      Identifier   "Screen0"
      Device       "Card0"
      Monitor      "Monitor0"
      DefaultDepth 24
      #Option       "AddARGBGLXVisuals" "True"
      SubSection "Display"
          Viewport 0 0
          Depth    24
          Modes    "1366x768"
      EndSubSection
EndSection

Section "Extensions"
      Option "Composite"   "Enable"
      Option "MIT-SHM" "Enable"
EndSection


那麼樓主為什麼進入 Xorg 後,鍵盤和鼠標便動不了呢?
答案很簡單,就是 Xorg 啟動後,它配置錯了鍵盤和鼠標的埠。

那麼為什麼會錯配鍵盤和鼠標埠呢?
請樓主提供以上問題的資料後,才分析吧! 沒有足夠資料,很難幫你。

startupunix 发表于 2013-05-21 00:34

回复 7# zeissoctopus

ls -l /dev/kbd*

lrwxr-xr-x1 rootwheel         65 21 00:11 /dev/kbd0 -> atkbd0
l
rwxr-xr-x1 rootwheel         75 21 00:11 /dev/kbd1 -> kbdmux0
l
rwxr-xr-x1 rootwheel         55 21 00:11 /dev/kbd2 -> ukbd0

crw-------1 rootwheel    0,205 21 00:11 /dev/kbdmux0



ls -l /dev/psm*

ls : no match



ls -l /dev/sysmouse

crw-------1 rootwheel    0,145 21 00:11 /dev/sysmouse



cat /etc/rc.conf

# -- sysinstall generated deltas --
# Thu Apr 25 08:45:47 2013
# Created: Thu Apr 25 08:45:47 2013

# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# This file now contains just the overrides from /etc/defaults/rc.conf.

keymap="us.iso"

hostname="free"

# -- sysinstall generated deltas -- # Wed May8 19:45:10 2013

moused_enable="YES"

# -- sysinstall generated deltas -- # Mon May 13 13:14:45 2013

moused_port="/dev/mse0"

moused_nodefault_enable="YES"

hald_enable="YES"

dbus_enable="TES"



cat /etc/X11/xorg.conf


Section "ServerLayout"
       
        Identifier    "X.org Configured"
       
        Screen      0"Screen0" 0 0
       
        InputDevice    "Mouse0" "CorePointer"
       
        InputDevice    "Keyboard0" "CoreKeyboard"

EndSection



Section "Files"

        ModulePath   "/usr/local/lib/xorg/modules"

        FontPath   "/usr/local/lib/X11/fonts/misc/"

        FontPath   "/usr/local/lib/X11/fonts/TTF/"

        FontPath   "/usr/local/lib/X11/fonts/OTF"

        FontPath   "/usr/local/lib/X11/fonts/Type1/"

        FontPath   "/usr/local/lib/X11/fonts/100dpi/"

        FontPath   "/usr/local/lib/X11/fonts/75dpi/"

EndSection



Section "Module"

        Load"dbe"

        Load"dri"

        Load"dri2"

        Load"extmod"

        Load"glx"

        Load"record"

EndSection



Section "InputDevice"

        Identifier"Keyboard0"

        Driver      "kbd"

EndSection



Section "InputDevice"

        Identifier"Mouse0"

        Driver      "mouse"

        Option          "Protocol" "auto"

        Option          "Device" "/dev/mse0"

        Option          "ZAxisMapping" "4 5 6 7"

EndSection



Section "Monitor"

        Identifier   "Monitor0"

        VendorName   "Monitor Vendor"

        ModelName    "Monitor Model"

        Modeline   "1024*768" 78.43 1024 1080 1192 1360 768 769 772 801

EndSection



Section "Device"

      ### Available Driver options are:-

      ### Values: <i>: integer, <f>: float, <bool>: "True"/"False"
,
       ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"

      ### : arg optional

      #Option   "SWcursor"                 # [<bool>]

      #Option   "HWcursor"                 # [<bool>]

      #Option   "NoAccel"                    # [<bool>]

      #Option   "ShadowFB"                 # [<bool>]

      #Option   "UseFBDev"                 # [<bool>]

      #Option   "Rotate"                     # [<str>]

      #Option   "VideoKey"                 # <i>

      #Option   "FlatPanel"                  # [<bool>]

      #Option   "FPDither"                 # [<bool>]

      #Option   "CrtcNumber"                 # <i>

      #Option   "FPScale"                    # [<bool>]

      #Option   "FPTweak"                    # <i>

      #Option   "DualHead"                 # [<bool>]

        Identifier"Card0"

        Driver      "nv"

        VendorName"NVIDIA Corporation"

        BoardName   "C61 "

        BusID       "PCI:0:13:0"

EndSection



Section "Screen"

        Identifier "Screen0"

        Device   "Card0"

        Monitor    "Monitor0"

        SubSection "Display"

                Viewport   0 0

                Depth   24

                Modes "1024*768"

        EndSubSection

EndSection



这是所有全部的配置了。
我也不是太懂。就是知道有这么些东西,但这些东西里边的配置到底是那个方面的不懂。

   

startupunix 发表于 2013-05-21 00:37

回复 7# zeissoctopus 忘了说了:
我用的是有线的,usb口的。
键盘也是有线的,usb口的。

zeissoctopus 发表于 2013-05-21 05:53

本帖最后由 zeissoctopus 于 2013-05-21 05:54 编辑

很好呀!有足夠資料解答。

你碰到問題原因是,你沒有用 AT keyboard,你是使用 /dev/kbd2 上的 USB keyboard 作為主要鍵盤。很可惜!FreeBSD 默認的 Xorg 配置是搞不懂你想要用 /dev/kbd2 的鍵盤。因為默認內核有古老 /dev/kbd0->atkbd0 存在,因此!當你啟動 Xorg 後,它默認接 /dev/kbd0,結果便昰你沒有用鍵盤了。

至於鼠標,你在 /etc/X11/xorg.conf 指示 xorg 用 /dev/mse0 ,當然大錯特錯,USB 鼠標絕對不是 /dev/mse0

如何設定默認鍵盤是用 /dev/kdb2-> ukb0 呢?

答案資訊是在 man kbdconfig

你以 root 身份,用 vi 在 /etc 裡增加一個 rc.local 文字配置檔,然後填入以下命令
kbdcontrol -k /dev/ukbd0 < /dev/console
/etc/rc.local 每次開機,最後都會讀的,以上命令是告訴 FreeBSD 你的默認鍵盤是在 /dev/ukbd0

請你把 /etc/rc.conf 中以下三句刪除吧,
moused_enable="YES"
moused_port="/dev/mse0"
moused_nodefault_enable="YES
因為 FreeBSD devd 子系統默認一旦發現有 USB 鼠標,它會自動載入鼠標驅動,產生 /dev/sysmouse

保留 /etc/rc.conf 中的 hald_enable=YES, dbus_enable=YES

你是使用 hald 幫 Xorg 找硬件的,請把以下多餘語句通通刪除
......
      InputDevice    "Mouse0" "CorePointer"
      InputDevice    "Keyboard0" "CoreKeyboard"
......
Section "InputDevice"

      Identifier"Keyboard0"

      Driver      "kbd"

EndSection



Section "InputDevice"

      Identifier"Mouse0"

      Driver      "mouse"

      Option            "Protocol" "auto"

      Option            "Device" "/dev/mse0"

      Option            "ZAxisMapping" "4 5 6 7"

EndSection
請樓主照著我的指示做,然後進入 Xorg 看看如何?如果成功恭喜你,如果失敗的話,要教你如何修改 hald 的 fdi 檔案引導它去找 /dev/ukbd0
页: [1] 2 3
查看完整版本: 为什么我的键盘和鼠标在freebsd-8.3-release下的command mode line