2006-01-06 12:46:26 +01:00
|
|
|
|
MouseSearch_PS2:
|
|
|
|
|
|
|
|
|
|
pusha
|
2006-03-07 10:52:43 +01:00
|
|
|
|
mov bl, 0xAD
|
|
|
|
|
call kb_cmd
|
2006-01-06 12:46:26 +01:00
|
|
|
|
|
|
|
|
|
mov bl,0xa8 ; enable mouse cmd
|
|
|
|
|
call kb_cmd
|
|
|
|
|
cmp ah,1
|
|
|
|
|
je @@DataInputError
|
|
|
|
|
|
|
|
|
|
mov bl,0xd4 ; for mouse
|
|
|
|
|
call kb_cmd
|
|
|
|
|
cmp ah,1
|
|
|
|
|
je @@DataInputError
|
|
|
|
|
mov al,0xeb ;
|
|
|
|
|
call kb_write
|
|
|
|
|
cmp ah,1
|
|
|
|
|
je @@DataInputError
|
|
|
|
|
call kb_read ; Acknowledge
|
|
|
|
|
call kb_read
|
|
|
|
|
mov [ps2_mouse_detected],0
|
2006-03-07 10:52:43 +01:00
|
|
|
|
test al,18h
|
2006-01-06 12:46:26 +01:00
|
|
|
|
jz @f
|
|
|
|
|
mov [ps2_mouse_detected],1
|
|
|
|
|
@@:
|
|
|
|
|
call kb_read ;
|
|
|
|
|
call kb_read ;
|
|
|
|
|
|
|
|
|
|
mov bl,0x20 ; get command byte
|
|
|
|
|
call kb_cmd
|
|
|
|
|
cmp ah,1
|
|
|
|
|
je @@DataInputError
|
|
|
|
|
call kb_read
|
|
|
|
|
cmp ah,1
|
|
|
|
|
je @@DataInputError
|
|
|
|
|
or al,3 ; enable interrupt
|
|
|
|
|
mov bl,0x60 ; write command
|
|
|
|
|
push eax
|
|
|
|
|
call kb_cmd
|
|
|
|
|
pop eax
|
|
|
|
|
call kb_write
|
|
|
|
|
cmp ah,1
|
|
|
|
|
je @@DataInputError
|
|
|
|
|
|
|
|
|
|
mov bl,0xd4 ; for mouse
|
|
|
|
|
call kb_cmd
|
|
|
|
|
cmp ah,1
|
|
|
|
|
je @@DataInputError
|
|
|
|
|
mov al,0xf4 ; enable mouse device
|
|
|
|
|
call kb_write
|
|
|
|
|
cmp ah,1
|
|
|
|
|
je @@DataInputError
|
|
|
|
|
call kb_read ; read status return
|
|
|
|
|
cmp ah,1
|
|
|
|
|
je @@DataInputError
|
|
|
|
|
cmp AL,0FAh
|
|
|
|
|
jnz @@DataInputError ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
@@DataInputError:
|
|
|
|
|
cmp [ps2_mouse_detected],0
|
|
|
|
|
je @f
|
|
|
|
|
mov esi,boot_setmouse_type
|
|
|
|
|
call boot_log
|
|
|
|
|
@@:
|
2006-03-07 10:52:43 +01:00
|
|
|
|
mov bl, 0xAE
|
|
|
|
|
call kb_cmd
|
2006-01-06 12:46:26 +01:00
|
|
|
|
popa
|
|
|
|
|
|