PS/2 Mouse Problem
Posted: Fri Jul 14, 2006 4:13 pm
I have enabled the mouse in every possible way. I have remapped the PICs to 0x30 for master and 0x38 for slave. I'm in protected mode. The keyboard and mouse is unmasked - Everything else is masked. (0xfd for port 0x21 and 0xef for port 0xa1). I have a mouse and keyboard handler. I also have a "everything else" handler, just incase.
The keyboard works. When I move the mouse, no interrupt comes in and the keyboard stops working. I tried debugging it with Bochs. Before I move the mouse and I push a key, the following is debugged:
00012824000d[KBD ] gen_scancode(): BX_KEY_T pressed
00012824000d[KBD ] gen_scancode(): writing translated 14
00012824000d[KBD ] kbd_enQ(0x14)
00012824000d[KBD ] kbd_enQ: putting scancode 0x14 in internal buffer
00012824000d[KBD ] activating timer...
00012824000d[KBD ] service_keyboard: key in internal buffer waiting
00012824500d[IOAP ] set_irq_level(): INTIN1: level=1
00012824500d[IOAP ] IOAPIC: servicing
00012824500d[IOAP ] service_ioapic(): INTIN0 is masked
00012824500d[IOAP ] service_ioapic(): INTIN1 is masked
00012824500d[IOAP ] service_ioapic(): INTIN6 is masked
00012824500d[PIC ] IRQ line 1 now high
00012824500d[PIC ] signalling IRQ(1)
00012824500d[CPU0 ] interrupt(): vector = 49, INT = 0, EXT = 1
00012824500d[CPU0 ] int_trap_gate286(): INTERRUPT TO SAME PRIVILEGE
When I move the mouse, I get the following:
00030898000d[KBD ] [mouse] Dx=-1 Dy=0 Dz=0
00030898000d[KBD ] mouse_enQ(18)
00030898000d[KBD ] mouse_enQ(ff)
00030898000d[KBD ] mouse_enQ(00)
00030898000d[KBD ] service_keyboard: key(from mouse) in internal buffer waiting
00030898500d[IOAP ] set_irq_level(): INTIN12: level=1
00030898500d[IOAP ] IOAPIC: servicing
00030898500d[IOAP ] service_ioapic(): INTIN0 is masked
00030898500d[IOAP ] service_ioapic(): INTIN1 is masked
00030898500d[IOAP ] service_ioapic(): INTIN6 is masked
00030898500d[IOAP ] service_ioapic(): INTIN12 is masked
00030898500d[PIC ] IRQ line 12 now high
00030898500d[PIC ] slave: signalling IRQ(12)
00030898500d[PIC ] IRQ line 2 now high
As you can see, the CPU0 information is missing.
The second time a signal comes from the mouse, this is the only thing debugged:
00031096000d[KBD ] [mouse] Dx=-2 Dy=0 Dz=0
After the mouse is moved and I push a key, the following is debugged:
00036604000d[KBD ] gen_scancode(): BX_KEY_T pressed
00036604000d[KBD ] gen_scancode(): writing translated 14
00036604000d[KBD ] kbd_enQ(0x14)
00036604000d[KBD ] kbd_enQ: putting scancode 0x14 in internal buffer
What have I done wrong that is causing my mouse to not be able to cause an interrupt? Everything seems to be enabled and unmasked..
The keyboard works. When I move the mouse, no interrupt comes in and the keyboard stops working. I tried debugging it with Bochs. Before I move the mouse and I push a key, the following is debugged:
00012824000d[KBD ] gen_scancode(): BX_KEY_T pressed
00012824000d[KBD ] gen_scancode(): writing translated 14
00012824000d[KBD ] kbd_enQ(0x14)
00012824000d[KBD ] kbd_enQ: putting scancode 0x14 in internal buffer
00012824000d[KBD ] activating timer...
00012824000d[KBD ] service_keyboard: key in internal buffer waiting
00012824500d[IOAP ] set_irq_level(): INTIN1: level=1
00012824500d[IOAP ] IOAPIC: servicing
00012824500d[IOAP ] service_ioapic(): INTIN0 is masked
00012824500d[IOAP ] service_ioapic(): INTIN1 is masked
00012824500d[IOAP ] service_ioapic(): INTIN6 is masked
00012824500d[PIC ] IRQ line 1 now high
00012824500d[PIC ] signalling IRQ(1)
00012824500d[CPU0 ] interrupt(): vector = 49, INT = 0, EXT = 1
00012824500d[CPU0 ] int_trap_gate286(): INTERRUPT TO SAME PRIVILEGE
When I move the mouse, I get the following:
00030898000d[KBD ] [mouse] Dx=-1 Dy=0 Dz=0
00030898000d[KBD ] mouse_enQ(18)
00030898000d[KBD ] mouse_enQ(ff)
00030898000d[KBD ] mouse_enQ(00)
00030898000d[KBD ] service_keyboard: key(from mouse) in internal buffer waiting
00030898500d[IOAP ] set_irq_level(): INTIN12: level=1
00030898500d[IOAP ] IOAPIC: servicing
00030898500d[IOAP ] service_ioapic(): INTIN0 is masked
00030898500d[IOAP ] service_ioapic(): INTIN1 is masked
00030898500d[IOAP ] service_ioapic(): INTIN6 is masked
00030898500d[IOAP ] service_ioapic(): INTIN12 is masked
00030898500d[PIC ] IRQ line 12 now high
00030898500d[PIC ] slave: signalling IRQ(12)
00030898500d[PIC ] IRQ line 2 now high
As you can see, the CPU0 information is missing.
The second time a signal comes from the mouse, this is the only thing debugged:
00031096000d[KBD ] [mouse] Dx=-2 Dy=0 Dz=0
After the mouse is moved and I push a key, the following is debugged:
00036604000d[KBD ] gen_scancode(): BX_KEY_T pressed
00036604000d[KBD ] gen_scancode(): writing translated 14
00036604000d[KBD ] kbd_enQ(0x14)
00036604000d[KBD ] kbd_enQ: putting scancode 0x14 in internal buffer
What have I done wrong that is causing my mouse to not be able to cause an interrupt? Everything seems to be enabled and unmasked..