The abstract embedded system’s mass data save on its F1ash chip. According to the Flash component’s intrinsic property, constructs one to suit manages NAND Flash memory’s FAT filing system, and elaborates the concrete design concept. This system improved the FAT table and the FRT table memory way, lengthened memory’s service life, enhanced the stability.
Key word NAND Flash memory FATl6 filing system FAT table FRT table
NAND the Flash memory is one kind of data accuracy non-ideal component, easy to present the position reverse phenomenon, simultaneously will possibly have in the use badly damages the unit. The data reads in must carries on after Li Bai’s sub-area or the cleaning sub-area turban, its first floor specification carries on (in memory block which take the block as the unit the cleaning “Oxff” will read in must clean), presses the page to read in again. The Flash memory’s cleaning number of times is limited, generally is 100000 times. After some execution excessive cleaning operation, this storage space will become “read-only” the condition, cannot again the write data. According to the above characteristic, to avoid certain blocks the excessive operation, but causes memory stick loss of life, the design aims at the Flash memory’s filing system is specially necessary.
1 NAND FIash memory’s characteristic
NAND the Flash memory’s read operation and the ordinary SRAM memory is similar, may read stochastically, the read-out speed is also very quick. Chip production manufacturer stipulation storage space’s 1st must be the effective block, has loaded information and so on leaving the plant marking, system disposition; But other possibly before the use on the foot bad block, need in the primary use time carries on the bad block to examine and to mark, forbids the data to read, because the memory each internal structure is mutually independent, the bad block does not affect system’s operation.
Before designing NAND the Flash filing system, must first understand its internal structure. At present in market condition NAND the Flash chip monolithic capacity has reached as high as lGB, the storage capacity is highest reaches 4GB (to become by 4 piece of 1GB chip seals). Well-known NAND the Flash manufacturer has companies and so on Samsung, Tashiba. Below take Samsung Corporation’s K9wAG08UlM as an example, explains large capacity NAND the Flash chip the organizational structure. In K9WAG08U1M, page (page) is the most basic organization unit. Each page has the 2048 64=2112 byte, 64 pages constitute a block. (block), each block’s capacity is (2048 64)×64=(128KB 4KB), chip altogether 8192, total storage capacity for (128KB 4KB)×8192=lGB 32MB. Memory each page has 64 byte redundant bytes. The entire chip total 32 MB redundant spaces, use in storing the block information and the ECC verification code and so on.
2 FIash filing system’s application characteristic
At present the embedded equipment’s Flash filing system mainly has 3 kinds: M-Systems Corporation’s TrueFFS, JFFSx as well as aim at NAND F1ash design specially only YAFFS. These 3 kind of Flash filing system has introduced the diary structure thought that its turban JFFSx and YAFFS are the code open the source.
Now on the majority embedded hand-hold equipment’s operating system uses the FAT filing system, but under DOS the general FAT filing system does not suit transplants directly to the Flash memory. Mainly has the following 3 reasons: L, embedded system’s application condition is bad, the supply voltage is unstable, the burst characteristics power failure as well as illegal will insert pulls out will have the disastrous to the Flash memory influence; General file system regarding reliable design consideration insufficiency. 2nd, the general file system’s recorded information needs to rewrite many times (for example the FAT table), but the recorded information places in the fixed sub-area, will cause this sub-area the frequent use, affects the entire Flash component’s service life. The 3, Flash memory reading speed is quicker than the disk driver, the memory content many are the multimedia data informations. These data permission certain extent’s error rate, needs to look like the general file system not necessarily to be such strict guaranteed saves accuracy. If with badly damages the management through the nimble verification mechanism, then may achieve the more highly effective storage space use factor. This is even more needs to consider to the cost sensitive embedded system.
In view of the above situation, this design constructed one to suit NAND Flash memory’s FAT filing system. In view of its memory characteristic, has made the improvement to the FAT table and the FRT table’s memory way, lengthened the service life, strengthened the reliability, causes it to be more advantageous to the Flash memory’s application.
3 FAT filing system’s structure
The FAT filing system technology is mature, the structure simple, the system resources expenses are small, realizes easy in embedded system’s hardware platform.
The filing system is composed of the following 4 parts:
O– system record area (System Record Region);
1–FAT table area (FAT Region);
2– document registration form area (File Register Table Region);
3– data areas (Data Region).
①The system record area (System Record Region, SR) stores the most important filing system information, like Flash memory’s type, capacity, edition information, data area position and size, but also includes the district table and the main vectoring procedure. The main vectoring procedure’s duty inspects the district table to be whether correct, automatic read
The FAT table and the FRT table, duplicate it the control terminal in the memory.
②The file allocation table (File Allocation Table, FAT) deposits on the Flash memory all sub-area occupancy with the idle situation as well as each document memory connection structure. In the FAT filing system has 12, 1 6, 32 3 kind of different forms. The different form’s filing system management memory cell’s integer is different, if the FATl6 filing system uses 16 word lengths the distribution lists, most may manage 2 16 power of exponent (65536) basic memory cell.
③The document registration form (File Register Table, FRT) follows close on after the FAT table. Deposits time which in the F1ash filing system each document’s code number, the length, the attribute, the table of contents, the production or revise finally, as well as this document memory chain’s in file allocation table entrance.
④The data area (Data Region) uses in storing the data. In this Flash filing system, the data assignment’s smallest unit is a Flash memory’s basic cleaning unit, namely physical sub-area (block).
Considered the filing system the conveniences which realizes on the embedded equipment and measures the Flash memory’s application scale. The choice, establishes the FATl6 filing system.
4 FAT filing system’s improvement design
When filing system work, changes only then the FAT table and follows close on after that the FRT table, therefore, only uses to track the record FAT table and the FRT table can know that the file operation the special details, this is also filing system’s core; But the Flash memory structure and the hard disk are different, cannot rewrite its content directly. The direct transplant’s FAT filing system, the FAT table and the FRT table deposit throughout in the identical sub-area, will cause this sub-area the service life to be obviously shorter than other sub-areas. If this important region expires, will then affect the entire memory’s use, must therefore improve two tables the memory ways.
Flash the production manufacturer hypothesis’s storage space’s l sub-area is the effective block surely. In the improvement design, (128KB 4KB) takes the 1st sub-area memory’s system record area, simultaneously establishes 100KB in this sub-area (50 pages) blank region, uses in recording the FAT table (the FRT table follows close on the FAT table after the Flash start address, does not need again alone to record its first address). According to the write operation take the page as unit’s rule, 100 KB spaces, may join the FAT table the start address 50 times.
FIash 1st assignment block of information structure as shown in Figure 1.

The improvement design’s filing system takes the FAT table and the FRT table the transportable data to place in some sub-area, is recording the FAT table first address in the Flash system block of information, and aims at it with the indicator. Each time the FAT table saves when the position changes, only need increase the new position first address to the system block of information blank region, readjustment indicator’s direction. Like this has avoided the FAT table and the FRT table scratches repeatedly throughout in a sub-area writes, causes this sub-area to use excessively, reduces memory’s life. Filing system’s operating principle frame net as shown in Figure 2.

In Figure 2, advocates the guidance area procedure first to read out saves in the system block of information the FAT table first address, found the FAT table and the FRT table, duplicated it the control terminal in the memory to carry on again the operation (in memory to be possible according to position revision, avoided Flash not being able according to position revision question). Because the FAT filing system is the index chain structure, revises the FAT table and FRT table while the memory, also follows close on two table’s rewriting situations by the chain way in the Flash memory in two table following blank region. This occurs at any time suddenly power failure or illegal inserts pulls out causes in the situation which in the memory the FAT table and the FRT table lose, can also act according to the content which in Flash rewrites to restore two tables, enhances filing system’s reliability.
After operates completely completes, the first memory in FAT table and the FRT table writes about the memory to redeposit in the sub-area, the cleaning original table is at the sub-area, will after then redeposit in the sub-area the content to duplicate the cleaning in the original sub-area. Finally, the cleaning redeposits the sub-area, completes the entire operation.
At the same time, to avoid the table memory sub-area the excessive use, when its cleaning operation number of times to a threshold value (for example 500000 times), first moves the FAT table and the FRT table to other blank sub-area, the new sub-area takes the table the memory sub-area. Again the FAT table’s first address, writes about in the FIash memory’s system block of information reservation blank region, through changes the indicator, the procedure when the next time operation will read the new address. Deposits the FAT table and the FRT table sub-area originally symbolize to invalid, finally through the Flash refuse reclamation strategy, recycles this sub-area. This may achieve the FAT table and the FRT table takes the migration data storage the goal, lengthened the service life, as shown in Figure 3.

In the above design, the memory l sub-area takes the information record sub-area. In which reservation empty space may record 50 addresses, may satisfy the FAT table and the FRT table moves the 5O time. The table memory sub-area made the piece j life to enhance 5O time.
After the above improvement, the filing system has not only avoided the FAT table and the FRT table throughout in a block the phenomenon which uses excessively, also has avoided at any time, has situation which the power failure or illegal inserts pulls out. Still might act according to Flash has revised the content to establish the new FAT table and the FRT table, causes the filing system as for not to encounter the fatal destruction. Like this although has taken some Flash resources, but has guaranteed filing system’s security and the reliability. Through such has not counted, even if presented the abnormal operation the situation, wrong also only involved at that time the document which operated, will not proliferate for F1ash memory’s in other documents, therefore will thoroughly not damage the FAT table and the FRT table, created the entire filing system’s paralysis.
Conclusion
FAT filing system which the Flash memory’s characteristic has not counted according to the embedded system, has made the improvement to the FAT table and the FRT table’s memory way, caused its service life and the reliability had the big enhancement. Even if under bad working condition which in the embedded equipment abnormal operation frequency sends, the filing system can also guarantee that the security works. This filing system stemming from the reliable consideration, the usual filing system only takes 1 D (the block (redeposits sub-area) resources, but uses regarding embedded on NANE) the Flash memory, such consumption is acceptable completely.
Editor note: This article shrinks slightly the version for the periodical, the full text sees this publication website www.mesnet.com.cn.