[Lazarus] Using Lazarus on Embedded Linux?
henry.vermaak at gmail.com
Mon Sep 27 11:25:38 CEST 2010
On 27/09/10 08:50, Michael Schnell wrote:
> On 09/25/2010 09:07 AM, Bo Berglund wrote:
> 5) Can data be stored on memory cards/hard disk on an embedded system?
> Not a Lazarus problem but...
> Using Flash Cards on an embedded system is a huge security risk.
> After writing to the card, same performs the storage procedure
> internally which takes a undefined amount of time and can't be watched
> from outside. So you don't know how long you need to apply power to the
> card after switching off the system. If you remove the power to the card
> too early, _all_ (even unrelated) data on the card might be lost. This
> is why using a special file system (a Flash File system and/or a
> journaling file system) does not help.
See sync, fsync, fdatasync, etc. You can also mount some filesystems
with sync, but that's usually not a good idea for performance and flash
cycle issues. Best is to remove the power only after your kernel has
powered down, obviously, so you know that all the buffers have been flushed.
Why do you think all data will be lost with a journalling file system?
> So only battery powered embedded systems (like cameras) are viable for
> writing to flash cards: they never switch off the power unexpectedly.
The battery can run out or the user can pull it out.
More information about the Lazarus