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.
I am polling the PS/2 keyboard for scancodes and everything is working apart from the last scancode appears to be read every time I poll the device. I can't see how I can reset it from the wiki, or if I should be doing that at all.
probablypaul wrote:I am polling the PS/2 keyboard for scancodes
Why? You really should be using interrupts instead of polling.
probablypaul wrote:and everything is working apart from the last scancode appears to be read every time I poll the device.
Your inline assembly is wrong. Assuming you can even get it to compile, the compiler assumes it will always read the same value. You should use a function like this:
Why? You really should be using interrupts instead of polling.
Yes, this isn't the way, but I am going from baby steps so am planning on getting to interrupts. I've just ventured out of playing in 16 bit real mode asm and will probably periodically seek refuge back there.
Your inline assembly is wrong. Assuming you can even get it to compile, the compiler assumes it will always read the same value. You should use a function like this:
I have inb/outb functions, I really should just use those - good point. Thanks for the hint about the compiler assuming the same value, I have added the volatile keyword to my inline asm and it works as expected now - no more endlessly repeating characters!