Subject: Re: Woops, forgot to CC the list: More disk questions
To: Bill Squier <groo@guinness.cs.stevens-tech.edu>
From: Joel Reicher <void@yoyo.cc.monash.edu.au>
List: port-i386
Date: 08/15/1997 09:48:34
I'm entering this a bit late, so please excuse any repeat of questions.

On Thu, 14 Aug 1997, Bill Squier wrote:

---snip!---

> However, I still have a couple of questions.  Can someone check me on my 
> assumptions:
> 
> 1) The disk has a real, honest to God geometry.  That is, it really is 
> organized into a certain number of cyls, has a certain number of heads, and 
> has a certain number of sectors per track.  (I hope at least _this_ is true :) 
> )

To the best of my knowledge, the answer is 'yes' depending on what you 
consider to be 'the disk'. What the computer sees is only what the logic 
on the disk shows it, and as AFAIK _nothing_, not the BIOS or the OS, can 
see the _real_ geometry of the disk, only what the disk's onboard logic 
presents that as.

To expand, in your case the answer is probably effectively yes. The errors 
you're getting would be a conflict between BIOS and OS components, and 
would not go down that far into hardware details.

FYI, disks are set up that way because they are circular, and the inner 
tracks aren't as long as outer tracks. The arrangement that the logic 
presents is just not physically efficient, so it fakes it, and in reality 
does something else. I stress though, that this is irrelevant to your 
problems.

> 
> 2) The controller talks to the physical disk using these parameters.

I don't honestly know a definite yes, but I can't think of any other way 
it would work. :)

> 
> 3) The BIOS provides geometry translation so braindead operating systems can 
> access the disk.

Eek. Umm...
The BIOS was certainly responsible for old style translation, called CHS 
and usually displayed in the bios as "Large" (as opposed to "Normal" or 
"LBA").
But in some weird way I think the disk's onboard logic participates in 
the LBA translation, so I don't know how much the BIOS is exactly 
responsible for. For all I know it may pass the address straight through 
with a flag saying "Hey, this is LBA!".

> 
> It seems to me that all three of these can't be true.  If they are, why can't 
> an operating system update eliminate all the geometry translation nonsense?

Ok, I get really uncertain here, but I _think_ that the BIOS's 
understanding of the disk geometry is only always used for booting. Some 
OS's use it for other things, but they don't have to. Once the OS loads, 
it can bang the disk controller directly, and not call the BIOS disk 
routines.

> 
> Secondly, why is it that 
> 
> 1) On a label pasted on the top of the disk, it says 1416 cyls, 16 heads, 63 
> spt
> 1.5) www.wdc.com says the Caviar AC2700 has 1416/16/63

Same reason for both of these. That's the untranslated geometry that the 
disk's logic is displaying.

> 2) The BIOS says 1416/16/63

See below.

> 3) NetBSD says 1416/16/63 when it asks the drive

I think NetBSD is successfully (yay!) probing the disk and getting the 
untranslated geometry.

> 4) pfdisk claims 707/32/63

pfdisk is showing you the same kind of geometry translation that I get. 
Heads are doubled, and cylinders are halved, as well as one translated 
cylinder being subtracted. I don't know why it does that last bit, all I 
can say is that it happens to me also. Probably something DOSish.

What is really confusing is how this disagrees with the BIOS. Somebody 
else mentioned this could be a Win95 effect. Could you please, please, 
please do any DOS stuff from a MS-DOS 6.22 boot disk from now on. 
Windows95 is just too smart for simple tasks like this.

Ok, now for my questions. What geometries does your BIOS give you options 
for? Also how does it get these geometries? Does it have an auto-detect? 
If so, it's probably probing the same way NetBSD does.

Finally, if NetBSD is the only thing on the disk, you _should_ be able to 
forget about translation altogether. The only thing that needs to 
correspond is NetBSD's and the BIOS's understanding of the geometry, so 
that all the booting stuff can be found by both of them.

To anyone else reading this, I'm really rusty on this old and not often 
used knowledge, so please correct lest I mislead anyone.

One last thing. Does your BIOS have any funky configuration utilities? 
Like for EISA or some other that might be unique to your brand of 
computer? If so, it might be saving that stuff somewhere on the 
harddrive. I've seen Compaq's doing this. You might want to go RTFM to 
make sure this isn't interfering.

Cheers,
	- Joel Reicher