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
This commit is contained in:
parent
b57ea2c975
commit
de65ee2b2c
2 changed files with 21 additions and 2 deletions
|
@ -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>
|
2009-06-08 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
* fs/hfs.c (grub_hfs_find_dir): Use union to avoid a warning
|
* fs/hfs.c (grub_hfs_find_dir): Use union to avoid a warning
|
||||||
|
|
|
@ -158,8 +158,20 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
|
||||||
&data->heads,
|
&data->heads,
|
||||||
&data->sectors) != 0)
|
&data->sectors) != 0)
|
||||||
{
|
{
|
||||||
grub_free (data);
|
if (total_sectors && (data->flags & GRUB_BIOSDISK_FLAG_LBA))
|
||||||
return grub_error (GRUB_ERR_BAD_DEVICE, "cannot get C/H/S values");
|
{
|
||||||
|
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)
|
if (! total_sectors)
|
||||||
|
|
Loading…
Reference in a new issue