2005-10-06 21:56:22 +04:00
|
|
|
|
;**************************************************
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* COMPortNum <EFBFBD> COMPortBaseAddr <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;**************************************************
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Mario79
|
|
|
|
|
|
2006-01-06 14:46:26 +03:00
|
|
|
|
Detect_COM_Mouse:
|
2005-10-06 21:56:22 +04:00
|
|
|
|
pusha
|
2006-01-06 14:46:26 +03:00
|
|
|
|
call MSMouseSearch
|
|
|
|
|
cmp AL,'M'
|
|
|
|
|
jne @f
|
|
|
|
|
mov [com1_mouse_detected],1
|
2006-03-11 21:10:47 +03:00
|
|
|
|
pusha
|
|
|
|
|
|
|
|
|
|
mov eax,4
|
|
|
|
|
shl eax,2
|
|
|
|
|
mov [irq_owner+eax],byte 1
|
|
|
|
|
|
|
|
|
|
inc dword [0x2d0000]
|
|
|
|
|
mov edi,[0x2d0000]
|
|
|
|
|
shl edi,4
|
|
|
|
|
mov [0x2d0000+edi+0],dword 1
|
|
|
|
|
mov [0x2d0000+edi+4],dword 0x3f0
|
|
|
|
|
mov [0x2d0000+edi+8],dword 0x3ff
|
|
|
|
|
|
|
|
|
|
popa
|
2006-01-06 14:46:26 +03:00
|
|
|
|
mov esi,boot_setmouse_type+22
|
|
|
|
|
call boot_log
|
|
|
|
|
@@:
|
|
|
|
|
sub [COMPortBaseAddr],100h
|
|
|
|
|
call MSMouseSearch
|
|
|
|
|
cmp AL,'M'
|
|
|
|
|
jne @f
|
|
|
|
|
mov [com2_mouse_detected],1
|
2006-03-11 21:10:47 +03:00
|
|
|
|
pusha
|
|
|
|
|
|
|
|
|
|
mov eax,3
|
|
|
|
|
shl eax,2
|
|
|
|
|
mov [irq_owner+eax],byte 1
|
|
|
|
|
|
|
|
|
|
inc dword [0x2d0000]
|
|
|
|
|
mov edi,[0x2d0000]
|
|
|
|
|
shl edi,4
|
|
|
|
|
mov [0x2d0000+edi+0],dword 1
|
|
|
|
|
mov [0x2d0000+edi+4],dword 0x2f0
|
|
|
|
|
mov [0x2d0000+edi+8],dword 0x2ff
|
|
|
|
|
|
|
|
|
|
popa
|
2006-01-06 14:46:26 +03:00
|
|
|
|
mov esi,boot_setmouse_type+44
|
|
|
|
|
call boot_log
|
|
|
|
|
@@:
|
|
|
|
|
popa
|
|
|
|
|
jmp end_detecting_mouse
|
|
|
|
|
|
|
|
|
|
MSMouseSearch:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> COM-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2005-10-06 21:56:22 +04:00
|
|
|
|
MouseSearch:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1200 <EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov DX,[COMPortBaseAddr]
|
|
|
|
|
add DX,3
|
|
|
|
|
in AL,DX
|
|
|
|
|
or AL,80h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> DLAB
|
|
|
|
|
out DX,AL
|
|
|
|
|
mov DX,[COMPortBaseAddr]
|
|
|
|
|
mov AL,60h ;1200 <EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
out DX,AL
|
|
|
|
|
inc DX
|
|
|
|
|
mov AL,0
|
|
|
|
|
out DX,AL
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 7 <EFBFBD><EFBFBD><EFBFBD>, 1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>,
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov DX,[COMPortBaseAddr]
|
|
|
|
|
add DX,3
|
|
|
|
|
mov AL,00000010b
|
|
|
|
|
out DX,AL
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov DX,[COMPortBaseAddr]
|
|
|
|
|
inc DX
|
|
|
|
|
mov AL,0
|
|
|
|
|
out DX,AL
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> MSMouse
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov DX,[COMPortBaseAddr]
|
|
|
|
|
add DX,4 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov AL,0 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DTR, RTS <EFBFBD> OUT2
|
|
|
|
|
out DX,AL
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 5 "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" (0,2 <EFBFBD>)
|
|
|
|
|
mov ecx,0xffff
|
|
|
|
|
dT_1:
|
|
|
|
|
dec ecx
|
|
|
|
|
cmp ecx,0
|
|
|
|
|
jne dT_1
|
2006-01-06 14:46:26 +03:00
|
|
|
|
mov ecx,0xffff
|
2005-10-06 21:56:22 +04:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov AL,11b ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DTR <EFBFBD> RTS
|
|
|
|
|
out DX,AL
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov DX,[COMPortBaseAddr]
|
|
|
|
|
in AL,DX
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
WaitData:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> 10 "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
|
|
|
|
dec ecx
|
|
|
|
|
cmp ecx,0
|
|
|
|
|
je NoMouse
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov DX,[COMPortBaseAddr]
|
|
|
|
|
add DX,5
|
|
|
|
|
in AL,DX
|
|
|
|
|
test AL,1 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|
|
|
|
jz WaitData
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov DX,[COMPortBaseAddr]
|
|
|
|
|
in AL,DX
|
|
|
|
|
NoMouse:
|
2006-01-06 14:46:26 +03:00
|
|
|
|
ret
|
2005-10-06 21:56:22 +04:00
|
|
|
|
|
|
|
|
|
iglobal
|
|
|
|
|
COMPortBaseAddr dw 3F8h
|
2006-01-06 14:46:26 +03:00
|
|
|
|
;COMPortNum dw 0
|
2005-10-06 21:56:22 +04:00
|
|
|
|
endg
|
|
|
|
|
|
|
|
|
|
iglobal
|
2006-01-06 14:46:26 +03:00
|
|
|
|
boot_setmouse_type db 'Detected - PS2 mouse',0
|
2005-10-06 21:56:22 +04:00
|
|
|
|
db 'Detected - COM1 mouse',0
|
|
|
|
|
db 'Detected - COM2 mouse',0
|
|
|
|
|
endg
|
|
|
|
|
|
2006-01-06 14:46:26 +03:00
|
|
|
|
end_detecting_mouse:
|
2005-10-06 21:56:22 +04:00
|
|
|
|
|