From a24ea27b470a710c841622fab6ccd64dbe61481a Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sun, 19 Nov 2006 17:01:23 +0000 Subject: [PATCH] - Change movw $0x0000,%ax to xorw %ax,%ax (because of probable bug in binutils, which compiles the first instruction into something weird) - Add segment registers save+restore in Int386() in FreeLdr (thanks to tamlin too) svn path=/trunk/; revision=24776 --- reactos/boot/freeldr/freeldr/arch/i386/arch.S | 2 +- reactos/boot/freeldr/freeldr/arch/i386/int386.S | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/reactos/boot/freeldr/freeldr/arch/i386/arch.S b/reactos/boot/freeldr/freeldr/arch/i386/arch.S index 9b93f899d0e..200c56e50d9 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/arch.S +++ b/reactos/boot/freeldr/freeldr/arch/i386/arch.S @@ -84,7 +84,7 @@ EXTERN(switch_to_prot) /* Of course CS has to already be valid. */ /* We are currently in real-mode so we */ /* need real-mode segment values. */ - movw $0x0000,%ax + xorw %ax,%ax movw %ax,%ds movw %ax,%es movw %ax,%fs diff --git a/reactos/boot/freeldr/freeldr/arch/i386/int386.S b/reactos/boot/freeldr/freeldr/arch/i386/int386.S index b8504f19266..7069a13aaf3 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/int386.S +++ b/reactos/boot/freeldr/freeldr/arch/i386/int386.S @@ -74,7 +74,12 @@ EXTERN(_Int386) movl 0x0c(%esp),%eax movl %eax,Int386_regsout + /* Save all registers + segment registers */ pushal + pushw %ds + pushw %es + pushw %fs + pushw %gs /* Copy the input regs to our variables */ movl $Int386_REGS,%edi @@ -147,6 +152,11 @@ Int386_vector_opcode: rep movsb + /* Restore segment and all other registers */ + popw %gs + popw %fs + popw %es + popw %ds popal /* Get return value */