Monday, January 14, 2008

YAFFS(YAFFS2) and JFFS2 comparison

Google android emulator extracts the system.img and userdata.img with YAFFS flash file system. I don't know much about YAFFS and its difference with JFFS2. I google it and share here.
  • YAFFS uses less run-time RAM to hold its state so YAFFS scales better than JFFS2. There are quite a few systems using large NAND arrays (the largest partitions I know of are around the 6Gbyte mark).
  • YAFFS garbage collection is simpler and faster typically making for better performance under hard writing.
  • YAFFS uses a whole page per file for headers, and does not provide compression. This means that JFFS2 is probably a better fit to small partitions. The flip side though is that a lot of data (eg. MP3) does not compress very well and enabling compression really hurts performance.
  • While YAFFS has been used on NOR, it does not fit that well (because YAFFS does not use erase suspend). Thus if you're using smaller NAND partitions and using jffs2 on NOR, then a jffs2-only solution is very appealing.
From the wikipedia, I can see YAFFS is Yet Another Flash File System, it is specifically designed for NAND flash. Here are some links for more information:
JFFS2 is a log-structured file system designed for use on flash devices in embedded systems. Rather than using a kind of translation layer on flash devices to emulate a normal hard drive, as is the case with older flash solutions, it places the filesystem directly on the flash chips. Here are some links for more information about JFFS2:
More information about Flash memory.
Flash memory is non-volatile computer memory that can be electrically erased and reprogrammed. There are NOR memories and NAND memories.
NOR memories:
Reading from NOR flash is similar to reading from random-access memory, provided the address and data bus are mapped correctly. Because of this, most microprocessors can use NOR flash memory as execute in place (XIP) memory, meaning that programs stored in NOR flash can be executed directly without the need to copy them into RAM. NOR flash chips lack intrinsic bad block management, so when a flash block is worn out, the software or device driver controlling the device must handle this, or the device will cease to work reliably.
When unlocking, erasing or writing NOR memories, special commands are written to the first page of the mapped memory. These commands are defined by the Common Flash memory Interface (CFI) and the flash chips can provide a list of available commands to the physical driver.
NAND memories:

NAND flash architecture was introduced by Toshiba in 1989. NAND flash memories cannot provide execute in place due to their different construction principles. These memories are accessed much like block devices such as hard disks or memory cards. The pages are typically 512 or 2,048 or 4,096 bytes in size. Associated with each page are a few bytes (typically 12–16 bytes) that should be used for storage of an error detection and correction checksum.

The pages are typically arranged in blocks. A typical block would be:
  • 32 pages of 512 bytes
  • 64 pages of 2,048 bytes.
  • 64 pages of 4,096 bytes.


No comments: