Subject: BIOS / pfdisk / sysinst glitches ?
To: Danny Thomas <D.Thomas@vthrc.uq.edu.au>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-i386
Date: 07/12/1998 14:45:22
>Maybe I'm just tired, but I thought it would be easier to set up a machine
>with several OS'. I'm trying with an FIC PA-2007 motherboard, K6/200,
>Quantum Fireball ST3.2A disk. NetBSD-1.3.2/i386

>   1)

[pfdisk does smart things.]

I'd guess some LBA translation is going on. pfdisk seems to DTRT, but
it gets its geometry direct from the BIOS, not by reading the MBR.


>  2)

>Now the curious thing is the installer reports geometry as
>  real geom 6256 cyl, 128 heads, 63 sec
>  BIOS geom 782 cyl, 128 heads, 63 cyl
>when I think the real heads should be 16
>
>If I change the type of partition for 4) to be not 0xA5, the real geometry
>does report 16 heads! Is this a problem with sysinst or pfdisk?

This looks like a bug. Please send a PR so it doesn't get forgotten.

Could this be caused by the LBA which seems to be happening in (1),
and blindly trusting the values in the MBR, rather than getting the
BIOS's idea of how to do LBA ?



>3) when sysinst is listing the partitions, I saw:
>   0     8  1408  1416
>   1  1416  1408  2824
>   2  2824  1408  4232
>   3  4232  2016  6248
>I guess it depends on the definition of 'end', but I'd say partition 0
>spanned sectors 8 thru 1415 and so on. When I first saw this I was
>concerned that maybe partitions were overlapping.

An MBR Partition from block A to block B spans (B - A +1) blocks (try
it with A == B) so adding the length to the start to get the end the
code needs to subtract 1, or it lists the first block of the next
partition (as you noticed).

It's certainly a different convention from pfdisk, which is Bad.
Please send a (separate) PR.  Or a patch :).