Intermec ck1 参照ガイド

ページ / 390
Appendix A — 
µClinux System 
CK1 SDK Programmer’s Reference Manual 
317 
page of the file individually when storing it and decompressing it on the 
fly when reading it. This functionality enables random access to data. The 
only problem with this file system is that in order to access data it must be 
first transmitted to RAM. These kinds of pseudo-file systems are designed 
to emulate a block device with a fixed amount of bytes in a sector and then 
using a standard file system on that.  
To overcome the translation layer problem that comes with the CRAMFS, 
a more efficient file system, designed for a Flash device, was developed. 
The journaling Flash file system is implemented directly to the Flash 
device so it does not need any translation layer between. 
 
User Application
User 
Mode
RAMFS
CRAMFS
JFFS/JFFS2
Kernel
FLASH
Hardware
 
CRAMFS Versus JFFS/JFFS2 
The JFFS is a log-structured file system with build-in wear leveling, where 
nodes or log entries are stored sequentially to a log located in Flash. The 
actual data and meta data written are placed in the storage in a location 
defined by the log. The log holds information such as the version number, 
which tells the chronological sequence of the nodes and meta data such as 
uid, gid, and the offset of the data within the file. The design of JFFS is 
implemented in such a way that it guarantees that the data written to the 
storage does not get corrupted. The storage always contains the latest data 
written even if power failure occurs during the write. In such a case, the 
data is a combination of the old and new data that were able to be written.  
When the file system is mounted, the whole log is scanned to determine 
how the directory hierarchy is to be created. Also the new blocks are re-
arranged in such away that they can be accessed and deleted blocks marked 
to the garbage collector. When changes are made to the file structure, the 
information in the log is updated in all times when the file system is 
mounted. The changes to the files may make part of the used space 
obsolete. These dirty spaces are then marked for the JFFS garbage collector 
to be recycled.