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 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
&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)