public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Ross Younger <wry@ecoscentric.com>
Cc: "ecos-devel@ecos.sourceware.org" <ecos-devel@ecos.sourceware.org>
Subject: Re: NAND review
Date: Fri, 19 Jun 2009 15:02:00 -0000	[thread overview]
Message-ID: <20090619150243.GD1188@lunn.ch> (raw)
In-Reply-To: <4A3B9D36.4000704@ecoscentric.com>

> Properly NAND-aware filesystems take both kinds of bad blocks in their
> stride; there's no point in adding the complexity if such a mapping if
> you're using such a filesystem.
> 
> Even with something simpler, factory-bad blocks are straightforward: as you
> say, one can simply linear-map them into oblivion in the driver at the cost
> of extra time complexity *on every NAND operation*. (I add the emphasis
> because I expect the overhead will add up fast if the NAND is heavily used.)

I'm not suggesting putting this in the driver. 

I'm suggesting RedBoot commands nandfis load and nandfis create
does this.

As you said, a full NAND filesystem will handle bad blocks etc.

However, just to get an executable image, be it the Linux kernel, or
an eCos App, into memory we don't necessarily need the overhead of a
NAND filesystem. 

> > This leads to three things:
> > 
> > 1) Full read/write support for the FS in Redboot. For NOR we normally
> >    have only read support.
> 
> Do you mean jffs2?

jffs2 is i think by default, and the ext2 code is definitely read
only.
 
> At the moment my YAFFS layer is fully read-write, but I could add a
> read-only switch if this was thought to be useful?

It might be, if it saves code/data space.

> > 2) mkfs functionality.
> 
> I don't know about other filesystems, but YAFFS always scans the NAND on
> mount, and automatically does the Right Thing when asked to mount a
> fully-erased array. (My RedBoot patch already includes logic to erase a nand
> partition.)

Given the unfriendly license of YAFFS, i think uffs is more likely to
be the defacto standard NAND filesystem for eCos based systems, once
it gets ported and committed into the anoncvs tree. I've no idea what
it needs for mkfs like operations. 

YAFFS makes more sense for Linux, but i also expect there will be
pressure to add UBI/UBIFS support, since that seems to be the defacto
standard mainline NAND filesystem now, replacing JFFS2. 
 
> The original YAFFS tree includes a mkyaffs2image utility for turning a
> directory tree into an image file which can then be programmed to NAND with
> suitable software. (Being log-based, I suppose bad blocks wouldn't matter.)
> I haven't looked into this, but it smells pretty straightforward to add
> support to RedBoot to program such an image into NAND - much nicer than
> teaching it how to unpack (say) a tarball.

The problem with mkyaffs2image is that it is specific to yaffs. What
about uffs and UBIFS and even jffs2, etc. Supporting a simple archive
format, like cpio, is a much more generic solution.

> Dynamic partitions are conceptually not very far from the current model. The
> partition "table" is just an array hanging off the cyg_nand_device struct,
> which could in theory be modified by any code which chose to - either from
> logic, or interactively e.g. from RB. The interesting part is deciding where
> and how the table is to be stored, which influences how we would provide a
> call to write out a fresh partition table and whether this was accessible
> via a hosted Linux partition. (We'd also have to think carefully what it
> meant to change the table at runtime; what if there were mounted
> filesystems? open files? Would (could) we make it safe?)

This is the sort of discussion i want to see. How would Redboot do
this? What are the APIs? How does an eCos App get this information via
VV? How many times have i asked these questions?

You say not very far from the current model, so lets get is right now,
rather than have to break the world when we fix it later.

Getting the locking right would be nice, but we currently don't do any
locking with JFFS2. You can fis delete etc, when the filesystem is
mounted. Bad things then happen. 

         Andrew

  reply	other threads:[~2009-06-19 15:02 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19  8:27 Simon Kallweit
2009-05-19 13:47 ` Ross Younger
2009-05-19 14:17   ` Andrew Lunn
2009-05-20 13:24     ` Bart Veer
2009-05-20 13:34       ` Rutger Hofman
2009-05-20 13:53         ` Andrew Lunn
2009-05-20 13:56           ` Gary Thomas
2009-05-20 14:22             ` Andrew Lunn
2009-05-20 15:22               ` Andrew Lunn
2009-05-20 15:34               ` Bart Veer
2009-05-20 13:58           ` Rutger Hofman
2009-05-20 14:16     ` Ross Younger
2009-05-20 14:21       ` Gary Thomas
2009-05-20 15:25         ` Ross Younger
2009-05-20 15:37           ` Gary Thomas
2009-05-19 16:29 ` Andrew Lunn
2009-06-03  8:51   ` Andrew Lunn
2009-06-03 10:21     ` Ross Younger
2009-06-03 10:48       ` Andrew Lunn
2009-06-03 11:52         ` Simon Kallweit
2009-06-03 12:26         ` Rutger Hofman
2009-06-03 13:33     ` Jürgen Lambrecht
2009-06-10 17:39     ` Nick Garnett
2009-06-11 11:25       ` Rutger Hofman
2009-06-13 16:31       ` Andrew Lunn
2009-06-18 14:10         ` Nick Garnett
2009-06-19  7:47           ` Andrew Lunn
2009-06-19 14:14             ` Ross Younger
2009-06-19 15:02               ` Andrew Lunn [this message]
2009-06-19 16:54               ` Jürgen Lambrecht
2009-06-29 11:09             ` Nick Garnett
2009-06-19  8:07           ` Andrew Lunn
2009-06-19 11:37             ` Daniel Morris
2009-06-19 12:06               ` Andrew Lunn
2009-05-20  1:02 ` Jonathan Larmour
2009-05-20  7:11   ` Simon Kallweit
2009-05-20 11:12     ` Rutger Hofman
2009-05-20 11:29       ` Simon Kallweit
2009-05-20 13:37         ` Rutger Hofman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090619150243.GD1188@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=ecos-devel@ecos.sourceware.org \
    --cc=wry@ecoscentric.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).