]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
change the check for a Windows partition in chainloader_func, to fix the problem...
authorokuji <okuji@localhost>
Tue, 27 Feb 2001 13:17:40 +0000 (13:17 +0000)
committerokuji <okuji@localhost>
Tue, 27 Feb 2001 13:17:40 +0000 (13:17 +0000)
ChangeLog
stage2/builtins.c
stage2/shared.h

index 1f29e4b8bb58472dd7e6fd02ff39a530235d582a..a67f4596e55c2e964af9b92bfeb8bbaff2644780 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-02-27  OKUJI Yoshinori  <okuji@gnu.org>
+
+       * stage2/builtins.c (chainloader_func): Don't check if the
+       current partition is FAT, but check if it has a FAT partition
+       type and the BPB has a system id starting with "MSWIN".
+       
 2001-02-27  OKUJI Yoshinori  <okuji@gnu.org>
 
        Added hercules support based on a patch by Frank Mehnert
index a47fc0320414599dc9a6a8b5ae93a17cbb703c83..02e236faf237f9c0e2a0e7e0fd3717400148cfe1 100644 (file)
@@ -448,12 +448,10 @@ chainloader_func (char *arg, int flags)
   grub_close ();
   kernel_type = KERNEL_TYPE_CHAINLOADER;
 
-  /* XXX: Windows evil hack. I don't know why, but Windows seems not to
-     set the start address of an extended partition in the BPB correctly.
-     So this is necessary to make Windows bootable even with an extended
-     partition. Maybe this should be made only for Windows, but how can
-     we determine if it is Windows or not precisely?!  */
-  if (open_partition () && fat_mount ())
+  /* XXX: Windows evil hack. For now, only the first five letters are
+     checked.  */
+  if (IS_PC_SLICE_TYPE_FAT (current_slice)
+      && ! grub_memcmp (BOOTSEC_LOCATION + BOOTSEC_BPB_SYSTEM_ID, "MSWIN", 5))
     *((unsigned long *) (BOOTSEC_LOCATION + BOOTSEC_BPB_HIDDEN_SECTORS))
       = part_start;
 
index eac287a03f2329808de5d4d9ff36456cc444c150..d6285b17a3eeef6aea4c079ad52fc2aa7ef3f078 100644 (file)
@@ -175,6 +175,7 @@ extern char *grub_scratch_mem;
 #define BOOTSEC_SIGNATURE              0xAA55
 #define BOOTSEC_BPB_OFFSET             0x3
 #define BOOTSEC_BPB_LENGTH             0x3B
+#define BOOTSEC_BPB_SYSTEM_ID          0x3
 #define BOOTSEC_BPB_HIDDEN_SECTORS     0x1C
 #define BOOTSEC_PART_OFFSET            0x1BE
 #define BOOTSEC_PART_LENGTH            0x40