Subversion Repositories Kolibri OS

Rev

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

Rev 1505 Rev 1664
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: 1369 $
14
$Revision: 1664 $
15
 
15
 
16
 
16
 
Line 98... Line 98...
98
 
98
 
99
uglobal
99
uglobal
100
  pf_err_code   dd ?
100
  pf_err_code   dd ?
Line 101... Line 101...
101
endg
101
endg
102
 
102
 
103
page_fault_exc:                 ; äóðàêîóñòî÷èâîñòü: ñåëåêòîðû èñïîð÷åíû...
103
page_fault_exc:                 ; fool-proofing: if selectors damaged...
104
        pop     [ss:pf_err_code]; äåéñòâèòåëüíî äî ñëåäóþùåãî #PF
104
        pop     [ss:pf_err_code]; active to the next #PF
Line 105... Line 105...
105
        save_ring3_context
105
        save_ring3_context
106
        mov     bl,14
106
        mov     bl,14
107
 
107
 
108
exc_c:                          ; èñêëþ÷åíèÿ (âñå, êðîìå 7-ãî - #NM)
108
exc_c:                          ; exceptions (all but the 7th - #NM)
109
; Ôðýéì ñòåêà ïðè èñêëþ÷åíèè/ïðåðûâàíèè èç 3-ãî êîëüöà + pushad (ò.å., èìåííî çäåñü)
109
; the stack frame for an exception/interrupt occured in Ring3 + pushad (i.e. here)
110
  reg_ss        equ esp+0x30
110
  reg_ss        equ esp+0x30
111
  reg_esp3      equ esp+0x2C
111
  reg_esp3      equ esp+0x2C
112
  reg_eflags    equ esp+0x28
112
  reg_eflags    equ esp+0x28
113
  reg_cs3       equ esp+0x24
113
  reg_cs3       equ esp+0x24
114
  reg_eip       equ esp+0x20
114
  reg_eip       equ esp+0x20
115
 ; ýòî ôðýéì îò pushad
115
 ; pushad's frame
116
  reg_eax       equ esp+0x1C
116
  reg_eax       equ esp+0x1C
117
  reg_ecx       equ esp+0x18
117
  reg_ecx       equ esp+0x18
118
  reg_edx       equ esp+0x14
118
  reg_edx       equ esp+0x14
119
  reg_ebx       equ esp+0x10
119
  reg_ebx       equ esp+0x10
120
  reg_esp0      equ esp+0x0C
120
  reg_esp0      equ esp+0x0C
Line 121... Line 121...
121
  reg_ebp       equ esp+0x08
121
  reg_ebp       equ esp+0x08
122
  reg_esi       equ esp+0x04
122
  reg_esi       equ esp+0x04
123
  reg_edi       equ esp+0x00
123
  reg_edi       equ esp+0x00
124
 
124
 
125
        Mov     ds,ax,app_data  ; çàãðóçèì ïðàâèëüíûå çíà÷åíèÿ
125
        Mov     ds,ax,app_data  ; load the correct values
126
        mov     es,ax           ; â ñåãìåíòíûå ðåãèñòðû
126
        mov     es,ax           ; to segregs
127
        cld                     ; è ïðèâîäèì DF ê ñòàíäàðòó
127
        cld                     ; and clear DF
128
        movzx   ebx,bl
128
        movzx   ebx,bl
Line 257... Line 257...
257
        mov     ds, ax
257
        mov     ds, ax
258
        mov     es, ax
258
        mov     es, ax
259
        mov     edi, 14
259
        mov     edi, 14
260
        cmp     [v86_irqhooks+edi*8], 0
260
        cmp     [v86_irqhooks+edi*8], 0
261
        jnz     v86_irq2
261
        jnz     v86_irq2
262
;       mov     byte [BOOT_VAR + 0x48E], 0xFF
-
 
263
        call    [irq14_func]
262
        call    [irq14_func]
264
        call    ready_for_next_irq_1
263
        call    ready_for_next_irq_1
265
        restore_ring3_context
264
        restore_ring3_context
266
        iret
265
        iret
267
p_irq15:
266
p_irq15:
Line 270... Line 269...
270
        mov     ds, ax
269
        mov     ds, ax
271
        mov     es, ax
270
        mov     es, ax
272
        mov     edi, 15
271
        mov     edi, 15
273
        cmp     [v86_irqhooks+edi*8], 0
272
        cmp     [v86_irqhooks+edi*8], 0
274
        jnz     v86_irq2
273
        jnz     v86_irq2
275
;       mov     byte [BOOT_VAR + 0x48E], 0xFF
-
 
276
        call    [irq15_func]
274
        call    [irq15_func]
277
        call    ready_for_next_irq_1
275
        call    ready_for_next_irq_1
278
        restore_ring3_context
276
        restore_ring3_context
279
        iret
277
        iret
Line 280... Line 278...
280
 
278
 
281
ready_for_next_irq:
279
ready_for_next_irq:
282
	mov	eax,5
280
	mov	eax,5
283
        mov     [check_idle_semaphore],eax
-
 
284
;        mov     al, 0x20
281
        mov     [check_idle_semaphore],eax
285
	add 	eax,(0x20-0x5)
-
 
286
 
282
	add 	eax,(0x20-0x5)
287
        out     0x20, al
283
        out     0x20, al
-
 
284
        ret
288
        ret
285
 
289
;destroy eax
286
;destroy eax
290
ready_for_next_irq_1:
287
ready_for_next_irq_1:
291
	mov	eax,5
288
	mov	eax,5
292
        mov     [check_idle_semaphore],eax
289
        mov     [check_idle_semaphore],eax
Line 407... Line 404...
407
 
404
 
Line 408... Line 405...
408
        pop  eax
405
        pop  eax
Line 409... Line 406...
409
 
406
 
410
        ret
407
        ret
411
 
408
 
412
;  * eax = 64 - íîìåð ôóíêöèè
409
;  * eax = 64 - sysFn #
413
;  * ebx = 1 - åäèíñòâåííàÿ ïîäôóíêöèÿ
410
;  * ebx = 1  - subFn
414
;  * ecx = íîâûé ðàçìåð ïàìÿòè
411
;  * ecx = new memory size
Line 415... Line 412...
415
;Âîçâðàùàåìîå çíà÷åíèå:
412
;Returns:
416
;  * eax = 0 - óñïåøíî
-
 
417
;  * eax = 1 - íåäîñòàòî÷íî ïàìÿòè
-
 
418
 
-
 
419
sys_resize_app_memory:
-
 
420
        ; ebx = 1 - resize
413
;  * eax = 0 - OK
421
        ; ecx = new amount of memory
414
;  * eax = 1 - insufficient memory
422
 
415
 
423
;        cmp    eax,1
416
sys_resize_app_memory:
424
	dec	ebx
417
	dec	ebx
425
        jnz    .no_application_mem_resize
418
        jnz    .no_application_mem_resize
Line 426... Line 419...
426
        stdcall new_mem_resize, ecx
419
        stdcall new_mem_resize, ecx
427
        mov [esp+32], eax
-
 
428
.no_application_mem_resize:
-
 
429
        ret
420
        mov [esp+32], eax
430
 
421
.no_application_mem_resize:
Line -... Line 422...
-
 
422
        ret
431
iglobal
423
 
432
;  process_terminating  db 'K : Process - terminating',13,10,0
424
iglobal
Line 433... Line 425...
433
;  process_terminated   db 'K : Process - done',13,10,0
425
  msg_obj_destroy       db 'K : app object destroyed',13,10,0
Line 434... Line 426...
434
  msg_obj_destroy       db 'K : destroy app object',13,10,0
426
endg
Line 435... Line 427...
435
endg
427
 
Line 449... Line 441...
449
           pop    esi
441
           pop    esi
450
           shl    esi, 5
442
           shl    esi, 5
451
           mov    [CURRENT_TASK+esi+TASKDATA.state], 9
443
           mov    [CURRENT_TASK+esi+TASKDATA.state], 9
452
           ret
444
           ret
453
@@:
445
@@:
454
           ;mov    esi,process_terminating
-
 
455
           ;call   sys_msg_board_str
-
 
456
@@:
-
 
457
           cli
446
           cli
458
           cmp   [application_table_status],0
447
           cmp   [application_table_status],0
459
           je    term9
448
           je    term9
460
           sti
449
           sti
461
           call  change_task
450
           call  change_task
Line 672... Line 661...
672
        movzx  edi, word [esi]               ; edi = process
661
        movzx  edi, word [esi]               ; edi = process
673
        shl    edi, 5
662
        shl    edi, 5
674
        cmp    [CURRENT_TASK + edi + TASKDATA.state], byte 9  ; skip dead slots
663
        cmp    [CURRENT_TASK + edi + TASKDATA.state], byte 9  ; skip dead slots
675
        je     .check_next_window
664
        je     .check_next_window
676
        add    edi, window_data
665
        add    edi, window_data
677
; \begin{diamond}[19.09.2006]
-
 
-
 
666
 
678
; skip minimized windows
667
; skip minimized windows
679
        test   [edi + WDATA.fl_wstate], WSTATE_MINIMIZED
668
        test   [edi + WDATA.fl_wstate], WSTATE_MINIMIZED
680
        jnz    .check_next_window
669
        jnz    .check_next_window
681
; \end{diamond}
-
 
682
        call   waredraw
670
        call   waredraw
683
 .nothing_to_activate:
671
 .nothing_to_activate:
684
        popad
672
        popad
685
 .dont_activate:
673
 .dont_activate:
Line 689... Line 677...
689
        mov     esi, [esi+CURRENT_TASK+TASKDATA.pid]
677
        mov     esi, [esi+CURRENT_TASK+TASKDATA.pid]
690
        cmp     [hd1_status], esi
678
        cmp     [hd1_status], esi
691
        jnz     @f
679
        jnz     @f
692
        call    free_hd_channel
680
        call    free_hd_channel
693
        and     [hd1_status], 0
681
        and     [hd1_status], 0
694
@@:
682
;@@:
695
        cmp     [cd_status], esi
683
;        cmp     [cd_status], esi
696
        jnz     @f
684
;        jnz     @f
697
        call    free_cd_channel
685
;        call    free_cd_channel
698
        and     [cd_status], 0
686
;        and     [cd_status], 0
699
@@:
687
@@:
700
        cmp     [flp_status], esi
688
        cmp     [flp_status], esi
701
        jnz     @f
689
        jnz     @f
702
        and     [flp_status], 0
690
        and     [flp_status], 0
703
@@:
691
@@:
Line 792... Line 780...
792
@@:
780
@@:
793
    inc  eax
781
    inc  eax
794
    add  ecx, 0x100
782
    add  ecx, 0x100
795
    jmp  .xd0
783
    jmp  .xd0
796
.xd1:
784
.xd1:
797
;    call  systest
-
 
798
    sti  ; .. and life goes on
785
    sti  ; .. and life goes on
Line 799... Line 786...
799
 
786
 
800
    mov   eax, [draw_limits.left]
787
    mov   eax, [draw_limits.left]
801
    mov   ebx, [draw_limits.top]
788
    mov   ebx, [draw_limits.top]
Line 808... Line 795...
808
 
795
 
809
    mov   [MOUSE_BACKGROUND],byte 0  ; no mouse background
796
    mov   [MOUSE_BACKGROUND],byte 0  ; no mouse background
Line 810... Line 797...
810
    mov   [DONT_DRAW_MOUSE],byte 0  ; draw mouse
797
    mov   [DONT_DRAW_MOUSE],byte 0  ; draw mouse
811
 
-
 
812
    and   [application_table_status],0
-
 
813
    ;mov   esi,process_terminated
798
 
814
    ;call  sys_msg_board_str
799
    and   [application_table_status],0
815
    add esp, 4
800
    add esp, 4
Line 816... Line 801...
816
    ret
801
    ret
817
restore .slot
802
restore .slot
818
 
803
 
819
iglobal
804
iglobal
Line 820... Line 805...
820
  boot_sched_1    db   'Building gdt tss pointer',0
805
  boot_sched_1    db   'Building gdt tss pointer',0
Line 821... Line 806...
821
  boot_sched_2    db   'Building IDT table',0
806
;  boot_sched_2    db   'Building IDT table',0
822
endg
807
endg
823
 
-
 
824
 
-
 
825
build_scheduler:
-
 
826
 
-
 
827
        mov    esi,boot_sched_1
-
 
828
        call   boot_log
808