]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-06-08 Vladimir Serbinenko <phcoder@gmail.com>
authorphcoder <phcoder@localhost>
Mon, 8 Jun 2009 13:29:05 +0000 (13:29 +0000)
committerphcoder <phcoder@localhost>
Mon, 8 Jun 2009 13:29:05 +0000 (13:29 +0000)
Not fail if unable to retrieve C/H/S on LBA disks

* disk/i386/pc/biosdisk.c (grub_biosdisk_open): behave gracefully
if unable to retrieve C/H/S on LBA disks

ChangeLog
disk/i386/pc/biosdisk.c

index b9ef1ba4039d911126ff0f7464bc54837ed49099..6eb19f8a44e33d2214d6ed24caa66d15aba19fcb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-06-08  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Not fail if unable to retrieve C/H/S on LBA disks
+
+       * disk/i386/pc/biosdisk.c (grub_biosdisk_open): behave gracefully 
+       if unable to retrieve C/H/S on LBA disks
+
 2009-06-08  Pavel Roskin  <proski@gnu.org>
 
        * fs/hfs.c (grub_hfs_find_dir): Use union to avoid a warning
index ba1eb77b85bf30e2c46babc5a69d8d4f768b406c..f9663305aaca65f40712448f7e8b0efef02c91b7 100644 (file)
@@ -158,8 +158,20 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
                                               &data->heads,
                                               &data->sectors) != 0)
         {
-          grub_free (data);
-          return grub_error (GRUB_ERR_BAD_DEVICE, "cannot get C/H/S values");
+         if (total_sectors && (data->flags & GRUB_BIOSDISK_FLAG_LBA))
+           {
+             data->sectors = 63;
+             data->heads = 255;
+             data->cylinders 
+               = grub_divmod64 (total_sectors 
+                                + data->heads * data->sectors - 1, 
+                                data->heads * data->sectors, 0);
+           }
+         else
+           {
+             grub_free (data);
+             return grub_error (GRUB_ERR_BAD_DEVICE, "cannot get C/H/S values");
+           }
         }
 
       if (! total_sectors)