Subversion Repositories Kolibri OS

Rev

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

Rev 377 Rev 379
Line 118... Line 118...
118
        mov   ds, ax
118
        mov   ds, ax
119
        mov   es, ax
119
        mov   es, ax
Line 120... Line 120...
120
 
120
 
121
; test if debugging
121
; test if debugging
122
        cli
122
        cli
123
        mov   eax, [0x3000]
123
        mov   eax, [CURRENT_TASK]
124
        shl   eax, 8
124
        shl   eax, 8
125
        mov   eax, [0x80000+eax+APPDATA.debugger_slot]
125
        mov   eax, [0x80000+eax+APPDATA.debugger_slot]
126
        test  eax, eax
126
        test  eax, eax
127
        jnz   .debug
127
        jnz   .debug
Line 130... Line 130...
130
        add   esp, 28h
130
        add   esp, 28h
131
        movzx eax, bl
131
        movzx eax, bl
132
        mov   [error_interrupt], eax
132
        mov   [error_interrupt], eax
133
        call  show_error_parameters
133
        call  show_error_parameters
Line 134... Line 134...
134
 
134
 
135
        mov   edx, [0x3010]
135
        mov   edx, [TASK_BASE]
Line 136... Line 136...
136
        mov   [edx + TASKDATA.state], byte 4
136
        mov   [edx + TASKDATA.state], byte 4
Line 137... Line 137...
137
 
137
 
138
        jmp   change_task
138
        jmp   change_task
139
 
139
 
140
.debug:
140
.debug:
141
; we are debugged process, notify debugger and suspend ourself
141
; we are debugged process, notify debugger and suspend ourself
142
; eax=debugger PID
142
; eax=debugger PID
143
        cld
143
        cld
144
        movzx ecx, bl
144
        movzx ecx, bl
145
        push  ecx
145
        push  ecx
146
        mov   ecx, [0x3010]
146
        mov   ecx, [TASK_BASE]
147
        push  dword [ecx+TASKDATA.pid]    ; PID of current process
147
        push  dword [ecx+TASKDATA.pid]    ; PID of current process
148
        push  12
148
        push  12
149
        pop   ecx
149
        pop   ecx
150
        push  1        ; 1=exception
150
        push  1        ; 1=exception
151
        call  debugger_notify
151
        call  debugger_notify
152
        pop   ecx
152
        pop   ecx
153
        pop   ecx
153
        pop   ecx
154
        pop   ecx
154
        pop   ecx
155
        mov   edx, [0x3010]
155
        mov   edx, [TASK_BASE]
156
        mov   byte [edx+TASKDATA.state], 1        ; suspended
156
        mov   byte [edx+TASKDATA.state], 1        ; suspended
Line 194... Line 194...
194
endg
194
endg
Line 195... Line 195...
195
 
195
 
Line 196... Line 196...
196
show_error_parameters:
196
show_error_parameters:
197
 
197
 
198
        mov    [write_error_to],process_pid+43
198
        mov    [write_error_to],process_pid+43
199
        mov    eax,[0x3000]
199
        mov    eax,[CURRENT_TASK]
200
        shl    eax, 5
200
        shl    eax, 5
Line 201... Line 201...
201
        mov    eax,[0x3000+TASKDATA.pid+eax]
201
        mov    eax,[CURRENT_TASK+TASKDATA.pid+eax]
202
        call   writehex
202
        call   writehex
203
 
203
 
Line 431... Line 431...
431
 
431
 
432
 
432
 
Line 433... Line 433...
433
set_application_table_status:
433
set_application_table_status:
434
        push eax
434
        push eax
435
 
435
 
436
        mov  eax,[0x3000]
436
        mov  eax,[CURRENT_TASK]
Line 437... Line 437...
437
        shl  eax, 5
437
        shl  eax, 5
Line 438... Line 438...
438
        add  eax,0x3000+TASKDATA.pid
438
        add  eax,CURRENT_TASK+TASKDATA.pid
Line 446... Line 446...
446
 
446
 
447
 
447
 
Line 448... Line 448...
448
clear_application_table_status:
448
clear_application_table_status:
449
        push eax
449
        push eax
450
 
450
 
451
        mov  eax,[0x3000]
451
        mov  eax,[CURRENT_TASK]
Line 452... Line 452...
452
        shl  eax, 5
452
        shl  eax, 5
453
        add  eax,0x3000+TASKDATA.pid
453
        add  eax,CURRENT_TASK+TASKDATA.pid
454
        mov  eax,[eax]
454
        mov  eax,[eax]
Line 735... Line 735...
735
    mov  eax, [0x80000+edi*8+APPDATA.debugger_slot]
735
    mov  eax, [0x80000+edi*8+APPDATA.debugger_slot]
736
    test eax, eax
736
    test eax, eax
737
    jz   .nodebug
737
    jz   .nodebug
738
    push 8
738
    push 8
739
    pop  ecx
739
    pop  ecx
740
    push dword [0x3000+edi+TASKDATA.pid]   ; PID
740
    push dword [CURRENT_TASK+edi+TASKDATA.pid]   ; PID
741
    push 2
741
    push 2
742
    call debugger_notify
742
    call debugger_notify
743
    pop  ecx
743
    pop  ecx
744
    pop  ecx
744
    pop  ecx
745
.nodebug:
745
.nodebug:
Line 762... Line 762...
762
           xor eax, eax
762
           xor eax, eax
763
           rep stosd
763
           rep stosd
Line 764... Line 764...
764
 
764
 
765
  ; activate window
765
  ; activate window
766
        movzx  eax, word [0xC000 + esi*2]
766
        movzx  eax, word [0xC000 + esi*2]
767
        cmp    eax, [0x3004]
767
        cmp    eax, [TASK_COUNT]
768
        jne    .dont_activate
768
        jne    .dont_activate
769
        pushad
769
        pushad
770
 .check_next_window:
770
 .check_next_window:
771
        dec    eax
771
        dec    eax
772
        cmp    eax, 1
772
        cmp    eax, 1
773
        jbe    .nothing_to_activate
773
        jbe    .nothing_to_activate
774
        lea    esi, [0xc400+eax*2]
774
        lea    esi, [0xc400+eax*2]
775
        movzx  edi, word [esi]               ; edi = process
775
        movzx  edi, word [esi]               ; edi = process
776
        shl    edi, 5
776
        shl    edi, 5
777
        cmp    [0x3000 + edi + TASKDATA.state], byte 9  ; skip dead slots
777
        cmp    [CURRENT_TASK + edi + TASKDATA.state], byte 9  ; skip dead slots
778
        je     .check_next_window
778
        je     .check_next_window
779
        add    edi, window_data
779
        add    edi, window_data
780
; \begin{diamond}[19.09.2006]
780
; \begin{diamond}[19.09.2006]
781
; skip minimized windows
781
; skip minimized windows
Line 787... Line 787...
787
        popad
787
        popad
788
 .dont_activate:
788
 .dont_activate:
Line 789... Line 789...
789
 
789
 
790
        push    esi     ; remove hd1 & cd & flp reservation
790
        push    esi     ; remove hd1 & cd & flp reservation
791
        shl     esi, 5
791
        shl     esi, 5
792
        mov     esi, [esi+0x3000+TASKDATA.pid]
792
        mov     esi, [esi+CURRENT_TASK+TASKDATA.pid]
793
        cmp     [hd1_status], esi
793
        cmp     [hd1_status], esi
794
        jnz     @f
794
        jnz     @f
795
        call    free_hd_channel
795
        call    free_hd_channel
796
        mov     [hd1_status], 0
796
        mov     [hd1_status], 0
Line 807... Line 807...
807
        pop     esi
807
        pop     esi
Line 808... Line 808...
808
 
808
 
809
    pusha ; remove all irq reservations
809
    pusha ; remove all irq reservations
810
    mov   eax,esi
810
    mov   eax,esi
811
    shl   eax, 5
811
    shl   eax, 5
812
    mov   eax,[eax+0x3000+TASKDATA.pid]
812
    mov   eax,[eax+CURRENT_TASK+TASKDATA.pid]
813
    mov   edi,irq_owner
813
    mov   edi,irq_owner
814
    mov   ecx,16
814
    mov   ecx,16
815
  newirqfree:
815
  newirqfree:
816
    scasd
816
    scasd
Line 821... Line 821...
821
    popa
821
    popa
Line 822... Line 822...
822
 
822
 
823
    pusha                     ; remove all port reservations
823
    pusha                     ; remove all port reservations
824
    mov   edx,esi
824
    mov   edx,esi
825
    shl   edx, 5
825
    shl   edx, 5
826
    add   edx,0x3000
826
    add   edx,CURRENT_TASK
Line 827... Line 827...
827
    mov   edx,[edx+TASKDATA.pid]
827
    mov   edx,[edx+TASKDATA.pid]
Line 828... Line 828...
828
 
828
 
Line 865... Line 865...
865
  rmpr9:
865
  rmpr9:
Line 866... Line 866...
866
 
866
 
867
    popa
867
    popa
868
    mov  edi,esi         ; do not run this process slot
868
    mov  edi,esi         ; do not run this process slot
869
    shl  edi, 5
869
    shl  edi, 5
870
    mov  [edi+0x3000 + TASKDATA.state],byte 9
870
    mov  [edi+CURRENT_TASK + TASKDATA.state],byte 9
871
; debugger test - terminate all debuggees
871
; debugger test - terminate all debuggees
872
    mov  eax, 2
872
    mov  eax, 2
873
    mov  ecx, 0x80000+2*0x100+APPDATA.debugger_slot
873
    mov  ecx, 0x80000+2*0x100+APPDATA.debugger_slot
874
.xd0:
874
.xd0:
875
    cmp  eax, [0x3004]
875
    cmp  eax, [TASK_COUNT]
876
    ja   .xd1
876
    ja   .xd1
877
    cmp  dword [ecx], esi
877
    cmp  dword [ecx], esi
878
    jnz  @f
878
    jnz  @f
879
    and  dword [ecx], 0
879
    and  dword [ecx], 0