From 958b7177511c426bb2dffff87397d2d55f10c596 Mon Sep 17 00:00:00 2001 From: ngiddings Date: Tue, 5 Jul 2022 15:19:20 -0500 Subject: [PATCH] Fixed state save after process preemption --- src/x86/preempt.S | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/x86/preempt.S b/src/x86/preempt.S index d341100..6b4cfea 100644 --- a/src/x86/preempt.S +++ b/src/x86/preempt.S @@ -34,7 +34,7 @@ isr_preempt: // Save base pointer; it points to the interrupt stack frame mov %esp, %ebp - sub $4, %ebp + add $4, %ebp // Save EAX on stack so it can be used as a buffer push %eax @@ -44,19 +44,19 @@ isr_preempt: push %eax // Load EIP, then push it onto stack - mov 16(%ebp), %eax + mov (%ebp), %eax push %eax // Load CS, then push it onto stack - mov 12(%ebp), %eax - push %eax - - // Load ESP, then push it onto stack mov 4(%ebp), %eax push %eax + // Load ESP, then push it onto stack + mov 12(%ebp), %eax + push %eax + // Load SS, then push it onto stack - mov (%ebp), %eax + mov 16(%ebp), %eax push %eax // Load EBP, then push it onto stack