
8. Flash Devices and Flash File System Support
25
■
Localizes Static File Blocks.
Localizing blocks that belong to static files significantly facilitates transferring
these blocks when the wear-leveling algorithm decides to move static areas.
Read and Write Operations
One of the characteristics of flash memory that differs considerably from the more
common magnetic-medium mechanical disks is the way in which it writes new
data to the medium. When using traditional magnetic storage media, writing new
data to a previously written storage area simply overwrites the existing data,
essentially obliterating it; whereas flash does not. This section describes how flash
reads from, and writes to, memory.
Reading from Blocks
Reading the data from a block is straightforward. The file system requests the
contents of a particular block. In response, TrueFFS translates the block number
into flash memory coordinates, retrieves the data at those coordinates, and returns
the data to the file system.
Writing to Previously Unwritten Blocks
Writing data to a block is straightforward, a byte can only be written once before it
is erased. Therefore, if the target block has remained unwritten since the last erase
of the block, the write process is simple. TrueFFS translates the block number into
flash memory coordinates and writes to the location. However, if the write request
seeks to modify the contents of a previously written block, the situation is more
complex.
If any write operation fails, TrueFFS attempts a second write. For more
information, see Recovering During a Write Operation, p.29.
Writing to Previously Written Blocks
If the write request is to an area of flash that already contains data, TrueFFS finds
a different, writable area of flash instead—one that is already erased and ready to
receive data. TrueFFS then writes the new data to that free area. After the data is
safely written, TrueFFS updates its block-to-flash mapping structures, so that the
NOTE: Storing data in flash memory requires the use of a manufacturer-supplied
programming algorithm, which is defined in the MTD. Consequently, writing to
flash is often referred to as programming flash.
Comentarios a estos manuales