Subject: Re: MTD devices in NetBSD
To: Garrett D'Amore <garrett_damore@tadpole.com>
From: marty fouts <mf.danger@gmail.com>
List: tech-kern
Date: 03/23/2006 14:22:48
On 3/23/06, Garrett D'Amore <garrett_damore@tadpole.com> wrote:
> Terry Moore wrote:
> > CF cards are done with NAND flash.  They don't "know where things
> > are", they just have an intermediate layer that provides an
> > abstraction.  Due to patents, this is done in a variety of ways.
>
> In order to provide that layer, they have to have somewhere to store
> their persistent data.  So they are able to make assumptions about where
> they can stick stuff on flash.

You don't have to have that ability, and at least one system doesn't.=20
What you have to have is a block signature that uniquely identifies
the blocks storing the persistent data.  With that in place, at boot,
you scan until you find such a block and go from there.  Everything
you know about the system is relative to the info in such blocks, and
usually, you duplicate them.

>
> If I follow that approach, the end result will be a flash system that is
> only useful to itself.  I.e. you won't have a way to directly access
> blocks of data at a specific physical sector.
>

This is, in fact, how the commercial systems present themselves.

> This can have bad effects, e.g. for some flash systems which need to
> store data like bootloaders at a specific offset in flash.
>

On NAND, you can't have a bootloader like that.  As a minimum, the
bootloader needs to be able to deal with bad block management.