Is there any classic PS/2 mouse init code works in PMode?
Posted: Mon Jun 04, 2007 10:17 pm
Is there any classic PS/2 mouse init code works in PMode, without disabling Keyboard interrupt? The init code I wrote works fine in BOCHS.
The keyboard dies when enabling the mouse IRQ12 bit, but the mouse works fine alone.
IBF8042: nop,,nop,,nop,,nop,,nop
in al,PS2_Port_Status
test al,PS2_KB_Bit_IBF
jnz IBF8042
ret
OBF8042: nop,,nop,,nop,,nop,,nop
in al,PS2_Port_Status
test al,PS2_KB_Bit_OBF
jz OBF8042
ret
call IBF8042
mov al,0x20
out PS2_Port_Command,al
call IBF8042
in al,PS2_Port_Data
or al,00000011b
push eax
call IBF8042
mov al,0x60
out PS2_Port_Command,al
call IBF8042
pop eax
out PS2_Port_Data,al
The keyboard dies when enabling the mouse IRQ12 bit, but the mouse works fine alone.
IBF8042: nop,,nop,,nop,,nop,,nop
in al,PS2_Port_Status
test al,PS2_KB_Bit_IBF
jnz IBF8042
ret
OBF8042: nop,,nop,,nop,,nop,,nop
in al,PS2_Port_Status
test al,PS2_KB_Bit_OBF
jz OBF8042
ret
call IBF8042
mov al,0x20
out PS2_Port_Command,al
call IBF8042
in al,PS2_Port_Data
or al,00000011b
push eax
call IBF8042
mov al,0x60
out PS2_Port_Command,al
call IBF8042
pop eax
out PS2_Port_Data,al