Subversion Repositories Kolibri OS

Rev

Rev 465 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 465 Rev 473
Line 1... Line 1...
1
$Revision: 465 $
1
$Revision: 473 $
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3
;;                                                              ;;
3
;;                                                              ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
5
;; Distributed under terms of the GNU General Public License    ;;
5
;; Distributed under terms of the GNU General Public License    ;;
6
;;                                                              ;;
6
;;                                                              ;;
Line 19... Line 19...
19
        pusha
19
        pusha
20
        call   MSMouseSearch
20
        call   MSMouseSearch
21
        cmp    AL,'M'
21
        cmp    AL,'M'
22
        jne    @f
22
        jne    @f
23
        mov    [com1_mouse_detected],1
23
        mov    [com1_mouse_detected],1
24
        pusha
24
        mov     [irq_owner+4*4], 1      ; IRQ4 owner is System
25
 
-
 
26
        mov   eax,4
25
        mov     eax, [RESERVED_PORTS]
27
        shl   eax,2
26
        inc     eax
28
        mov   [irq_owner+eax], 1
-
 
29
 
-
 
30
        inc   dword [RESERVED_PORTS]
-
 
31
        mov   edi,[RESERVED_PORTS]
27
        mov     [RESERVED_PORTS], eax
32
        shl   edi,4
28
        shl     eax, 4
33
        mov   [RESERVED_PORTS+edi+0],dword 1
29
        mov     [RESERVED_PORTS+eax+0], dword 1
34
        mov   [RESERVED_PORTS+edi+4],dword 0x3f0
30
        mov     [RESERVED_PORTS+eax+4], dword 0x3F8
35
        mov   [RESERVED_PORTS+edi+8],dword 0x3ff
31
        mov     [RESERVED_PORTS+eax+8], dword 0x3FF
36
 
-
 
37
        popa
-
 
38
        mov    esi,boot_setmouse_type+22
32
        mov    esi,boot_setmouse_type+22
39
        call  boot_log
33
        call  boot_log
40
     @@:
34
     @@:
41
        sub    [COMPortBaseAddr],100h
35
        sub    [COMPortBaseAddr],100h
42
        call   MSMouseSearch
36
        call   MSMouseSearch
43
        cmp    AL,'M'
37
        cmp    AL,'M'
44
        jne    @f
38
        jne    @f
45
        mov    [com2_mouse_detected],1
39
        mov    [com2_mouse_detected],1
46
        pusha
40
        mov     [irq_owner+3*4], 1      ; IRQ3 owner is System
47
 
-
 
48
        mov   eax,3
41
        mov     eax, [RESERVED_PORTS]
49
        shl   eax,2
42
        inc     eax
50
        mov   [irq_owner+eax], 1
-
 
51
 
-
 
52
        inc   dword [RESERVED_PORTS]
-
 
53
        mov   edi,[RESERVED_PORTS]
43
        mov     [RESERVED_PORTS], eax
54
        shl   edi,4
44
        shl     eax, 4
55
        mov   [RESERVED_PORTS+edi+0],dword 1
45
        mov     [RESERVED_PORTS+eax+0], dword 1
56
        mov   [RESERVED_PORTS+edi+4],dword 0x2f0
46
        mov     [RESERVED_PORTS+eax+4], dword 0x2F8
57
        mov   [RESERVED_PORTS+edi+8],dword 0x2ff
47
        mov     [RESERVED_PORTS+eax+8], dword 0x2FF
58
 
-
 
59
        popa
-
 
60
        mov    esi,boot_setmouse_type+44
48
        mov    esi,boot_setmouse_type+44
61
        call  boot_log
49
        call  boot_log
62
     @@:
50
     @@:
63
        popa
51
        popa
64
        jmp     end_detecting_mouse
52
        jmp     end_detecting_mouse
Line 92... Line 80...
92
        out     DX,AL
80
        out     DX,AL
93
; Ïðîâåðèòü, ÷òî óñòðîéñòâî ïîäêëþ÷åíî è ÿâëÿåòñ
81
; Ïðîâåðèòü, ÷òî óñòðîéñòâî ïîäêëþ÷åíî è ÿâëÿåòñ
94
; ìûøüþ òèïà MSMouse
82
; ìûøüþ òèïà MSMouse
95
        ; Îòêëþ÷èòü ïèòàíèå ìûøè è ïðåðûâàíè
83
        ; Îòêëþ÷èòü ïèòàíèå ìûøè è ïðåðûâàíè
96
        mov     DX,[COMPortBaseAddr]
84
        mov     DX,[COMPortBaseAddr]
97
        add     DX,4    ;ðåãèñòð óïðàâëåíèÿ ìîäåìîì
85
        add     EDX,4   ;ðåãèñòð óïðàâëåíèÿ ìîäåìîì
98
        mov     AL,0    ;ñáðîñèòü DTR, RTS è OUT2
86
        mov     AL,0    ;ñáðîñèòü DTR, RTS è OUT2
99
        out     DX,AL
87
        out     DX,AL
100
        ; Îæèäàòü 5 "òèêîâ" (0,2 ñ)
88
        ; Îæèäàòü 5 "òèêîâ" (0,2 ñ)
101
        mov  ecx,0xffff
89
        mov     ecx, 0xFFFF
102
dT_1:
-
 
103
        dec  ecx
90
        loop    $
104
        cmp ecx,0
-
 
105
        jne dT_1
-
 
106
        mov  ecx,0xffff
-
 
107
        ; Âêëþ÷èòü ïèòàíèå ìûøè
91
        ; Âêëþ÷èòü ïèòàíèå ìûøè
108
        mov     AL,11b  ;óñòàíîâèòü DTR è RTS
92
        mov     al, 1
109
        out     DX,AL
93
        out     dx, al
-
 
94
        mov     ecx, 0xFFFF
-
 
95
        loop    $
110
        ; Î÷èñòèòü ðåãèñòð äàííûõ
96
        ; Î÷èñòèòü ðåãèñòð äàííûõ
111
        mov     DX,[COMPortBaseAddr]
97
        sub     edx, 4
112
        in      AL,DX
98
        in      AL,DX
-
 
99
        add     edx, 4
-
 
100
        mov     AL,11b  ;óñòàíîâèòü DTR è RTS
-
 
101
        out     DX,AL
-
 
102
        mov     ecx, 0x1FFFF
113
; Öèêë îïðîñà ïîðòà
103
; Öèêë îïðîñà ïîðòà
114
WaitData:
104
WaitData:
115
        ; Îæèäàòü åùå 10 "òèêîâ"
105
        ; Îæèäàòü åùå 10 "òèêîâ"
116
         dec  ecx
106
         dec  ecx
117
         cmp  ecx,0
107
         cmp  ecx,0