Keyboard in QEMU extremly slow

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.
User avatar
Muazzam
Member
Member
Posts: 543
Joined: Mon Jun 16, 2014 5:59 am
Location: Shahpur, Layyah, Pakistan

Re: Keyboard in QEMU extremly slow

Post by Muazzam »

SpyderTL wrote: That's up to you, but I would start by changing .scanCode from a 32-bit number to an array of 32 bit numbers. Then change the .keyboardChanged variable from a Boolean 32-bit number to a counter. (i.e. change mov [.keyboardChanged], 1 to inc [.keyboardChanged]).

Then just loop through the .scanCode array using the count from the .keyboardChanged counter, and read the scan codes. Then when you are done, you can just set the .keyboardChanged back to 0.

In your INT 0x01 handler, you will need to use the .keyboardChanged counter to figure out where to store the scan code in the .scanCode array.

This is the easiest solution I can think of, given your current code. It should be usable until you decide to replace it with something a lot more complex, like a keyboard driver and an event system.
Thanks for help.
User avatar
Muazzam
Member
Member
Posts: 543
Joined: Mon Jun 16, 2014 5:59 am
Location: Shahpur, Layyah, Pakistan

Re: Keyboard in QEMU extremly slow

Post by Muazzam »

SpyderTL wrote: But just remember that this code will probably need to be redesigned at some point in the future.
You were right then. I have changed my code to implement buffer (array) today.
Post Reply