Hello,
I think there is a typo in the
Mouse Input articleNear the end of the page:
Quote:
If mouseID is 0, send: Set Samplerate 200, Set Samplerate 100, Set Samplerate 80, Get MouseID. If mouseID changed to 3, mouse has a scroll wheel, and is now in 4 byte packet mode.
If mouseID is 3, send: Set Samplerate 200, Set Samplerate 200, Set Samplerate 80, Get MouseID. If mouseID changed to 4, mouse has 5 mouse buttons -- otherwise only 3.
The second thing we should send when mouseID is 3 is certainly "samplerate 100" and not 200, though I'm not sure because the PS/2 chipset is such a strange thing
By the way you should also precise that the three or four packets each trigger a different IRQ12
On first IRQ12 you can only read the first data byte (port 0x60)
On the second you can only read the second data byte, etc.
I've learned this the hard way
![Smile :)](./images/smilies/icon_smile.gif)
Thanks BOCHS logs:
Quote:
00170792000d[KBD ] [mouse] Dx=1 Dy=1 Dz=0
00170792000d[KBD ] mouse_enQ(08)
00170792000d[KBD ] mouse_enQ(01)
00170792000d[KBD ] mouse_enQ(01)
00170850037d[KBD ] [mouse] read from 0x60 returns 0x08
00170850051d[KBD ] num_elements = 0
00170850051d[KBD ] read from port 60h with outb empty
00170850065d[KBD ] num_elements = 0
00170850065d[KBD ] read from port 60h with outb empty
00170850500d[KBD ] service_keyboard: key(from mouse) in internal buffer waiting
00170891288d[KBD ] [mouse] read from 0x60 returns 0x01
00170891302d[KBD ] num_elements = 0
00170891302d[KBD ] read from port 60h with outb empty
00170891316d[KBD ] num_elements = 0
00170891316d[KBD ] read from port 60h with outb empty
00170891500d[KBD ] service_keyboard: key(from mouse) in internal buffer waiting
00170932550d[KBD ] [mouse] read from 0x60 returns 0x01
00170932564d[KBD ] num_elements = 0
00170932564d[KBD ] read from port 60h with outb empty
00170932578d[KBD ] num_elements = 0
00170932578d[KBD ] read from port 60h with outb empty
00170933000d[KBD ] service_keyboard(): no keys waiting