Subversion Repositories Kolibri OS

Rev

Rev 2166 | Rev 2465 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2166 Rev 2434
Line 9... Line 9...
9
;;  Distributed under GPL. See file COPYING for details.        ;;
9
;;  Distributed under GPL. See file COPYING for details.        ;;
10
;;  Copyright 2003 Ville Turjanmaa                              ;;
10
;;  Copyright 2003 Ville Turjanmaa                              ;;
11
;;                                                              ;;
11
;;                                                              ;;
12
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 13... Line 13...
13
 
13
 
Line 14... Line 14...
14
$Revision: 2166 $
14
$Revision: 2434 $
15
 
15
 
16
 
16
 
17
align 4 ;3A08
17
align 4 ;3A08
18
build_interrupt_table:
18
build_interrupt_table:
19
        mov     edi, idts
19
        mov     edi, idts
-
 
20
        mov     esi, sys_int
20
        mov     esi, sys_int
21
        mov     ecx, 0x40
21
        mov     ecx, 0x40
22
        mov     eax, (10001110b shl 24) + os_code
22
        mov     eax, (10001110b shl 24) + os_code
23
  @@:
23
  @@:   movsw   ;low word of code-entry
24
        movsw   ;low word of code-entry
24
        stosd   ;interrupt gate type : os_code selector
25
        stosd   ;interrupt gate type : os_code selector
25
        movsw   ;high word of code-entry
26
        movsw   ;high word of code-entry
Line 136... Line 137...
136
        test    byte[reg_eflags+2],2
137
        test    byte[reg_eflags+2], 2
137
        jnz     v86_exc_c
138
        jnz     v86_exc_c
138
        cmp     bl,14           ; #PF
139
        cmp     bl, 14          ; #PF
139
        jne     @f
140
        jne     @f
140
        call    page_fault_handler ; SEE: core/memory.inc
141
        call    page_fault_handler ; SEE: core/memory.inc
-
 
142
  @@:
141
  @@:   mov     esi, [current_slot]
143
        mov     esi, [current_slot]
142
        btr     [esi+APPDATA.except_mask], ebx
144
        btr     [esi+APPDATA.except_mask], ebx
143
        jnc     @f
145
        jnc     @f
144
        mov     eax,[esi+APPDATA.exc_handler]
146
        mov     eax, [esi+APPDATA.exc_handler]
145
        test    eax, eax
147
        test    eax, eax
146
        jnz     IRetToUserHook
148
        jnz     IRetToUserHook
-
 
149
  @@:
147
  @@:   cli
150
        cli
148
        mov     eax, [esi+APPDATA.debugger_slot]
151
        mov     eax, [esi+APPDATA.debugger_slot]
149
        test    eax, eax
152
        test    eax, eax
150
        jnz     .debug
153
        jnz     .debug
151
        sti
154
        sti
152
; not debuggee => say error and terminate
155
; not debuggee => say error and terminate
Line 163... Line 166...
163
        mov     ebx, dr6        ; debug_message data=DR6_image
166
        mov     ebx, dr6        ; debug_message data=DR6_image
164
        xor     edx, edx
167
        xor     edx, edx
165
        mov     dr6, edx
168
        mov     dr6, edx
166
        mov     edx, dr7
169
        mov     edx, dr7
167
        mov     cl, not 8
170
        mov     cl, not 8
-
 
171
  .l1:
168
  .l1:  shl     dl,2
172
        shl     dl, 2
169
        jc      @f
173
        jc      @f
170
        and     bl, cl
174
        and     bl, cl
-
 
175
  @@:
171
  @@:   sar     cl,1
176
        sar     cl, 1
172
        jc      .l1
177
        jc      .l1
173
        mov     cl, 3           ; debug_message code=debug_exception
178
        mov     cl, 3           ; debug_message code=debug_exception
174
.notify:
179
.notify:
175
        push    ebx             ; debug_message data
180
        push    ebx             ; debug_message data
176
        mov     ebx, [TASK_BASE]
181
        mov     ebx, [TASK_BASE]
Line 211... Line 216...
211
        DEBUGF  1, "K : Process - forced terminate PID: %x\n", [edx+TASKDATA.pid]
216
        DEBUGF  1, "K : Process - forced terminate PID: %x\n", [edx+TASKDATA.pid]
212
        cmp     bl, 0x08
217
        cmp     bl, 0x08
213
        jb      .l0
218
        jb      .l0
214
        cmp     bl, 0x0e
219
        cmp     bl, 0x0e
215
        jbe     .l1
220
        jbe     .l1
-
 
221
  .l0:
216
  .l0:  mov     bl, 0x09
222
        mov     bl, 0x09
-
 
223
  .l1:
217
  .l1:  mov     eax,[msg_fault_sel+ebx*4 - 0x08*4]
224
        mov     eax, [msg_fault_sel+ebx*4 - 0x08*4]
218
        DEBUGF  1, "K : %s\n", eax
225
        DEBUGF  1, "K : %s\n", eax
219
        mov     eax, [reg_cs3+4]
226
        mov     eax, [reg_cs3+4]
220
        mov     edi, msg_sel_app
227
        mov     edi, msg_sel_app
221
        mov     ebx, [reg_esp3+4]
228
        mov     ebx, [reg_esp3+4]
222
        cmp     eax, app_code
229
        cmp     eax, app_code
223
        je      @f
230
        je      @f
224
        mov     edi, msg_sel_ker
231
        mov     edi, msg_sel_ker
225
        mov     ebx, [reg_esp0+4]
232
        mov     ebx, [reg_esp0+4]
-
 
233
    @@:
226
    @@: DEBUGF  1, "K : EAX : %x EBX : %x ECX : %x\n", [reg_eax+4], [reg_ebx+4], [reg_ecx+4]
234
        DEBUGF  1, "K : EAX : %x EBX : %x ECX : %x\n", [reg_eax+4], [reg_ebx+4], [reg_ecx+4]
227
        DEBUGF  1, "K : EDX : %x ESI : %x EDI : %x\n", [reg_edx+4], [reg_esi+4], [reg_edi+4]
235
        DEBUGF  1, "K : EDX : %x ESI : %x EDI : %x\n", [reg_edx+4], [reg_esi+4], [reg_edi+4]
228
        DEBUGF  1, "K : EBP : %x EIP : %x ESP : %x\n", [reg_ebp+4], [reg_eip+4], ebx
236
        DEBUGF  1, "K : EBP : %x EIP : %x ESP : %x\n", [reg_ebp+4], [reg_eip+4], ebx
229
        DEBUGF  1, "K : Flags : %x CS : %x (%s)\n", [reg_eflags+4], eax, edi
237
        DEBUGF  1, "K : Flags : %x CS : %x (%s)\n", [reg_eflags+4], eax, edi
230
        ret
238
        ret
231
;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
239
;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=