MouClass in grandmaster mode does this. See the source for details.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: S. Drasnin
To: Windows System Software Devs Interest List
Sent: Thursday, August 18, 2005 8:36 PM
Subject: Re: [ntdev] how to expose 2 PS/2 mice at the same time
Cool, that explains a lot about the driver – I didn’t pick up on what the polling rate would have to be. Haven’t found a spec on the intel 8042 part yet or app note, even on the intel site, must go by another name?
It’s amazing you know about that driver, too. Any chance you know how to modify the DDK sample video mirror driver sample not to disable overlay/Direct X support for apps? (Just kidding, unless of course you used to own that sample too, and really know if it’s possible ! Many have tried and all appeared to have failed, according to the newsgroups.)
So, one more question: How does the OS know how to combine two mouse streams into one?
I was assuming you have two separate driver stack, each stack looking like the stack indicated in MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intinput/hh/intinput/km-ovr_c81f3fa0-a080-4356-a5db-09c7da5b7353.xml.asp
Some how the stacks or data path (?) need to combine so the OS treats both mouse streams as mouse input regardless of the source. Ideally if you could talk in terms of the device object stacks (if that makes sense), that would be most helpful for me.
thanks!!!
----- Original Message -----
From: Doron Holan
To: Windows System Software Devs Interest List
Sent: Tuesday, August 16, 2005 10:25 PM
Subject: RE: [ntdev] how to expose 2 PS/2 mice at the same time
You don’t want to be continuously polling the ports, that would kill system perf. The ps2 interface is also an interrupt, one for the keyboard and one for the mouse. The ISR is hooked up to the mouse interrupt. The ISR fires every time there is a mouse packet to report, the ISR is called once for each byte in the packet (3 bytes for a normal mouse, 4 bytes for a wheel mouse).
You could probably get away with using i8042prt source, but there will be some modifications you need to make. I8042prt makes sure that it has both the keyboard and mouse before initializing the controller during start device, you don’t need to do that b/c there is no keyboard. Also, the power up code does the same thing. Basically, you will be removing a lot of code.
You will get a found new hw popup when the machine boots up the first time, but this sounds like a specialized system to begin with if you can modify the bios to enumerate your device in the first place.
D
From: xxxxx@listsosr.com [mailto:xxxxx@lists.osr.com] On Behalf Of S. Drasnin
Sent: Tuesday, August 16, 2005 9:19 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] how to expose 2 PS/2 mice at the same time
hi
The 2nd mouse would expose a PS/2 interface but with a different interrupt and different port address (not 0x60, x64).
When you boot up for the first time, would it pop up a new hardware found dialog or would I have to manually install the driver/inf through the Add Hardware applet in the Control Panel? Or something else?
Would you suggest a different driver model to use instead of the i8042 driver model, perhaps the hid mini driver model? (I don’t have an indepth understanding of either yet.)
Thanks for the heads up on the driver being less than ideal. I took a look at the high level look at the ii8042 driver sample last week and I didn’t understand why there was ISR handling code in there given that it’s doing port i/o to talk to the driver. I also saw some #if or #ifdefs for polling versus ISRs. What interrupt is this ISR tied to that there needs to be an ISR? (I figured I had to just go thru all the code in gory detail to figure it out.)
I was hoping I could just rename the sources file for the i8042 port sample and recompiile it and it would work out of the box. Maybe that’s a pipe dream.
thanks for the replies…
----- Original Message -----
From: Doron Holan
To: Windows System Software Devs Interest List
Sent: Tuesday, August 16, 2005 2:58 PM
Subject: RE: [ntdev] how to expose 2 PS/2 mice at the same time
You need to use a different hardware ID (ie the pnp0x0y). I think MSFT used to hand out ISA PNPXxxx IDs, but we don’t any longer. In reality, you can put whatever you want in the hardware ID string within reason. Put your company name + model number and you’ll be OK.
The i8042prt example is one of the worst samples to learn from (I used to own this driver ;)). It is there b/c it is a working mouse and keyboard port driver. Unless your device behaves like ps2 at the hw level, I would not use this driver as a model of talking to your hw
d
From: xxxxx@listsosr.com [mailto:xxxxx@lists.osr.com] On Behalf Of S. Drasnin
Sent: Tuesday, August 16, 2005 2:52 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] how to expose 2 PS/2 mice at the same time
hi
I have another question about the bios-modification route, using my own version of the sample i8042prt driver for the 2nd PS/2 mouse.
I’m concerned that the OS won’t be able to distinguish between two PS/2 mouse devices in the same table. In the table, I would have the same PNP0X0Y value (where X and Y are hex digits) and different I/O range and IRQs. Will the OS be able to enumerate two separate mice given that they share the same PNP0x0Y value? Also, how will it know to load a different driver (my driver) for the 2nd device? Is there some other unique ID that is used for this? If so, where does this unique ID come for/where is it stored?
thanks in advance…
----- Original Message -----
From: Doron Holan
To: Windows System Software Devs Interest List
Sent: Wednesday, August 10, 2005 12:24 PM
Subject: RE: [ntdev] how to expose 2 PS/2 mice at the same time
-
If you have control over the bios add an entry in the ACPI table for your device, acpi will enumerate your device and assign the required resources (ie not the ps2 ports) to your device (based on the acpi table settings). What class the PDO is installed under is up to the INF that installs the driver on top of the PDO. The class of the INF depends on the answer to number 2). No filter driver is involved.
-
you have two options here. One is your FDO is a hid miniport (INF class is HID), the other is your FDO is a mouse port driver (INF is mouse and pointers class). Which you choose depends on what you want to do. In either case, you are going to convert your input data into another form.
For a mouse port, you would convert it to MOUSE_INPUT_DATA and report it to mouclass. You will have to support 2 or 3 IOCTLs and you are done. This will be the only thing your driver will be able to report to the OS. This is a more simple driver.
For a HID miniport, you will have to create a fake HID descriptor and you will convert your data into a HID report. HIDClass will enumerate the mouse stack on your behalf (which will load mouhid.sys which is the same driver which runs the USB HID mouse). This is more complicated, but you can enumerate other top level collections and have other forms of communication to/from the device.
d
From: xxxxx@listsosr.com [mailto:xxxxx@lists.osr.com] On Behalf Of S. Drasnin
Sent: Wednesday, August 10, 2005 10:19 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] how to expose 2 PS/2 mice at the same time
thanks for the great info!
(1) If I had control of the hardware and the bios, and I mapped the 2nd ps/2 style mouse to a different port than the standard port 0x60, could the root bus driver then automatically enumerate a 2nd PDO for me? Would this work? Would that 2nd PDO get installed under the mouse and pointers device class? Would the data transfer work without me needing to add a filter driver?
If this would work, how does the root bus driver know how to enumerate the first PDO (corresponding to port 0x60) and if this can be extended to enumerate more than one.
(2) What if I tried to expose the 2nd mouse as a HID class type of device (attached to a port, not to the usb bus)? How would you compare this to the approach below? (It seems like I would need to implement a HID minidriver and convert the PS/2 style data coming from the port to whatever HID format was expected…but I don’t know what else I would have to do or if this approach would buy me anything…) If I took this approach could I encapsulate all the added work in the minidriver itself w/o having to add a filter driver, etc?
thanks
----- Original Message -----
From: Doron Holan
To: Windows System Software Devs Interest List
Sent: Wednesday, August 10, 2005 8:04 AM
Subject: RE: [ntdev] how to expose 2 PS/2 mice at the same time
The OS supports N number of mice, the OS doesn’t care where they came from. Why does your second mouse have to PS2? Let me guess, you have some wacko connector or device on the port…i don’t want to know really ;). If all you want to do is create a virtual mouse so that you can inject packets, that is a different question…
Getting another mouse enumerated is not a big deal. You can insert yourself as a device upper filter on the ps2 mouse devstack and then in your filter enumerate another PDO. That PDO will also be installed under the mouse and pointers device class. The PDO can contain all the logic for being a mouse port if you want, or you can load an FDO between your filter’s enumerated PDO and mouclass.
Now, if your 2nd device is reporting data through the ps2 ports, how are you going to get your data? How are you going to initialize your device? I8042prt allows a device filter to supply an ISR hook routine so you can use that. It doesn’t provide a mouse init routine though IIRC. You would get the data from the ISR hook, queue your own DPC and then shuttle off that data to the new stack.
d
From: xxxxx@listsosr.com [mailto:xxxxx@lists.osr.com] On Behalf Of S. Drasnin
Sent: Tuesday, August 09, 2005 10:46 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] how to expose 2 PS/2 mice at the same time
hi
I have a rather unusual question to ask about the OS support for multiple PS/2 style mice.
Is there a way to make an XP (Service Pack 2) PC support 2 PS/2 mice by doing some driver magic? (I know this isn’t normally supported.)
My primary reason for sending this email is not how the two PS/2 ports get exposed in hardware. For now, I’m more concerned with what it takes to make the OS upper portion (above the driver that talks to the hardware) of the mouse PS/2 device object stack support 2 PS/2 mice at the same time. The goal would be that the user would see two different mice on the Device’s tab on the control panel mouse applet, but the user could use either mice to move the mouse cursor around, etc. (like they would be able to do if they had a usb mouse and a PS/2 style mouse connected to their PC). So, multiplexing the data from one port is not what I’m asking about (I saw a interesting posting by Doron on this one…though).
I was thinking that perhaps another non-HID class device object stack similar to the one described in MSDN (I pasted in the link below) in which there is a mouse PDO created by a root bus driver, and on top of that a mouse function DO created by a i8042prt, and on top of that a upper-level mouse filter D0, and finally on top of that a upper-level class filter DO created by mouseclass might work. I thought I could perhaps create another i8042prt device object (the associated driver would deal would abstract out the details of talking to the mouse hardware) for the second PS/2 port and then build up another stack (or a partial one).
But, then, I think that the OS expects only one mouse PDO / mouse function D0 pair in one device object chain so I don’t know how you could expose 2 PS/2 style mice. Though, it gives me hope that XP supports one PS/2 mouse and one USB mouse and that these get exposed as two difference mice in the control panel applet (I think) - this support probably had to get added once USB mice and/or keyboards came along.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intinput/hh/intinput/km-ovr_c81f3fa0-a080-4356-a5db-09c7da5b7353.xml.asp
I could also think of a big hack that might work - trying to expose the 2nd PS/2 mouse in the same manner as a a USB mouse gets exposed (so you have the 1st mouse exposed as a PS/2 style mouse and the 2nd one as a USB mouse) but I probably don’t want to go there. Any comments on this approach as well?
If you think there is a way to expose two PS/2 style mice, please could you outline what I would need to do in terms of the device object stack, such as where I would put in a filter driver (for example) and what it would need to do, etc. or if I need to do something out of desperation, such as hook a system driver (not that I would want to do that, but I’m interested in hearing about solutions).
thanks in advance…
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@listsosr.com
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@listsosr.com
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@listsosr.com
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@listsosr.com
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@listsosr.com
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@listsosr.com
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@listsosr.com
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@listsosr.com
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com