需要开发一个设备驱动程序,当安装在系统上时会创建多个虚拟串口 [英] Need to develop a device driver, which when installed on a system would create multiple virtual serial port

查看:154
本文介绍了需要开发一个设备驱动程序,当安装在系统上时会创建多个虚拟串口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的第一个Windows设备驱动程序&我被分配了一个从头开始开发Windows设备驱动程序的任务。当用户在Windows PC上安装该驱动程序时,它会在安装过程中要求用户输入用户需要的虚拟串口数量。安装驱动程序后,应创建用户所需的虚拟端口号。然后用户通过USB端口将他的自定义打印机连接到Windows PC。用户应该能够通过Hyper终端向打印机发送数据,方法是选择9600波特率的新创建的虚拟串口,8个数据位,无奇偶校验和1个停止位。



现在我开始使用Windows 7系统,我已经在MSDN网站上安装了Visual Studio 2015和Windows Driver Kit 10。我还从GITHUB下载了Windows驱动程序示例代码,此示例soce base包含serial / Svirtualserial2下的virtualSerial UMDF项目。这个项目文件包含2个项目,一个是Virtualserial2项目&另一个是FakeModem项目,所以我删除了FakeModem项目(因为它对我没有用)&成功编译了源/ VirtualSerial2示例代码。在编译之后.dll(因为UDMF驱动程序具有.dll扩展名)文件在调试中生成折叠但我没有得到任何.exe这个驱动程序所以我不知道如何在我的系统上安装此驱动程序。我还要通过这个链接https://msdn.microsoft.com/en-in/library/windows/hardware/dn745911%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396列出使用WinDbg调试UMDF驱动程序的过程,在一个示例中它还要求我们运行.exe所以我的第一个问题是***我如何生成我的驱动程序的&.exe文件.exe文件在系统上测试它***。



除此之外我还有一个查询。在我的目标系统上安装驱动程序后(Windows 7 32位我需要将它链接到超级终端。这样我就可以通过超级终端将命令和数据发送到我的打印机了我的驱动程序将是负责从超级终端获取数据并通过USB将其发送到我的打印机。我该怎么做?



我是朝着正确的方向前进的...... ?



请帮助我,我被要求提供完成此任务的时间范围。因为我不确定我正在做的事情&需要做的事情,所以我无法为他们提供时间框架。



我尝试了什么: < br $>


我已经通过CodeProject的以下链接来描述驱动程序开发。但它主要集中在KMDF驱动程序上

http:// www .codeproject.com / Articles / 9636 / Driver-Development-Part-Introduction-to-driver-c

This is my first Windows device driver & I have been assigned a task to develop a Windows device driver from scratch. When the user installs this driver on a windows PC it would ask the user, during the installation process, to enter the number of virtual serial port that user requires & after installation of the driver the number of virtual port desired by the user shall be created. Then the user connects his customized printer to the windows PC via USB port. The user should be able to send data to the printer through the Hyper terminal by selecting any of the newly created Virtual serial port at 9600 baud rate, 8 data bit, No parity & 1 stop bit.

Now to get started I am using a windows 7 system on which I have installed Visual Studio 2015 along with Windows Driver Kit 10 form the MSDN website. I have also downloaded the Windows drivers sample codes form the GITHUB this sample soce base contains a virtualSerial UMDF project under serial/Svirtualserial2. this project file contained 2 projects one being the Virtualserial2 project & the other is a FakeModem project so I deleted the FakeModem project(as its was of no use for me) & successfully compileed the source/VirtualSerial2 sample code. after compilation a .dll(as UDMF drivers have .dll extensions) file gets generated in the debug folded but I don't get any .exe for this driver so I am not sure how can I install this driver on my system. I was also going through this link https://msdn.microsoft.com/en-in/library/windows/hardware/dn745911%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396 that list the process to debug a UMDF driver using WinDbg, in an example it also asks us to run the .exe so my 1st question is ***how do I need to generate a .exe file of my driver & test it on a system***.

Along with this I have one more query. after I install my driver on the target system(Windows 7 32 bit I need to link it to the hyper terminal. so that I will be able to send the Commands & data to my printer through the hyper terminal & my driver will be responsible to take the data from the hyper terminal & send it to my printer through USB. How can I do that?

Am I going in the right direction..?

Please help me out I am being asked to provide the time frame within which I can complete this Task. As I am not sure about the things which I am doing & the things that need to be done so I am not able to provide them a time frame.

What I have tried:

I have gone through the following links of CodeProject that describes the Driver development. But it mainly concentrated on KMDF drivers
http://www.codeproject.com/Articles/9636/Driver-Development-Part-Introduction-to-driver-c

推荐答案

这样的问题太广泛了,无法在快速答案论坛中得到解答。您应该访问 Microsoft Windows驱动程序开发工具包(DDK)解决方案中心 [ ^ ]并研究设备驱动程序的开发。但请注意,这是一个非常复杂的主题。
A question like this is far too broad to be answered in a Quick Answers forum. You should go to Microsoft Windows Driver Development Kit (DDK) Solution Center[^] and study the development of device drivers. But be aware it is quite a complex subject.


这篇关于需要开发一个设备驱动程序,当安装在系统上时会创建多个虚拟串口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆