Serial Mouse Driver for Win7 x64

Hello Kernel Driver Developers,

Seems like every time I get a new driver development project, I am asking you guys how to get started. This is no exception… I have been looking at this stuff for a few days now and have come to the conclusion that I have no idea what I am doing…

I am trying to write a mouse driver for a Windows 7 64 bit OS. The target hardware is a custom embedded unit that we build. We have a touch screen that is inputing RS422 serial touch data through a memory mapped FPGA. I have already written a legacy style driver that can be used to transfer that data to a user application. (Just a simple open handle to named driver and get data IOCTL kind of thing…) The original requirement was just to access the touch screen from a select user application.

Now they want to be able to use the touch screen as a mouse device (user logins ect.). I was thinking I could write a driver that would replace the MS serial mouse driver, however that has not proven to be as simple as I thought. I cant even figure out how to install the thing. I do not want to use serenum to start the thing because the hardware is memory mapped and not accessed through a COM port.

What I would like to do is just start the driver as a legacy hardware device using the MemConfig hardware construct in the INF Install section. (Same as the PortIO driver sample code). Then connect my driver to the mouclass driver (not using sermouse or any of the other microsoft drivers) and send the mouse commands to mouclass directly from my driver.

How do I do this?? I have not been able to find any sample code that really helps. The moufiltr and sermouse sample projects rely on serenum to start. And mouclass does not start if sermouse or one of the other mouse devices in msmouse.inf does not start. Also, I do not know if this thing would be a filter or what…

I know how to make my hardware work and translate the serial data into mouse data, I just dont know how to send it to mouclass.

Any help would be appreciated. At this point I am just walking in circles…

Thanks.
Bob

You want a HID miniport. Convert whatever data comes back from your device into HID reports. You’ll want to describe the device as an absolute positioning device, not a relative positioning device like a mouse.

  • Jake Oshins
    Windows Kernel Team

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@peoplepc.com
Sent: Wednesday, January 9, 2013 8:42 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Serial Mouse Driver for Win7 x64

Hello Kernel Driver Developers,

Seems like every time I get a new driver development project, I am asking you guys how to get started. This is no exception… I have been looking at this stuff for a few days now and have come to the conclusion that I have no idea what I am doing…

I am trying to write a mouse driver for a Windows 7 64 bit OS. The target hardware is a custom embedded unit that we build. We have a touch screen that is inputing RS422 serial touch data through a memory mapped FPGA. I have already written a legacy style driver that can be used to transfer that data to a user application. (Just a simple open handle to named driver and get data IOCTL kind of thing…) The original requirement was just to access the touch screen from a select user application.

Now they want to be able to use the touch screen as a mouse device (user logins ect.). I was thinking I could write a driver that would replace the MS serial mouse driver, however that has not proven to be as simple as I thought. I cant even figure out how to install the thing. I do not want to use serenum to start the thing because the hardware is memory mapped and not accessed through a COM port.

What I would like to do is just start the driver as a legacy hardware device using the MemConfig hardware construct in the INF Install section. (Same as the PortIO driver sample code). Then connect my driver to the mouclass driver (not using sermouse or any of the other microsoft drivers) and send the mouse commands to mouclass directly from my driver.

How do I do this?? I have not been able to find any sample code that really helps. The moufiltr and sermouse sample projects rely on serenum to start. And mouclass does not start if sermouse or one of the other mouse devices in msmouse.inf does not start. Also, I do not know if this thing would be a filter or what…

I know how to make my hardware work and translate the serial data into mouse data, I just dont know how to send it to mouclass.

Any help would be appreciated. At this point I am just walking in circles…

Thanks.
Bob


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

And install your kmdf hid miniport on the serial port device node itself (if it were a normal serial port, you could write a umdf hid miniport). The value of serenum is that it can detect whatever device is attached to the port. Since your port is dedicated to being a mouse, there is no need to have the generic serenum in the mix. And your driver must be pnp, not legacy.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Jake Oshins
Sent: Wednesday, January 9, 2013 10:04 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Serial Mouse Driver for Win7 x64

You want a HID miniport. Convert whatever data comes back from your device into HID reports. You’ll want to describe the device as an absolute positioning device, not a relative positioning device like a mouse.

  • Jake Oshins
    Windows Kernel Team

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@peoplepc.com
Sent: Wednesday, January 9, 2013 8:42 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Serial Mouse Driver for Win7 x64

Hello Kernel Driver Developers,

Seems like every time I get a new driver development project, I am asking you guys how to get started. This is no exception… I have been looking at this stuff for a few days now and have come to the conclusion that I have no idea what I am doing…

I am trying to write a mouse driver for a Windows 7 64 bit OS. The target hardware is a custom embedded unit that we build. We have a touch screen that is inputing RS422 serial touch data through a memory mapped FPGA. I have already written a legacy style driver that can be used to transfer that data to a user application. (Just a simple open handle to named driver and get data IOCTL kind of thing…) The original requirement was just to access the touch screen from a select user application.

Now they want to be able to use the touch screen as a mouse device (user logins ect.). I was thinking I could write a driver that would replace the MS serial mouse driver, however that has not proven to be as simple as I thought. I cant even figure out how to install the thing. I do not want to use serenum to start the thing because the hardware is memory mapped and not accessed through a COM port.

What I would like to do is just start the driver as a legacy hardware device using the MemConfig hardware construct in the INF Install section. (Same as the PortIO driver sample code). Then connect my driver to the mouclass driver (not using sermouse or any of the other microsoft drivers) and send the mouse commands to mouclass directly from my driver.

How do I do this?? I have not been able to find any sample code that really helps. The moufiltr and sermouse sample projects rely on serenum to start. And mouclass does not start if sermouse or one of the other mouse devices in msmouse.inf does not start. Also, I do not know if this thing would be a filter or what…

I know how to make my hardware work and translate the serial data into mouse data, I just dont know how to send it to mouclass.

Any help would be appreciated. At this point I am just walking in circles…

Thanks.
Bob


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

So I am looking at the sample code for wacompen:
C:\WINDDK\7600.16385.1\src\input\hiddigi\WacomKMDF

Based off what you are saying, would this code be a good starting point?
Could I remove the “LowerFilters” serial service and replace it with my device I/O code.
I would then use a MemConfig install option in the INF to point it at my FPGA memory?
I am assuming this would give me a KMDF pnpPowerCallbacks.EvtDevicePrepareHardware callback to configure my hardware.

Does this make sense?

Thanks.

Why do you need a memconfig? Is your device ISA?

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@peoplepc.com
Sent: Wednesday, January 9, 2013 12:16 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Serial Mouse Driver for Win7 x64

So I am looking at the sample code for wacompen:
C:\WINDDK\7600.16385.1\src\input\hiddigi\WacomKMDF

Based off what you are saying, would this code be a good starting point?
Could I remove the “LowerFilters” serial service and replace it with my device I/O code.
I would then use a MemConfig install option in the INF to point it at my FPGA memory?
I am assuming this would give me a KMDF pnpPowerCallbacks.EvtDevicePrepareHardware callback to configure my hardware.

Does this make sense?

Thanks.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

The device is not ISA, it just sits on a memory address.
I thought that is what I needed to get a callback with raw and translated addresses so
I can call MmMapIoSpace. Is there another way??

When I did this as a PortIO style driver, the driver did not load if I did not have this.

You should report the device in acpi in the bios then and it will be enumerated with the resources assigned

d


From: xxxxx@peoplepc.commailto:xxxxx
Sent: ?1/?9/?2013 12:47 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Serial Mouse Driver for Win7 x64

The device is not ISA, it just sits on a memory address.
I thought that is what I needed to get a callback with raw and translated addresses so
I can call MmMapIoSpace. Is there another way??

When I did this as a PortIO style driver, the driver did not load if I did not have this.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>

How do I do that??

A memconfig tells the PnP manager “My device can’t be found through plug and play mechanisms and will always be configured at the following memory range.”

Both parts of that statement are untrue for your device.

  • Jake Oshins
    (Former PnP guy)
    Windows Kernel Team

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@peoplepc.com
Sent: Wednesday, January 9, 2013 12:47 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Serial Mouse Driver for Win7 x64

The device is not ISA, it just sits on a memory address.
I thought that is what I needed to get a callback with raw and translated addresses so I can call MmMapIoSpace. Is there another way??

When I did this as a PortIO style driver, the driver did not load if I did not have this.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer