One, JFFS2
jffs:1999
Journalling Flash File System, Version 2:2001-9-23,linux 2.4.10
Mainly for nor flash, can be used for NAND flash
1. Features:
Power-down protection and loss balancing
Garbage collection mechanism
CRC cyclic redundancy check mechanism
Mount time and memory consumption are proportional to the size of the file system: the larger the file system, the slower, the more you consume ———— > Poor scalability
Mount requires a full scan, and it takes more than half a minute to mount a 16M flash
In practical applications, the JFFS2 can be used on 128M of flash memory
Two, YAFFS2
yaffs:2002
Yet another Flash File System, Version 2:2003
Can only be used for NAND flash, YAFFS1 supports 512bytes/page NAND flash; The YAFFS2 supports 2kbytes/page NAND Flash.
1. Features:
The basic unit for storing data is Chunk:page
Support Yaffs/direct use: No VFS required, even operating system support
ECC redundancy Check mechanism
Correction of single-bit errors and detection of double-bit errors, and the calculation is fast, but more than 1 bits of error can not be corrected, more than 2 bits of error is not guaranteed to detect.
Faster mount speeds and less memory usage
512b/page ———— > 4KB ram/1mb NAND
2kb/page ———— > 1KB ram/1mb NAND
Jffs and yaffs are log structure file system (LFS), which guarantees the reliability and security of data and can recover data.
In general, for less than 64MB NAND Flash, you can choose JFFS2, if more than 64MB, with YAFFS2 more appropriate
Third, JFFS2 file system image production
1, tool installation
sudo apt-get install mtd-utils
Command: MKFS.JFFS2
2, mirror production
information collection:
Flash page size, erase block size
MKFS.JFFS2 [Options]
Main option:
-P,--pad[=size] fills the file system to a specified size using 0xFF, does not specify that only the last erase block is populated
-R,-D,--root=dir Uses the specified directory content to build the file system (DEFAULT:CWD)
-S,--pagesize=size using the specified page size (maximum data node size) (Default:4kib)
-E,--eraseblock=size Specifies the size of the erase block (Default:64kib)
-C,--cleanmarker=size the size of the erase tag (default)
-M,--compr-mode=mode Select compression mode (default:prior Tiry)
-X,--disable-compressor=compressor_name disables the specified compression algorithm
-X,--enable-compressor=compressor_name enables the specified compression algorithm
-Y,--compressor-priority=priority:compressor_name sets the priority of the compression algorithm
-L,--list-compressors lists the available compression algorithms
-T,-- Test-compression test compression algorithm
-N,--no-cleanmarkers do not add erase tag to erase block
-O,--output=file specifies the file system image name (default:stdout)
-L, --little-endian Create a small end file system
-B,--big-endian create a big-endian file system
-Q,--squash compress permissions and set the owner of all files as root
-u,-- Squash-uids set the owner of all files to root
-p,--squash-perms to compress permissions for all files
Four, YAFFS2 file system image production
1, access to YAFFS2 source code
git clone git://www.aleph1.co.uk/yaffs2
Compile the authoring tool from the source code:
CD Yaffs2/utils
Make
Error:unknown type name ' U8 '
Error:unknown type name ' U32 '
If the above error occurs, modify the Yportenv.h file to add: #define Config_yaffs_defines_types
Production Tools:
MKYAFFS2IMAGE:YAFFS2 (2kb/page)
Mkyaffsimage:yaffs (512b/page)
2. Mirror production
Mkyaffs2image dir image_file [convert]
All of the above file systems can only be burned and cannot be mounted on the host
JFFS2 and YAFFS2 file systems