]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-06-16 Pavel Roskin <proski@gnu.org>
authorproski <proski@localhost>
Mon, 15 Jun 2009 23:25:38 +0000 (23:25 +0000)
committerproski <proski@localhost>
Mon, 15 Jun 2009 23:25:38 +0000 (23:25 +0000)
* boot/i386/pc/boot.S: Remove root_drive.  Assert offset of
boot_drive_check by using GRUB_BOOT_MACHINE_DRIVE_CHECK.  Don't
save %dx, we only need %dl and we never change it.
* boot/i386/pc/cdboot.S: Don't set the root drive.
* boot/i386/pc/pxeboot.S: Likewise.
* include/grub/i386/pc/boot.h: Remove
GRUB_BOOT_MACHINE_ROOT_DRIVE, adjust
GRUB_BOOT_MACHINE_DRIVE_CHECK.
* include/grub/i386/pc/kernel.h: Remove grub_root_drive.
* kern/i386/pc/init.c (make_install_device): Remove references
to grub_root_drive.
* kern/i386/pc/startup.S: Likewise.
* util/i386/pc/grub-setup.c (setup): Don't set root_drive.

ChangeLog
boot/i386/pc/boot.S
boot/i386/pc/cdboot.S
boot/i386/pc/pxeboot.S
include/grub/i386/pc/boot.h
include/grub/i386/pc/kernel.h
kern/i386/pc/init.c
kern/i386/pc/startup.S
util/i386/pc/grub-setup.c

index 27c0eec5c70fc48ce3848152db71ee9ad29ef6d3..64153e0e374556876952c7420bcb32fa4effc655 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2009-06-16  Pavel Roskin  <proski@gnu.org>
+
+       * boot/i386/pc/boot.S: Remove root_drive.  Assert offset of
+       boot_drive_check by using GRUB_BOOT_MACHINE_DRIVE_CHECK.  Don't
+       save %dx, we only need %dl and we never change it.
+       * boot/i386/pc/cdboot.S: Don't set the root drive.
+       * boot/i386/pc/pxeboot.S: Likewise.
+       * include/grub/i386/pc/boot.h: Remove
+       GRUB_BOOT_MACHINE_ROOT_DRIVE, adjust
+       GRUB_BOOT_MACHINE_DRIVE_CHECK.
+       * include/grub/i386/pc/kernel.h: Remove grub_root_drive.
+       * kern/i386/pc/init.c (make_install_device): Remove references
+       to grub_root_drive.
+       * kern/i386/pc/startup.S: Likewise.
+       * util/i386/pc/grub-setup.c (setup): Don't set root_drive.
+
 2009-06-16  Vladimir Serbinenko  <phcoder@gmail.com>
 
        xnu_uuid command
index 2cd505e6abc62025125e9ea7870f06b91cd1c443..8d8c27c82987b5b62858a67aa1a9a2b85a5f234b 100644 (file)
@@ -102,8 +102,6 @@ kernel_sector:
 boot_drive:
        .byte 0xff      /* the disk to load kernel from */
                        /* 0xff means use the boot drive */
-root_drive:
-        .byte 0xff
 
 after_BPB:
 
@@ -118,6 +116,7 @@ after_BPB:
          * possible boot drive. If GRUB is installed into a floppy,
          * this does nothing (only jump).
          */
+       . = _start + GRUB_BOOT_MACHINE_DRIVE_CHECK
 boot_drive_check:
         jmp     1f     /* grub-setup may overwrite this jump */
         testb   $0x80, %dl
@@ -151,14 +150,12 @@ real_start:
        /*
         *  Check if we have a forced disk reference here
         */
-        /* assign root_drive at the same time */
 #ifdef APPLE_CC
        boot_drive_abs = ABS (boot_drive)
-       movw    boot_drive_abs, %ax
+       movb    boot_drive_abs, %al
 #else
-       movw    ABS(boot_drive), %ax
+       movb   ABS(boot_drive), %al
 #endif
-        movb    %ah, %dh
        cmpb    $0xff, %al
        je      1f
        movb    %al, %dl
@@ -343,7 +340,6 @@ setup_sectors:
 
        /* restore %dl */
        popw    %dx
-        pushw   %dx
 
        /* head start */
        movb    %al, %dh
@@ -399,7 +395,6 @@ copy_buffer:
 
        popw    %ds
        popa
-        popw    %dx
 
        /* boot kernel */
 #ifdef APPLE_CC
index 688b26c7d01acf32283df338a2208ca8c55a4f91..efa65f511dde339d75aa61f04f3152ddc464be04 100644 (file)
@@ -86,9 +86,6 @@ bi_reserved:
 
        call    read_cdrom
 
-        /* Root drive will default to boot drive */
-        movb    $0xFF, %dh
-
        ljmp    $(DATA_ADDR >> 4), $0
 
 /*
index 1b51127f64a49184bfd07299a52de6981c3c21c5..2fc53bc812f02122612798c2417921e3d303912a 100644 (file)
@@ -27,8 +27,7 @@
 _start:
 start:
 
-        /* Root drive will default to boot drive */
-        movb   $0xFF, %dh
+       /* Use drive number 0x7F for PXE */
         movb   $0x7F, %dl
 
        /* Jump to the real world */
index 3862214146e614fb6cd30c88db6b97b59e218245..f35cb3a279020a2c67f835486f4b407b78f6b7c7 100644 (file)
@@ -34,9 +34,6 @@
 /* The offset of BOOT_DRIVE.  */
 #define GRUB_BOOT_MACHINE_BOOT_DRIVE   0x4c
 
-/* The offset of ROOT_DRIVE.  */
-#define GRUB_BOOT_MACHINE_ROOT_DRIVE   0x4d
-
 /* The offset of KERNEL_ADDRESS.  */
 #define GRUB_BOOT_MACHINE_KERNEL_ADDRESS       0x40
 
@@ -47,7 +44,7 @@
 #define GRUB_BOOT_MACHINE_KERNEL_SEGMENT       0x42
 
 /* The offset of BOOT_DRIVE_CHECK.  */
-#define GRUB_BOOT_MACHINE_DRIVE_CHECK  0x4f
+#define GRUB_BOOT_MACHINE_DRIVE_CHECK  0x4e
 
 /* The offset of a magic number used by Windows NT.  */
 #define GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC     0x1b8
index 5acc883f5d606c98b4151a330e049e6f5832d169..5b9d8dcb53e771cb21d65ecd5f283a30d9cb08b1 100644 (file)
@@ -71,9 +71,6 @@ extern char grub_prefix[];
 /* The boot BIOS drive number.  */
 extern grub_uint8_t EXPORT_VAR(grub_boot_drive);
 
-/* The root BIOS drive number.  */
-extern grub_uint8_t grub_root_drive;
-
 #endif /* ! ASM_FILE */
 
 #endif /* ! KERNEL_MACHINE_HEADER */
index b5339214e002a32cfd3b2b51d93f819b6e1d2cf1..ebe4bb6ea5157fece4bcca8c89dae06f82471617 100644 (file)
@@ -60,13 +60,10 @@ make_install_device (void)
 
   if (grub_prefix[0] != '(')
     {
-      /* If the root drive is not set explicitly, assume that it is identical
-         to the boot drive.  */
-      if (grub_root_drive == 0xFF)
-        grub_root_drive = grub_boot_drive;
-
-      grub_sprintf (dev, "(%cd%u", (grub_root_drive & 0x80) ? 'h' : 'f',
-                    grub_root_drive & 0x7f);
+      /* No hardcoded root partition - make it from the boot drive and the
+        partition number encoded at the install time.  */
+      grub_sprintf (dev, "(%cd%u", (grub_boot_drive & 0x80) ? 'h' : 'f',
+                   grub_boot_drive & 0x7f);
 
       if (grub_install_dos_part >= 0)
        grub_sprintf (dev + grub_strlen (dev), ",%u", grub_install_dos_part + 1);
index 0f80e8ab87af5606af92a579dfe0183aa8110b63..f77d7dbe3e4f73b67df8c028e883e8f234a08ebc 100644 (file)
@@ -195,9 +195,8 @@ codestart:
 
        sti             /* we're safe again */
 
-       /* save boot and root drive references */
+       /* save the boot drive */
        ADDR32  movb    %dl, EXT_C(grub_boot_drive)
-       ADDR32  movb    %dh, EXT_C(grub_root_drive)
 
        /* reset disk system (%ah = 0) */
        int     $0x13
@@ -300,9 +299,6 @@ codestart:
 VARIABLE(grub_boot_drive)
        .byte   0
 
-VARIABLE(grub_root_drive)
-       .byte   0
-
        .p2align        2       /* force 4-byte alignment */
 
 /*
index bdf234c645513ef88867634eeb189814462e0ae9..5a519645b83f9f95b65d80f18bdab49b25096467 100644 (file)
@@ -94,7 +94,7 @@ setup (const char *dir,
   grub_uint16_t core_sectors;
   grub_device_t root_dev, dest_dev;
   const char *dest_partmap;
-  grub_uint8_t *boot_drive, *root_drive;
+  grub_uint8_t *boot_drive;
   grub_disk_addr_t *kernel_sector;
   grub_uint16_t *boot_drive_check;
   struct boot_blocklist *first_block, *block;
@@ -207,7 +207,6 @@ setup (const char *dir,
 
   /* Set the addresses of variables in the boot image.  */
   boot_drive = (grub_uint8_t *) (boot_img + GRUB_BOOT_MACHINE_BOOT_DRIVE);
-  root_drive = (grub_uint8_t *) (boot_img + GRUB_BOOT_MACHINE_ROOT_DRIVE);
   kernel_sector = (grub_disk_addr_t *) (boot_img
                                     + GRUB_BOOT_MACHINE_KERNEL_SECTOR);
   boot_drive_check = (grub_uint16_t *) (boot_img
@@ -379,7 +378,6 @@ setup (const char *dir,
 
   /* FIXME: can this be skipped?  */
   *boot_drive = 0xFF;
-  *root_drive = 0xFF;
 
   *kernel_sector = grub_cpu_to_le64 (embed_region.start);
 
@@ -513,7 +511,6 @@ unable_to_embed:
 
   /* FIXME: can this be skipped?  */
   *boot_drive = 0xFF;
-  *root_drive = 0xFF;
 
   *install_dos_part = grub_cpu_to_le32 (dos_part);
   *install_bsd_part = grub_cpu_to_le32 (bsd_part);