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.
enable_irq(1, keyboardInt, INT_GATE|BITS_32|PRESENT|RING_2);
SendData(0xFF); //Restart keyboard
SendData(0xF4); //Enables keyboard and Scanning
SetRate(KDefault); //Sets default scanning rate]
// if I enable interrups yet the cpu restart
// else it goes on
the funny thing is that it all works in my AMD K6 (586, 133MHz)
void WaitForReady(void) //determines if the keyboard is ready to accept a command
{
volatile long i = MAX_TRYES_FOR_READY;
while(i-- && (inportb(0x64) & 0x02));
}
void WaitForReady(void) //determines if the keyboard is ready to accept a command
{
volatile long i = MAX_TRYES_FOR_READY;
while(i-- && (inportb(0x64) & 0x02));
}
MAX_TRYES_FOR_READY is probably a compile-time constant, and if it's large enough for a 1mhz computer bochs emulates, it might be a little low for the 1000mhz computer your real one is.
You might even have some constants swapped around, I have no experience with the keyboard programming.