From 3399c4570c6050b065f9cb64892db7e65ff92b2b Mon Sep 17 00:00:00 2001 From: Matheus Date: Sun, 12 Apr 2026 22:14:08 -0300 Subject: [PATCH] isr: allow stack traces to cross interrupts --- kernel-src/arch/x86-64/isr.asm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/kernel-src/arch/x86-64/isr.asm b/kernel-src/arch/x86-64/isr.asm index 3b81c7c9..c212ac8b 100644 --- a/kernel-src/arch/x86-64/isr.asm +++ b/kernel-src/arch/x86-64/isr.asm @@ -57,8 +57,17 @@ isr_common: mov rdi, rbp ; vec mov rsi, rsp ; ctx - ; set this as the end of the stack frame - xor rbp, rbp + ; set this as the end of the stack frame or continue it + cmp qword [rsp + 184], 0x8 + jne .zero_frame + push qword [rsp + 176] + push qword [rsp + 168] + jmp .keep_going + .zero_frame: + push qword 0 + push qword 0 + .keep_going: + mov rbp, rsp cld extern interrupt_isr @@ -66,7 +75,7 @@ isr_common: cli ; pop context - add rsp, 24 ; cr2 gs and fs are not popped. + add rsp, 40 ; cr2 gs and fs are not popped. pop rax mov es,rax pop rax