*BSD News Article 34699


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!constellation!convex!insosf1.infonet.net!yeshua.marcam.com!charnel.ecst.csuchico.edu!xmission!u.cc.utah.edu!cs.weber.edu!terry
From: terry@cs.weber.edu (Terry Lambert)
Newsgroups: comp.os.386bsd.development
Subject: Re: FreeBSD 2.0: someone please fix mount_pcfs
Date: 21 Aug 1994 04:30:41 GMT
Organization: Weber State University, Ogden, UT
Lines: 56
Message-ID: <336l9h$9jc@u.cc.utah.edu>
References: <331v11$kjs@news.u.washington.edu> <335mao$20r@u.cc.utah.edu> <vanepp.777418589@sfu.ca>
NNTP-Posting-Host: cs.weber.edu

In article <vanepp.777418589@sfu.ca> vanepp@fraser.sfu.ca (Peter Van Epp) writes:
] terry@cs.weber.edu (Terry Lambert) writes:
] 
] >In article <331v11$kjs@news.u.washington.edu> tzs@u.washington.edu (Tim Smith) writes:
] ...
] >] I'm not sure I understand the problem.  Why can't the OS figure out the
] >] geometry by reading the partition map?  MS-DOS partitions end on cylinder
] >] boundaries, and so by looking at the partition map entry for DOS the
] >] dos partition, you can figure out the number of sectors and heads
] >] that the BIOS reported to DOS when DOS fdisk created the DOS partition.
] 
] >Because this presumes that the C/H/S values are non-commutative, which
] >would not be the case in 1 out of 4 circumsatnces where there are two
] >partitions on the disk and the translated geometry values for H and S
] >offsets for both partitions had two or more common multiplicative
] >factors.  If that were the case, you would not be able to determine if
] >the factor belonged to the C or to the H.
] 
] 	Perhaps I'm dense, but I still don't see a problem here. You are 
] trying to read a DOS partition. The entry for the DOS partition in the 
] partition table has a starting cyl head record, and an ending cyl head 
] record for the partition as well as an  absolute block count from the 
] start of the disk for the start and end block of the partition. The
] end of partition HR values will give you the same number of heads, and
] the number of sectors that DOS int 13 ah=8 will give you. It will not
] give you the number of cylinders that DOS thinks are there for the whole
] disk, but I don't see that you care for this application. It will 
] give you what cylinders DOS believes it owns in terms of its partition
] and what geometry DOS thinks exists in that partition (which is undoubtably
] important to pcfs).

[ ... ]

] 	Am I (like the original poster) missing something obvious?

I see your problem:  not all DOS OEM's versions of fdisk, nor all versions
of OnTrack's disk software correctly fill out anything other than the C/H/S
values used by BIOS.  This means that your absolute block counts are not
reliable (if they exist instead of simply containing random garbage).

In addition, the sector offsets, when present, refer to the BIOS logical
sector, not the physical sector, so drive controllers whose BIOS entry
points interleave rplacement cylinders will have cylinder offsets that
are inaccurate for a protected mode driver which does not incorporate
the precise interleave algorithm.  Many ESDI drives fall into the second
category.

If everyone ran non-translating controllers and MS DOS 6.2, there would
not be a problem.


					Terry Lambert
					terry@cs.weber.edu
---
Any opinions in this posting are my own and not those of my present
or previous employers.