Having keyboard+mouse problems in QEMU? It's finally fixed!

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
klange
Member
Member
Posts: 679
Joined: Wed Mar 30, 2011 12:31 am
Libera.chat IRC: klange
Discord: klange

Having keyboard+mouse problems in QEMU? It's finally fixed!

Post by klange »

QEMU has had a bug for quite some time now that caused reliable stream corruption for PS/2 devices due to a race in setting flags and delivering interrupts. It's finally been fixed in git. Coincidentally, the day I posted a bug report detailing it, but not in response to that bug report.

For us hobby OS devs, this was an easy one to suffer from as the combination of a scancode set 1 keyboard driver and the regular PS/2 mouse resulted in all sorts of horrible corruption - move the mouse while typing and the both will suffer in painfully obvious ways; but for OSes with more advanced drivers it was more difficult to observe - especially the combination of the "vmmouse" and scancode set 2 completely masked the issue.

Finally, I can play Quake in QEMU again!

As an aside, just before filing the report - and before the fix was committed - I found a viable guest-side workaround, so if you want a functioning driver even with QEMU's former broken implementation, take a look at misaka's shared ps2 interrupt handler (but do note it relies on functionality you may not find on real devices or other VMs, so best to make it optional or detect QEMU before using it).
Post Reply