]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-06-22 Robert Millan <rmh.grub@aybabtu.com>
authorrobertmh <robertmh@localhost>
Mon, 22 Jun 2009 10:42:37 +0000 (10:42 +0000)
committerrobertmh <robertmh@localhost>
Mon, 22 Jun 2009 10:42:37 +0000 (10:42 +0000)
        * kern/i386/pc/startup.S (real_to_prot): Move from here ...
        * kern/i386/realmode.S (real_to_prot): ... to here.

ChangeLog
kern/i386/pc/startup.S
kern/i386/realmode.S

index b8d3afaf17ae838436a2a945c32dbc605b6028ce..ea303ce19ab7d140ccb6a5fde6ba251296e2cca2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-22  Robert Millan  <rmh.grub@aybabtu.com>
+
+       * kern/i386/pc/startup.S (real_to_prot): Move from here ...
+       * kern/i386/realmode.S (real_to_prot): ... to here.
+
 2009-06-22  Robert Millan  <rmh.grub@aybabtu.com>
 
        * conf/i386-ieee1275.rmk (pkglib_PROGRAMS): Replace `kernel.elf'
index f77d7dbe3e4f73b67df8c028e883e8f234a08ebc..cb3fec6ba687a5f690dc4aa3960d0044f28a6251 100644 (file)
@@ -290,8 +290,6 @@ codestart:
         */
        call EXT_C(grub_main)
 
-#include "../realmode.S"
-
 /*
  *  This is the area for all of the special variables.
  */
@@ -301,62 +299,7 @@ VARIABLE(grub_boot_drive)
 
        .p2align        2       /* force 4-byte alignment */
 
-/*
- *  These next two routines, "real_to_prot" and "prot_to_real" are structured
- *  in a very specific way.  Be very careful when changing them.
- *
- *  NOTE:  Use of either one messes up %eax and %ebp.
- */
-
-real_to_prot:
-       .code16
-       cli
-
-       /* load the GDT register */
-#ifdef APPLE_CC
-       mov %cs, %ax
-       mov %ax, %ds
-       DATA32  ADDR32  lgdt    gdtdesc
-#else
-       DATA32  ADDR32  lgdt    %cs:gdtdesc
-#endif
-
-       /* turn on protected mode */
-       movl    %cr0, %eax
-       orl     $GRUB_MEMORY_MACHINE_CR0_PE_ON, %eax
-       movl    %eax, %cr0
-
-       /* jump to relocation, flush prefetch queue, and reload %cs */
-       DATA32  ljmp    $GRUB_MEMORY_MACHINE_PROT_MODE_CSEG, $protcseg
-
-       .code32
-protcseg:
-       /* reload other segment registers */
-       movw    $GRUB_MEMORY_MACHINE_PROT_MODE_DSEG, %ax
-       movw    %ax, %ds
-       movw    %ax, %es
-       movw    %ax, %fs
-       movw    %ax, %gs
-       movw    %ax, %ss
-
-       /* put the return address in a known safe location */
-       movl    (%esp), %eax
-       movl    %eax, GRUB_MEMORY_MACHINE_REAL_STACK
-
-       /* get protected mode stack */
-       movl    protstack, %eax
-       movl    %eax, %esp
-       movl    %eax, %ebp
-
-       /* get return address onto the right stack */
-       movl    GRUB_MEMORY_MACHINE_REAL_STACK, %eax
-       movl    %eax, (%esp)
-
-       /* zero %eax */
-       xorl    %eax, %eax
-
-       /* return on the old (or initialized) stack! */
-       ret
+#include "../realmode.S"
 
 /*
  * grub_gate_a20(int on)
index d28c5ca56ca495a0c4f92c63da59c0d4be680fec..075aa57e901ea05554e7364bf40139b0922518f2 100644 (file)
@@ -110,12 +110,62 @@ gdtdesc:
        .long   gdt                     /* addr */
 
 /*
- *  These next routine, "prot_to_real" is structured in a very
- *  specific way.  Be very careful when changing it.
+ *  These next two routines, "real_to_prot" and "prot_to_real" are structured
+ *  in a very specific way.  Be very careful when changing them.
  *
- *  NOTE:  Use of it messes up %eax and %ebp.
+ *  NOTE:  Use of either one messes up %eax and %ebp.
  */
 
+real_to_prot:
+       .code16
+       cli
+
+       /* load the GDT register */
+#ifdef APPLE_CC
+       mov %cs, %ax
+       mov %ax, %ds
+       DATA32  ADDR32  lgdt    gdtdesc
+#else
+       DATA32  ADDR32  lgdt    %cs:gdtdesc
+#endif
+
+       /* turn on protected mode */
+       movl    %cr0, %eax
+       orl     $GRUB_MEMORY_MACHINE_CR0_PE_ON, %eax
+       movl    %eax, %cr0
+
+       /* jump to relocation, flush prefetch queue, and reload %cs */
+       DATA32  ljmp    $GRUB_MEMORY_MACHINE_PROT_MODE_CSEG, $protcseg
+
+       .code32
+protcseg:
+       /* reload other segment registers */
+       movw    $GRUB_MEMORY_MACHINE_PROT_MODE_DSEG, %ax
+       movw    %ax, %ds
+       movw    %ax, %es
+       movw    %ax, %fs
+       movw    %ax, %gs
+       movw    %ax, %ss
+
+       /* put the return address in a known safe location */
+       movl    (%esp), %eax
+       movl    %eax, GRUB_MEMORY_MACHINE_REAL_STACK
+
+       /* get protected mode stack */
+       movl    protstack, %eax
+       movl    %eax, %esp
+       movl    %eax, %ebp
+
+       /* get return address onto the right stack */
+       movl    GRUB_MEMORY_MACHINE_REAL_STACK, %eax
+       movl    %eax, (%esp)
+
+       /* zero %eax */
+       xorl    %eax, %eax
+
+       /* return on the old (or initialized) stack! */
+       ret
+
 prot_to_real:
        /* just in case, set GDT */
        lgdt    gdtdesc