ps2mouse: disable mouse before system shutdown

git-svn-id: svn://kolibrios.org@6241 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2016-02-17 14:20:47 +00:00
parent 6e1bd6d91d
commit a73038cb78
2 changed files with 17 additions and 7 deletions

View File

@ -69,11 +69,14 @@ mouse_cmd:
call kbd_write call kbd_write
cmp ah, 1 cmp ah, 1
je .fail je .fail
cmp [mouse_cmd_byte], 0xF5
je .ok
call mouse_read call mouse_read
cmp al, 0xFA cmp al, 0xFA
jne .noack jne .noack
.ok:
clc clc
ret ret
.noack: .noack:
@ -85,8 +88,8 @@ mouse_cmd:
.fail: .fail:
stc stc
ret ret
mouse_read: mouse_read:
mov [mouse_nr_tries], 100 mov [mouse_nr_tries], 100
.repeat: .repeat:

View File

@ -22,7 +22,10 @@ entry START
proc START c, state:dword, cmdline:dword proc START c, state:dword, cmdline:dword
cmp [state], DRV_ENTRY cmp [state], DRV_ENTRY
jne .nothing je .init
cmp [state], DRV_EXIT
je .fini
jmp .nothing
.init: .init:
; disable keyboard and mouse interrupts ; disable keyboard and mouse interrupts
; keyboard IRQ handler can interfere badly otherwise ; keyboard IRQ handler can interfere badly otherwise
@ -54,12 +57,12 @@ proc START c, state:dword, cmdline:dword
test eax,eax test eax,eax
jnz .stop_try jnz .stop_try
mov [MouseType],MT_3BScroll mov [MouseType],MT_3BScroll
call try_mode_ID4 call try_mode_ID4
test eax,eax test eax,eax
jnz .stop_try jnz .stop_try
mov [MouseType],MT_5BScroll mov [MouseType],MT_5BScroll
.stop_try: .stop_try:
mov al, 0xF4 ; enable data reporting mov al, 0xF4 ; enable data reporting
@ -89,6 +92,10 @@ proc START c, state:dword, cmdline:dword
.nothing: .nothing:
xor eax, eax xor eax, eax
ret ret
.fini:
mov al, 0xF5
call mouse_cmd
ret
.exit: .exit:
mov bl, 0xA7 ; disable mouse interface mov bl, 0xA7 ; disable mouse interface