How to access raw ps/2 touchpad data through kernel mode driver?

I’m writing an alternative ps/2 touchpad driver for a new laptop and having challenges accessing raw data from the device. Started with moufiltr (WDK8) and it works great and kernel debug output is flowing. However, I’m ultimately trying to support multitouch and having a difficult time understanding how to communicate with the device for it. MOUSE_INPUT_DATA is giving me what appears to be processed or standardized mouse input messages. Not able to find out which finger generates the messages or find raw information like pressure.

This kind of raw information probably requires a special protocol with the device and there is a mature linux driver with all that info documented. What I need help with is understanding how to communicate with the device using the Windows KMDF driver. The Linux guys are using functions like ‘ps2_command’ and ‘psmouse_sliced_command’ to read registers. I’m not sure what is the windows equivalent of this or if I am even on the right track.

The linux driver is somehow receiving 4-byte and 6-byte packets after setting a protocol handler on a ‘psmouse’ object. If anyone has any suggestions on how I can ultimately push some bytes over to a ps2 device and then receive some bytes back, that would be a great place to start. Even if it’s just a function name or msdn link on how to manage ps/2 protocol. I’m pretty advanced with C/C++ and embedded development, but new to windows drivers.

The device is an elantech ps/2 touchpad on an Acer Aspire S7 notebook.

Thanks!

This is not a project to learn drivers. Nastiness lies here. You have to work with the native ps2 driver , it provides some hooks but probably not enough to.make the touch pad work. Furthermore, unless elan has given you a spec for their private custom interface, you don’t have much to work with.

Start here, http://msdn.microsoft.com/en-us/library/windows/hardware/ff539982(v=vs.85).aspx

d

Bent from my phone


From: xxxxx@jadware.commailto:xxxxx
Sent: ?4/?20/?2013 4:36 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] How to access raw ps/2 touchpad data through kernel mode driver?

I’m writing an alternative ps/2 touchpad driver for a new laptop and having challenges accessing raw data from the device. Started with moufiltr (WDK8) and it works great and kernel debug output is flowing. However, I’m ultimately trying to support multitouch and having a difficult time understanding how to communicate with the device for it. MOUSE_INPUT_DATA is giving me what appears to be processed or standardized mouse input messages. Not able to find out which finger generates the messages or find raw information like pressure.

This kind of raw information probably requires a special protocol with the device and there is a mature linux driver with all that info documented. What I need help with is understanding how to communicate with the device using the Windows KMDF driver. The Linux guys are using functions like ‘ps2_command’ and ‘psmouse_sliced_command’ to read registers. I’m not sure what is the windows equivalent of this or if I am even on the right track.

The linux driver is somehow receiving 4-byte and 6-byte packets after setting a protocol handler on a ‘psmouse’ object. If anyone has any suggestions on how I can ultimately push some bytes over to a ps2 device and then receive some bytes back, that would be a great place to start. Even if it’s just a function name or msdn link on how to manage ps/2 protocol. I’m pretty advanced with C/C++ and embedded development, but new to windows drivers.

The device is an elantech ps/2 touchpad on an Acer Aspire S7 notebook.

Thanks!


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

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>

Yes indeed a challenging one to start with but I think the hard part is
behind me. I actually do have the parts of the protocol that I need, I
have the init code bytes and the responses and all that fun stuff.

What I’m trying to understand is whether I have to do the I/O
asynchronously and build a state machine into the driver, or if there is
a way to do it synchronously. And with asynch, if I can queue up a
bunch of bytes into a buffer/queue and then set state to process the
response. Either one is no problem, and the ReactOS implementation that
I am now looking at is asynch.

IOCTL_INTERNAL_I8042_MOUSE_WRITE_BUFFER appears to be the method for
pushing data, but it is actually quite difficult to find examples of its
use. I see some use in a keyboard ps/2 driver but not sure if it
translates. Do you know of any good examples of that ioctl? I looked
at the old pnpi8042 code from the WDK 6000 but it is fairly long and
seems a little outdated.

Thanks,
Jad

------ Original Message ------
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: 2013-04-20 20:15:20
Subject: RE: [ntdev] How to access raw ps/2 touchpad data through kernel
mode driver?
>This is not a project to learn drivers. Nastiness lies here. You have
>to work with the native ps2 driver , it provides some hooks but
>probably not enough to.make the touch pad work. Furthermore, unless
>elan has given you a spec for their private custom interface, you don’t
>have much to work with.
>
>Start here,
>http://msdn.microsoft.com/en-us/library/windows/hardware/ff539982(v=vs.85).aspx
>
>d
>
>Bent from my phone
>--------------------------------------------------------------------------------
>From: xxxxx@jadware.com
>Sent: ‎4/‎20/‎2013 4:36 PM
>To: Windows System Software Devs Interest List
>Subject: [ntdev] How to access raw ps/2 touchpad data through kernel
>mode driver?
>
>I’m writing an alternative ps/2 touchpad driver for a new laptop and
>having challenges accessing raw data from the device. Started with
>moufiltr (WDK8) and it works great and kernel debug output is flowing.
>However, I’m ultimately trying to support multitouch and having a
>difficult time understanding how to communicate with the device for it.
> MOUSE_INPUT_DATA is giving me what appears to be processed or
>standardized mouse input messages. Not able to find out which finger
>generates the messages or find raw information like pressure.
>
>This kind of raw information probably requires a special protocol with
>the device and there is a mature linux driver with all that info
>documented. What I need help with is understanding how to communicate
>with the device using the Windows KMDF driver. The Linux guys are
>using functions like ‘ps2_command’ and ‘psmouse_sliced_command’ to read
>registers. I’m not sure what is the windows equivalent of this or if I
>am even on the right track.
>
>The linux driver is somehow receiving 4-byte and 6-byte packets after
>setting a protocol handler on a ‘psmouse’ object. If anyone has any
>suggestions on how I can ultimately push some bytes over to a ps2
>device and then receive some bytes back, that would be a great place to
>start. Even if it’s just a function name or msdn link on how to manage
>ps/2 protocol. I’m pretty advanced with C/C++ and embedded
>development, but new to windows drivers.
>
>The device is an elantech ps/2 touchpad on an Acer Aspire S7 notebook.
>
>Thanks!
>
>—
>NTDEV is sponsored by OSR
>
>OSR is HIRING!! See http://www.osr.com/careers
>
>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
>
>OSR is HIRING!! See http://www.osr.com/careers
>
>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

Pnpi8042 is the one that processes these requests which you send down the stack. You won’t find public samples of drivers sending this ioctls, drivers that send them are for proprietary hardware. device init will be sync, normal packet processing and io flow will be asynchronous.

Your bigger design problem is going to be how you are going to report data like.touch and other extended info. Mouclass won’t let you report any of that data. If you want it to show up as touch, you will need a hid miniport to push the datat to (use a pdo enumerated from your filter for that). Also, if you look at all the mapping that elan and others do, most of that is in user mode in value ads software, not the driver

d

Bent from my phone


From: Jad Meouchymailto:xxxxx
Sent: ?4/?20/?2013 8:27 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: Re: [ntdev] How to access raw ps/2 touchpad data through kernel mode driver?

Yes indeed a challenging one to start with but I think the hard part is behind me. I actually do have the parts of the protocol that I need, I have the init code bytes and the responses and all that fun stuff.

What I’m trying to understand is whether I have to do the I/O asynchronously and build a state machine into the driver, or if there is a way to do it synchronously. And with asynch, if I can queue up a bunch of bytes into a buffer/queue and then set state to process the response. Either one is no problem, and the ReactOS implementation that I am now looking at is asynch.

IOCTL_INTERNAL_I8042_MOUSE_WRITE_BUFFER appears to be the method for pushing data, but it is actually quite difficult to find examples of its use. I see some use in a keyboard ps/2 driver but not sure if it translates. Do you know of any good examples of that ioctl? I looked at the old pnpi8042 code from the WDK 6000 but it is fairly long and seems a little outdated.

Thanks,
Jad

------ Original Message ------
From: “Doron Holan” >
To: “Windows System Software Devs Interest List” >
Sent: 2013-04-20 20:15:20
Subject: RE: [ntdev] How to access raw ps/2 touchpad data through kernel mode driver?
This is not a project to learn drivers. Nastiness lies here. You have to work with the native ps2 driver , it provides some hooks but probably not enough to.make the touch pad work. Furthermore, unless elan has given you a spec for their private custom interface, you don’t have much to work with.

Start here, http://msdn.microsoft.com/en-us/library/windows/hardware/ff539982(v=vs.85).aspx

d

Bent from my phone
________________________________
From: xxxxx@jadware.commailto:xxxxx
Sent: ?4/?20/?2013 4:36 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] How to access raw ps/2 touchpad data through kernel mode driver?

I’m writing an alternative ps/2 touchpad driver for a new laptop and having challenges accessing raw data from the device. Started with moufiltr (WDK8) and it works great and kernel debug output is flowing. However, I’m ultimately trying to support multitouch and having a difficult time understanding how to communicate with the device for it. MOUSE_INPUT_DATA is giving me what appears to be processed or standardized mouse input messages. Not able to find out which finger generates the messages or find raw information like pressure.

This kind of raw information probably requires a special protocol with the device and there is a mature linux driver with all that info documented. What I need help with is understanding how to communicate with the device using the Windows KMDF driver. The Linux guys are using functions like ‘ps2_command’ and ‘psmouse_sliced_command’ to read registers. I’m not sure what is the windows equivalent of this or if I am even on the right track.

The linux driver is somehow receiving 4-byte and 6-byte packets after setting a protocol handler on a ‘psmouse’ object. If anyone has any suggestions on how I can ultimately push some bytes over to a ps2 device and then receive some bytes back, that would be a great place to start. Even if it’s just a function name or msdn link on how to manage ps/2 protocol. I’m pretty advanced with C/C++ and embedded development, but new to windows drivers.

The device is an elantech ps/2 touchpad on an Acer Aspire S7 notebook.

Thanks!


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

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

OSR is HIRING!! See http://www.osr.com/careers

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

OSR is HIRING!! See http://www.osr.com/careers

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></mailto:xxxxx></mailto:xxxxx>

When you say ‘report that data’, do you mean that I won’t be able to
directly share that data into a user mode application? That’s okay for
now, all I really want to do is change the movement behavior of the
touchpad. Eventually I will need to design an API layer and some kind
of management interface, or use registry keys perhaps.

I’m still trying to figure out exactly when to send off the init bytes
to the mouse, not sure if it’s inside IOCTL_INTERNAL_MOUSE_CONNECT or
IOCTL_INTERNAL_I8042_HOOK_MOUSE or
IOCTL_INTERNAL_I8042_MOUSE_START_INFORMATION.

------ Original Message ------
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: 2013-04-20 21:33:28
Subject: RE: [ntdev] How to access raw ps/2 touchpad data through kernel
mode driver?
>Pnpi8042 is the one that processes these requests which you send down
>the stack. You won’t find public samples of drivers sending this
>ioctls, drivers that send them are for proprietary hardware. device
>init will be sync, normal packet processing and io flow will be
>asynchronous.
>
>Your bigger design problem is going to be how you are going to report
>data like.touch and other extended info. Mouclass won’t let you report
>any of that data. If you want it to show up as touch, you will need a
>hid miniport to push the datat to (use a pdo enumerated from your
>filter for that). Also, if you look at all the mapping that elan and
>others do, most of that is in user mode in value ads software, not the
>driver
>
>d
>
>Bent from my phone
>--------------------------------------------------------------------------------
>From: Jad Meouchy
>Sent: ‎4/‎20/‎2013 8:27 PM
>To: Windows System Software Devs Interest List
>Subject: Re: [ntdev] How to access raw ps/2 touchpad data through
>kernel mode driver?
>
>Yes indeed a challenging one to start with but I think the hard part is
>behind me. I actually do have the parts of the protocol that I need, I
>have the init code bytes and the responses and all that fun stuff.
>
>What I’m trying to understand is whether I have to do the I/O
>asynchronously and build a state machine into the driver, or if there
>is a way to do it synchronously. And with asynch, if I can queue up a
>bunch of bytes into a buffer/queue and then set state to process the
>response. Either one is no problem, and the ReactOS implementation
>that I am now looking at is asynch.
>
>IOCTL_INTERNAL_I8042_MOUSE_WRITE_BUFFER appears to be the method for
>pushing data, but it is actually quite difficult to find examples of
>its use. I see some use in a keyboard ps/2 driver but not sure if it
>translates. Do you know of any good examples of that ioctl? I looked
>at the old pnpi8042 code from the WDK 6000 but it is fairly long and
>seems a little outdated.
>
>Thanks,
>Jad
>
>------ Original Message ------
>From: “Doron Holan”
>To: “Windows System Software Devs Interest List”
>Sent: 2013-04-20 20:15:20
>Subject: RE: [ntdev] How to access raw ps/2 touchpad data through
>kernel mode driver?
>>This is not a project to learn drivers. Nastiness lies here. You have
>>to work with the native ps2 driver , it provides some hooks but
>>probably not enough to.make the touch pad work. Furthermore, unless
>>elan has given you a spec for their private custom interface, you
>>don’t have much to work with.
>>
>>Start here,
>>http://msdn.microsoft.com/en-us/library/windows/hardware/ff539982(v=vs.85).aspx
>>
>>d
>>
>>Bent from my phone
>>--------------------------------------------------------------------------------
>>From: xxxxx@jadware.com
>>Sent: ‎4/‎20/‎2013 4:36 PM
>>To: Windows System Software Devs Interest List
>>Subject: [ntdev] How to access raw ps/2 touchpad data through kernel
>>mode driver?
>>
>>I’m writing an alternative ps/2 touchpad driver for a new laptop and
>>having challenges accessing raw data from the device. Started with
>>moufiltr (WDK8) and it works great and kernel debug output is flowing.
>> However, I’m ultimately trying to support multitouch and having a
>>difficult time understanding how to communicate with the device for
>>it. MOUSE_INPUT_DATA is giving me what appears to be processed or
>>standardized mouse input messages. Not able to find out which finger
>>generates the messages or find raw information like pressure.
>>
>>This kind of raw information probably requires a special protocol with
>>the device and there is a mature linux driver with all that info
>>documented. What I need help with is understanding how to communicate
>>with the device using the Windows KMDF driver. The Linux guys are
>>using functions like ‘ps2_command’ and ‘psmouse_sliced_command’ to
>>read registers. I’m not sure what is the windows equivalent of this
>>or if I am even on the right track.
>>
>>The linux driver is somehow receiving 4-byte and 6-byte packets after
>>setting a protocol handler on a ‘psmouse’ object. If anyone has any
>>suggestions on how I can ultimately push some bytes over to a ps2
>>device and then receive some bytes back, that would be a great place
>>to start. Even if it’s just a function name or msdn link on how to
>>manage ps/2 protocol. I’m pretty advanced with C/C++ and embedded
>>development, but new to windows drivers.
>>
>>The device is an elantech ps/2 touchpad on an Acer Aspire S7 notebook.
>>
>>Thanks!
>>
>>—
>>NTDEV is sponsored by OSR
>>
>>OSR is HIRING!! See http://www.osr.com/careers
>>
>>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
>>
>>OSR is HIRING!! See http://www.osr.com/careers
>>
>>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
>
>OSR is HIRING!! See http://www.osr.com/careers
>
>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
>
>OSR is HIRING!! See http://www.osr.com/careers
>
>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

Is this for a product? If so, why wouldn’t elan provide the driver for their part? Win8 has some pretty strict touchpad requirements, not simple for someone new and on his own to meet

d

Bent from my phone


From: Jad Meouchymailto:xxxxx
Sent: ?4/?20/?2013 10:23 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: Re: [ntdev] How to access raw ps/2 touchpad data through kernel mode driver?

When you say ‘report that data’, do you mean that I won’t be able to directly share that data into a user mode application? That’s okay for now, all I really want to do is change the movement behavior of the touchpad. Eventually I will need to design an API layer and some kind of management interface, or use registry keys perhaps.

I’m still trying to figure out exactly when to send off the init bytes to the mouse, not sure if it’s inside IOCTL_INTERNAL_MOUSE_CONNECT or IOCTL_INTERNAL_I8042_HOOK_MOUSE or IOCTL_INTERNAL_I8042_MOUSE_START_INFORMATION.

------ Original Message ------
From: “Doron Holan” >
To: “Windows System Software Devs Interest List” >
Sent: 2013-04-20 21:33:28
Subject: RE: [ntdev] How to access raw ps/2 touchpad data through kernel mode driver?
Pnpi8042 is the one that processes these requests which you send down the stack. You won’t find public samples of drivers sending this ioctls, drivers that send them are for proprietary hardware. device init will be sync, normal packet processing and io flow will be asynchronous.

Your bigger design problem is going to be how you are going to report data like.touch and other extended info. Mouclass won’t let you report any of that data. If you want it to show up as touch, you will need a hid miniport to push the datat to (use a pdo enumerated from your filter for that). Also, if you look at all the mapping that elan and others do, most of that is in user mode in value ads software, not the driver

d

Bent from my phone

From: Jad Meouchymailto:xxxxx
Sent: ?4/?20/?2013 8:27 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: Re: [ntdev] How to access raw ps/2 touchpad data through kernel mode driver?

Yes indeed a challenging one to start with but I think the hard part is behind me. I actually do have the parts of the protocol that I need, I have the init code bytes and the responses and all that fun stuff.

What I’m trying to understand is whether I have to do the I/O asynchronously and build a state machine into the driver, or if there is a way to do it synchronously. And with asynch, if I can queue up a bunch of bytes into a buffer/queue and then set state to process the response. Either one is no problem, and the ReactOS implementation that I am now looking at is asynch.

IOCTL_INTERNAL_I8042_MOUSE_WRITE_BUFFER appears to be the method for pushing data, but it is actually quite difficult to find examples of its use. I see some use in a keyboard ps/2 driver but not sure if it translates. Do you know of any good examples of that ioctl? I looked at the old pnpi8042 code from the WDK 6000 but it is fairly long and seems a little outdated.

Thanks,
Jad

------ Original Message ------
From: “Doron Holan” >
To: “Windows System Software Devs Interest List” >
Sent: 2013-04-20 20:15:20
Subject: RE: [ntdev] How to access raw ps/2 touchpad data through kernel mode driver?
This is not a project to learn drivers. Nastiness lies here. You have to work with the native ps2 driver , it provides some hooks but probably not enough to.make the touch pad work. Furthermore, unless elan has given you a spec for their private custom interface, you don’t have much to work with.

Start here, http://msdn.microsoft.com/en-us/library/windows/hardware/ff539982(v=vs.85).aspx

d

Bent from my phone

From: xxxxx@jadware.commailto:xxxxx
Sent: ?4/?20/?2013 4:36 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] How to access raw ps/2 touchpad data through kernel mode driver?

I’m writing an alternative ps/2 touchpad driver for a new laptop and having challenges accessing raw data from the device. Started with moufiltr (WDK8) and it works great and kernel debug output is flowing. However, I’m ultimately trying to support multitouch and having a difficult time understanding how to communicate with the device for it. MOUSE_INPUT_DATA is giving me what appears to be processed or standardized mouse input messages. Not able to find out which finger generates the messages or find raw information like pressure.

This kind of raw information probably requires a special protocol with the device and there is a mature linux driver with all that info documented. What I need help with is understanding how to communicate with the device using the Windows KMDF driver. The Linux guys are using functions like ‘ps2_command’ and ‘psmouse_sliced_command’ to read registers. I’m not sure what is the windows equivalent of this or if I am even on the right track.

The linux driver is somehow receiving 4-byte and 6-byte packets after setting a protocol handler on a ‘psmouse’ object. If anyone has any suggestions on how I can ultimately push some bytes over to a ps2 device and then receive some bytes back, that would be a great place to start. Even if it’s just a function name or msdn link on how to manage ps/2 protocol. I’m pretty advanced with C/C++ and embedded development, but new to windows drivers.

The device is an elantech ps/2 touchpad on an Acer Aspire S7 notebook.

Thanks!


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

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

OSR is HIRING!! See http://www.osr.com/careers

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

OSR is HIRING!! See http://www.osr.com/careers

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

OSR is HIRING!! See http://www.osr.com/careers

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

OSR is HIRING!! See http://www.osr.com/careers

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></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>

Not a new product, no. It’s an elan touchpad but their driver is awful
and not open source. Synaptics at least has an SDK with all the hooks,
but not Elan. I thought maybe the synaptics driver would work with the
elan hardware since they are probably both pretty similar under the
hood, not so.

My intention is to customize the behavior of this existing touchpad to
align with my preferred ergonomics.

------ Original Message ------
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: 2013-04-20 22:33:01
Subject: RE: [ntdev] How to access raw ps/2 touchpad data through kernel
mode driver?
>Is this for a product? If so, why wouldn’t elan provide the driver for
>their part? Win8 has some pretty strict touchpad requirements, not
>simple for someone new and on his own to meet
>
>d
>
>Bent from my phone
>--------------------------------------------------------------------------------
>From: Jad Meouchy
>Sent: ‎4/‎20/‎2013 10:23 PM
>To: Windows System Software Devs Interest List
>Subject: Re: [ntdev] How to access raw ps/2 touchpad data through
>kernel mode driver?
>
>When you say ‘report that data’, do you mean that I won’t be able to
>directly share that data into a user mode application? That’s okay for
>now, all I really want to do is change the movement behavior of the
>touchpad. Eventually I will need to design an API layer and some kind
>of management interface, or use registry keys perhaps.
>
>I’m still trying to figure out exactly when to send off the init bytes
>to the mouse, not sure if it’s inside IOCTL_INTERNAL_MOUSE_CONNECT or
>IOCTL_INTERNAL_I8042_HOOK_MOUSE or
>IOCTL_INTERNAL_I8042_MOUSE_START_INFORMATION.
>
>
>------ Original Message ------
>From: “Doron Holan”
>To: “Windows System Software Devs Interest List”
>Sent: 2013-04-20 21:33:28
>Subject: RE: [ntdev] How to access raw ps/2 touchpad data through
>kernel mode driver?
>>Pnpi8042 is the one that processes these requests which you send down
>>the stack. You won’t find public samples of drivers sending this
>>ioctls, drivers that send them are for proprietary hardware. device
>>init will be sync, normal packet processing and io flow will be
>>asynchronous.
>>
>>Your bigger design problem is going to be how you are going to report
>>data like.touch and other extended info. Mouclass won’t let you report
>>any of that data. If you want it to show up as touch, you will need a
>>hid miniport to push the datat to (use a pdo enumerated from your
>>filter for that). Also, if you look at all the mapping that elan and
>>others do, most of that is in user mode in value ads software, not the
>>driver
>>
>>d
>>
>>Bent from my phone
>>--------------------------------------------------------------------------------
>>From: Jad Meouchy
>>Sent: ‎4/‎20/‎2013 8:27 PM
>>To: Windows System Software Devs Interest List
>>Subject: Re: [ntdev] How to access raw ps/2 touchpad data through
>>kernel mode driver?
>>
>>Yes indeed a challenging one to start with but I think the hard part
>>is behind me. I actually do have the parts of the protocol that I
>>need, I have the init code bytes and the responses and all that fun
>>stuff.
>>
>>What I’m trying to understand is whether I have to do the I/O
>>asynchronously and build a state machine into the driver, or if there
>>is a way to do it synchronously. And with asynch, if I can queue up a
>>bunch of bytes into a buffer/queue and then set state to process the
>>response. Either one is no problem, and the ReactOS implementation
>>that I am now looking at is asynch.
>>
>>IOCTL_INTERNAL_I8042_MOUSE_WRITE_BUFFER appears to be the method for
>>pushing data, but it is actually quite difficult to find examples of
>>its use. I see some use in a keyboard ps/2 driver but not sure if it
>>translates. Do you know of any good examples of that ioctl? I looked
>>at the old pnpi8042 code from the WDK 6000 but it is fairly long and
>>seems a little outdated.
>>
>>Thanks,
>>Jad
>>
>>------ Original Message ------
>>From: “Doron Holan”
>>To: “Windows System Software Devs Interest List”
>>Sent: 2013-04-20 20:15:20
>>Subject: RE: [ntdev] How to access raw ps/2 touchpad data through
>>kernel mode driver?
>>>This is not a project to learn drivers. Nastiness lies here. You have
>>>to work with the native ps2 driver , it provides some hooks but
>>>probably not enough to.make the touch pad work. Furthermore, unless
>>>elan has given you a spec for their private custom interface, you
>>>don’t have much to work with.
>>>
>>>Start here,
>>>http://msdn.microsoft.com/en-us/library/windows/hardware/ff539982(v=vs.85).aspx
>>>
>>>d
>>>
>>>Bent from my phone
>>>--------------------------------------------------------------------------------
>>>From: xxxxx@jadware.com
>>>Sent: ‎4/‎20/‎2013 4:36 PM
>>>To: Windows System Software Devs Interest List
>>>Subject: [ntdev] How to access raw ps/2 touchpad data through kernel
>>>mode driver?
>>>
>>>I’m writing an alternative ps/2 touchpad driver for a new laptop and
>>>having challenges accessing raw data from the device. Started with
>>>moufiltr (WDK8) and it works great and kernel debug output is
>>>flowing. However, I’m ultimately trying to support multitouch and
>>>having a difficult time understanding how to communicate with the
>>>device for it. MOUSE_INPUT_DATA is giving me what appears to be
>>>processed or standardized mouse input messages. Not able to find out
>>>which finger generates the messages or find raw information like
>>>pressure.
>>>
>>>This kind of raw information probably requires a special protocol
>>>with the device and there is a mature linux driver with all that info
>>>documented. What I need help with is understanding how to
>>>communicate with the device using the Windows KMDF driver. The Linux
>>>guys are using functions like ‘ps2_command’ and
>>>‘psmouse_sliced_command’ to read registers. I’m not sure what is the
>>>windows equivalent of this or if I am even on the right track.
>>>
>>>The linux driver is somehow receiving 4-byte and 6-byte packets after
>>>setting a protocol handler on a ‘psmouse’ object. If anyone has any
>>>suggestions on how I can ultimately push some bytes over to a ps2
>>>device and then receive some bytes back, that would be a great place
>>>to start. Even if it’s just a function name or msdn link on how to
>>>manage ps/2 protocol. I’m pretty advanced with C/C++ and embedded
>>>development, but new to windows drivers.
>>>
>>>The device is an elantech ps/2 touchpad on an Acer Aspire S7
>>>notebook.
>>>
>>>Thanks!
>>>
>>>—
>>>NTDEV is sponsored by OSR
>>>
>>>OSR is HIRING!! See http://www.osr.com/careers
>>>
>>>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
>>>
>>>OSR is HIRING!! See http://www.osr.com/careers
>>>
>>>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
>>
>>OSR is HIRING!! See http://www.osr.com/careers
>>
>>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
>>
>>OSR is HIRING!! See http://www.osr.com/careers
>>
>>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
>
>OSR is HIRING!! See http://www.osr.com/careers
>
>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
>
>OSR is HIRING!! See http://www.osr.com/careers
>
>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

IMHO you are diving into a death of a thousand cuts. Enjoy, it ain’t going to be pretty.

d

Bent from my phone


From: Jad Meouchymailto:xxxxx
Sent: ?4/?20/?2013 10:42 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: Re: [ntdev] How to access raw ps/2 touchpad data through kernel mode driver?

Not a new product, no. It’s an elan touchpad but their driver is awful and not open source. Synaptics at least has an SDK with all the hooks, but not Elan. I thought maybe the synaptics driver would work with the elan hardware since they are probably both pretty similar under the hood, not so.

My intention is to customize the behavior of this existing touchpad to align with my preferred ergonomics.

------ Original Message ------
From: “Doron Holan” >
To: “Windows System Software Devs Interest List” >
Sent: 2013-04-20 22:33:01
Subject: RE: [ntdev] How to access raw ps/2 touchpad data through kernel mode driver?
Is this for a product? If so, why wouldn’t elan provide the driver for their part? Win8 has some pretty strict touchpad requirements, not simple for someone new and on his own to meet

d

Bent from my phone

From: Jad Meouchymailto:xxxxx
Sent: ?4/?20/?2013 10:23 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: Re: [ntdev] How to access raw ps/2 touchpad data through kernel mode driver?

When you say ‘report that data’, do you mean that I won’t be able to directly share that data into a user mode application? That’s okay for now, all I really want to do is change the movement behavior of the touchpad. Eventually I will need to design an API layer and some kind of management interface, or use registry keys perhaps.

I’m still trying to figure out exactly when to send off the init bytes to the mouse, not sure if it’s inside IOCTL_INTERNAL_MOUSE_CONNECT or IOCTL_INTERNAL_I8042_HOOK_MOUSE or IOCTL_INTERNAL_I8042_MOUSE_START_INFORMATION.

------ Original Message ------
From: “Doron Holan” >
To: “Windows System Software Devs Interest List” >
Sent: 2013-04-20 21:33:28
Subject: RE: [ntdev] How to access raw ps/2 touchpad data through kernel mode driver?
Pnpi8042 is the one that processes these requests which you send down the stack. You won’t find public samples of drivers sending this ioctls, drivers that send them are for proprietary hardware. device init will be sync, normal packet processing and io flow will be asynchronous.

Your bigger design problem is going to be how you are going to report data like.touch and other extended info. Mouclass won’t let you report any of that data. If you want it to show up as touch, you will need a hid miniport to push the datat to (use a pdo enumerated from your filter for that). Also, if you look at all the mapping that elan and others do, most of that is in user mode in value ads software, not the driver

d

Bent from my phone

From: Jad Meouchymailto:xxxxx
Sent: ?4/?20/?2013 8:27 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: Re: [ntdev] How to access raw ps/2 touchpad data through kernel mode driver?

Yes indeed a challenging one to start with but I think the hard part is behind me. I actually do have the parts of the protocol that I need, I have the init code bytes and the responses and all that fun stuff.

What I’m trying to understand is whether I have to do the I/O asynchronously and build a state machine into the driver, or if there is a way to do it synchronously. And with asynch, if I can queue up a bunch of bytes into a buffer/queue and then set state to process the response. Either one is no problem, and the ReactOS implementation that I am now looking at is asynch.

IOCTL_INTERNAL_I8042_MOUSE_WRITE_BUFFER appears to be the method for pushing data, but it is actually quite difficult to find examples of its use. I see some use in a keyboard ps/2 driver but not sure if it translates. Do you know of any good examples of that ioctl? I looked at the old pnpi8042 code from the WDK 6000 but it is fairly long and seems a little outdated.

Thanks,
Jad

------ Original Message ------
From: “Doron Holan” >
To: “Windows System Software Devs Interest List” >
Sent: 2013-04-20 20:15:20
Subject: RE: [ntdev] How to access raw ps/2 touchpad data through kernel mode driver?
This is not a project to learn drivers. Nastiness lies here. You have to work with the native ps2 driver , it provides some hooks but probably not enough to.make the touch pad work. Furthermore, unless elan has given you a spec for their private custom interface, you don’t have much to work with.

Start here, http://msdn.microsoft.com/en-us/library/windows/hardware/ff539982(v=vs.85).aspx

d

Bent from my phone
________________________________
From: xxxxx@jadware.commailto:xxxxx
Sent: ?4/?20/?2013 4:36 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] How to access raw ps/2 touchpad data through kernel mode driver?

I’m writing an alternative ps/2 touchpad driver for a new laptop and having challenges accessing raw data from the device. Started with moufiltr (WDK8) and it works great and kernel debug output is flowing. However, I’m ultimately trying to support multitouch and having a difficult time understanding how to communicate with the device for it. MOUSE_INPUT_DATA is giving me what appears to be processed or standardized mouse input messages. Not able to find out which finger generates the messages or find raw information like pressure.

This kind of raw information probably requires a special protocol with the device and there is a mature linux driver with all that info documented. What I need help with is understanding how to communicate with the device using the Windows KMDF driver. The Linux guys are using functions like ‘ps2_command’ and ‘psmouse_sliced_command’ to read registers. I’m not sure what is the windows equivalent of this or if I am even on the right track.

The linux driver is somehow receiving 4-byte and 6-byte packets after setting a protocol handler on a ‘psmouse’ object. If anyone has any suggestions on how I can ultimately push some bytes over to a ps2 device and then receive some bytes back, that would be a great place to start. Even if it’s just a function name or msdn link on how to manage ps/2 protocol. I’m pretty advanced with C/C++ and embedded development, but new to windows drivers.

The device is an elantech ps/2 touchpad on an Acer Aspire S7 notebook.

Thanks!


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

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

OSR is HIRING!! See http://www.osr.com/careers

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

OSR is HIRING!! See http://www.osr.com/careers

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

OSR is HIRING!! See http://www.osr.com/careers

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

OSR is HIRING!! See http://www.osr.com/careers

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

OSR is HIRING!! See http://www.osr.com/careers

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

OSR is HIRING!! See http://www.osr.com/careers

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></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>

xxxxx@jadware.com wrote:

… MOUSE_INPUT_DATA is giving me what appears to be processed or standardized mouse input messages. Not able to find out which finger generates the messages or find raw information like pressure.

Do you understand that the hardware has no concept of “fingers”? The
device is going to report to you at each time interval that it is being
tickled at a large set of (X,Y) coordinates. It’s up to YOU to figure
out which coordinates should be grouped together (and hence are likely
to be generated from a single finger or stylus), and which coordinates
are likely to be caused by other fingers. Further, it’s also up to you
to track the finger blobs over time. There’s a lot of processing going on.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Right, I’m looking for that raw data. I have to interpret it as fingers
and swipes and gestures, etc. The touchpad will give me raw data but I
have to bump it the initialization sequence to get 4- or 6-byte messages
instead of the normal ps/2 3-byte. This particular hardware does track
individual blobs though and their general size.

Currently using PI8042_ISR_WRITE_PORT to push the init sequence / magic
knock.

Working to figure out the mechanics of my state machine. I am getting
the acknowledge response back from the touchpad, but I guess there’s no
way to know the size of the ps/2 input buffer. So I have to build a
state machine around a single byte processed even if the buffer will
ultimately have 3-6 bytes.

Will probably have data flowing in the next day or two, then I can write
the actual processor.

Another question: in these manufacturer mouse drivers, there is always
bundled a GUI that visualizes how many touches are on the pad and also
show lists of the events… any idea what mechanism the driver is using
to transmit those event messages to the GUI? Some kind of DMA? Or is
there an event model from a driver to a user-mode app?

------ Original Message ------
From: “Tim Roberts”
To: “Windows System Software Devs Interest List”
Sent: 2013-04-22 10:08:00
Subject: Re: [ntdev] How to access raw ps/2 touchpad data through kernel
mode driver?
>xxxxx@jadware.com wrote:
>> … MOUSE_INPUT_DATA is giving me what appears to be processed or
>>standardized mouse input messages. Not able to find out which finger
>>generates the messages or find raw information like pressure.
>
>Do you understand that the hardware has no concept of “fingers”? The
>device is going to report to you at each time interval that it is being
>tickled at a large set of (X,Y) coordinates. It’s up to YOU to figure
>out which coordinates should be grouped together (and hence are likely
>to be generated from a single finger or stylus), and which coordinates
>are likely to be caused by other fingers. Further, it’s also up to you
>to track the finger blobs over time. There’s a lot of processing going
>on.
>
>–
>Tim Roberts, xxxxx@probo.com
>Providenza & Boekelheide, Inc.
>
>
>—
>NTDEV is sponsored by OSR
>
>OSR is HIRING!! See http://www.osr.com/careers
>
>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

Jad Meouchy wrote:

Another question: in these manufacturer mouse drivers, there is always
bundled a GUI that visualizes how many touches are on the pad and also
show lists of the events… any idea what mechanism the driver is using
to transmit those event messages to the GUI? Some kind of DMA? Or is
there an event model from a driver to a user-mode app?

The term DMA never applies to software. They’re just using some kind of
custom driver interface. There are any number of ways to do that. The
driver could accumulate events into an in-memory buffer, then have the
application make a periodic request to go fetch them. You could
probably find out using procmon.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

A touch pad would no more use DMA to send information to an app than a
serial port would use DMA. You’ve already established that the interface
is a ps/2 connector, which cannot do DMA. What the touch-pad does is send
a sequence of bytes in which it encodes its information. If the app has
an interface that lets it read the raw data, it might get it tbat way, or
it might query the driver for “cooked” data, that is, data already reduced
to sone form by the driver. I either case, it would either do aReadFile
on a handle, or a DeviceIoControl, but the fact that you had to ask this
question suggests that this project is going to present you with
significant challenges. I’ve written multitouch apps (back around 1989)
and even the “cooked” data can be challenging to work with (this led to a
PhD dissertation, to give you an idea of the complexity)
joe

Jad Meouchy wrote:
> Another question: in these manufacturer mouse drivers, there is always
> bundled a GUI that visualizes how many touches are on the pad and also
> show lists of the events… any idea what mechanism the driver is using
> to transmit those event messages to the GUI? Some kind of DMA? Or is
> there an event model from a driver to a user-mode app?

The term DMA never applies to software. They’re just using some kind of
custom driver interface. There are any number of ways to do that. The
driver could accumulate events into an in-memory buffer, then have the
application make a periodic request to go fetch them. You could
probably find out using procmon.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

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

> Right, I’m looking for that raw data. I have to interpret it as fingers

and swipes and gestures, etc. The touchpad will give me raw data but I
have to bump it the initialization sequence to get 4- or 6-byte messages
instead of the normal ps/2 3-byte. This particular hardware does track
individual blobs though and their general size.

Currently using PI8042_ISR_WRITE_PORT to push the init sequence / magic
knock.

Working to figure out the mechanics of my state machine. I am getting
the acknowledge response back from the touchpad, but I guess there’s no
way to know the size of the ps/2 input buffer. So I have to build a
state machine around a single byte processed even if the buffer will
ultimately have 3-6 bytes.

Will probably have data flowing in the next day or two, then I can write
the actual processor.

Another question: in these manufacturer mouse drivers, there is always
bundled a GUI that visualizes how many touches are on the pad and also
show lists of the events… any idea what mechanism the driver is using
to transmit those event messages to the GUI? Some kind of DMA? Or is
there an event model from a driver to a user-mode app?
****

Yes. It is called “I/O Completion”. The user-mode app sends a ReadFile
or DeviceIoControl request to the driver, the driver fills in the buffers
with suitable data, and the driver completes the request. What else were
you expecting?
****

------ Original Message ------
From: “Tim Roberts”
> To: “Windows System Software Devs Interest List”
> Sent: 2013-04-22 10:08:00
> Subject: Re: [ntdev] How to access raw ps/2 touchpad data through kernel
> mode driver?
>>xxxxx@jadware.com wrote:
>>> … MOUSE_INPUT_DATA is giving me what appears to be processed or
>>>standardized mouse input messages. Not able to find out which finger
>>>generates the messages or find raw information like pressure.
>>
>>Do you understand that the hardware has no concept of “fingers”? The
>>device is going to report to you at each time interval that it is being
>>tickled at a large set of (X,Y) coordinates. It’s up to YOU to figure
>>out which coordinates should be grouped together (and hence are likely
>>to be generated from a single finger or stylus), and which coordinates
>>are likely to be caused by other fingers. Further, it’s also up to you
>>to track the finger blobs over time. There’s a lot of processing going
>>on.
>>
>>–
>>Tim Roberts, xxxxx@probo.com
>>Providenza & Boekelheide, Inc.
>>
>>
>>—
>>NTDEV is sponsored by OSR
>>
>>OSR is HIRING!! See http://www.osr.com/careers
>>
>>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
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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
>

Thanks for the info, makes sense.

It has been a good 10 years since I’ve been this close to the metal and things have changed a little bit!

xxxxx@flounder.com wrote:

Right, I’m looking for that raw data. I have to interpret it as fingers
and swipes and gestures, etc. The touchpad will give me raw data but I
have to bump it the initialization sequence to get 4- or 6-byte messages
instead of the normal ps/2 3-byte. This particular hardware does track
individual blobs though and their general size.

Currently using PI8042_ISR_WRITE_PORT to push the init sequence / magic
knock.

Working to figure out the mechanics of my state machine. I am getting
the acknowledge response back from the touchpad, but I guess there’s no
way to know the size of the ps/2 input buffer. So I have to build a
state machine around a single byte processed even if the buffer will
ultimately have 3-6 bytes.

Will probably have data flowing in the next day or two, then I can write
the actual processor.

Another question: in these manufacturer mouse drivers, there is always
bundled a GUI that visualizes how many touches are on the pad and also
show lists of the events… any idea what mechanism the driver is using
to transmit those event messages to the GUI? Some kind of DMA? Or is
there an event model from a driver to a user-mode app?
****

Yes. It is called “I/O Completion”. The user-mode app sends a ReadFile
or DeviceIoControl request to the driver, the driver fills in the buffers
with suitable data, and the driver completes the request. What else were
you expecting?
****

------ Original Message ------
From: “Tim Roberts”
> To: “Windows System Software Devs Interest List”
> Sent: 2013-04-22 10:08:00
> Subject: Re: [ntdev] How to access raw ps/2 touchpad data through kernel
> mode driver?
>>xxxxx@jadware.com wrote:
>>> … MOUSE_INPUT_DATA is giving me what appears to be processed or
>>>standardized mouse input messages. Not able to find out which finger
>>>generates the messages or find raw information like pressure.
>>
>>Do you understand that the hardware has no concept of “fingers”? The
>>device is going to report to you at each time interval that it is being
>>tickled at a large set of (X,Y) coordinates. It’s up to YOU to figure
>>out which coordinates should be grouped together (and hence are likely
>>to be generated from a single finger or stylus), and which coordinates
>>are likely to be caused by other fingers. Further, it’s also up to you
>>to track the finger blobs over time. There’s a lot of processing going
>>on.
>>
>>–
>>Tim Roberts, xxxxx@probo.com
>>Providenza & Boekelheide, Inc.
>>
>>
>>—
>>NTDEV is sponsored by OSR
>>
>>OSR is HIRING!! See http://www.osr.com/careers
>>
>>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
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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

OSR is HIRING!! See http://www.osr.com/careers

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

>show lists of the events… any idea what mechanism the driver is using

to transmit those event messages to the GUI?

DirectInput?

Some kind of DMA?

How PS/2 is related to DMA? :slight_smile:


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

A little update: got all communication with the touchpad working great,
but a couple questions remain for any ps/2 geniuses out there:

After I go through a big sequence with the mouse, setting the sampling
rate and whatnot, I get a stream of characters that I can’t quite
interpret, that don’t seem to be prompted from any of my sends: FA AA 00
FA 00 FA FA FA FA FA FA 3C 03 00 FA FA FA FA … 00 FA FA FA
FA FA and then a query_attributes IOCTL gets called in (which I do not
implement), and then it settles down and the mouse works great.

Anyone have enough experience with ps/2 mice to know what that could be?
Should I infer that the mouse is officially ‘ready’ after the query
attributes comes across?

Is there any way to be notified of a byte writing out to the mouse?
I’ve resorted to using a macro to log outgoing bytes, but it seems like
I should be able to intercept the outgoing buffer with some kind of
IOCTL…?

Thanks,
Jad

------ Original Message ------
From: xxxxx@jadware.com
To: “Windows System Software Devs Interest List”
Sent: 2013-04-22 20:46:06
Subject: Re: [ntdev] How to access raw ps/2 touchpad data through kernel
mode driver?
>Thanks for the info, makes sense.
>
>It has been a good 10 years since I’ve been this close to the metal and
>things have changed a little bit!
>
>xxxxx@flounder.com wrote:
>
>> Right, I’m looking for that raw data. I have to interpret it as
>>fingers
>> and swipes and gestures, etc. The touchpad will give me raw data but
>>I
>> have to bump it the initialization sequence to get 4- or 6-byte
>>messages
>> instead of the normal ps/2 3-byte. This particular hardware does
>>track
>> individual blobs though and their general size.
>>
>> Currently using PI8042_ISR_WRITE_PORT to push the init sequence /
>>magic
>> knock.
>>
>> Working to figure out the mechanics of my state machine. I am getting
>> the acknowledge response back from the touchpad, but I guess there’s
>>no
>> way to know the size of the ps/2 input buffer. So I have to build a
>> state machine around a single byte processed even if the buffer will
>> ultimately have 3-6 bytes.
>>
>> Will probably have data flowing in the next day or two, then I can
>>write
>> the actual processor.
>>
>> Another question: in these manufacturer mouse drivers, there is
>>always
>> bundled a GUI that visualizes how many touches are on the pad and
>>also
>> show lists of the events… any idea what mechanism the driver is
>>using
>> to transmit those event messages to the GUI? Some kind of DMA? Or is
>> there an event model from a driver to a user-mode app?
>
>
>Yes. It is called “I/O Completion”. The user-mode app sends a ReadFile
>or DeviceIoControl request to the driver, the driver fills in the
>buffers
>with suitable data, and the driver completes the request. What else
>were
>you expecting?
>

>
>>
>>
>> ------ Original Message ------
>> From: “Tim Roberts”
>> To: “Windows System Software Devs Interest List”
>>
>> Sent: 2013-04-22 10:08:00
>> Subject: Re: [ntdev] How to access raw ps/2 touchpad data through
>>kernel
>> mode driver?
>>>xxxxx@jadware.com wrote:
>>>> … MOUSE_INPUT_DATA is giving me what appears to be processed or
>>>>standardized mouse input messages. Not able to find out which finger
>>>>generates the messages or find raw information like pressure.
>>>
>>>Do you understand that the hardware has no concept of “fingers”? The
>>>device is going to report to you at each time interval that it is
>>>being
>>>tickled at a large set of (X,Y) coordinates. It’s up to YOU to figure
>>>out which coordinates should be grouped together (and hence are
>>>likely
>>>to be generated from a single finger or stylus), and which
>>>coordinates
>>>are likely to be caused by other fingers. Further, it’s also up to
>>>you
>>>to track the finger blobs over time. There’s a lot of processing
>>>going
>>>on.
>>>
>>>–
>>>Tim Roberts, xxxxx@probo.com
>>>Providenza & Boekelheide, Inc.
>>>
>>>
>>>—
>>>NTDEV is sponsored by OSR
>>>
>>>OSR is HIRING!! See http://www.osr.com/careers
>>>
>>>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
>>
>> OSR is HIRING!! See http://www.osr.com/careers
>>
>> 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
>
>OSR is HIRING!! See http://www.osr.com/careers
>
>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
>
>OSR is HIRING!! See http://www.osr.com/careers
>
>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

Figured it out… silly mistake. I forgot to set *ContinueProcessing to
FALSE in the HOOK routine. So after the mouse was initialized, the
(lower driver?) was stepping in with default mouse handling behavior and
resetting the touchpad.

Working great now, getting 6-byte raw finger data and it is beatiful.
Of course the next part is figuring out how to translate them to regular
mouse packets for the OS… any tips? I think I need to use
QueueMousePacket with custom built MOUSE_INPUT_DATA structures?

Thanks for everyone’s help getting to this point, was my first driver
project and somewhat ambitious. I will send out the link to the writeup
and source code soon.

------ Original Message ------
From: “Jad Meouchy”
To: “Windows System Software Devs Interest List”
Sent: 2013-04-29 19:48:25
Subject: Re: [ntdev] How to access raw ps/2 touchpad data through kernel
mode driver?
>A little update: got all communication with the touchpad working great,
>but a couple questions remain for any ps/2 geniuses out there:
>
>After I go through a big sequence with the mouse, setting the sampling
>rate and whatnot, I get a stream of characters that I can’t quite
>interpret, that don’t seem to be prompted from any of my sends: FA AA
>00 FA 00 FA FA FA FA FA FA 3C 03 00 FA FA FA FA … 00 FA FA FA FA FA
>and then a query_attributes IOCTL gets called in (which I do not
>implement), and then it settles down and the mouse works great.
>
>Anyone have enough experience with ps/2 mice to know what that could
>be? Should I infer that the mouse is officially ‘ready’ after the query
>attributes comes across?
>
>Is there any way to be notified of a byte writing out to the mouse?
>I’ve resorted to using a macro to log outgoing bytes, but it seems like
>I should be able to intercept the outgoing buffer with some kind of
>IOCTL…?
>
>Thanks,
>Jad
>
>------ Original Message ------
>From: xxxxx@jadware.com
>To: “Windows System Software Devs Interest List”
>Sent: 2013-04-22 20:46:06
>Subject: Re: [ntdev] How to access raw ps/2 touchpad data through
>kernel mode driver?
>>Thanks for the info, makes sense.
>>
>>It has been a good 10 years since I’ve been this close to the metal
>>and things have changed a little bit!
>>
>>xxxxx@flounder.com wrote:
>>
>>> Right, I’m looking for that raw data. I have to interpret it as
>>>fingers
>>> and swipes and gestures, etc. The touchpad will give me raw data but
>>>I
>>> have to bump it the initialization sequence to get 4- or 6-byte
>>>messages
>>> instead of the normal ps/2 3-byte. This particular hardware does
>>>track
>>> individual blobs though and their general size.
>>>
>>> Currently using PI8042_ISR_WRITE_PORT to push the init sequence /
>>>magic
>>> knock.
>>>
>>> Working to figure out the mechanics of my state machine. I am
>>>getting
>>> the acknowledge response back from the touchpad, but I guess there’s
>>>no
>>> way to know the size of the ps/2 input buffer. So I have to build a
>>> state machine around a single byte processed even if the buffer will
>>> ultimately have 3-6 bytes.
>>>
>>> Will probably have data flowing in the next day or two, then I can
>>>write
>>> the actual processor.
>>>
>>> Another question: in these manufacturer mouse drivers, there is
>>>always
>>> bundled a GUI that visualizes how many touches are on the pad and
>>>also
>>> show lists of the events… any idea what mechanism the driver is
>>>using
>>> to transmit those event messages to the GUI? Some kind of DMA? Or is
>>> there an event model from a driver to a user-mode app?
>>
>>
>>Yes. It is called “I/O Completion”. The user-mode app sends a ReadFile
>>or DeviceIoControl request to the driver, the driver fills in the
>>buffers
>>with suitable data, and the driver completes the request. What else
>>were
>>you expecting?
>>

>>
>>>
>>>
>>> ------ Original Message ------
>>> From: “Tim Roberts”
>>> To: “Windows System Software Devs Interest List”
>>>
>>> Sent: 2013-04-22 10:08:00
>>> Subject: Re: [ntdev] How to access raw ps/2 touchpad data through
>>>kernel
>>> mode driver?
>>>>xxxxx@jadware.com wrote:
>>>>> … MOUSE_INPUT_DATA is giving me what appears to be processed or
>>>>>standardized mouse input messages. Not able to find out which
>>>>>finger
>>>>>generates the messages or find raw information like pressure.
>>>>
>>>>Do you understand that the hardware has no concept of “fingers”? The
>>>>device is going to report to you at each time interval that it is
>>>>being
>>>>tickled at a large set of (X,Y) coordinates. It’s up to YOU to
>>>>figure
>>>>out which coordinates should be grouped together (and hence are
>>>>likely
>>>>to be generated from a single finger or stylus), and which
>>>>coordinates
>>>>are likely to be caused by other fingers. Further, it’s also up to
>>>>you
>>>>to track the finger blobs over time. There’s a lot of processing
>>>>going
>>>>on.
>>>>
>>>>–
>>>>Tim Roberts, xxxxx@probo.com
>>>>Providenza & Boekelheide, Inc.
>>>>
>>>>
>>>>—
>>>>NTDEV is sponsored by OSR
>>>>
>>>>OSR is HIRING!! See http://www.osr.com/careers
>>>>
>>>>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
>>>
>>> OSR is HIRING!! See http://www.osr.com/careers
>>>
>>> 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
>>
>>OSR is HIRING!! See http://www.osr.com/careers
>>
>>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
>>
>>OSR is HIRING!! See http://www.osr.com/careers
>>
>>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
>
>OSR is HIRING!! See http://www.osr.com/careers
>
>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