public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [SPAM] FAT on NAND
@ 2003-04-04  6:21 jimzeus
  2003-04-04  9:40 ` David Woodhouse
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: jimzeus @ 2003-04-04  6:21 UTC (permalink / raw)
  To: linux-mtd

Hi, all:


What I am doing now is to build a filesystem which can be 
recognized on _raw_ NAND flash. So, I think FAT will be the only
choice(though I know it's very unstable). And I have following question now:

1.How unstable would it be? Does it support: 
     a.journaling (crash/power-off safe ,I mean)
     b.bad block management
     c.wear levelling
     d.error correction
     e.something else I dont know to make the FS reliable
2.I have checked the NAND flash docoment (especially 
the "Filesystems supporting NAND"chapter) and I found out that
it seems no way to build a FAT on a bare NAND flash but only on 
the SmartMediaCards, am I right? Or the SM card and the bare NAND
are just the same thing when a FAT on it.
3.Maybe I misunderstood,but David Woodhouse had told me that I should apply layers like FAT->NFTL->NAND if I wanna build a FAT on
a NAND flash.But I learned that the NFTL only support Doc from the
NAND flash document, isnt it? And what should I do to support the 
FAT ?
4.Everybody tells me that the Fat on a NAND is not reliable,but I 
think USB mass storage are based on NAND and got a FAT (or some 
filesystem which windows can recognize) on it, so ,how comes it 
happen?

BTW:Why my mail sent to the maillist always "awaits moderator approval"?

TIA

Jim Zeus



______________________________________

===================================================================

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [SPAM] FAT on NAND
  2003-04-04  6:21 [SPAM] FAT on NAND jimzeus
@ 2003-04-04  9:40 ` David Woodhouse
  2003-04-07  3:19   ` Jim Zeus
  2003-04-04 10:48 ` Thomas Gleixner
  2003-04-04 20:08 ` Charles Manning
  2 siblings, 1 reply; 9+ messages in thread
From: David Woodhouse @ 2003-04-04  9:40 UTC (permalink / raw)
  To: jimzeus; +Cc: linux-mtd

On Fri, 2003-04-04 at 07:21, jimzeus@vip.sina.com wrote:
> Hi, all:
> 
> 
> What I am doing now is to build a filesystem which can be 
> recognized on _raw_ NAND flash. So, I think FAT will be the only
> choice(though I know it's very unstable). And I have following question now:

Windows won't recognise raw NAND flash anyway. You'll have to write
_some_ kind of driver for Windows.

> 1.How unstable would it be? Does it support: 
>      a.journaling (crash/power-off safe ,I mean)

No.

>      b.bad block management

No.

>      c.wear levelling

No.

>      d.error correction

No.

>      e.something else I dont know to make the FS reliable

No.

> 2.I have checked the NAND flash docoment (especially 
> the "Filesystems supporting NAND"chapter) and I found out that
> it seems no way to build a FAT on a bare NAND flash but only on 
> the SmartMediaCards, am I right? Or the SM card and the bare NAND
> are just the same thing when a FAT on it.
> 3.Maybe I misunderstood,but David Woodhouse had told me that I should apply layers like FAT->NFTL->NAND if I wanna build a FAT on
> a NAND flash.But I learned that the NFTL only support Doc from the
> NAND flash document, isnt it? And what should I do to support the 
> FAT ?

I told you to use the SmartMedia format, not NFTL. You can do that on
any NAND hardware; NFTL has silly patent problems in some parts of the
world.

But really you should have a file system directly on the flash, not a
translation layer pretending to be a block device.

> 4.Everybody tells me that the Fat on a NAND is not reliable,but I 
> think USB mass storage are based on NAND and got a FAT (or some 
> filesystem which windows can recognize) on it, so ,how comes it 
> happen?

It's not reliable, as you were told.

> BTW:Why my mail sent to the maillist always "awaits moderator approval"?

The ones you send as HTML get bounced for that reason. The rest are
trapped because SpamAssassin doesn't like them...

X-Spam-Status: Yes, hits=7.7 required=5.0
        tests=AWL,NO_REAL_NAME,RCVD_IN_OSIRUSOFT_COM,RCVD_IN_RFCI,
        SPAM_PHRASE_00_01,X_OSIRU_SPAM_SRC version=2.44

-- 
dwmw2

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [SPAM] FAT on NAND
  2003-04-04  6:21 [SPAM] FAT on NAND jimzeus
  2003-04-04  9:40 ` David Woodhouse
@ 2003-04-04 10:48 ` Thomas Gleixner
  2003-04-07  3:32   ` Jim Zeus
  2003-04-04 20:08 ` Charles Manning
  2 siblings, 1 reply; 9+ messages in thread
From: Thomas Gleixner @ 2003-04-04 10:48 UTC (permalink / raw)
  To: jimzeus, linux-mtd

On Friday 04 April 2003 08:21, jimzeus@vip.sina.com wrote:
> What I am doing now is to build a filesystem which can be
> recognized on _raw_ NAND flash. So, I think FAT will be the only
> choice(though I know it's very unstable). And I have following question
> now:
For what ? Why don't you use JFFS2 or YAFFS, which handle NAND out of the box 
?

> 1.How unstable would it be? Does it support:
>      a.journaling (crash/power-off safe ,I mean)
>      b.bad block management
>      c.wear levelling
>      d.error correction
>      e.something else I dont know to make the FS reliable
JFFS2 and YAFFS have all this, read the source and build a new one, if you 
have enough time.

> 2.I have checked the NAND flash docoment (especially
> the "Filesystems supporting NAND"chapter) and I found out that
> it seems no way to build a FAT on a bare NAND flash but only on
> the SmartMediaCards, am I right? Or the SM card and the bare NAND
> are just the same thing when a FAT on it.
SMCard and bare NAND is just the same, only packaging is different

> 3.Maybe I misunderstood,but David Woodhouse had told me that I should apply
> layers like FAT->NFTL->NAND if I wanna build a FAT on a NAND flash.But I
> learned that the NFTL only support Doc from the NAND flash document, isnt
> it? And what should I do to support the
> FAT ?
Hack NTFL :)

> 4.Everybody tells me that the Fat on a NAND is not reliable,but I
> think USB mass storage are based on NAND and got a FAT (or some
> filesystem which windows can recognize) on it, so ,how comes it
> happen?
Yes, this is Smart-Media-FAT, which is not exactly the same as DOS-FAT. 
SmartMedia-FAT is used on SmartMedia cards for MP3-Players, Digicams ... 
There exist various adapters (USB, serial, LPT) to access it via a PC. 
SmartMedia-FAT is designed for NAND-FLASH and handles bad block management 
and error correction. 
If you want compability to this, you have to write a fs-driver, which is 
compatible to the SMART-Media-FAT definition, which is available from Toshiba 
under a non disclosure aggreement. 


-- 
Thomas
________________________________________________________________________
linutronix - competence in embedded & realtime linux
http://www.linutronix.de
mail: tglx@linutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [SPAM] FAT on NAND
  2003-04-04  6:21 [SPAM] FAT on NAND jimzeus
  2003-04-04  9:40 ` David Woodhouse
  2003-04-04 10:48 ` Thomas Gleixner
@ 2003-04-04 20:08 ` Charles Manning
  2 siblings, 0 replies; 9+ messages in thread
From: Charles Manning @ 2003-04-04 20:08 UTC (permalink / raw)
  To: jimzeus, linux-mtd

Jim

As you see from David and Thomas, there is wide  agreement that FAT on NAND 
is not a good idea if you want reliable storage.

Some associates of mine using WinCE tried three different commercial 
FAT-on-NAND solutions before they gave up and moved to YAFFS for data 
integrity and speed reasons.

The easiest way to get FAT-on-NAND is to use SmartMedia. This is used by MP3 
players, cameras etc. It works OK, has wear levelling (of a sort - not 
explicit wear levelling). As Thomas says, this is not pure FAT but is very 
close and it looks like FAT from the operating system.  I would not trust it 
for any data I cared about or if I needed a fast file system.

I have had a look at what is required to get YAFFS working on Windows (98, 
2000, XP). I think this would be far easier, and give far better results, 
than trying to make FAT robust.

-- CHarles

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [SPAM] FAT on NAND
  2003-04-04  9:40 ` David Woodhouse
@ 2003-04-07  3:19   ` Jim Zeus
  2003-04-07 14:32     ` Jörn Engel
  2003-04-07 22:49     ` Charles Manning
  0 siblings, 2 replies; 9+ messages in thread
From: Jim Zeus @ 2003-04-07  3:19 UTC (permalink / raw)
  To: David Woodhouse; +Cc: MTD mail list

> > What I am doing now is to build a filesystem which can be 
> > recognized on _raw_ NAND flash. So, I think FAT will be the only
> > choice(though I know it's very unstable). And I have following question now:
> 
> Windows won't recognise raw NAND flash anyway. You'll have to write
> _some_ kind of driver for Windows.
> 

Since the MTD block device(which include nand.c,mtdcore.c 
and mtdblock.c) is a block device, why I can't build
any filesystem on it? 
And, what's the difference between MTD block device and NFTL
if they stay on the same layer? Even though I cant use NFTL
because of some "silly patent problem" ,I still wanna know it,
thanks.


> > 1.How unstable would it be? Does it support: 
> >      a.journaling (crash/power-off safe ,I mean)
> 
> No.
> 
> >      b.bad block management
> 
> No.
> 
> >      c.wear levelling
> 
> No.
> 
> >      d.error correction
> 
> No.
> 
> >      e.something else I dont know to make the FS reliable
> 
> No.

Then, maybe the lower layer (MTD or NFTL) support it? or all the
stuff(a.b.c.d.e) are supported only by the file system 
(JFFS2/YAFFS,I mean)?

> 
> > 2.I have checked the NAND flash docoment (especially 
> > the "Filesystems supporting NAND"chapter) and I found out that
> > it seems no way to build a FAT on a bare NAND flash but only on 
> > the SmartMediaCards, am I right? Or the SM card and the bare NAND
> > are just the same thing when a FAT on it.
> > 3.Maybe I misunderstood,but David Woodhouse had told me that I should apply layers like FAT->NFTL->NAND if I wanna build a FAT on
> > a NAND flash.But I learned that the NFTL only support Doc from the
> > NAND flash document, isnt it? And what should I do to support the 
> > FAT ?
> 
> I told you to use the SmartMedia format, not NFTL. You can do that on
> any NAND hardware; NFTL has silly patent problems in some parts of the
> world.

Thank you, but what is the SmartMedia format? Sorry I am not 
familiar with that.

> 
> But really you should have a file system directly on the flash, not a
> translation layer pretending to be a block device.
> 

Do you mean build a totally new FS on a _bare_ NAND flash or on a MTD? 
You are so right, but I must build a FS which Windows can 
recognize and I have no enough time to do this before the time
limit.


> > 4.Everybody tells me that the Fat on a NAND is not reliable,but I 
> > think USB mass storage are based on NAND and got a FAT (or some 
> > filesystem which windows can recognize) on it, so ,how comes it 
> > happen?
> 
> It's not reliable, as you were told.
> 
> > BTW:Why my mail sent to the maillist always "awaits moderator approval"?
> 
> The ones you send as HTML get bounced for that reason. The rest are
> trapped because SpamAssassin doesn't like them...

I think my mail is txt but not in HTML.Whatever, I hope it won't 
happen anymore:)

> 
> X-Spam-Status: Yes, hits=7.7 required=5.0
>         tests=AWL,NO_REAL_NAME,RCVD_IN_OSIRUSOFT_COM,RCVD_IN_RFCI,
>         SPAM_PHRASE_00_01,X_OSIRU_SPAM_SRC version=2.44
> 
> -- 
> dwmw2
> 
> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [SPAM] FAT on NAND
  2003-04-04 10:48 ` Thomas Gleixner
@ 2003-04-07  3:32   ` Jim Zeus
  2003-04-07  8:01     ` Thomas Gleixner
  0 siblings, 1 reply; 9+ messages in thread
From: Jim Zeus @ 2003-04-07  3:32 UTC (permalink / raw)
  To: tglx; +Cc: MTD mail list

> > What I am doing now is to build a filesystem which can be
> > recognized on _raw_ NAND flash. So, I think FAT will be the only
> > choice(though I know it's very unstable). And I have following question
> > now:
> For what ? Why don't you use JFFS2 or YAFFS, which handle NAND out of the box 
> ?

Because I've got to build a FS which can be accessed by Windows and Linux at the same 
time.I think JFFS2/YAFFS can't be recognized by Windows nowadays. 
And , it seems like I have to support some device layer between the FS and Flash so the
Linux can access it, isn't it?
Is there anyway else I can choose?

> 
> > 1.How unstable would it be? Does it support:
> >      a.journaling (crash/power-off safe ,I mean)
> >      b.bad block management
> >      c.wear levelling
> >      d.error correction
> >      e.something else I dont know to make the FS reliable
> JFFS2 and YAFFS have all this, read the source and build a new one, if you 
> have enough time.

Are all the functions supported by JFFS2/YAFFS? Somebody told me the wear levelling
is supported by MTD

And It seems like I don't have enough time ,maybe I can finish it with all my leisure time.

> > 4.Everybody tells me that the Fat on a NAND is not reliable,but I
> > think USB mass storage are based on NAND and got a FAT (or some
> > filesystem which windows can recognize) on it, so ,how comes it
> > happen?
> Yes, this is Smart-Media-FAT, which is not exactly the same as DOS-FAT. 
> SmartMedia-FAT is used on SmartMedia cards for MP3-Players, Digicams ... 
> There exist various adapters (USB, serial, LPT) to access it via a PC. 
> SmartMedia-FAT is designed for NAND-FLASH and handles bad block management 
> and error correction. 
> If you want compability to this, you have to write a fs-driver, which is 
> compatible to the SMART-Media-FAT definition, which is available from Toshiba 
> under a non disclosure aggreement. 

Does the SMART-Media-FAT build directly on a _bare_ NAND Flash ? 
If it is, That's nothing useful to me 'cause Linux cant access it.


Thanks a lot for answering my questions

Your Faithful
Jim Zeus




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [SPAM] FAT on NAND
  2003-04-07  3:32   ` Jim Zeus
@ 2003-04-07  8:01     ` Thomas Gleixner
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Gleixner @ 2003-04-07  8:01 UTC (permalink / raw)
  To: Jim Zeus; +Cc: MTD mail list

On Monday 07 April 2003 05:32, Jim Zeus wrote:
> > For what ? Why don't you use JFFS2 or YAFFS, which handle NAND out of the
> > box ?
> Because I've got to build a FS which can be accessed by Windows and Linux
> at the same time.I think JFFS2/YAFFS can't be recognized by Windows
> nowadays. And , it seems like I have to support some device layer between
> the FS and Flash so the Linux can access it, isn't it?
> Is there anyway else I can choose?
No, but AFAIK is there a Windows driver for YAFFS. 
 
> Are all the functions supported by JFFS2/YAFFS? Somebody told me the wear
> levelling is supported by MTD
Crap, MTD just provides the low level interface. Bad block management, wear 
levelling and journalling must be done in the fs driver.

> Does the SMART-Media-FAT build directly on a _bare_ NAND Flash ? 
> If it is, That's nothing useful to me 'cause Linux cant access it.
You can build it on bare FLASH: But that's not the correct way for LINUX. Your 
have to build a filesystem driver, which acts on top of MTD.

1. fs-driver 
2. MTD-block-device-driver
3. MTD-partition-driver
4. Generic NAND-driver
5. yourHardwareInterface-driver

2, 3 and 4 exist.
5 is easy to build (copy an existing one and modify it to fit your hardware)

1 has to be written from scratch. 
The specifications of SmartMedia-FAT are available from
http://www.ssfdc.or.jp/english/index.htm


-- 
Thomas
________________________________________________________________________
linutronix - competence in embedded & realtime linux
http://www.linutronix.de
mail: tglx@linutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [SPAM] FAT on NAND
  2003-04-07  3:19   ` Jim Zeus
@ 2003-04-07 14:32     ` Jörn Engel
  2003-04-07 22:49     ` Charles Manning
  1 sibling, 0 replies; 9+ messages in thread
From: Jörn Engel @ 2003-04-07 14:32 UTC (permalink / raw)
  To: Jim Zeus; +Cc: MTD mail list, David Woodhouse

David didn't respond (yet), so you have to settle with my words of
lesser wisdom. :)

On Mon, 7 April 2003 11:19:53 +0800, Jim Zeus wrote:
> 
> > Windows won't recognise raw NAND flash anyway. You'll have to write
> > _some_ kind of driver for Windows.
> > 
> 
> Since the MTD block device(which include nand.c,mtdcore.c 
> and mtdblock.c) is a block device, why I can't build
> any filesystem on it? 

Oh, you can. But you won't have a-d, unless you use a working nftl.

> And, what's the difference between MTD block device and NFTL
> if they stay on the same layer? Even though I cant use NFTL
> because of some "silly patent problem" ,I still wanna know it,
> thanks.

Disclaimer: I've never even tried nftl or know of anyone that has.

Nftl (or any variant of that theme) should take care of b, d, possibly
c and - as a side effect - also of a.
Nftl has no knowledge about the file system on top of it. So you can
still get the possibility of inconsistent file systems, unless you use
some variant of ffs or a journaling file system.

Whether existing implementations actually do this under all
circumstances is highly questionable, given the userbase the code has.
Do you own tests.

> > > 1.How unstable would it be? Does it support: 
> > >      a.journaling (crash/power-off safe ,I mean)
> > 
> > No.
> > 
> > >      b.bad block management
> > 
> > No.
> > 
> > >      c.wear levelling
> > 
> > No.
> > 
> > >      d.error correction
> > 
> > No.
> > 
> > >      e.something else I dont know to make the FS reliable
> > 
> > No.
> 
> Then, maybe the lower layer (MTD or NFTL) support it? or all the
> stuff(a.b.c.d.e) are supported only by the file system 
> (JFFS2/YAFFS,I mean)?

Jffs2 does support it, yaffs should also (not sure, never used it).

> > But really you should have a file system directly on the flash, not a
> > translation layer pretending to be a block device.
> 
> Do you mean build a totally new FS on a _bare_ NAND flash or on a MTD? 
> You are so right, but I must build a FS which Windows can 
> recognize and I have no enough time to do this before the time
> limit.

Mtd is as good as a bare nand. In the traditional unix world of
character and block devices, flash is neither one nor the other. Thus,
mtd devices were created as a third kind. They usually give you enough
abstraction to ignore chip specifics, sometimes not even that.

A *very* thin layer.

Jörn

-- 
To recognize individual spam features you have to try to get into the
mind of the spammer, and frankly I want to spend as little time inside
the minds of spammers as possible.
-- Paul Graham

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [SPAM] FAT on NAND
  2003-04-07  3:19   ` Jim Zeus
  2003-04-07 14:32     ` Jörn Engel
@ 2003-04-07 22:49     ` Charles Manning
  1 sibling, 0 replies; 9+ messages in thread
From: Charles Manning @ 2003-04-07 22:49 UTC (permalink / raw)
  To: Jim Zeus, David Woodhouse; +Cc: MTD mail list

On Mon, 07 Apr 2003 15:19, Jim Zeus wrote:
> > > What I am doing now is to build a filesystem which can be 
> > > recognized on _raw_ NAND flash. So, I think FAT will be the only
> > > choice(though I know it's very unstable). And I have following question
> > > now:

I think the easiest route would be to get  yaffs working under Windows. It 
works under WinCE already, which has a similar file system driver level.

> > 
> > Windows won't recognise raw NAND flash anyway. You'll have to write
> > _some_ kind of driver for Windows.
> > 
>
> 
> Since the MTD block device(which include nand.c,mtdcore.c 
> and mtdblock.c) is a block device, why I can't build
> any filesystem on it? 
> And, what's the difference between MTD block device and NFTL
> if they stay on the same layer? Even though I cant use NFTL
> because of some "silly patent problem" ,I still wanna know it,
> thanks.

The mtd drivers are pretty much Linux specific. They also carry a lot of 
stuff that is not really required to support a NAND-based file system.

The journaling file systems (YAFFS and JFFS2) do not use block drivers. They 
know about flash. It is this knowledge that gives them both efficiency and 
robusness. FAT file systems on NAND are inefficient and lack robustness 
because of the block driver layer (and to some degree because of FAT).

[snip]

> Then, maybe the lower layer (MTD or NFTL) support it? or all the
> stuff(a.b.c.d.e) are supported only by the file system 
> (JFFS2/YAFFS,I mean)?

I don't know about JFFS2, but YAFFS handles all robustness inside itself. I 
think JFFS2 does too.

> Thank you, but what is the SmartMedia format? Sorry I am not 
> familiar with that.

Look up the Samsung flash website or google for "SmartMedia specification".

This is the format for file systems using SmartMedia cards so that you get 
interoperability between cameras, PCs etc.

SmartMedia is like FAT.

> 
>
> > 
> > But really you should have a file system directly on the flash, not a
> > translation layer pretending to be a block device.
> > 
>
> 
> Do you mean build a totally new FS on a _bare_ NAND flash or on a MTD? 
> You are so right, but I must build a FS which Windows can 
> recognize and I have no enough time to do this before the time
> limit.

This is what YAFFS and JFFS2 do. They talk directly to the flash chips. mtd 
just gives a standard interface under Linux. 

YAFFS makes all its NAND accesses through 5 functions. Under Linux, these 
functions access mtd functions. Under other environments they are implemented 
in other ways. This makes it very easy to port.

The more difficult side is porting the top side of the file system (ie. where 
it interfaces to the operating system). There are functions in CVS to do this 
for WinCE - that would be a good starting point.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-04-07 22:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-04  6:21 [SPAM] FAT on NAND jimzeus
2003-04-04  9:40 ` David Woodhouse
2003-04-07  3:19   ` Jim Zeus
2003-04-07 14:32     ` Jörn Engel
2003-04-07 22:49     ` Charles Manning
2003-04-04 10:48 ` Thomas Gleixner
2003-04-07  3:32   ` Jim Zeus
2003-04-07  8:01     ` Thomas Gleixner
2003-04-04 20:08 ` Charles Manning

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox