Subject: Re: MTD devices in NetBSD
To: Charles M. Hannum <mycroft@MIT.EDU>
From: Terry Moore <>
List: tech-kern
Date: 03/23/2006 18:45:30
At 06:06 PM 3/23/2006 -0500, Charles M. Hannum wrote:
>On Thu, Mar 23, 2006 at 11:52:18PM +0100, Jachym Holecek wrote:
> > Is there a good reason why the block remapper should be prevented from
> > only operating over a couple of flash device extents and leaving the
> > rest mapped 1:1 (in other words, have the bootloader partition 1:1 and
> > only block-remap the "/" partition)?
>Yes.  There's no guarantee that any particular physical block on a NAND
>device is usable.  Except, as I noted before, that most devices are
>guaranteed to have a good block 0.  So if your "boot partition" happens
>to fit entirely in block 0, and you're not rewriting it too often,

I agree with Charles.

FWIW, these guarantees on block 0 cost money (for high volume 
products); additional test, sorting time, or possibly some extra 
silicon area, etc., so the chips cost a little more to make, and 
therefore normally cost a little more to put into a product.  For 
general-purpose applications, normally one would try to avoid 
depending on any particular location. Instead one does what FFS (for 
example) does, namely sprinkle header blocks across the media, which 
reduces the probability of disaster to something much more tolerable.

As Charles points out, if you have a fixed bootloader that can't deal 
with a flash abstraction layer, you have to depend on block zero, but 
that's probably a 2005/2006/2007 kind of problem; the bootloaders are 
probably going to have to get smarter.