Moxa Technologies EM-1240-LX user manual Journaling Flash File System JFFS2

Page 31

EM-1240-LX User’s Manual

Software Package

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 &

0x40000– 0x3fffff

4

M

Read ONLY

Root File System

 

 

 

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 consistenteven 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:

yDirectly targeted to Flash ROM

yRobust

yConsistent across power failure

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

yExplicit wear leveling

yTransparent 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/

3-3

Image 31
Contents First Edition, November EM-1240-LX User’s ManualCopyright Notice Table of Contents Chapter EM-1240-LX Device API Introduction EM-1240-LX Package ChecklistProduct Features OverviewHardware Specifications Product SpecificationsSoftware Specifications EM-1240 Development Kit Embedded Module Hardware Block Diagram AppearanceEM-1240 Embedded Module EM-1240 Development Kit Dimensions LED Indicators Installing the EM-1240-LXWiring Requirements Connecting the Power Connecting Data Transmission CablesGrounding the EM-1240-LX Connecting to a Serial Device Connecting to the NetworkSerial Console Port Reset ButtonInternal SD Socket Additional FunctionsReal-time Clock Getting Started Connecting the EM-1240-LX to a PC Powering on the EM-1240-LXConsole Port 192.168.4.127 255.255.255.0 Default IP Address Default NetmaskTelnet 192.168.3.127 255.255.255.0Configuring the Ethernet Interface Dhcpcd -p -a eth0 & dhcpcd -p -a eth1 Ifconfig eth0Installing a Secure Digital SD Memory Card #mount -t iso9660 /dev/cdrom /mnt/cdrom Installing the EM-1240-LX Tool ChainDeveloping Your Applications StepEM-1240-LX User’s Manual PATH=/usr/local/arm-elf/bin$PATH Compiling Hello.c#make Uploading Hello to the EM-1240-LX# chmod 755 hello #./hello Running Hello on the EM-1240-LXCflags = Make File Example CodeSoftware Package EM-1240-LX Software Architecture Journaling Flash File System JFFS2 Flash Context Flash Address Size Access controlAdditional information about JFFS2 is available at Bin Dev EM-1240-LX Software PackagePtyp0 Ppp Pio Rtc Ram1 Ram0 Null Kmem Mem Cua0 Console Tty ‰ Iptables ‰ NAT Configuring the EM-1240-LXEnabling and Disabling Daemons Example default enableAdding a Web Default Home Page addressLocal Host Packets Usage Define policy rules, and Append or delete rulesExamples Define policy for chain rules NAT Example Enabling NAT at BootupDial-in Service Configuring Dial-in/Dial-out ServiceConfiguring PPPoE Dial-out ServiceDynamic Driver Module Load/Unload How to Mount a Remote NFS ServerCd ramdisk Ramdiskupkernel em1240-1.x.bin /ramdiskrebootUpgrading the Kernel UpramdiskUpramdisk Cd ramdisk Upgrading the Root File System & User DirectoryRamdiskbackupfs /ramdisk/usrdisk-backup User Directory Backup-EM-1240-LX to PCChecking the Kernel and Root File System Versions Loading Factory DefaultsMirroring the Application Program and Configuration Autostarting User Applications on BootupCat /etc/version FsversionEM-1240-LX Device API Buzzer RTC Real-time ClockUart Interface UC Finder Windows UC Finder EM-1240-LX User’s Manual UC Finder EM-1240-LX User’s Manual UC Finder Linux UC Finder Editor System CommandsBusybox µClinux normal command utility collection File managerMoxa Special Utilities NetworkProcess OtherSnmp Agent with MIB II & RS-232 Like Group Ip MIB Tcp MIB Udp MIB Snmp Agent with MIB II & RS-232 Like GroupRFC1317 RS-232 like group supported variables Rs232 MIB Snmp MIBEM-1240-LX FAQ Service Information Following services are provided Moxa Internet ServicesMoxa Product † EM-1240-LX Serial Number Problem Report FormProduct Return Procedure