From bbdb8bd8110c1404a115540fd9b6e08190ed981c Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 23 Apr 2019 16:14:21 -0700 Subject: [PATCH] Avoid corrupting eax during system call. --- kern/trapentry.S | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/kern/trapentry.S b/kern/trapentry.S index 3e7a622..31b211f 100644 --- a/kern/trapentry.S +++ b/kern/trapentry.S @@ -81,14 +81,12 @@ TRAPHANDLER(t_default, T_DEFAULT); .globl _alltraps _alltraps: sub $0x2, %esp - mov %ds, %eax - push %ax + pushw %ds sub $0x2, %esp - mov %es, %eax - push %ax + pushw %es pushal mov $(GD_KD), %eax - movl %eax, %ds - movl %eax, %es + movw %ax, %ds + movw %ax, %es pushl %esp call trap