JPH10289144A - Memory control method - Google Patents

Memory control method

Info

Publication number
JPH10289144A
JPH10289144A JP9092668A JP9266897A JPH10289144A JP H10289144 A JPH10289144 A JP H10289144A JP 9092668 A JP9092668 A JP 9092668A JP 9266897 A JP9266897 A JP 9266897A JP H10289144 A JPH10289144 A JP H10289144A
Authority
JP
Japan
Prior art keywords
sector
fat
area
file
recorded
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
JP9092668A
Other languages
Japanese (ja)
Inventor
Takeshi Nakamura
毅 中村
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.)
Pioneer Corp
Original Assignee
Pioneer Electronic Corp
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 Pioneer Electronic Corp filed Critical Pioneer Electronic Corp
Priority to JP9092668A priority Critical patent/JPH10289144A/en
Publication of JPH10289144A publication Critical patent/JPH10289144A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To extend the service life of a flash memory by using first a sector that remains longest as a free area in terms of a time series when the free area is secured for writing the data. SOLUTION: When the accesses are given to a storage 10 for the writing, erasion, etc., of files, a memory controller 102 controls a flash memory 101. In a file write mode, the FAT entries showing successively the idle sectors at and after the head of a FAT area are retrieved and the files are written into the sectors which are shown by the retrieved FAT entries. At the same time, the retrieved FAT entries are rewritten into the FAT entries showing the non-idle sectors. In a file erasion mode, the relevant file is deleted and also a new FAT entry is produced for the sector that becomes idle use to the file deletion. Then the new FAT entry is recorded at the end of the FAT area.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、メモリの制御方法
に関する。
The present invention relates to a method for controlling a memory.

【0002】[0002]

【従来の技術】パーソナルコンピュータ等の情報処理装
置には、プログラム実行過程において使用されるRAM
(ランダムアクセスメモリ)の他に、各種アプリケーシ
ョンソフトを記憶しておく為の記憶装置が設けられてい
る。この種の記憶装置としては、電源遮断後もその記憶
内容を保持しておく必要がある為、その記憶媒体として
磁気記録ディスクを用いたハードディスク装置が採用さ
れていた。
2. Description of the Related Art An information processing apparatus such as a personal computer has a RAM used in a program execution process.
In addition to (random access memory), a storage device for storing various application software is provided. As this type of storage device, it is necessary to retain the stored content even after power is turned off, and a hard disk device using a magnetic recording disk has been employed as the storage medium.

【0003】ところが、近年、上記記憶装置の高速アク
セス化に伴い、上記磁気記録ディスクに代わり、フラッ
シュメモリの如き書込自在な不揮発性半導体メモリを用
いる試みが為されている。フラッシュメモリは、そのメ
モリセルのゲート領域に高電圧を印加することにより、
かかるゲート領域に電荷を形成させてデータの書き込み
記憶を行うものである。
[0003] In recent years, however, attempts have been made to use a writable non-volatile semiconductor memory such as a flash memory in place of the magnetic recording disk with the high-speed access of the storage device. Flash memory applies a high voltage to the gate region of its memory cell,
Data is written and stored by forming charges in such a gate region.

【0004】しかしながら、フラッシュメモリにおいて
は、1つのメモリセルに上記の如き書き込みが集中する
と、半導体自体の特性劣化が生じて、そのメモリセルが
破壊してしまうという問題を抱えている。
[0004] However, the flash memory has a problem that if the above-mentioned writing is concentrated on one memory cell, the characteristics of the semiconductor itself are deteriorated and the memory cell is destroyed.

【0005】[0005]

【発明が解決しようとする課題】本発明は、かかる問題
を解決せんとして為されたものであり、メモリの使用寿
命を延ばすことが出来るメモリの制御方法を提供するこ
とを目的とする。
SUMMARY OF THE INVENTION The present invention has been made in order to solve such a problem, and an object of the present invention is to provide a method of controlling a memory which can extend the service life of the memory.

【0006】[0006]

【課題を解決するための手段】本発明によるメモリの制
御方法は、各々が所定記録容量からなる複数のセクタに
てメモリの記録領域を区分けし、前記セクタ単位にて前
記メモリの制御を行う方法であって、前記セクタの各々
が空きセクタであるか否かを示すファットエントリを前
記メモリのファット領域中に記録しておき、ファイルの
書込時には、前記ファット領域の先頭から順に空きセク
タであることを示すファットエントリを検索してこの検
索ファットエントリによって示されるセクタに前記ファ
イルの書込みを行うと共に、前記検索ファットエントリ
を空きセクタではないことを示すファットエントリに書
き換え、ファイルの消去時には、削除対象となったファ
イルを削除すると共に、前記ファイルの削除によって空
きセクタとなったセクタに関するファットエントリを新
たに作成してこれを前記ファット領域の最後尾に記録す
ることを特徴とする。
According to a memory control method of the present invention, a memory recording area is divided into a plurality of sectors each having a predetermined recording capacity, and the memory is controlled on a sector-by-sector basis. A fat entry indicating whether or not each of the sectors is a free sector is recorded in a fat area of the memory, and at the time of writing a file, the sectors are sequentially free sectors from the head of the fat area. A fat entry indicating that the file is written to the sector indicated by the search fat entry, and the search fat entry is rewritten to a fat entry indicating that the sector is not a free sector. Was deleted, and the file was deleted and became a free sector. And create a new fat entry for Kuta wherein the record this to the end of the fat region.

【0007】[0007]

【発明の実施の形態】図1は、情報処理装置の構成の一
例を示す図である。図1において、記憶装置10は、電
源遮断後もその記憶内容を保持しておくことが出来る書
込自在なフラッシュメモリ101、及びかかるフラッシ
ュメモリ101に対して書込及び読出制御を行うメモリ
コントローラ102から構成される。
FIG. 1 is a diagram showing an example of the configuration of an information processing apparatus. In FIG. 1, a storage device 10 includes a writable flash memory 101 capable of retaining its stored contents even after power is turned off, and a memory controller 102 that performs writing and reading control on the flash memory 101. Consists of

【0008】図2は、かかるフラッシュメモリ101の
初期論理フォーマットを示す図である。図2に示される
が如く、その初期状態においてフラッシュメモリ101
の記憶領域は、フック領域、ディレクトリ領域、FSL
(Free Storage List)_FAT領域、及びファイル領域な
る4つの領域に区分されている。かかるフラッシュメモ
リ101に対するアクセスは、各々が重複しないSID
(セクタID)0〜Nにて示されるセクタ単位にて実施
され、上記フック領域は、その初期論理フォーマット時
においてSID=0のセクタに割り当てられる。
FIG. 2 is a diagram showing an initial logical format of the flash memory 101. As shown in FIG. 2, the flash memory 101 is in its initial state.
Storage areas are hook area, directory area, FSL
(Free Storage List) _FAT area and file area. The access to the flash memory 101 is performed by using unique SIDs.
(Sector ID) It is implemented in units of sectors indicated by 0 to N, and the hook area is allocated to the sector of SID = 0 at the time of the initial logical format.

【0009】尚、以下の説明においてフラッシュメモリ
101は、初期化またはデータ消去された状態では、全
てのビットが論理値"0"になるものとする。又、データ
消去は、ブロック単位でしかできないが、消去ビットへ
の書き込み("0"→"1")は、ワード単位(所定ビット
数)にて可能であるとする。図3は、上記フック領域の
初期論理フォーマット時におけるメモリフォーマットを
示す図である。
In the following description, it is assumed that all bits of the flash memory 101 have a logical value "0" when initialized or data is erased. It is assumed that data can be erased only in block units, but writing to erase bits ("0" → "1") can be performed in word units (predetermined number of bits). FIG. 3 is a diagram showing a memory format at the time of the initial logical format of the hook area.

【0010】図3において、かかるフック領域の先頭部
には、この1セクタがフック領域であることを示す識別
ID、及びこのフック領域に割り当てられたセクタが正
常であるか否かを示すセクタチェックバイトCBが記録
される。更に、上記ディレクトリ領域の先頭のセクタI
Dを示すD−SIDが記録され、その後に、追記領域が
配置されている。かかる追記領域は、上記D−SIDが
新たなものに更新された場合に、この最新のD−SID
を順次追記して行く為に設けられている。
In FIG. 3, at the head of the hook area, an identification ID indicating that this one sector is a hook area, and a sector check indicating whether the sector allocated to this hook area is normal or not. The byte CB is recorded. Further, the first sector I of the directory area
A D-SID indicating D is recorded, and thereafter, an additional recording area is arranged. When the D-SID is updated to a new one, the additional D-SID is updated to the latest D-SID.
Are sequentially added.

【0011】尚、本実施例の形態では、識別IDにはフ
ック領域の存在するセクタIDを書き込み、CBには識
別IDの全ビットを反転した値を書き込むものとする。
図4は、図2に示されるディレクトリ領域の初期論理フ
ォーマット時におけるメモリフォーマットを示す図であ
る。図4に示されるが如く、ディレクトリ領域には、F
SLディレクトリエントリ0〜n、並びにディレクトリ
エントリ0〜kが形成されている。
In this embodiment, it is assumed that a sector ID in which a hook area exists is written in the identification ID, and a value obtained by inverting all bits of the identification ID is written in CB.
FIG. 4 is a diagram showing a memory format in the initial logical format of the directory area shown in FIG. As shown in FIG. 4, the directory area contains F
SL directory entries 0 to n and directory entries 0 to k are formed.

【0012】FSLディレクトリエントリ0〜nの各々
には、このFSLディレクトリエントリが有効なもので
あるか否かを示すデリートチェックバイトDCB、ファ
イルタイプ及びFSL_FAT領域中において最も先頭
位置に存在する有効なFATエントリ(後述する)が記
録されているセクタを示すセクタIDとして、FT−S
IDが記録される。尚、初期論理フォーマット時、及び
データが消去された後においては、FSLディレクトリ
エントリ0〜n各々のデリートチェックバイトDCBの
全てのビットは、"有効"であることを示す論理値"0"と
なっている。すなわち、消去又は初期化後、データが何
も書き込まれていない状態の時に、"有効"となるのであ
る。
[0012] Each of the FSL directory entries 0 to n has a delete check byte DCB indicating whether or not this FSL directory entry is valid, a file type, and a valid FAT present at the foremost position in the FSL_FAT area. FT-S as a sector ID indicating a sector in which an entry (described later) is recorded
The ID is recorded. At the time of the initial logical format and after the data has been erased, all the bits of the delete check byte DCB of each of the FSL directory entries 0 to n have the logical value “0” indicating “valid”. ing. In other words, it becomes "valid" when no data is written after erasure or initialization.

【0013】一方、ディレクトリエントリ0〜kの各々
には、このディレクトリエントリが有効なものであるか
否かを示すデリートチェックバイトDCB、図2のファ
イル領域に書込まれたファイルに関するファイル情報
(ファイル名、ファイルサイズ、ファイルタイプ、記録
日時等)、並びに、このファイルが記録されているフラ
ッシュメモリ101上の先頭のセクタIDを示すFL−
SIDが記録される。尚、初期論理フォーマット時、及
びデータ消去後においては、ディレクトリエントリ0〜
k各々のデリートチェックバイトDCBの全てのビット
は、"有効"であることを示す論理値"0"になっている。
すなわち、初期化又はデータ消去された後、データが何
も書き込まれていない状態の時に"有効"となるのであ
る。
On the other hand, in each of the directory entries 0 to k, a delete check byte DCB indicating whether or not this directory entry is valid, file information (file information) on the file written in the file area of FIG. Name, file size, file type, recording date and time) and FL-
The SID is recorded. Incidentally, at the time of the initial logical format and after the data is erased, directory entries 0 to 0 are set.
All bits of each k of the delete check bytes DCB have a logical value "0" indicating "valid".
In other words, it becomes "valid" when no data has been written after initialization or data erasure.

【0014】又、ディレクトリ領域の先頭部には、この
領域内でのセクタの繋がり情報を示すnSIDが記録さ
れる。この際、全ての記録容量が1セクタ分を越える度
に、図4に示されるが如く、1セクタ分毎にその先頭部
にセクタ繋がり情報としてのnSIDを記録する。尚、
前述したFSLディレクトリエントリ及びディレクトリ
エントリ中のファイルタイプとは、ディレクトリエント
リが示すファイル、あるいはサブディレクトリの属性、
及びそのエントリがFSLディレクトリエントリである
かディレクトリエントリであるかを示す情報である。
At the head of the directory area, an nSID indicating the connection information of the sectors in this area is recorded. At this time, every time the entire recording capacity exceeds one sector, as shown in FIG. 4, an nSID as sector connection information is recorded at the head of each sector as shown in FIG. still,
The FSL directory entry and the file type in the directory entry are the attributes of the file or subdirectory indicated by the directory entry,
And information indicating whether the entry is an FSL directory entry or a directory entry.

【0015】例えば、ディレクトリエントリによって指
し示される先が書き込み禁止のサブディレクトリであれ
ば、その属性、及びこのエントリがディレクトリエント
リであることを示す情報がファイルタイプとして書き込
まれることになる。従って、図4の説明では、ディレク
トリ領域内を明確にFSLディレクトリエントリとディ
レクトリエントリとに区分けしたが、実際使用する場合
には、夫々のエントリの種類はエントリ内に記録される
フィルタイプよりその属性を知ることができる。すなわ
ち、FSLディレクトリエントリ、及びディレクトリエ
ントリ各々の領域を明確に区分けする必要はない。この
場合、ディレクトリ領域内でFSLディレクトリエント
リとディレクトリエントリとが明確に区分けされていな
くとも、各セクタの繋がり先は夫々のnSIDにより分
かる。
For example, if the destination pointed to by a directory entry is a write-protected subdirectory, its attributes and information indicating that this entry is a directory entry are written as a file type. Therefore, in the description of FIG. 4, the directory area is clearly divided into the FSL directory entry and the directory entry. However, when actually used, the type of each entry is more attributed than the fill type recorded in the entry. You can know. That is, the FSL directory entry and the area of each directory entry need not be clearly divided. In this case, even if the FSL directory entry and the directory entry are not clearly divided in the directory area, the connection destination of each sector can be known by each nSID.

【0016】図5は、図2に示されるFSL_FAT領
域の初期論理フォーマット時におけるメモリフォーマッ
トを示す図である。かかるFSL_FAT領域には、フ
ラッシュメモリ101に存在する自由領域(書込可能な
セクタの集合)中における各セクタIDを示すファット
ポインタFP、及びこのファットポインタFPによって
示されるセクタが空きセクタであるか否かを示すデリー
トチェックバイトDCBからなるFATエントリが形成
される。かかるFATエントリは、このフラッシュメモ
リ101における自由領域中の全てのセクタに対応して
設けられる。この際、上記デリートチェックバイトDC
Bの全てのビットが、空きセクタであることを示す論理
値"0"である場合、このFATエントリは"有効"なFA
Tエントリであるとする。又、かかるFSL_FAT領
域の先頭部には、この領域内でのセクタの繋がり情報を
示すnSIDが記録される。尚、全てのFATエントリ
の容量が1セクタ分の容量を越える場合には、図5に示
されるが如く、1セクタ分毎にその先頭部にセクタ繋が
り情報としてのnSIDを記録する。かかるnSIDに
は、このセクタの次に繋がるセクタのSIDが示されて
いる。
FIG. 5 is a diagram showing a memory format in the initial logical format of the FSL_FAT area shown in FIG. In the FSL_FAT area, a fat pointer FP indicating each sector ID in a free area (a set of writable sectors) existing in the flash memory 101, and whether or not the sector indicated by the fat pointer FP is an empty sector A FAT entry consisting of a delete check byte DCB is formed. Such FAT entries are provided corresponding to all sectors in the free area of the flash memory 101. At this time, the above-mentioned delete check byte DC
If all the bits of B are logical values “0” indicating that the sector is a free sector, this FAT entry is a “valid” FA
Let it be a T entry. Also, at the head of the FSL_FAT area, an nSID indicating connection information of sectors in this area is recorded. When the capacity of all FAT entries exceeds the capacity of one sector, as shown in FIG. 5, an nSID as sector connection information is recorded at the head of each sector as shown in FIG. The nSID indicates the SID of the sector connected to the next sector.

【0017】尚、上述した如き各領域(ディレクトリ領
域、FSL_FAT領域、ファイル領域)は連続して配
列されていなくても、各セクタのnSIDによって次に
繋がるべきセクタを知ることが出来る。つまり、論理的
には連続した領域として扱うことが出来るのである。上
記の如きフラッシュメモリ101のファイル領域には、
各種アプリケーションプログラム、及び情報ファイル等
が記憶される。更に、フラッシュメモリ101のファイ
ル領域には、予め、本発明によるメモリの制御方法が適
用されたオペレーティングシステム(以下、OSと称す
る)プログラムが記憶されている。
Even if the above-mentioned areas (directory area, FSL_FAT area, file area) are not arranged continuously, the sector to be connected next can be known from the nSID of each sector. That is, it can be treated as a logically continuous area. In the file area of the flash memory 101 as described above,
Various application programs and information files are stored. Further, in the file area of the flash memory 101, an operating system (hereinafter, referred to as OS) program to which the memory control method according to the present invention is applied is stored in advance.

【0018】電源投入に応じて上記OSプログラムは、
かかるフラッシュメモリ101から読み出されてRAM
(ランダムアクセスメモリ)12の所定領域に書き込ま
れる。使用者が上記アプリケーションプログラムのいず
れか1つの実行を行うべく操作装置13の操作を行う
と、このプログラムがフラッシュメモリ101から読み
出されて上記RAM12に読み込まれる。CPU(中央
処理装置)11は、RAM12上に読み込まれた上記ア
プリケーションプログラムを実行して、その実行結果を
ディスプレイ14上に表示せしめる。
When the power is turned on, the OS program is
RAM read from such flash memory 101
(Random access memory) 12 is written in a predetermined area. When the user operates the operation device 13 to execute any one of the application programs, the program is read from the flash memory 101 and read into the RAM 12. The CPU (Central Processing Unit) 11 executes the application program read on the RAM 12 and displays the execution result on the display 14.

【0019】この際、かかるアプリケーションソフトの
実行により、記憶装置10に対するファイルの書込、及
び消去等のアクセスが発生すると、メモリコントローラ
102は、フラッシュメモリ101に対して上記OSに
従った制御処理を実行する。以下に、かかるOSプログ
ラムの実行により為される新規ファイルの書込、消去、
及び更新の各動作についてを、図6に示されるが如き初
期論理フォーマットを有するフラッシュメモリ101を
例にとって説明する。
At this time, when an access such as writing or erasing of a file to the storage device 10 occurs due to execution of the application software, the memory controller 102 controls the flash memory 101 to perform control processing according to the OS. Run. The following describes writing, erasing, and writing of a new file performed by executing the OS program.
Each operation of updating and updating will be described by taking a flash memory 101 having an initial logical format as shown in FIG. 6 as an example.

【0020】尚、図6に示されるファイル領域は、全容
量が20Kバイトであり、各々2Kバイトの容量を有す
る10個のセクタから構成されている。この際、各セク
タは、セクタID:Q〜(Q+9)にて示される。又、
FATエントリ0〜9各々のファットポインタFPに
は、上記ファイル領域中のセクタ各々に対応したセクタ
ID:Q〜(Q+9)が記録される。又、FATエント
リ0〜9各々のデリートチェックバイトDCBは、この
ファットポインタFPによって示されるセクタが空きセ
クタ、すなわち書込有効なセクタであることを示す論理
値"0"となっている。この際、FATエントリ0〜5
は、セクタID:Rにて示されるセクタ内に記録され、
FATエントリ6〜9は、セクタID:(R+1)にて
示されるセクタ内に記録されるものとする。
The file area shown in FIG. 6 has a total capacity of 20 Kbytes and is composed of ten sectors each having a capacity of 2 Kbytes. At this time, each sector is indicated by sector IDs: Q to (Q + 9). or,
In the fat pointer FP of each of the FAT entries 0 to 9, sector IDs: Q to (Q + 9) corresponding to the sectors in the file area are recorded. The delete check byte DCB of each of the FAT entries 0 to 9 has a logical value "0" indicating that the sector indicated by the fat pointer FP is a free sector, that is, a write-enabled sector. At this time, FAT entries 0 to 5
Is recorded in the sector indicated by the sector ID: R,
The FAT entries 6 to 9 are recorded in the sector indicated by the sector ID: (R + 1).

【0021】従って、FSLディレクトリエントリ0の
FT−SIDとして、FATエントリ0が存在するセク
タのセクタID:Rが記録される。かかるFSLディレ
クトリエントリ0のデリートチェックバイトDCBは、
このFSLディレクトリエントリ0が有効であることを
示す論理値"0"となっている。以下に、かかる図6に示
されるが如き状態から、各々が4Kバイトの容量を有す
る5つの新規ファイルA〜Eを順次書込み、この書き込
んだファイルをファイルC、E、Aの順に消去した後、
新たに6Kバイトの容量を有するファイルFを書き込む
までの動作例を、図7〜図13を参照しつつ説明する。
Accordingly, the sector ID: R of the sector in which the FAT entry 0 exists is recorded as the FT-SID of the FSL directory entry 0. The delete check byte DCB of the FSL directory entry 0 is:
The logical value "0" indicates that the FSL directory entry 0 is valid. Hereinafter, from the state as shown in FIG. 6, five new files A to E each having a capacity of 4 Kbytes are sequentially written, and after erasing the written files in the order of files C, E, and A,
An operation example until a file F having a new capacity of 6 Kbytes is written will be described with reference to FIGS.

【0022】ファイルA〜Eの書込 図6に示されるが如き状態において、先ず、メモリコン
トローラ102は、図3に示されるフック領域中のD−
SIDを読出す。メモリコントローラ102は、この読
み出したD−SIDの内容によってディレクトリ領域の
先頭セクタIDを認識し、このセクタ内において最も先
頭位置に存在する有効(DCBの論理値が"0")なFS
Lディレクトリエントリを検索する。この際、図6に示
されるが如く、最も先頭位置に存在する有効なFSLデ
ィレクトリエントリは、FSLディレクトリエントリ0
である。メモリコントローラ102は、このFSLディ
レクトリエントリ0のFT−SIDとして記録されてい
るセクタID:Rにて示されるセクタ内において、最も
先頭位置に存在する有効なFATエントリ(DCBの論
理値が"0"であるFATエントリ)を検索する。この
際、かかるセクタID:Rにて示されるセクタ内におい
て最も先頭位置に存在する有効なFATエントリは、図
6に示されるが如く、FATエントリ0である。ここ
で、メモリコントローラ102は、このFATエントリ
0のファットポインタFPとして記録されているセクタ
ID:Qにて示されるセクタに、図7に示されるが如
く、ファイルAを書き込んで行く。この際、ファイルA
の容量は4Kバイトあり、1セクタ分の容量(2Kバイ
ト)よりも大である。そこで、メモリコントローラ10
2は、上記FATエントリ0の次に存在する有効なFA
Tエントリを検索する。この際、検索されるFATエン
トリは、図6に示されるが如く、FATエントリ1であ
る。ここで、メモリコントローラ102は、このFAT
エントリ1のファットポインタFPとして記録されてい
るセクタID:(Q+1)にて示されるセクタに、図7
に示されるように上記ファイルAの続きを書き込んで行
くのである。
Writing of files A to E In the state shown in FIG. 6, first, the memory controller 102 stores the D- file in the hook area shown in FIG.
Read the SID. The memory controller 102 recognizes the leading sector ID of the directory area based on the contents of the read D-SID, and identifies the valid (the logical value of the DCB is "0") FS in the leading position in this sector.
Search for L directory entry. At this time, as shown in FIG. 6, the valid FSL directory entry existing at the top position is FSL directory entry 0.
It is. In the sector indicated by the sector ID: R recorded as the FT-SID of the FSL directory entry 0, the memory controller 102 determines the valid FAT entry (the logical value of the DCB of which is "0") at the foremost position. FAT entry). At this time, the valid FAT entry existing at the foremost position in the sector indicated by the sector ID: R is the FAT entry 0 as shown in FIG. Here, as shown in FIG. 7, the memory controller 102 writes the file A to the sector indicated by the sector ID: Q recorded as the fat pointer FP of the FAT entry 0. At this time, file A
Has a capacity of 4 Kbytes, which is larger than the capacity of one sector (2 Kbytes). Therefore, the memory controller 10
2 is a valid FA existing next to the FAT entry 0
Search for a T entry. At this time, the searched FAT entry is the FAT entry 1 as shown in FIG. Here, the memory controller 102
In the sector indicated by the sector ID: (Q + 1) recorded as the fat pointer FP of the entry 1, FIG.
Then, the continuation of the file A is written as shown in FIG.

【0023】図14は、かかるファイルAの書込時のフ
ォーマットを示す図である。図14に示されるが如く、
セクタID:Qにて示されるセクタには、ファイルAの
前半部が書込まれると共に、その先頭位置には、次のセ
クタの繋がり情報を示すnSIDとして(Q+1)が記
録される。この(Q+1)にて示されるセクタには、フ
ァイルAの後半部分が書込まれる。その先頭位置の次の
セクタの繋がり情報を示すnSIDには何も書き込まず
に"0"のままにしておく。これは、次のセクタへの繋が
りが存在しないことを示すものである。
FIG. 14 is a diagram showing a format at the time of writing the file A. As shown in FIG.
In the sector indicated by the sector ID: Q, the first half of the file A is written, and (Q + 1) is recorded at the head position as nSID indicating the connection information of the next sector. The latter half of the file A is written in the sector indicated by (Q + 1). Nothing is written in the nSID indicating the connection information of the next sector at the head position, and the value is left as “0”. This indicates that there is no connection to the next sector.

【0024】又、ファイルAへの新たな追記は、ファイ
ルAの最後のセクタのnSIDに新たに追加されたセク
タIDを書き込むことにより可能となる。次に、メモリ
コントローラ102は、上記FATエントリ0及び1の
DCBの論理値を、図7に示されるが如く"1"に書き換
えることにより、セクタID:Q及び(Q+1)にて示
されるセクタ各々が書込無効となったことを示す。次
に、メモリコントローラ102は、上記ディレクトリ領
域中において書き込みの為されていないディレクトリエ
ントリの先頭を検索する。この際、上述の如き初期状態
において書き込みの為されていない先頭のディレクトリ
エントリとは、図7に示されるように、ディレクトリエ
ントリ0である。ここで、メモリコントローラ102
は、かかるディレクトリエントリ0に、上記ファイルA
に関するファイル情報(ファイル名、ファイルサイズ、
ファイルタイプ、記録日時等)、並びに、このファイル
Aが書込まれているフラッシュメモリ101上の先頭の
セクタID:Qを記録する。
Further, new appending to the file A can be performed by writing a newly added sector ID to the nSID of the last sector of the file A. Next, the memory controller 102 rewrites the logical values of the DCBs of the FAT entries 0 and 1 to “1” as shown in FIG. 7 so that the sectors indicated by the sector IDs: Q and (Q + 1) Indicates that writing has become invalid. Next, the memory controller 102 searches the directory area for the head of a directory entry that has not been written. At this time, the first directory entry which has not been written in the initial state as described above is the directory entry 0 as shown in FIG. Here, the memory controller 102
Stores the file A in the directory entry 0
File information (file name, file size,
File type, recording date and time), and the first sector ID: Q on the flash memory 101 in which the file A is written.

【0025】以上の如き一連の動作により、メモリコン
トローラ102は、ファイルAの書込動作を完了する。
かかるファイルAの書込動作と同様な方法によって、メ
モリコントローラ102は、ファイルB、ファイルCの
書込を順次行う。図8は、これらファイルA、B、及び
C各々の書込が完了した際のフラッシュメモリ101の
状態を示す図である。
Through a series of operations as described above, the memory controller 102 completes the operation of writing the file A.
The memory controller 102 sequentially writes the file B and the file C by a method similar to the writing operation of the file A. FIG. 8 is a diagram showing a state of the flash memory 101 when writing of each of the files A, B, and C is completed.

【0026】図8に示されるが如く、セクタID:Q〜
(Q+5)によって示されるセクタ各々が、ファイルA
〜Cの書込により使用される。従って、これらセクタI
D:Q〜(Q+5)を示すFATエントリ0〜5各々の
デリートチェックバイトDCBの論理値が全て"1"とな
る。よって、図8に示されるが如く、セクタID:Rに
示されるセクタ内には、有効なFATエントリが存在し
ないことになる。この際、FSL_FAT領域中の最も
先頭位置に存在し、かつ有効なFATエントリは、図8
に示されるが如くFATエントリ6であり、このFAT
エントリ6が記録されるセクタのセクタIDは(R+
1)である。そこで、メモリコントローラ102は、F
SLディレクトリエントリ中において、未記録であり、
かつ最も先頭に存在するFSLディレクトリエントリを
検索する。図8に示されるように、FSLディレクトリ
エントリ中において未記録、かつ最先頭に存在するFS
Lディレクトリエントリは、FSLディレクトリエント
リ1であるので、メモリコントローラ102は、このF
SLディレクトリエントリ1のFT−SIDとして上記
(R+1)を記録する。
As shown in FIG. 8, sector IDs: Q to
Each sector indicated by (Q + 5) is a file A
To C are used. Therefore, these sectors I
D: All the logical values of the delete check byte DCB of each of the FAT entries 0 to 5 indicating Q to (Q + 5) become “1”. Therefore, as shown in FIG. 8, no valid FAT entry exists in the sector indicated by the sector ID: R. At this time, the FAT entry existing at the foremost position in the FSL_FAT area and valid is shown in FIG.
Is the FAT entry 6 as shown in FIG.
The sector ID of the sector in which entry 6 is recorded is (R +
1). Therefore, the memory controller 102
Unrecorded in the SL directory entry,
Further, the FSL directory entry existing at the top is searched. As shown in FIG. 8, the FS which is not recorded in the FSL directory entry and which is present at the top
Since the L directory entry is the FSL directory entry 1, the memory controller 102
The above (R + 1) is recorded as the FT-SID of the SL directory entry 1.

【0027】更に、今まで"有効"であったディレクトリ
エントリ0を"無効"にすべく、そのDCBを"1"にす
る。かかる図8に示される状態において、次なる新規フ
ァイルとしてのファイルDの書込を行うにあたり、先
ず、メモリコントローラ102は、図3に示されるフッ
ク領域中のD−SIDを読出す。メモリコントローラ1
02は、この読み出したD−SIDの内容によってディ
レクトリ領域の先頭セクタIDを認識し、このセクタ内
において最も先頭位置に存在する有効(DCBの論理値
が"0")なFSLディレクトリエントリを検索する。こ
の際、図8に示されるが如く、最も先頭位置に存在する
有効なFSLディレクトリエントリは、FSLディレク
トリエントリ1である。メモリコントローラ102は、
このFSLディレクトリエントリ1のFT−SIDとし
て記録されているセクタID:(R+1)、にて示され
るセクタ内において、最も先頭位置に存在する有効(D
CBの論理値が"0")なFATエントリを検索する。こ
の際、かかるセクタID:(R+1)にて示されるセク
タ内において最も先頭位置に存在する有効なFATエン
トリは、図8に示されるが如く、FATエントリ6であ
る。ここで、メモリコントローラ102は、このFAT
エントリ6のファットポインタFPとして記録されてい
るセクタID:(Q+6)にて示されるセクタに、図9
に示されるが如く、ファイルDを書き込んで行く。この
際、ファイルDの容量は4Kバイトあり、1セクタ分の
容量(2Kバイト)よりも大である。そこで、メモリコ
ントローラ102は、上記FATエントリ6の次に存在
する有効なFATエントリを検索する。この際、検索さ
れるFATエントリは、図8に示されるが如く、FAT
エントリ7である。ここで、メモリコントローラ102
は、このFATエントリ7のファットポインタFPとし
て記録されているセクタID:(Q+7)にて示される
セクタに、図9に示されるが如く上記ファイルDの続き
を書き込んで行くのである。
Further, the DCB is set to "1" in order to make the directory entry 0 which has been "valid" up to now "invalid". In writing the file D as the next new file in the state shown in FIG. 8, first, the memory controller 102 reads out the D-SID in the hook area shown in FIG. Memory controller 1
No. 02 recognizes the first sector ID of the directory area based on the contents of the read D-SID, and searches for a valid (DCB logical value “0”) FSL directory entry at the first position in this sector. . At this time, as shown in FIG. 8, the valid FSL directory entry existing at the head position is the FSL directory entry 1. The memory controller 102
In the sector indicated by the sector ID: (R + 1) recorded as the FT-SID of the FSL directory entry 1, the valid (D
The FAT entry whose logical value of CB is “0”) is searched. At this time, the valid FAT entry existing at the foremost position in the sector indicated by the sector ID: (R + 1) is the FAT entry 6 as shown in FIG. Here, the memory controller 102
In the sector indicated by the sector ID: (Q + 6) recorded as the fat pointer FP of the entry 6, FIG.
The file D is written as shown in FIG. At this time, the capacity of the file D is 4 Kbytes, which is larger than the capacity of one sector (2 Kbytes). Therefore, the memory controller 102 searches for a valid FAT entry existing next to the FAT entry 6. At this time, the FAT entry to be searched is, as shown in FIG.
Entry 7 Here, the memory controller 102
Writes the continuation of the file D into the sector indicated by the sector ID (Q + 7) recorded as the fat pointer FP of the FAT entry 7 as shown in FIG.

【0028】次に、メモリコントローラ102は、上記
FATエントリ6及び7のDCBの論理値を、図9に示
されるが如く"1"に書き換えることにより、セクタI
D:(Q+6)及び(Q+7)にて示されるセクタ各々
が書込無効になったことを示す。次に、メモリコントロ
ーラ102は、上記ディレクトリ領域中において書き込
みの為されていないディレクトリエントリの先頭を検索
する。この際、図8に示されるが如き状態において書き
込みの為されていない先頭のディレクトリエントリと
は、ディレクトリエントリ3である。ここで、メモリコ
ントローラ102は、図9に示されるが如く、かかるデ
ィレクトリエントリ3に、上記ファイルDに関するファ
イル情報(ファイル名、ファイルサイズ、ファイルタイ
プ、記録日時等)、並びに、このファイルDが書込まれ
ているフラッシュメモリ101上の先頭のセクタID:
(Q+6)を記録する。
Next, the memory controller 102 rewrites the logical value of the DCB of the FAT entries 6 and 7 to "1" as shown in FIG.
D: Indicates that writing to each of the sectors indicated by (Q + 6) and (Q + 7) has become invalid. Next, the memory controller 102 searches the directory area for the head of a directory entry that has not been written. At this time, the first directory entry that has not been written in the state as shown in FIG. 8 is the directory entry 3. Here, as shown in FIG. 9, the memory controller 102 writes the file information (file name, file size, file type, recording date, etc.) regarding the file D and the file D in the directory entry 3. ID of the first sector on the flash memory 101 that has been inserted:
Record (Q + 6).

【0029】以上の如き一連の動作により、メモリコン
トローラ102は、ファイルDの書込動作を完了する。
同様な方法によって、メモリコントローラ102は、フ
ァイルEの書込を行う。図10は、上記ファイルA、
B、C、D及びE各々の書込が完了した際のフラッシュ
メモリ101の状態を示す図である。
Through a series of operations as described above, the memory controller 102 completes the operation of writing the file D.
In a similar manner, the memory controller 102 writes the file E. FIG. 10 shows the file A,
FIG. 9 is a diagram showing a state of the flash memory 101 when writing of each of B, C, D, and E is completed.

【0030】ファイルC、E、Aの削除 かかる図10に示される状態においてファイルCの消去
を行うにあたり、メモリコントローラ102は、先ず、
ディレクトリエントリ中からファイル名としてファイル
Cが記録されているディレクトリエントリの検索を行
う。この際、かかるディレクトリエントリは、図10に
示されるが如く、ディレクトリエントリ2である。ここ
で、メモリコントローラ102は、かかるディレクトリ
エントリ2のFL−SIDとして記録されているセクタ
ID:(Q+4)、及びこのセクタのnSIDに記録さ
れている次に繋がるべきセクタID:(Q+5)に示さ
れるセクタ各々の書込内容を消去する。かかる動作によ
り、ファイル領域中に書込まれていたファイルCは、図
11に示されるが如く消去される。
In deleting the files C in the state shown in FIG. 10, the memory controller 102 firstly deletes the files C, E, and A.
A search is made for a directory entry in which the file C is recorded as a file name from the directory entry. At this time, the directory entry is the directory entry 2 as shown in FIG. Here, the memory controller 102 indicates the sector ID: (Q + 4) recorded as the FL-SID of the directory entry 2 and the sector ID to be connected next (Q + 5) recorded in the nSID of this sector. Erase the written contents of each sector to be written. By such an operation, the file C written in the file area is erased as shown in FIG.

【0031】次に、メモリコントローラ102は、上記
ディレクトリエントリ2のDCBの論理値を、図11に
示されるように、"1"に書き換える。これにより、上記
ディレクトリエントリ2の記録内容が無効となる。次
に、メモリコントローラ102は、上記FSL_FAT
領域中において書き込み済みのFATエントリの最後尾
を検索する。図10に示されるが如き状態において書き
込み済みのFATエントリの最後尾は、FATエントリ
9である。ここで、メモリコントローラ102は、かか
るFATエントリ9の次のFATエントリ10及び11
各々のファットポインタFPとして、図11に示される
が如く、(Q+4)及び(Q+5)を夫々記録する。す
なわち、ファイルCの消去により、ファイル領域(Q+
4)及び(Q+5)が新たに自由領域となったので、こ
れらを示す有効なFATポインタとしてFATエントリ
に(Q+4)及び(Q+5)が作成された。ここでは、
メモリコントローラ102は、これらFATエントリ1
0及び11各々のDCBには何も書き込まない。
Next, the memory controller 102 rewrites the logical value of the DCB of the directory entry 2 to "1" as shown in FIG. As a result, the recorded contents of the directory entry 2 become invalid. Next, the memory controller 102 sets the FSL_FAT
The end of the written FAT entry is searched in the area. In the state as shown in FIG. 10, the last of the written FAT entry is the FAT entry 9. Here, the memory controller 102 checks the FAT entries 10 and 11 next to the FAT entry 9.
As shown in FIG. 11, (Q + 4) and (Q + 5) are recorded as each fat pointer FP. That is, by deleting the file C, the file area (Q +
Since (4) and (Q + 5) are new free areas, (Q + 4) and (Q + 5) are created in the FAT entry as valid FAT pointers indicating these. here,
The memory controller 102 reads these FAT entries 1
Nothing is written to the DCB of each of 0 and 11.

【0032】以上の如き一連の動作により、メモリコン
トローラ102は、ファイルCの消去動作を完了する。
同様な方法によって、メモリコントローラ102は、フ
ァイルE及びAの消去を行う。図12は、これらファイ
ルA、C、及びEをC、E、Aの順番で消去が完了した
際のフラッシュメモリ101の状態を示す図である。
Through a series of operations as described above, the memory controller 102 completes the operation of erasing the file C.
In a similar manner, the memory controller 102 erases the files E and A. FIG. 12 is a diagram showing a state of the flash memory 101 when the erasure of these files A, C, and E is completed in the order of C, E, and A.

【0033】ファイルF(6Kバイト)の書込 かかる図12に示される状態において、新規ファイルと
して、その容量が6KバイトのファイルFの書込を行う
にあたり、先ず、メモリコントローラ102は、フック
領域中のD−SIDを読出す。メモリコントローラ10
2は、この読み出したD−SIDの内容によってディレ
クトリ領域の先頭セクタIDを認識し、このセクタ内に
おいて最も先頭位置に存在する有効(DCBの論理値
が"0")なFSLディレクトリエントリを検索する。こ
の際、図12に示されるが如く、最も先頭位置に存在す
る有効なFSLディレクトリエントリは、FSLディレ
クトリエントリ1である。メモリコントローラ102
は、このFSLディレクトリエントリ1のFT−SID
として記録されているセクタID:(R+1)にて示さ
れるセクタ内において、最も先頭位置に存在する有効
(DCBの論理値が"0")なFATエントリを検索す
る。この際、かかるセクタID:(R+1)にて示され
るセクタ内において、最も先頭位置に存在する有効なF
ATエントリは、図12に示されるが如く、FATエン
トリ10である。ここで、メモリコントローラ102
は、このFATエントリ10のファットポインタFPと
して記録されているセクタID:(Q+4)にて示され
るセクタに、図13に示されるが如く、ファイルFを書
き込んで行く。この際、ファイルFの容量は6Kバイト
あり、1セクタ分の容量(2Kバイト)よりも大であ
る。そこで、メモリコントローラ102は、上記FAT
エントリ10の次に存在する有効なFATエントリを検
索する。この際、検索されるFATエントリは、図12
に示されるが如く、FATエントリ11である。ここ
で、メモリコントローラ102は、このFATエントリ
11のファットポインタFPとして記録されているセク
タID:(Q+5)にて示されるセクタに、図13に示
されるが如く上記ファイルFの続きを書き込んで行く。
更に、ファイルFの残り分(2Kバイト)を書き込むべ
く、メモリコントローラ102は、上記FATエントリ
11の次に存在する有効なFATエントリの検索を実施
する。この際、検索されるFATエントリは、図12に
示されるが如く、FATエントリ12である。ここで、
メモリコントローラ102は、このFATエントリ12
のファットポインタFPとして記録されているセクタI
D:(Q+8)にて示されるセクタに、図13に示され
るが如く上記ファイルFの残り分(2Kバイト)を書込
む。
In writing the file F (6 Kbytes) in the state shown in FIG. 12, when writing the file F having a capacity of 6 Kbytes as a new file, first, the memory controller 102 Is read out. Memory controller 10
2 recognizes the head sector ID of the directory area based on the contents of the read D-SID, and searches for the valid (DCB logical value "0") FSL directory entry at the head position in this sector. . At this time, as shown in FIG. 12, the valid FSL directory entry existing at the foremost position is the FSL directory entry 1. Memory controller 102
Is the FT-SID of this FSL directory entry 1.
In the sector indicated by Sector ID: (R + 1) recorded as (1), a valid (at the DCB logical value “0”) FAT entry existing at the head position is searched. At this time, in the sector indicated by the sector ID: (R + 1), the valid F
The AT entry is a FAT entry 10 as shown in FIG. Here, the memory controller 102
Writes the file F into the sector indicated by the sector ID: (Q + 4) recorded as the fat pointer FP of the FAT entry 10 as shown in FIG. At this time, the capacity of the file F is 6 Kbytes, which is larger than the capacity of one sector (2 Kbytes). Therefore, the memory controller 102
A valid FAT entry existing after the entry 10 is searched. At this time, the searched FAT entry is as shown in FIG.
The FAT entry 11 is as shown in FIG. Here, the memory controller 102 writes the continuation of the file F into the sector indicated by the sector ID: (Q + 5) recorded as the fat pointer FP of the FAT entry 11 as shown in FIG. .
Further, in order to write the remaining portion (2 Kbytes) of the file F, the memory controller 102 searches for a valid FAT entry existing next to the FAT entry 11. At this time, the FAT entry searched for is the FAT entry 12, as shown in FIG. here,
The memory controller 102 stores the FAT entry 12
Sector I recorded as fat pointer FP of
D: The remaining portion (2 Kbytes) of the file F is written in the sector indicated by (Q + 8) as shown in FIG.

【0034】図15は、かかるファイルFの書込時のフ
ォーマットを示す図である。図15に示されるが如く、
セクタID:(Q+4)にて示されるセクタには、ファ
イルFの一部が書込まれると共に、その先頭位置には、
次のセクタの繋がり情報を示すnSIDとして(Q+
5)が記録される。この(Q+5)にて示されるセクタ
には、上記ファイルFの続き部分が書込まれると共に、
その先頭位置には、次のセクタの繋がり情報を示すnS
IDとして(Q+8)が記録される。この(Q+8)に
て示されるセクタには、上記ファイルFの最終部分が書
込まれる。又、その先頭位置のセクタの繋がり情報を示
すnSIDには何も書き込まないので、"0"のままであ
る。これは、ファイルFとして次のセクタへの繋がりが
存在しないことを示すものである。
FIG. 15 is a diagram showing a format at the time of writing the file F. As shown in FIG.
In the sector indicated by the sector ID: (Q + 4), a part of the file F is written, and the head position thereof is
As the nSID indicating the connection information of the next sector, (Q +
5) is recorded. In the sector indicated by (Q + 5), the continuation of the file F is written,
At the head position, nS indicating connection information of the next sector is displayed.
(Q + 8) is recorded as the ID. The last part of the file F is written in the sector indicated by (Q + 8). Also, nothing is written to the nSID indicating the connection information of the sector at the head position, so that it remains "0". This indicates that there is no connection to the next sector as the file F.

【0035】次に、メモリコントローラ102は、上記
ファイルFに関するFATエントリ10、11及び12
各々のDCBの論理値を図13に示されるが如く"1"に
書き換えて、セクタID:(Q+4)、(Q+5)及び
(Q+8)にて示されるセクタ各々が書込無効になった
ことを示す。次に、メモリコントローラ102は、上記
ディレクトリ領域中において書き込みの為されていない
ディレクトリエントリの先頭を検索する。この際、図1
2に示されるが如き状態において書き込みの為されてい
ない先頭のディレクトリエントリとは、ディレクトリエ
ントリ5である。ここで、メモリコントローラ102
は、図13に示されるが如く、かかるディレクトリエン
トリ5に、上記ファイルFに関するファイル情報(ファ
イル名、ファイルサイズ、記録日時等)、及びこのファ
イルFが書込まれているフラッシュメモリ101上の先
頭のセクタID:(Q+4)を記録する。
Next, the memory controller 102 transmits the FAT entries 10, 11 and 12 relating to the file F.
The logical value of each DCB is rewritten to "1" as shown in FIG. 13 to indicate that each sector indicated by sector IDs: (Q + 4), (Q + 5) and (Q + 8) has become write-ineffective. Show. Next, the memory controller 102 searches the directory area for the head of a directory entry that has not been written. At this time, FIG.
The first directory entry that has not been written in the state as shown in FIG. 2 is the directory entry 5. Here, the memory controller 102
As shown in FIG. 13, file information (file name, file size, recording date and time, etc.) relating to the file F and the top of the flash memory 101 where the file F is written are stored in the directory entry 5 as shown in FIG. Sector ID: (Q + 4) is recorded.

【0036】ここで、図13に示されるが如く、セクタ
ID:R及び(R+1)各々によって示されるセクタ内
には、有効なFATエントリが存在していない。この
際、FSL_FAT領域中において有効なFATエント
リの先頭は、セクタID:(R+2)なるセクタ内に存
在するFATエントリ13である。そこで、メモリコン
トローラ102は、FSLディレクトリエントリ中にお
いて、未記録であり、かつ最も先頭に存在するFSLデ
ィレクトリエントリを検索する。図13に示されるよう
に、FSLディレクトリエントリ中において未記録、か
つ最先頭に存在するFSLディレクトリエントリは、F
SLディレクトリエントリ2である。よって、メモリコ
ントローラ102は、このFSLディレクトリエントリ
2のFT−SIDとして上記(R+2)を記録する。
Here, as shown in FIG. 13, there is no valid FAT entry in the sector indicated by each of the sector IDs: R and (R + 1). At this time, the head of the valid FAT entry in the FSL_FAT area is the FAT entry 13 existing in the sector having the sector ID: (R + 2). Therefore, the memory controller 102 searches the FSL directory entry for an unrecorded and foremost FSL directory entry. As shown in FIG. 13, the FSL directory entry which has not been recorded and is present at the forefront in the FSL directory entry is the FSL directory entry.
SL directory entry 2. Therefore, the memory controller 102 records the above (R + 2) as the FT-SID of the FSL directory entry 2.

【0037】以上の如く、本発明によるメモリの制御方
法においては、図6に示されるように、ファイル領域中
の空きセクタ(書込可能なセクタ)を線形リスト構造と
捉え、その線形リストのポインタ(ファットポインタF
P)をFSL_FAT領域に記録する。ここで、ファイ
ルの書込みの際には、図7〜図10、及び図13に示さ
れるように、上記FSL_FAT領域の先頭位置から順
に空きセクタを検索して行き、この検索したセクタから
順次ファイルの書込みを行う。その後、このファイルが
書き込まれたセクタを示すFATエントリ中のデリート
チェックバイトDCBを、論理値"1"、すなわち、空き
セクタではないことを示すデリートチェックバイトに書
き換える。又、ファイル削除時には、図11及び図12
に示されるが如く、削除対象となったファイルを削除す
ると共に、このファイル削除によって空きセクタとなっ
たセクタに関するFATエントリを新たに作成し、これ
をFSL_FAT領域の最後尾に追記して行く。
As described above, in the memory control method according to the present invention, as shown in FIG. 6, an empty sector (writable sector) in a file area is regarded as a linear list structure, and a pointer of the linear list is used. (Fat pointer F
P) is recorded in the FSL_FAT area. Here, at the time of writing a file, as shown in FIGS. 7 to 10 and 13, empty sectors are sequentially searched from the head position of the FSL_FAT area. Write. After that, the delete check byte DCB in the FAT entry indicating the sector in which this file has been written is rewritten to a logical value "1", that is, a delete check byte indicating that the sector is not an empty sector. 11 and 12 when deleting a file.
As shown in (1), the file to be deleted is deleted, and a new FAT entry for a sector which has become a free sector due to this file deletion is newly created and added to the end of the FSL_FAT area.

【0038】以上のようにメモリ管理を行えば、データ
を書き込むべく自由領域を確保する際に、時系列的に見
て最も長く自由領域として残っているセクタから使用す
ることになる。かかる制御方法によれば、ファイルの更
新時において、特定のセクタだけが頻繁に使用されるこ
とが防止されるので、フラッシュメモリの寿命を延ばす
ことが可能となるのである。
When the memory management is performed as described above, when securing a free area for writing data, a sector that is left as the longest free area in time series is used. According to such a control method, when a file is updated, only a specific sector is prevented from being frequently used, so that the life of the flash memory can be extended.

【0039】又、本発明によるメモリの制御方法におい
ては、図3〜図5、図14及び図15に示されるよう
に、フラッシュメモリ内の各セクタ間の繋がりを示す情
報(nSID)をセクタ各々の先頭位置に記録するよう
にしている。よって、ファイルの削除時には、セクタの
消去を行えばこのセクタ間の繋がりを示す情報も同時に
消去されるので、各セクタの繋がり情報を一カ所に配し
た従来のメモリ管理方法に比して、特定のセクタに書き
換えが集中することを避けることが出来るのである。
In the memory control method according to the present invention, as shown in FIGS. 3 to 5, 14 and 15, information (nSID) indicating the connection between the sectors in the flash memory is used for each sector. Is recorded at the head position. Therefore, when a file is deleted, if the sector is erased, the information indicating the connection between the sectors is also erased at the same time. It is possible to prevent rewriting from being concentrated on the sector.

【0040】尚、前述した如きファイルの書込及び消去
操作等により、ディレクトリ領域の先頭セクタ内におけ
る全てのディレクトリエントリが無効を示す状態となっ
た場合、あるいは、このディレクトリ領域中の追記領域
が所定容量よりも少なくなった場合、メモリコントロー
ラ102は、フラッシュメモリ101に対してディレク
トリ領域の最適化を行う。
When all directory entries in the first sector of the directory area are invalidated by the above-described file writing and erasing operations, or the like, or the additional write area in this directory area becomes a predetermined area. When the capacity is smaller than the capacity, the memory controller 102 optimizes the directory area for the flash memory 101.

【0041】ディレクトリ領域の最適化 以下に、かかるメモリコントローラ102によるディレ
クトリ領域の最適化動作について、図13及び図16を
参照しつつ説明する。この際、図16(a)は、ディレク
トリ領域の最適化前の記録状態、図16(b)は、最適化
後の記録状態の一例を夫々示すものである。又、図16
(a)に示される一例においては、最適化前のディレクト
リ領域はセクタID:Y〜(Y+2)にて示される3つ
のセクタから構成されているものとする。
The optimization of the directory area by the memory controller 102 will be described below with reference to FIGS. 13 and 16. At this time, FIG. 16A shows an example of a recording state before optimization of a directory area, and FIG. 16B shows an example of a recording state after optimization. FIG.
In the example shown in (a), it is assumed that the directory area before optimization is composed of three sectors indicated by sector IDs: Y to (Y + 2).

【0042】ここで、かかる図16(a)の状態に対して
最適化を実施するにあたり、メモリコントローラ102
は、先ず、フラッシュメモリ101の自由領域中から空
きセクタを検索し、この空きセクタをディレクトリ領域
としての最後尾セクタに追加する。例えば、図13の状
態においては、メモリコントローラ102は、FATエ
ントリを順に参照することにより、セクタID:(Q+
9)にて示されるセクタが空きセクタであると判定し、
このセクタをディレクトリ領域の最後尾セクタとして追
加する。すなわち、最適化前の状態においてディレクト
リ領域の最後尾セクタであったセクタID:(Y+2)
にて示されるセクタのnSIDに、図16(b)に示され
るが如く(Q+9)を記述するのである。更に、メモリ
コントローラ102は、図13に示されるFATエント
リ13を無効とすべく、かかるFATエントリ13のD
CBを論理値"1"に書き換える。かかる動作により、セ
クタID:(Q+9)にて示されるセクタは、ディレク
トリ領域となる。
Here, in optimizing the state of FIG. 16A, the memory controller 102
First searches for a free sector in the free area of the flash memory 101, and adds this free sector to the last sector as a directory area. For example, in the state of FIG. 13, the memory controller 102 refers to the FAT entries in order to obtain the sector ID: (Q +
It is determined that the sector indicated by 9) is an empty sector,
This sector is added as the last sector of the directory area. That is, the sector ID that was the last sector of the directory area in the state before the optimization: (Y + 2)
(Q + 9) is described as shown in FIG. 16B in the nSID of the sector indicated by. Further, the memory controller 102 sets the DAT of the FAT entry 13 to invalidate the FAT entry 13 shown in FIG.
CB is rewritten to a logical value “1”. By this operation, the sector indicated by the sector ID: (Q + 9) becomes a directory area.

【0043】次に、メモリコントローラ102は、図1
6(a)の状態においてディレクトリ領域の先頭セクタで
あったセクタID:Yにて示されるセクタ内に存在する
全ての有効なディレクトリエントリを、図16(b)に示
されるように、上記セクタID:(Q+9)にて示され
るセクタにコピーする。次に、メモリコントローラ10
2は、かかるセクタID:Yにて示されるセクタ内に記
録されていた情報を全て消去して、図16(b)に示され
るが如く、このセクタID:Yにて示されるセクタを自
由領域とする。すなわち、メモリコントローラ102
は、セクタID:Yのセクタを自由領域扱いとすべきF
ATエントリを作成し、これをFSL_FAT領域の最
後尾に追記するのである。
Next, the memory controller 102
As shown in FIG. 16B, all the valid directory entries existing in the sector indicated by the sector ID: Y, which was the first sector of the directory area in the state of FIG. : Copy to sector indicated by (Q + 9). Next, the memory controller 10
2 erases all the information recorded in the sector indicated by the sector ID: Y, and sets the sector indicated by the sector ID: Y to a free area as shown in FIG. And That is, the memory controller 102
Indicates that the sector with sector ID: Y should be treated as a free area.
An AT entry is created and added to the end of the FSL_FAT area.

【0044】かかるディレクトリ領域の最適化により、
ディレクトリ領域の先頭セクタは、セクタID:(Y+
1)にて示されるセクタとなる。従って、メモリコント
ローラ102は、この最新のディレクトリ領域の先頭セ
クタを示すセクタID:(Y+1)を、新たなD−SI
Dとして図3に示されるが如きフック領域中の追記領域
に追記して行く。
By optimizing the directory area,
The first sector of the directory area has a sector ID of (Y +
This is the sector indicated by 1). Therefore, the memory controller 102 assigns a sector ID: (Y + 1) indicating the head sector of the latest directory area to a new D-SI
D is added to an additional write area in the hook area as shown in FIG.

【0045】尚、かかるフック領域中の追記領域が一杯
になると、メモリコントローラ102は、フラッシュメ
モリ101に対してフック領域の更新を行う。この際、
上述した如く初期フォーマット時においてフック領域
は、セクタID:0のセクタに配置されている。フック領域の更新 図17は、かかるフック領域の更新を実施する為のサブ
ルーチンフローを示す図である。
When the additional recording area in the hook area becomes full, the memory controller 102 updates the hook area of the flash memory 101. On this occasion,
As described above, in the initial format, the hook area is arranged in the sector with the sector ID: 0. Update of hook area FIG. 17 is a diagram showing a subroutine flow for performing the update of the hook area.

【0046】図17において、メモリコントローラ10
2は、先ず、フック領域の最後尾に記録された最新のD
−SIDをその内蔵レジスタA(図示せず)に記憶する
(ステップS1)。次に、メモリコントローラ102
は、かかるフック領域中の全ての記録内容を消去する
(ステップS2)。次に、メモリコントローラ102
は、識別ID及びCBをかかるフック領域の先頭に夫々
記録し直してこれらを読み出す(ステップS3)。次
に、メモリコントローラ102は、これら識別ID及び
CB各々の読み出しが正常に為されたか否かの判定を行
う(ステップS4)。かかるステップS4において、読
み出しが正常に為されたと判定された場合、メモリコン
トローラ102は、書き込み位置を示すポインタ(バイ
ト数)nとして9を内蔵レジスタ(図示せず)に記憶す
る(ステップS5)。次に、メモリコントローラ102
は、そのnバイト目に、上記内蔵レジスタAに記憶して
おいた最新のD−SIDを記録し、これを読み出す(ス
テップS6)。すなわち、記録された識別ID及びCB
に続いてD−SIDを記録するのである。次に、メモリ
コントローラ102は、かかるD−SIDの読み出しが
正常に為されたか否かの判定を行う(ステップS7)。
かかるステップS7において、読み出しが正常に為され
たと判定された場合、メモリコントローラ102は、こ
のフック領域更新ルーチンを抜けてメインルーチン(説
明せず)の動作に戻る。
In FIG. 17, the memory controller 10
2 is the latest D recorded at the end of the hook area.
-Store the SID in its built-in register A (not shown) (step S1). Next, the memory controller 102
Deletes all recorded contents in the hook area (step S2). Next, the memory controller 102
Re-records the identification ID and CB at the head of the hook area, respectively, and reads them (step S3). Next, the memory controller 102 determines whether or not reading of each of the identification ID and CB has been normally performed (step S4). If it is determined in step S4 that the reading has been normally performed, the memory controller 102 stores 9 in a built-in register (not shown) as a pointer (number of bytes) n indicating the writing position (step S5). Next, the memory controller 102
Records the latest D-SID stored in the built-in register A in the n-th byte and reads it out (step S6). That is, the recorded identification ID and CB
Then, the D-SID is recorded. Next, the memory controller 102 determines whether or not the reading of the D-SID has been normally performed (Step S7).
If it is determined in step S7 that the reading has been performed normally, the memory controller 102 exits this hook area update routine and returns to the operation of the main routine (not described).

【0047】一方、かかるステップS7において、読み
出しが正常に為されなかったと判定された場合、メモリ
コントローラ102は、上記ポインタnに4バイトを加
算したものを新たなポインタnとして内蔵レジスタに記
憶する(ステップS8)。次に、メモリコントローラ1
02は、そのポインタnがフック領域の大きさ、すなわ
ち1セクタの全バイト数Nよりも大であるか否かの判定
を行う(ステップS9)。かかるステップS9におい
て、ポインタnが1セクタの全バイト数Nよりも大では
ないと判定された場合、メモリコントローラ102は、
上記ステップS6の動作に戻る。一方、かかるステップ
S9において、ポインタnが1セクタの全バイト数Nよ
りも大であると判定された場合、メモリコントローラ1
02は、このセクタの記録内容を全て消去する(ステッ
プS10)。かかるステップS10の終了後、あるい
は、上記ステップS4において、識別ID及びCB各々
の読み出しが正常に為されなかったと判定された場合、
メモリコントローラ102は、フック領域退避ルーチン
の実行に移る(ステップS11)。つまり、この際、フ
ック領域に割り当てられていたセクタが不良セクタであ
ると考えられるので、メモリコントローラ102は、別
のセクタにフック領域を退避させるべく以下の如きフッ
ク領域退避ルーチンの実行に移るのである。
On the other hand, if it is determined in step S7 that the reading has not been performed normally, the memory controller 102 stores the value obtained by adding 4 bytes to the pointer n in the internal register as a new pointer n ( Step S8). Next, the memory controller 1
In the step 02, it is determined whether or not the pointer n is larger than the size of the hook area, that is, whether or not the total number N of bytes in one sector (step S9). When it is determined in step S9 that the pointer n is not larger than the total number of bytes N in one sector, the memory controller 102
It returns to the operation of step S6. On the other hand, if it is determined in step S9 that the pointer n is larger than the total number of bytes N in one sector, the memory controller 1
02 erases all the recorded contents of this sector (step S10). After the end of the step S10, or when it is determined in the step S4 that the reading of the identification ID and the CB has not been performed normally,
The memory controller 102 proceeds to the execution of the hook area saving routine (step S11). That is, at this time, since the sector allocated to the hook area is considered to be a bad sector, the memory controller 102 proceeds to the execution of the following hook area saving routine to save the hook area in another sector. is there.

【0048】図18は、かかるフック領域退避ルーチン
を示す図である。図18において、先ず、メモリコント
ローラ102は、FSL_FAT領域の記録内容に基づ
いて空きセクタを探索し、これを新たなフック領域とす
べきセクタとして選出する(ステップS22)。次に、
メモリコントローラ102はポインタnとして1を内蔵
レジスタ(図示せず)に記憶する(ステップS23)。
次に、メモリコントローラ102は、不良セクタのnバ
イト目に、この選出セクタのセクタIDを記録し、これ
を読み出す。更に、メモリコントローラ102は、この
不良セクタの(n+4)バイト目に、この選出セクタの
セクタIDをビット反転したデータを記録し、これを読
み出す(ステップS24)。次に、メモリコントローラ
102は、かかるステップS24による読み出しが正常
に為されたか否かの判定を行う(ステップS25)。か
かるステップS25において、読み出しが正常に為され
なかったと判定された場合、メモリコントローラ102
は、上記不良セクタの(n+4)バイト目に、この選出
セクタのセクタIDのビット反転データ以外のデータを
記録し、これを読み出す(ステップS26)。次に、メ
モリコントローラ102は、かかるステップS26によ
る読み出しが正常に為されたか否かの判定を行う(ステ
ップS27)。かかるステップS27において、読み出
しが正常に為されたと判定された場合、メモリコントロ
ーラ102は、上記ポインタnに8バイトを加算したも
のを新たなポインタnとして内蔵レジスタに記憶する
(ステップS28)。次に、メモリコントローラ102
は、そのポインタnが1セクタの全バイト数Nよりも小
であるか否かの判定を行う(ステップS29)。かかる
ステップS29において、ポインタnが1セクタの全バ
イト数Nよりも小であると判定された場合、メモリコン
トローラ102は、上記ステップS24の動作に戻る。
一方、かかるステップS9において、ポインタnが1セ
クタの全バイト数Nよりも大であると判定された場合、
あるいは、上記ステップS27において、読み出しが正
常に為されなかったと判定された場合、メモリコントロ
ーラ102は、フック領域の待避動作が失敗した旨を、
図1に示されるCPU11に通知する(ステップS3
0)。
FIG. 18 is a diagram showing the hook area retreat routine. In FIG. 18, first, the memory controller 102 searches for an empty sector based on the recorded contents of the FSL_FAT area, and selects this as a sector to be a new hook area (step S22). next,
The memory controller 102 stores 1 as a pointer n in a built-in register (not shown) (step S23).
Next, the memory controller 102 records the sector ID of the selected sector in the n-th byte of the defective sector, and reads it. Further, the memory controller 102 records data in which the sector ID of the selected sector is bit-inverted in the (n + 4) byte of the defective sector, and reads the data (step S24). Next, the memory controller 102 determines whether or not the reading in step S24 has been performed normally (step S25). If it is determined in step S25 that the reading has not been performed normally, the memory controller 102
Records data other than the bit-reversed data of the sector ID of the selected sector in the (n + 4) byte of the defective sector and reads it (step S26). Next, the memory controller 102 determines whether or not the reading in step S26 has been normally performed (step S27). If it is determined in step S27 that the reading has been normally performed, the memory controller 102 stores the value obtained by adding 8 bytes to the pointer n in the internal register as a new pointer n (step S28). Next, the memory controller 102
Determines whether the pointer n is smaller than the total number N of bytes in one sector (step S29). If it is determined in step S29 that the pointer n is smaller than the total number of bytes N in one sector, the memory controller 102 returns to the operation in step S24.
On the other hand, when it is determined in step S9 that the pointer n is larger than the total number N of bytes in one sector,
Alternatively, if it is determined in step S27 that the reading has not been performed normally, the memory controller 102 notifies the user that the saving operation of the hook area has failed.
The CPU 11 shown in FIG. 1 is notified (step S3).
0).

【0049】すなわち、フック領域中の識別IDがこの
フック領域が存在するセクタIDであり、かつCBがこ
のセクタIDの全ビットを反転した値であれば、このフ
ック領域は正常でありD−SIDが正常に記録されてい
る。例えば、セクタID:0にあるフック領域の識別I
Dが "00000000"(HEX)であり、かつCBが"FFFFFFFF"(H
EX)であれば、このフック領域は正常であり、CBの後
に続く4バイトにはD−SIDが記録されている。
That is, if the identification ID in the hook area is the sector ID in which this hook area exists, and if CB is a value obtained by inverting all the bits of this sector ID, this hook area is normal and D-SID Is recorded normally. For example, the identification I of the hook area in the sector ID: 0
D is "00000000" (HEX) and CB is "FFFFFFFF" (HEX
If EX), this hook area is normal, and D-SID is recorded in the 4 bytes following CB.

【0050】また、フック領域中の識別IDがこのフッ
ク領域が存在するセクタIDとは異なる値であり、かつ
CBがこの値の全ビットを反転した値であれば、このフ
ック領域は不良セクタであり、この識別IDが示すセク
タIDのセクタへフック領域の内容を退避してあること
を示している。例えば、セクタID:0にあるフック領
域の識別IDが "00000010"(HEX)であり、かつCBが"F
FFFFFEF"(HEX)であれば、このセクタは不良であり、フ
ック領域の内容はセクタID:"10"(HEX)へ退避してあ
ることを示す。
If the identification ID in the hook area is different from the sector ID in which the hook area exists and CB is a value obtained by inverting all the bits of this value, the hook area is a bad sector. This indicates that the contents of the hook area have been saved to the sector of the sector ID indicated by the identification ID. For example, the ID of the hook area at sector ID: 0 is "00000010" (HEX), and the CB is "F".
If FFFFFEF "(HEX), this sector is bad, indicating that the contents of the hook area have been saved to sector ID:" 10 "(HEX).

【0051】更に、フック領域中の識別IDとCBの全
ビットが各々互いに反転関係になければ、この8バイト
は不良であり意味を持たないことを示す。従って、次の
8バイトを識別ID及びCBとして調べて、再び上述し
た如き検査を繰り返し実行する。もし、かかるフック領
域のセクタが終了しても互いに反転関係にある(不良で
はない)8バイトの領域が検出されなければセクタの退
避が失敗したことになるのである。
Further, if all the bits of the identification ID and CB in the hook area are not in an inverting relation with each other, this indicates that these 8 bytes are defective and have no meaning. Therefore, the next 8 bytes are checked as the identification ID and CB, and the above-described inspection is repeated. Even if the sector of the hook area is completed, if an 8-byte area that is in an inverse relationship (not a bad one) is not detected, the evacuation of the sector has failed.

【0052】FSL_FAT領域の更新 尚、FSL_FAT領域の先頭セクタ内における全ての
FATエントリが無効を示す状態となった場合、メモリ
コントローラ102は、フラッシュメモリ101に対し
てFSL_FAT領域の更新を行う。例えば、図13の
状態においては、FSL_FAT領域の先頭セクタ(セ
クタID:R)内の全てのFATエントリ0〜5が無効
を示す状態となっている。よって、メモリコントローラ
102は、このセクタID:Rにて示されるセクタに記
録されている情報を全て消去し、かかるセクタを自由領
域とする。すなわち、メモリコントローラ102は、セ
クタID:Rのセクタを自由領域扱いとすべきFATエ
ントリを作成し、これをFSL_FAT領域の最後尾に
追記するのである。
Update of FSL_FAT Area If all the FAT entries in the first sector of the FSL_FAT area indicate invalid, the memory controller 102 updates the flash memory 101 with the FSL_FAT area. For example, in the state of FIG. 13, all the FAT entries 0 to 5 in the first sector (sector ID: R) of the FSL_FAT area are in a state where they are invalid. Therefore, the memory controller 102 erases all information recorded in the sector indicated by the sector ID: R, and sets the sector as a free area. That is, the memory controller 102 creates a FAT entry in which the sector with the sector ID: R should be treated as a free area, and adds this to the end of the FSL_FAT area.

【0053】尚、FSL_FAT領域の最終セクタ内に
おける消去領域が全く無くなった場合、メモリコントロ
ーラ102は、フラッシュメモリ101の自由領域中か
ら空きセクタを検索し、この空きセクタをFSL_FA
T領域の最後尾セクタとして追加する。例えば、図13
の状態においては、メモリコントローラ102は、FS
L_FAT領域中のFATエントリを順に参照すること
により、セクタID:(Q+9)にて示されるセクタが
空きセクタであると判定し、このセクタをFSL_FA
T領域の最後尾セクタとして追加する。すなわち、更新
前の状態においてFSL_FAT領域の最後尾セクタで
あったセクタID:(R+2)にて示されるセクタのn
SIDに(Q+9)を記述するのである。更に、メモリ
コントローラ102は、図13に示されるが如きFSL
ディレクトリエントリ3のFT−SIDとして、先頭セ
クタを示す(R+2)を記録するのである。この際、F
SLディレクトリエントリ2のDCBを論理値"1"に書
き換える。
When the erase area in the last sector of the FSL_FAT area is completely lost, the memory controller 102 searches the free area of the flash memory 101 for a free sector, and finds this free sector in the FSL_FAT area.
It is added as the last sector of the T area. For example, FIG.
In the state of, the memory controller 102
By sequentially referring to the FAT entries in the L_FAT area, it is determined that the sector indicated by the sector ID: (Q + 9) is an empty sector, and this sector is referred to as FSL_FA.
It is added as the last sector of the T area. That is, n of the sector indicated by the sector ID: (R + 2) which was the last sector of the FSL_FAT area in the state before the update.
(Q + 9) is described in the SID. Further, the memory controller 102 has an FSL as shown in FIG.
As the FT-SID of the directory entry 3, (R + 2) indicating the head sector is recorded. At this time, F
The DCB of the SL directory entry 2 is rewritten to the logical value “1”.

【0054】以上の如き、フック領域、ディレクトリ領
域、及びFSL_FAT領域各々に対する最適化動作に
よれば、フラッシュメモリ101内の記録領域を有効化
しつつセクタの消去回数を減らすことが出来るので、フ
ラッシュメモリ101の寿命を延ばすことが可能とな
る。尚、上記各領域を最適化する際に、記録内容の消去
単位を1セクタとしたが、これに限らず消去ブロックの
整数倍を消去単位としても同様の効果が得られる。
According to the optimization operation for each of the hook area, the directory area, and the FSL_FAT area as described above, the number of erasures of the sector can be reduced while the recording area in the flash memory 101 is enabled. Can be extended. When optimizing each area, the erase unit of the recorded contents is set to one sector. However, the present invention is not limited to this, and the same effect can be obtained by using an integral multiple of the erase block as the erase unit.

【0055】又、本実施例の形態ではフラッシュメモリ
を記憶媒体として用いたが、要するに書き込み回数に制
限のあるメモリに対して本願発明は有効となるのであ
る。
Although the flash memory is used as a storage medium in this embodiment, the present invention is effective for a memory having a limited number of times of writing.

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

【図1】情報処理装置の構成の一例を示す図である。FIG. 1 is a diagram illustrating an example of a configuration of an information processing apparatus.

【図2】フラッシュメモリ101の初期論理フォーマッ
トを示す図である。
FIG. 2 is a diagram showing an initial logical format of a flash memory 101.

【図3】フック領域の初期フォーマットを示す図であ
る。
FIG. 3 is a diagram showing an initial format of a hook area.

【図4】ディレクトリ領域の初期フォーマットを示す図
である。
FIG. 4 is a diagram showing an initial format of a directory area.

【図5】FSL_FAT領域の初期フォーマットを示す
図である。
FIG. 5 is a diagram showing an initial format of an FSL_FAT area.

【図6】本発明のメモリの制御方法によるフラッシュメ
モリ101の状態推移の一例を示す図である。
FIG. 6 is a diagram showing an example of a state transition of the flash memory 101 according to the memory control method of the present invention.

【図7】本発明のメモリの制御方法によるフラッシュメ
モリ101の状態推移の一例を示す図である。
FIG. 7 is a diagram showing an example of a state transition of the flash memory 101 according to the memory control method of the present invention.

【図8】本発明のメモリの制御方法によるフラッシュメ
モリ101の状態推移の一例を示す図である。
FIG. 8 is a diagram showing an example of a state transition of the flash memory 101 according to the memory control method of the present invention.

【図9】本発明のメモリの制御方法によるフラッシュメ
モリ101の状態推移の一例を示す図である。
FIG. 9 is a diagram showing an example of a state transition of the flash memory 101 according to the memory control method of the present invention.

【図10】本発明のメモリの制御方法によるフラッシュ
メモリ101の状態推移の一例を示す図である。
FIG. 10 is a diagram showing an example of a state transition of the flash memory 101 according to the memory control method of the present invention.

【図11】本発明のメモリの制御方法によるフラッシュ
メモリ101の状態推移の一例を示す図である。
FIG. 11 is a diagram showing an example of a state transition of the flash memory 101 according to the memory control method of the present invention.

【図12】本発明のメモリの制御方法によるフラッシュ
メモリ101の状態推移の一例を示す図である。
FIG. 12 is a diagram showing an example of a state transition of the flash memory 101 according to the memory control method of the present invention.

【図13】本発明のメモリの制御方法によるフラッシュ
メモリ101の状態推移の一例を示す図である。
FIG. 13 is a diagram showing an example of a state transition of the flash memory 101 according to the memory control method of the present invention.

【図14】ファイルAの保存形態の一例を示す図であ
る。
FIG. 14 is a diagram showing an example of a storage mode of a file A.

【図15】ファイルFの保存形態の一例を示す図であ
る。
FIG. 15 is a diagram illustrating an example of a storage form of a file F.

【図16】ディレクトリ領域の最適化動作を説明する為
の図である。
FIG. 16 is a diagram for explaining an operation of optimizing a directory area.

【図17】フック領域の更新動作に基づくサブルーチン
フローを示す図である。
FIG. 17 is a diagram showing a subroutine flow based on a hook area update operation.

【図18】フック領域の退避動作に基づくサブルーチン
フローを示す図である。
FIG. 18 is a diagram showing a subroutine flow based on an evacuation operation of a hook area.

【主要部分の符号の説明】[Description of Signs of Main Parts]

10 記憶装置 101 フラッシュメモリ 102 メモリコントローラ Reference Signs List 10 storage device 101 flash memory 102 memory controller

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 各々が所定記録容量からなる複数のセク
タにてメモリの記録領域を区分けし前記セクタ単位にて
前記メモリの制御を行う方法であって、 前記セクタの各々が空きセクタであるか否かを示すファ
ットエントリを前記メモリのファット領域中に記録して
おき、 ファイルの書込時には、前記ファット領域の先頭から順
に空きセクタであることを示すファットエントリを検索
してこの検索ファットエントリによって示されるセクタ
に前記ファイルの書込みを行うと共に、前記検索ファッ
トエントリを空きセクタではないことを示すファットエ
ントリに書き換え、 ファイルの消去時には、削除対象となったファイルを削
除すると共に、前記ファイルの削除によって空きセクタ
となったセクタに関するファットエントリを新たに作成
してこれを前記ファット領域の最後尾に記録することを
特徴とするメモリの制御方法。
1. A method for dividing a recording area of a memory into a plurality of sectors each having a predetermined recording capacity and controlling the memory in units of the sector, wherein each of the sectors is a free sector. A fat entry indicating whether or not the sector is empty is recorded in the fat area of the memory, and at the time of writing a file, a fat entry indicating a free sector is sequentially searched from the head of the fat area. The file is written to the indicated sector, and the search fat entry is rewritten to a fat entry indicating that the file is not an empty sector. When deleting the file, the file to be deleted is deleted, and the file is deleted. Create a new fat entry for an empty sector. And recording it at the end of the fat area.
【請求項2】 前記ファット領域中に記録されているフ
ァットエントリの内で空きセクタであることを示しかつ
最も先頭位置に存在しているファットエントリが記録さ
れているセクタを示す先頭セクタ情報を記録しておき、 ファイルの書込時には、前記先頭セクタ情報によって示
されるセクタ位置から空きセクタであることを示すファ
ットエントリを検索することを特徴とする請求項1記載
のメモリの制御方法。
2. A head sector information indicating a vacant sector among fat entries recorded in the fat area and indicating a sector in which a fat entry located at the head position is recorded is recorded. 2. The memory control method according to claim 1, wherein when writing the file, a fat entry indicating an empty sector is searched from a sector position indicated by the head sector information.
【請求項3】 前記ファット領域の先頭セクタ中に記録
されている全てのファットエントリが空きセクタではな
いことを示す場合には、前記先頭セクタの記録内容を全
て消去して該先頭セクタを書込可能な自由領域とするこ
とを特徴とする請求項1記載のメモリの制御方法。
3. When all fat entries recorded in the head sector of the fat area indicate that they are not empty sectors, all recorded contents of the head sector are erased and the head sector is written. 2. The method according to claim 1, wherein the free area is a free area.
【請求項4】 前記メモリには、前記ファイル各々に関
するファイル情報及び前記ファット領域の先頭セクタの
位置を示す情報が記録されるディレクトリ領域と、前記
ディレクトリ領域の先頭セクタの位置を示す情報が記録
されるフック領域とが記録形成されることを特徴とする
請求項1記載のメモリの制御方法。
4. A directory area in which file information relating to each of the files and information indicating a position of a head sector of the fat area are recorded, and information indicating a position of a head sector of the directory area are recorded in the memory. 2. The memory control method according to claim 1, wherein a hook area is recorded and formed.
【請求項5】 前記フック領域に対応したセクタが不良
セクタとなった場合には、前記ファット領域中から空き
セクタを検索してこの空きセクタの位置を示す情報を前
記不良セクタに記録すると共に該不良セクタに記録され
ていた記録内容を前記空きセクタに記録することによ
り、前記フック領域を前記空きセクタに退避することを
特徴とする請求項1及び4記載のメモリの制御方法。
5. When the sector corresponding to the hook area becomes a bad sector, a search is made for a free sector from the fat area, and information indicating the position of the free sector is recorded in the bad sector. 5. The memory control method according to claim 1, wherein said hook area is evacuated to said empty sector by recording contents recorded in a defective sector in said empty sector.
【請求項6】 前記各領域には夫々のセクタ間の繋がり
を示す情報が記録されることを特徴とする請求項1、
2、3、4又は5に記載のメモリの制御方法。
6. The apparatus according to claim 1, wherein information indicating a connection between the respective sectors is recorded in each of the areas.
6. The method for controlling a memory according to 2, 3, 4, or 5.
【請求項7】 前記メモリは、書き込み回数に制限があ
る記憶媒体であることを特徴とする請求項1記載のメモ
リの制御方法。
7. The method according to claim 1, wherein the memory is a storage medium having a limited number of times of writing.
【請求項8】 前記メモリは、フラッシュメモリである
ことを特徴とする請求項1記載のメモリの制御方法。
8. The method according to claim 1, wherein the memory is a flash memory.
JP9092668A 1997-04-11 1997-04-11 Memory control method Pending JPH10289144A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9092668A JPH10289144A (en) 1997-04-11 1997-04-11 Memory control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9092668A JPH10289144A (en) 1997-04-11 1997-04-11 Memory control method

Publications (1)

Publication Number Publication Date
JPH10289144A true JPH10289144A (en) 1998-10-27

Family

ID=14060866

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9092668A Pending JPH10289144A (en) 1997-04-11 1997-04-11 Memory control method

Country Status (1)

Country Link
JP (1) JPH10289144A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100420602B1 (en) * 1997-05-23 2004-04-17 삼성전자주식회사 Method for replacing image for test printing in printer
WO2008026466A1 (en) * 2006-08-31 2008-03-06 Sharp Kabushiki Kaisha File system
KR100844058B1 (en) * 2006-01-11 2008-07-07 후지쯔 가부시끼가이샤 File delete method, file open method, storge medium storing file delete program, and storage medium storing file open program
US8149295B2 (en) 2002-02-18 2012-04-03 Nikon Corporation Digital camera with external storage medium detector
US8681243B2 (en) 2002-01-11 2014-03-25 Nikon Corporation Digital camera

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100420602B1 (en) * 1997-05-23 2004-04-17 삼성전자주식회사 Method for replacing image for test printing in printer
US8681243B2 (en) 2002-01-11 2014-03-25 Nikon Corporation Digital camera
US8149295B2 (en) 2002-02-18 2012-04-03 Nikon Corporation Digital camera with external storage medium detector
US8659677B2 (en) 2002-02-18 2014-02-25 Nikon Corporation Digital camera with external storage medium detector
KR100844058B1 (en) * 2006-01-11 2008-07-07 후지쯔 가부시끼가이샤 File delete method, file open method, storge medium storing file delete program, and storage medium storing file open program
WO2008026466A1 (en) * 2006-08-31 2008-03-06 Sharp Kabushiki Kaisha File system

Similar Documents

Publication Publication Date Title
US8122193B2 (en) Storage device and user device including the same
JP3485938B2 (en) Nonvolatile semiconductor memory device
US8738845B2 (en) Transaction-safe fat file system improvements
US6038636A (en) Method and apparatus for reclaiming and defragmenting a flash memory device
US5592669A (en) File structure for a non-volatile block-erasable semiconductor flash memory
JP3195988B2 (en) Nonvolatile semiconductor memory and computer system using the same
US7552311B2 (en) Memory device with preread data management
JP5035636B2 (en) Moving sectors in blocks in flash memory
US6256232B1 (en) Data access method capable of reducing the number of erasing to flash memory and data patch and access device using the same
JP2004013895A (en) File system for flash memory
JPH11126488A (en) Method and device for storing and controlling data of external memory using plural flash memories
JPH05233426A (en) Flash memory using method
JPH08328762A (en) Semiconductor disk device and memory management method therefor
JP3421581B2 (en) Storage device using nonvolatile semiconductor memory
JPH096540A (en) Built-in directory method for data compression of direct-access storage device and directory record
JP2000298608A (en) Computer data storage medium and memory managing method
KR20010037155A (en) Flash file system
KR20020092261A (en) Management Scheme for Flash Memory with the Multi-Plane Architecture
JP5036078B2 (en) Storage device
JPH10289144A (en) Memory control method
US20050149493A1 (en) Data recording apparatus and data recording method
JPH0695955A (en) Flash file system
US6871260B2 (en) Non-volatile memory based storage system capable of directly overwriting without using redundancy and its writing method
JP2004326523A (en) Storage device with rewritable nonvolatile memory, and control method of nonvolatile memory for storage device
JP2001101071A (en) Data storage device using flash type memory and data managing method for the same memory

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20051024

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20060301