Subject: Re: Supporting sector size != DEV_BSIZE
To: Bill Studenmund <wrstuden@netbsd.org>
From: Trevin Beattie <trevin@xmission.com>
List: tech-kern
Date: 10/08/2001 12:03:25
At 05:38 AM 10/7/2001 -0700, you wrote:
>Well, it's nice that you feel they have no basis in reality. They've been
>that way for quite a while. :-)

So I see, according to PR kern/495 (7 years old!)

>
>I've been there and done that. You can check out the results on the
>wrstuden-dev-bsize branch. I had scsi disks working fine, with both 512
>and 2048 byte sectors in the same system. i386 floppies had a problem.

Where would I find that branch?

>
>There are three PRs in the database talking about different ways to fix
>this. They were written by a Japanese developer, who unfortunatly died in
>a motorcycle accident shortly there after. My efforts on the branch were
>following one of the PRs (forgot which one) which got rid of DEV_BSIZE.

I've seen PR's kern/3790, 3791, & 3792 (which were written for NetBSD-1.2E)
and even tried applying them to NetBSD-1.4.2, but still had problems.  The
later PR's deal with the Amiga port.  Although these early patches seem
better developed than mine, the last NetBSD release has well over 300
expressions which evaluate DEV_BSHIFT, and none of the patches appear to
cover all of them.

>
>The branch is abandoned at the moment. Among other things, Chuck Silvers,
>who has done the UBC work, has followed on with a different approach (one
>of the other PRs). As he is making things happen and I am not in a
>position to work on it, I'll let him finish things up.

Is there any documentation of his efforts and progress?

>
>See past threads and the PRs. You've basically presented two of the three
>options.

From the introductory comments, I can't tell the difference between PR's
3790 and 3792.  3792 just has more changes.  (In fact, the initial part of
3792 is almost identical to 3790.)

What I'd like more than seeing a patch, though, is a well thought-out (and
documented) design.  The meaning of block size vs. fragment size vs. sector
size should be explained, their usage and boundaries at various levels of
the kernel clearly defined, and their storage locations in disk structures
and in memory given.  (For example, the sector size given in a disk label
should be used only to convert partition offsets and sizes from sectors to
bytes, not for determining block numbers in a partition (which are in terms
of fragment size) or even physical sector numbers, since (as was pointed
out by Chris G. Demetriou in PR 3460) a file system could be dumped from
one disk to another having a different sector size.)

-----------------------
Trevin Beattie          "Do not meddle in the affairs of wizards,
trevin@xmission.com     for you are crunchy and good with ketchup."
      {:->                                     --unknown