文件系统里面没有 /dev/input/mice 文件的解决办法

简介: 文件系统里面没有 /dev/input/mice 文件的解决办法

问题

前阵子使用一块新板子的开发嵌入式系统,在做界面的过程中,发现移植的根文件系统里面没有/dev/input/mice文件,虽然接了鼠标时候会生成一个event0,但mice文件的数据和event0的数据是不一样的,所以想看看能不能让系统里有支持/dev/input/mice文件。

2018122814580746.png


解决过程

1、在网上搜索系统里为什么没有/dev/input/mice?,没有找到想要的答案!!!

看了一些文章后,发现大部分文章都是直接就可以使用/dev/input/mice文件,产生一个想法:会不会是编译内核时,缺少了哪些配置导致的,然后执行make menuconfig重新配置内核,按斜杠键/搜索mice,没有任何相关信息。

2018122814580746.png

2、接着又在内核源码的根目录使用grep "/dev/input/mice" -rnw ./搜索到很多txt文件,从中找到一个./Documentation/input/input.txt的文件可能会有帮助。

从这个txt文件摘抄下面这段话,意思是要先加载模块,再创建设备节点,最后指定GPM 使用节点。按照命令操作,没有 gpm 命令。

2. Simple Usage
~~~~~~~~~~~~~~~
  For the most usual configuration, with one USB mouse and one USB keyboard,
you'll have to load the following modules (or have them built in to the
kernel):
  input
  mousedev
  keybdev
  usbcore
  uhci_hcd or ohci_hcd or ehci_hcd
  usbhid
  After this, the USB keyboard will work straight away, and the USB mouse
will be available as a character device on major 13, minor 63:
  crw-r--r--   1 root     root      13,  63 Mar 28 22:45 mice
  This device has to be created.
  The commands to create it by hand are:
  cd /dev
  mkdir input
  mknod input/mice c 13 63
  After that you have to point GPM (the textmode mouse cut&paste tool) and
XFree to this device to use it - GPM should be called like:
  gpm -t ps2 -m /dev/input/mice
  And in X:
  Section "Pointer"
      Protocol    "ImPS/2"
      Device      "/dev/input/mice"
      ZAxisMapping 4 5
  EndSection
  When you do all of the above, you can use your USB mouse and keyboard.

3、最后尝试在内核配置中搜到mousedev,找到了有点相关的选项,发现都被关闭了。

2018122814580746.png

3、最后尝试在内核配置中搜到mousedev,找到了有点相关的选项,发现都被关闭了。

Device Drivers  --->
    Input device support  --->
        <*>   Mouse interface

配置后如下图:2018122814580746.png

重新编译成功后,烧到板子了,可以找到/dev/input/mice文件了

2018122814580746.png

总结

系统里没有/dev/input/mice的原因,可能是编译内核时,没有配置加载mousedev模块,需要重新配置内核,配置路径如下:

Device Drivers  --->
    Input device support  --->
        <*>   Mouse interface


目录
相关文章
|
4月前
|
Java
Files.find 去除部分目录/dev/fd,/proc如何操作
在使用 `Files.find` 方法时,如果你想在搜索过程中排除特定目录,如 `/dev/fd` 和 `/proc`,可以在 `BiPredicate` 实现中添加相应的逻辑。以下是一个示例,演示如何在 `Files.find` 中排除这些目录: ```java import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.attribute.BasicFileAttributes; imp
|
Linux
【Linux】关于Bad magic number in super-block 当尝试打开/dev/sda1 时找不到有效的文件系统超级块
【Linux】关于Bad magic number in super-block 当尝试打开/dev/sda1 时找不到有效的文件系统超级块
268 0
|
Unix Linux
cat /proc/bus/input/devices 文件内容详解
cat /proc/bus/input/devices 文件内容详解
483 0
cat /proc/bus/input/devices 文件内容详解
mount: 文件系统类型错误、选项错误、/dev/rbd0 上有坏超级块、
mount: 文件系统类型错误、选项错误、/dev/rbd0 上有坏超级块、
2618 0
|
存储 Linux 开发工具
[OS][FS]查看ext3文件系统分区的superblock
本文将介绍怎样读取一个分区的superblock: 1. 首先我们查看一下在磁盘上有哪些分区,通过fdisk -l 这里有三个分区,我们下面查看/dev/sda3(这是一个device file) 2. 从/dev/sda3拷贝1024B-2048B(这就是superblock的位置)到一个叫superblock的文件 这里我们用到了dd这个工具,它在对磁盘进行这样读写操作时非常有用,具体请见man。
1124 0
|
监控 数据安全/隐私保护 索引
第十八章--Ext2和Ext3文件系统
一、Ext2的一般特征         但在一些情况下,已经在Ext2的索引节点中为这些特性引入新的字段。最重要的一些特点如下:         块片(block fragmentation):系统管理员对磁盘的访问通常选择较大的块,因为计算机应用程序常常处理大文件。
1316 0