54,18 → 54,18 |
; ----------------------------------------- |
|
app_code_l: |
dw ((0x80000000-std_application_base_address) shr 12) and 0xffff |
dw 0xFFFF;((0x80000000-std_application_base_address) shr 12) and 0xffff |
dw 0 |
db 0 |
dw 11010000b*256+11111010b+256*((0x80000000-std_application_base_address) shr 28) |
db std_application_base_address shr 24 |
db 0x40 |
db cpl3 |
dw G32+D32+0x6000+0x7; |
|
app_data_l: |
dw (0x80000000-std_application_base_address) shr 12 and 0xffff |
dw 0xFFFF;(0x80000000-std_application_base_address) shr 12 and 0xffff |
dw 0 |
db 0 |
dw 11010000b*256+11110010b+256*((0x80000000-std_application_base_address) shr 28) |
db std_application_base_address shr 24 |
db 0x40 |
db drw3 |
dw G32+D32+0x6000+0x7; |
|
graph_data_l: |
|
81,11 → 81,10 |
gdte: |
|
|
|
idtreg: |
dw 8*0x41-1 |
dd idts+8 |
label idts at 0xB100-8 |
;label idts at 0xB100-8 |
|
|
|
166,16 → 165,20 |
|
ret |
|
|
|
iglobal |
sys_int: |
dd e0,debug_exc,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15 |
dd e16,e17 |
dd e0,debug_exc,e2,e3 |
dd e4,e5,e6,e7 |
dd e8,e9,e10,e11 |
dd e12,e13,page_fault_handler,e15 |
|
dd except_16, e17 |
times 14 dd unknown_interrupt |
|
dd irq0 ,irq1 ,p_irq2 ,p_irq3 ,p_irq4 ,p_irq5,p_irq6 ,p_irq7 |
dd p_irq8,p_irq9,p_irq10,p_irq11,p_irq12,irqD ,p_irq14,p_irq15 |
dd irq0 , irq_serv.irq_1, p_irq2 ,irq_serv.irq_3 |
dd p_irq4 ,irq_serv.irq_5,p_irq6,irq_serv.irq_7 |
dd irq_serv.irq_8, irq_serv.irq_9, irq_serv.irq_10 |
dd irq_serv.irq_11,p_irq12,irqD ,p_irq14,p_irq15 |
|
times 16 dd unknown_interrupt |
|
216,7 → 219,7 |
jmp exc_c |
} |
|
exc_wo_code 0, 1, 2, 3, 4, 5, 6, 9, 15, 16 ; 18, 19 |
exc_wo_code 0, 1, 2, 3, 4, 5, 6, 9, 15 ; 18, 19 |
exc_w_code 8, 10, 11, 12, 13, 14, 17 |
|
exc_c: |
276,25 → 279,46 |
mov ds, ax |
mov es, ax |
|
mov eax, [prev_user_of_fpu] |
shl eax, 8 |
add eax, 0x80000 + APPDATA.fpu_save_area |
fsave [eax] |
mov ebx, [fpu_owner] |
cmp ebx, [CURRENT_TASK] |
je .exit |
|
mov eax, [0x3000] |
mov [prev_user_of_fpu], eax |
shl eax, 8 |
add eax, 0x80000 |
cmp [eax + APPDATA.is_fpu_saved], 0 |
je @f |
frstor [eax+APPDATA.fpu_save_area] |
@@: |
mov [eax + APPDATA.is_fpu_saved], 1 |
shl ebx, 8 |
mov eax, [ebx+PROC_BASE+APPDATA.fpu_state] |
bt [cpu_caps], CAPS_FXSR |
jnc .no_SSE |
|
fxsave [eax] |
mov ebx, [CURRENT_TASK] |
mov [fpu_owner], ebx |
shl ebx, 8 |
cmp dword [ebx+PROC_BASE+APPDATA.fpu_init], 0 |
je .init |
mov eax, [ebx+PROC_BASE+APPDATA.fpu_state] |
fxrstor [eax] |
restore_ring3_context |
iret |
.init: |
fninit ; ¬ ¥ ã¦ë ¥¬ ᪨஢ ë¥ ¨áª«î票ï |
mov dword [ebx+PROC_BASE+APPDATA.fpu_init], 1 |
.exit: |
restore_ring3_context |
iret |
.no_SSE: |
fnsave [eax] |
mov ebx, [CURRENT_TASK] |
mov [fpu_owner], ebx |
shl ebx, 8 |
cmp dword [ebx+PROC_BASE+APPDATA.fpu_init], 0 |
je .init |
|
mov eax, [ebx+PROC_BASE+APPDATA.fpu_state] |
frstor [eax] |
restore_ring3_context |
iret |
|
iglobal |
prev_user_of_fpu dd 1 |
fpu_owner dd 1 |
endg |
|
|
611,11 → 635,11 |
cmp eax,1 |
jne .no_application_mem_resize |
|
jmp new_mem_resize ;resize for new type of processes |
stdcall new_mem_resize, ebx |
mov [esp+36], eax |
ret |
|
|
.no_application_mem_resize: |
|
ret |
|
|
732,11 → 756,16 |
call set_application_table_status |
|
mov eax,esi |
call dispose_app_cr3_table |
|
cmp [prev_user_of_fpu],esi ; if user fpu last -> fpu user = 1 |
pushad |
shl eax,8 |
mov eax,[PROC_BASE+eax+0xB8] |
stdcall destroy_app_space, eax |
popad |
|
cmp [fpu_owner],esi ; if user fpu last -> fpu user = 1 |
jne fpu_ok_1 |
mov [prev_user_of_fpu],1 |
mov [fpu_owner],1 |
fpu_ok_1: |
|
mov [0xf400],byte 0 ; empty keyboard buffer |