/kernel/trunk/core/except.inc |
---|
5,13 → 5,13 |
reg_eflags equ ebp+12 |
reg_esp equ ebp+16 |
reg_ss equ ebp+20 |
fpu_ctrl equ ebp-28 |
;fpu_ctrl equ ebp-28 |
align 4 |
except_16: |
push ebp |
mov ebp, esp |
sub esp, 28 |
; sub esp, 28 |
push eax |
push ebx |
41,12 → 41,54 |
iretd |
.default: |
pop edx |
pop ecx |
pop ebx |
pop eax |
leave |
fnstenv [fpu_ctrl] |
fnclex |
or word [fpu_ctrl], 0111111b |
fldenv [fpu_ctrl] |
save_ring3_context ;debugger support |
mov bl, 16 |
jmp exc_c |
; fnstenv [fpu_ctrl] |
; fnclex |
; or word [fpu_ctrl], 0111111b |
; fldenv [fpu_ctrl] |
; pop edx |
; pop ecx |
; pop ebx |
; pop eax |
; leave |
; iretd |
align 16 |
except_19: |
push ebp |
mov ebp, esp |
push eax |
push ebx |
push ecx |
push edx |
mov ebx, [ss:CURRENT_TASK] |
shl ebx, 8 |
mov eax, [ss:ebx+PROC_BASE+APPDATA.sse_handler] |
test eax, eax |
jz .default |
mov ecx, [reg_eip] |
mov edx, [reg_esp] |
sub edx, 4 |
mov [ss:edx+new_app_base], ecx |
mov [reg_esp], edx |
mov dword [reg_eip], eax |
pop edx |
pop ecx |
pop ebx |
55,10 → 97,21 |
leave |
iretd |
.default: |
pop edx |
pop ecx |
pop ebx |
pop eax |
leave |
save_ring3_context ;debugger support |
mov bl, 19 |
jmp exc_c |
restore reg_eip |
restore reg_cs |
restore reg_eflags |
restore reg_esp |
restore reg_ss |
restore fpu_ctrl |
;restore fpu_ctrl |
/kernel/trunk/core/memory.inc |
---|
4,7 → 4,7 |
align 4 |
proc mem_test |
mov eax, cr0 |
or eax, 0x60000000 ;disable caching |
or eax, (CR0_CD+CR0_NW);disable caching |
mov cr0, eax |
wbinvd ;invalidate cache |
17,7 → 17,7 |
xchg ebx, dword [edi] |
je @b |
and eax, 0x21 |
and eax, not (CR0_CD+CR0_NW) |
mov cr0, eax |
mov eax, edi |
ret |
40,7 → 40,10 |
jnc @F |
or eax, PG_GLOBAL |
or ebx, CR4_PGE |
@@: |
mov cr4, ebx |
mov dword [sys_pgdir], eax |
add eax, 0x00400000 |
mov dword [sys_pgdir+4], eax |
52,8 → 55,6 |
mov dword [sys_pgdir+0x600], sys_master_tab+PG_SW |
mov dword [sys_master_tab+0x600], sys_master_tab+PG_SW |
mov cr4, ebx |
mov ecx, [pg_data.kernel_tables] |
sub ecx, 4 |
mov eax, tmp_page_tab+PG_SW |
1102,6 → 1103,15 |
stdcall srv_handlerEx, ebx |
mov [esp+36], eax |
ret |
@@: |
cmp eax, 18 |
ja @f |
mov ecx, [CURRENT_TASK] |
shl ecx, 8 |
mov eax, [ecx+PROC_BASE+APPDATA.sse_handler] |
mov [ecx+PROC_BASE+APPDATA.sse_handler], ebx |
mov [esp+36], eax |
ret |
@@: |
.fail: |
/kernel/trunk/core/sys32.inc |
---|
172,8 → 172,8 |
dd e8,e9,e10,e11 |
dd e12,e13,page_fault_handler,e15 |
dd except_16, e17 |
times 14 dd unknown_interrupt |
dd except_16, e17,e18, except_19 |
times 12 dd unknown_interrupt |
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 |
219,7 → 219,7 |
jmp exc_c |
} |
exc_wo_code 0, 1, 2, 3, 4, 5, 6, 9, 15 ; 18, 19 |
exc_wo_code 0, 1, 2, 3, 4, 5, 6, 9, 15, 18 |
exc_w_code 8, 10, 11, 12, 13, 14, 17 |
exc_c: |