I can't figure out what I'm doing wrong with this. I've written a PS2 keyboard driver, and it works great in Qemu, Bochs, and VirtualBox, but it doesn't work on a physical machine. It's a really simple driver here is the initialization code:
Code: Select all
register_irq(PS2_KEYBOARD_IRQ, keyboard_irq);
unmask_irq(PS2_KEYBOARD_IRQ);
ps2_enable(0); // enable ps2 port 0
flush_keyboard(); // flush the current buffer
ps2_enable_translation(0); // enable translation on port 0
ps2_enable_interrupt(0); // enable interrupts on port 0
Code: Select all
ps2_disable(0);
ps2_disable(1);
ps2_flush_buffer();
ps2_disable_interrupt(0);
ps2_disable_interrupt(1);
ps2_disable_translation(0);
ps2_disable_translation(1);
if( !ps2_clock_enabled(1) )
ps2_dual_channel = 0;
u8 test = ps2_test();
if( test != 0x55 ){
PANIC("PS/2 Controller Self Test Failed!");
}
if( ps2_dual_channel )
{
ps2_enable(1);
if( ps2_clock_enabled(1) )
ps2_dual_channel = 0;
ps2_disable(1);
}
test = ps2_test_port(0);
if( test != 0x00 ) PANIC("First PS/2 Port Test Failed!");
if( ps2_dual_channel )
{
test = ps2_test_port(1);
if( test != 0x00 )
PANIC("Second PS/2 Port Test Failed!");
}
ps2_enable(0);
if( ps2_dual_channel ) ps2_enable(1);
I am getting no input from the keyboard when I run it on my desktop from a flash drive. Any ideas?