Fundamental Qi question

Werner Almesberger werner at
Thu Jun 4 14:40:14 CEST 2009

Laszlo KREKACS wrote:
> I use the distribution on NAND as an SD card reader.

Hmm, I think we have to distinguish between things you can do and
things that actually make sense here ;-)

Once you've started to fill the niches, it's always unpleasant to
change. That's one reason why it's difficult to make architectural
changes like switching from a NAND-centric approach to an SD-centric
approach once a system has been deployed.

But in a new system, features should be open to evaluation, and if
one can accomplish the same tasks in a simpler and cheaper way, that
only helps to make the product stronger.

The problem with NAND is that it's no end of hassle. You need a
complex boot loader to use if fully, you need an in-system recovery
architecture, it needs special partitioning, you have to deal with
unusual error patterns (factory-bad blocks and wear), etc.

An SD-centric design does away with all this and brings the whole
architecture much closer to what you find in a PC. I.e., the analogy
SD == disk holds true for most purposes. So you don't need to learn
a whole new set of methods and tools to perform routine tasks but
you can just handle them exactly like you'd handle a PC.

For your SD reader scenario, there are actually two solutions:

- you can just have a small system on the SD card that boots into an
  initramfs. Once the system has been loaded, you can remove the card
  and insert another one.

- USB microSD readers sell for < USD 3 and make a nice addition to the
  travel accessories bag for each laptop that doesn't have an SD slot.

> and I write the new distro to the uSD card. It is impossible to do it
> on the same
> SD card, from where the OS is running. You cant simply repartition
> the uSD card.

Why not ? Just get a big enough card and partition it before using it
the first time. The total cost of a card with several GB is likely to
be much lower than that of those few hundred MB of NAND. (It's not
only the cost of the chip per se but also how this constrains the
choice of packages, complicates sourcing, production, and all that.)

> Furthermore, I used recently TangoGPS, and it broke the filesystem where the
> maps were located. It broked every time when the phone runned out of battery.

Hmm, frequent data loss looks like a problem that needs solving anyway,
whether there is NAND or not. Does your user space attempt a shutdown
when it notices an imminent low battery condition ?

> I see only one alternativ: two uSD card slot.

That's actually an attractive feature anyway. Basically one acting
like a hard disk and the other one like a USB stick. Thinking of it,
you can actually do this already if you have a suitable cable, since
the USB port can be switched to host mode.

> I think I made a fair point, so please save an emergency path.

The design of a typical Qi system (whether NAND-free or not) should
include a partition with an small user space for the boot menu and
just this sort of recovery environment. There's no disagreement that
you need this sort of functionality, there are just better ways to
do it than to use NAND :-)

Ah, and to recover from a truly catastrophic SD failure, there's
always the option of carrying a backup card. There are also failure
modes where you're much better off with SD than with NAND. E.g., if
your device fails completely and needs to be replaced, you can't
backup your NAND if your device is broken, while you can usually
still remove your SD card and access it with another computer.

- Werner

More information about the community mailing list