写设备驱动程序?

发布于 2024-11-04 02:03:37 字数 387 浏览 4 评论 0原文

我想知道我是否理解正确...

比如说,如果我想控制鼠标的工作方式,即左键打开窗口,右键发送击键“A”等。

但我并不是在谈论在应用程序中编写如下所示的内容:

void MouseDown(xxxxEventArgs e, sender object)
{

}

我想完全控制设备的工作方式,那么我需要为其编写驱动程序吗?根据我之前在汇编中学到的知识,控制设备我应该需要知道它们的端口才能与设备进行通信。但是如果我购买了罗技鼠标,是否可以自己编写鼠标驱动程序来使用它?

因为我看到一些项目他们从商店购买了一个USB网络摄像头,他们可以控制网络来旋转,从网络摄像头接收图像,我想知道这是因为网络摄像头有API提供给他们吗?

提前致谢。

I wonder if I understand correctly...

Say, if I want to control how my mouse work, i.e Left Button open window, Right Button send keystroke 'A' etc.

But I am not talking about writting something like follows in an application:

void MouseDown(xxxxEventArgs e, sender object)
{

}

I want to completely controls how the device work, then I will need to write a driver for it? From what I learn in assembly before, controlling a device I should need to know their port to communicate with the device. But say if I buy a Logitech mouse, is it possible to write a mouse driver myself to use it?

Because I saw some project that they buy a usb web cam from store, and they could able to control the web came to rotate, recevie the image from the web cam, I wonder if that's because the web cam has API provided them?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

过气美图社 2024-11-11 02:03:37

如果你想完整地控制设备,那么你确实需要编写一个设备驱动程序。这是一项不平凡的任务,您应该仔细阅读。 这里有一个关于它的教程,还有一本关于 Windows 驱动程序开发的书 < a href="https://rads.stackoverflow.com/amzn/click/com/0735623740" rel="nofollow noreferrer">此处。

如果您想编写设备驱动程序,您应该非常精通 C 和/或 C++。

If you want to control the device in it's entirety, then you need to write a device driver indeed. This is a non-trivial task and you should read up on it. There is a tutorial on it here and there a book for windows driver development here.

If you want to write device drivers, you should be very well versed with C and/or C++.

你如我软肋 2024-11-11 02:03:37

您不需要为您想要做的事情编写设备驱动程序。设备驱动程序除了根据寄存器设备地址的数据表之外什么都没有,它可以在其中读取、写入、执行 IOMMU 等或其他一些东西。什么您将需要对您想要实现的目标的应用程序编程部分进行某种破解。

因为设备驱动程序代码只是从设备读取数据并写回,所以关心它的是应用程序。尽管在某些情况下设备驱动程序程序员向应用程序程序员提供方法(函数),以便他们可以编写应用程序并调用这些方法在您的情况下,您只需要了解应用程序代码如何与设备驱动程序通信。
如果您想编写设备驱动程序,请检查此
http://www.freesoftwaremagazine.com/articles/drivers_linux?page=0%2C0

You do not need to write a device driver for what you are trying to do.The device driver has nothing but as per the data sheet of the device address of registers where it can read,write,do IOMMU etc or some other stuff.What you will need is some kind of hacking the application programming part of the thing which you are trying to achieve.

Because device driver code just reads the data from device and writes back it is the application which is concerned for it.Though in some case device driver programmer provide a method (function) to application programmer so that they can write their application and invoke those methods.In your case you need to just understand how the application code is talking to device driver.
In case you want to write a device driver check this
http://www.freesoftwaremagazine.com/articles/drivers_linux?page=0%2C0

渡你暖光 2024-11-11 02:03:37

在这种情况下,您可以继续使用 C++ 编写自己的设备驱动程序并进行组装
莱姆

In such kind of cases you can proceed with writing your own device driver by C++ and assemb
lyem

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文