JP4130808B2 - Formatting method - Google Patents

Formatting method Download PDF

Info

Publication number
JP4130808B2
JP4130808B2 JP2004023797A JP2004023797A JP4130808B2 JP 4130808 B2 JP4130808 B2 JP 4130808B2 JP 2004023797 A JP2004023797 A JP 2004023797A JP 2004023797 A JP2004023797 A JP 2004023797A JP 4130808 B2 JP4130808 B2 JP 4130808B2
Authority
JP
Japan
Prior art keywords
fat
flash memory
erase block
sector
size
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.)
Expired - Fee Related
Application number
JP2004023797A
Other languages
Japanese (ja)
Other versions
JP2005216119A (en
Inventor
誠司 堀田
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.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial 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 Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP2004023797A priority Critical patent/JP4130808B2/en
Publication of JP2005216119A publication Critical patent/JP2005216119A/en
Application granted granted Critical
Publication of JP4130808B2 publication Critical patent/JP4130808B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Read Only Memory (AREA)

Description

本発明は、消去ブロック単位を持つ不揮発性メモリを用いた記録媒体に関し、特に、そのような記録媒体に関する。   The present invention relates to a recording medium using a nonvolatile memory having an erase block unit, and more particularly to such a recording medium.

近年、電気的に記録や消去が可能で、電源を切っても記録されたデータが不揮発なメモリ素子を内蔵した半導体フラッシュメモリが普及しつつある。この種の半導体フラッシュメモリは、機械的な可動部分が少なくて済み、小型・軽量に装置を構成できることから、モバイル機器などの分野ではハードディスクの代替として、すなわち二次記憶として利用されることも増えてきた。またメモリ素子の大容量化も進み、半導体フラッシュメモリは映像や音声を記録する用途にも使用され始めている。   In recent years, semiconductor flash memories that can be electrically recorded and erased and have built-in memory elements in which recorded data is non-volatile even when the power is turned off are becoming widespread. This type of semiconductor flash memory requires fewer mechanical moving parts, and can be configured to be compact and lightweight, so it is increasingly used as an alternative to hard disks in mobile devices and other fields, that is, as secondary storage. I came. In addition, as the capacity of memory devices has increased, semiconductor flash memories have begun to be used for recording video and audio.

半導体フラッシュメモリに記録された映像や音声などの情報は、一般にファイルシステムによってファイルとして管理されている。ファイルシステムは、個々のファイルのサイズや記録された日時、クラスタやセクタなどの記録領域の使用状況や空き状況などを管理し、これらのメタ情報を記録媒体に記録する。
例えば、あるオペレーティングシステムにおいては、二次記憶へのファイル入出力の最小単位を、メタ情報もユーザデータ領域のデータも区別せずにセクタとしている。これは、ハードディスクやフレキシブルディスクといった記録媒体の最小書き換え単位がセクタであるためである。また、FAT(File Allocation Table)系のファイルシステムにおいては、ユーザデータ領域のデータが、連続したセクタを複数個まとめたクラスタという単位によって管理される。
Information such as video and audio recorded in a semiconductor flash memory is generally managed as a file by a file system. The file system manages the size of each file, the date and time when it was recorded, the usage status and availability of recording areas such as clusters and sectors, and records such meta information on a recording medium.
For example, in a certain operating system, the minimum unit of file input / output to / from secondary storage is a sector without distinguishing between meta information and data in the user data area. This is because the minimum rewrite unit of a recording medium such as a hard disk or a flexible disk is a sector. Also, in a FAT (File Allocation Table) file system, data in the user data area is managed by a unit called a cluster in which a plurality of continuous sectors are collected.

一方、一般的に半導体フラッシュメモリは、データ記録の際には記録前に消去ブロックと呼ばれる一定のサイズのデータが電気的に一括消去される特徴を持っている。ここで、消去ブロックのサイズに満たないデータを記録する場合、一度そのブロックのデータを読み出して保持した後、ブロックのデータを一括消去し、保持していたデータを部分的に更新してから、ブロックに書き戻すことになる。このような動作はリード・モディファイ・ライトと呼ばれ、記録動作が複雑になり、記録の転送レートが低下する原因となる。高い転送レートでデータを記録するには、このような消去ブロックに対する部分的なデータ更新を避けるため、記録するデータのサイズを消去ブロックと同じサイズか、または、その整数倍のサイズにして、さらに記録するアドレスを消去ブロックの先頭に合わせる必要がある。   On the other hand, in general, a semiconductor flash memory has a characteristic that data of a certain size called an erase block is electrically erased collectively before data recording. Here, when recording data less than the size of the erase block, after reading and holding the data of the block once, erase the data of the block at once, update the data held partially, Will be written back to the block. Such an operation is called “read-modify-write”, which complicates the recording operation and lowers the recording transfer rate. In order to record data at a high transfer rate, in order to avoid partial data update for such erase blocks, the size of the data to be recorded is the same size as the erase block or an integral multiple of that size, and It is necessary to set the recording address to the beginning of the erase block.

一般的に、半導体フラッシュメモリを二次記憶として用いる場合、半導体フラッシュメモリにおける消去ブロック単位の境界と、半導体フラッシュメモリの上で構築されたファイルシステムが扱うクラスタの境界とは一致しない。半導体フラッシュメモリ上で、クラスタが複数の消去ブロックにまたがっていた場合、ひとつのクラスタ書き換えに対して複数回のブロック消去がおこなわれることになり、これは半導体フラッシュメモリの寿命を著しく縮めるとともに、クラスタがひとつの消去ブロック内に含まれていた場合に比べて書き込み時間も多くかかる。   In general, when a semiconductor flash memory is used as secondary storage, the boundary of erase block units in the semiconductor flash memory does not coincide with the boundary of clusters handled by a file system built on the semiconductor flash memory. When a cluster spans multiple erase blocks on a semiconductor flash memory, multiple block erases are performed for one cluster rewrite, which significantly shortens the life of the semiconductor flash memory and As compared with the case where is included in one erase block, the write time is longer.

このような問題を解決するために、例えば、以下のような方法が開発されている(特許文献1を参照。)。
図7は、半導体フラッシュメモリをFAT16ファイルシステムで初期化した場合のブロック構成図であって、特に、半導体フラッシュメモリ内のボリューム領域を表している。
In order to solve such a problem, for example, the following method has been developed (see Patent Document 1).
FIG. 7 is a block diagram when the semiconductor flash memory is initialized with the FAT16 file system, and particularly shows a volume area in the semiconductor flash memory.

図7に示されるように、ボリューム領域は、マスターブートレコード(MBR: Master Boot Record)及びルートパーティションテーブルセクタ701、予約領域702、703、システム領域708及びユーザデータ領域707から構成されている。
前記MBR及びルートパーティションテーブルセクタ701には、パーティションの開始位置が記録されている。パーティションは、前記システム領域708から開始される。
As shown in FIG. 7, the volume area includes a master boot record (MBR), a root partition table sector 701, reserved areas 702 and 703, a system area 708, and a user data area 707.
In the MBR and root partition table sector 701, the start position of the partition is recorded. The partition starts from the system area 708.

予約領域702、703は、MBR及びルートパーティションテーブルセクタ701とシステム領域708との間に設けられている領域である。以上、MBR及びルートパーティションテーブルセクタ701と予約領域702、703から構成される領域をパーティション管理領域という。
システム領域708は、更にパーティションブートセクタ704、二重化FAT705、ルートディレクトリエントリ(RDE: Root Directory Entry)706に分けられる。
The reserved areas 702 and 703 are areas provided between the MBR / root partition table sector 701 and the system area 708. As described above, an area composed of the MBR and root partition table sector 701 and the reserved areas 702 and 703 is referred to as a partition management area.
The system area 708 is further divided into a partition boot sector 704, a duplicated FAT 705, and a root directory entry (RDE) 706.

また、ユーザデータ領域707は、クラスタ単位で管理されている。
このようにすれば、前記ユーザデータ領域707の先頭が半導体フラッシュメモリの消去ブロックの境界と一致するようにマスターブートレコード及びパーティションテーブルを含むセクタからパーティションブートセクタまでのデータサイズを決定することができる。
The user data area 707 is managed in cluster units.
In this way, the data size from the sector including the master boot record and the partition table to the partition boot sector can be determined so that the head of the user data area 707 coincides with the erase block boundary of the semiconductor flash memory. .

従って、ユーザデータ領域におけるクラスタどうしの境界と消去可能ブロックの境界とが一致するので、ひとつのクラスタの書き換えに当たってふたつの消去ブロックを消去するような無駄を省くことができる。
しかしながら、前記方法により解決されるのは、ユーザデータ領域におけるファイルシステムの管理単位と消去ブロック単位の差異のみである。前記半導体フラッシュメモリのシステム領域708には、ユーザデータ領域を管理するためのメタ情報が記録されている。これらのメタ情報の中には、数多くのセクタにまたがり、かつ頻繁に書き換えがおこなわれるものも存在する。FATファイルシステムにおけるFATや、UDF(Universal Disk Format)ファイルシステムにおけるスペース・ビットマップといった、記録媒体上のデータ割り当て状況や空き状況を記録した情報などがその代表である。
Therefore, since the boundary between clusters in the user data area coincides with the boundary of erasable blocks, it is possible to eliminate the waste of erasing two erase blocks when rewriting one cluster.
However, the above method only solves the difference between the file system management unit and the erase block unit in the user data area. Meta information for managing the user data area is recorded in the system area 708 of the semiconductor flash memory. Among these pieces of meta information, there is a piece of information that spans many sectors and is frequently rewritten. Representative examples include FAT recording in the FAT file system and information recording the data allocation status and free space on the recording medium, such as space bitmap in the UDF (Universal Disk Format) file system.

前記FATや前記スペース・ビットマップはクラスタ単位で管理されないため、オペレーションシステムからの読み出しと更新の最小単位はセクタとなる。多くのオペレーションシステムにおいて、セクタ単位の入出力要求は、そのアドレスが連続している場合はひとつの大きな入出力要求として結合されるが、一般にメタ情報の更新場所が連続している保証はない。つまり、ひとつの消去ブロック内に含まれる様々な場所のセクタが書き換えられるたびに消去ブロックの読み出し、書き換え、書き戻しが発生する。FATやスペース・ビットマップといったメタ情報は比較的小さな単位の更新を頻繁に繰り返す性質を持っているので、これは半導体フラッシュメモリの寿命を縮めるのみならず、メタ情報の更新に多大な時間を要することで、ユーザデータ領域のデータに関する実効的な書き出しレートの著しい劣化をまねくことにもなる。   Since the FAT and the space bitmap are not managed in cluster units, the minimum unit for reading and updating from the operation system is a sector. In many operation systems, sector-by-sector input / output requests are combined as one large input / output request when their addresses are continuous, but there is generally no guarantee that the update location of meta information is continuous. That is, each time a sector at various locations included in one erase block is rewritten, the erase block is read, rewritten, and written back. Since meta information such as FAT and space bitmap has the property of frequently updating relatively small units, this not only shortens the life of the semiconductor flash memory, but also takes a lot of time to update the meta information. As a result, the effective writing rate of the data in the user data area is significantly degraded.

そこで、FATやスペース・ビットマップといったメタ情報を標準的なオペレーティングシステムに採用されているセクタ単位の入出力機構から独立させることが有効と考えられる。すなわち、前記メタ情報を主記憶上に消去ブロック単位でコピーし、オペレーションシステムは前記メタ情報のコピーに対して、ファイル入出力に伴うメタ情報の更新をおこなう。そしてオペレーションシステムは一定時間ごとに前記メタ情報コピーに対する更新の有無をチェックし、更新のあったメタ情報が含まれた消去ブロックを半導体フラッシュメモリに書き戻す。これにより、前記管理情報の更新に伴う消去ブロックの無駄な読み出し、書き換え、書き戻しの発生が抑制できる。
特開2001−188701号公報
Therefore, it is considered effective to make meta information such as FAT and space bitmap independent of the sector unit input / output mechanism employed in the standard operating system. That is, the meta information is copied onto the main memory in units of erase blocks, and the operation system updates the meta information accompanying file input / output with respect to the copy of the meta information. Then, the operation system checks whether or not the meta information copy is updated at regular intervals, and writes the erase block including the updated meta information back to the semiconductor flash memory. As a result, it is possible to suppress the occurrence of unnecessary read, rewrite, and writeback of the erase block associated with the update of the management information.
JP 2001-188701 A

しかしながら、上述のように半導体フラッシュメモリを初期化すると複数のメタ情報がひとつの消去ブロックを共有する可能性があるため、メタ情報の入出力管理が複雑になる。図8は、かかる半導体フラッシュメモリ(二次記憶)のデータ構造を示す図である。図8において、内部に消去ブロック単位808を持つ二次記憶807はFATファイルシステムで初期化されている。この初期化では、FAT803とFAT804が同一の消去ブロック810を共有し、またFAT804とルートディレクトリエントリ805が同一の消去ブロック810を共有している。   However, when the semiconductor flash memory is initialized as described above, there is a possibility that a plurality of meta information may share one erase block, so that input / output management of meta information becomes complicated. FIG. 8 shows the data structure of such a semiconductor flash memory (secondary storage). In FIG. 8, a secondary storage 807 having an erase block unit 808 inside is initialized by the FAT file system. In this initialization, FAT 803 and FAT 804 share the same erase block 810, and FAT 804 and root directory entry 805 share the same erase block 810.

前記初期化が施された半導体フラッシュメモリのFATを前記運用法で管理するためには、消去ブロックのコピー809と消去ブロックのコピー810を主記憶811に保持する必要がある。FAT803とFAT804は同一のデータであるため、これは冗長で、前記主記憶811の使用効率を悪化させる。また、このようにFAT803の先頭とFAT804の先頭がそれぞれ消去ブロック809、810内でオフセットを持つことで、ファイル入出力に伴うFATの参照や更新も煩雑になるうえ、FAT更新に際して主記憶811上でFAT803、804それぞれの該当箇所を更新する必要が生じる。   In order to manage the FAT of the initialized semiconductor flash memory by the operation method, it is necessary to hold the copy 809 of the erase block and the copy 810 of the erase block in the main memory 811. Since the FAT 803 and the FAT 804 are the same data, they are redundant and deteriorate the usage efficiency of the main memory 811. In addition, since the beginning of FAT 803 and the beginning of FAT 804 have offsets in erase blocks 809 and 810, respectively, FAT reference and update accompanying file input / output are complicated, and the FAT is updated on the main memory 811. Therefore, it is necessary to update the corresponding portions of the FATs 803 and 804, respectively.

また、FATが記録された消去ブロック内にFAT以外の管理情報(図8ではルートディレクトリエントリ805)が入り込んだ形で初期化されているため、前記消去ブロックの更新がファイル入出力に伴うFATの更新以外でも生じることになるので、ファイルシステムの運用手段の設計が複雑化し、前記消去ブロックの更新有無管理も煩雑になる。
本発明は、上述のような問題に鑑みて為されたものであって、メタ情報の読み書きの高速化と半導体フラッシュメモリの長寿命化を実現し、且つ、ファイルシステムの運用手段の設計が容易となるように初期化するフォーマット方法を提供することを目的とする。
Further, since the management information other than the FAT (the root directory entry 805 in FIG. 8) is initialized in the erase block in which the FAT is recorded, the update of the erase block is associated with the file input / output. Since it occurs even in cases other than updating, the design of the operation means of the file system becomes complicated, and the management of whether or not the erase block is updated becomes complicated.
The present invention has been made in view of the above-described problems, and achieves high-speed reading / writing of meta information and long life of a semiconductor flash memory, and easy design of file system operation means. It is an object of the present invention to provide a formatting method for initializing so that

上記目的を達成するため、本発明に係る半導体フラッシュメモリは、消去ブロック単位でデータが消去される半導体フラッシュメモリであって、ファイルとしてデータを記録するユーザ領域と、前記ファイルを管理するためのデータであるメタ情報を記録するシステム領域とを備え、前記ユーザ領域と前記システム領域とは消去ブロックを共有せず、前記ユーザ領域においてひとつのデータが記録または消去される際に、これと関連付けて更新される複数のメタ情報は互いに異なる消去ブロックに記録されることを特徴とする。   In order to achieve the above object, a semiconductor flash memory according to the present invention is a semiconductor flash memory from which data is erased in units of erase blocks, a user area for recording data as a file, and data for managing the file A system area for recording meta information, and the user area and the system area do not share an erasure block, and when one data is recorded or erased in the user area, it is updated in association therewith. The plurality of meta information to be recorded are recorded in different erase blocks.

このようにすれば、メタ情報の読み書きを高速化すると共に、半導体フラッシュメモリの長寿命化を図ることができる。
また、本発明に係る半導体フラッシュメモリは、FATファイルシステム規格に準拠して初期化されている半導体フラッシュメモリであって、前記システム領域は、パーティションブートセクタとファイルアロケーションテーブルを含み、前記パーティションブートセクタは、パーティションの先頭セクタに記録されており、前記ファイルアロケーションテーブルは、前記パーティションブートセクタから所定のセクタ数だけ隔てて記録されており、前記ファイルアロケーションテーブルの最終セクタが消去ブロックの最終セクタと一致するように、前記ファイルアロケーションテーブルのサイズが決定されていることを特徴とする。
In this way, reading and writing of meta information can be speeded up and the life of the semiconductor flash memory can be extended.
The semiconductor flash memory according to the present invention is a semiconductor flash memory initialized in accordance with the FAT file system standard, wherein the system area includes a partition boot sector and a file allocation table, and the partition boot sector Is recorded in the first sector of the partition, and the file allocation table is recorded at a predetermined number of sectors from the partition boot sector, and the last sector of the file allocation table matches the last sector of the erase block. As described above, the size of the file allocation table is determined.

このようにすれば、FATファイルシステム規格に準拠して初期化されている半導体フラッシュメモリについて、本発明の効果を得ることができる。
また、本発明に係る半導体フラッシュメモリは、UDFファイルシステム規格に準拠して初期化されている半導体フラッシュメモリであって、スペース・ビットマップがパーティションの先頭に記録されており、前記スペース・ビットマップの最終セクタが消去ブロックの最終セクタと一致するように、前記スペース・ビットマップのサイズが決定されていることを特徴とする。
In this way, the effects of the present invention can be obtained for a semiconductor flash memory that is initialized in accordance with the FAT file system standard.
The semiconductor flash memory according to the present invention is a semiconductor flash memory initialized in accordance with the UDF file system standard, and a space bitmap is recorded at the head of the partition, and the space bitmap The size of the space bit map is determined so that the last sector of the first and second sectors coincides with the last sector of the erase block.

このようにすれば、UDFファイルシステム規格に準拠して初期化されている半導体フラッシュメモリについて、本発明の効果を得ることができる。
本構成により、頻繁に書き換えの生じるメタ情報等の管理情報を、それぞれ独立して常に消去ブロック単位で半導体フラッシュメモリに書き戻すことができるため、メタ情報の読み書きの高速化と半導体フラッシュメモリの長寿命化を実現しつつ、ファイルシステムの運用手段の設計が容易になる。
In this way, the effects of the present invention can be obtained for a semiconductor flash memory that is initialized in accordance with the UDF file system standard.
With this configuration, management information such as meta information that frequently rewrites can be written back to the semiconductor flash memory independently in units of erase blocks, so that the reading / writing speed of meta information and the length of the semiconductor flash memory can be increased. The design of file system operation means is facilitated while realizing a long life.

以上述べたように、本発明によれば、半導体フラッシュメモリの寿命を延長することができるとともに、半導体フラッシュメモリを二次媒体としてリアルタイム性の高いデータを記録する際、消去ブロックをまたがったメタ情報の書き出しや、同一消去ブロックの複数回書き直しによって記録の実効速度が低下することを防ぐことができる。   As described above, according to the present invention, the lifetime of the semiconductor flash memory can be extended, and when recording data with high real-time property using the semiconductor flash memory as a secondary medium, the meta information across the erase blocks It is possible to prevent the effective recording speed from being reduced by writing data or rewriting the same erase block multiple times.

以下、本発明に係る記録媒体の実施の形態について、FAT16ファイルシステムを採用した半導体フラッシュメモリ例にとり、図面を参照しながら説明する。
[1] 実施の形態
図1は、本発明の実施の形態に係る半導体フラッシュメモリの物理番地0から始まる空間全体を表わす図である。図1に示されるように、半導体フラッシュメモリ1のデータ構造は、パーティション管理領域、システム領域及びユーザデータ領域からなっている。
Hereinafter, an embodiment of a recording medium according to the present invention will be described with reference to the drawings for an example of a semiconductor flash memory employing a FAT16 file system.
[1] Embodiment FIG. 1 is a diagram showing an entire space starting from physical address 0 of a semiconductor flash memory according to an embodiment of the present invention. As shown in FIG. 1, the data structure of the semiconductor flash memory 1 includes a partition management area, a system area, and a user data area.

半導体フラッシュメモリ1は隣接するNセクタ(N=2i:iは自然数)ごとに消去ブロックを持ち、データの書き換えは、前記消去ブロック単位でバッファへの読み出し、バッファ上での書き換え、半導体フラッシュメモリへの書き戻しをすることによっておこなわれる。なお、書き換えられるデータサイズと位置が消去ブロックと完全に一致する場合は、バッファへの読み込みが生じないため、書き換えは高速に実行される。 The semiconductor flash memory 1 has an erase block for every adjacent N sectors (N = 2 i : i is a natural number), and data is rewritten by reading to the buffer in units of the erase block, rewriting on the buffer, semiconductor flash memory This is done by writing back to Note that when the data size and position to be rewritten completely match the erase block, reading into the buffer does not occur, so rewriting is executed at high speed.

物理番地0に書かれたマスターブートレコードとパーティションテーブル101には、パーティションの開始位置、すなわちパーテシションブートセクタ103の位置が書かれている。これらの間にあるセクタは予約領域102として扱われ、データが書き込まれることはない。本実施の形態においては、前記パーティションブートセクタ103の先頭が消去ブロック112の先頭と一致するように前記予約領域102の大きさが設定されている。   In the master boot record written in the physical address 0 and the partition table 101, the start position of the partition, that is, the position of the partition boot sector 103 is written. A sector between these is treated as a reserved area 102 and no data is written. In the present embodiment, the size of the reserved area 102 is set so that the head of the partition boot sector 103 coincides with the head of the erase block 112.

図2はJIS−X0605に規定されている、FAT16のパーティションブートセクタ103の構成を示す表である。図2に示されるように、前記パーティションブートセクタ103の14〜15バイト目を用いて、パーティションブートセクタ103の直後に続く予約領域104の大きさを定めることができる。本実施の形態では、予約領域104のセクタ数を(M×N−1)と定めることで、予約領域104の直後に続くFAT105の先頭を消去ブロックの境界と一致させている。ここでMはパーティションブートセクタ103と予約領域104が占有する消去ブロックの数を示す正整数である。本実施の形態においては、M=1としたが、Mが正整数であればFAT105先頭と消去ブロックの境界の一致は必ず成立するので、1以外の値をとるとしても良い。   FIG. 2 is a table showing the configuration of the partition boot sector 103 of FAT16 defined in JIS-X0605. As shown in FIG. 2, the size of the reserved area 104 that immediately follows the partition boot sector 103 can be determined using the 14th to 15th bytes of the partition boot sector 103. In the present embodiment, the number of sectors in the reserved area 104 is defined as (M × N−1), so that the head of the FAT 105 immediately following the reserved area 104 is made coincident with the boundary of the erase block. Here, M is a positive integer indicating the number of erase blocks occupied by the partition boot sector 103 and the reserved area 104. In the present embodiment, M = 1. However, if M is a positive integer, the boundary between the head of the FAT 105 and the erase block always holds, so a value other than 1 may be taken.

また、パーティションブートセクタ103の22〜23バイト目で、FATひとつ当たりの領域の大きさを設定できる。すなわち、有効クラスタ数Tcに関わらずFATの大きさを決められることを意味している。次式は有効クラスタ数Tcを決定する式である。
c=[(TS−Ssys)/Sc
ここで、TSはメディア全体のセクタ数を表わし、Ssysは管理情報(マスターブートレコードとパーティションテーブル101、パーティションブートセクタ103、FAT105、106、ルートディレクトリエントリ107及び予約領域102、104)が占めるセクタ数を表わす。また、Scは1クラスタ当たりのセクタ数を表わす。また、ガウス記号[x]は、xを超えない最大の整数を表わす。すなわち、上式では、半導体フラッシュメモリ1の全セクタ数から管理情報を引いたセクタ数、すなわちユーザデータ領域109のセクタ数を、クラスタ当たりのセクタ数で割って、有効クラスタ数Tcとしている。
In addition, the size of the area per FAT can be set in the 22nd to 23rd bytes of the partition boot sector 103. That is, it means that the size of the FAT can be determined regardless of the effective cluster number T c . The following equation is an equation for determining the effective cluster number T c .
T c = [(T S −S sys ) / S c ]
Here, T S represents the number of sectors of the entire medium, and S sys is occupied by management information (master boot record and partition table 101, partition boot sector 103, FAT 105, 106, root directory entry 107 and reserved areas 102, 104). Represents the number of sectors. S c represents the number of sectors per cluster. The Gaussian symbol [x] represents the maximum integer that does not exceed x. That is, in the above formula, the number of sectors obtained by subtracting management information from the total number of sectors of the semiconductor flash memory 1, that is, the number of sectors in the user data area 109 is divided by the number of sectors per cluster to obtain the effective cluster number Tc .

さて、本実施の形態においては、FATの大きさを以下のようにして決定する。図3は、FATひとつ当たりのセクタ数を決定する手順を示すフローチャートである。図3に示されるように、FATひとつ当たりのセクタ数を決定するに際しては、先ず、パーティション内の総セクタ数TSからパーティションブートセクタ103と予約領域102、104とのセクタ数SRを減算して、ユーザデータ領域109、FAT105、106及びルートディレクトリエントリ107が占有するセクタ数Soを計算する(ステップS100)。 In the present embodiment, the size of the FAT is determined as follows. FIG. 3 is a flowchart showing a procedure for determining the number of sectors per FAT. As shown in FIG. 3, when determining the number of sectors per FAT, first, the number of sectors S R between the partition boot sector 103 and the reserved areas 102 and 104 is subtracted from the total number of sectors T S in the partition. Te, the user data area 109, FAT105,106 and root directory entry 107 to calculate the number of sectors S o occupied (step S100).

続いて、FATひとつ当たりの消去ブロック数を表わす変数Sに値ゼロを代入して初期化した後(ステップS101)、変数Sを1だけ増加させる(ステップS102)。
そして、不等式が成立するか否かを判断する。
[(So−S×N×FN−RDES)/Sc]≦(S×N×SS×8/16)−2
ここで、Nは消去ブロックひとつに含まれるセクタ数を表わす。FNはFATの個数を表わす。本実施の形態においては、FAT105、106に対応させて、FNは2とする。また、RDESはルートディレクトリエントリ107のセクタ数を表わし、Scは1クラスタ当たりのセクタ数を表わす。SSは1セクタ当たりのバイト数を表わす。[x]は上と同様、ガウス記号である。なお、FNは、JIS−X0605に従って、2以外の正整数値をとるとしても良い。
Subsequently, after initializing the variable S representing the number of erase blocks per FAT by substituting the value zero (step S101), the variable S is incremented by 1 (step S102).
And it is judged whether an inequality is materialized.
[(S o -S × N × F N -RDE S) / S c] ≦ (S × N × S S × 8/16) -2
Here, N represents the number of sectors included in one erase block. F N represents the number of FATs. In the present embodiment, F N is set to 2 corresponding to the FATs 105 and 106. Moreover, RDE S represents the number of sectors in the root directory entry 107, S c represents the number of sectors per cluster. S S represents the number of bytes per sector. [X] is a Gaussian symbol as above. Note that F N may take a positive integer value other than 2 in accordance with JIS-X0605.

すなわち、左辺は、パーティション内のユーザデータ領域に確保されるクラスタ数を表わし、右辺は、準備したFATの大きさで管理できるクラスタ数を表わす。よって、確保したFATの大きさがユーザデータ領域のクラスタ数をカバーしきれていない場合、前記不等式は成り立たない。逆に、FATの大きさがユーザデータ領域のクラスタ数をカバーできる場合には、前記不等式が成立する。   That is, the left side represents the number of clusters secured in the user data area in the partition, and the right side represents the number of clusters that can be managed with the prepared FAT size. Therefore, if the size of the secured FAT does not cover the number of clusters in the user data area, the above inequality does not hold. Conversely, if the size of the FAT can cover the number of clusters in the user data area, the above inequality holds.

さて、前記不等式が成立しない場合(ステップS103:NO)、FATひとつ当たりの消去ブロック数Sを1だけ増加させて(ステップS102)、上記不等式が成立するか否かを判定する。
上記不等式が成立すると判定された場合には(ステップS103:YES)、FATに必要な数の消去ブロックを割り当てることができたとして、式
S=S×N
を用いて、FATひとつ当たりのセクタ数FSを算出して(ステップS104)、処理を終了する。
If the inequality is not satisfied (step S103: NO), the number of erase blocks S per FAT is increased by 1 (step S102), and it is determined whether the inequality is satisfied.
If it is determined that the above inequality is satisfied (step S103: YES), it is assumed that the necessary number of erase blocks can be allocated to the FAT, and the expression F S = S × N
Is used to calculate the number of sectors F S per FAT (step S104), and the process is terminated.

以上の方法により、ユーザデータ領域の管理に必要な大きさを持ったFAT105、106が消去ブロック単位の大きさで確保できる。また、前述のように予約領域104の大きさを調節することでFATの先頭を消去ブロックの境界と一致させたことから、以上の方法によって確保したFATの末尾もまた消去ブロックの境界と一致する。すなわち、FATがちょうど消去ブロック単位で配置されることになる。   By the above method, the FATs 105 and 106 having a size necessary for managing the user data area can be secured in the size of the erase block unit. Further, as described above, by adjusting the size of the reserved area 104, the beginning of the FAT is made to coincide with the boundary of the erase block, so that the end of the FAT secured by the above method also coincides with the boundary of the erase block. . That is, the FAT is arranged in units of erase blocks.

また、パーティションブートセクタ103の17〜18バイト目において、ルートディレクトリエントリ107の大きさを
N×L×SS/32
とすれば、ユーザデータ領域の先頭と消去ブロックの境界を一致させることができる。ここで、Lはルートディレクトリエントリ107が占有する消去ブロックの数を表わし、任意の正整数値を与えることができる。SSはセクタひとつ当たりのバイト数を表わす。また、分母の32は、JIS−X0605に規定されているように、ディレクトリのエントリひとつ当たりに消費されるバイト数である。
In the 17th to 18th bytes of the partition boot sector 103, the size of the root directory entry 107 is set to N × L × S S / 32
Then, the beginning of the user data area and the boundary of the erase block can be matched. Here, L represents the number of erase blocks occupied by the root directory entry 107, and an arbitrary positive integer value can be given. S S represents the number of bytes per sector. The denominator 32 is the number of bytes consumed per directory entry as defined in JIS-X0605.

以上のようにして、半導体フラッシュメモリ1を初期化することにより、ふたつのFATがひとつの消去ブロック内に並存するのを回避することができる。また、ユーザデータ領域の先頭を消去ブロック境界に一致させることができる。
従って、二重化されたFATを更新する際に、同一の消去ブロックが2回書き換えられるといった事態を回避して、消去ブロック毎の書き換え回数を減少させることができるの半導体フラッシュメモリ1の寿命を延長することができる。
By initializing the semiconductor flash memory 1 as described above, it is possible to avoid two FATs coexisting in one erase block. In addition, the head of the user data area can be made coincident with the erase block boundary.
Therefore, when the duplicated FAT is updated, the situation that the same erase block is rewritten twice is avoided, and the lifetime of the semiconductor flash memory 1 that can reduce the number of rewrites for each erase block is extended. be able to.

本実施の形態においては、FAT105、106は、それぞれ対応する消去ブロックに同じようにして配置される。すなわち、いずれのFATもその先頭を消去ブロックの先頭に置き、1消去ブロック分の領域を占有するように配置される。なお、本発明においては、FATが占有する消去ブロック数は1に限定されないのは言うまでも無く、2以上の消去ブロックを占有するとしても良い。   In the present embodiment, the FATs 105 and 106 are arranged in the same manner in the corresponding erase blocks. In other words, each FAT is placed so that the head is placed at the head of the erase block and occupies the area for one erase block. In the present invention, it goes without saying that the number of erase blocks occupied by the FAT is not limited to one, and two or more erase blocks may be occupied.

従って、半導体フラッシュメモリにアクセスするアクセス装置が、FATにアクセスするためにそのFATを消去ブロック単位で内蔵メモリに読み込む際、FATの数だけメモリに読み込む必要はなく、ひとつのFATのみを内蔵メモリに読み込むだけでよくなる。すなわち、内蔵メモリ中のFATのコピーが更新された後は、その内容を半導体フラッシュメモリ上の複数のFATに対して上書きすることで、半導体フラッシュメモリ上の複数のFATの更新が可能となる。   Therefore, when an access device that accesses the semiconductor flash memory reads the FAT into the built-in memory in units of erase blocks in order to access the FAT, it is not necessary to read the number of FATs into the memory, and only one FAT is stored in the built-in memory. Just read. That is, after the copy of the FAT in the built-in memory is updated, the plurality of FATs on the semiconductor flash memory can be updated by overwriting the contents on the plurality of FATs on the semiconductor flash memory.

[2] 変形例
以上、本発明を実施の形態に基づいて説明してきたが、本発明が上述の実施の形態に限定されないのは勿論であり、以下のような変形例を実施することができる。
(1) 上記実施の形態においては、パーティションブートセクタ103の先頭を消去ブロックの境界に一致させる場合について説明したが、本発明がこれに限定されないのは言うまでもなく、同一消去ブロック内にパーティションブートセクタ103とFAT105とが混在しない限り、パーティションブートセクタ103の先頭を消去ブロック境界に一致させる必要はない。例えば、パーティションブートセクタ103の先頭が消去ブロック境界からK番目のセクタにあるならば、FAT先頭との間にある予約領域104の大きさをセクタ(M×N−K)個分とすれば良い。
[2] Modifications Although the present invention has been described based on the embodiments, it is needless to say that the present invention is not limited to the above-described embodiments, and the following modifications can be implemented. .
(1) In the above embodiment, the case where the head of the partition boot sector 103 is made to coincide with the boundary of the erase block has been described, but the present invention is not limited to this, and the partition boot sector is included in the same erase block. Unless 103 and FAT 105 are mixed, it is not necessary to make the head of the partition boot sector 103 coincide with the erase block boundary. For example, if the head of the partition boot sector 103 is in the Kth sector from the erase block boundary, the size of the reserved area 104 between the FAT head and the sector (M × N−K) may be set. .

(2) 上記実施の形態においてはFATを二重化する場合について説明したが、本発明がこれに限定されないのは言うまでもなく、パーティションブートセクタ103の16バイト目で指定することにより、FATの数を任意に変えても良い。
また、FATをひとつしか持たず、従ってFAT106を有しない場合には、FAT105の先頭を消去ブロック先頭と一致させる必要はない。消去ブロックの書き換え頻度が増大するおそれが無いからである。
(2) Although the case where the FAT is duplexed has been described in the above embodiment, it goes without saying that the present invention is not limited to this, and the number of FATs can be arbitrarily set by specifying the 16th byte of the partition boot sector 103. It may be changed to
Further, if there is only one FAT and therefore no FAT 106, it is not necessary to make the head of the FAT 105 coincide with the head of the erase block. This is because the erase block rewrite frequency does not increase.

この場合において、FAT105とルートディレクトリエントリ107とを同一の消去ブロックに並存させないためには、FAT105の末尾を消去ブロックの境界に一致させると良い。このためには、次式を満足するように各パラメータを設定すれば良い。
R+FS=N×I
ここで、SRはFAT105とルートディレクトリエントリ107以外の管理情報が占めるセクタ数を表わす。FSはFAT105のセクタ数を表わす。また、Nは消去ブロックひとつ当たりのセクタ数を表わし、Iは正整数である。
In this case, in order to prevent the FAT 105 and the root directory entry 107 from coexisting in the same erase block, it is preferable to match the end of the FAT 105 with the boundary of the erase block. For this purpose, each parameter may be set so as to satisfy the following equation.
S R + F S = N × I
Here, S R represents the number of sectors occupied by management information other than the FAT 105 and the root directory entry 107. F S represents the number of sectors of the FAT 105. N represents the number of sectors per erase block, and I is a positive integer.

上式の左辺はFAT105よりも前にあるすべての管理情報(マスターブートレコードとパーティションテーブル101、パーティションブートセクタ103及び予約領域102、104)とFAT105とが消費するセクタ数の総和であり、右辺は左辺が消去ブロック単位で確保されていることを表わしている。
(3) 上記本発明の形態においては、FAT16ファイルシステムを用いる場合を例にとり本発明について説明したが、本発明がこれに限定されないのは言うまでもなく、FAT16ファイルシステムに代えて、FAT12ファイルシステムやFAT32ファイルシステムを用いるとしても良い。
The left side of the above formula is the sum of all management information (master boot record and partition table 101, partition boot sector 103 and reserved areas 102, 104) before FAT 105 and the number of sectors consumed by FAT 105, and the right side is The left side indicates that the erase block is secured.
(3) In the above embodiment of the present invention, the present invention has been described by taking the case of using the FAT16 file system as an example. However, it goes without saying that the present invention is not limited to this, and instead of the FAT16 file system, a FAT12 file system, A FAT32 file system may be used.

上記FAT16ファイルシステムの場合には、FATの大きさを決定する際に不等式:
[(So−S×N×FN−RDES)/Sc]≦(S×N×SS×8/16)−2
を用いたが、FAT32ファイルシステムの場合には、不等式:
[(So−S×N×FN−RDES)/Sc]≦(S×N×SS×8/32)−2
を用いると良い。また、FAT12ファイルシステムの場合には、不等式:
[(So−S×N×FN−RDES)/Sc]≦(S×N×SS×8/12)−2
を用いると良い。
For the FAT16 file system, the inequality is used when determining the FAT size:
[(S o -S × N × F N -RDE S) / S c] ≦ (S × N × S S × 8/16) -2
In the case of the FAT32 file system, the inequality is:
[(S o -S × N × F N -RDE S) / S c] ≦ (S × N × S S × 8/32) -2
It is good to use. Also, in the case of the FAT12 file system, the inequality:
[(S o -S × N × F N -RDE S) / S c] ≦ (S × N × S S × 8/12) -2
It is good to use.

このように、FAT32ファイルシステムを用いる場合には、ルートディレクトリエントリ107をシステム領域108内にもつ必要がないため、前記図3にて示される初期化手順において、ルートディレクトリエントリ107に関する処理を省略できる。
(4) 上記実施の形態においては、パーティションブートセクタ103に対して消去ブロックをひとつ割り当てる場合について説明したが、FATをひとつしか持たず、従ってFAT106を有しない場合には、パーティションブートセクタ103をFAT105と同一の消去ブロックに配置しても良い。
As described above, when the FAT32 file system is used, since it is not necessary to have the root directory entry 107 in the system area 108, the processing related to the root directory entry 107 can be omitted in the initialization procedure shown in FIG. .
(4) In the above embodiment, the case where one erase block is assigned to the partition boot sector 103 has been described. However, when there is only one FAT and therefore no FAT 106, the partition boot sector 103 is assigned to the FAT 105. May be arranged in the same erase block.

例えば、図1において、消去ブロック3の先頭セクタにパーティションブートセクタ103を配置し、その後の(N−1)個のセクタをFAT105として使用するようにしても良い。
パーティションブートセクタ103をどの消去ブロックに配置するとしても、パーティションブートセクタ103は半導体フラッシュメモリをフォーマットする時に書き込まれた後は書き替えられることがないため、このようにしても半導体フラッシュメモリ1の寿命に影響を与えることがなく、本発明の効果にも影響しない。
For example, in FIG. 1, the partition boot sector 103 may be arranged at the head sector of the erase block 3, and the subsequent (N−1) sectors may be used as the FAT 105.
Even if the partition boot sector 103 is arranged in any erase block, the partition boot sector 103 is not rewritten after being written when the semiconductor flash memory is formatted. Does not affect the effects of the present invention.

(5) 上記実施の形態においては、FAT16ファイルシステムを例にとって説明したが、本発明がこれに限定されないのは言うまでもなく、FAT系列のファイルシステムに代えて、UDFファイルシステムを用いるとしても良い。このUDFファイルシステムについては、下記において標準規格化されている。
ISO/IEC 13346-1:1995, Information technology - Volume and file structure of write-once and rewritable media using nonsequential recording for information interchange - Part 1: General.
ISO/IEC 13346-2:1995, Information technology - Volume and file structure of write-once and rewritable media using nonsequential recording for information interchange - Part 2: Volume and boot block recognition.
ISO/IEC 13346-3:1995, Information technology - Volume and file structure of write-once and rewritable media using nonsequential recording for information interchange - Part 3: Volume structure.
ISO/IEC 13346-4:1995, Information technology - Volume and file structure of write-once and rewritable media using nonsequential recording for information interchange - Part 4: File structure.
ISO/IEC 13346-5:1995, Information technology - Volume and file structure of write-once and rewritable media using nonsequential recording for information interchange - Part 5: Record structure.
ISO/IEC 13490-1:1995, Information technology - Volume and file structure of read-only and write-once compact disk media for information interchange - Part 1: General.
ISO/IEC 13490-2:1995, Information technology - Volume and file structure of read-only and write-once compact disk media for information interchange - Part 2: Volume and file structure.
さて、UDFファイルシステムを用いる場合の半導体フラッシュメモリのデータ構造について説明する。図4は、UDFファイルシステムを用いる場合の半導体フラッシュメモリ内の論理セクタ番号0から開始する空間を表わす図である。
(5) In the above embodiment, the FAT16 file system has been described as an example. However, it goes without saying that the present invention is not limited to this, and a UDF file system may be used instead of the FAT series file system. The UDF file system is standardized as follows.
ISO / IEC 13346-1: 1995, Information technology-Volume and file structure of write-once and rewritable media using nonsequential recording for information interchange-Part 1: General.
ISO / IEC 13346-2: 1995, Information technology-Volume and file structure of write-once and rewritable media using nonsequential recording for information interchange-Part 2: Volume and boot block recognition.
ISO / IEC 13346-3: 1995, Information technology-Volume and file structure of write-once and rewritable media using nonsequential recording for information interchange-Part 3: Volume structure.
ISO / IEC 13346-4: 1995, Information technology-Volume and file structure of write-once and rewritable media using nonsequential recording for information interchange-Part 4: File structure.
ISO / IEC 13346-5: 1995, Information technology-Volume and file structure of write-once and rewritable media using nonsequential recording for information interchange-Part 5: Record structure.
ISO / IEC 13490-1: 1995, Information technology-Volume and file structure of read-only and write-once compact disk media for information interchange-Part 1: General.
ISO / IEC 13490-2: 1995, Information technology-Volume and file structure of read-only and write-once compact disk media for information interchange-Part 2: Volume and file structure.
Now, the data structure of the semiconductor flash memory when the UDF file system is used will be described. FIG. 4 is a diagram showing a space starting from logical sector number 0 in the semiconductor flash memory when the UDF file system is used.

UDFファイルシステムにおいて、ファイルの記録中に頻繁に更新されるメタ情報はスペース・ビットマップ403である。スペース・ビットマップ403は、図4に示されるように、パーティションの先頭に記録されている。前記パーティションの先頭位置は、メイン・ボリューム記述子401に含まれるパーティション記述子402にて特定される。前記パーティション記述子にて特定されるパーティションの先頭を消去ブロックの境界と一致させることで、スペース・ビットマップ403の先頭を消去ブロック境界に一致させることができる。   In the UDF file system, meta information frequently updated during file recording is a space bitmap 403. The space bitmap 403 is recorded at the head of the partition as shown in FIG. The head position of the partition is specified by a partition descriptor 402 included in the main volume descriptor 401. By matching the head of the partition specified by the partition descriptor with the boundary of the erase block, the head of the space bitmap 403 can be made to match the boundary of the erase block.

図5は、前記スペース・ビットマップ403の構成を示す表である。図5に示されるように、スペース・ビットマップ403の20〜23バイト目に、前記スペース・ビットマップ403の大きさが記述される。すなわち、パーティションに実際に含まれるブロック数とは独立にスペース・ビットマップ403の大きさを定義することができる。
従って、上記FAT16ファイルシステムの場合と同様にして、前記スペース・ビットマップ403をパーティション全体をカバーするのに充分な大きさとし、かつ前記スペース・ビットマップ403の末尾が消去ブロックの境界と一致するように定めることができる。これにより、前記スペース・ビットマップ403と他のメタ情報やユーザデータが同一消去ブロックに混在しないように配置することができる。
FIG. 5 is a table showing the configuration of the space bitmap 403. As shown in FIG. 5, the size of the space bitmap 403 is described in the 20th to 23rd bytes of the space bitmap 403. That is, the size of the space bitmap 403 can be defined independently of the number of blocks actually included in the partition.
Accordingly, in the same manner as in the FAT16 file system, the space bitmap 403 is made large enough to cover the entire partition, and the end of the space bitmap 403 coincides with the boundary of the erase block. Can be determined. Thus, the space bitmap 403 and other meta information and user data can be arranged so as not to be mixed in the same erase block.

なお、上記においては、更新されるメタ情報が同一の消去ブロックを共有しないようにスペース・ビットマップ403の先頭セクタと消去ブロックの先頭セクタを一致させたが、ファイル記録中にパーティション先頭以前のセクタに対する書き換えが生じない場合は、スペース・ビットマップの先頭セクタを消去ブロックの先頭セクタに一致させる必要はない。同一の消去ブロックに並存する複数のメタ情報が同時に更新され得ないからである。   In the above, the top sector of the space bitmap 403 and the top sector of the erase block are matched so that the updated meta information does not share the same erase block. If rewriting does not occur, it is not necessary to make the head sector of the space bitmap coincide with the head sector of the erase block. This is because a plurality of meta information existing in the same erase block cannot be updated simultaneously.

次に、半導体フラッシュメモリに効率よくファイルを記録するためのファイルシステムの運用方法について、FATファイルシステムの場合を例にとって説明する。なお、UDFファイルシステムを用いる場合も同様の運用方法がとられる。図6は、半導体フラッシュメモリにファイルを記録するための手順を説明するための図である。
図6において、アプリケーション601は、二次記憶である半導体フラッシュメモリ605に格納されるべきデータを作成する。また、アプリケーション601は、ファイルシステム構成手段602に対して、前記データを半導体フラッシュメモリ605に格納するように依頼する。ファイルシステム構成手段602は、内部にメタ情報処理部606と、データ処理手段607を備えている。半導体フラッシュメモリ605は前述のようなデータ構造を有している。
Next, a file system operation method for efficiently recording a file in a semiconductor flash memory will be described taking the case of a FAT file system as an example. A similar operation method is also used when using the UDF file system. FIG. 6 is a diagram for explaining a procedure for recording a file in the semiconductor flash memory.
In FIG. 6, an application 601 creates data to be stored in a semiconductor flash memory 605 that is a secondary storage. Further, the application 601 requests the file system configuration unit 602 to store the data in the semiconductor flash memory 605. The file system configuration unit 602 includes a meta information processing unit 606 and a data processing unit 607 inside. The semiconductor flash memory 605 has a data structure as described above.

ファイルシステム構成手段602は、半導体フラッシュメモリ605のマウント処理に際して、半導体フラッシュメモリ605上にあるパーティションのシステム領域613から、頻繁に書き換えが起こるメタ情報(例えば、論理セクタN番から論理セクタM番まで。)を、連続するセクタで構成される消去ブロック単位で切り出し、高速に読み書きが可能な機器の内蔵メモリ603にコピーする。   When the semiconductor flash memory 605 is mounted, the file system configuration unit 602 performs meta information (for example, from logical sector N to logical sector M) from the system area 613 of the partition on the semiconductor flash memory 605, which frequently rewrites. .) Is cut out in units of erase blocks composed of continuous sectors, and copied to the built-in memory 603 of the device capable of reading and writing at high speed.

このとき、半導体フラッシュメモリ605は上記実施の形態に示したデータ構造をとっているので、必要なメタ情報を消去ブロック単位で内蔵メモリ603にコピーすることができる。
また、ふたつのFATが同一消去ブロックを共有しないので、一方のFATのみを消去ブロック単位で切り出し、前記内蔵メモリ603にコピーすることができる。従って、システムの省メモリ化が可能となる。なお、ファイルシステム構成手段602は、消去ブロック単位取得手段615を介して、半導体フラッシュメモリ605に問い合わせることによって、消去ブロックのサイズを取得する。
At this time, since the semiconductor flash memory 605 has the data structure shown in the above embodiment, necessary meta information can be copied to the built-in memory 603 in units of erase blocks.
In addition, since two FATs do not share the same erase block, only one FAT can be cut out in units of erase blocks and copied to the internal memory 603. Accordingly, the memory of the system can be saved. The file system configuration unit 602 acquires the size of the erase block by inquiring of the semiconductor flash memory 605 via the erase block unit acquisition unit 615.

メタ情報処理部606は、内蔵メモリ603上で、コピーしてきたメタ情報を半導体フラッシュメモリ605の消去ブロックと同じ消去ブロック単位で管理し、消去ブロックごとに消去ブロック単位の書き換え有無管理手段を関連付ける。ここでは、書き換え有無管理手段の一例として、消去ブロックごとに関連付けた書き換え有無管理フラグ608を用いている。書き換え有無管理フラグ608は、マウント直後にすべて「clean」に設定される。   The meta information processing unit 606 manages the copied meta information in the same erase block unit as the erase block of the semiconductor flash memory 605 on the built-in memory 603, and associates a rewrite presence / absence management unit in erase block unit for each erase block. Here, the rewrite presence / absence management flag 608 associated with each erase block is used as an example of the rewrite presence / absence management means. All the rewrite presence / absence management flags 608 are set to “clean” immediately after mounting.

さて、アプリケーション601からデータの書き込みを依頼されると、ファイルシステム構成手段602は、ユーザデータ領域データ処理手段607を用いて、アプリケーション601から受け付けたデータを前記半導体フラッシュメモリ605のユーザデータ領域614に書き込む。この際、メタ情報処理部606が前記データに係るメタ情報を作成し、内蔵メモリ603にコピーされたメタ情報を更新する。また、情報の更新があった消去ブロックについては、書き換え有無管理フラグ608が「dirty」に設定される。   When the application 601 requests to write data, the file system configuration unit 602 uses the user data area data processing unit 607 to transfer the data received from the application 601 to the user data area 614 of the semiconductor flash memory 605. Write. At this time, the meta information processing unit 606 creates meta information related to the data, and updates the meta information copied to the internal memory 603. In addition, the rewrite presence / absence management flag 608 is set to “dirty” for the erase block for which information has been updated.

半導体フラッシュメモリ605上のメタ情報は定周期で更新される。すなわち、タイマー610は一定時間毎に半導体フラッシュメモリ605上のメタ情報の更新時期をメタ情報処理部606に通知する。当該通知を受け付けると、メタ情報処理部606は、内蔵メモリ603上の書き換え有無管理フラグ608を参照して、「dirty」とされている書き換え有無管理フラグ608を検出する。書き換え有無管理フラグ608が「dirty」ならば、内蔵メモリ603と半導体フラッシュメモリ605との間で対応するメタ情報の内容が一致しないからである。   The meta information on the semiconductor flash memory 605 is updated at regular intervals. That is, the timer 610 notifies the meta information processing unit 606 of the update time of the meta information on the semiconductor flash memory 605 at regular intervals. When the notification is received, the meta information processing unit 606 refers to the rewrite presence / absence management flag 608 in the built-in memory 603 and detects the rewrite presence / absence management flag 608 that is “dirty”. This is because if the rewrite presence / absence management flag 608 is “dirty”, the contents of the corresponding meta information do not match between the internal memory 603 and the semiconductor flash memory 605.

メタ情報処理部606にて書き換え有無管理フラグ608が「dirty」と判定された消去ブロックについては、消去ブロック単位書き出し手段604が内蔵メモリ603から当該消去ブロックを読み出して、半導体フラッシュメモリ605の対応する消去ブロックに消去ブロック単位で書き込む。
このようにすれば、メタ情報を常に消去ブロック単位でまとめて書き戻すことができるので、半導体フラッシュメモリの書き換え回数を削減して、その寿命を延ばすことができるとともに、高速なメタ情報の書き込みを実現することができる。
For an erase block for which the rewrite presence / absence management flag 608 is determined to be “dirty” by the meta information processing unit 606, the erase block unit writing unit 604 reads the erase block from the built-in memory 603 and corresponds to the semiconductor flash memory 605. Write to the erase block in erase block units.
In this way, the meta information can always be written back in units of erase blocks, so that the number of rewrites of the semiconductor flash memory can be reduced, extending its life, and high-speed meta information writing. Can be realized.

また、前記内蔵メモリ603へコピーした消去ブロックにはFAT以外のデータが混在していないため、書き換え有無管理フラグ608はFATの更新のみに着目して更新すれば良い。これにより、メタ情報の書き戻しに係る装置の構成を簡略化することができる。
なお、本変形例においては、消去ブロック単位取得手段615にて消去ブロックの大きさを取得するとしたが、これに代えて、ユーザがアプリケーション601を通じて手動で消去ブロックの大きさを通知するとしても良い。
Further, since data other than FAT is not mixed in the erase block copied to the internal memory 603, the rewrite presence / absence management flag 608 may be updated by paying attention only to the update of the FAT. As a result, the configuration of the apparatus related to writing back meta information can be simplified.
In this modification, the erase block size acquisition unit 615 acquires the size of the erase block. Alternatively, the user may manually notify the size of the erase block through the application 601. .

また、本変形例においては、マウント時に頻繁に書き換えるメタ情報をすべて内蔵メモリにコピーするとしたが、これに代えて、ファイル記録中に必要になった部分だけを消去ブロック単位で内蔵メモリにコピーするとしても良い。
また、本変形例においては、メタ情報の書き戻しのタイミングをタイマー610にてメタ情報処理部606に通知するとしたが、これに代えて、アプリケーションが適当なタイミングでファイルシステム構成手段602にメタ情報の書き戻しを指示するとしても良い。
In this modification, all the meta information that is frequently rewritten at the time of mounting is copied to the built-in memory. Instead, only the part necessary during file recording is copied to the built-in memory in units of erase blocks. It is also good.
In this modification, the meta information write-back timing is notified to the meta information processing unit 606 by the timer 610, but instead, the application notifies the meta information to the file system configuration unit 602 at an appropriate timing. May be instructed to write back.

本発明に係る記録媒体は、消去ブロック単位をもつ不揮発性メモリを用い記録媒体であって、そのような記録媒体の寿命を延長することができる技術として有用である。   The recording medium according to the present invention is a recording medium using a non-volatile memory having an erase block unit, and is useful as a technique that can extend the life of such a recording medium.

本発明の実施の形態に係る半導体フラッシュメモリの物理番地0から始まる空間全体を表わす図である。It is a figure showing the whole space which starts from the physical address 0 of the semiconductor flash memory based on embodiment of this invention. JIS−X0605に規定されている、FAT16のパーティションブートセクタ103の構成を示す表である。It is a table | surface which shows the structure of the partition boot sector 103 of FAT16 prescribed | regulated to JIS-X0605. 本発明の実施の形態に係るFATひとつ当たりのセクタ数を決定する手順を示すフローチャートである。It is a flowchart which shows the procedure which determines the number of sectors per FAT concerning embodiment of this invention. 本発明の変形例(5)に係る半導体フラッシュメモリ内の論理セクタ番号0から開始する空間を表わす図である。It is a figure showing the space which starts from the logical sector number 0 in the semiconductor flash memory concerning the modification (5) of this invention. 本発明の変形例(5)に係る半導体フラッシュメモリに記録されているスペース・ビットマップ403の構成を示す表である。It is a table | surface which shows the structure of the space bitmap 403 recorded on the semiconductor flash memory which concerns on the modification (5) of this invention. 本発明の変形例(5)に係る半導体フラッシュメモリにファイルを記録するための手順を説明するための図である。It is a figure for demonstrating the procedure for recording a file in the semiconductor flash memory which concerns on the modification (5) of this invention. 従来技術に係る半導体フラッシュメモリをFAT16ファイルシステムで初期化した場合のブロック構成図であって、特に、半導体フラッシュメモリ内のボリューム領域を表している。FIG. 2 is a block configuration diagram when a semiconductor flash memory according to the prior art is initialized with a FAT16 file system, and particularly shows a volume area in the semiconductor flash memory. 従来技術に係る半導体フラッシュメモリ(二次記憶)のデータ構造を示す図である。It is a figure which shows the data structure of the semiconductor flash memory (secondary storage) based on a prior art.

符号の説明Explanation of symbols

1…………………半導体フラッシュメモリ
101……………マスターブートレコードとパーティションテーブル
102、104…予約領域
103……………パーテシションブートセクタ
105、106…FAT
107……………ルートディレクトリエントリ
108、613…システム領域
109、614…ユーザデータ領域
111、112、113、114、115、609、612…消去ブロック
401……………メイン・ボリューム記述子
402……………パーティション記述子
403……………スペース・ビットマップ
601……………アプリケーション
602……………ファイルシステム構成手段
603……………内蔵メモリ
604……………消去ブロック単位書き出し手段
605……………半導体フラッシュメモリ
606……………メタ情報処理部
607……………データ処理手段
608……………書き換え有無管理フラグ
610……………タイマー
611……………セクタ
615……………消去ブロック取得手段
1 ......... Semiconductor flash memory 101 ............... Master boot record and partition table 102, 104 ... Reserved area 103 ......... Partition boot sector 105, 106 ... FAT
107 ............ Root directory entry 108, 613... System area 109, 614... User data area 111, 112, 113, 114, 115, 609, 612. ............... Partition descriptor 403 ............... Space bitmap 601 ............... Application 602 ............... File system configuration means 603 ............... Built-in memory 604 ............... Erasing Block unit writing means 605... Semiconductor flash memory 606... Meta information processing unit 607... Data processing means 608. …………… Sector 615 …………… Erasing block acquisition means

Claims (3)

コンピュータが、予め定めたクラスタサイズを持つFATファイルシステムでフラッシュメモリをフォーマットするフォーマット方法であって、
フラッシュメモリ上の番地であって、FATファイルシステムの構成情報を記入したセクタであるパーティションブートセクタを書き込む番地を決定する第1ステップと、
ファイルの配置状態を記入するFATの開始番地を、パーティションブートセクタとフラッシュメモリの消去ブロックを共用せず、かつ消去ブロックの先頭とする第2ステップと、
FATのサイズをフラッシュメモリの消去ブロックの整数倍とする第3ステップと、
フラッシュメモリがFATの末尾以降に持つ総セクタ数からクラスタサイズを除算して、フラッシュメモリ上の有効クラスタ数を求める第4ステップと、
FATが管理できる最大クラスタ数が有効クラスタ数よりも小さい場合、FATが管理できる最大クラスタ数が有効クラスタ数と同一か、有効クラスタ数よりも大きくなるまで、フラッシュメモリの消去ブロックの整数倍だけFATのサイズを大きくする第5ステップと、
FATが管理できる最大クラスタ数が有効クラスタ数と同一か、有効クラスタ数よりも大きい場合、当該FATのサイズをパーティションブートレコードに書き込む第6ステップと、を含む
ことを特徴とするフォーマット方法。
A formatting method in which a computer formats a flash memory with a FAT file system having a predetermined cluster size,
A first step of determining an address to write a partition boot sector, which is an address on the flash memory, which is a sector in which the configuration information of the FAT file system is written;
A second step in which the FAT start address for entering the file arrangement state is not shared with the partition boot sector and the erase block of the flash memory, and the erase block starts,
A third step in which the FAT size is an integral multiple of the erase block of the flash memory;
A fourth step of determining the number of effective clusters on the flash memory by dividing the cluster size from the total number of sectors that the flash memory has after the end of the FAT;
If the maximum number of clusters that can be managed by the FAT is smaller than the number of valid clusters, the FAT can be increased by an integer multiple of the erase block in the flash memory until the maximum number of clusters that can be managed by the FAT is equal to or greater than the number of valid clusters. A fifth step of increasing the size of
FAT maximum cluster number is valid clusters number and whether the same can be managed, is greater than the number of valid clusters, formatting method, which comprises a sixth step of writing the size of the FAT to partition boot record, the.
コンピュータが、予め定めたクラスタサイズを持ち、かつFATを1つだけ有するFATファイルシステムでフラッシュメモリをフォーマットする方法であって、
フラッシュメモリ上の番地であって、FATファイルシステムの構成情報を記入したセクタであるパーティションブートセクタを書き込む番地を決定する第1ステップと、
ファイルの配置状態を記入するFATの開始番地を、パーティションブートセクタと前記フラッシュメモリの消去ブロックを共用しない番地とする第2ステップと、
FATの最後のセクタがフラッシュメモリの消去ブロックの最後のセクタに一致するようにFATのサイズを決定する第3ステップと、
フラッシュメモリがFATの末尾以降に持つ総セクタ数からクラスタサイズを除算して、フラッシュメモリ上の有効クラスタ数を求める第3ステップと、
FATが管理できる最大クラスタ数が有効クラスタ数よりも小さい場合、FATが管理できる最大クラスタ数が有効クラスタ数と同一か、有効クラスタ数よりも大きくなるまで、フラッシュメモリの消去ブロックの整数倍だけFATのサイズを大きくする第5ステップと、
FATが管理できる最大クラスタ数が有効クラスタ数と同一か、有効クラスタ数よりも大きい場合、当該FATのサイズをパーティションブートレコードに書き込む第6ステップと、を含む
ことを特徴とするフォーマット方法。
A method in which a computer formats a flash memory with a FAT file system having a predetermined cluster size and having only one FAT,
A first step of determining an address to write a partition boot sector, which is an address on the flash memory, which is a sector in which the configuration information of the FAT file system is written;
A second step in which a FAT start address for entering a file arrangement state is set to an address not sharing the partition boot sector and the erase block of the flash memory;
A third step of determining the size of the FAT so that the last sector of the FAT matches the last sector of the erase block of the flash memory;
A third step of determining the number of effective clusters on the flash memory by dividing the cluster size from the total number of sectors that the flash memory has after the end of the FAT;
If the maximum number of clusters that can be managed by the FAT is smaller than the number of valid clusters, the FAT can be increased by an integer multiple of the erase block in the flash memory until the maximum number of clusters that can be managed by the FAT is equal to or greater than the number of valid clusters. A fifth step of increasing the size of
FAT maximum cluster number is valid clusters number and whether the same can be managed, is greater than the number of valid clusters, formatting method, which comprises a sixth step of writing the size of the FAT to partition boot record, the.
ルートディレクトリのファイル一覧であるルートディレクトリエントリのサイズを、フラッシュメモリの消去ブロックの整数倍として、パーティションブートレコードに書き込むステップを含む
ことを特徴とする請求項1又は2に記載のフォーマット方法。
3. The formatting method according to claim 1, further comprising a step of writing the size of the root directory entry, which is a file list of the root directory, into the partition boot record as an integral multiple of the erase block of the flash memory.
JP2004023797A 2004-01-30 2004-01-30 Formatting method Expired - Fee Related JP4130808B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004023797A JP4130808B2 (en) 2004-01-30 2004-01-30 Formatting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004023797A JP4130808B2 (en) 2004-01-30 2004-01-30 Formatting method

Publications (2)

Publication Number Publication Date
JP2005216119A JP2005216119A (en) 2005-08-11
JP4130808B2 true JP4130808B2 (en) 2008-08-06

Family

ID=34906696

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004023797A Expired - Fee Related JP4130808B2 (en) 2004-01-30 2004-01-30 Formatting method

Country Status (1)

Country Link
JP (1) JP4130808B2 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100703807B1 (en) * 2006-02-17 2007-04-09 삼성전자주식회사 Method and apparatus for managing block by update type of data in block type memory
JP4802791B2 (en) * 2006-03-20 2011-10-26 ソニー株式会社 Data storage device and data access method
JP4663577B2 (en) * 2006-05-16 2011-04-06 株式会社バッファロー Data storage device and initialization method thereof
JP4676378B2 (en) * 2006-05-18 2011-04-27 株式会社バッファロー Data storage device and data storage method
JP4991320B2 (en) 2007-01-12 2012-08-01 株式会社東芝 Host device and memory system
KR100923990B1 (en) * 2007-02-13 2009-10-28 삼성전자주식회사 Computing system based on characteristcs of flash storage
JP2009064263A (en) * 2007-09-06 2009-03-26 Toshiba Corp Memory device
JP5260152B2 (en) * 2008-06-06 2013-08-14 セミコンダクター・コンポーネンツ・インダストリーズ・リミテッド・ライアビリティ・カンパニー Nonvolatile memory control circuit
US8392687B2 (en) * 2009-01-21 2013-03-05 Micron Technology, Inc. Solid state memory formatting
US8180995B2 (en) 2009-01-21 2012-05-15 Micron Technology, Inc. Logical address offset in response to detecting a memory formatting operation
EP3364651B1 (en) 2011-04-19 2020-03-04 Dolby Laboratories Licensing Corporation High luminance projection displays and associated methods

Also Published As

Publication number Publication date
JP2005216119A (en) 2005-08-11

Similar Documents

Publication Publication Date Title
JP4238514B2 (en) Data storage device
US7610434B2 (en) File recording apparatus
EP2096546B1 (en) Write once recording device
US7752412B2 (en) Methods of managing file allocation table information
US8312554B2 (en) Method of hiding file at data protecting mode for non-volatile memory module, memory controller and portable memory storage apparatus
US7681008B2 (en) Systems for managing file allocation table information
US20060020744A1 (en) Method and apparatus for maintaining data on non-volatile memory systems
US20070043924A1 (en) Method for controlling memory card and method for controlling nonvolatile semiconductor memory
US7647470B2 (en) Memory device and controlling method for elongating the life of nonvolatile memory
US8914579B2 (en) Access device, information recording device, controller, and information recording system
US8977802B2 (en) Access device, information recording device, controller, real time information recording system, access method, and program
JP2008507756A (en) FAT analysis for optimized sequential cluster management
JPWO2005103903A1 (en) Nonvolatile storage system
JP2006040264A (en) Control method of memory card, and control method of nonvolatile semiconductor memory
WO2005066787A1 (en) Information recording medium
JP4130808B2 (en) Formatting method
JP4308780B2 (en) Semiconductor memory device, memory controller, and data recording method
WO2008042594A1 (en) Managing file allocation table information
US20050149493A1 (en) Data recording apparatus and data recording method
JP2008269520A (en) Recorder and recording method
JP2008262452A (en) Cache method of recording device, and recording device
JP2009205591A (en) Access module, information recording module, and information recording system
JPH1031611A (en) File system for nonvolatile memory storage medium
JP2009205590A (en) Access module, information recording module, controller, and information recording system
JPH06332795A (en) Electrically erasable nonvolatile memory controlling method and system therefor

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071218

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080128

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080226

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080401

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20080430

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080523

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110530

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120530

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130530

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130530

Year of fee payment: 5

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees