From 3f01f936a10134d354c3797069ff6b1c21f96718 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 af2cb91c22..e31f378729 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 3c72cb179d..a75600c930 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