beautypg.com

Journaling flash file system (jffs2), Journaling flash file system (jffs2) -3 – Moxa Technologies EM-1240-LX User Manual

Page 31

background image

EM-1240-LX User’s Manual

Software Package

3-3

The partition sizes are hard coded into the kernel binary. You must rebuild the kernel to change the
partition sizes. The flash memory map is shown in the following table.

Flash Context

Flash Address

Size

Access control

Boot loader

0 – 0x3ffff

256 K

Read ONLY

Kernet &
Root File System

0x40000– 0x3fffff

4 M

Read ONLY
JFFS2

User Directory

0x400000 – 0x7fffff

4 M – 256 K

Read / Write
JFFS2

Developers write their own programs only on partition /etc, /home, /tmp, and /usr/bin .It is advised
the executed file be put in /usr/bin as this will allow developers to use hotkeys.

In addition to the flash file systems, a RAM based file system is mounted on /var/.

Journaling Flash File System (JFFS2)

The flash User Directory is formatted by the Journaling Flash File System (JFFS2), which places a
compressed file system on the flash, transparent to the user.

Axis Communications in Sweden developed the Journaling Flash File System (JFFS2).

JFFS2 provides a file system directly on flash, rather than emulating a block device designed for
use on flash-ROM chips. It recognizes flash-ROM chips’ special write requirements, does
wear-leveling to extend flash life, keeps the flash directory structure in RAM at all times, and
implements a log-structured file system that is always consistent—even if the system crashes or
unexpectedly powers down. It does not require fsck on boot up.

JFFS2, the next version of JFFS, provides improved wear-leveling and garbage-collection
performance, improved RAM footprint and response to system-memory pressure, improved
concurrency and support for suspending flash erases, marking of bad sectors with continued use of
the remaining good sectors (thus enhancing the write-life of the devices), native data compression
inside the file system design; and support for hard links.

Key features of JFFS2 are:

y

Directly targeted to Flash ROM

y

Robust

y

Consistent across power failure

y

No integrity scan (fsck) is required at boot time after normal or abnormal shutdown

y

Explicit wear leveling

y

Transparent compression

Although JFFS2 is a journaling file system, this does not preclude the loss of data. The file system
will remain in a consistent state across power failures, and will always be mountable. However, if
the board is powered down during a write, then the incomplete write will be rolled back on the
next boot. Any writes that were already completed will not be affected.

Additional information about JFFS2 is available at
http://sources.redhat.com/jffs2/jffs2.pdf
http://developer.axis.com/software/jffs/
http://www.linux-mtd.infradead.org/