JP2009104695A - Recording media control device, recording media control method, and computer program - Google Patents

Recording media control device, recording media control method, and computer program Download PDF

Info

Publication number
JP2009104695A
JP2009104695A JP2007274341A JP2007274341A JP2009104695A JP 2009104695 A JP2009104695 A JP 2009104695A JP 2007274341 A JP2007274341 A JP 2007274341A JP 2007274341 A JP2007274341 A JP 2007274341A JP 2009104695 A JP2009104695 A JP 2009104695A
Authority
JP
Japan
Prior art keywords
file system
area
recording
recording medium
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007274341A
Other languages
Japanese (ja)
Inventor
Ryogo Ito
亮吾 伊藤
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.)
Sony Corp
Original Assignee
Sony 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 Sony Corp filed Critical Sony Corp
Priority to JP2007274341A priority Critical patent/JP2009104695A/en
Publication of JP2009104695A publication Critical patent/JP2009104695A/en
Pending legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To perform efficient format processing to recording media being in a state in which a lot of empty regions exist in a recording region. <P>SOLUTION: A file system issues write-in command monitoring instruction when full-format-processing is completed, and a device driver updates a range of an unrecorded region in accordance with a write-in command execution range processed hereafter. When the next full-format-processing is performed, when write-in destination corresponds to a range of an unrecorded region for a write-in command sent from the file system, the device driver does not transmit the write-in command to recording media, informs completion of write-in to the file system. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、記録メディアの制御を行なう記録メディア制御装置及び記録メディア制御方法、並びにコンピュータ・プログラムに係り、特に、ハード・ディスクのように記録領域のフォーマット処理を行なってから使用が開始される記録メディアの制御を行なう記録メディア制御装置及び記録メディア制御方法、並びにコンピュータ・プログラムに関する。   The present invention relates to a recording medium control apparatus, a recording medium control method, and a computer program for controlling a recording medium, and in particular, a recording that starts to be used after a recording area is formatted like a hard disk. The present invention relates to a recording medium control apparatus, a recording medium control method, and a computer program that control media.

さらに詳しくは、本発明は、データ書き込みが行なわれた後の記録メディアに対して書き込みデータを完全に消去するフォーマット処理を行なう記録メディア制御装置及び記録メディア制御方法、並びにコンピュータ・プログラムに係り、特に、記録領域に空き領域が大量にある状態の記録メディアに対して効率的なフォーマット処理を行なう記録メディア制御装置及び記録メディア制御方法、並びにコンピュータ・プログラムに関する。   More particularly, the present invention relates to a recording medium control apparatus and a recording medium control method for performing a formatting process for completely erasing write data on a recording medium after data writing is performed, and in particular to a computer program. The present invention relates to a recording medium control apparatus, a recording medium control method, and a computer program that perform efficient format processing on a recording medium having a large amount of free space in the recording area.

情報処理や情報通信など情報技術の発達とともに、過去に作成・編集した情報を再利用する必要が生じてきており、このために情報蓄積技術はますます重要となってきている。これまで、磁気テープや磁気ディスクなどさまざまなメディアを利用した情報記録装置が開発され普及している。このうち、ハード・ディスクなどのディスク型の記録メディアは、基本的には、回転するディスクの記録面上で読み書きヘッドが半径方向にシークする動作によって、ランダム・アクセスが可能である。   With the development of information technology such as information processing and information communication, it has become necessary to reuse information created and edited in the past, and information storage technology has become increasingly important for this purpose. Up to now, information recording apparatuses using various media such as magnetic tapes and magnetic disks have been developed and spread. Of these, a disk-type recording medium such as a hard disk can basically be accessed randomly by the read / write head seeking in the radial direction on the recording surface of the rotating disk.

ハード・ディスクは既に広汎に普及している。例えば、パーソナル・コンピュータ用の標準的なローカル記録装置として、コンピュータを起動するために必要なオペレーティング・システム(OS)やアプリケーションなど、さまざまなソフトウェアをインストールしたり、作成・編集したファイルを保存したりするためにハード・ディスクが利用されている。   Hard disks are already widespread. For example, as a standard local recording device for a personal computer, various software such as an operating system (OS) and applications necessary for starting the computer can be installed, and files created and edited can be saved. A hard disk is used to do this.

また、最近では、デジタルビデオカメラのように大容量のデータを扱う情報機器にも、ローカル記録装置、若しくは外付けの記録装置としてハード・ディスクが利用されるようになっている。デジタルビデオカメラは、CCD(Charge Coupled Device)やCMOS(Complementary Metal Oxide Semiconductor)などの固体撮像素子により被写体を撮影した画像データをデジタル・データとして処理するが、近年のデジタル処理の高速化と大容量化に伴って広範に普及している。デジタルビデオカメラの記録機器にハード・ディスクを用いる場合、多数の高画質画像データのデジタル記録や、記録データへのランダム・アクセスが可能であり、また、コンピュータにUSB(Universal Serial Bus)接続してファイル操作したりコンピュータ上で画像編集を行なったりすることができる。また、記録メディアの着脱機構を必要としないため、着脱可能な磁気テープや光ディスクを用いる場合に比べて、装置の重量や体積、コストを小さくすることが可能である。加えて、記録メディアの大きさや着脱部のレイアウトに制限されないので、より小型なデジタルビデオカメラを実現でき、デザインの自由度が高くなる(例えば、特許文献1、特許文献2を参照のこと)。   Recently, a hard disk has been used as a local recording device or an external recording device in an information device that handles a large amount of data such as a digital video camera. A digital video camera processes image data obtained by photographing a subject with a solid-state imaging device such as a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) as a digital data. It has become widespread with the development. When a hard disk is used as a recording device for a digital video camera, digital recording of a large number of high-quality image data and random access to the recording data are possible, and a USB (Universal Serial Bus) is connected to the computer. You can manipulate files and edit images on your computer. Further, since a recording medium attaching / detaching mechanism is not required, the weight, volume, and cost of the apparatus can be reduced as compared with the case of using a detachable magnetic tape or optical disk. In addition, since it is not limited by the size of the recording medium or the layout of the detachable part, a smaller digital video camera can be realized and the degree of design freedom is increased (for example, refer to Patent Document 1 and Patent Document 2).

通常、ハード・ディスクの記録空間は、FAT(File Allocation Table)などのファイルシステムによって管理される。デジタルビデオカメラ上では、静止画像、動画像、音声といった各種データは、ファイルシステムを介してファイルとしてハード・ディスクに記録される。例えば、デジタルビデオカメラなどの記録装置において、ファイルシステムの管理対象外の記録領域を有効活用して、ファイルを記録するための記録領域を減少させることなく所定のデータを記録する方法について提案されている(例えば、特許文献3を参照のこと)。   Usually, the recording space of a hard disk is managed by a file system such as FAT (File Allocation Table). On a digital video camera, various data such as still images, moving images, and sounds are recorded as files on a hard disk via a file system. For example, in a recording apparatus such as a digital video camera, there has been proposed a method for recording predetermined data without effectively reducing a recording area for recording a file by effectively using a recording area that is not managed by the file system. (For example, see Patent Document 3).

ところで、ハード・ディスクなどの記録メディアを使用する際には、記録領域をファイルシステムに応じたファイル・フォーマットに整える処理、すなわちフォーマット処理が必要である。例えばFAT方式でフォーマットされた記録メディアの記録領域は、セクタと称される所定容量(例えば、512バイト)毎の区画に分割され、各セクタにはセクタ・アドレスが付与される。セクタは区画の最小単位であるが、実際には複数のセクタをまとめたクラスタを単位にしてデータの記録・再生を行なうことが多い。   By the way, when a recording medium such as a hard disk is used, processing for arranging the recording area into a file format corresponding to the file system, that is, formatting processing is required. For example, a recording area of a recording medium formatted by the FAT method is divided into sections each having a predetermined capacity (for example, 512 bytes) called a sector, and a sector address is given to each sector. A sector is the minimum unit of a partition, but in practice, data is often recorded / reproduced in units of a cluster of a plurality of sectors.

1つの記録メディアは1又は2以上のパーティションからなる。フォーマット処理の対象範囲はパーティションを単位として指定される。フォーマット処理は、概略的には、パーティション全体に所定の値(例えば、0×FF)からなるデータを書き込んで以前のデータを潰す処理と、その後にファイルシステムの管理情報をパーティション内の所定の場所に作成する処理からなる。   One recording medium consists of one or more partitions. The target range for formatting is specified in units of partitions. The format process is roughly a process of writing data consisting of a predetermined value (for example, 0 × FF) to the entire partition and crushing the previous data, and then transferring the file system management information to a predetermined location in the partition. It consists of processing to create.

このうち、前段の所定データ書き込み処理は、記録メディアの大容量化に伴って所要時間が増大するという問題がある。例えば、30GBのハード・ディスク(パーティション)の場合の所要時間が30分であるとすると、60GBの場合は60分前後になるといった具合に、所要時間はメディアの容量に比例して増えていく。とりわけ、空き容量がまだ大量にあるパーティションをフォーマットする場合、未使用領域に同じデータを書き込んでデータを消去するという無駄な処理を繰り返しながら長い所要時間を要することになる。また、フォーマット処理は基本的にはメディアへのデータ書き込み処理からなることから、所要時間を要することは消費電力の増大を意味し、特にデジタルビデオカメラのようなバッテリ駆動の機器にとっては負担が大きく、看過し難い。   Among these, the predetermined data writing process in the previous stage has a problem that the required time increases as the capacity of the recording medium increases. For example, if the required time in the case of a 30 GB hard disk (partition) is 30 minutes, the required time increases in proportion to the capacity of the media, such as about 60 minutes in the case of 60 GB. In particular, when formatting a partition that still has a large amount of free space, a long time is required while repeating the useless process of writing the same data in the unused area and erasing the data. In addition, since the format process basically consists of data writing to the media, the time required means increased power consumption, especially for battery-powered devices such as digital video cameras. It ’s hard to overlook.

ファイルシステムの管理情報のみを消去して初期状態に戻すことによって、所要時間の短縮化を図ったフォーマット処理も知られており、利用に供されている。パーティション全体を初期化する処理は「フルフォーマット」と呼ばれ、ファイルシステムの管理情報のみ消去を行なう簡易な処理は「クイックフォーマット」と呼ばれる。   A format process for shortening the required time by deleting only the management information of the file system and returning it to the initial state is also known and used. The process of initializing the entire partition is called “full format”, and the simple process of deleting only the management information of the file system is called “quick format”.

例えば、デジタルカメラに未フォーマットのメモリカードが装着された状態でシャッタが押下されたときに、メモリカードにクイックフォーマットを行なってから、JPEG形式で圧縮された画像データをメモリカードに書き込むデジタルカメラについて提案がなされている(例えば、特許文献4を参照のこと)。   For example, a digital camera that performs quick formatting on a memory card and then writes image data compressed in JPEG format to the memory card when the shutter is pressed with an unformatted memory card attached to the digital camera. Proposals have been made (see, for example, Patent Document 4).

しかしながら、クイックフォーマットでは、データを完全に消去することはできない。すなわち、既にデータの書き込み処理が行なわれた後の記録メディアに対してクイックフォーマットを行なった場合には、データ領域のデータは残ったままであることから、専用ソフトなどを用いて見かけ上は消えたはずのデータを復活させることができるので、セキュリティ上の問題がある。また、フルフォーマットでは、データ書き込みの際にメディア上の不良個所のチェックを行ない、以後は不良箇所へのデータ書き込み行なわないようにして、不良個所に記録したファイルが後から開けないといったトラブルを回避することができるが、クイックフォーマットでは不良個所のチェックが省かれる。   However, the quick format cannot completely erase the data. In other words, when a quick format is performed on a recording medium that has already been subjected to data writing processing, the data in the data area remains, so that it apparently disappears using dedicated software. There is a security problem because the data that should have been restored. In the full format, check the defective part on the media when writing data, and avoid writing data to the defective part afterwards to avoid the trouble that the file recorded in the defective part cannot be opened later. However, the quick format eliminates the check of defective parts.

特開平8−140027号公報JP-A-8-140027 特開平9−168109号公報JP 9-168109 A 特開2005−339628号公報JP 2005-339628 A 特開平11−146246号公報JP-A-11-146246

本発明の目的は、ハード・ディスクのように記録領域のフォーマット処理を行なってから使用が開始される記録メディアの制御を好適に行なうことができる、優れた記録メディア制御装置及び記録メディア制御方法、並びにコンピュータ・プログラムを提供することにある。   An object of the present invention is to provide an excellent recording medium control device and recording medium control method capable of suitably controlling a recording medium that is used after formatting processing of a recording area like a hard disk, And providing a computer program.

本発明のさらなる目的は、データ書き込みが行なわれた後の記録メディアに対して書き込みデータを完全に消去するフォーマット処理を好適に行なうことができる、優れた記録メディア制御装置及び記録メディア制御方法、並びにコンピュータ・プログラムを提供することにある。   A further object of the present invention is to provide an excellent recording medium control device and recording medium control method capable of suitably performing a formatting process for completely erasing write data on a recording medium after data writing has been performed, and To provide a computer program.

本発明のさらなる目的は、記録領域に空き領域が大量にある状態の記録メディアに対して効率的なフォーマット処理を行なうことができる、優れた記録メディア制御装置及び記録メディア制御方法、並びにコンピュータ・プログラムを提供することにある。   A further object of the present invention is to provide an excellent recording medium control device, recording medium control method, and computer program capable of performing efficient format processing on a recording medium having a large amount of free space in the recording area. Is to provide.

本発明は、上記課題を参酌してなされたものであり、その第1の側面は、記録領域にファイルシステムに応じたフォーマット処理を行なってから使用が開始される記録メディアの制御を行なう記録メディア制御装置であって、
前記記録領域のうち、前回フルフォーマット処理を実行してから今回フルフォーマット処理を実行するまでの間に書き込みが実行されていない未書き込み領域の範囲を把握する未書き込み領域管理手段と、
未書き込み領域の範囲を除外して、前記記録領域に所定の値を書き込んでデータの消去を行なうデータ消去手段と、
前記記録領域の所定の場所にファイルシステムの管理情報を作成する管理情報作成手段と、
を具備することを特徴とする記録メディア制御装置である。
The present invention has been made in consideration of the above-mentioned problems, and a first aspect of the present invention is a recording medium that controls a recording medium that is used after a formatting process corresponding to a file system is performed on the recording area. A control device,
Of the recording area, an unwritten area management means for grasping a range of an unwritten area in which writing is not performed between the previous full format process and the current full format process;
A data erasing means for erasing data by writing a predetermined value in the recording area, excluding the range of the unwritten area;
Management information creation means for creating file system management information at a predetermined location in the recording area;
A recording medium control apparatus comprising:

ハード・ディスクなどのランダム・アクセスが可能な記録メディアが広範に普及し、パーソナル・コンピュータなどの計算機システムや、デジタルビデオカメラなどの情報機器に利用されている。この種の記録メディアの記録空間はファイルシステムによって管理され、ファイルシステムは各種のデータをファイルとして保存する。   Randomly accessible recording media such as hard disks are widely used and used in computer systems such as personal computers and information equipment such as digital video cameras. The recording space of this type of recording medium is managed by a file system, and the file system stores various data as files.

ハード・ディスクなどの記録メディアを使用する際にはフォーマット処理が必要である。ここで、データ領域をすべて未使用の状態にするフルフォーマットを行なう場合には、フォーマット対象となるパーティション全体に所定の値(例えば、0×FF)からなるデータを書き込んで以前のデータを潰す処理を含むため、記録メディアの大容量化に伴って所要時間が増大するという問題がある。   Formatting is required when using a recording medium such as a hard disk. Here, in the case of performing a full format in which all data areas are unused, a process of writing data consisting of a predetermined value (for example, 0 × FF) to the entire partition to be formatted and crushing the previous data Therefore, there is a problem that the required time increases as the capacity of the recording medium increases.

これに対し、本発明に係る記録メディア制御装置は、前回フルフォーマット処理を実行してから今回フルフォーマット処理を実行するまでの間に書き込みが実行されていない範囲を把握しておき、今回のフルフォーマットを行なうときには、書き込みが実行されていない範囲をフルフォーマット処理対象範囲から除外するようになっている。   In contrast, the recording media control apparatus according to the present invention grasps the range in which writing has not been performed between the previous full format process and the current full format process, and the current full format process. When formatting is performed, a range in which writing has not been executed is excluded from the full format processing target range.

したがって、本発明によれば、一旦フルフォーマットした記録メディアにデータの書き込みを行なった後に再びフルフォーマットを行なう際には、データ領域のうち未使用領域に対して所定値を書き込んでデータを消去するという無駄な処理が省略されるので、フルフォーマット処理全体の処理を短縮することができる。   Therefore, according to the present invention, when data is written on a once-formatted recording medium and then full-formatted again, a predetermined value is written to an unused area in the data area and the data is erased. Since this wasteful process is omitted, the entire full format process can be shortened.

例えば、デジタルビデオカメラなどでハード・ディスクのフルフォーマットを行なってから動画や静止画などのファイルを記録したが空き容量がまだ大量にある状態で再びフルフォーマット処理するという操作が行なわれた場合、再びのフルフォーマット処理の所要時間を空き容量サイズに応じて短縮することができる。   For example, if a file such as a movie or still image was recorded after a hard disk was fully formatted with a digital video camera, etc., but the full format process was performed again when there was still a large amount of free space, The time required for the full format process again can be shortened according to the free capacity size.

デジタルビデオカメラなどの情報機器、あるいはパーソナル・コンピュータなどの計算機システムでは、ファイルシステムが記録メディアの記録空間を管理し、各種データをファイルとして扱う。また、ファイルシステムは、ハード・ディスクなど記録メディア毎のデバイス・ドライバを通じてデータの書き込みや読み出しを行なう。   In an information device such as a digital video camera or a computer system such as a personal computer, a file system manages a recording space of a recording medium and handles various data as files. The file system writes and reads data through a device driver for each recording medium such as a hard disk.

したがって、デバイス・ドライバは、未書き込み領域管理手段として機能して、前回フルフォーマット処理を実行してから今回フルフォーマット処理を実行するまでの間に書き込みが実行されていない未書き込み領域の範囲を把握することができる。   Therefore, the device driver functions as an unwritten area management means, and grasps the range of unwritten areas that have not been written between the previous full format process and the current full format process. can do.

ファイルシステムは、フルフォーマット処理を行なう際に、デバイス・ドライバに対して書き込みコマンド監視指示を発行する。これに対し、デバイス・ドライバは、フルフォーマット処理した以降に処理した記録メディアへの書き込みコマンド実行範囲に応じて、未書き込み領域の範囲を更新していく。   The file system issues a write command monitoring instruction to the device driver when performing full format processing. On the other hand, the device driver updates the range of the unwritten area according to the execution range of the write command to the recording medium processed after the full format processing.

このような場合、次回のフルフォーマット処理時に、デバイス・ドライバは、ファイルシステムから届く(データ消去のための)書き込みコマンドに対して、書き込み先が未書き込み領域の範囲に該当するときには記録メディアへ書き込みコマンドを送信せずに、ファイルシステムへ書き込み完了を通知する。すなわち、デバイス・ドライバは、未書き込み領域の範囲では実際の(データ消去のための)書き込みを行なわず、ファイルシステムに対しては書き込みを行なったかのようにフェイクする。ファイルシステム側では、パーティション全体でデータ消去が行なわれたものと認識する。   In such a case, during the next full format process, the device driver writes to the recording medium when the write destination falls within the unwritten area range in response to a write command (for erasing data) received from the file system. Notifies the file system of completion of writing without sending a command. In other words, the device driver does not perform actual writing (for erasing data) in the range of the unwritten area, and fakes the file system as if it had been written. The file system recognizes that the entire partition has been erased.

あるいは、次回のフルフォーマット処理時に、ファイルシステムは、デバイス・ドライバから未書き込み領域の範囲の情報を取得し、その情報に基づいて、フルフォーマット処理においてデータ書き込み処理を実行する範囲を狭めるようにしてもよい。   Alternatively, during the next full format process, the file system acquires information on the range of the unwritten area from the device driver, and based on this information, narrows the range for executing the data write process in the full format process. Also good.

いずれの場合であっても、前回フルフォーマット処理した以降の未書き込み領域の範囲では所定の値を書き込んでデータを消去するという無駄な書き込み処理が省略されるので、フルフォーマット処理の所要時間を短縮することができる。   In any case, the time required for full format processing is shortened because unnecessary write processing of erasing data by writing a predetermined value in the range of the unwritten area after the previous full format processing is omitted. can do.

また、本発明の第2の側面は、記録領域にファイルシステムに応じたフォーマット処理した後に使用が開始される記録メディアの制御を行なうための処理をコンピュータ上で実行するようにコンピュータ可読形式で記述されたコンピュータ・プログラムであって、前記コンピュータを、
前記記録領域のうち、前回フルフォーマット処理を実行してから今回フルフォーマット処理を実行するまでの間に書き込みが実行されていない未書き込み領域の範囲を把握する未書き込み領域管理手段と、
未書き込み領域の範囲を除外して、前記記録領域に所定の値を書き込んでデータの消去を行なうデータ消去手段と、
前記記録領域の所定の場所にファイルシステムの管理情報を作成する管理情報作成手段と、
として機能させるためのコンピュータ・プログラムである。
Also, the second aspect of the present invention is described in a computer-readable format so that a process for controlling a recording medium to be used after a format process corresponding to a file system is performed in a recording area is executed on a computer. Computer program, wherein the computer is
Of the recording area, an unwritten area management means for grasping a range of an unwritten area in which writing is not performed between the previous full format process and the current full format process;
A data erasing means for erasing data by writing a predetermined value in the recording area, excluding the range of the unwritten area;
Management information creation means for creating file system management information at a predetermined location in the recording area;
It is a computer program for making it function as.

本発明の第2の側面に係るコンピュータ・プログラムは、コンピュータ上で所定の処理を実現するようにコンピュータ可読形式で記述されたコンピュータ・プログラムを定義したものである。換言すれば、本発明の第2の側面に係るコンピュータ・プログラムをコンピュータにインストールすることによって、コンピュータ上では協働的作用が発揮され、本発明の第1の側面に係る記録メディア制御装置と同様の作用効果を得ることができる。   The computer program according to the second aspect of the present invention defines a computer program described in a computer-readable format so as to realize predetermined processing on the computer. In other words, by installing the computer program according to the second aspect of the present invention on the computer, a cooperative action is exhibited on the computer, and is the same as the recording medium control apparatus according to the first aspect of the present invention. The effect of this can be obtained.

本発明によれば、ハード・ディスクのように記録領域のフォーマット処理を行なってから使用が開始される記録メディアの制御を好適に行なうことができる、優れた記録メディア制御装置及び記録メディア制御方法、並びにコンピュータ・プログラムを提供することができる。   According to the present invention, an excellent recording medium control device and recording medium control method capable of suitably controlling a recording medium that is used after a recording area is formatted like a hard disk, In addition, a computer program can be provided.

また、本発明によれば、データ書き込みが行なわれた後の記録メディアに対して書き込みデータを完全に消去するフォーマット処理を好適に行なうことができる、優れた記録メディア制御装置及び記録メディア制御方法、並びにコンピュータ・プログラムを提供することができる。   In addition, according to the present invention, an excellent recording medium control apparatus and recording medium control method capable of suitably performing a format process for completely erasing write data on a recording medium after data writing has been performed, In addition, a computer program can be provided.

また、本発明によれば、記録領域に空き領域が大量にある状態の記録メディアに対して効率的なフォーマット処理を行なうことができる、優れた記録メディア制御装置及び記録メディア制御方法、並びにコンピュータ・プログラムを提供することができる。   In addition, according to the present invention, an excellent recording medium control device and recording medium control method capable of performing efficient format processing on a recording medium having a large amount of free space in the recording area, and a computer A program can be provided.

本発明に係る記録メディア制御装置は、前回フルフォーマット処理を実行してから今回フルフォーマット処理を実行するまでの間に書き込みが実行されていない範囲を把握しておき、今回のフルフォーマットを行なうときには、書き込みが実行されていない範囲をデータ書き込み処理の対象範囲から除外するようになっているので、フルフォーマット処理全体の処理を短縮することができる。   The recording media control device according to the present invention grasps a range in which writing is not performed between the previous full format process and the current full format process, and when performing the current full format. Since the range in which writing has not been performed is excluded from the target range of data writing processing, the entire processing of the full format processing can be shortened.

本発明のさらに他の目的、特徴や利点は、後述する本発明の実施形態や添付する図面に基づくより詳細な説明によって明らかになるであろう。   Other objects, features, and advantages of the present invention will become apparent from more detailed description based on embodiments of the present invention described later and the accompanying drawings.

以下、図面を参照しながら本発明の実施形態について詳解する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

図1には、本発明を適用した記録メディア制御装置として動作することができる装置の一例として、デジタルビデオカメラの構成を模式的に示している。   FIG. 1 schematically shows the configuration of a digital video camera as an example of an apparatus that can operate as a recording media control apparatus to which the present invention is applied.

図示のデジタルビデオカメラ100は、光学レンズ部111と、光電変換部112、カメラ機能制御部102と、画像信号処理部113と、画像入出力部114と、液晶ディスプレイ115と、音声入出力部116と、音声信号処理部117と、通信部131と、制御部101と、内蔵メモリ(RAM)118と、内蔵メモリ(ROM)119と、操作入力部120と、記録メディアに対するドライブ132と、GPS(Global Positioning System)や加速度センサなどのセンサ150と、上記の各構成部に対する電力供給を行なう電源141を備えている。   The illustrated digital video camera 100 includes an optical lens unit 111, a photoelectric conversion unit 112, a camera function control unit 102, an image signal processing unit 113, an image input / output unit 114, a liquid crystal display 115, and an audio input / output unit 116. An audio signal processing unit 117, a communication unit 131, a control unit 101, a built-in memory (RAM) 118, a built-in memory (ROM) 119, an operation input unit 120, a drive 132 for a recording medium, a GPS ( A sensor 150 such as a global positioning system or an acceleration sensor, and a power supply 141 that supplies power to each of the components described above are provided.

制御部101は、CPU(Central Processing Unit)などで構成されるが、ROM(read Only Memory)119に格納された各種の処理プログラムに従って処理を実行する。RAM(Random Access Memory)118は、各処理において途中結果を一時記録するなど、主に作業領域として用いられる。   The control unit 101 is configured by a CPU (Central Processing Unit) or the like, but executes processing according to various processing programs stored in a ROM (read Only Memory) 119. A RAM (Random Access Memory) 118 is mainly used as a work area, such as temporarily recording intermediate results in each process.

操作入力部120は、動画撮影モード、静止画撮影モード、VTRモードなどの動作モードを切り換えるモード切り換えキー、静止画の撮影のためのシャッターキー、動画を撮影するための撮影開始キー、録画キー、再生キー、停止キー、早送りキー、早戻しキーなどの種々の操作キーや機能キーなどを備え、ユーザからの操作入力を受け付けて、受け付けた操作入力に応じた電気信号を制御部101に供給する。   The operation input unit 120 includes a mode switching key for switching operation modes such as a moving image shooting mode, a still image shooting mode, and a VTR mode, a shutter key for shooting a still image, a shooting start key for shooting a movie, a recording key, Various operation keys and function keys such as a play key, a stop key, a fast-forward key, and a fast-rewind key are provided, and an operation input from the user is received and an electric signal corresponding to the received operation input is supplied to the control unit 101 .

制御部101は、ユーザからの操作入力に応じて、目的とする処理を行なうためのプログラムをROM119から読み出して実行し、各部を制御することによって、ユーザからの指示に応じた処理の制御を行なう。デジタルビデオカメラ100は、磁気ディスク、光ディスク、光磁気ディスク、半導体メモリなどの各種の記録メディアを装着可能であり、これらの記録メディアに対してドライブ132を介して各種の情報を記録し、また、これらの記録メディアに記録された情報を再生する。ここで言う磁気ディスクには、いわゆるハード・ディスクが含まれる。ハード・ディスクの記録領域はFATなどのファイルシステムによって管理されており、アプリケーションやオペレーティング・システムなどの上位層プログラムはファイルシステムを介してハード・ディスク内の記録領域にアクセスすることができる。また、ハード・ディスクは専用のデバイス・ドライバによって駆動制御され、ファイルシステムはデバイス・ドライバに対し書き込みコマンドや読み出しコマンドなどのホスト・コマンドを発行する。   In response to an operation input from the user, the control unit 101 reads out and executes a program for performing a target process from the ROM 119, and controls each unit to control the process according to an instruction from the user. . The digital video camera 100 can be mounted with various recording media such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., and records various information on these recording media via the drive 132, Information recorded on these recording media is reproduced. The magnetic disk mentioned here includes a so-called hard disk. The recording area of the hard disk is managed by a file system such as FAT, and an upper layer program such as an application or operating system can access the recording area in the hard disk via the file system. The hard disk is driven and controlled by a dedicated device driver, and the file system issues host commands such as a write command and a read command to the device driver.

デジタルビデオカメラ100は、画像を撮像して得た画像データを、ドライブ132を介して磁気ディスク、光ディスク、光磁気ディスク、半導体メモリなどの各種記録メディアに記録する「撮像モード」と、画像入出力部114や音声入出力部116あるいは通信部131を通じて供給を受けたデータを記録メディアに記録したり、記録メディアに記録されているデータを再生したりする「VTRモード」を備えている。   The digital video camera 100 records image data obtained by capturing an image on various recording media such as a magnetic disk, an optical disk, a magneto-optical disk, and a semiconductor memory via a drive 132, and image input / output. It is provided with a “VTR mode” for recording data supplied through the recording unit 114, the voice input / output unit 116, or the communication unit 131 on a recording medium and reproducing data recorded on the recording medium.

撮像モード下では、動画を撮像するとともに、これと同時に収音するようにした音声とを記録メディアに記録する動画撮像モードと、静止画を撮像する静止画撮像モードとを備えている。また、VTRモード下では、記録ボタン・スイッチなどによって構成される操作入力部120を操作することによって供給されるデータの記録が行なわれ、また、再生ボタン・スイッチを操作することにより記録メディアに記録されている目的とするデータを再生することができる。   Under the image capturing mode, a moving image capturing mode for capturing a moving image and simultaneously recording a sound that is picked up on a recording medium and a still image capturing mode for capturing a still image are provided. In the VTR mode, the supplied data is recorded by operating the operation input unit 120 including a recording button / switch, and the recording is performed on the recording medium by operating the playback button / switch. The target data can be reproduced.

また、図2には、本発明を適用した記録メディア制御装置として動作することができる装置の他の例として、パーソナル・コンピュータの構成を模式的に示している。   FIG. 2 schematically shows the configuration of a personal computer as another example of an apparatus that can operate as a recording media control apparatus to which the present invention is applied.

CPI201は、オペレーティング・システム(OS)が提供するプログラム実行環境下で、ROM201やハード・ディスク・ドライブ211に格納されているプログラムを実行する。   The CPI 201 executes a program stored in the ROM 201 or the hard disk drive 211 under a program execution environment provided by an operating system (OS).

ROM(Read Only Memory)202は、POST(Power On Self Test)やBIOS(Basic Input Output SYstem)などのプログラム・コードを恒久的に格納する。RAM203は、ROM202やHDD211に格納されているプログラムをCPU201が実行する際にロードしたり、実行中のプログラムの作業データを一時的に保持したりするために使用される。これらはCPU201のローカル・ピンに直結されたローカル・バス204により相互に接続されている。   A ROM (Read Only Memory) 202 permanently stores program codes such as POST (Power On Self Test) and BIOS (Basic Input Output System). The RAM 203 is used to load a program stored in the ROM 202 or the HDD 211 when the CPU 201 executes it, or to temporarily hold work data of the program being executed. These are connected to each other by a local bus 204 directly connected to a local pin of the CPU 201.

ローカル・バス204は、ブリッジ205を介して、PCI(Peripheral Component Interconnect)バスなどの入出力バス206に接続されている。   The local bus 204 is connected to an input / output bus 206 such as a PCI (Peripheral Component Interconnect) bus via a bridge 205.

キーボード208と、マウスなどのポインティング・デバイス209は、ユーザにより操作される入力デバイスである。ディスプレイ210は、LCD(Liquid Crystal Display)又はCRT(Cathode Ray Tube)などから成り、各種情報をテキストやイメージで表示する。   A keyboard 208 and a pointing device 209 such as a mouse are input devices operated by a user. The display 210 includes an LCD (Liquid Crystal Display) or a CRT (Cathode Ray Tube), and displays various types of information as text and images.

HDD211は、記録メディアとしてのハード・ディスクを内蔵し、ハード・ディスクを駆動する。ハード・ディスクには、オペレーティング・システムや各種アプリケーションなどCPU210が実行するプログラムをインストールしたり、動画像や静止画像などのメディア・ファイルや、データ・ファイルなど、各種のローカル・ファイルを保存したりするために使用される。ハード・ディスクの記録領域はFATなどのファイルシステムによって管理されており、アプリケーションやオペレーティング・システムなどの上位層プログラムはファイルシステムを介してハード・ディスク内の記録領域にアクセスすることができる。また、ハード・ディスクは専用のデバイス・ドライバによって駆動制御され、ファイルシステムはデバイス・ドライバに対し書き込みコマンドや読み出しコマンドなどのホスト・コマンドを発行する。   The HDD 211 has a built-in hard disk as a recording medium and drives the hard disk. The hard disk installs programs executed by the CPU 210 such as an operating system and various applications, and stores various local files such as media files such as moving images and still images, and data files. Used for. The recording area of the hard disk is managed by a file system such as FAT, and an upper layer program such as an application or operating system can access the recording area in the hard disk via the file system. The hard disk is driven and controlled by a dedicated device driver, and the file system issues host commands such as a write command and a read command to the device driver.

ドライブ212は、装着されている磁気ディスク、光ディスク、光磁気ディスク、又は半導体メモリなどのリムーバブル記録メディア221に記録されているデータ又はプログラムを読み出して、入出力インターフェース207、入出力バス206、ブリッジ205、及びローカル・バス204を介して接続されているRAM503に供給する。   The drive 212 reads data or a program recorded on a removable recording medium 221 such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, and inputs / outputs an input / output interface 207, an input / output bus 206, and a bridge 205. , And the RAM 503 connected via the local bus 204.

接続ポート214は、外部接続機器222を接続するポートであり、USBやIEEE1394などの接続インターフェースを持つ。接続ポート214は、インターフェース207、及び入出力バス206、ブリッジ205、ローカル・バス204を介してCPU201に接続されている。通信部215は、ネットワークに接続され、その他の情報処理装置(図示しない)との通信を実行する。   The connection port 214 is a port for connecting the external connection device 222, and has a connection interface such as USB or IEEE1394. The connection port 214 is connected to the CPU 201 via the interface 207, the input / output bus 206, the bridge 205, and the local bus 204. The communication unit 215 is connected to a network and executes communication with other information processing apparatuses (not shown).

上述したデジタルビデオカメラ100やパーソナル・コンピュータ200などの情報機器において、ハード・ディスクなどの記録メディアに対してデータの記録を行なう場合、FATなどのファイルシステムを適用した処理によって、データはファイルとして扱われる。この種のファイルシステムは、記録メディアに対して記録される各ファイルについての記録位置情報、記録位置連鎖情報といったファイルシステムの管理情報を管理する。ファイルシステムによる記録メディアの管理方法について以下に説明しておく。   In the information apparatus such as the digital video camera 100 and the personal computer 200 described above, when data is recorded on a recording medium such as a hard disk, the data is handled as a file by processing using a file system such as FAT. Is called. This type of file system manages file system management information such as recording position information and recording position chain information for each file recorded on the recording medium. A recording medium management method using the file system will be described below.

ハード・ディスクなどの記録メディアを1以上のパーティションに区切り、指定したパーティションに対してフォーマット処理を施すことによって、そのパーティションはファイルシステムに組み込まれる。ファイルシステムは、記録メディア上のファイルを管理するための仕組み、すなわち、ユーザが論理的に扱うファイルやディレクトリを実際の物理的なディスク上に対応させ、ファイルやディレクトリ自体を構成する体系であり、ディレクトリ・エントリとFATという情報を管理する。   By dividing a recording medium such as a hard disk into one or more partitions and subjecting the designated partition to a formatting process, the partition is incorporated into the file system. The file system is a system for managing files on a recording medium, that is, a system that configures files and directories themselves by associating files and directories that are logically handled by users with actual physical disks. Manages directory entries and FAT information.

FATには、例えばFAT16やFAT32が挙げられる。図3A及び図3Bには、ハード・ディスクにパーティションを1つ設け、FAT16及びFAT32でフォーマットした場合のデータ構造をそれぞれ示している。   Examples of the FAT include FAT16 and FAT32. FIGS. 3A and 3B show data structures when one partition is provided on the hard disk and formatted by FAT16 and FAT32.

FAT16のデータ構造は、図3Aに示すように、先頭セクタ(LBA=0)にマスタ・ブート・レコード(MBR)が記録され、以降はパーティション毎に、パーティション・ブート・レコード(PBR)、ファイル・アロケーション・テーブル1(FAT1)、ファイル・アロケーション・テーブル2(FAT2)が記録され、さらにルート・ディレクトリ・エントリ、並びにデータ領域が続く。データ領域は複数のクラスタに区画される。   As shown in FIG. 3A, the FAT 16 has a data structure in which a master boot record (MBR) is recorded in the first sector (LBA = 0), and thereafter, a partition boot record (PBR), a file Allocation table 1 (FAT1) and file allocation table 2 (FAT2) are recorded, followed by a root directory entry and a data area. The data area is partitioned into a plurality of clusters.

また、FAT32のデータ構造は、図3Bに示すように、先頭セクタ(LBA=0)にマスタ・ブート・レコード(MBR)が記録され、以降はパーティション毎に、パーティション・ブート・レコード(PBR)、ファイルシステム情報(FSinfo)、ファイル・アロケーション・テーブル1(FAT1)、ファイル・アロケーション・テーブル2(FAT2)が記録され、その後はデータ領域が続く。データ領域は複数のクラスタに区画される。   Further, as shown in FIG. 3B, the data structure of FAT32 is that a master boot record (MBR) is recorded in the first sector (LBA = 0), and thereafter, a partition boot record (PBR), File system information (FSinfo), file allocation table 1 (FAT1), and file allocation table 2 (FAT2) are recorded, followed by a data area. The data area is partitioned into a plurality of clusters.

なお、FAT16/32の詳細については、例えば、“Microsoft Extensible Firmware Initiative FAT32 File System Specification”を参照されたい。   For details of the FAT16 / 32, refer to, for example, “Microsoft Extensible Firmware Initial FAT32 File System Specification”.

図4Aには、マスタ・ブート・レコードの構成を模式的に示している。図示のように、マスタ・ブート・レコードは、起動情報と、パーティション情報、すなわち、各パーティションの開始アドレスとサイズ情報を含むパーティション・テーブルを保持している。図3には、ハード・ディスク内にパーティションを1つだけ設けた場合のFAT16並びにFAT32のそれぞれのデータ構造を示したが、ハード・ディスクなどの記録メディアを複数のパーティションに区切って管理することが可能である。記録メディアを複数のパーティションに区切った場合、図4Aに示すように、パーティション毎のパーティション・テーブルが設定される。   FIG. 4A schematically shows the configuration of the master boot record. As shown in the figure, the master boot record holds startup information and partition information, that is, a partition table including the start address and size information of each partition. FIG. 3 shows the data structure of FAT16 and FAT32 when only one partition is provided in the hard disk. However, it is possible to manage a recording medium such as a hard disk by dividing it into a plurality of partitions. Is possible. When the recording medium is divided into a plurality of partitions, a partition table for each partition is set as shown in FIG. 4A.

起動時には、まず、マスタ・ブート・レコードの起動コード領域から起動コード(プログラム)が読み出される。読み出されたマスタ・ブート・レコードの起動コードは、図4Aに示す起動コードの直後に形成されるパーティション・テーブル領域のパーティション・テーブルを参照し、目的とするパーティションのブート・セクタの情報を読み出し、このブート・セクタのコード(プログラム)によって、オペレーティング・システム(OS)が起動される。   At startup, first, an activation code (program) is read from the activation code area of the master boot record. For the activation code of the read master boot record, the partition table of the partition table area formed immediately after the activation code shown in FIG. 4A is referred to, and information on the boot sector of the target partition is read. The operating system (OS) is started by the code (program) of the boot sector.

マスタ・ブート・レコード内には複数個のパーティション・テーブル(図示の例では4個)を設けることができる。各パーティション・テーブルは、上述したように、例えばハード・ディスクの記録領域を分割して形成される各パーティション領域の位置(開始アドレス)と大きさ(パーティション・サイズ)を示す情報を保持する。なお、パーティション・テーブル領域に続く2バイト(0E,0F)には、パーティション・テーブルに対する署名が付与される。   A plurality of partition tables (four in the illustrated example) can be provided in the master boot record. As described above, each partition table holds information indicating the position (start address) and size (partition size) of each partition area formed by dividing the recording area of the hard disk, for example. A signature for the partition table is added to 2 bytes (0E, 0F) following the partition table area.

図4Bには、16バイト(128ビット)データ長からなるパーティション・テーブルのデータ構造を示している。0バイト目から7バイト目までの8バイト分のエリアがCHS(Cylinder/Head/Sector)方式でアドレスを指定する場合に用いる情報の格納エリアであり、8バイト目から15バイト目までの8バイト分のエリアがLBA(Logical Block Addressing:論理ブロック・アドレス)方式でアドレスを指定する場合に用いる情報の格納エリアである。   FIG. 4B shows a data structure of a partition table having a data length of 16 bytes (128 bits). The 8-byte area from the 0th byte to the 7th byte is an information storage area used when an address is specified by the CHS (Cylinder / Head / Sector) method. The 8th byte from the 8th byte to the 15th byte The minute area is an information storage area used when an address is designated by the LBA (Logical Block Addressing) method.

ここで、CHS方式では、シリンダ(Cylinder)、ヘッド(Head)、セクタ(Sector)の3つのパラメータを1組として用いて、記録メディア(ハード・ディスク)上のアドレス(位置)を指定する。また、LBA方式は、ハード・ディスクの記録領域上のアクセス可能な各単位ブロック(例えば、1セクタ単位)について、例えば0番から順番に数字(ブロック・アドレス(論理アドレス))を割り当てておき、その数字を指定することにより、ハード・ディスクの記録領域上のアドレス(位置)を指定する。   Here, in the CHS system, an address (position) on a recording medium (hard disk) is designated using three parameters of a cylinder (Cylinder), a head (Head), and a sector (Sector) as one set. In the LBA method, numbers (block addresses (logical addresses)) are assigned in order from 0, for example, for each accessible unit block (for example, one sector unit) on the recording area of the hard disk. By specifying the number, an address (position) on the recording area of the hard disk is specified.

パーティション・テーブルのうちCHS方式でアクセスする場合に用いる情報の格納エリアは、図4Bに示すように、0バイト目がアクティブフラグ情報(以下、単に「フラグ情報」という)の格納エリア、1バイト目から3バイト目までの3バイト分がCHS方式でアクセスする場合に用いる開始セクタ情報の格納アリア、4バイト目がパーティション・タイプ情報(以下、単に「タイプ情報」という)の格納エリア、5バイト目から7バイト目までの3バイト分がCHS方式でアクセスする場合に用いる終了セクタ情報の格納エリアである。   As shown in FIG. 4B, the storage area for information used when accessing the CHS system in the partition table is the storage area for active flag information (hereinafter simply referred to as “flag information”), the first byte, as shown in FIG. 4B. Storage area for starting sector information used when 3 bytes from the first to the third byte are accessed by the CHS method, the fourth byte is a storage area for partition type information (hereinafter simply referred to as “type information”), the fifth byte 3 bytes from the first to the seventh byte are storage areas for the end sector information used when accessing by the CHS method.

また、パーティション・テーブルのうちLBA方式でアクセスする場合に用いる情報の格納エリアは、図4Bに示すように、8バイト目から11バイト目までの4バイト分がLBA方式で用いられる開始セクタ情報の格納エリア、12バイト目から15バイト目までの4バイト分がLBA方式で用いられるパーティション・サイズの格納エリアである。   In addition, as shown in FIG. 4B, the storage area of the information used for accessing the partition table by the LBA method includes 4 bytes from the 8th byte to the 11th byte of the start sector information used by the LBA method. Storage area, 4 bytes from the 12th byte to the 15th byte are a partition size storage area used in the LBA method.

なお、CHS方式は、ハード・ディスクの物理的構造をそのまま流用したアドレス指定方式であり、シリンダ、ヘッド、セクタというアドレス指定のためのパラメータが3つあることから、ソフトウェア的な処理が複雑である。これに対し、LBA方式は、ブロック・アドレスという単一のパラメータで指定するので、アクセス時のアドレス指定が極めて簡単である。現在、ハード・ディスクのアドレス指定方式としてはLBA方式が主流であり、例えばメモリカードなどのリムーバブル・メディアやその他の記録メディアにも広く適用されている。但し、本発明の要旨は特定のアドレス指定方式に限定されるものではなく、CHS方式又はLBA方式のいずれのアドレス指定方式を採用する記録メディアにも本発明を適用することができる。   Note that the CHS method is an addressing method that uses the physical structure of a hard disk as it is, and has three parameters for addressing, ie, cylinder, head, and sector, so that software processing is complicated. . On the other hand, since the LBA method is designated by a single parameter called a block address, address designation at the time of access is very simple. Currently, the LBA method is the mainstream as a hard disk addressing method, and it is widely applied to removable media such as memory cards and other recording media. However, the gist of the present invention is not limited to a specific addressing system, and the present invention can also be applied to a recording medium that employs any addressing system such as a CHS system or an LBA system.

ファイルシステムは、ファイルやディレクトリ自体を構成する体系であり、ディレクトリ・エントリとFATによって管理される(前述)。ファイルはクラスタを単位として構成されているが、クラスタの記録メディア上の物理的な位置はファイル毎に常に連続している訳ではない。FATは、ファイルを構成するクラスタ同士のつながりを管理するためのテーブルであり、FATの各エントリは記録メディアの各クラスタと1対1に対応している。また、ファイルの開始クラスタはディレクトリ・エントリに記録され、その次のクラスタを指しているのは最初のクラスタに対応するFATの次のエントリの内容である。   The file system is a system that constitutes a file or directory itself, and is managed by a directory entry and a FAT (described above). Although the file is configured in units of clusters, the physical position of the cluster on the recording medium is not always continuous for each file. The FAT is a table for managing the connection between clusters constituting a file, and each entry of the FAT has a one-to-one correspondence with each cluster of the recording medium. The start cluster of the file is recorded in the directory entry, and the next cluster is the content of the next entry of the FAT corresponding to the first cluster.

記録メディア内のパーティション内にファイルが記録されたとき、ファイル名や記録日時といったファイルの詳細情報を管理するためのディレクトリ・エントリが形成される。図5には、記録メディアに記録される各ファイルに設定されるディレクトリ・エントリの情報構造を模式的に示している。   When a file is recorded in a partition in the recording medium, a directory entry for managing detailed information of the file such as a file name and recording date / time is formed. FIG. 5 schematically shows the information structure of the directory entry set in each file recorded on the recording medium.

図示のように、各ファイルに対応するディレクトリ・エントリは、ファイル名欄、拡張名欄、属性欄、予約欄、作成時刻欄、作成日欄、最終アクセス日付欄、先頭クラスタ番号の指示情報(High)欄、記録時刻欄、記録日付欄、先頭クラスタ番号の指示情報(Low)欄、ファイル・サイズ欄を備え、それぞれ対応する情報、すなわち、ファイル名、拡張名、属性、作成時刻、作成日、最終アクセス日付、先頭クラスタ番号(High)、記録時刻、記録日付、先頭クラスタ番号(Low)、ファイル・サイズを格納する。このディレクトリ・エントリの情報を用いることにより、ファイル名によって特定されるファイルは、(1)どのような属性のものであり、(2)開始クラスタはどこで、(3)どの位の大きさのファイルであり、(4)いつ作成され、(5)最終アクセスはいつで、(6)データの記録はいつ行なわれたかなどを管理することができる。   As shown in the figure, the directory entry corresponding to each file includes a file name field, an extended name field, an attribute field, a reservation field, a creation time field, a creation date field, a last access date field, and head cluster number indication information (High). ) Field, recording time field, recording date field, head cluster number indication information (Low) field, and file size field, respectively corresponding information, that is, file name, extended name, attribute, creation time, creation date, The last access date, the leading cluster number (High), the recording time, the recording date, the leading cluster number (Low), and the file size are stored. By using this directory entry information, the file specified by the file name is (1) what attribute it is, (2) where the starting cluster is, and (3) how big the file is It is possible to manage (4) when it was created, (5) when it was last accessed, (6) when data was recorded, and so on.

先頭クラスタ番号は、パーティションをクラスタ単位に区画したデータ領域の内の何番目のクラスタから当該ファイルのデータの記録が行なわれたかを示すものであり、ディレクトリ・エントリ内では、図5に示すように、先頭クラスタ番号を上位側(high側)の2バイトと下位側(Low側)の2バイトとに分けて管理される。   The head cluster number indicates the number of clusters in the data area obtained by partitioning the partition into cluster units, and the data of the file is recorded in the directory entry as shown in FIG. The leading cluster number is managed by dividing it into 2 bytes on the upper side (high side) and 2 bytes on the lower side (Low side).

クラスタは、FATがパーティション内のデータ領域を管理できる最小単位であり、1ファイル当たりの最小記録単位に相当する。1つのクラスタは、記録メディアの最小単位であるセクタ(ハード・ディスクの場合、セクタ・サイズ=512バイト)をn個(n=1,2,4,・・・64,128)集めた構成になる。セクタはファイルを管理する単位としては小さ過ぎるので、複数のセクタをまとめたクラスタという単位を用いることによって、ファイルの管理が容易となる。クラスタの具体的な大きさは、例えば、FAT16の場合には32キロバイト、FAT32の場合には4キロバイトである。   The cluster is the smallest unit in which the FAT can manage the data area in the partition, and corresponds to the smallest recording unit per file. One cluster has a configuration in which n (n = 1, 2, 4,... 64, 128) of sectors (sector size = 512 bytes in the case of a hard disk), which are the minimum units of recording media, are collected. Become. Since a sector is too small as a unit for managing a file, management of a file is facilitated by using a unit called a cluster in which a plurality of sectors are collected. The specific size of the cluster is, for example, 32 kilobytes for FAT16 and 4 kilobytes for FAT32.

FATのデータ構造には、マスタ・ブート・レコード(図4Aを参照のこと)に続いて、パーティションに対応する起動コードを含むパーティション・ブート・レコード(PBR)が設定され、その後、ファイル・アロケーション・テーブル1(FAT1)と、ファイル・アロケーション・テーブル2(FAT2)が格納される(図3を参照のこと)。ファイル・アロケーション・テーブル2(FAT2)は、ファイル・アロケーション・テーブル1(FAT1)のコピーであり、予備データとして利用される。   In the FAT data structure, a master boot record (see FIG. 4A) is followed by a partition boot record (PBR) including an activation code corresponding to the partition, and then a file allocation record. Table 1 (FAT1) and file allocation table 2 (FAT2) are stored (see FIG. 3). The file allocation table 2 (FAT2) is a copy of the file allocation table 1 (FAT1) and is used as spare data.

ファイル・アロケーション・テーブル(FAT)は、記録メディアに対して記録されるデータ・ファイル各々についての記録位置情報、記録位置連鎖情報を管理するテーブルである。図6には、ファイル・アロケーション・テーブルのデータ構成例を示している。各ファイルの構成データは、1つ以上のクラスタに分散されて記録メディアに記録される。ファイル・アロケーション・テーブル(FAT)は、各ファイルの構成データを格納したクラスタのクラスタ番号の連鎖情報を格納している。同図中の2重線で示す項目は、インデックスであり、データ・エントリとして、以下のクラスタ番号を示している。なお、同図に示すテーブルでは[0×]を省略しているが、上記[0×]は後続の8桁の0〜Fの数値で示されるクラスタ番号が16進数表記であることを示している。   The file allocation table (FAT) is a table for managing recording position information and recording position chain information for each data file recorded on the recording medium. FIG. 6 shows a data configuration example of the file allocation table. The configuration data of each file is distributed to one or more clusters and recorded on a recording medium. The file allocation table (FAT) stores chain information of cluster numbers of clusters that store configuration data of each file. The items indicated by double lines in the figure are indexes, and the following cluster numbers are indicated as data entries. [0x] is omitted in the table shown in the figure, but the above [0x] indicates that the cluster number indicated by the subsequent 8-digit number 0 to F is in hexadecimal notation. Yes.

[0×00000000]〜[0×0000000F]
[0×00000010]〜[0×0000010F]
[0×00000020]〜[0×0000020F]
[0×00000030]〜[0×0000030F]
[0x00000000] to [0x0000000F]
[0x00000010] to [0x0000010F]
[0x00000020] to [0x000020F]
[0x00000030] to [0x00000030F]

各ファイルの構成データを格納したクラスタ番号の位置に、ファイル構成データの次のデータを格納したクラスタ番号が記録され、最終クラスタ番号の位置にはEOF(エンドオブファイル)を示すコード[0×0FFFFFFF]が記録される。先頭クラスタ番号は、各ファイルのディレクトリ・エントリ(図5を参照のこと)に記録されている(前述)。   The cluster number storing the next data of the file configuration data is recorded at the position of the cluster number storing the configuration data of each file, and the code [0 × 0FFFFFFF] indicating EOF (end of file) is stored at the position of the final cluster number Is recorded. The head cluster number is recorded in the directory entry (see FIG. 5) of each file (described above).

例えば、ディレクトリ・エントリに記録された第1のファイルの先頭クラスタ番号を0×00000007とし、第2のファイルの先頭クラスタ番号を0×0000000Aとし、第3のファイルの先頭クラスタ番号を0×0000001Bとし、第4のファイルの先頭クラスタ番号を0×0000002Cとする。   For example, the first cluster number recorded in the directory entry is 0 × 00000007, the second file first cluster number is 0 × 0000000000A, and the third file first cluster number is 0 × 0000001B. The first cluster number of the fourth file is set to 0 × 0000002C.

第1ファイルの先頭クラスタ番号は、[0×00000007]であるので、まず、クラスタ番号[0×00000007]のクラスタを読み取ることで、第1ファイルの最初のデータが取得できる。第1ファイルの次の構成データの記録されたクラスタ番号は、図6に示すFATのクラスタ番号[0×00000007]の位置の記録情報に基づいて知ることができる。図6に示すFATのクラスタ番号[0×00000007]の位置にはクラスタ番号[0×00000008]が記録され、第1ファイルの次の構成データの記録されたクラスタ番号は[0×00000008]であることが判明し、クラスタ番号[0×00000008]のクラスタからデータを読み取ることができる。   Since the first cluster number of the first file is [0 × 00000007], the first data of the first file can be acquired by first reading the cluster with the cluster number [0 × 00000007]. The cluster number in which the next configuration data of the first file is recorded can be known based on the recording information at the position of the FAT cluster number [0 × 00000007] shown in FIG. The cluster number [0 × 00000008] is recorded at the position of the FAT cluster number [0 × 00000007] shown in FIG. 6, and the cluster number in which the next configuration data of the first file is recorded is [0 × 00000008]. As a result, data can be read from the cluster having the cluster number [0 × 00000008].

さらに、第1ファイルの次の構成データの記録されたクラスタ番号は、図6に示すFATのクラスタ番号[0×00000008]の位置に記録されている。図6に示すFATのクラスタ番号[0×00000008]の位置にはクラスタ番号[0×00000009]が記録され、第1ファイルの次の構成データの記録されたクラスタ番号は[0×00000009]であることが判明し、クラスタ番号[0×00000009]のクラスタからデータを読み取ることができる。さらに、次の構成データの記録されたクラスタ番号を取得するため、FATのクラスタ番号[0×00000009の位置の記録情報を参照すると、EOF(エンドオブファイル)の対応コード[0×0FFFFFFF]が記録されており、後続データはないことが判明する。   Furthermore, the cluster number in which the next configuration data of the first file is recorded is recorded at the position of the FAT cluster number [0 × 00000008] shown in FIG. The cluster number [0 × 00000009] is recorded at the position of the FAT cluster number [0 × 00000008] shown in FIG. 6, and the cluster number in which the next configuration data of the first file is recorded is [0 × 00000009]. The data can be read from the cluster having the cluster number [0 × 00000009]. Further, in order to obtain the cluster number in which the next configuration data is recorded, referring to the recording information in the FAT cluster number [0 × 00000009], the corresponding code [0 × 0FFFFFFF] of EOF (end of file) is recorded. And no subsequent data is found.

結果として、第1のファイルは、クラスタ番号:[0×00000007]→[0×00000008]→[0×00000009]によって指定されるクラスタに格納されていることが判明する。   As a result, it is found that the first file is stored in the cluster specified by the cluster number: [0 × 00000007] → [0 × 00000008] → [0 × 00000009].

同様に、第2のファイルはクラスタ番号:[0×0000000A]→[0×0000001F]→[0×0000025]→[0×00000031]→[0×00000030]によって指定されるクラスタに格納され、第3のファイルはクラスタ番号:[0×000001B]→[0×0000011]→[0×0000012]→[0×0000013]→[0×0000014]→[0×0000003]によって指定されるクラスタに格納され、第4のファイルはクラスタ番号:[0×000002C]→[0×000002D]→[0×000002E]→[0×000002F]→[0×0000038]→[0×0000039]→[0×000003A]→[0×000003B]によって指定されるクラスタに格納されていることが判明し、これらのクラスタからデータを取得することが可能となる。   Similarly, the second file is stored in the cluster specified by the cluster number: [0x0000000A] → [0x0000001F] → [0x00000025] → [0x00000031] → [0x00000030]. The file No. 3 is stored in the cluster specified by the cluster number: [0 × 000001B] → [0 × 0000011] → [0 × 0000012] → [0 × 0000013] → [0 × 0000013] → [0 × 000003]. The fourth file has a cluster number: [0 × 000002C] → [0 × 000002D] → [0 × 000002E] → [0 × 000002F] → [0 × 00000038] → [0 × 00000039] → [0 × 000003A] → It is stored in the cluster specified by [0x000003B] Known, it is possible to acquire data from these clusters.

なお、図6に示したFATは、FAT32に対応するデータ構成例である。FAT32では、EOF(エンドオブファイル)の対応コードは[0×0FFFFFFF]であるが、FAT16では、EOF(エンドオブファイル)の対応コードは[0×FFFF]である。EOF(エンドオブファイル)の対応コードを検出することで、ファイル構成データが終了することを判別することができる。   The FAT shown in FIG. 6 is a data configuration example corresponding to the FAT32. In FAT32, the EOF (end of file) corresponding code is [0 × 0FFFFFFF], while in FAT16, the EOF (end of file) corresponding code is [0 × FFFF]. By detecting a corresponding code of EOF (end of file), it can be determined that the file configuration data ends.

上述したように、記録メディアに記録される各ファイルは、以下の3要素を有し、これらが記録メディア上に記録され、ディレクトリ・エントリとFATに基づいて各ファイルの構成クラスタを識別して、データを読み取ることができる。
(a)ファイル名や作成日時、ファイル・サイズなどを保持する「ディレクトリ・エントリ」
(b)クラスタの連鎖情報を保持する「FAT」
(c)クラスタ単位で記録されている「データ(ファイルの実体)」
As described above, each file recorded on the recording medium has the following three elements, which are recorded on the recording medium, identifying the constituent cluster of each file based on the directory entry and FAT, Data can be read.
(A) "Directory entry" that holds file name, creation date and time, file size, etc.
(B) “FAT” that holds cluster chain information
(C) “Data (substance of file)” recorded in cluster units

続いて、デジタルビデオカメラ100やパーソナル・コンピュータ200などの情報機器からハード・ディスクなどの記録メディアに対しデータの記録並びに再生を行なうための動作について説明する。   Next, an operation for recording and reproducing data on a recording medium such as a hard disk from an information device such as the digital video camera 100 or the personal computer 200 will be described.

既に述べたように、記録メディアの記録空間を管理するファイルシステムは、ハード・ディスクなど記録メディア毎のデバイス・ドライバに対して書き込みコマンドや読み出しコマンドを発行することで、データの書き込みや読み出しを行なう。図7には、記録メディアにアクセスしてデータの記録並びに再生を行なうための処理階層を模式的に示している。   As described above, the file system that manages the recording space of the recording medium writes and reads data by issuing a write command and a read command to a device driver for each recording medium such as a hard disk. . FIG. 7 schematically shows a processing hierarchy for accessing a recording medium and recording and reproducing data.

最上位層のアプリケーション・プログラムは、ユーザからの処理要求を受け付けるとともに処理結果を返すユーザ・インターフェースとなる。アプリケーション・プログラムの直近下層には記録メディア上のファイルを管理するファイル管理プログラムとしてのファイルシステムが存在する。さらにその下層のデバイス・ドライバは、ファイルシステムからの情報に基づいて、記録メディアを制御する。   The uppermost layer application program serves as a user interface that accepts a processing request from a user and returns a processing result. A file system as a file management program for managing files on a recording medium exists immediately below the application program. Further, the underlying device driver controls the recording medium based on information from the file system.

アプリケーションとファイルシステム間では、ファイルを単位としてアクセス要求及び応答がなされる。また、ファイルシステムとデバイス・ドライバ間では、クラスタを単位としてアクセス要求及び応答がなされる。また、デバイス・ドライバと記録メディア間では、セクタを単位としてアクセス要求及び応答がなされる。アプリケーション、ファイルシステム、並びにデバイス・ドライバは、制御部101やCPU201で実行するソフトウェア・プログラムである。   Between the application and the file system, access requests and responses are made in units of files. Also, between the file system and the device driver, access requests and responses are made in units of clusters. Further, an access request and a response are made in units of sectors between the device driver and the recording medium. The application, file system, and device driver are software programs executed by the control unit 101 and the CPU 201.

記録メディアに対してデータを記録し、又は記録メディアからデータを再生する場合、例えばアプリケーション・プログラムを介する要求がファイルシステム、デバイス・ドライバの順に伝えられ、ファイルシステム並びにデバイス・ドライバの機能によりデータの書き込み又は再生が実行される。   When recording data on a recording medium or reproducing data from a recording medium, for example, a request via an application program is transmitted in the order of the file system and the device driver, and the data of the data is recorded by the function of the file system and the device driver. Writing or playback is performed.

図8には、図7に示した処理階層のうちファイルシステムをさらに詳細にして示している。図示の例では、2つの記録メディアA341及び記録メディアB342が装備されており、デバイス・ドライバ330としてそれぞれに対応するデバイス・ドライバA332及びデバイス・ドライバB333がインストールされている。   FIG. 8 shows the file system in more detail in the processing hierarchy shown in FIG. In the illustrated example, two recording media A 341 and recording media B 342 are provided, and a device driver A 332 and a device driver B 333 corresponding to each are installed as the device driver 330.

アプリケーション310、ファイルシステム320、及びデバイス・ドライバ330は、それぞれの処理に必要なプログラムやパラメータの格納、データ処理におけるワーク領域としてRAM350を利用する。   The application 310, the file system 320, and the device driver 330 use the RAM 350 as a work area for storing programs and parameters necessary for respective processes and for data processing.

アプリケーション310には、各記録メディアに対するデータ記録処理を実行する記録アプリケーション311や、各記録メディアに記録されたデータの再生処理を実行する再生アプリケーション312、接続機器による処理を実行するUSB接続アプリケーション313など、処理に応じたアプリケーションが含まれる。ユーザはこれらのアプリケーション311〜313を選択してさまざまな処理を実行することになる。記録アプリケーション311並びに再生アプリケーション312はファイルシステム経由でデバイス・ドライバ330にアクセスし、USB接続アプリケーション313はデバイス・ドライバ330に直接アクセスするものとする。   The application 310 includes a recording application 311 that executes data recording processing on each recording medium, a playback application 312 that executes playback processing of data recorded on each recording medium, a USB connection application 313 that executes processing by a connected device, and the like. , Application according to the process is included. The user selects these applications 311 to 313 and executes various processes. It is assumed that the recording application 311 and the reproduction application 312 access the device driver 330 via the file system, and the USB connection application 313 directly accesses the device driver 330.

ファイルシステム320は、記録メディアの種別やフォーマット情報などを含む各記憶メディア対応のマウントドライブ情報321、322を保持し、これらマウントドライブ情報に従って、ハード・ディスクなどの記録メディアを適用したデータ記録並びに再生制御を実行する。ファイルシステム320は、データ記録再生制御を実行する記録再生制御部323と、メディア制御を実行するメディア制御部324を有する。記録再生制御部323の実行する処理はメディア非依存型のメディア共通の処理であり、メディア制御部324の実行する処理はメディア依存型の処理である。   The file system 320 holds mount drive information 321 and 322 corresponding to each storage medium including the type and format information of the recording medium, and data recording and reproduction using a recording medium such as a hard disk according to the mount drive information. Execute control. The file system 320 includes a recording / playback control unit 323 that executes data recording / playback control, and a media control unit 324 that executes media control. The processing executed by the recording / playback control unit 323 is a media-independent type common media processing, and the processing executed by the media control unit 324 is a media-dependent type processing.

記録再生制御部323は、ファイル・アロケーション・テーブル(FAT)の記録や参照処理を実行するFAT制御部323Aと、データ記録位置情報としてのクラスタの決定処理やクラスタ番号に基づく再生位置決定処理を実行するクラスタ制御部323Bと、ファイルに対応する情報を格納したディレクトリ・エントリ(図5を参照のこと)を生成し、又は参照する処理を実行するディレクトリ・エントリ制御部324Cを有する。ディレクトリ・エントリ制御部324Cは、アプリケーション301からの記憶手段やファイル指定情報に基づいて特定のファイルに対応するディレクトリ・エントリを取得し、例えばファイル再生の場合は、ディレクトリ・エントリから先頭クラスタ番号を取得し、クラスタ制御部324Bに提供する。   The recording / playback control unit 323 executes a FAT control unit 323A that performs file allocation table (FAT) recording and reference processing, cluster determination processing as data recording position information, and playback position determination processing based on the cluster number. And a directory entry control unit 324C that executes a process for generating or referring to a directory entry (see FIG. 5) that stores information corresponding to a file. The directory entry control unit 324C obtains a directory entry corresponding to a specific file based on storage means and file designation information from the application 301. For example, in the case of file reproduction, obtains a head cluster number from the directory entry. And provided to the cluster control unit 324B.

メディア制御部324は、位置算出部324Aとアクセス制御部324Bを有する。位置算出部324Aは、クラスタ制御部322が決定するクラスタ情報やFATのクラスタ連鎖情報に基づいて、クラスタ番号によってデータ記録又はデータ再生を実行する記録メディア上のアクセス位置を決定する。また、アクセス制御部324Bは、位置算出部324Aによって決定された位置情報に従ってデバイス・ドライバ330を制御し、デバイス・ドライバ330を介して記録メディアに対するデータ記録、又は当該記録メディアからのデータ再生を実行する。   The media control unit 324 includes a position calculation unit 324A and an access control unit 324B. Based on the cluster information determined by the cluster control unit 322 and the FAT cluster chain information, the position calculation unit 324A determines the access position on the recording medium on which data recording or data reproduction is performed based on the cluster number. In addition, the access control unit 324B controls the device driver 330 according to the position information determined by the position calculation unit 324A, and performs data recording on the recording medium or data reproduction from the recording medium via the device driver 330. To do.

ファイルシステム320内のアクセス制御部324Bは、デバイス・ドライバ330内のアクセス制御部331と協働して、アプリケーション310(但し、USB接続アプリケーション312を除く)において実行されるアプリケーションに応じたアクセス制御を行なう。   The access control unit 324B in the file system 320 cooperates with the access control unit 331 in the device driver 330 to perform access control according to the application executed in the application 310 (except for the USB connection application 312). Do.

「背景技術」の欄でも既に述べたように、ハード・ディスクなどほとんどの記録メディアは、使用を開始する際にはフォーマット処理が必要である。従来、フォーマット処理には、パーティション全体を初期化する処理は「フルフォーマット」と、ファイルシステムの管理情報のみ消去を行なう簡易な処理は「クイックフォーマット」が挙げられる。いずれのフォーマット処理も、ファイルシステムの主導により、該当する記録メディア駆動用のデバイス・ドライバを介して行なわれる。   As already described in the “Background Art” section, most recording media such as hard disks need to be formatted when they are used. Conventionally, the format process includes “full format” as the process for initializing the entire partition, and “quick format” as the simple process for deleting only the management information of the file system. Any format processing is performed through the corresponding device driver for driving the recording medium under the initiative of the file system.

図9には、従来のフルフォーマット処理の手順をフローチャートの形式で示している。このフォーマット処理は、例えば、ファイルシステムが上位アプリケーションからの要求に応じて起動する。   FIG. 9 shows a procedure of a conventional full format process in the form of a flowchart. For example, the file system is activated in response to a request from an upper application.

ファイルシステムは、まず、フォーマット処理の対象となるパーティション全体にわたって所定の値(例えば、0×FF)からなるデータを書き込んで、以前のデータを消去する(ステップS1)。   The file system first writes data having a predetermined value (for example, 0 × FF) over the entire partition to be formatted, and erases the previous data (step S1).

図10に示すように、論理ブロック・アドレスがXから始まるA個の論理ブロック・アドレスからなるパーティションがフォーマット処理の対象であるとき、X〜X+A−1の論理ブロック・アドレスの範囲に値0×FFが順次書き込まれる。   As shown in FIG. 10, when a partition consisting of A logical block addresses whose logical block addresses start with X is the target of formatting, the value 0 × is in the logical block address range of X to X + A−1. FFs are written sequentially.

このデータ書き込みは、実際には、デバイス・ドライバに対してクラスタ毎のデータ書き込みコマンドを順次発行することで実施される。そして、デバイス・ドライバからは、各々のデータ書き込みコマンドの実行結果(エラー発生の有無など)が返される。   This data writing is actually performed by sequentially issuing a data write command for each cluster to the device driver. The device driver returns the execution result of each data write command (whether or not an error has occurred).

次いで、ファイルシステムは、デバイス・ドライバからの戻り値を基に、データ書き込みのエラーが発生したか否かをチェックする(ステップS2)。ここで、エラーが発生したときには(ステップS2のYes)、要求元に対してフルフォーマット処理の失敗を通知して(ステップS6)、本処理ルーチンを終了する。   Next, the file system checks whether a data write error has occurred based on the return value from the device driver (step S2). Here, when an error occurs (Yes in step S2), the request source is notified of the failure of the full format process (step S6), and this processing routine is terminated.

一方、エラーが発生しなかったときには(ステップS2のNo)、ファイルシステムは、続いて、クイックフォーマットと同様のファイルシステムの管理情報をパーティション内の所定の場所に作成するという、クイックフォーマットと同様の処理を実施する(ステップS3)。クイックフォーマット処理の手順は後述並びに図11を参照されたい。   On the other hand, when no error has occurred (No in step S2), the file system subsequently creates file system management information similar to the quick format in a predetermined location in the partition, similar to the quick format. Processing is performed (step S3). Refer to FIG. 11 for the procedure of the quick format process.

続いて、ファイルシステムは、クイックフォーマット処理に対するデバイス・ドライバからの戻り値を基に、クイックフォーマットに相当する処理においてエラーが発生したか否かをチェックする(ステップS4)。   Subsequently, the file system checks whether an error has occurred in the process corresponding to the quick format based on the return value from the device driver for the quick format process (step S4).

ここで、エラーが発生したときには(ステップS4のYes)、要求元に対してフルフォーマット処理の失敗を通知する(ステップS6)。また、エラーが発生しなかったときには(ステップS4のNo)、要求元に対してフルフォーマット処理が成功裏に終了したことを通知して(ステップS5)、本処理ルーチンを終了する。   Here, when an error occurs (Yes in step S4), the request source is notified of the failure of the full format process (step S6). If no error has occurred (No in step S4), the request source is notified that the full format process has been completed successfully (step S5), and the process routine ends.

また、図11には、クイックフォーマット処理の手順をフローチャートの形式で示している。このフォーマット処理は、図9に示したフローチャートのステップS3として実施される。あるいは、例えば、上位アプリケーションからの要求に応じて起動する。   FIG. 11 shows a procedure of quick format processing in the form of a flowchart. This formatting process is performed as step S3 of the flowchart shown in FIG. Alternatively, for example, it is activated in response to a request from a higher-level application.

ファイルシステムは、ルート・ディレクトリ・エントリに該当するクラスタを0クリアする(ステップS11)。   The file system clears the cluster corresponding to the root directory entry to 0 (step S11).

このデータ書き込みは、実際には、デバイス・ドライバに対してクラスタ毎のデータ書き込みコマンドを順次発行することで実施される。そして、デバイス・ドライバからは、各々のデータ書き込みコマンドの実行結果(エラー発生の有無など)が返される。   This data writing is actually performed by sequentially issuing a data write command for each cluster to the device driver. The device driver returns the execution result of each data write command (whether or not an error has occurred).

次いで、ファイルシステムは、デバイス・ドライバからの戻り値を基に、データ書き込みのエラーが発生したか否かをチェックする(ステップS12)。ここで、エラーが発生したときには(ステップS12のYes)、要求元に対してフルフォーマット処理の失敗を通知して(ステップS18)、本処理ルーチンを終了する。   Next, the file system checks whether a data write error has occurred based on the return value from the device driver (step S12). Here, when an error occurs (Yes in step S12), the request source is notified of the failure of the full format process (step S18), and this processing routine ends.

一方、エラーが発生しなかったときには(ステップS12のNo)、ファイルシステムは、続いて、パーティション・ブート・レコード(PBR)並びにFSInfoなどの管理情報をパーティション内の所定の場所に作成する(ステップS13)。この処理は、デバイス・ドライバに対してデータ書き込みコマンドを発行することによって実施される。   On the other hand, when no error has occurred (No in step S12), the file system subsequently creates management information such as a partition boot record (PBR) and FSInfo in a predetermined location in the partition (step S13). ). This process is performed by issuing a data write command to the device driver.

続いて、ファイルシステムは、デバイス・ドライバからの戻り値を基に、PBR並びにFSInfoなどの管理情報の書き込み処理においてエラーが発生したか否かをチェックする(ステップS14)。   Subsequently, the file system checks whether an error has occurred in the processing for writing management information such as PBR and FSInfo, based on the return value from the device driver (step S14).

ここで、エラーが発生したときには(ステップS14のYes)、要求元に対してフルフォーマット処理(若しくはクイックフォーマット処理)の失敗を通知して(ステップS16)、本処理ルーチン全体を終了する。   Here, when an error occurs (Yes in step S14), the requester is notified of the failure of the full format process (or quick format process) (step S16), and the entire processing routine is terminated.

一方、エラーが発生しなかったときには(ステップS14のNo)、ファイルシステムは、さらにFAT1及びFAT2を初期状態(すなわち未使用状態)に戻す処理を行なう(ステップS15)。この処理は、デバイス・ドライバに対してデータ書き込みコマンドを発行することによって実施され、各々のデータ書き込みコマンドの実行結果(エラー発生の有無など)が返される。   On the other hand, when no error has occurred (No in step S14), the file system further performs a process of returning FAT1 and FAT2 to the initial state (that is, the unused state) (step S15). This process is performed by issuing a data write command to the device driver, and the execution result of each data write command (such as whether an error has occurred) is returned.

続いて、ファイルシステムは、デバイス・ドライバからの戻り値を基に、FAT1及びFAT2を初期状態に戻す処理においてエラーが発生したか否かをチェックする(ステップS16)。   Subsequently, the file system checks whether an error has occurred in the process of returning FAT1 and FAT2 to the initial state based on the return value from the device driver (step S16).

ここで、エラーが発生したときには(ステップS16のYes)、要求元に対してフルフォーマット処理(若しくはクイックフォーマット処理)の失敗を通知して(ステップS18)、本処理ルーチンを終了する。   If an error has occurred (Yes in step S16), the requester is notified of the failure of the full format process (or quick format process) (step S18), and the process routine ends.

また、エラーが発生しなかったときには(ステップS16のNo)、要求元に対してクイックフォーマット処理が成功裏に終了したことを通知して(ステップS17)、本処理ルーチンを終了する。   If no error has occurred (No in step S16), the request source is notified that the quick format process has been completed successfully (step S17), and the process routine is terminated.

図9からも分かるように、フルフォーマット処理は、パーティション全体に所定の値(例えば、0×FF)からなるデータを書き込んで以前のデータを潰す(書き込まれたデータを消去する)処理と、その後にファイルシステムの管理情報をパーティション内の所定の場所に作成する(クイックフォーマットと同様の)処理からなる。このうち、前段の所定データ書き込み処理は、記録メディアの大容量化に伴って所要時間が増大するという問題がある。とりわけ、空き容量がまだ大量にあるパーティションをフォーマットする場合、未使用領域に同じデータを書き込んでデータを消去するという無駄な処理を繰り返しながら長い所要時間を要することになる。   As can be seen from FIG. 9, the full format process is a process of writing data consisting of a predetermined value (for example, 0 × FF) to the entire partition to crush previous data (erasing the written data), and thereafter The file system management information is created at a predetermined location in the partition (similar to the quick format). Among these, the predetermined data writing process in the previous stage has a problem that the required time increases as the capacity of the recording medium increases. In particular, when formatting a partition that still has a large amount of free space, a long time is required while repeating the useless process of writing the same data in the unused area and erasing the data.

そこで、本発明者は、前回フルフォーマット処理を実行してから今回フルフォーマット処理を実行するまでの間に書き込みが実行されていない範囲を把握しておき、今回のフルフォーマットを行なうときには、書き込みが実行されていない範囲をフルフォーマット処理対象範囲から除外するというフルフォーマット処理方法を提案する。この方法によれば、一旦フルフォーマットした記録メディアにデータの書き込みを行なった後に再びフルフォーマットを行なう際には、データ領域のうち未使用領域に対して所定値を書き込んでデータを消去するという無駄な処理が省略されるので、フルフォーマット処理全体の処理を短縮することができる。   Therefore, the present inventor knows the range in which writing has not been performed from the previous full formatting process to the current full formatting process, and when performing the current full formatting, the writing is not performed. A full-format processing method is proposed in which a range that has not been executed is excluded from the full-format processing target range. According to this method, when data is written on a once-formatted recording medium and then full format is performed again, a predetermined value is written in an unused area of the data area and data is erased. Therefore, the entire full format process can be shortened.

フォーマット処理の対象となる記録メディア駆動用のデバイス・ドライバは、未書き込み領域管理手段として機能することができる。具体的には、前回フルフォーマット処理を行なってから今回フルフォーマット処理を行なうまでの間に、ファイルシステムから書き込みコマンドが発行される度にその要求先のアドレス(論理ブロック・アドレス)を監視することによって、書き込みが実行されていない未書き込み領域の範囲を把握することができ、その内容を不揮発的に記録する。   A device driver for driving a recording medium to be formatted can function as an unwritten area management unit. Specifically, the address (logical block address) of the request destination is monitored each time a write command is issued from the file system between the last full format process and the current full format process. Thus, the range of the unwritten area where writing has not been performed can be grasped, and the contents thereof are recorded in a nonvolatile manner.

ファイルシステムは、フルフォーマット処理を完了したとき、デバイス・ドライバに対して書き込みコマンド監視指示を発行する。これに対し、デバイス・ドライバは、フルフォーマット処理した以降に処理した記録メディアへの書き込みコマンド実行範囲に応じて、未書き込み領域の範囲を更新していく。   When the file system completes the full format process, it issues a write command monitoring instruction to the device driver. On the other hand, the device driver updates the range of the unwritten area according to the execution range of the write command to the recording medium processed after the full format processing.

次回のフルフォーマット処理時には、デバイス・ドライバは、ファイルシステムから届く(データ消去のための)書き込みコマンドに対して、書き込み先が未書き込み領域の範囲に該当するときには記録メディアへ書き込みコマンドを送信せずに、ファイルシステムへ書き込み完了を通知する。すなわち、デバイス・ドライバは、未書き込み領域の範囲では実際の(データ消去のための)書き込みを行なわず、ファイルシステムに対しては書き込みを行なったかのようにフェイクする。ファイルシステム側では、パーティション全体でデータ消去が行なわれたものと認識する。   During the next full format processing, the device driver does not send a write command to the recording medium when the write destination falls within the unwritten area range in response to a write command received from the file system (for data erasure). To the file system. In other words, the device driver does not perform actual writing (for erasing data) in the range of the unwritten area, and fakes the file system as if it had been written. The file system recognizes that the entire partition has been erased.

図12には、書き込みが実行されていない範囲を除外してフルフォーマット処理を行なうために、ファイルシステムが実行する処理手順をフローチャートの形式で示している。但し、ここでは、図10に示したような論理ブロック・アドレスがXから始まるA個の論理ブロック・アドレスからなるパーティションがフォーマット処理の対象であるとする。   FIG. 12 shows a processing procedure executed by the file system in the form of a flowchart in order to perform a full format process excluding a range where writing has not been executed. However, here, it is assumed that a partition including A logical block addresses whose logical block addresses start with X as shown in FIG.

ファイルシステムは、まず、デバイス・ドライバに対して書き込みコマンド監視結果反映指示を送る(ステップS21)。   First, the file system sends a write command monitoring result reflection instruction to the device driver (step S21).

次いで、ファイルシステムは、フォーマット処理の対象となるパーティション全体にわたって所定の値(例えば、0×FF)からなるデータを書き込んで、以前のデータを消去する(ステップS22)。   Next, the file system writes data having a predetermined value (for example, 0 × FF) over the entire partition to be formatted, and erases the previous data (step S22).

パーティションが論理ブロック・アドレスXからAブロック分とすると、論理ブロック・アドレスがX乃至X+A−1の範囲において、ファイルシステムはデバイス・ドライバに対し書き込みコマンドを発行する。デバイス・ドライバからは各々のデータ書き込みコマンドの実行結果(エラー発生の有無など)が返される。   When the partition is assumed to be A blocks from the logical block address X, the file system issues a write command to the device driver in the range of the logical block address from X to X + A-1. The device driver returns the execution result of each data write command (whether or not an error has occurred).

ここで、書き込みコマンド監視結果反映指示がなされている場合、デバイス・ドライバはファイルシステムから届く書き込みコマンドの書き込み先が未書き込み領域の範囲に該当するときには記録メディアへ書き込みコマンドを送信せずに、ファイルシステムへ書き込み完了を通知するが、その詳細な手順は後述並びに図16を参照されたい。   If a write command monitoring result reflection instruction has been issued, the device driver does not send the write command to the recording medium when the write destination of the write command received from the file system falls within the unwritten area range. The system is notified of the completion of writing. Refer to FIG. 16 for details of the procedure.

次いで、ファイルシステムは、デバイス・ドライバからの戻り値を基に、データ書き込みのエラーが発生したか否かをチェックする(ステップS23)。ここで、エラーが発生したときには(ステップS23のYes)、要求元に対してフルフォーマット処理の失敗を通知して(ステップS28)、本処理ルーチンを終了する。   Next, the file system checks whether or not a data write error has occurred based on the return value from the device driver (step S23). Here, when an error occurs (Yes in step S23), the request source is notified of the failure of the full format process (step S28), and this processing routine ends.

一方、エラーが発生しなかったときには(ステップS23のNo)、ファイルシステムは、デバイス・ドライバに対して、この度のフルフォーマット処理を行なって以降の当該パーティション内のデータ領域のうち書き込みが実行されていない未書き込み領域の範囲を把握するよう、書き込みコマンドの監視指示を発行する(ステップS24)。   On the other hand, if no error has occurred (No in step S23), the file system has performed a full format process on the device driver and the subsequent data area in the partition has been written. A command to monitor the write command is issued so as to grasp the range of the unwritten area that is not present (step S24).

この書き込みコマンドの監視指示は、例えば、監視をするか否かを示す1バイトのフィールドと、監視範囲の先頭及び終端の論理ブロック・アドレスを格納した各6バイトのフィールドを含んでいる(図13を参照のこと)。   This write command monitoring instruction includes, for example, a 1-byte field indicating whether or not to monitor, and a 6-byte field storing the logical block addresses at the beginning and end of the monitoring range (FIG. 13). checking).

次いで、ファイルシステムは、クイックフォーマットと同様のファイルシステムの管理情報をパーティション内の所定の場所に作成するという、クイックフォーマットと同様の処理を実施する(ステップS25)。クイックフォーマット処理の手順は図11(前述)を参照されたい。   Next, the file system performs a process similar to the quick format in which management information of the file system similar to the quick format is created at a predetermined location in the partition (step S25). Refer to FIG. 11 (described above) for the procedure of the quick format process.

続いて、ファイルシステムは、クイックフォーマット処理に対するデバイス・ドライバからの戻り値を基に、クイックフォーマットに相当する処理においてエラーが発生したか否かをチェックする(ステップS26)。   Subsequently, the file system checks whether an error has occurred in the process corresponding to the quick format based on the return value from the device driver for the quick format process (step S26).

ここで、エラーが発生したときには(ステップS26のYes)、要求元に対してフルフォーマット処理の失敗を通知する(ステップS28)。また、エラーが発生しなかったときには(ステップS26のNo)、要求元に対してフルフォーマット処理が成功裏に終了したことを通知して(ステップS27)、本処理ルーチンを終了する。   Here, when an error occurs (Yes in step S26), the request source is notified of the failure of the full format process (step S28). If no error has occurred (No in step S26), the request source is notified that the full format processing has been completed successfully (step S27), and this processing routine is terminated.

デバイス・ドライバは、図12に示したフローチャートのステップS24においてファイルシステムから書き込みコマンド監視指示が届いた以降は、ファイルシステムから書き込みコマンドが届く度に、パーティション内のデータ領域のうち書き込みが実行されていない未書き込み領域の範囲を更新していく。   After the write command monitoring instruction is received from the file system in step S24 of the flowchart shown in FIG. 12, the device driver executes writing in the data area in the partition every time the write command is received from the file system. The range of the unwritten area that is not updated is updated.

図14には、デバイス・ドライバが未書き込み領域の範囲を更新していく様子を図解している。デバイス・ドライバは、例えば、パーティション内のデータ領域の未書き込み状態を論理ブロック・アドレス単位で管理し、各論理ブロック・アドレスに対応するビット位置のビット値によって未書き込み状態を表現するビットマップを用いてみ書き込み領域の範囲を管理し、このようなビットマップを不揮発メモリ内に格納している。図14では、未書き込み状態のクラスタを網掛けで表し、書き込みが行なわれたクラスタを白で表している。   FIG. 14 illustrates how the device driver updates the unwritten area range. For example, the device driver manages the unwritten state of the data area in the partition in units of logical block addresses, and uses a bitmap that represents the unwritten state by the bit value of the bit position corresponding to each logical block address. The range of the trial writing area is managed, and such a bitmap is stored in the nonvolatile memory. In FIG. 14, the unwritten cluster is indicated by shading, and the cluster to which writing has been performed is indicated by white.

図14Aに示すように、書き込み済みのクラスタに連続する点線で囲う領域に対して書き込みコマンドがファイルシステムから届くと、この書き込みコマンドが書き込みを指示する最終端のクラスタまで書き込み状態に変更する。また、図14Bに示すように、書き込み済みのクラスタから不連続となる点線で囲う領域に対して書き込みコマンドがファイルシステムから届くと、この書き込みコマンドが書き込みを指示する最終端のクラスタまで書き込み状態に変更する。   As shown in FIG. 14A, when a write command arrives from the file system to an area surrounded by a dotted line continuous to a written cluster, the write command changes to a write state up to the final cluster instructing writing. Also, as shown in FIG. 14B, when a write command arrives from the file system to a region surrounded by a dotted line that is discontinuous from the already written cluster, the write command enters a write state up to the final cluster that instructs writing. change.

図14A並びに図14Bのいずれの場合も、監視範囲の先頭の論理ブロック・アドレスが当該書き込みコマンドの書き込み範囲の終端の論理ブロック・アドレスに1を足したアドレスとなるようにビットマップを修正する処理を行なうことで、未書き込み領域の範囲を更新する。そして、図14A並びに図14Bにおいて、網掛けのまま残った未書き込み領域の範囲が、それ以降に書き込みコマンドが届いたときの監視範囲となる。   14A and 14B, a process of correcting the bitmap so that the first logical block address of the monitoring range becomes an address obtained by adding 1 to the logical block address at the end of the write range of the write command. To update the range of the unwritten area. In FIG. 14A and FIG. 14B, the range of the unwritten area remaining shaded is the monitoring range when the write command arrives after that.

図15には、デバイス・ドライバが、ファイルシステムからの書き込みコマンド監視指示に応じて、未書き込み領域の範囲を更新するための処理手順をフローチャートの形式で示している。但し、デバイス・ドライバは、書き込み監視指示フラグを用いて、ファイルシステムから書き込みコマンド監視指示を受けた状態を管理するようにしているものとする。   FIG. 15 is a flowchart showing a processing procedure for the device driver to update the range of the unwritten area in response to a write command monitoring instruction from the file system. However, it is assumed that the device driver manages the state of receiving the write command monitoring instruction from the file system using the write monitoring instruction flag.

デバイス・ドライバは、ファイルシステムから書き込みコマンドが届くと、まず、書き込みコマンド監視指示フラグをチェックする(ステップS31)。   When a write command is received from the file system, the device driver first checks the write command monitoring instruction flag (step S31).

書き込みコマンド監視指示がなされていないときには(ステップS32のNo)、後続のステップS33〜S37における書き込みコマンドを監視するための処理ステップをスキップし、ファイルシステムからの書き込みコマンドをそのまま実行して(ステップS38)、本処理ルーチンを終了する。   When the write command monitoring instruction has not been issued (No in step S32), the processing steps for monitoring the write command in the subsequent steps S33 to S37 are skipped, and the write command from the file system is executed as it is (step S38). ), This processing routine is terminated.

一方、書き込みコマンド監視指示がなされているときには(ステップS32のYes)、当該書き込みコマンドに対応する監視範囲のビットマップ(図14を参照のこと)を不揮発メモリから読み出して(ステップS33)、当該書き込みコマンドが指示する書き込み範囲をチェックする(ステップS34)。   On the other hand, when a write command monitoring instruction is given (Yes in step S32), a bitmap of the monitoring range corresponding to the write command (see FIG. 14) is read from the nonvolatile memory (step S33) and the write is performed. The writing range indicated by the command is checked (step S34).

書き込みコマンドの書き込み範囲が監視範囲と重なる部分がないときには(ステップS35のNo)、当該書き込みコマンドの実行によりパーティション内でのみ書き込み領域の範囲に変更はない。そこで、後続のステップS36〜S37における書き込みコマンドを監視するための処理ステップをスキップし、ファイルシステムからの書き込みコマンドをそのまま実行して(ステップS38)、本処理ルーチンを終了する。   When there is no portion where the write range of the write command overlaps the monitoring range (No in step S35), the execution of the write command does not change the write area range only within the partition. Therefore, the processing step for monitoring the write command in subsequent steps S36 to S37 is skipped, the write command from the file system is executed as it is (step S38), and this processing routine is ended.

また、書き込みコマンドの書き込み範囲が監視範囲と重なる部分があるときには(ステップS35のYes)、監視範囲の先頭の論理ブロック・アドレスが当該書き込みコマンドの書き込み範囲の終端の論理ブロック・アドレスに1を足したアドレスとなるようにビットマップを修正することによって、監視範囲を修正し(ステップS36)、ビットマップを不揮発メモリに記録する(ステップS37)。そして、ファイルシステムからの書き込みコマンドを実行して(ステップS38)、本処理ルーチンを終了する。   When there is a portion where the write range of the write command overlaps the monitoring range (Yes in step S35), the first logical block address of the monitoring range is incremented by 1 to the logical block address of the end of the write range of the write command. The monitoring range is corrected by correcting the bitmap so that the address becomes the same address (step S36), and the bitmap is recorded in the nonvolatile memory (step S37). Then, a write command from the file system is executed (step S38), and this processing routine ends.

ファイルシステムが記録メディアに対して再びのフルフォーマット処理を行なう際、デバイス・ドライバに対して書き込みコマンド監視結果反映指示を送る(図12に示したフローチャートのステップS21)。デバイス・ドライバ側では、書き込みコマンド監視結果反映フラグを用いて、当該指示を受けた状態を管理するようにしているものとする。   When the file system performs full format processing again on the recording medium, a write command monitoring result reflection instruction is sent to the device driver (step S21 in the flowchart shown in FIG. 12). It is assumed that the device driver side uses the write command monitoring result reflection flag to manage the state of receiving the instruction.

デバイス・ドライバは、通常の状態ではファイルシステムからの書き込みコマンドをそのまま実行する。これに対し、書き込みコマンド監視結果反映指示を受けた状態のデバイス・ドライバは、ファイルシステムから書き込みコマンドを受け取ったときには、図15に示したフローチャートに従って管理される書き込みコマンド監視結果に応じた処理を行なう。具体的には、再びのフルフォーマット処理時に、デバイス・ドライバは、ファイルシステムから届く(データ消去のための)書き込みコマンドに対して、書き込み先が未書き込み領域の範囲に該当するときには記録メディアへ書き込みコマンドを送信せずに、ファイルシステムへ書き込み完了を通知する。すなわち、デバイス・ドライバが未書き込み領域の範囲ではファイルシステムに対しフェイクすることで、記録メディアへ実際に発行される書き込みコマンドが削減されるので、フルフォーマット処理の所要時間を短縮することができる。   In a normal state, the device driver executes a write command from the file system as it is. On the other hand, when receiving a write command from the file system, the device driver that has received the write command monitoring result reflection instruction performs processing according to the write command monitoring result managed according to the flowchart shown in FIG. . Specifically, during full format processing again, the device driver writes to the recording medium when the write destination falls within the unwritten area range in response to a write command (for erasing data) received from the file system. Notifies the file system of completion of writing without sending a command. That is, since the device driver fakes the file system in the unwritten area range, the number of write commands actually issued to the recording medium is reduced, so that the time required for full format processing can be shortened.

図16には、デバイス・ドライバが、書き込みコマンド監視結果反映指示に応じて、ファイルシステムからの書き込みコマンドの処理を行なうための処理手順をフローチャートの形式で示している。   FIG. 16 is a flowchart showing a processing procedure for the device driver to process a write command from the file system in response to a write command monitoring result reflection instruction.

デバイス・ドライバは、ファイルシステムから書き込みコマンドが届くと、まず、書き込みコマンド監視結果反映フラグをチェックする(ステップS41)。   When a write command is received from the file system, the device driver first checks the write command monitoring result reflection flag (step S41).

書き込みコマンド監視結果反映フラグが設定されていないときには(ステップS42のNo)、後続のステップS43〜S45における書き込みコマンドを監視するための処理ステップをスキップし、ファイルシステムからの書き込みコマンドをそのまま実行して(ステップS46)、本処理ルーチンを終了する。   When the write command monitoring result reflection flag is not set (No in step S42), the processing step for monitoring the write command in the subsequent steps S43 to S45 is skipped, and the write command from the file system is executed as it is. (Step S46), this processing routine is terminated.

一方、書き込みコマンド監視結果反映フラグが設定されているときには(ステップS42のYes)、当該書き込みコマンドに対応する監視範囲のビットマップ(図14を参照のこと)を不揮発メモリから読み出して(ステップS43)、当該書き込みコマンドが指示する書き込み範囲をチェックする(ステップS44)。   On the other hand, when the write command monitoring result reflection flag is set (Yes in step S42), the monitoring range bitmap corresponding to the write command (see FIG. 14) is read from the nonvolatile memory (step S43). Then, the write range indicated by the write command is checked (step S44).

ファイルシステムからの書き込みコマンドの書き込み範囲が監視範囲と重ならない部分があるときには(ステップS45のYes)、当該書き込みコマンドの書き込み範囲は監視範囲から外れた部分がある、すなわち、既にデータが書き込まれた領域を含んでいることになる。したがって、ファイルシステムからの書き込みコマンドをそのまま実行、すなわち書き込みデータを消去するための所定値(0×FF)を書き込むためのコマンドを記録メディアに転送して(ステップS46)、本処理ルーチンを終了する。   When there is a portion where the write range of the write command from the file system does not overlap with the monitoring range (Yes in step S45), the write range of the write command has a portion outside the monitoring range, that is, data has already been written. It will include the area. Therefore, the write command from the file system is executed as it is, that is, the command for writing the predetermined value (0 × FF) for erasing the write data is transferred to the recording medium (step S46), and this processing routine is finished. .

また、書き込みコマンドの書き込み範囲が監視範囲と重ならない部分がないときには(ステップS45のNo)、当該書き込みコマンドの書き込み範囲はすべて未書き込み領域に含まれることになる。したがって、後続のステップS46をスキップして記録メディアへ書き込みコマンドを送信せずに、ファイルシステムへ書き込み完了を通知して、本処理ルーチンを終了する。   When there is no portion where the write range of the write command does not overlap with the monitoring range (No in step S45), the write range of the write command is all included in the unwritten area. Therefore, the subsequent step S46 is skipped, the writing command is not transmitted to the recording medium, the writing completion is notified to the file system, and this processing routine is ended.

図16に示した処理手順では、ファイルシステムからのデータ書き込みコマンドに対し、デバイス・ドライバが書き込みコマンド監視結果を反映したデータ書き込み処理を行なうことで、フルフォーマット処理の所要時間短縮を実現している。この変形例として、ファイルシステム側で書き込みコマンド監視結果を反映したデータ書き込み処理を行なうという方法も考えられる。   In the processing procedure shown in FIG. 16, the time required for full format processing is reduced by the device driver performing data write processing reflecting the write command monitoring result in response to the data write command from the file system. . As a modified example, a method of performing data write processing reflecting the write command monitoring result on the file system side is also conceivable.

図17には、ファイルシステムが、デバイス・ドライバから書き込みコマンド監視結果を受け取り、これを反映したフルフォーマット処理を行なうための手順をフローチャートの形式で示している。   FIG. 17 is a flowchart showing a procedure for the file system to receive the write command monitoring result from the device driver and perform the full format processing reflecting this.

ファイルシステムは、フルフォーマット処理のための書き込みコマンドを発行するのに先駆けて、デバイス・ドライバから、書き込みコマンド監視結果を取得する(ステップS51)。   Prior to issuing the write command for the full format processing, the file system acquires the write command monitoring result from the device driver (step S51).

書き込みコマンド監視結果は、例えば、監視範囲の先頭及び終端の論理ブロック・アドレスを格納した各6バイトのフィールドを含んでいる(図18を参照のこと)。   The write command monitoring result includes, for example, a 6-byte field storing the logical block address at the beginning and end of the monitoring range (see FIG. 18).

次いで、ファイルシステムは、フォーマット処理の対象となるパーティション全体のうち、監視範囲を除いたすべての領域にわたって、所定の値(例えば、0×FF)からなるデータを書き込んで、以前のデータを消去する(ステップS52)。   Next, the file system writes data consisting of a predetermined value (for example, 0 × FF) over the entire area excluding the monitoring range in the entire partition to be formatted, and erases the previous data. (Step S52).

パーティションが論理ブロック・アドレスX乃至X+A−1の範囲で構成され、これに対し、監視範囲(すなわち、前回のフルフォーマット処理後の未書き込み領域)が論理ブロック・アドレスX+B乃至X+A−1の範囲であったとすると、論理ブロック・アドレスX乃至X+Bが、ステップS52におけるデータ書き込みの範囲となる(図19を参照のこと)。この範囲において、ファイルシステムはデバイス・ドライバに対し書き込みコマンドを発行する。デバイス・ドライバからは各々のデータ書き込みコマンドの実行結果(エラー発生の有無など)が返される。   The partition is composed of logical block addresses X to X + A-1, while the monitoring range (that is, the unwritten area after the previous full format processing) is logical block addresses X + B to X + A-1. If there is, the logical block addresses X to X + B are the data write range in step S52 (see FIG. 19). In this range, the file system issues a write command to the device driver. The device driver returns the execution result of each data write command (whether or not an error has occurred).

次いで、ファイルシステムは、デバイス・ドライバからの戻り値を基に、データ書き込みのエラーが発生したか否かをチェックする(ステップS53)。ここで、エラーが発生したときには(ステップS53のYes)、要求元に対してフルフォーマット処理の失敗を通知して(ステップS58)、本処理ルーチンを終了する。   Next, the file system checks whether or not a data write error has occurred based on the return value from the device driver (step S53). Here, when an error occurs (Yes in step S53), the request source is notified of the failure of the full format process (step S58), and this processing routine ends.

一方、エラーが発生しなかったときには(ステップS23のNo)、ファイルシステムは、デバイス・ドライバに対して、この度のフルフォーマット処理を行なって以降の当該パーティション内のデータ領域のうち書き込みが実行されていない未書き込み領域の範囲を把握するよう、書き込みコマンドの監視指示を発行する(ステップS54)。書き込みコマンドの監視指示は図13に示した通りである。また、デバイス・ドライバによる書き込みコマンドの監視指示に応じた処理動作については、図15を参照しながら既に説明した通りである。   On the other hand, if no error has occurred (No in step S23), the file system has performed a full format process on the device driver and the subsequent data area in the partition has been written. A command to monitor the write command is issued so as to grasp the range of the unwritten area that is not present (step S54). The monitoring instruction of the write command is as shown in FIG. Further, the processing operation according to the write command monitoring instruction by the device driver is as already described with reference to FIG.

次いで、ファイルシステムは、クイックフォーマットと同様のファイルシステムの管理情報をパーティション内の所定の場所に作成するという、クイックフォーマットと同様の処理を実施する(ステップS55)。クイックフォーマット処理の手順は図11(前述)を参照されたい。   Next, the file system performs a process similar to the quick format in which management information of the file system similar to the quick format is created in a predetermined location in the partition (step S55). Refer to FIG. 11 (described above) for the procedure of the quick format process.

続いて、ファイルシステムは、クイックフォーマット処理に対するデバイス・ドライバからの戻り値を基に、クイックフォーマットに相当する処理においてエラーが発生したか否かをチェックする(ステップS56)。   Subsequently, the file system checks whether an error has occurred in the process corresponding to the quick format based on the return value from the device driver for the quick format process (step S56).

ここで、エラーが発生したときには(ステップS56のYes)、要求元に対してフルフォーマット処理の失敗を通知する(ステップS58)。また、エラーが発生しなかったときには(ステップS56のNo)、要求元に対してフルフォーマット処理が成功裏に終了したことを通知して(ステップS57)、本処理ルーチンを終了する。   Here, when an error occurs (Yes in step S56), the request source is notified of the failure of the full format process (step S58). If no error has occurred (No in step S56), the request source is notified that the full format processing has been completed successfully (step S57), and this processing routine ends.

上述したような、未書き込み領域の範囲を除外してデータ消去を行なうというフルフォーマット処理によれば、例えば、デジタルビデオカメラなどでハード・ディスクのフルフォーマットを行なってから動画や静止画などのファイルを記録したが空き容量がまだ大量にある状態で再びフルフォーマット処理するという操作が行なわれた場合、再びのフルフォーマット処理の所要時間を空き容量サイズに応じて短縮することができる。   As described above, according to the full format process that excludes the unwritten area range and erases the data, for example, after performing a hard disk full format with a digital video camera or the like, a file such as a moving image or still image Is recorded, but the operation of performing the full format process again in a state where the free capacity is still large is performed, the time required for the full format process can be shortened according to the free capacity size.

例えば、30GBのハード・ディスク(パーティション)の場合の所要時間が30分であるとし、フルフォーマット済みの当該ハード・ディスクに対して静止画を1枚だけ記録してデータ領域の3MBを消費した後、再びフルフォーマット処理を行なう場合について考えてみる。   For example, assuming that the time required for a 30 GB hard disk (partition) is 30 minutes, after recording only one still image on the fully formatted hard disk and consuming 3 MB of the data area Consider the case where full format processing is performed again.

従来のフルフォーマット処理では、すべての領域について所定の値を書き込む処理が実施されることから、再び30分の所要時間を要する。これに対し、本発明に従って未書き込み領域の範囲を除外したフルフォーマット処理を行なう場合には、数秒で処理が完了する。   In the conventional full format process, since a process of writing a predetermined value is performed for all areas, a required time of 30 minutes is required again. On the other hand, in the case of performing the full format process excluding the unwritten area range according to the present invention, the process is completed in several seconds.

以上、特定の実施形態を参照しながら、本発明について詳解してきた。しかしながら、本発明の要旨を逸脱しない範囲で当業者が該実施形態の修正や代用を成し得ることは自明である。   The present invention has been described in detail above with reference to specific embodiments. However, it is obvious that those skilled in the art can make modifications and substitutions of the embodiment without departing from the gist of the present invention.

本発明に係る記録メディア制御方法は、デジタルビデオカメラやデジタルスチルカメラなどの情報機器や、パーソナル・コンピュータなどの計算機システムを始めとして、記録領域にファイルシステムに応じたフォーマット処理を行なってから使用が開始される記録メディアを利用するさまざまな装置に適用することができる。   The recording media control method according to the present invention is used after performing format processing corresponding to the file system in the recording area, including information devices such as digital video cameras and digital still cameras, and computer systems such as personal computers. The present invention can be applied to various apparatuses that use a recording medium to be started.

本明細書では、ファイルシステムに応じたフォーマット処理を行なうタイプの記録メディアとして主にハード・ディスクを採り上げて説明したが、本発明の要旨はこれに限定されるものではなく、光ディスクやメモリカードなどフォーマット処理を行なう他の記録メディアに対しても適用することができる。また、記録メディアは、機器内蔵又は着脱可能の区別を問わない(但し、着脱可能なメディアの場合には、メディアの抜去に応じて不揮発メモリに記録されている書き込み監視情報を破棄する、といった制御が必要であろう)。   In the present specification, a hard disk has been mainly described as a recording medium of a type that performs format processing in accordance with the file system. However, the gist of the present invention is not limited to this, and an optical disk, a memory card, and the like are used. The present invention can also be applied to other recording media that perform format processing. In addition, the recording medium does not matter whether it is built-in or detachable (in the case of a detachable medium, control for discarding the write monitoring information recorded in the nonvolatile memory when the medium is removed) Would be necessary).

また、本明細書ではファイルシステムとしてFATを採り上げたが、本発明の要旨はこれに限定されるものではなく、本発明は、フルフォーマット処理を行なうさまざまなファイルシステムを適用対象とする。   In this specification, FAT is taken as the file system. However, the gist of the present invention is not limited to this, and the present invention is applicable to various file systems that perform full format processing.

要するに、例示という形態で本発明を開示してきたのであり、本明細書の記載内容を限定的に解釈するべきではない。本発明の要旨を判断するためには、特許請求の範囲を参酌すべきである。   In short, the present invention has been disclosed in the form of exemplification, and the description of the present specification should not be interpreted in a limited manner. In order to determine the gist of the present invention, the claims should be taken into consideration.

図1は、デジタルビデオカメラの構成を模式的に示した図である。FIG. 1 is a diagram schematically showing the configuration of a digital video camera. 図2は、パーソナル・コンピュータの構成を模式的に示した図である。FIG. 2 is a diagram schematically showing the configuration of the personal computer. 図3Aは、ハード・ディスクに設けられたパーティションをFAT16でフォーマットした場合のデータ構造を示した図である。FIG. 3A is a diagram showing a data structure when a partition provided on the hard disk is formatted with FAT16. 図3Bは、ハード・ディスクに設けられたパーティションをFAT32でフォーマットした場合のデータ構造を示した図である。FIG. 3B is a diagram showing a data structure when a partition provided on the hard disk is formatted with FAT32. 図4Aは、マスタ・ブート・レコードの構成を模式的に示した図である。FIG. 4A is a diagram schematically showing the configuration of the master boot record. 図4Bは、16バイト(128ビット)データ長からなるパーティション・テーブルのデータ構造を示した図である。FIG. 4B is a diagram showing a data structure of a partition table having a data length of 16 bytes (128 bits). 図5は、記録メディアに記録される各ファイルに設定されるディレクトリ・エントリの情報構造を模式的に示した図である。FIG. 5 is a diagram schematically showing the information structure of the directory entry set in each file recorded on the recording medium. 図6は、ファイル・アロケーション・テーブルのデータ構成例を示した図である。FIG. 6 is a diagram illustrating a data configuration example of the file allocation table. 図7は、記録メディアにアクセスしてデータの記録並びに再生を行なうための処理階層を模式的に示した図である。FIG. 7 is a diagram schematically showing a processing hierarchy for accessing a recording medium and recording and reproducing data. 図8は、図7に示した処理階層のうちファイルシステムをさらに詳細にして示した図である。FIG. 8 is a diagram showing the file system in more detail in the processing hierarchy shown in FIG. 図9は、従来のフルフォーマット処理の手順を示したフローチャートである。FIG. 9 is a flowchart showing the procedure of a conventional full format process. 図10は、フォーマット処理の対象となるパーティションの構造を模式的に示したフローチャートである。FIG. 10 is a flowchart schematically showing the structure of a partition to be formatted. 図11は、クイックフォーマット処理の手順を示した図である。FIG. 11 is a diagram showing a procedure of quick format processing. 図12は、未書き込み領域の範囲を把握してフルフォーマット処理を行なうために、ファイルシステムが実行する処理手順を示したフローチャートである。FIG. 12 is a flowchart showing a processing procedure executed by the file system in order to grasp the range of the unwritten area and perform the full format processing. 図13は、書き込みコマンド監視指示の構成例を示した図である。FIG. 13 is a diagram showing a configuration example of a write command monitoring instruction. 図14Aは、デバイス・ドライバが未書き込み領域の範囲を更新していく様子を示した図である。FIG. 14A is a diagram illustrating how the device driver updates the range of the unwritten area. 図14Bは、デバイス・ドライバが未書き込み領域の範囲を更新していく様子を示した図である。FIG. 14B is a diagram showing how the device driver updates the range of the unwritten area. 図15は、デバイス・ドライバが、ファイルシステムからの書き込みコマンド監視指示に応じて、未書き込み領域の範囲を更新するための処理手順を示したフローチャートである。FIG. 15 is a flowchart showing a processing procedure for the device driver to update the range of the unwritten area in response to a write command monitoring instruction from the file system. 図16は、デバイス・ドライバが、書き込みコマンド監視結果反映指示に応じて、ファイルシステムからの書き込みコマンドの処理を行なうための処理手順を示したフローチャートである。FIG. 16 is a flowchart showing a processing procedure for the device driver to process a write command from the file system in response to a write command monitoring result reflection instruction. 図17は、ファイルシステムが書き込みコマンド監視結果を反映したフルフォーマット処理を行なうための手順を示したフローチャートである。FIG. 17 is a flowchart showing a procedure for the file system to perform full format processing reflecting the write command monitoring result. 図18は、書き込みコマンド監視結果の構成例を示している。FIG. 18 shows a configuration example of the write command monitoring result. 図19は、ファイルシステムが書き込みコマンド監視結果を反映したフルフォーマット処理を行なう際のデータ書き込み範囲を説明するための図である。FIG. 19 is a diagram for explaining a data write range when the file system performs a full format process reflecting a write command monitoring result.

符号の説明Explanation of symbols

100…デジタルビデオカメラ
101…制御部(CPU)
102…カメラ機能部
111…光学レンズ部
112…光電変換部
113…画像信号処理部
114…画像入出力部
115…液晶ディスプレイ
116…音声入出力部
117…音声信号処理部
118…内蔵メモリ(RAM)
119…内蔵メモリ(ROM)
120…操作入力部
131…通信部
132…ドライブ
141…電源
201…CPU
202…ROM
203…RAM
204…ローカル・バス
205…ブリッジ
206…入出力バス
207…入出力インターフェース
208…キーボード
209…ポインティング・デバイス(マウス)
210…ディスプレイ
211…HDD
214…接続ポート
221…リムーバブル記録メディア
222…外部接続機器
310…アプリケーション
311…記録アプリケーション
312…再生アプリケーション
313…USB接続アプリケーション
320…ファイルシステム
321、322…マウントドライブ情報
323…記録再生制御部
323A…FAT制御部
323B…クラスタ制御部
323C…ディレクトリ・エントリ制御部
324…メディア制御部
324A…位置制御部
324B…アクセス制御部
330…デバイス・ドライバ
331…アクセス制御部
332…デバイス・ドライバA
333…デバイス・ドライバB
341…記録メディアA
342…記録メディアB
350…RAM(ワーク領域)
DESCRIPTION OF SYMBOLS 100 ... Digital video camera 101 ... Control part (CPU)
DESCRIPTION OF SYMBOLS 102 ... Camera function part 111 ... Optical lens part 112 ... Photoelectric conversion part 113 ... Image signal processing part 114 ... Image input / output part 115 ... Liquid crystal display 116 ... Audio | voice input / output part 117 ... Audio | voice signal processing part 118 ... Built-in memory (RAM)
119 ... Built-in memory (ROM)
DESCRIPTION OF SYMBOLS 120 ... Operation input part 131 ... Communication part 132 ... Drive 141 ... Power supply 201 ... CPU
202 ... ROM
203 ... RAM
204 ... Local bus 205 ... Bridge 206 ... Input / output bus 207 ... Input / output interface 208 ... Keyboard 209 ... Pointing device (mouse)
210 ... Display 211 ... HDD
214 ... Connection port 221 ... Removable recording medium 222 ... External connection device 310 ... Application 311 ... Recording application 312 ... Playback application 313 ... USB connection application 320 ... File system 321, 322 ... Mount drive information 323 ... Recording / playback control unit 323A ... FAT Control unit 323B ... Cluster control unit 323C ... Directory / entry control unit 324 ... Media control unit 324A ... Position control unit 324B ... Access control unit 330 ... Device driver 331 ... Access control unit 332 ... Device driver A
333: Device driver B
341 ... Recording medium A
342 ... Recording medium B
350 ... RAM (work area)

Claims (6)

記録領域にファイルシステムに応じたフォーマット処理を行なってから使用が開始される記録メディアの制御を行なう記録メディア制御装置であって、
前記記録領域のうち、前回フルフォーマット処理を実行してから今回フルフォーマット処理を実行するまでの間に書き込みが実行されていない未書き込み領域の範囲を把握する未書き込み領域管理手段と、
未書き込み領域の範囲を除外して、前記記録領域に所定の値を書き込んでデータの消去を行なうデータ消去手段と、
前記記録領域の所定の場所にファイルシステムの管理情報を作成する管理情報作成手段と、
を具備することを特徴とする記録メディア制御装置。
A recording medium control device for controlling a recording medium to be used after a format process corresponding to a file system is performed on a recording area,
Of the recording area, an unwritten area management means for grasping a range of an unwritten area in which writing is not performed between the previous full format process and the current full format process;
A data erasing means for erasing data by writing a predetermined value in the recording area, excluding the range of the unwritten area;
Management information creation means for creating file system management information at a predetermined location in the recording area;
A recording medium control apparatus comprising:
ファイルシステムは、デバイス・ドライバを通じて記録メディアへのアクセスを行なう場合に、
ファイルシステムは、前回のフルフォーマット処理を完了したときにデバイス・ドライバに対して書き込みコマンド監視指示を発行し、
デバイス・ドライバは、前記未書き込み領域管理手段として、ファイルシステムからの前記書き込みコマンド監視指示に応じて、以後に処理した前記記録メディアへの書き込みコマンド実行範囲に応じて、未書き込み領域の範囲を逐次更新する、
ことを特徴とする請求項1に記載の記録メディア制御装置。
When the file system accesses the recording media through the device driver,
The file system issues a write command monitoring instruction to the device driver when the previous full format processing is completed,
The device driver, as the unwritten area management means, sequentially determines the range of the unwritten area according to the write command execution range to the recording medium processed thereafter in accordance with the write command monitoring instruction from the file system. Update,
The recording media control apparatus according to claim 1, wherein
次回のフルフォーマット処理時に、デバイス・ドライバは、ファイルシステムから届く書き込みコマンドに対して、書き込み先が未書き込み領域の範囲に該当しないときは前記記録メディアへ書き込みコマンドを送信するが、書き込み先が未書き込み領域の範囲に該当するときには前記記録メディアへ書き込みコマンドを送信せずにファイルシステムへ書き込み完了を通知する、
ことを特徴とする請求項2に記載の記録メディア制御装置。
During the next full format processing, the device driver sends a write command to the recording medium when the write destination does not fall within the unwritten area range in response to a write command received from the file system. Notifying the completion of writing to the file system without sending a write command to the recording medium when corresponding to the range of the writing area,
The recording medium control apparatus according to claim 2, wherein
次回のフルフォーマット処理時に、ファイルシステムは、デバイス・ドライバから未書き込み領域の範囲の情報を取得し、その情報に基づいて、フルフォーマット処理における所定の値を書き込んでデータ消去処理を実行する範囲を狭める、
ことを特徴とする請求項2に記載の記録メディア制御装置。
During the next full format process, the file system obtains information on the range of the unwritten area from the device driver, writes a predetermined value in the full format process based on the information, and sets the range for executing the data erasure process. Narrow,
The recording medium control apparatus according to claim 2, wherein
記録領域にファイルシステムに応じたフォーマット処理を行なってから使用が開始される記録メディアの制御を行なう記録メディア制御方法であって、
前記記録領域のうち、前回フルフォーマット処理を実行してから今回フルフォーマット処理を実行するまでの間に書き込みが実行されていない未書き込み領域の範囲を把握する未書き込み領域管理ステップと、
未書き込み領域の範囲を除外して、前記記録領域に所定の値を書き込んでデータの消去を行なうデータ消去ステップと、
前記記録領域の所定の場所にファイルシステムの管理情報を作成する管理情報作成ステップと、
を具備することを特徴とする記録メディア制御方法。
A recording medium control method for controlling a recording medium to be used after a format process corresponding to a file system is performed on a recording area,
Of the recording area, an unwritten area management step for grasping a range of an unwritten area in which writing is not performed between the previous full format process and the current full format process;
A data erasing step of erasing data by writing a predetermined value in the recording area, excluding the range of the unwritten area;
Management information creating step for creating file system management information at a predetermined location in the recording area;
A recording medium control method comprising:
記録領域にファイルシステムに応じたフォーマット処理した後に使用が開始される記録メディアの制御を行なうための処理をコンピュータ上で実行するようにコンピュータ可読形式で記述されたコンピュータ・プログラムであって、前記コンピュータを、
前記記録領域のうち、前回フルフォーマット処理を実行してから今回フルフォーマット処理を実行するまでの間に書き込みが実行されていない未書き込み領域の範囲を把握する未書き込み領域管理手段と、
未書き込み領域の範囲を除外して、前記記録領域に所定の値を書き込んでデータの消去を行なうデータ消去手段と、
前記記録領域の所定の場所にファイルシステムの管理情報を作成する管理情報作成手段と、
として機能させるためのコンピュータ・プログラム。
A computer program written in a computer-readable format so as to execute on a computer a process for controlling a recording medium to be used after a formatting process corresponding to a file system is performed on a recording area. The
Of the recording area, an unwritten area management means for grasping a range of an unwritten area in which writing is not performed between the previous full format process and the current full format process;
A data erasing means for erasing data by writing a predetermined value in the recording area, excluding the range of the unwritten area;
Management information creation means for creating file system management information at a predetermined location in the recording area;
Computer program to function as
JP2007274341A 2007-10-22 2007-10-22 Recording media control device, recording media control method, and computer program Pending JP2009104695A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007274341A JP2009104695A (en) 2007-10-22 2007-10-22 Recording media control device, recording media control method, and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007274341A JP2009104695A (en) 2007-10-22 2007-10-22 Recording media control device, recording media control method, and computer program

Publications (1)

Publication Number Publication Date
JP2009104695A true JP2009104695A (en) 2009-05-14

Family

ID=40706219

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007274341A Pending JP2009104695A (en) 2007-10-22 2007-10-22 Recording media control device, recording media control method, and computer program

Country Status (1)

Country Link
JP (1) JP2009104695A (en)

Similar Documents

Publication Publication Date Title
US8867889B2 (en) Apparatus, method, and computer program for processing information
JP4561759B2 (en) Information processing apparatus, information recording medium, information processing method, and computer program
EP0971358A2 (en) Data processing apparatus and file management method therefor
JP2007193883A (en) Data recording device and method, data reproducing device and method, and data recording and reproducing device and method
JP4487954B2 (en) Data recording apparatus, data recording method, and program
JP2007265492A (en) Disk device with data erasure function
US20070168604A1 (en) Information recording apparatus and method for controlling the same
TWI493341B (en) Memory storage device and repairing method thereof
JP2005050192A (en) Information recording system
JP2006228138A (en) Semiconductor storage device, storage control method, and information equipment
US20070250661A1 (en) Data recording apparatus and method of controlling the same
JP2007108853A (en) Information processor, information processing method, and computer program
JP2001325134A (en) Directory setting method and recorder
JP2009104695A (en) Recording media control device, recording media control method, and computer program
JP2009059444A (en) Information processing device and information processing method
JP2006260158A (en) Information processing apparatus, information processing method and program
JP2006155461A (en) Information processor and processing method, and program
JP2008262381A (en) Information processor, information processing method and computer program
JP2009104739A (en) Recording media control device, recording media control method, and computer program
JP2009301683A (en) Recording and playback device, recording and playback method, and computer program
JP4561323B2 (en) Information processing apparatus, information processing method, and program
JP2009205590A (en) Access module, information recording module, controller, and information recording system
JP4734898B2 (en) Information processing apparatus, information processing method, and program
US8037268B2 (en) Storage system and operation method thereof
JP2007264870A (en) Information processor, information processing method, and computer program