On 16.03.2011 21:09, Lennart Sorensen wrote: > On Wed, Mar 16, 2011 at 03:23:58PM -0400, Lennart Sorensen wrote: > >> On Wed, Mar 16, 2011 at 03:19:48PM -0400, Phillip Susi wrote: >> >>> On 3/16/2011 1:32 PM, Lennart Sorensen wrote: >>> >>>> So I now have some debug info: >>>> >>>> version=48 >>>> total_sectors=156312576 C=16383 H=16 S=63 >>>> error: hd0,msdos1 out of disk. >>>> Entering rescue mode... >>>> grub rescue> >>>> >>>> So version is returning something, and it is actually getting the disk >>>> size properly. I wonder what else could cause the out of disk message >>>> then. >>>> >>> What does the partition table look like? It doesn't extend beyond >>> sector 156312575 does it? >>> >>> Also I wonder about why H=16. It should be 255. >>> >> Well usually it should, but not always. >> >> Here is the partition table: >> >> Disk /dev/sda: 80.0 GB, 80032038912 bytes >> 255 heads, 63 sectors/track, 9730 cylinders, total 156312576 sectors >> Units = sectors of 1 * 512 = 512 bytes >> Sector size (logical/physical): 512 bytes / 512 bytes >> I/O size (minimum/optimal): 512 bytes / 512 bytes >> Disk identifier: 0x0004a073 >> >> Device Boot Start End Blocks Id System >> /dev/sda1 * 2048 152350719 76174336 83 Linux >> /dev/sda2 152352766 156311551 1979393 5 Extended >> /dev/sda5 152352768 156311551 1979392 82 Linux swap / Solaris >> > I have now determined that the call to grub_biosdisk_rw_int13_extensions > fails here: > > if (grub_biosdisk_rw_int13_extensions (cmd + 0x42, data->drive, dap)) > { > /* Fall back to the CHS mode. */ > data->flags &= ~GRUB_BIOSDISK_FLAG_LBA; > disk->total_sectors = data->cylinders * data->heads * > data->sectors; > return grub_biosdisk_rw (cmd, disk, sector, size, segment); > } > > Then LBA gets disabled, and access beyond CHS range is gone, and the > error about 'out of disk' happens. > > Following may help: === modified file 'grub-core/disk/i386/pc/biosdisk.c' --- grub-core/disk/i386/pc/biosdisk.c 2011-01-04 14:42:47 +0000 +++ grub-core/disk/i386/pc/biosdisk.c 2011-03-16 20:17:57 +0000 @@ -80,6 +80,9 @@ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; grub_bios_interrupt (0x13, ®s); + if (!(regs.flags & GRUB_CPU_INT_FLAGS_CARRY)) + return 0; + return (regs.eax >> 8) & 0xff; }
-- Regards Vladimir 'φ-coder/phcoder' Serbinenko
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel