Re: [Fwd: Hard disk geometry]

Andrew Clausen (clausen@alphalink.com.au)
Fri, 22 Oct 1999 08:09:37 -0400


Andries.Brouwer@cwi.nl wrote:
> So all that matters to me is that the geometry on the software side,
> no matter what operating system, needs to be the same.
>
> Does Windows determine the geometry from the partition table ONLY?
>
> It can use: (i) the disk, (ii) the BIOS setup, (iii) the partition table.
> In a Linux context ingredient (ii) is unavailable.

Yep. Do you know what DOS/Windows actually use?

> If that's the case, then there's no problem - we can use any geometry we
> like, by writing it to the partition table (because Windows assumes each
> partition ends on the end of a cylinder,
>
> I consider that a common myth. What are your sources, or experiments?
> I did some experiments four years ago and found this false for DOS.
> This is also false for Windows NT on an Alpha.

I didn't assert this - I have no idea if it's true. But DOS fdisk
always creates partitions according to these rules, so it is reasonable
to determine the geometry DOS is using from this, but its not reasonable
to write out a new geometry, expecting DOS to use it. Correct?

It seems the hard disk's actual geometry, and the geometry as DOS
sees it are two different things. A program that wants to be
compatible with DOS should then use the geometry as DOS sees it, which
is in turn the same as the BIOS sees it (correct?). In this case,
the said program should use BIOS to determine the geometry. Correct?

But it's near impossible to call BIOS from user-space. OK, it can
be done - setting up a virtual machine like dos-emu...but this is
ridiculous for a partition program.

Methinks there should be some interface for getting the geometry
as DOS sees it from the linux kernel with some ugly ioctl, or
something. I know this is a Bad Thing TM, but are there any
other alternatives?

Andrew Clausen

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