Subversion Repositories Kolibri OS

Rev

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

Rev 160 Rev 164
Line 52... Line 52...
52
        dw     10011111b *256 +10010010b
52
        dw     10011111b *256 +10010010b
53
        db     0x00
53
        db     0x00
54
; -----------------------------------------
54
; -----------------------------------------
Line 55... Line 55...
55
 
55
 
56
app_code_l:
56
app_code_l:
57
      dw ((0x80000000-std_application_base_address) shr 12) and 0xffff
57
      dw 0xFFFF;((0x80000000-std_application_base_address) shr 12) and 0xffff
58
      dw 0
58
      dw 0
59
      db 0
59
      db 0x40
60
      dw 11010000b*256+11111010b+256*((0x80000000-std_application_base_address) shr 28)
60
      db cpl3
Line 61... Line 61...
61
      db std_application_base_address shr 24
61
      dw G32+D32+0x6000+0x7;
62
 
62
 
63
app_data_l:
63
app_data_l:
64
      dw (0x80000000-std_application_base_address) shr 12 and 0xffff
64
      dw 0xFFFF;(0x80000000-std_application_base_address) shr 12 and 0xffff
65
      dw 0
65
      dw 0
66
      db 0
66
      db 0x40
Line 67... Line 67...
67
      dw 11010000b*256+11110010b+256*((0x80000000-std_application_base_address) shr 28)
67
      db drw3
Line 68... Line 68...
68
      db std_application_base_address shr 24
68
      dw G32+D32+0x6000+0x7;
69
 
69
 
Line 79... Line 79...
79
      times (max_processes+10) dd 0,0
79
      times (max_processes+10) dd 0,0
Line 80... Line 80...
80
 
80
 
Line 81... Line -...
81
gdte:
-
 
82
 
81
gdte:
83
 
82
 
84
 
83
 
85
idtreg:
84
idtreg:
Line 86... Line 85...
86
     dw   8*0x41-1
85
     dw   8*0x41-1
87
     dd   idts+8
86
     dd   idts+8
Line 164... Line 163...
164
        mov    [edi + 4], word 11101110b*256
163
        mov    [edi + 4], word 11101110b*256
165
        mov    [edi + 6], word (i40 shr 16)
164
        mov    [edi + 6], word (i40 shr 16)
Line 166... Line 165...
166
 
165
 
Line 167... Line -...
167
        ret
-
 
168
 
-
 
169
 
166
        ret
170
 
167
 
171
iglobal
168
iglobal
-
 
169
  sys_int:
-
 
170
    dd e0,debug_exc,e2,e3
-
 
171
    dd e4,e5,e6,e7
-
 
172
    dd e8,e9,e10,e11
172
  sys_int:
173
    dd e12,e13,page_fault_handler,e15
173
    dd   e0,debug_exc,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15
174
 
Line 174... Line 175...
174
    dd   e16,e17
175
    dd except_16, e17
-
 
176
    times 14 dd unknown_interrupt
-
 
177
 
175
    times 14 dd unknown_interrupt
178
    dd   irq0  , irq_serv.irq_1, p_irq2 ,irq_serv.irq_3
Line 176... Line 179...
176
 
179
    dd   p_irq4 ,irq_serv.irq_5,p_irq6,irq_serv.irq_7
Line 177... Line 180...
177
    dd   irq0  ,irq1  ,p_irq2 ,p_irq3 ,p_irq4 ,p_irq5,p_irq6 ,p_irq7
180
    dd   irq_serv.irq_8, irq_serv.irq_9, irq_serv.irq_10
178
    dd   p_irq8,p_irq9,p_irq10,p_irq11,p_irq12,irqD  ,p_irq14,p_irq15
181
    dd   irq_serv.irq_11,p_irq12,irqD ,p_irq14,p_irq15
Line 214... Line 217...
214
      save_ring3_context
217
      save_ring3_context
215
      mov bl, num
218
      mov bl, num
216
      jmp exc_c
219
      jmp exc_c
217
}
220
}
Line 218... Line 221...
218
 
221
 
219
exc_wo_code 0, 1, 2, 3, 4, 5, 6, 9, 15, 16 ; 18, 19
222
exc_wo_code 0, 1, 2, 3, 4, 5, 6, 9, 15 ; 18, 19
Line 220... Line 223...
220
exc_w_code 8, 10, 11, 12, 13, 14, 17
223
exc_w_code 8, 10, 11, 12, 13, 14, 17
221
 
224
 
222
exc_c:
225
exc_c:
Line 274... Line 277...
274
        clts
277
        clts
275
        mov   ax, os_data
278
        mov ax, os_data
276
        mov   ds, ax
279
        mov ds, ax
277
        mov   es, ax
280
        mov es, ax
Line 278... Line 281...
278
        
281
 
-
 
282
        mov ebx, [fpu_owner]
-
 
283
        cmp ebx, [CURRENT_TASK]
-
 
284
        je .exit
-
 
285
 
-
 
286
        shl ebx, 8
-
 
287
        mov eax, [ebx+PROC_BASE+APPDATA.fpu_state]
-
 
288
        bt [cpu_caps], CAPS_FXSR
-
 
289
        jnc .no_SSE
-
 
290
 
-
 
291
        fxsave [eax]
-
 
292
        mov ebx, [CURRENT_TASK]
279
        mov   eax, [prev_user_of_fpu]
293
        mov [fpu_owner], ebx
-
 
294
        shl ebx, 8
-
 
295
        cmp dword [ebx+PROC_BASE+APPDATA.fpu_init], 0
280
        shl   eax, 8
296
        je .init
-
 
297
        mov eax, [ebx+PROC_BASE+APPDATA.fpu_state]
-
 
298
        fxrstor [eax]
-
 
299
        restore_ring3_context
-
 
300
        iret
-
 
301
.init:
-
 
302
        fninit                      ;­ ¬ ­¥ ­ã¦­ë ­¥¬ áª¨à®¢ ­­ë¥ ¨áª«î祭¨ï
-
 
303
        mov dword [ebx+PROC_BASE+APPDATA.fpu_init], 1
-
 
304
.exit:
-
 
305
        restore_ring3_context
-
 
306
        iret
281
        add   eax, 0x80000 + APPDATA.fpu_save_area
307
.no_SSE:
-
 
308
        fnsave [eax]
-
 
309
        mov ebx, [CURRENT_TASK]
-
 
310
        mov [fpu_owner], ebx
-
 
311
        shl ebx, 8
-
 
312
        cmp dword [ebx+PROC_BASE+APPDATA.fpu_init], 0
Line 282... Line -...
282
        fsave [eax]
-
 
283
        
313
        je .init
284
        mov   eax, [0x3000]
314
 
285
        mov   [prev_user_of_fpu], eax
-
 
286
        shl   eax, 8
-
 
287
        add   eax, 0x80000
-
 
288
        cmp   [eax + APPDATA.is_fpu_saved], 0
-
 
289
        je    @f
-
 
290
        frstor [eax+APPDATA.fpu_save_area]
-
 
291
     @@:
315
        mov eax, [ebx+PROC_BASE+APPDATA.fpu_state]
292
        mov   [eax + APPDATA.is_fpu_saved], 1
316
        frstor [eax]
Line 293... Line 317...
293
        restore_ring3_context
317
        restore_ring3_context
294
        iret
318
        iret
295
        
319
 
Line 296... Line 320...
296
iglobal
320
iglobal
297
  prev_user_of_fpu dd 1
321
  fpu_owner dd 1
Line 609... Line 633...
609
        ;     ebx = new amount of memory
633
        ;     ebx = new amount of memory
Line 610... Line 634...
610
 
634
 
611
        cmp    eax,1
635
        cmp    eax,1
Line 612... Line 636...
612
        jne    .no_application_mem_resize
636
        jne    .no_application_mem_resize
-
 
637
 
613
        
638
        stdcall new_mem_resize, ebx
Line 614... Line 639...
614
        jmp    new_mem_resize ;resize for new type of processes
639
        mov [esp+36], eax
615
 
-
 
616
 
640
        ret
Line 617... Line 641...
617
     .no_application_mem_resize:
641
 
Line 730... Line 754...
730
  term9:
754
  term9:
Line 731... Line 755...
731
 
755
 
Line 732... Line 756...
732
    call  set_application_table_status
756
    call  set_application_table_status
733
    
-
 
Line -... Line 757...
-
 
757
 
-
 
758
    mov    eax,esi
-
 
759
 
-
 
760
    pushad
-
 
761
    shl   eax,8
-
 
762
    mov   eax,[PROC_BASE+eax+0xB8]
734
    mov    eax,esi
763
    stdcall destroy_app_space, eax
735
    call   dispose_app_cr3_table
764
    popad
736
 
765
 
737
    cmp   [prev_user_of_fpu],esi   ; if user fpu last -> fpu user = 1
766
    cmp   [fpu_owner],esi   ; if user fpu last -> fpu user = 1
Line 738... Line 767...
738
    jne   fpu_ok_1
767
    jne   fpu_ok_1
739
    mov   [prev_user_of_fpu],1
768
    mov   [fpu_owner],1