]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Make mb header to protected part
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 25 Sep 2010 19:42:13 +0000 (21:42 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 25 Sep 2010 19:42:13 +0000 (21:42 +0200)
grub-core/kern/i386/pc/startup.S
include/grub/offsets.h

index 9319df98ee1f99c470cd9fabf54fc3406d59c0e9..c4abc31b89fb26b9349efa907ca29b027aa24a7c 100644 (file)
@@ -109,7 +109,58 @@ bss_start:
 bss_end:
        .long 0
 #endif
+/*
+ *  This is the area for all of the special variables.
+ */
+
+VARIABLE(grub_boot_drive)
+       .byte   0
+
+/* the real mode code continues... */
+LOCAL (codestart):
+       cli             /* we're not safe here! */
 
+       /* set up %ds, %ss, and %es */
+       xorw    %ax, %ax
+       movw    %ax, %ds
+       movw    %ax, %ss
+       movw    %ax, %es
+
+       /* set up the real mode/BIOS stack */
+       movl    $GRUB_MEMORY_MACHINE_REAL_STACK, %ebp
+       movl    %ebp, %esp
+
+       sti             /* we're safe again */
+
+       /* save the boot drive */
+       ADDR32  movb    %dl, EXT_C(grub_boot_drive)
+
+       /* reset disk system (%ah = 0) */
+       int     $0x13
+
+       /* transition to protected mode */
+       DATA32  call real_to_prot
+
+       /* The ".code32" directive takes GAS out of 16-bit mode. */
+       .code32
+
+       incl    %eax
+       call    grub_gate_a20
+
+       movl    EXT_C(grub_compressed_size), %edx
+       addl    $(GRUB_KERNEL_MACHINE_RAW_SIZE - GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART), %edx
+       movl    reed_solomon_redundancy, %ecx
+       leal    _start + GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART, %eax
+       testl   %edx, %edx
+       jz post_reed_solomon
+       call    EXT_C (grub_reed_solomon_recover)
+       jmp post_reed_solomon
+
+#include <rs_decoder.S>
+
+       .text
+
+       . = _start + GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART
 /*
  * Support for booting GRUB from a Multiboot boot loader (e.g. GRUB itself).
  * This uses the a.out kludge to load raw binary to the area starting at 1MB,
@@ -173,53 +224,7 @@ multiboot_trampoline:
         movb    $0xFF, %dh
        /* enter the usual booting */
        call    prot_to_real
-       .code16
-
-/* the real mode code continues... */
-LOCAL (codestart):
-       cli             /* we're not safe here! */
-
-       /* set up %ds, %ss, and %es */
-       xorw    %ax, %ax
-       movw    %ax, %ds
-       movw    %ax, %ss
-       movw    %ax, %es
-
-       /* set up the real mode/BIOS stack */
-       movl    $GRUB_MEMORY_MACHINE_REAL_STACK, %ebp
-       movl    %ebp, %esp
-
-       sti             /* we're safe again */
-
-       /* save the boot drive */
-       ADDR32  movb    %dl, EXT_C(grub_boot_drive)
-
-       /* reset disk system (%ah = 0) */
-       int     $0x13
-
-       /* transition to protected mode */
-       DATA32  call real_to_prot
-
-       /* The ".code32" directive takes GAS out of 16-bit mode. */
-       .code32
 
-       incl    %eax
-       call    grub_gate_a20
-
-       movl    EXT_C(grub_compressed_size), %edx
-       addl    $(GRUB_KERNEL_MACHINE_RAW_SIZE - GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART), %edx
-       movl    reed_solomon_redundancy, %ecx
-       leal    _start + GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART, %eax
-       testl   %edx, %edx
-       jz post_reed_solomon
-       call    EXT_C (grub_reed_solomon_recover)
-       jmp post_reed_solomon
-
-#include <rs_decoder.S>
-
-       .text
-
-       . = _start + GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART
 post_reed_solomon:
 
 #ifdef ENABLE_LZMA
@@ -289,15 +294,6 @@ post_reed_solomon:
         */
        call EXT_C(grub_main)
 
-/*
- *  This is the area for all of the special variables.
- */
-
-VARIABLE(grub_boot_drive)
-       .byte   0
-
-       .p2align        2       /* force 4-byte alignment */
-
 #include "../realmode.S"
 
 /*
index 28db0115cf96a6b986ee85afc3d8c9ad3a73fe93..f11dffacaa5f43ee899a9f481fe871fc96f47302 100644 (file)
@@ -41,9 +41,9 @@
 #define GRUB_KERNEL_I386_PC_MULTIBOOT_SIGNATURE 0x20
 
 /* The size of the first region which won't be compressed.  */
-#define GRUB_KERNEL_I386_PC_RAW_SIZE           0xc80
+#define GRUB_KERNEL_I386_PC_RAW_SIZE           0xc90
 
-#define GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART 0x75c
+#define GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART 0x6f8
 
 /* The offset of GRUB_PREFIX.  */
 #define GRUB_KERNEL_I386_PC_PREFIX             GRUB_KERNEL_I386_PC_RAW_SIZE