Subversion Repositories Kolibri OS

Rev

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

Rev 4313 Rev 5130
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: 4313 $
14
$Revision: 5130 $
15
 
15
 
16
align 4 ;3A08
16
align 4 ;3A08
17
build_interrupt_table:
17
build_interrupt_table:
Line 411... Line 411...
411
; param
411
; param
412
;  esi= slot
412
;  esi= slot
Line 413... Line 413...
413
 
413
 
414
align 4
414
align 4
-
 
415
terminate: ; terminate application
-
 
416
destroy_thread:
-
 
417
 
-
 
418
        .slot     equ esp+4             ;locals
Line 415... Line -...
415
terminate: ; terminate application
-
 
Line 416... Line 419...
416
 
419
        .process  equ esp               ;ptr to parent process
Line 417... Line 420...
417
           .slot equ esp   ;locals
420
 
418
 
421
 
-
 
422
        push    esi        ;save .slot
419
        push    esi        ;save .slot
423
 
420
 
424
        shl     esi, 8
421
        shl     esi, 8
425
        mov     edx, [SLOT_BASE+esi+APPDATA.process]
422
        cmp     [SLOT_BASE+esi+APPDATA.dir_table], 0
426
        test    edx, edx
423
        jne     @F
427
        jnz     @F
424
        pop     esi
428
        pop     esi
-
 
429
        shl     esi, 5
425
        shl     esi, 5
430
        mov     [CURRENT_TASK+esi+TASKDATA.state], 9
426
        mov     [CURRENT_TASK+esi+TASKDATA.state], 9
431
        ret
427
        ret
-
 
428
@@:
-
 
429
        lea     edx, [SLOT_BASE+esi]
432
@@:
Line 430... Line 433...
430
        call    scheduler_remove_thread
433
        push    edx                     ;save .process
431
           ;mov    esi,process_terminating
434
        lea     edx, [SLOT_BASE+esi]
432
           ;call   sys_msg_board_str
435
        call    scheduler_remove_thread
Line 440... Line 443...
440
        cmp     [eax+SLOT_BASE+APPDATA.saved_esp0], esi
443
        cmp     [eax+SLOT_BASE+APPDATA.saved_esp0], esi
441
        jz      .nov86
444
        jz      .nov86
442
; ...it has page directory for V86 mode
445
; ...it has page directory for V86 mode
443
        mov     esi, [eax+SLOT_BASE+APPDATA.saved_esp0]
446
        mov     esi, [eax+SLOT_BASE+APPDATA.saved_esp0]
444
        mov     ecx, [esi+4]
447
        mov     ecx, [esi+4]
445
        mov     [eax+SLOT_BASE+APPDATA.dir_table], ecx
448
        mov     [eax+SLOT_BASE+APPDATA.process], ecx
446
; ...and I/O permission map for V86 mode
449
; ...and I/O permission map for V86 mode
447
        mov     ecx, [esi+12]
450
        mov     ecx, [esi+12]
448
        mov     [eax+SLOT_BASE+APPDATA.io_map], ecx
451
        mov     [eax+SLOT_BASE+APPDATA.io_map], ecx
449
        mov     ecx, [esi+8]
452
        mov     ecx, [esi+8]
450
        mov     [eax+SLOT_BASE+APPDATA.io_map+4], ecx
453
        mov     [eax+SLOT_BASE+APPDATA.io_map+4], ecx
451
.nov86:
454
.nov86:
452
 
-
 
-
 
455
;destroy per-thread kernel objects
453
        mov     esi, [.slot]
456
        mov     esi, [.slot]
454
        shl     esi, 8
457
        shl     esi, 8
455
        add     esi, SLOT_BASE+APP_OBJ_OFFSET
458
        add     esi, SLOT_BASE+APP_OBJ_OFFSET
456
@@:
459
@@:
457
        mov     eax, [esi+APPOBJ.fd]
460
        mov     eax, [esi+APPOBJ.fd]
Line 465... Line 468...
465
        call    [eax+APPOBJ.destroy]
468
        call    [eax+APPOBJ.destroy]
466
           DEBUGF 1,"%s",msg_obj_destroy
469
           DEBUGF 1,"%s",msg_obj_destroy
467
        pop     esi
470
        pop     esi
468
        jmp     @B
471
        jmp     @B
469
@@:
472
@@:
470
 
-
 
471
        mov     eax, [.slot]
-
 
472
        shl     eax, 8
-
 
473
        stdcall destroy_app_space, [SLOT_BASE+eax+APPDATA.dir_table], [SLOT_BASE+eax+APPDATA.dlls_list_ptr]
-
 
474
 
-
 
475
        mov     esi, [.slot]
473
        mov     esi, [.slot]
476
        cmp     [fpu_owner], esi ; if user fpu last -> fpu user = 2
474
        cmp     [fpu_owner], esi ; if user fpu last -> fpu user = 2
477
        jne     @F
475
        jne     @F
Line 478... Line 476...
478
 
476
 
Line 628... Line 626...
628
        mov     eax, [edi+APPDATA.io_map+4]
626
        mov     eax, [edi+APPDATA.io_map+4]
629
        cmp     eax, [SLOT_BASE+256+APPDATA.io_map+4]
627
        cmp     eax, [SLOT_BASE+256+APPDATA.io_map+4]
630
        je      @F
628
        je      @F
631
        call    free_page
629
        call    free_page
632
@@:
630
@@:
-
 
631
        lea     ebx, [edi+APPDATA.list]
-
 
632
        list_del ebx                    ;destroys edx, ecx
-
 
633
 
633
        mov     eax, 0x20202020
634
        mov     eax, 0x20202020
634
        stosd
635
        stosd
635
        stosd
636
        stosd
636
        stosd
637
        stosd
637
        mov     ecx, 244/4
638
        mov     ecx, 244/4
Line 743... Line 744...
743
@@:
744
@@:
744
        inc     eax
745
        inc     eax
745
        add     ecx, 0x100
746
        add     ecx, 0x100
746
        jmp     .xd0
747
        jmp     .xd0
747
.xd1:
748
.xd1:
-
 
749
;release slot
-
 
750
 
-
 
751
        bts     [thr_slot_map], esi
-
 
752
 
-
 
753
        mov     ecx, [.process]
-
 
754
        lea     eax, [ecx+PROC.thr_list]
-
 
755
        cmp     eax, [eax+LHEAD.next]
748
;    call  systest
756
        jne     @F
-
 
757
 
-
 
758
        call    destroy_process.internal
-
 
759
@@:
749
        sti     ; .. and life goes on
760
        sti     ; .. and life goes on
Line 750... Line 761...
750
 
761
 
751
        mov     eax, [draw_limits.left]
762
        mov     eax, [draw_limits.left]
752
        mov     ebx, [draw_limits.top]
763
        mov     ebx, [draw_limits.top]
Line 758... Line 769...
758
        call    redrawscreen
769
        call    redrawscreen
Line 759... Line 770...
759
 
770
 
760
        call    unlock_application_table
771
        call    unlock_application_table
761
    ;mov   esi,process_terminated
772
    ;mov   esi,process_terminated
762
    ;call  sys_msg_board_str
773
    ;call  sys_msg_board_str
763
        add     esp, 4
774
        add     esp, 8
764
        ret
775
        ret
765
restore .slot
-
 
766
 
-
 
767
;build_scheduler:
-
 
768
;        mov     esi, boot_sched_1
-
 
769
;        call    boot_log
-
 
770
;        call   build_process_gdt_tss_pointer
-
 
771
 
-
 
772
;        mov    esi,boot_sched_2
-
 
773
;        call   boot_log
776
restore .slot
Line 774... Line 777...
774
;        ret
777
restore .process
775
 
778
 
776
; Three following procedures are used to guarantee that
779
; Three following procedures are used to guarantee that
777
; some part of kernel code will not be terminated from outside
780
; some part of kernel code will not be terminated from outside