]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-01-05 Robert Millan <rmh@aybabtu.com>
authorrobertmh <robertmh@localhost>
Sat, 5 Jan 2008 12:14:05 +0000 (12:14 +0000)
committerrobertmh <robertmh@localhost>
Sat, 5 Jan 2008 12:14:05 +0000 (12:14 +0000)
        * kern/i386/loader.S (grub_linux_is_bzimage): New variable.
        (grub_linux_boot_zimage): Rename to ...
        (grub_linux_boot): ... this.
        (grub_linux_boot_bzimage): Merge with `grub_linux_boot_zimage'.
        (grub_linux_boot_zimage): Conditionalize zImage copy.

        * include/grub/i386/loader.h (grub_linux_is_bzimage): Add prototype.
        (grub_linux_boot_bzimage): Remove prototype.
        (grub_linux_boot_zimage): Rename to ...
        (grub_linux_boot): ... this.

        * loader/i386/pc/linux.c (big_linux): Replace with `grub_linux_is_bzimage'.
        (grub_linux_boot): Remove function.

ChangeLog
include/grub/i386/loader.h
kern/i386/loader.S
loader/i386/pc/linux.c

index 7d27decfc05ea06f60e546be2b116d267889a914..554ac03b17f85a5365c28b95a40cead10ae57a1b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2008-01-05  Robert Millan  <rmh@aybabtu.com>
+
+       * kern/i386/loader.S (grub_linux_is_bzimage): New variable.
+       (grub_linux_boot_zimage): Rename to ...
+       (grub_linux_boot): ... this.
+       (grub_linux_boot_bzimage): Merge with `grub_linux_boot_zimage'.
+       (grub_linux_boot_zimage): Conditionalize zImage copy.
+
+       * include/grub/i386/loader.h (grub_linux_is_bzimage): Add prototype.
+       (grub_linux_boot_bzimage): Remove prototype.
+       (grub_linux_boot_zimage): Rename to ...
+       (grub_linux_boot): ... this.
+
+       * loader/i386/pc/linux.c (big_linux): Replace with `grub_linux_is_bzimage'.
+       (grub_linux_boot): Remove function.
+
 2008-01-05  Robert Millan  <rmh@aybabtu.com>
 
        * include/grub/normal.h (grub_env_write_color_normal): New prototype.
index 6d9ecb9f084b06e7847b966fcbe3f6d56fbbfaca..45a1652e2c28bf5474405055503323790c37aeae 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2002,2003,2004,2007  Free Software Foundation, Inc.
+ *  Copyright (C) 2002,2003,2004,2007,2008  Free Software Foundation, Inc.
  *
  *  GRUB is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
 extern grub_uint32_t EXPORT_VAR(grub_linux_prot_size);
 extern char *EXPORT_VAR(grub_linux_tmp_addr);
 extern char *EXPORT_VAR(grub_linux_real_addr);
+extern grub_int32_t EXPORT_VAR(grub_linux_is_bzimage);
 extern grub_addr_t EXPORT_VAR(grub_os_area_addr);
 extern grub_size_t EXPORT_VAR(grub_os_area_size);
 
-void EXPORT_FUNC(grub_linux_boot_zimage) (void) __attribute__ ((noreturn));
-void EXPORT_FUNC(grub_linux_boot_bzimage) (void) __attribute__ ((noreturn));
+void EXPORT_FUNC(grub_linux_boot) (void) __attribute__ ((noreturn));
 
 /* The asm part of the multiboot loader.  */
 void EXPORT_FUNC(grub_multiboot_real_boot) (grub_addr_t entry, 
index 9254c43302d22d21e14244e72a62122a8a49424e..266f4efeae2961cf99b0ad44cd8f45d6424cefec 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007 Free Software Foundation, Inc.
+ *  Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008 Free Software Foundation, Inc.
  *
  *  GRUB is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -56,8 +56,17 @@ VARIABLE(grub_linux_tmp_addr)
        .long   0
 VARIABLE(grub_linux_real_addr)
        .long   0
+VARIABLE(grub_linux_is_bzimage)
+       .long   0
        
-FUNCTION(grub_linux_boot_zimage)
+FUNCTION(grub_linux_boot)
+       /* Must be done before zImage copy.  */
+       call    EXT_C(grub_dl_unload_all)
+
+       movl    EXT_C(grub_linux_is_bzimage), %ebx
+       test    %ebx, %ebx
+       jne bzimage
+
        /* copy the kernel */
        movl    EXT_C(grub_linux_prot_size), %ecx
        addl    $3, %ecx
@@ -68,9 +77,7 @@ FUNCTION(grub_linux_boot_zimage)
        rep
        movsl
 
-FUNCTION(grub_linux_boot_bzimage)
-       call    EXT_C(grub_dl_unload_all)
-       
+bzimage:
        movl    EXT_C(grub_linux_real_addr), %ebx
 
        /* copy the real mode code */
index 818f762e3b20ab8dfb9b0b1b6f904b1bf65bff00..d66fd205196c153bb69a0d73b46e79bc40a3a1af 100644 (file)
@@ -1,7 +1,7 @@
 /* linux.c - boot Linux zImage or bzImage */
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007  Free Software Foundation, Inc.
+ *  Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008  Free Software Foundation, Inc.
  *
  *  GRUB is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
 
 static grub_dl_t my_mod;
 
-static int big_linux;
 static grub_size_t linux_mem_size;
 static int loaded;
 
-static grub_err_t
-grub_linux_boot (void)
-{
-  if (big_linux)
-    grub_linux_boot_bzimage ();
-  else
-    grub_linux_boot_zimage ();
-
-  /* Never reach here.  */
-  return GRUB_ERR_NONE;
-}
-
 static grub_err_t
 grub_linux_unload (void)
 {
@@ -106,14 +93,14 @@ grub_rescue_cmd_linux (int argc, char *argv[])
       goto fail;
     }
 
-  big_linux = 0;
+  grub_linux_is_bzimage = 0;
   setup_sects = lh.setup_sects;
   linux_mem_size = 0;
   
   if (lh.header == grub_cpu_to_le32 (GRUB_LINUX_MAGIC_SIGNATURE)
       && grub_le_to_cpu16 (lh.version) >= 0x0200)
     {
-      big_linux = (lh.loadflags & GRUB_LINUX_FLAG_BIG_KERNEL);
+      grub_linux_is_bzimage = (lh.loadflags & GRUB_LINUX_FLAG_BIG_KERNEL);
       lh.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE;
       
       /* Put the real mode part at as a high location as possible.  */
@@ -158,7 +145,7 @@ grub_rescue_cmd_linux (int argc, char *argv[])
   
   grub_linux_tmp_addr = (char *) GRUB_LINUX_BZIMAGE_ADDR + prot_size;
 
-  if (! big_linux
+  if (! grub_linux_is_bzimage
       && prot_size > (grub_size_t) (grub_linux_real_addr
                                    - (char *) GRUB_LINUX_ZIMAGE_ADDR))
     {
@@ -177,7 +164,7 @@ grub_rescue_cmd_linux (int argc, char *argv[])
     }
 
   grub_printf ("   [Linux-%s, setup=0x%x, size=0x%x]\n",
-              big_linux ? "bzImage" : "zImage", real_size, prot_size);
+              grub_linux_is_bzimage ? "bzImage" : "zImage", real_size, prot_size);
 
   for (i = 1; i < argc; i++)
     if (grub_memcmp (argv[i], "vga=", 4) == 0)