From 641ed233800730a82d5bbe231ae1634233d17e08 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sat, 8 Apr 2023 00:31:57 +0300 Subject: [PATCH] Kernel: Fix framepointers on started threads --- kernel/arch/i386/Thread.S | 1 + kernel/arch/x86_64/Thread.S | 1 + 2 files changed, 2 insertions(+) diff --git a/kernel/arch/i386/Thread.S b/kernel/arch/i386/Thread.S index af2cb91c..e31f3787 100644 --- a/kernel/arch/i386/Thread.S +++ b/kernel/arch/i386/Thread.S @@ -15,6 +15,7 @@ start_thread: movl 8(%esp), %ecx movl 4(%esp), %esp movl $0, %ebp + movl $0, (%esp) pushl $exit_thread_trampoline sti jmp *%ecx diff --git a/kernel/arch/x86_64/Thread.S b/kernel/arch/x86_64/Thread.S index 3c72cb17..a75600c9 100644 --- a/kernel/arch/x86_64/Thread.S +++ b/kernel/arch/x86_64/Thread.S @@ -14,6 +14,7 @@ start_thread: movq %rdi, %rsp popq %rdi movq $0, %rbp + movq $0, (%rsp) pushq $exit_thread_trampoline sti jmp *%rsi