JP2002251310A - Method for preparing file system for flash memory - Google Patents

Method for preparing file system for flash memory

Info

Publication number
JP2002251310A
JP2002251310A JP2001045518A JP2001045518A JP2002251310A JP 2002251310 A JP2002251310 A JP 2002251310A JP 2001045518 A JP2001045518 A JP 2001045518A JP 2001045518 A JP2001045518 A JP 2001045518A JP 2002251310 A JP2002251310 A JP 2002251310A
Authority
JP
Japan
Prior art keywords
file
file system
information
flash memory
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2001045518A
Other languages
Japanese (ja)
Inventor
Hisanori Kawaura
久典 川浦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2001045518A priority Critical patent/JP2002251310A/en
Publication of JP2002251310A publication Critical patent/JP2002251310A/en
Pending legal-status Critical Current

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PROBLEM TO BE SOLVED: To secure the safety of data without risking a failure of rewriting an unchanged sector by reducing the number of times of rewriting sectors in updating a file system of a flash memory. SOLUTION: A sector area of the flash memory is made to correspond to an information storage block 21 and data storage blocks 22, 23 and 24 in the file system 20 of the flash memory. The file system 20 comprises a plurality of storage blocks being two kinds, which are the storage block 21 where file system information 20a, directory information 20b, file information 20c and path information 20d are arranged to be stored and the data storage blocks 22, 23 and 24 where data of each file of file data 20e is arranged to be stored. Only a corresponding sector is rewritten with respect to storage blocks of a changed file system to reduce the number of sector rewriting times.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、フラッシュメモリ
のファイルシステム作成方式、より詳細には、フラッシ
ュメモリにおけるファイルシステムの書き換え方式に関
する。
The present invention relates to a method for creating a file system of a flash memory, and more particularly, to a method of rewriting a file system in a flash memory.

【0002】[0002]

【従来の技術】一般に、ファイルシステムにおいては、
例えば、フロッピー(登録商標)ディスク装置やハード
ディスク装置といった二次記憶装置をデータ格納領域と
して用いている。また、これらの二次記憶装置として
は、512バイト、1024バイトといったブロック単
位でランダムアクセス可能なものが一般的である。一
方、近年では、組み込みソフトの分野においてファイル
システムのデータ格納領域に、前述の二次記憶装置の代
わりに、フラッシュメモリを使用することも行われてき
ている。
2. Description of the Related Art Generally, in a file system,
For example, a secondary storage device such as a floppy (registered trademark) disk device or a hard disk device is used as a data storage area. As these secondary storage devices, those which can be randomly accessed in block units such as 512 bytes and 1024 bytes are generally used. On the other hand, in recent years, in the field of embedded software, a flash memory has been used instead of the above-described secondary storage device for a data storage area of a file system.

【0003】図9は、フラッシュメモリのファイルシス
テムの構成例を示す図で、図中、20は、フラッシュメ
モリのファイルシステムで、該ファイルシステム20
は、ファイルシステム情報20a、ディレクトリ情報2
0b、ファイル情報20c、パス情報20d、ファイル
データ20eの5個のブロックからなる。図9に示すフ
ァイルシステムを作成し、ファイルシステムの作成イメ
ージをフラッシュメモリに書き込み、マウントすること
によって、ファイルおよびツリー構造をフラッシュメモ
リ上に実装することができる。
FIG. 9 is a diagram showing a configuration example of a file system of a flash memory. In FIG. 9, reference numeral 20 denotes a file system of a flash memory.
Indicates file system information 20a and directory information 2
0b, file information 20c, path information 20d, and file data 20e. By creating the file system shown in FIG. 9, writing the created image of the file system into the flash memory, and mounting it, the file and the tree structure can be mounted on the flash memory.

【0004】ここで、フラッシュメモリの書き換えは、
セクタ単位で消去を行った後に、そのセクタへのデータ
を書き込むことで可能となる。
Here, rewriting of the flash memory is performed by
After erasing data in sector units, it becomes possible by writing data to the sector.

【0005】しかし、上記ファイルシステムは、上記の
5つのブロックが連続した構成であるため、フラッシュ
メモリ上のファイルシステム20を更新しようとしたと
き、ファイルシステム20のファイルシステム情報20
a、ディレクトリ情報20b、ファイル情報20c、パ
ス情報20dは、情報変更および格納サイズの伸張変更
が加わり、それらの格納サイズに変更が加わるためにフ
ァイルデータ20eの先頭アドレスも変更される。
However, since the file system has a configuration in which the above five blocks are continuous, when the file system 20 on the flash memory is updated, the file system information 20 of the file system 20 is not updated.
a, the directory information 20b, the file information 20c, and the path information 20d are subjected to an information change and an expansion change of the storage size, and the start address of the file data 20e is also changed because the storage size is changed.

【0006】図10は、従来方式のファイルシステム2
0の更新の一例を示す図で、図10(A)に更新前のフ
ァイルシステム20を示し、図10(B)に図10
(A)におけるファイル3のデータの更新とファイル4
のデータの削除を行った後のファイルシステム20を示
す。図10に示す従来方式では、フラッシュメモリ上の
ファイルシステム20の更新は、ファイルシステム全
体、つまりファイルシステム全体のサイズに相当するす
べてのセクタを書き換える必要がある。しかし、このフ
ラッシュメモリの書き換えは、変更が加わっていないフ
ァイルのファイルデータまでも書き換えを必要としてし
まうため、書き換え回数限界を持つフラッシュメモリに
おいては、適切な書き換え方式とはいえない。また、フ
ァイルシステム全体の書き換えは、予期しないフラッシ
ュメモリの書き換えに失敗すると、ファイルシステム自
体の破壊を招くため、データの安全性の面でも適切な書
き換えとはいえない。
FIG. 10 shows a conventional file system 2.
FIG. 10A shows an example of the file system 20 before the update, and FIG.
(A) Update of data in file 3 and file 4
2 shows the file system 20 after the data has been deleted. In the conventional method shown in FIG. 10, updating the file system 20 on the flash memory requires rewriting the entire file system, that is, all the sectors corresponding to the size of the entire file system. However, this rewriting of the flash memory requires rewriting even the file data of a file that has not been changed, and thus cannot be said to be an appropriate rewriting method in a flash memory having a limited number of times of rewriting. In addition, rewriting of the entire file system, if the rewriting of the flash memory fails unexpectedly, causes the destruction of the file system itself. Therefore, it cannot be said that rewriting is appropriate in terms of data security.

【0007】[0007]

【発明が解決しようとする課題】本発明は上述の点に鑑
みてなされたものであり、不要なフラッシュメモリのセ
クタの書き換えを減らし、フラッシュメモリ上のファイ
ルシステムおよび無変更のファイルデータの安全を考え
たファイルシステムの更新を行うこと、を目的としてな
されたものである。
SUMMARY OF THE INVENTION The present invention has been made in view of the above points, and reduces unnecessary rewriting of sectors of a flash memory, and secures a file system on a flash memory and the security of unmodified file data. The purpose of this is to update the file system in consideration of the above.

【0008】[0008]

【課題を解決するための手段】請求項1の発明は、フラ
ッシュメモリのファイルシステム作成方式において、フ
ラッシュメモリのファイルシステム中でセクタ境界を考
慮したブロックを格納ブロックとして、ファイルシステ
ム情報、ディレクトリ情報、ファイル情報、パス情報を
格納ブロックに収まるように配置した情報格納ブロック
と、ファイル毎のデータを格納ブロックに収まるように
配置したデータ格納ブロックの2種類かつ複数の格納ブ
ロックで構成することを特徴としたものである。
According to a first aspect of the present invention, in the flash memory file system creation method, a block considering a sector boundary in the file system of the flash memory is used as a storage block to store file system information, directory information, It is characterized by comprising two types and a plurality of storage blocks, an information storage block in which file information and path information are arranged to fit in a storage block, and a data storage block in which data for each file is arranged to fit in a storage block. It was done.

【0009】請求項2の発明は、請求項1に記載の発明
において、ファイル毎のデータをファイルの更新履歴の
古い順にデータ格納ブロックに収まるように配置するこ
とを特徴としたものである。
According to a second aspect of the present invention, in the first aspect of the present invention, the data for each file is arranged so as to fit in the data storage block in the chronological order of the update history of the file.

【0010】請求項3の発明は、請求項1または2に記
載の発明において、ファイルシステム情報、ディレクト
リ情報、ファイル情報、パス情報の情報格納ブロックが
単一で、その単一ブロックの空き領域に更新履歴の新し
いファイル毎のデータを、前記情報格納ブロックに収ま
るように配置することを特徴としたものである。
According to a third aspect of the present invention, in the first or second aspect, the information storage block of the file system information, the directory information, the file information, and the path information is single and the single block has an empty area. Data of a new update history for each file is arranged so as to fit in the information storage block.

【0011】[0011]

【発明の実施の形態】図1は、本発明が適用されるフラ
ッシュメモリのファイルシステム20を作成する情報処
理装置のシステム構成例を示す図で、図中、1は、CP
U、2は、RAM、3は、ROM、4は、メモリカード
インタフェイス、5は、メモリカード、6は、表示部、
7は、入力部、8は、HDD、9は、システムバスであ
る。本システムは、フラッシュメモリに書き込むファイ
ルシステム20のイメージを作成し、メモリカード5に
そのイメージと書き換えアドレスとサイズを指示する書
き換えプログラムの書き込みを行う。
FIG. 1 is a diagram showing an example of the system configuration of an information processing apparatus for creating a file system 20 of a flash memory to which the present invention is applied.
U, 2 is RAM, 3 is ROM, 4 is a memory card interface, 5 is a memory card, 6 is a display unit,
7, an input unit; 8, an HDD; and 9, a system bus. The present system creates an image of the file system 20 to be written to the flash memory, and writes the image, a rewrite address and a size to the memory card 5 to write a rewrite program.

【0012】図2は、本発明が適用されるフラッシュメ
モリのファイルシステム20の書き換えを行う情報処理
装置のシステム構成例を示す図で、図中、10は、フラ
ッシュメモリである。本システムは、メモリカード5を
差し込んで情報処理装置を起動すると、自動的にメモリ
カード5上の書き換えプログラムを実行し、フラッシュ
メモリ10のファイルシステム20の書き換えを行う。
FIG. 2 is a diagram showing an example of a system configuration of an information processing apparatus for rewriting a file system 20 of a flash memory to which the present invention is applied. In the drawing, reference numeral 10 denotes a flash memory. When the information processing apparatus is started with the memory card 5 inserted, the system automatically executes the rewriting program on the memory card 5 and rewrites the file system 20 of the flash memory 10.

【0013】ファイルシステム20は、ファイルシステ
ム情報20a、ディレクトリ情報20b、ファイル情報
20c、パス情報20d、ファイルデータ20eの5個
のブロックで構成され、各ブロックの構成は以下に示す
通りである。
The file system 20 is composed of five blocks of file system information 20a, directory information 20b, file information 20c, path information 20d, and file data 20e. Each block has the following configuration.

【0014】1.ファイルシステム情報 structrom_sblock{ unsignedlong magic;チェック用のマジックナンバー long time;ファイルシステムの作成日時(1
970/01/0100:00:00からの経過秒数) unsignedlong bsize;ファイルシステムのブロックサイ
ズ(4096) unsignedlong blocks;データ領域のブロック数 unsignedlong files;総ファイル数 unsignedlong nrdirent;ディレクトリ情報の個数 unsignedlong nrnode;ファイル情報の個数 unsignedlong pathsize;パス情報の総サイズ unsignedlong data_offset;先頭アドレスからデータ領
域までのオフセット量 };
1. File system information structrom_sblock {unsignedlong magic; Magic number for checking long time; File system creation date and time (1
Unsignedlong bsize; File system block size (4096) unsignedlong blocks; Data area blocks unsignedlong files; Total number of files unsignedlong nrdirent; Number of directory information unsignedlong nrnode; Number of file information unsignedlong pathsize; Total size of path information unsignedlong data_offset; Offset amount from start address to data area};

【0015】2.ディレクトリ情報 structrom_dirent{ unsignedlong name;ファイル名の文字列が、パス情報
のどの位置にあるかを示すオフセット値 unsignedlong rno;ファイルの番号 unsignedlong seq;ディレクトリの中での、ファイルの
順番を示す値 };
2. Directory information structrom_dirent {unsignedlong name; Offset value indicating where the character string of the file name is located in the path information unsignedlong rno; File number unsignedlong seq; Value indicating the order of files in the directory};

【0016】図3は、ディレクトリ構造の一例を示す図
である。ディレクトリ情報20bは、そのディレクトリ
内に存在するファイルの個数分だけ、必ず連続して配置
される。ファイルの順番seqは、ディレクトリの最初の
エントリから降順に割り振られており、最後のエントリ
では0になる。つまり、seqは、そのディレクトリの中
に、あと何個のファイルがあるかを示す値になってい
る。例えば、あるディレクトリ(directory)中に、あ
るファイル(filename)が存在する場合、図3に示すよ
うな構造になる。
FIG. 3 shows an example of a directory structure. The directory information 20b is always continuously arranged by the number of files existing in the directory. The file order seq is allocated in descending order from the first entry of the directory, and becomes 0 in the last entry. In other words, seq is a value that indicates how many files remain in that directory. For example, when a certain file (filename) exists in a certain directory (directory), the structure is as shown in FIG.

【0017】3.ファイル情報(ファイル情報のテーブ
ル) ファイルシステム20中のファイルは、ファイル毎に以
下の情報を有し、このファイル情報は、ファイル番号
(rno)順の配列になっており、ファイル番号をインデ
ックスにして簡単にファイル情報が取り出せるようにな
っている。
3. File Information (Table of File Information) The files in the file system 20 have the following information for each file, and the file information is arranged in the order of the file numbers (rno). File information can be easily retrieved.

【0018】structromfs_rnode{ unsignedshort mode UNIX(登録商標)ファイル
互換のモード情報 unsignedshort nlink このファイルへのハードリンク
の数 unsignedlong size ファイルのデータサイズ unsignedlong rno ファイルシステム内部のファイル
番号 long ctime ファイルの作成日時情報(1970/01/0100:
00:00からの経過秒数) unsignedlong uid 所有者のユーザ番号 unsignedlong gid グループ番号 unsignedlong offset ファイルのデータの位置情報
(ファイルシステムのデータ領域の先頭からのオフセッ
ト、ただし、ディレクトリの場合には、ディレクトリ情
報の中でのオフセット値) };
Structromfs_rnode {unsignedshort mode UNIX (registered trademark) file compatible mode information unsignedshort nlink Number of hard links to this file unsignedlong size File data size unsignedlong rno File number inside file system long ctime File creation date and time information (1970 / 01/0100:
Unsignedlong uid Owner's user number unsignedlong gid Group number unsignedlong offset File data location information (offset from the beginning of the file system data area. However, in the case of a directory, directory information Offset value within the)};

【0019】4.パス情報(ファイル名のテーブル) パス情報20dには、ファイルシステム中に存在するす
べてのファイル名の文字列が格納され、すべての文字列
はNULL(==0x00)で終端される。図3に示すように、各
ファイル名の文字列は、そのファイルに該当するディレ
クトリ情報20bの、nameポインタにより指定される。
また、シンボリックリンクファイルの場合には、ファイ
ル情報20cのdata_offsetポインタの指す先のパス情
報20dの領域に、シンボリックリンク先のファイル名
が格納される。
4. Path Information (Table of File Names) The path information 20d stores character strings of all file names existing in the file system, and all character strings are terminated with NULL (== 0x00). As shown in FIG. 3, the character string of each file name is specified by the name pointer of the directory information 20b corresponding to the file.
In the case of a symbolic link file, the file name of the symbolic link destination is stored in the area of the path information 20d to which the data_offset pointer of the file information 20c points.

【0020】5.ファイルデータ ファイルシステム20中の、すべてのファイルのデータ
が、ブロック単位で格納される。つまり、どんなに小さ
なファイル、例えば、1バイトだけのファイルでも、フ
ァイルシステム20のデータ領域では1ブロック分(409
6バイト)を占有する。
[5] File Data Data of all files in the file system 20 is stored in block units. That is, no matter how small a file, for example, a file of only one byte, the data area of the file system 20 has one block (409 bytes).
6 bytes).

【0021】図4は、本発明が適用されるフラッシュメ
モリのセクタ境界を考慮したファイルシステム20の構
成例を示す図で、図4(A)にフラッシュメモリのファ
イルシステムを示し、図4(B)にフラッシュメモリの
セクタ構成を示す。図4(A)に示すようにファイルシ
ステム20は、主に情報を格納する領域である情報格納
ブロック21、データを格納する領域であるデータ格納
ブロック22、23、24からなり、前述したファイル
システム20の5つのブロックに対してフラッシュメモ
リのセクタ境界を考慮したデータ配置を行うことにす
る。
FIG. 4 is a diagram showing an example of the configuration of a file system 20 in consideration of sector boundaries of a flash memory to which the present invention is applied. FIG. 4A shows a file system of a flash memory, and FIG. () Shows the sector configuration of the flash memory. As shown in FIG. 4A, the file system 20 mainly includes an information storage block 21, which is an area for mainly storing information, and data storage blocks 22, 23, 24, which are areas for storing data. Data arrangement is performed on 20 blocks in consideration of the sector boundaries of the flash memory.

【0022】ここでは、図4(B)に示すフラッシュメ
モリのセクタの領域をファイルシステム中の格納ブロッ
クとし、まず、ファイルシステム情報20a、ディレク
トリ情報20b、ファイル情報20c、パス情報20d
の4つは、それぞれ情報格納ブロック21に収まるよう
に配置され、書き込まれていない領域は、情報予備領域
20fとして、将来のファイルシステム更新による各情
報の伸張を考慮し、空き領域とする。次に、ファイルデ
ータ20eは、データ格納ブロック22、23、24の
先頭からファイル毎のデータが、各データ格納ブロック
に収まるように配置され、ファイルのデータ配置がされ
なかった領域は未使用領域となる。
Here, the sector area of the flash memory shown in FIG. 4B is used as a storage block in the file system. First, file system information 20a, directory information 20b, file information 20c, and path information 20d.
The four are arranged so as to fit in the information storage block 21, and the unwritten area is set as an empty area in consideration of the expansion of each information due to future file system update as an information spare area 20f. Next, the file data 20e is arranged such that the data for each file from the top of the data storage blocks 22, 23, and 24 fits in each data storage block, and the area where the data of the file is not arranged is an unused area. Become.

【0023】図5は、本発明が適用されるフラッシュメ
モリのファイルシステム20の書き換え処理の一例を説
明するフローチャートである。フラッシュメモリのセク
タ番号をs、書き込もうとしているフラッシュメモリの
ファイルシステム20の格納ブロック番号をb、これら
2つの共通のオフセット値をoとする。まず、フラッシ
ュメモリのセクタ番号s、および書き込もうとしている
フラッシュメモリのファイルシステム20の格納ブロッ
ク番号bを0に設定し(ステップS1)、共通のオフセ
ット値oを0に設定する(ステップS2)。各々の先頭
アドレスからのオフセット値oにおけるデータ値を順次
比較していく(ステップS3)。ここで、データの相違
があった場合(NOの場合)、その対象となる第sセク
タを消去し(ステップS8)、オフセット値oを0にす
る(ステップS9)。そして、対象となる書き換えよう
としているファイルシステム20の格納ブロックで書き
換えを行って(ステップS10)、次セクタに移り(ス
テップS11)、オフセット値oがセクタ(格納ブロッ
ク)サイズより大きいかどうか判断し(ステップS1
2)、大きい場合(YESの場合)、次の書き換えファ
イルシステムの格納ブロック、セクタに移行する(ステ
ップS6)。
FIG. 5 is a flowchart illustrating an example of a rewriting process of the file system 20 of the flash memory to which the present invention is applied. It is assumed that the sector number of the flash memory is s, the storage block number of the file system 20 of the flash memory to be written is b, and the common offset value of these two is o. First, the sector number s of the flash memory and the storage block number b of the file system 20 of the flash memory to be written are set to 0 (step S1), and the common offset value o is set to 0 (step S2). The data values at the offset value o from each head address are sequentially compared (step S3). Here, if there is a data difference (NO), the s-th sector as the target is erased (step S8), and the offset value o is set to 0 (step S9). Then, rewriting is performed in the storage block of the file system 20 to be rewritten (step S10), and the process moves to the next sector (step S11), and it is determined whether or not the offset value o is larger than the sector (storage block) size. (Step S1
2) If the size is larger (in the case of YES), the process proceeds to the next storage block and sector of the rewrite file system (step S6).

【0024】ステップS3において相違がなかった場合
(YESの場合)にも、次セクタに移り(ステップS
4)、オフセット値oがセクタ(格納ブロック)サイズ
より大きいかどうか判断し(ステップS5)、大きい場
合(YESの場合)、ステップS6で次の書き換えファ
イルシステムの格納ブロック、セクタに移り、同処理を
行う。この工程を書き換えファイルシステムの格納ブロ
ックがある限り、もしくはフラッシュメモリのセクタが
存在する限り実行する(ステップS7)。
If there is no difference in step S3 (in the case of YES), the process moves to the next sector (step S3).
4) It is determined whether or not the offset value o is larger than the sector (storage block) size (step S5). If it is larger (YES), the process moves to the next storage block and sector of the rewrite file system in step S6, and the same processing is performed. I do. This process is executed as long as there is a storage block of the rewrite file system or as long as there is a sector of the flash memory (step S7).

【0025】図6は、フラッシュメモリのファイルシス
テム20の書き換え処理の一例を示す図で、図中、25
は、データ格納ブロック、図6(A)に書き換えようと
するファイルシステムを示し、図6(B)にフラッシュ
メモリに書かれているファイルシステムを示す。図6
(A)に示す書き換えようとするファイルシステム20
では、ファイルデータ20e中のファイル2のデータが
更新され、そのデータサイズが減少して、ファイル2の
データがデータ格納ブロック22に収まるようになった
ため、図6(B)に示すように、ファイルシステム全て
を書き換えなければならなくなっている。
FIG. 6 is a diagram showing an example of a rewriting process of the file system 20 of the flash memory.
6A shows a data storage block, FIG. 6A shows a file system to be rewritten, and FIG. 6B shows a file system written in a flash memory. FIG.
A file system 20 to be rewritten as shown in FIG.
In FIG. 6B, the data of the file 2 in the file data 20e is updated, the data size of the file 2 is reduced, and the data of the file 2 can be accommodated in the data storage block 22, and as shown in FIG. The whole system has to be rewritten.

【0026】図7は、フラッシュメモリのファイルシス
テム20の書き換え処理の一例を示す図で、図7(A)
に書き換えようとするファイルシステムを示し、図7
(B)にフラッシュメモリに書かれているファイルシス
テムを示しており、前述の図6に示した例に対し、フラ
ッシュメモリのファイルシステム20の構成をさらに検
討したものである。図7(B)に示す例では、フラッシ
ュメモリのファイルシステム20中のファイルデータに
おいて、ファイルの更新履歴をもとに古いファイルデー
タからデータ格納ブロックにデータ配置されている。こ
こで、ファイルの古い順からファイル3、ファイル5、
ファイル2、ファイル1、ファイル4で配置される。
FIG. 7 is a diagram showing an example of a rewriting process of the file system 20 of the flash memory.
FIG. 7 shows a file system to be rewritten in FIG.
FIG. 6B shows a file system written in the flash memory. The configuration of the file system 20 of the flash memory is further examined with respect to the example shown in FIG. In the example shown in FIG. 7B, in the file data in the file system 20 of the flash memory, data is arranged from the oldest file data to the data storage block based on the update history of the file. Here, file 3, file 5,
Arranged in file 2, file 1, file 4.

【0027】図7に示すファイルシステム20の作成方
式では、更新履歴の古いファイルは、今後も変更を加え
る可能性が低く、さらに新しいファイルは頻繁に変更が
加わる可能性が高いため、ファイルデータ20eをファ
イルの変更の可能性の低いものからデータ格納ブロック
に配置することで作成し、図7(A)に示す書き換えよ
うとするファイルシステム20中のファイルデータ20
eの配置ずれをデータ格納ブロックの終盤にすることに
よって、書き換えを必要とするセクタを減らすことが出
来る。このとき、図6に示した例と同様にファイル2の
データに対してのみ更新され、データサイズが減少した
場合、図7(B)に示す例では、第2セクタ、第3セク
タに対してセクタの書き換えが不要になっており、セク
タの書き換え回数を減らすことが出来ている。
In the method of creating the file system 20 shown in FIG. 7, a file having an old update history is unlikely to be changed in the future, and a new file is likely to be frequently changed. Of the file system 20 in the file system 20 to be rewritten as shown in FIG.
By setting the displacement of e at the end of the data storage block, the number of sectors requiring rewriting can be reduced. At this time, similarly to the example shown in FIG. 6, when only the data of the file 2 is updated and the data size is reduced, in the example shown in FIG. This eliminates the need to rewrite the sector, thereby reducing the number of times the sector is rewritten.

【0028】図8は、フラッシュメモリのファイルシス
テム20の書き換え処理の一例を示す図で、図8(A)
に書き換えようとするファイルシステムを示し、図8
(B)にフラッシュメモリに書かれているファイルシス
テムを示す。図8(B)に示す例では、セクタの書き換
え回数を減らすため、情報格納ブロック21が1つのと
きは、最新のファイルを順に情報格納ブロック21の情
報予備領域20fに格納可能な限りデータを格納する。
書き換えるフラッシュメモリ上のファイルシステム20
では、ファイルの変更を加えると、必ずファイル情報は
変わる。つまり、ファイルシステム20の書き換えにお
いて、情報格納ブロック21に該当するセクタについて
は必ず書き換えを必要とする。
FIG. 8 is a diagram showing an example of a rewriting process of the file system 20 of the flash memory.
FIG. 8 shows a file system to be rewritten in FIG.
(B) shows a file system written in the flash memory. In the example shown in FIG. 8B, in order to reduce the number of times of rewriting of the sector, when the number of information storage blocks 21 is one, data is stored as long as the latest file can be sequentially stored in the information spare area 20f of the information storage block 21. I do.
File system 20 on flash memory to be rewritten
Then, every time you change the file, the file information changes. That is, in rewriting the file system 20, the sector corresponding to the information storage block 21 must be rewritten without fail.

【0029】ここで、変更を加えたファイルが情報予備
領域20fに収まるデータサイズであれば、ファイルデ
ータを構成するデータ格納ブロック22以降の書き換え
が不要になり、さらに、セクタの書き換えを減らすこと
ができる。図8(B)に示す例では、最新のファイル4
のデータ変更に対して、第1セクタのみの書き換えだけ
で済ますことが出来ている。
Here, if the changed file has a data size that can be accommodated in the information spare area 20f, rewriting of the data storage block 22 and subsequent data constituting the file data becomes unnecessary, and furthermore, rewriting of sectors can be reduced. it can. In the example shown in FIG.
For the data change, only the first sector needs to be rewritten.

【0030】[0030]

【発明の効果】請求項1の発明によると、ファイルシス
テムの書き換えを行うとき、ファイルシステム作成時に
データ格納ブロックの構成変更が行われない場合に限
り、変更があったファイルシステムの格納ブロックに対
してセクタ書き換えを行えばよいので、セクタ書き換え
回数を減らすことができ、かつ変更のないセクタに対し
て書き換え失敗の危険にさらさずに済むためデータの安
全を確保できる。
According to the first aspect of the present invention, when rewriting a file system, only when the configuration of the data storage block is not changed when the file system is created, the changed storage block of the file system is deleted. Sector rewriting can be performed, the number of times of sector rewriting can be reduced, and the security of data can be ensured because there is no risk of rewriting failure for unmodified sectors.

【0031】請求項2の発明によると、ファイルデータ
をファイル変更の可能性の低いものから順にデータ格納
ブロックに配置することにより、データ格納ブロックの
構成変更をファイルデータ中の終盤にして、請求項1の
発明よりもセクタ書き換え回数を減らすことができ、か
つ変更のないセクタに対して書き換え失敗の危険にさら
さずに済むためデータの安全を確保できる。
According to the second aspect of the present invention, the file data is arranged in the data storage block in ascending order of the possibility of file change, so that the configuration change of the data storage block is at the end of the file data. The number of times of sector rewriting can be reduced as compared with the first invention, and data security can be ensured because there is no need to expose the unmodified sector to the risk of rewriting failure.

【0032】請求項3の発明によると、変更されたファ
イルが情報格納ブロックの空き領域に収まった場合は、
必ずセクタ書き換えを行なうファイルシステム情報、デ
ィレクトリ情報、ファイル情報、パス情報の情報格納ブ
ロックのみのセクタ書き換えで済ますことができ、請求
項2の発明よりもセクタ書き換え回数を減らすことがで
き、かつ変更のないセクタに対して書き換え失敗の危険
にさらさずに済むためデータの安全を確保できる。
According to the third aspect of the present invention, when the changed file fits in the free area of the information storage block,
Sector rewriting can be performed only for the information storage block of the file system information, directory information, file information, and path information for which sector rewriting is always performed. Data security can be ensured because there is no need to risk rewriting failure for an empty sector.

【図面の簡単な説明】[Brief description of the drawings]

【図1】 本発明が適用されるフラッシュメモリのファ
イルシステムを作成する情報処理装置のシステム構成例
を示す図である。
FIG. 1 is a diagram illustrating an example of a system configuration of an information processing apparatus that creates a file system of a flash memory to which the present invention is applied.

【図2】 本発明が適用されるフラッシュメモリのファ
イルシステムの書き換えを行う情報処理装置のシステム
構成例を示す図である。
FIG. 2 is a diagram illustrating an example of a system configuration of an information processing apparatus that rewrites a file system of a flash memory to which the present invention is applied.

【図3】 ディレクトリ構造の一例を示す図である。FIG. 3 is a diagram illustrating an example of a directory structure.

【図4】 本発明が適用されるフラッシュメモリのセク
タ境界を考慮したファイルシステムの構成例を示す図で
ある。
FIG. 4 is a diagram showing a configuration example of a file system in which a sector boundary of a flash memory to which the present invention is applied is considered.

【図5】 本発明が適用されるフラッシュメモリのファ
イルシステムの書き換え処理の一例を説明するフローチ
ャートである。
FIG. 5 is a flowchart illustrating an example of a rewriting process of a file system of a flash memory to which the present invention is applied.

【図6】 フラッシュメモリのファイルシステムの書き
換え処理の一例を示す図である。
FIG. 6 is a diagram illustrating an example of a rewriting process of a file system of a flash memory.

【図7】 フラッシュメモリのファイルシステムの書き
換え処理の一例を示す図である。
FIG. 7 is a diagram illustrating an example of a rewriting process of a file system of a flash memory.

【図8】 フラッシュメモリのファイルシステムの書き
換え処理の一例を示す図である。
FIG. 8 is a diagram showing an example of a rewriting process of a file system of a flash memory.

【図9】 フラッシュメモリのファイルシステムの構成
例を示す図である。
FIG. 9 is a diagram illustrating a configuration example of a file system of a flash memory.

【図10】 従来方式のファイルシステムの更新の一例
を示す図である。
FIG. 10 is a diagram illustrating an example of updating a conventional file system.

【符号の説明】[Explanation of symbols]

1…CPU、2…RAM、3…ROM、4…メモリカー
ドインタフェイス、5…メモリカード、6…表示部、7
…入力部、8…HDD、9…システムバス、10…フラ
ッシュメモリ、20…ファイルシステム、20a…ファ
イルシステム情報、20b…ディレクトリ情報、20c
…ファイル情報、20d…パス情報、20e…ファイル
データ、20f…情報予備領域、21、情報格納ブロッ
ク、22、23、24、25…データ格納ブロック。
DESCRIPTION OF SYMBOLS 1 ... CPU, 2 ... RAM, 3 ... ROM, 4 ... Memory card interface, 5 ... Memory card, 6 ... Display part, 7
... Input unit, 8 HDD, 9 system bus, 10 flash memory, 20 file system, 20a file system information, 20b directory information, 20c
... file information, 20d ... path information, 20e ... file data, 20f ... information spare area, 21, information storage block, 22, 23, 24, 25 ... data storage block.

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 フラッシュメモリのファイルシステム作
成方式において、フラッシュメモリのファイルシステム
中でセクタ境界を考慮したブロックを格納ブロックとし
て、ファイルシステム情報、ディレクトリ情報、ファイ
ル情報、パス情報を格納ブロックに収まるように配置し
た情報格納ブロックと、ファイル毎のデータを格納ブロ
ックに収まるように配置したデータ格納ブロックの2種
類かつ複数の格納ブロックで構成することを特徴とする
フラッシュメモリのファイルシステム作成方式。
In a method for creating a file system of a flash memory, a block considering a sector boundary in a file system of a flash memory is set as a storage block, and file system information, directory information, file information, and path information are stored in the storage block. A file system creation method for a flash memory, comprising two types and a plurality of storage blocks, an information storage block arranged in a storage block and data storage blocks arranged so that data for each file fits in the storage block.
【請求項2】 請求項1に記載のフラッシュメモリのフ
ァイルシステム作成方式において、ファイル毎のデータ
をファイルの更新履歴の古い順にデータ格納ブロックに
収まるように配置することを特徴とするフラッシュメモ
リのファイルシステム作成方式。
2. A flash memory file system according to claim 1, wherein data of each file is arranged in a data storage block in the order of older file update history. System creation method.
【請求項3】 請求項1または2に記載のフラッシュメ
モリのファイルシステム作成方式において、ファイルシ
ステム情報、ディレクトリ情報、ファイル情報、パス情
報の情報格納ブロックが単一で、その単一ブロックの空
き領域に更新履歴の新しいファイル毎のデータを、前記
情報格納ブロックに収まるように配置することを特徴と
するフラッシュメモリのファイルシステム作成方式。
3. The file system creation method for a flash memory according to claim 1, wherein a single information storage block for file system information, directory information, file information, and path information is provided, and a free area of the single block. A file system creation method for a flash memory, wherein data for each new file in the update history is arranged so as to fit in the information storage block.
JP2001045518A 2001-02-21 2001-02-21 Method for preparing file system for flash memory Pending JP2002251310A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001045518A JP2002251310A (en) 2001-02-21 2001-02-21 Method for preparing file system for flash memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001045518A JP2002251310A (en) 2001-02-21 2001-02-21 Method for preparing file system for flash memory

Publications (1)

Publication Number Publication Date
JP2002251310A true JP2002251310A (en) 2002-09-06

Family

ID=18907303

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001045518A Pending JP2002251310A (en) 2001-02-21 2001-02-21 Method for preparing file system for flash memory

Country Status (1)

Country Link
JP (1) JP2002251310A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6731536B1 (en) * 2001-03-05 2004-05-04 Advanced Micro Devices, Inc. Password and dynamic protection of flash memory data
KR100862237B1 (en) 2007-03-02 2008-10-09 한국과학기술원 File System Based on NAND Flash Memory and Flie Search Method thereof
US7669003B2 (en) 2005-08-03 2010-02-23 Sandisk Corporation Reprogrammable non-volatile memory systems with indexing of directly stored data files
US7747837B2 (en) 2005-12-21 2010-06-29 Sandisk Corporation Method and system for accessing non-volatile storage devices
US7769978B2 (en) 2005-12-21 2010-08-03 Sandisk Corporation Method and system for accessing non-volatile storage devices
US7793068B2 (en) 2005-12-21 2010-09-07 Sandisk Corporation Dual mode access for non-volatile storage devices
US7814262B2 (en) 2005-10-13 2010-10-12 Sandisk Corporation Memory system storing transformed units of data in fixed sized storage blocks
US7877540B2 (en) 2005-12-13 2011-01-25 Sandisk Corporation Logically-addressed file storage methods
US7877539B2 (en) 2005-02-16 2011-01-25 Sandisk Corporation Direct data file storage in flash memories
US7949845B2 (en) 2005-08-03 2011-05-24 Sandisk Corporation Indexing of file data in reprogrammable non-volatile memories that directly store data files
US7984233B2 (en) 2005-02-16 2011-07-19 Sandisk Corporation Direct data file storage implementation techniques in flash memories
US8055832B2 (en) 2005-08-03 2011-11-08 SanDisk Technologies, Inc. Management of memory blocks that directly store data files
US8214583B2 (en) 2005-02-16 2012-07-03 Sandisk Technologies Inc. Direct file data programming and deletion in flash memories
JP2013218388A (en) * 2012-04-05 2013-10-24 Sharp Corp Program update device, method, program, and recording medium
US9104315B2 (en) 2005-02-04 2015-08-11 Sandisk Technologies Inc. Systems and methods for a mass data storage system having a file-based interface to a host and a non-file-based interface to secondary storage

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6731536B1 (en) * 2001-03-05 2004-05-04 Advanced Micro Devices, Inc. Password and dynamic protection of flash memory data
US9104315B2 (en) 2005-02-04 2015-08-11 Sandisk Technologies Inc. Systems and methods for a mass data storage system having a file-based interface to a host and a non-file-based interface to secondary storage
US8214583B2 (en) 2005-02-16 2012-07-03 Sandisk Technologies Inc. Direct file data programming and deletion in flash memories
US7877539B2 (en) 2005-02-16 2011-01-25 Sandisk Corporation Direct data file storage in flash memories
US7984233B2 (en) 2005-02-16 2011-07-19 Sandisk Corporation Direct data file storage implementation techniques in flash memories
US8055832B2 (en) 2005-08-03 2011-11-08 SanDisk Technologies, Inc. Management of memory blocks that directly store data files
US7669003B2 (en) 2005-08-03 2010-02-23 Sandisk Corporation Reprogrammable non-volatile memory systems with indexing of directly stored data files
US8291151B2 (en) 2005-08-03 2012-10-16 Sandisk Technologies Inc. Enhanced host interface
US7949845B2 (en) 2005-08-03 2011-05-24 Sandisk Corporation Indexing of file data in reprogrammable non-volatile memories that directly store data files
US7814262B2 (en) 2005-10-13 2010-10-12 Sandisk Corporation Memory system storing transformed units of data in fixed sized storage blocks
US7877540B2 (en) 2005-12-13 2011-01-25 Sandisk Corporation Logically-addressed file storage methods
US7769978B2 (en) 2005-12-21 2010-08-03 Sandisk Corporation Method and system for accessing non-volatile storage devices
US8209516B2 (en) 2005-12-21 2012-06-26 Sandisk Technologies Inc. Method and system for dual mode access for storage devices
US7793068B2 (en) 2005-12-21 2010-09-07 Sandisk Corporation Dual mode access for non-volatile storage devices
US7747837B2 (en) 2005-12-21 2010-06-29 Sandisk Corporation Method and system for accessing non-volatile storage devices
KR100862237B1 (en) 2007-03-02 2008-10-09 한국과학기술원 File System Based on NAND Flash Memory and Flie Search Method thereof
JP2013218388A (en) * 2012-04-05 2013-10-24 Sharp Corp Program update device, method, program, and recording medium

Similar Documents

Publication Publication Date Title
US8156165B2 (en) Transaction-safe FAT files system
US7363540B2 (en) Transaction-safe FAT file system improvements
JP2914360B2 (en) External storage device and data processing method
JP4037605B2 (en) Nonvolatile memory unit controller, memory system having the controller, and nonvolatile memory unit control method
JP2000305839A (en) Storage device, storage system, memory managing method, and recording medium
JP2002251310A (en) Method for preparing file system for flash memory
JP4825433B2 (en) Computing device with relatively limited storage space and operating system / file system thereof
US6675257B1 (en) System and method for managing storage space on a sequential storage media
WO2003056432A1 (en) Memory device and recording/reproducing apparatus using the same
JP3268130B2 (en) Data processing device using flash EEPROM
JP2007241576A (en) Nonvolatile storage device and data writing method
JPH117505A (en) Card type storage medium
JP3793868B2 (en) Flash memory management device and recording medium
JP3070539B2 (en) External storage device, data processing device, and data processing method
JP4953612B2 (en) Data processing apparatus, control method therefor, computer program, and storage medium
US20030200232A1 (en) Information processor and program
JP3636773B2 (en) Information processing device for database check
JP2004078902A (en) Storage device, memory management method, and program thereof
JP3620241B2 (en) File management apparatus, file management method, recording medium, and file management system
JPH11120044A (en) Data processor, data processing method, data processing system and recording medium
JPH10289144A (en) Memory control method
JP3624647B2 (en) Storage device, data management device, data management system, data management method, file management device, recording medium, and file management system
JP4200362B2 (en) Recording medium recording control method, recording control apparatus, and electronic apparatus
JP2008134777A (en) Caching method of file allocation table
JP7031327B2 (en) Information processing equipment, information processing methods, and programs