Keyboard Interrupt Handler Issue
Posted: Sun Jun 03, 2012 3:53 pm
For some reason when I try which should output "4 was pressed" instead I get nothing and when I type I get " was pressed". Another thing is when I try to just use the key board the interrupt won't register unless I try to enable the floppy drive, which my driver for it isn't working and goes somewhere into an infinite loop. Even more oddly when it works with the floppy every time I press a key there's a space or unwanted character inbetween. A saw on a post somewhere else I saw that when you enable the pit and keyboard without multitasking it might cause some errors so I only enable the keyboard and I get the same error.
Here's my code.
Code: Select all
outb(0x60, 0x3);
Code: Select all
outb(0x60, 0x3);
outb(0x60, 0x4);
Here's my code.
Code: Select all
static void keyboard_handler(registers_t regs)
{
if(get_status_reg() & output_buffer_full)
{
uint8 key_pressed = get_keyboard_en_input_buffer();
if(key_pressed == 0xE0)
{
printf("No Support for this key yet\n");
return;
}
print_c(keymap[key_pressed]);
printf(" was pressed\n");
}
}