[英]How do I know whether a device driver works in Linux?
For a mouse, if I issue the command cat /dev/input/mouse1
and then move the mouse, there will be outputs in the console. 对于鼠标,如果发出命令
cat /dev/input/mouse1
然后移动鼠标,则控制台中将有输出。 From this I know that the mouse works. 由此我知道鼠标可以工作。
But for the touchpad of my laptop, which is mouse0
, I see no output when I issue /dev/input/mouse0
and touch the pad. 但是对于我的笔记本电脑的触摸板,即
mouse0
,发出/dev/input/mouse0
并触摸该板时,看不到任何输出。
Then how do I know whether drivers of devices like my touchpad are really working? 那么我如何知道诸如触摸板之类的设备的驱动程序是否真正起作用? Whether they can really communicate with the operating system?
他们是否真的可以与操作系统通信?
this depends upon how your driver wishes to communicate with the device and provide a response to you. 这取决于您的驾驶员希望如何与设备通信并向您提供响应。
your driver needs to create a procfs or a sysfs interface like your mouse did. 您的驱动程序需要像鼠标一样创建procfs或sysfs接口。 so if your driver creates such an interface you can surely see but you have to look for them, sometimes they are not easy to find with their terminologies.
因此,如果您的驱动程序创建了这样的界面,您肯定可以看到,但是您必须寻找它们,有时有时很难用它们的术语找到它们。
needless to say, they exist and they are communicating with your OS if they are working, but have they provided a procfs or sysfs interface, that is driver specific and could not be said just right away, some documentation or code would be required. 毋庸置疑,它们存在并且正在与您的OS通信(如果它们正在工作),但是如果它们提供了procfs或sysfs接口,该接口特定于驱动程序,不能马上说出来,则需要一些文档或代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.