JP2004038595A - Information processor, and program - Google Patents

Information processor, and program Download PDF

Info

Publication number
JP2004038595A
JP2004038595A JP2002195206A JP2002195206A JP2004038595A JP 2004038595 A JP2004038595 A JP 2004038595A JP 2002195206 A JP2002195206 A JP 2002195206A JP 2002195206 A JP2002195206 A JP 2002195206A JP 2004038595 A JP2004038595 A JP 2004038595A
Authority
JP
Japan
Prior art keywords
storage area
data storage
divided data
management table
primary
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.)
Withdrawn
Application number
JP2002195206A
Other languages
Japanese (ja)
Inventor
Hiroki Matsuoka
松岡 弘樹
Tsutomu Nakayama
中山 力
Hirotaka Ogura
小倉 宏隆
▲斎▼藤 昭彦
Akihiko Saito
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson 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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2002195206A priority Critical patent/JP2004038595A/en
Publication of JP2004038595A publication Critical patent/JP2004038595A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To provide an information processor for effectively utilizing an unused marginal area in a cluster which is considered to be under usage in an FAT file system while keeping compatibility with the FAT file system. <P>SOLUTION: A temporary file management table 22 is arranged separately from a FAT management table 21. A sector which is left unused in the cluster which is used in a FAT is retrieved by a free sector obtaining means 34, a data write means 35 writes data in it, and a data reading means 36 reads the data. Thus, the unused marginal area of the cluster which is partially being used is effectively utilized while keeping compatibility with the FAT file system through the use of a comparatively simple method. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、情報処理装置およびプログラムに関し、特に情報記憶手段の有効利用を図った情報処理装置およびプログラムに関する。
【0002】
【従来の技術】
フラッシュメモリはEEPROM(Electorically Erasable and Programmable Read Only Memory)の一種であるが、通常のEEPROMが1バイトづつ消去を行うのに対して、ブロック単位または一括に消去できるように構成されているメモリである。データは比較的自由に繰り返し書き替えることができ、バックアップ電源を必要とせず、また構成が簡単なため、単位セル面積がRAMよりも小さいという長所を有している。また、書き込み、消去回数も10万回ぐらいは保証されている。さらに、記憶容量は数Mバイトから512Mバイトぐらいまで幅広いものがある。このため、パソコンなどのBIOS(基本入出力システム)の記憶などに用いられているほか、オンボードメモリとしても広く用いられるようになってきている。
ところで、フラッシュメモリの素子は、メーカおよびその型番によってその仕様が異なっており、殊に記憶容量にともなって一度に転送できるデータの最大単位であるブロックサイズが異なるためにその違いに応じて制御の仕方、処理方法を変えなければならないという問題があった。
【0003】
これを解決する手段として、従来の情報記録装置でハードディスク装置上のファイル管理に用いられる、FAT(File Allocation Table )ファイルシステムと呼ばれる管理方法を用いてフラッシュメモリの記録領域を管理する方法が報告されている。この方法では、ハードディスクに習ってフラッシュメモリの記録領域を複数の小データ格納領域である仮想セクタに分割し、この複数の仮想セクタをまとめたものを仮想クラスタとする。情報記録装置へのアクセスの単位はこのセクタである。クラスタの使用状況を記憶するテーブルがFATである。
【0004】
FATの内容は対応するクラスタの使用状況を示し、使用中の場合はファイルが次のクラスタに続くかどうかなどの情報を含んでいる。セクタの大きさ(セクタサイズ)は512バイトなどで、クラスタの大きさ(クラスタサイズ)はMS−DOSでのFATでは1kバイト、MS−DOS3.0から採用されたFAT16では32kバイト、Windows(R)95から採用されたFAT32では4kバイトである。クラスタサイズが大きいと管理やアクセスが容易になるが、大きすぎるとディスク装置のメモリ領域の利用効率は悪くなる。
【0005】
FATディスクファイルシステムでは、通常データの書き込みに際しては、論理アドレスに従ってファイルを管理するための表であるディレクトリの番号の小さい順にFATのクラスタ情報(データ格納領域であるクラスタの使用/未使用状態を記録したもの)を参照し、未使用であるクラスタを検索する。次に当該未使用クラスタデータにデータを格納し、ディレクトリ構造とFATを更新する。
【0006】
図7はディレクトリ構造を示す説明図である。図8はFATを示す説明図である。
図7のディレクトリ構造には、ファイル名やファイルが管理されているOSの種類を表す拡張子、バイト数や作成日時を表す属性およびFAT上の開始位置を表すFATエントリなどが記録されている。図8のFATにはデータ格納領域の使用/未使用状態を示すクラスタ情報と、そのクラスタのファイルの続きがどのクラスタに続くのか、あるいはここで終了するのかを示す情報が記録されている。
【0007】
データの書き込みに当たって未使用領域を探す場合、図7のディレクトリから対応付けられたFATエントリを参照し、図8のFATからクラスタ情報を参照する。図9のフローチャートに示すように、もし、データ格納領域が未使用(すなわちクラスタ情報=0)であれば、そのクラスタにデータを格納し、FATのクラスタのステータスを未使用(クラスタ情報=0)から使用(クラスタ情報=1)に書き換える。さらに、ディレクトリ構造の書き換えを行う。ここで、ディレクトリ構造の書き換えは、ディレクトリ番号に割り当てられるFATエントリ(FAT番号を示す)、ファイル名、拡張子等である。
一方、データ格納領域が使用中(クラスタ情報=1)であれば、次のディレクトリについて上記の手順を繰り返す。ここで、検索順はディレクトリの小さい順に行う。また、ディレクトリ番号とFATエントリは固定した形になっている。
【0008】
ところで、フラッシュメモリの記憶領域をFATファイルシステムなどのファイルシステムで管理する場合、そのメモリ容量は論理クラスタ単位で処理され、ファイルは論理クラスタ単位で作成される。したがって、ファイルは必ずクラスタの先頭から格納される。また、1つのクラスタは1つのファイルしか含まない。このため、クラスタには未使用セクタが発生する場合がある。クラスタが一部でも使用中の場合は、クラスタ情報は1となり、未使用のセクタが残っていてもFATファイルシステムでは利用することはできない。
【0009】
【発明が解決しようとする課題】
上述のごとく、フラッシュメモリをファイルシステムで管理するとファイルの終りにクラスタの未使用のセクタが発生する場合がある。この未使用セクタを全く無駄にしてしまうのは勿体ない。
本発明は、比較的簡単な方法でこの問題を解決して、FATファイルシステムへの互換性を保ったまま、一部使用されているクラスタの未使用のセクタを有効に利用することができるフラッシュメモリの利用方法を実行する情報処理装置およびプログラムの実現を課題とする。
【0010】
【課題を解決するための手段】
上記課題を達成するため、本発明は、情報記憶手段を具備し、前記情報記憶手段の記憶領域を複数の一次分割データ格納領域に分割し、前記一次分割データ格納領域を複数の二次分割データ格納領域に分割し、前記データ格納領域の使用状況を管理テーブルで管理する情報処理装置において、前記一次分割データ格納領域の使用状況を一次分割データ格納領域管理テーブルで管理する一次分割データ格納領域管理手段と、前記二次分割データ格納領域の使用状況を二次分割データ格納領域管理テーブルで管理する二次分割データ格納領域管理手段とを有することを特徴とする。
これにより、比較的簡単な方法で一次分割データ格納領域の管理テーブルによる管理との互換性を保ったまま、管理テーブル上で使用中とされているデータ格納領域中の未使用二次分割データ格納領域を別途管理することが可能な情報処理装置を実現することができる。
【0011】
また、本発明は、前記一次分割データ格納領域管理テーブルは前記一次分割データ格納領域に使用中の前記二次分割データ格納領域があるかないかの情報を記憶し、前記二次分割データ格納領域管理テーブルは、前記第1の一次分割データ格納領域内のすべての二次分割データ格納領域の使用ステータスを記憶することを特徴とする。
これにより、使用中の一次分割データ格納領域中の二次分割データ格納領域を二次分割データ格納領域管理テーブルによって別途管理することが可能な情報処理装置を実現することができる。
【0012】
また、本発明の前記二次分割データ格納領域管理手段は、前記一次分割データ格納領域管理テーブル上で使用中とされている一次分割データ格納領域中の未使用二次分割データ格納領域を管理する二次分割データ格納領域管理テーブルを初期化する二次分割データ格納領域管理テーブル初期化手段と、前記一次分割データ格納領域管理テーブル上で使用中とされている一次分割データ格納領域中の未使用二次分割データ格納領域を検索し前記二次分割データ格納領域管理テーブルに登録する未使用二次分割データ格納領域検索手段と、前記二次分割データ格納領域管理テーブルからデータ長に応じた未使用二次分割データ格納領域を探してデータを書き込むデータ書き込み手段と、このデータ書き込み手段が書き込んだデータを読み出すデータ読み出し手段と、前記一次分割データ格納領域管理手段が動作を開始したとき前記二次分割データ格納領域管理テーブルに登録されている二次分割データ格納領域を解放する二次分割データ格納領域解放手段とを具備することを特徴とする。
これにより、一次分割データ格納領域管理テーブルとは別個に、未使用二次分割データ格納領域を管理し、これにデータを記録し、記録したデータを読み出すことが可能な二次分割データ格納領域管理手段を実現することができる。
【0013】
また、本発明は、情報処理装置に用いられるプログラムにおいて、前記一次分割データ格納領域管理テーブル上で使用中とされている一次分割データ格納領域中の未使用二次分割データ格納領域を管理する二次分割データ格納領域管理テーブルを初期化する二次分割データ格納領域管理テーブル初期化手順と、前記一次分割データ格納領域管理テーブル上で使用中とされている一次分割データ格納領域中の未使用二次分割データ格納領域を検索し前記二次分割データ格納領域管理テーブルに登録する未使用二次分割データ格納領域検索手順と、前記二次分割データ格納領域管理テーブルからデータ長に応じた未使用二次分割データ格納領域を探してデータを書き込むデータ書き込み手順と、前記データ書き込み手順で書き込んだデータを読み出すデータ読み出し手順と、前記一次分割データ格納領域管理手段が動作を開始したとき前記二次分割データ格納領域管理テーブルに登録されている二次分割データ格納領域を解放する二次分割データ格納領域解放手順とを情報処理装置に実行させることを特徴とする。
これにより、管理テーブル上で使用中とされているデータ格納領域中の未使用二次分割データ格納領域を有効に利用することが可能な情報処理装置用のプログラムを実現することができる。
【0014】
【発明の実施の形態】
以下、本発明にかかる情報処理装置およびプログラムを添付図面を参照にして詳細に説明する。
【0015】
図1に、本発明が用いられる情報処理装置の構成を示す。図1において、符号1はCPU、符号2はRAM、符号3はROM、符号4はフラッシュメモリ、符号5はI/Oインターフェース、符号6はバスである。この構成でRAM2はCPU1のメインメモリとしての機能とFAT管理テーブル21および本発明のテンポラリファイル管理テーブル22など全管理テーブルやシステム領域の記憶機能を、ROM3はデバイスドライバ、FATファイルシステムコントロールブロック31、テンポラリファイルシステムコントロールブロック32およびユーザプログラムなどの記憶機能を、フラッシュメモリ4はデータ記憶領域とシステム管理領域とクラスタ情報、不良ブロック情報などの記憶機能を分担すると共に、電源オフ時にRAM2上のシステム領域を退避する機能を有する。
ここで、FATファイルシステムコントロールブロック31は、クラスタ情報を記憶するFATを制御する手段である。テンポラリファイルシステムコントロールブロック32は、セクタ情報を記憶するテンポラリファイル管理テーブルを制御する手段である。このテンポラリファイルシステムコントロールブロック32はテンポラリファイル初期化手段33、空きセクタ取得手段34、データ書き込み手段35、データ読み出し手段36、セクタ解放手段37の各機能を有している。これらと本発明の対応については順次発明の記述の中で説明することにする。
【0016】
また、このフラッシュメモリファイルシステムを層構成的にイメージしたのが図2である。図2において、符号11はCPU、符号12はフラッシュメモリ、符号13はアドレスバス、符号14はデータバス、符号15はデバイスドライバ、符号16はファイルシステム、符号17はテンポラリファイルシステム、符号18はユーザプログラムである。ハードウェア領域(物理領域)ではCPU11と、フラッシュメモリ12と、CPU11とフラッシュメモリ12を結ぶアドレスバス13およびデータバス14で構成されており、ソフトウェア領域(論理領域)は、ユーザプログラム18と周辺機器(ここではフラッシュメモリ12)とを仲介する周辺機器管理プログラムであるデバイスドライバ15と、それに接続されるFAT構成のファイルシステム16、未使用セクタを管理するテンポラリファイルシステム17およびユーザプログラム18とで構成されている。デバイスドライバ15とFATファイルシステム16とテンポラリファイルシステム17はユーザプログラム18などと共にROM3に記憶されている。
【0017】
図3は、クラスタとセクタの関係を示す説明図である。この例では、1セクタは512バイト、1クラスタは32kバイトであると仮定する。したがって、1クラスタは64セクタから構成されている。クラスタは特許請求の範囲の一次分割データ格納領域にあたり、セクタは二次分割データ格納領域にあたる。また、図4は、本発明でのセクタの利用方法を説明する説明図である。
いま、図4に示すように、FAT形式で2kバイトのデータをフラシュメモリのクラスタに記録したとする。データが記録されたクラスタをクラスタ1とすると、このクラスタ1には32k−2k=30kバイトの余白(未使用部分)が生じる。この余白をセクタに換算すると60セクタになる。
このような余白を管理して利用するために、本発明では、テンポラリファイルシステムを設けている。
【0018】
テンポラリファイルシステムの動作を図5および図6のフローチャートに沿って説明する。テンポラリファイルシステムを動作する際には、FATが動作中であるかを確認する。ステップ101でFATが動作中の場合は待機する。FATが動作していなければ、ステップ102に移行する。ステップ102でテンポラリファイル初期化手段33によってテンポラリファイル管理情報を初期化する。
ステップ103で空きセクタ取得手段34は、FAT管理情報をもとにFATで使用しているクラスタ情報およびクラスタに記録されているファイルのサイズ情報を得る。これらの情報をもとに、余白情報を得る。この余白情報はFATで使用しているクラスタ内に未使用のセクタがあるかどうかを検索し決定する。この時、余白情報の検索対象はあくまでFATで使用しているクラスタに限っており、FATで未使用のクラスタは対象にしない。
ステップ104で、こうして求めた余白情報をテンポラリファイル管理情報にID(識別番号)を付けて登録する。登録する情報の個数は、テンポラリファイル初期化手段33による初期化の際に予め決められている。
【0019】
ステップ105で、テンポラリファイルシステムへデータを書き込む場合は、ステップ106でデータ書き込み手段35はテンポラリファイル管理情報からデータのサイズにあった最適な余白情報を取得し、ステップ107で、余白情報として登録されている未使用のセクタに書き込む。ステップ108で、データ書き込み手段35を呼び出したアプリケーションにIDを返し、テンポラリファイル管理情報の余白情報を修正する。
ステップ105でデータを書き込みでないと判定された場合、ステップ109に移行し、ステップ109で、テンポラリファイルシステムからデータを読み出す場合は、ステップ110でアプリケーションはデータ読み出し手段36にIDを渡す。データ読み出し手段36はテンポラリファイル管理情報からIDの示すセクタを検索し、ステップ111でそのセクタに記録されたデータを読み出してアプリケーションに返す。
テンポラリファイルシステムを使用している期間は、FATファイルシステムの操作は行わないことが望ましいために次の制御を行う。ステップ109でデータ読出しを行わないと判定された場合、ステップ112でFATファイルシステムの操作を行う場合は、ステップ113でセクタの解放手段37を使用して、テンポラリファイル管理情報に登録されたセクタを解放し、ステップ114でテンポラリファイルシステムを無効にしてFATファイルシステムに移り終了する。なお、本発明は発明の要旨の範囲内において種々の変形実施が可能である。例えば、ステップ105,106,107,108とステップ109,110,111と入れ替えることが可能である。
【0020】
【発明の効果】
以上説明したように本発明によると、FATファイルシステムとは別個に、テンポラリファイルシステムを設け、FATで使用しているクラスタに未使用で残っているセクタを管理するようにしているので、比較的簡単な方法で、FATファイルシステムとの互換性を保ったまま、一部使用中のクラスタの未使用の余白エリアを有効に利用することができ、実用的な価値の高い情報処理装置とプログラムを実現することができる。
【図面の簡単な説明】
【図1】本発明が用いられる情報処理装置の構成を示す図。
【図2】本発明のフラシュメモリファイルシステムの層構成イメージを示す図。
【図3】クラスタとセクタの関係を示す説明図。
【図4】本発明での未使用セクタの利用方法を説明する説明図。
【図5】本発明のテンポラリファイルシステムの処理動作を示すフローチャート。
【図6】本発明のテンポラリファイルシステムの処理動作を示すフローチャート。
【図7】ディレクトリ構造を示す説明図。
【図8】FATを示す説明図。
【図9】従来のデータの書き込み手順を示す説明図。
【符号の説明】
1、11  CPU
2  RAM
3  ROM
4、12  フラッシュメモリ
5  I/Oインターフェース
6  バス
13  アドレスバス
14  データバス
15  デバイスドライバ
16  ファイルシステム
17  テンポラリファイルシステム
18  ユーザプログラム
21  FAT管理テーブル
22  テンポラリファイル管理テーブル
31  FATファイルシステムコントロールブロック
32  テンポラリファイルシステムコントロールブロック
33  テンポラリファイル初期化手段
34  空きセクタ取得手段
35  データ書き込み手段
36  データ読み出し手段
37  セクタ解放手段
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an information processing apparatus and a program, and more particularly, to an information processing apparatus and a program for effectively using an information storage unit.
[0002]
[Prior art]
A flash memory is a type of EEPROM (Electrically Erasable and Programmable Read Only Memory), but is a memory configured to be able to erase in block units or collectively, while a normal EEPROM erases one byte at a time. . Data can be rewritten relatively freely and repeatedly, does not require a backup power supply, and has a simple configuration, so that the unit cell area is smaller than that of a RAM. Also, the number of times of writing and erasing is guaranteed to be about 100,000 times. Further, the storage capacity is wide ranging from several Mbytes to about 512 Mbytes. For this reason, it is used not only for storing a BIOS (basic input / output system) of a personal computer or the like, but also for being widely used as an on-board memory.
By the way, flash memory elements have different specifications depending on the maker and the model number. In particular, since the block size, which is the maximum unit of data that can be transferred at one time, differs depending on the storage capacity, the control of the element depends on the difference. There was a problem that the method and processing method had to be changed.
[0003]
As means for solving this problem, there has been reported a method of managing a recording area of a flash memory using a management method called a FAT (File Allocation Table) file system, which is used for file management on a hard disk device in a conventional information recording apparatus. ing. In this method, the recording area of the flash memory is divided into a plurality of virtual sectors, which are small data storage areas, like a hard disk, and a group of the plurality of virtual sectors is defined as a virtual cluster. The unit of access to the information recording device is this sector. The table that stores the usage status of the cluster is the FAT.
[0004]
The contents of the FAT indicate the use status of the corresponding cluster, and include information such as whether or not the file continues to the next cluster when in use. The size of a sector (sector size) is 512 bytes or the like, and the size of a cluster (cluster size) is 1 kbyte in FAT in MS-DOS, 32 kbytes in FAT16 adopted from MS-DOS 3.0, and Windows (R). ) 95 is 4 kbytes in FAT32. If the cluster size is large, management and access are easy, but if the cluster size is too large, the utilization efficiency of the memory area of the disk device deteriorates.
[0005]
In the FAT disk file system, when writing normal data, FAT cluster information (recording the used / unused state of the cluster as the data storage area) in ascending order of the directory number which is a table for managing files according to logical addresses ), And search for an unused cluster. Next, data is stored in the unused cluster data, and the directory structure and the FAT are updated.
[0006]
FIG. 7 is an explanatory diagram showing a directory structure. FIG. 8 is an explanatory diagram showing the FAT.
The directory structure in FIG. 7 records a file name, an extension indicating the type of the OS in which the file is managed, an attribute indicating the number of bytes and creation date and time, and a FAT entry indicating a start position on the FAT. The FAT of FIG. 8 records cluster information indicating the used / unused state of the data storage area, and information indicating which cluster continues the file of the cluster or continues here.
[0007]
When searching for an unused area when writing data, the corresponding FAT entry is referenced from the directory in FIG. 7 and the cluster information is referenced from the FAT in FIG. As shown in the flowchart of FIG. 9, if the data storage area is unused (that is, cluster information = 0), data is stored in that cluster and the status of the FAT cluster is unused (cluster information = 0). Is rewritten to use (cluster information = 1). Further, the directory structure is rewritten. Here, the rewriting of the directory structure includes a FAT entry (indicating a FAT number) assigned to the directory number, a file name, an extension, and the like.
On the other hand, if the data storage area is in use (cluster information = 1), the above procedure is repeated for the next directory. Here, the search order is performed in ascending order of the directory. Further, the directory number and the FAT entry are fixed.
[0008]
By the way, when the storage area of the flash memory is managed by a file system such as the FAT file system, the memory capacity is processed in units of logical clusters, and files are created in units of logical clusters. Therefore, the file is always stored from the beginning of the cluster. In addition, one cluster includes only one file. Therefore, an unused sector may occur in the cluster. When a part of the cluster is in use, the cluster information becomes 1, and even if an unused sector remains, it cannot be used in the FAT file system.
[0009]
[Problems to be solved by the invention]
As described above, when the flash memory is managed by the file system, unused sectors of the cluster may be generated at the end of the file. It is natural that this unused sector is wasted at all.
The present invention solves this problem in a relatively simple manner, and can effectively utilize unused sectors of partially used clusters while maintaining compatibility with the FAT file system. It is an object to realize an information processing device and a program for executing a method of using a memory.
[0010]
[Means for Solving the Problems]
In order to achieve the above object, the present invention comprises an information storage means, divides a storage area of the information storage means into a plurality of primary divided data storage areas, and divides the primary divided data storage area into a plurality of secondary divided data In an information processing apparatus which divides a storage area and manages the use status of the data storage area with a management table, a primary split data storage area management which manages the usage state of the primary split data storage area with a primary split data storage area management table Means, and secondary division data storage area management means for managing the use status of the secondary division data storage area in a secondary division data storage area management table.
Thus, while maintaining compatibility with the management of the primary divided data storage area by the management table in a relatively simple manner, the storage of unused secondary divided data in the data storage area that is being used on the management table is performed. An information processing device capable of separately managing an area can be realized.
[0011]
Also, in the present invention, the primary divided data storage area management table stores information as to whether or not the secondary divided data storage area is in use in the primary divided data storage area. The table stores the use statuses of all the secondary divided data storage areas in the first primary divided data storage area.
Thus, it is possible to realize an information processing apparatus capable of separately managing the secondary divided data storage area in the primary divided data storage area in use by the secondary divided data storage area management table.
[0012]
Further, the secondary divided data storage area management means of the present invention manages an unused secondary divided data storage area in the primary divided data storage area which is determined to be in use on the primary divided data storage area management table. A secondary divided data storage area management table initializing means for initializing the secondary divided data storage area management table, and an unused part in the primary divided data storage area which is regarded as being used on the primary divided data storage area management table. An unused secondary divided data storage area searching means for searching the secondary divided data storage area and registering it in the secondary divided data storage area management table; and an unused secondary data storage area corresponding to the data length from the secondary divided data storage area management table. A data writing unit for writing data by searching for a secondary divided data storage area; and a data reading unit for reading data written by the data writing unit. Reading means, and secondary divided data storage area releasing means for releasing the secondary divided data storage area registered in the secondary divided data storage area management table when the primary divided data storage area management means starts operating. It is characterized by having.
Thereby, the secondary divided data storage area management which can manage the unused secondary divided data storage area separately from the primary divided data storage area management table, record data in this, and read out the recorded data. Means can be realized.
[0013]
According to the present invention, there is provided a program used in an information processing apparatus for managing an unused secondary divided data storage area in a primary divided data storage area which is determined to be in use on the primary divided data storage area management table. A secondary divided data storage area management table initialization procedure for initializing the next divided data storage area management table; and an unused secondary storage in the primary divided data storage area that is being used on the primary divided data storage area management table. An unused secondary divided data storage area search procedure for retrieving the next divided data storage area and registering it in the secondary divided data storage area management table, and an unused secondary data storage area corresponding to the data length from the secondary divided data storage area management table. A data write procedure for writing data by searching for the next divided data storage area; and reading data written in the data write procedure. Data reading procedure, and releasing the secondary divided data storage area registered in the secondary divided data storage area management table when the primary divided data storage area management means starts operating. And causing the information processing apparatus to execute the steps.
As a result, it is possible to realize a program for an information processing device that can effectively use the unused secondary divided data storage area in the data storage area that is being used on the management table.
[0014]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, an information processing apparatus and a program according to the present invention will be described in detail with reference to the accompanying drawings.
[0015]
FIG. 1 shows a configuration of an information processing apparatus to which the present invention is applied. In FIG. 1, reference numeral 1 denotes a CPU, reference numeral 2 denotes a RAM, reference numeral 3 denotes a ROM, reference numeral 4 denotes a flash memory, reference numeral 5 denotes an I / O interface, and reference numeral 6 denotes a bus. In this configuration, the RAM 2 functions as a main memory of the CPU 1 and a storage function of all management tables and system areas such as the FAT management table 21 and the temporary file management table 22 of the present invention, and the ROM 3 functions as a device driver, a FAT file system control block 31, The flash memory 4 shares storage functions such as a temporary file system control block 32 and a user program, and a storage function such as a data storage area, a system management area, cluster information, and bad block information. It has a function to save
Here, the FAT file system control block 31 is means for controlling the FAT for storing cluster information. The temporary file system control block 32 is means for controlling a temporary file management table for storing sector information. The temporary file system control block 32 has the functions of a temporary file initialization unit 33, a free sector acquisition unit 34, a data writing unit 35, a data reading unit 36, and a sector release unit 37. The correspondence between these and the present invention will be sequentially described in the description of the invention.
[0016]
FIG. 2 illustrates this flash memory file system in a layered structure. 2, reference numeral 11 denotes a CPU, reference numeral 12 denotes a flash memory, reference numeral 13 denotes an address bus, reference numeral 14 denotes a data bus, reference numeral 15 denotes a device driver, reference numeral 16 denotes a file system, reference numeral 17 denotes a temporary file system, and reference numeral 18 denotes a user. It is a program. The hardware area (physical area) includes a CPU 11, a flash memory 12, an address bus 13 and a data bus 14 connecting the CPU 11 and the flash memory 12, and a software area (logical area) includes a user program 18 and a peripheral device. The device driver 15 is a peripheral device management program that mediates with the flash memory 12 (here, the flash memory 12), and has a FAT-configured file system 16 connected thereto, a temporary file system 17 that manages unused sectors, and a user program 18. Have been. The device driver 15, the FAT file system 16, and the temporary file system 17 are stored in the ROM 3 together with the user program 18 and the like.
[0017]
FIG. 3 is an explanatory diagram showing the relationship between clusters and sectors. In this example, it is assumed that one sector is 512 bytes and one cluster is 32 kbytes. Therefore, one cluster is composed of 64 sectors. The cluster corresponds to the primary divided data storage area in the claims, and the sector corresponds to the secondary divided data storage area. FIG. 4 is an explanatory diagram for explaining a method of using a sector in the present invention.
Now, as shown in FIG. 4, it is assumed that 2 kbytes of data is recorded in the cluster of the flash memory in the FAT format. Assuming that a cluster on which data is recorded is a cluster 1, a blank (unused portion) of 32k-2k = 30k bytes is generated in the cluster 1. When this margin is converted into a sector, it becomes 60 sectors.
In order to manage and use such margins, the present invention provides a temporary file system.
[0018]
The operation of the temporary file system will be described with reference to the flowcharts of FIGS. When operating the temporary file system, it is checked whether the FAT is operating. If the FAT is operating in step 101, the process waits. If the FAT is not operating, the process proceeds to step 102. In step 102, the temporary file management means 33 initializes temporary file management information.
In step 103, the empty sector obtaining means 34 obtains cluster information used in the FAT and size information of a file recorded in the cluster based on the FAT management information. Margin information is obtained based on these information. This margin information is determined by searching whether there is an unused sector in the cluster used by the FAT. At this time, the search target of the margin information is limited only to the clusters used in the FAT, and the clusters not used in the FAT are not targeted.
In step 104, the blank information thus obtained is registered by attaching an ID (identification number) to the temporary file management information. The number of pieces of information to be registered is predetermined at the time of initialization by the temporary file initialization means 33.
[0019]
If the data is to be written to the temporary file system in step 105, the data writing means 35 acquires the optimal margin information corresponding to the data size from the temporary file management information in step 106, and is registered as the margin information in step 107. Write to unused sectors. In step 108, the ID is returned to the application that called the data writing means 35, and the margin information of the temporary file management information is corrected.
If it is determined in step 105 that the data is not to be written, the process proceeds to step 109. If the data is read from the temporary file system in step 109, the application passes the ID to the data reading means 36 in step 110. The data reading means 36 searches the sector indicated by the ID from the temporary file management information, reads out the data recorded in the sector in step 111, and returns the data to the application.
During the period in which the temporary file system is used, the following control is performed because it is desirable not to operate the FAT file system. If it is determined in step 109 that data reading is not to be performed, and if the FAT file system is to be operated in step 112, the sector registered in the temporary file management information is deleted using the sector release means 37 in step 113. The file is released, the temporary file system is invalidated in step 114, and the process moves to the FAT file system and ends. The present invention can be variously modified within the scope of the invention. For example, steps 105, 106, 107, 108 and steps 109, 110, 111 can be interchanged.
[0020]
【The invention's effect】
As described above, according to the present invention, a temporary file system is provided separately from the FAT file system to manage the sectors remaining unused in the cluster used by the FAT. By using a simple method, it is possible to effectively use the unused margin area of a partially used cluster while maintaining compatibility with the FAT file system. Can be realized.
[Brief description of the drawings]
FIG. 1 is a diagram showing a configuration of an information processing apparatus to which the present invention is applied.
FIG. 2 is a diagram showing a layer configuration image of a flash memory file system of the present invention.
FIG. 3 is an explanatory diagram showing the relationship between clusters and sectors.
FIG. 4 is an explanatory diagram for explaining a method of using an unused sector in the present invention.
FIG. 5 is a flowchart showing the processing operation of the temporary file system of the present invention.
FIG. 6 is a flowchart showing the processing operation of the temporary file system of the present invention.
FIG. 7 is an explanatory diagram showing a directory structure.
FIG. 8 is an explanatory diagram showing a FAT.
FIG. 9 is an explanatory diagram showing a conventional data writing procedure.
[Explanation of symbols]
1,11 CPU
2 RAM
3 ROM
4, 12 Flash memory 5 I / O interface 6 Bus 13 Address bus 14 Data bus 15 Device driver 16 File system 17 Temporary file system 18 User program 21 FAT management table 22 Temporary file management table 31 FAT file system control block 32 Temporary file system Control block 33 Temporary file initialization means 34 Free sector acquisition means 35 Data writing means 36 Data reading means 37 Sector release means

Claims (4)

情報記憶手段を具備し、
前記情報記憶手段の記憶領域を複数の一次分割データ格納領域に分割し、
前記一次分割データ格納領域を複数の二次分割データ格納領域に分割し、
前記データ格納領域の使用状況を管理テーブルで管理する情報処理装置において、
前記一次分割データ格納領域の使用状況を一次分割データ格納領域管理テーブルで管理する一次分割データ格納領域管理手段と、
前記二次分割データ格納領域の使用状況を二次分割データ格納領域管理テーブルで管理する二次分割データ格納領域管理手段と
を有することを特徴とする情報処理装置。
Comprising information storage means,
Dividing the storage area of the information storage means into a plurality of primary divided data storage areas,
Dividing the primary divided data storage area into a plurality of secondary divided data storage areas,
In an information processing apparatus that manages the use status of the data storage area with a management table,
Primary divided data storage area management means for managing the usage status of the primary divided data storage area in a primary divided data storage area management table,
An information processing apparatus, comprising: a secondary divided data storage area management unit that manages a use state of the secondary divided data storage area in a secondary divided data storage area management table.
請求項1に記載の情報処理装置において、
前記一次分割データ格納領域管理テーブルは前記一次分割データ格納領域に使用中の前記二次分割データ格納領域があるかないかの情報を記憶し、
前記二次分割データ格納領域管理テーブルは、前記第1の一次分割データ格納領域内のすべての二次分割データ格納領域の使用ステータスを記憶することを特徴とする情報処理装置。
The information processing device according to claim 1,
The primary divided data storage area management table stores information on whether or not the secondary divided data storage area is in use in the primary divided data storage area,
The information processing apparatus according to claim 1, wherein the secondary divided data storage area management table stores usage statuses of all the secondary divided data storage areas in the first primary divided data storage area.
前記二次分割データ格納領域管理手段は、
前記一次分割データ格納領域管理テーブル上で使用中とされている一次分割データ格納領域中の未使用二次分割データ格納領域を管理する二次分割データ格納領域管理テーブルを初期化する二次分割データ格納領域管理テーブル初期化手段と、
前記一次分割データ格納領域管理テーブル上で使用中とされている一次分割データ格納領域中の未使用二次分割データ格納領域を検索し前記二次分割データ格納領域管理テーブルに登録する未使用二次分割データ格納領域検索手段と、
前記二次分割データ格納領域管理テーブルからデータ長に応じた未使用二次分割データ格納領域を探してデータを書き込むデータ書き込み手段と、
このデータ書き込み手段が書き込んだデータを読み出すデータ読み出し手段と、
前記一次分割データ格納領域管理手段が動作を開始したとき前記二次分割データ格納領域管理テーブルに登録されている二次分割データ格納領域を解放する二次分割データ格納領域解放手段と
を具備することを特徴とする請求項1に記載の情報処理装置。
The secondary divided data storage area management means,
Secondary divided data for initializing a secondary divided data storage area management table for managing an unused secondary divided data storage area in a primary divided data storage area which is regarded as being used on the primary divided data storage area management table Storage area management table initialization means;
An unused secondary that searches for an unused secondary divided data storage area in the primary divided data storage area that is being used on the primary divided data storage area management table and registers the unused secondary divided data storage area in the secondary divided data storage area management table Division data storage area search means;
Data writing means for writing data by searching for an unused secondary divided data storage area according to the data length from the secondary divided data storage area management table,
Data reading means for reading data written by the data writing means;
Secondary division data storage area release means for releasing the secondary division data storage area registered in the secondary division data storage area management table when the primary division data storage area management means starts operating. The information processing apparatus according to claim 1, wherein:
請求項1の情報処理装置に用いられるプログラムにおいて、
前記一次分割データ格納領域管理テーブル上で使用中とされている一次分割データ格納領域中の未使用二次分割データ格納領域を管理する二次分割データ格納領域管理テーブルを初期化する二次分割データ格納領域管理テーブル初期化手順と、
前記一次分割データ格納領域管理テーブル上で使用中とされている一次分割データ格納領域中の未使用二次分割データ格納領域を検索し前記二次分割データ格納領域管理テーブルに登録する未使用二次分割データ格納領域検索手順と、
前記二次分割データ格納領域管理テーブルからデータ長に応じた未使用二次分割データ格納領域を探してデータを書き込むデータ書き込み手順と、
前記データ書き込み手順で書き込んだデータを読み出すデータ読み出し手順と、
前記一次分割データ格納領域管理手段が動作を開始したとき前記二次分割データ格納領域管理テーブルに登録されている二次分割データ格納領域を解放する二次分割データ格納領域解放手順と
を情報処理装置に実行させることを特徴とするプログラム。
A program used in the information processing apparatus according to claim 1,
Secondary divided data for initializing a secondary divided data storage area management table for managing an unused secondary divided data storage area in a primary divided data storage area which is regarded as being used on the primary divided data storage area management table A storage space management table initialization procedure,
An unused secondary that searches for an unused secondary divided data storage area in the primary divided data storage area that is being used on the primary divided data storage area management table and registers the unused secondary divided data storage area in the secondary divided data storage area management table A divided data storage area search procedure;
A data writing procedure for writing data by searching for an unused secondary divided data storage area according to the data length from the secondary divided data storage area management table,
A data reading procedure for reading data written in the data writing procedure;
A secondary divided data storage area release procedure for releasing the secondary divided data storage area registered in the secondary divided data storage area management table when the primary divided data storage area management means starts operating; A program characterized by being executed by a user.
JP2002195206A 2002-07-03 2002-07-03 Information processor, and program Withdrawn JP2004038595A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002195206A JP2004038595A (en) 2002-07-03 2002-07-03 Information processor, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002195206A JP2004038595A (en) 2002-07-03 2002-07-03 Information processor, and program

Publications (1)

Publication Number Publication Date
JP2004038595A true JP2004038595A (en) 2004-02-05

Family

ID=31703693

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002195206A Withdrawn JP2004038595A (en) 2002-07-03 2002-07-03 Information processor, and program

Country Status (1)

Country Link
JP (1) JP2004038595A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100714691B1 (en) 2005-05-04 2007-05-04 삼성전자주식회사 Apparatus and method for saving and managing additional data of file system
US7603520B2 (en) 2005-04-15 2009-10-13 Sony Corporation Record apparatus, record method, and program for writing data to optical disc in a second unit larger than a first unit

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7603520B2 (en) 2005-04-15 2009-10-13 Sony Corporation Record apparatus, record method, and program for writing data to optical disc in a second unit larger than a first unit
KR100714691B1 (en) 2005-05-04 2007-05-04 삼성전자주식회사 Apparatus and method for saving and managing additional data of file system

Similar Documents

Publication Publication Date Title
JP4238514B2 (en) Data storage device
JP4206688B2 (en) Data processing apparatus and data processing method
KR100951107B1 (en) Method for managing files for optimal performance
US8312554B2 (en) Method of hiding file at data protecting mode for non-volatile memory module, memory controller and portable memory storage apparatus
TWI472916B (en) Method for memory space management
US8589617B2 (en) Write once recording device
JPH11203191A (en) Nonvolatile storage device, control method of nonvolatile storage device and information recording medium recorded with program for controlling nonvolatile storage device
JPWO2005103903A1 (en) Nonvolatile storage system
US8977802B2 (en) Access device, information recording device, controller, real time information recording system, access method, and program
US6272611B1 (en) Computer data storage medium having a virtual disk drive and memory management method therefor
CN101484882A (en) Method for flash-memory management
WO2006098212A1 (en) Memory controller, nonvolatile storage device, nonvolatile storage system and data write method
US9389998B2 (en) Memory formatting method, memory controller, and memory storage apparatus
CN103842962A (en) Method for improving booting of a computing device
CN112882649A (en) Data storage device and non-volatile memory control method
JP4130808B2 (en) Formatting method
TW200832132A (en) Managing file allocation table information
JP4714291B2 (en) Information recording apparatus, information recording method, and information recording program
JP2004038595A (en) Information processor, and program
JP2008262452A (en) Cache method of recording device, and recording device
CN111949212B (en) File system and file management method based on self-defined open channel SSD
JP4599450B2 (en) Electronic device, file system storage area allocation method, and storage area allocation program
JP2004038236A (en) Information processor and program therefor
WO2018186455A1 (en) Available-space management method for nonvolatile memory, access device which stores data to information storage device with nonvolatile memory, information storage device, and information storage system
JP2004038237A (en) Information processor and program therefor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050201

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20070122