]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/lib/i386/relocator16.S (grub_relocator16_start): Move switch
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 5 Feb 2012 09:12:18 +0000 (10:12 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 5 Feb 2012 09:12:18 +0000 (10:12 +0100)
to real mode down to execute A20-related code in protected mode as
intended.

ChangeLog
grub-core/lib/i386/relocator16.S

index 078d2aeccb25e0dc26507c758bea158f2a7cfa34..09777c513573803dddf08c588111a21a2abfcead 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-02-05  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/lib/i386/relocator16.S (grub_relocator16_start): Move switch
+       to real mode down to execute A20-related code in protected mode as
+       intended.
+
 2012-02-05  GrĂ©goire Sutre  <gregoire.sutre@gmail.com>
 
        * grub-core/disk/diskfilter.c (grub_diskfilter_make_raid): Return
index babe69e1d2f7d31868bb110a88b9f5050ebb7cec..8500c2f947f2628fbfd8a7aaae1831cfa841ef9c 100644 (file)
@@ -63,37 +63,6 @@ VARIABLE(grub_relocator16_start)
        andl    $(~GRUB_MEMORY_CPU_CR4_PAE_ON), %eax
        movl    %eax, %cr4
 
-       /* Update other registers. */
-       movl    $PSEUDO_REAL_DSEG, %eax
-       movl    %eax, %ds
-       movl    %eax, %es
-       movl    %eax, %fs
-       movl    %eax, %gs
-       movl    %eax, %ss
-
-       movl    %esi, %eax
-       shrl    $4, %eax
-       movw    %ax, (LOCAL (segment) - LOCAL (base)) (%esi, 1)
-       
-       /* jump to a 16 bit segment */
-       ljmp    $PSEUDO_REAL_CSEG, $(LOCAL (cont2) - LOCAL(base))
-LOCAL(cont2):
-       .code16
-
-       /* clear the PE bit of CR0 */
-       movl    %cr0, %eax
-       andl    $(~GRUB_MEMORY_CPU_CR0_PE_ON), %eax
-       movl    %eax, %cr0
-
-       /* flush prefetch queue, reload %cs */
-       /* ljmp  */
-       .byte   0xea
-       .word   LOCAL(cont3)-LOCAL(base)
-LOCAL(segment):
-       .word   0
-
-LOCAL(cont3):
-
        /* movw imm16, %ax.  */
        .byte   0xb8
 VARIABLE(grub_relocator16_keep_a20_enabled)
@@ -172,6 +141,37 @@ LOCAL(gate_a20_check_state):
        ret
 
 LOCAL(gate_a20_done):
+       /* Update other registers. */
+       movl    $PSEUDO_REAL_DSEG, %eax
+       movl    %eax, %ds
+       movl    %eax, %es
+       movl    %eax, %fs
+       movl    %eax, %gs
+       movl    %eax, %ss
+
+       movl    %esi, %eax
+       shrl    $4, %eax
+       movw    %ax, (LOCAL (segment) - LOCAL (base)) (%esi, 1)
+       
+       /* jump to a 16 bit segment */
+       ljmp    $PSEUDO_REAL_CSEG, $(LOCAL (cont2) - LOCAL(base))
+LOCAL(cont2):
+       .code16
+
+       /* clear the PE bit of CR0 */
+       movl    %cr0, %eax
+       andl    $(~GRUB_MEMORY_CPU_CR0_PE_ON), %eax
+       movl    %eax, %cr0
+
+       /* flush prefetch queue, reload %cs */
+       /* ljmp  */
+       .byte   0xea
+       .word   LOCAL(cont3)-LOCAL(base)
+LOCAL(segment):
+       .word   0
+
+LOCAL(cont3):
+
        /* we are in real mode now
         * set up the real mode segment registers : DS, SS, ES
         */