From bce944d1498eaa3b6940ee234c863b3548a66b37 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 24 Jan 2021 12:00:11 -0500 Subject: graphics! --- src/kernel/isrs.asm | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) (limited to 'src/kernel/isrs.asm') diff --git a/src/kernel/isrs.asm b/src/kernel/isrs.asm index 472bb40..02b046d 100644 --- a/src/kernel/isrs.asm +++ b/src/kernel/isrs.asm @@ -22,8 +22,9 @@ extern advance_active_task extern on_kbd_isr extern make_sure_tasks extern exception_halt +extern pf_check_stack -n_syscalls equ 0x10 +n_syscalls equ 0x19 ;section .bss ;_debug_is_start_task resb 1 @@ -149,30 +150,59 @@ kbd_isr: udf_isr: push 0 push udid - call exception_halt + jmp exception dfa_isr: push dfid - call exception_halt + jmp exception tsf_isr: push tsid - call exception_halt + jmp exception npf_isr: push npid - call exception_halt + jmp exception ssf_isr: push ssid - call exception_halt + jmp exception gpf_isr: push gpid - call exception_halt + jmp exception pff_isr: + push eax + push ecx + push edx + + mov eax, cr2 + push eax + call pf_check_stack + add esp, 4 + + pop edx + pop ecx + test eax, eax + jz .not_stack + + pop eax + add esp, 4 + iret + +.not_stack: + pop eax push pfid + jmp exception + +exception: + push edi + push esi + push edx + push ecx + push ebx + push eax call exception_halt section .rodata -- cgit v1.2.3