Re: [RFC] Restoring HDIO_GETGEO semantics (was: Re: workaround for BIOS / CHS stuff)

From: Andrew Clausen
Date: Sat Jul 03 2004 - 10:03:57 EST


On Sat, Jul 03, 2004 at 03:40:01PM +0100, Anton Altaparmakov wrote:
> > XP home edition (the green box)
>
> Hm, I only ever tried XP Pro.

I guess we can try diff'ing the bootstrap code. Should probably do this
in private for copyright reasons...

> > > Does it use NTFS as both the boot and system drive?
> >
> > I am using a single NTFS partition.
>
> I have lots of partitions (mostly Linux, NTFS is at end of disk).

If NTFS is at the end of the disk, doesn't it have to use LBA to address
it?

> > Note: I reversed-engineered the Windows FAT bootstrap code. My analysis
> > is contained in the file doc/FAT in the Parted source distribution. I
> > concluded that Windows uses LBA if the LBA flag is set in the boot
> > partition table entry. (i.e. the partition type includes LBA in the
> > fdisk codes - this corresponds to a bit being set)
>
> Interesting. Maybe I don't have this bit set?

This bit only applies to FAT, AFAIK. There is no corresponding bit
for NTFS.

> > > u16 sectors_per_track; /* Required to boot Windows. */
> > > u16 heads; /* Required to boot Windows. */
> > > u32 hidden_sectors; /* Offset to the start of the partition relative
> > > to the disk in sectors. Required to boot Windows. */
> >
> > I just set the first 2 of these fields to 0, and everything still works.
> > Am I blessed? (Or perhaps cursed!)
>
> Odd. Messing up any of the above three values makes my XP Pro fail to
> boot!

Interesting. How is your BIOS configured? (LBA, Auto, CHS or Large?
what CHS values?)

Cheers,
Andrew

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/