Klakap wrote:
BIOS with legacy support turned on should emulate connected USB keyboard and USB mouse as ps/2 keyboard and ps/2 mouse. So I would suspect that something is wrong with your ps/2 mouse driver. What about showing your code so we can take look on it?
thanks Klakap for the reply. Ps/2 mouse is working but usb mouse is not. my code is like below
this it the init part
Code:
#define wait_KB_write() while(inb(PORT_KB_STATUS) & KBSTATUS_IBF)
Code:
wait_KB_write();
kbd_write_command(0xA8);
wait_KB_write();
kbd_write_command(0xD4);
wait_KB_write();
kbd_write_output(0xF4);
wait_KB_write();
kbd_write_command(0x60);
wait_KB_write();
kbd_write_output(0x47);
this part is the interrupt handling
Code:
static inline void handle_mouse_event(unsigned char scancode)
{
if (mouse_reply_expected) {
if (scancode == AUX_ACK) {
mouse_reply_expected--;
printk("mouse ack is %x\n", scancode);
return;
}
else
{
printk("ERROR:mouse ack is %x\n", scancode);
mouse_reply_expected--;
return;
}
mouse_reply_expected = 0;
}
if (aux_count) {
int head = queue->head;
queue->buf[head] = scancode;
head = (head + 1) & (AUX_BUF_SIZE-1);
if (head != queue->tail) {
queue->head = head;
}
/* if the input queue is active, add to it */
if( driver_input_handler_ps2 ) {
driver_input_handler_ps2( &scancode, 1 );
} else {
/* post this byte to termios */
//rtems_termios_enqueue_raw_characters( termios_ttyp_paux, (char *)&scancode, 1 );
}
}
}
/*
* This reads the keyboard status port, and does the
* appropriate action.
*
* It requires that we hold the keyboard controller
* spinlock.
*/
static unsigned char handle_kbd_event(void)
{
unsigned char status = kbd_read_status();
unsigned int work = 10000;
while (status & KBD_STAT_OBF) {
unsigned char scancode;
scancode = kbd_read_input();
if (status & KBD_STAT_MOUSE_OBF)
{
handle_mouse_event(scancode);
}
else
{
printk("pc_keyb: %X ", scancode );
}
status = kbd_read_status();
if(!work--) {
printk("pc_keyb: controller jammed (0x%02X).\n", status);
break;
}
}
return status;
}
static void ps2_mouse_interrupt(void * unused)
{
handle_kbd_event();
}
after this is done , I cannot receive any usb mouse data stream.