- Change movw $0x0000,%ax to xorw %ax,%ax (because of probable bug in binutils, which...
authorMagnus Olsen <magnus@greatlord.com>
Sun, 19 Nov 2006 17:01:23 +0000 (17:01 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Sun, 19 Nov 2006 17:01:23 +0000 (17:01 +0000)
- 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
reactos/boot/freeldr/freeldr/arch/i386/int386.S

index 9b93f89..200c56e 100644 (file)
@@ -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
index b8504f1..7069a13 100644 (file)
@@ -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 */