JP4959766B2 - Device driver - Google Patents

Device driver Download PDF

Info

Publication number
JP4959766B2
JP4959766B2 JP2009233192A JP2009233192A JP4959766B2 JP 4959766 B2 JP4959766 B2 JP 4959766B2 JP 2009233192 A JP2009233192 A JP 2009233192A JP 2009233192 A JP2009233192 A JP 2009233192A JP 4959766 B2 JP4959766 B2 JP 4959766B2
Authority
JP
Japan
Prior art keywords
driver
data
read
cache memory
request
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.)
Active
Application number
JP2009233192A
Other languages
Japanese (ja)
Other versions
JP2010009622A (en
Inventor
秀之 紙井
満 豊田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Media Logic Corp
Original Assignee
Media Logic 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 Media Logic Corp filed Critical Media Logic Corp
Priority to JP2009233192A priority Critical patent/JP4959766B2/en
Publication of JP2010009622A publication Critical patent/JP2010009622A/en
Application granted granted Critical
Publication of JP4959766B2 publication Critical patent/JP4959766B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Description

この発明は、パーソナルコンピュータの外付周辺機器を制御するデバイスドライバに関し、特に、データ転送を高速化するデバイスドライバに関する。   The present invention relates to a device driver that controls an external peripheral device of a personal computer, and more particularly to a device driver that speeds up data transfer.

パーソナルコンピュータ(以下、PCと言う。)のオペレーティングシステム(以下、OSと言う。)が周辺機器を正常に認識、制御するためにはデバイスドライバというソフトウェアが必要になる。   In order for an operating system (hereinafter referred to as an OS) of a personal computer (hereinafter referred to as a PC) to normally recognize and control a peripheral device, software called a device driver is required.

近年のPCに搭載されるOSには、標準のデバイスドライバが多数組み込まれている。したがって、OSは、標準的な周辺機器が接続された場合には、標準のデバイスドライバを自動的に割り当て、接続された周辺機器を認識、制御する。   Many standard device drivers are incorporated in an OS installed in a recent PC. Therefore, when a standard peripheral device is connected, the OS automatically assigns a standard device driver, and recognizes and controls the connected peripheral device.

しかし、標準のデバイスドライバは、各周辺機器に対して最適化されておらず、デバイスドライバが制御する転送速度よりも高速に動作する周辺機器(例えば高速にリード/ライトする外付HDD等)が存在した場合であっても、標準のデバイスドライバが速度を制限してしまう。また、アプリケーションが速度を制限する場合もある。   However, the standard device driver is not optimized for each peripheral device, and a peripheral device that operates at a higher speed than the transfer speed controlled by the device driver (for example, an external HDD that reads / writes at a high speed). Even if it exists, standard device drivers limit speed. The application may also limit the speed.

特に、一般的なOSであるWindows(登録商標)の場合、USBマスストレージデバイス(外付HDD等)を接続してデータ転送を行なうと、Windows(登録商標)標準搭載のアプリケーションまたはデバイスドライバが64kB毎にデータを区分し、USBマスストレージドライバは区分したデータ毎にコマンド、ステータス等の情報を付加する。このコマンド、ステータス等の情報を処理する時間は長く(数百μsec)、データ転送速度が低下する要因となっていた。   In particular, in the case of Windows (registered trademark), which is a general OS, when a USB mass storage device (external HDD or the like) is connected and data transfer is performed, an application or device driver equipped with Windows (registered trademark) as a standard is 64 kB. The USB mass storage driver adds information such as a command and status to each divided data. The time for processing information such as commands and statuses is long (several hundreds of microseconds), which causes a reduction in data transfer speed.

図1に、OS上に搭載されている各種ドライバの機能ブロック図を示す。同図において、アプリケーション51、汎用ディスクドライバ52、USBマスストレージドライバ53、およびUSBホストコントローラドライバ54は、OS上に搭載されている機能部である。   FIG. 1 shows a functional block diagram of various drivers installed on the OS. In the figure, an application 51, a general-purpose disk driver 52, a USB mass storage driver 53, and a USB host controller driver 54 are function units mounted on the OS.

アプリケーション51は、各種ドライバを介してUSBマスストレージデバイス55(例えば外付HDD)にリードまたはライトの要求を行う。同図においては、アプリケーション51がライトの要求を行い、データ転送する例を示す。アプリケーション51は、汎用ディスクドライバ52に、ライト要求を行い、データを転送する。汎用ディスクドライバ52は、このデータを下位側であるUSBマスストレージドライバ53に転送する。このとき、USBマスストレージドライバ53のデータ転送サイズの上限が64kBのため、汎用ディスクドライバ52は64kB毎にデータを分割する。USBマスストレージドライバ53は、この64kB毎に分割されたデータにコマンド、ステータスを付与して、順次、USBホストコントローラドライバ54に転送する。USBホストコントローラドライバ54は、このコマンド、データ、ステータスをUSBバルク転送方式にて、順次、USBマスストレージデバイス55へ転送する。   The application 51 makes a read or write request to the USB mass storage device 55 (for example, an external HDD) via various drivers. In the figure, an example is shown in which the application 51 makes a write request and transfers data. The application 51 makes a write request to the general-purpose disk driver 52 and transfers data. The general-purpose disk driver 52 transfers this data to the USB mass storage driver 53 on the lower side. At this time, since the upper limit of the data transfer size of the USB mass storage driver 53 is 64 kB, the general-purpose disk driver 52 divides the data every 64 kB. The USB mass storage driver 53 gives a command and a status to the data divided every 64 kB, and sequentially transfers the data to the USB host controller driver 54. The USB host controller driver 54 sequentially transfers the command, data, and status to the USB mass storage device 55 using the USB bulk transfer method.

図2は、汎用ディスクドライバ52、およびUSBマスストレージドライバ53が転送するデータ(バルクオンリープロトコル)の構成を示した概念図である。同図に示すように、汎用ディスクドライバ52は、64kBにデータを分割し、USBマスストレージドライバ53は、各データ部にコマンド、ステータスを付与し、順次、USBホストコントローラドライバ54に転送する。さらに、USBホストコントローラドライバ54は、このコマンド、64kBに分割されたデータ、ならびにステータスを順次、USBマスストレージデバイス55にデータを転送する。これにより、アプリケーション51はUSBマスストレージデバイス55にライトを行う。   FIG. 2 is a conceptual diagram showing the configuration of data (bulk-only protocol) transferred by the general-purpose disk driver 52 and the USB mass storage driver 53. As shown in the figure, the general-purpose disk driver 52 divides the data into 64 kB, and the USB mass storage driver 53 assigns commands and statuses to the respective data sections and sequentially transfers them to the USB host controller driver 54. Further, the USB host controller driver 54 sequentially transfers the command, the data divided into 64 kB, and the status to the USB mass storage device 55. As a result, the application 51 writes to the USB mass storage device 55.

USBマスストレージドライバ53、USBホストコントローラドライバ54、およびUSBマスストレージデバイス55がコマンドおよびステータスを処理する時間は、USB2.0規格の環境下では500μsec程度である。すると、64kBのデータを転送する毎にコマンド、ステータスの処理時間あわせて500μsec程度の遅延が発生することになり、転送する総データ量が64kB以上であると、データ転送速度が低下する。   The time for the USB mass storage driver 53, the USB host controller driver 54, and the USB mass storage device 55 to process the command and status is about 500 μsec under the USB 2.0 standard environment. Then, every time 64 kB of data is transferred, a delay of about 500 μsec occurs together with the command and status processing time. If the total amount of data to be transferred is 64 kB or more, the data transfer speed decreases.

また、図1に示すように、アプリケーション51が直接USBマスストレージドライバ53にデータを転送する場合であっても、USBマスストレージドライバ53のデータ転送サイズの上限が64kBのため、アプリケーション51は、64kB毎にデータを分割し、USBマスストレージドライバ53は、各データ部にコマンド、ステータスを付与し、順次、USBホストコントローラドライバ54に転送する。なお、ドライバ側に64kBのデータ転送サイズの上限が存在しない場合で、かつアプリケーション51が64kBより大きいデータの転送を行なう場合であってもアプリケーション側で64kB毎にデータを分割する場合もある(例えばWindows(登録商標)標準搭載のエクスプローラなど)。   Further, as shown in FIG. 1, even when the application 51 directly transfers data to the USB mass storage driver 53, the upper limit of the data transfer size of the USB mass storage driver 53 is 64 kB. The data is divided every time, and the USB mass storage driver 53 gives a command and a status to each data part and sequentially transfers them to the USB host controller driver 54. Note that even when there is no upper limit of the data transfer size of 64 kB on the driver side, and even when the application 51 transfers data larger than 64 kB, the application side may divide the data every 64 kB (for example, Windows (registered trademark) standard Explorer).

そのため、いずれにしても、転送する総データ量が所定量以上となると、転送速度が低下するという問題が発生していた。   Therefore, in any case, when the total amount of data to be transferred exceeds a predetermined amount, there has been a problem that the transfer speed is lowered.

一方で、従来、PCとデバイスとの間の転送速度を向上させる手法として、デバイスコントローラにバッファを備え、このバッファにデータをキャッシュし、まとめて転送するものがあった(例えば特許文献1参照)。特許文献1の装置は、転送するデータの総容量がバッファの容量を超えるデータの場合、都度書き込み処理が発生するため、バッファ容量を超えるデータについては、バッファを介さずに直接転送するものである。   On the other hand, conventionally, as a technique for improving the transfer speed between a PC and a device, there has been a method in which a buffer is provided in a device controller, data is cached in the buffer, and transferred collectively (for example, see Patent Document 1). . The device of Patent Literature 1 directly transfers data exceeding the buffer capacity without going through the buffer because the writing process occurs whenever the total capacity of the transferred data exceeds the capacity of the buffer. .

また、複数のバッファを備え、1つのバッファのデータを転送する処理を行いながら、他のバッファに上位側からのデータをキャッシュすることで転送速度を向上させるもの(例えば特許文献2参照)や、コマンド、データ、ステータスをそれぞれキャッシュし、まとめて処理するものが提案されている(例えば特許文献3参照)。   In addition, a plurality of buffers are provided to improve the transfer speed by caching data from the upper side in another buffer while performing processing to transfer data in one buffer (see, for example, Patent Document 2), A command that caches each command, data, and status and processes them together has been proposed (see, for example, Patent Document 3).

また、PC側およびデバイス側で上記のようにデータを分割して処理する必要が有る場合において、PC側のデバイスコントローラがある程度のデータをまとめて転送し、デバイス側の制御部でこれを再び分割して処理するものが提案されている(例えば特許文献4参照)。   In addition, when it is necessary to divide and process data as described above on the PC side and device side, the device controller on the PC side transfers a certain amount of data and transfers it again by the control unit on the device side. Have been proposed (see, for example, Patent Document 4).

特開平4−130523号公報JP-A-4-130523 特開2002−344537号公報JP 2002-344537 A 特開2006−215891号公報JP 2006-215891 A 特開2001−154811号公報JP 2001-154811 A

しかし、特許文献1に記載の装置では、アプリケーションやドライバがデータを分割した場合に高速化できるものではなかった。また、特許文献2および特許文献3に記載の装置は、転送部の処理速度を向上することができるが、アプリケーションやドライバがデータを分割した場合に高速化できるものではなかった。   However, the apparatus described in Patent Document 1 cannot increase the speed when an application or driver divides data. The devices described in Patent Document 2 and Patent Document 3 can improve the processing speed of the transfer unit, but cannot increase the speed when an application or driver divides data.

また、特許文献4に記載の計算機システムは、デバイス側の制御部で再びデータを分割して処理する必要が有った。また、リード時には、デバイス側の制御部において、分割された各要求を統合してデータ転送する構成が必要であった。   Further, the computer system described in Patent Document 4 needs to divide and process data again by the control unit on the device side. Further, at the time of reading, a configuration is required in which the divided requests are integrated and transferred in the device-side control unit.

そこで、この発明は、転送する総データ量が所定量である場合において、デバイス側に特別な構成を必要とせず、転送速度を向上するデバイスドライバを提供することを目的とする。   SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to provide a device driver that improves the transfer speed without requiring a special configuration on the device side when the total amount of data to be transferred is a predetermined amount.

本発明のデバイスドライバは、周辺機器が接続されたパーソナルコンピュータのOSに搭載され、前記周辺機器に対するライトの要求を上限のデータ転送サイズで複数のコマンドに分割して順次送信するソフトウェアの下位側に配置されるデバイスドライバであって、前記パーソナルコンピュータを、前記ライトの要求に対応するデータをキャッシュするキャッシュメモリと、前記ドライバが前記上限のデータ転送サイズのライトの要求を受信したとき、この後連続してライトの要求がされると予測し、各コマンドに対するコマンド終了を擬似的に上位側に返信するとともに、上位側から転送されるデータを順次前記キャッシュメモリにキャッシュし、前記ソフトウェアが分割する各コマンドあたりのデータ転送サイズの上限よりも大きいデータ転送サイズのコマンドを発行して前記キャッシュメモリのデータを前記周辺機器に転送する処理を行う制御部と、して機能させることを特徴とする。   The device driver of the present invention is mounted on the OS of a personal computer to which a peripheral device is connected, and is placed on the lower side of software that sequentially transmits a write request for the peripheral device by dividing it into a plurality of commands with an upper limit data transfer size. A device driver, wherein the personal computer caches data corresponding to the write request, and when the driver receives a write request of the upper limit data transfer size, Then, it is predicted that a write request will be made, and a command end for each command is returned in a pseudo manner to the upper side, and data transferred from the upper side is sequentially cached in the cache memory, and each of the software divided A data larger than the upper limit of the data transfer size per command Wherein the control unit issues a command data transfer size performs processing of transferring the data of the cache memory in the peripheral device, to the be made to function.

また、本発明のデバイスドライバは、周辺機器が接続されたパーソナルコンピュータのOSに搭載され、前記周辺機器に対するリードの要求を上限のデータ転送サイズで複数のコマンドに分割して順次送信するソフトウェアの下位側に配置されるデバイスドライバであって、前記パーソナルコンピュータを、前記リードの要求に対応するデータをキャッシュするキャッシュメモリと、前記ドライバが前記上限のデータ転送サイズのリードの要求を受信したとき、この後連続してリードの要求がされると予測し、前記ソフトウェアが分割する各コマンドあたりのデータ転送サイズの上限よりも大きいデータ転送サイズのコマンドを発行して前記周辺機器からデータを読み出して前記キャッシュメモリにキャッシュする処理を行い、その後上位側から順次送信されたリード要求のコマンドに対応するデータが前記キャッシュメモリにキャッシュされている場合に前記キャッシュメモリから当該データを上位側に転送する制御部と、して機能させることを特徴とする。   The device driver of the present invention is installed in the OS of a personal computer to which a peripheral device is connected, and is a lower level of software that sequentially transmits a read request to the peripheral device by dividing it into a plurality of commands with an upper limit data transfer size. A device driver arranged on the side, wherein the personal computer caches data corresponding to the read request, and the driver receives a read request for the upper limit data transfer size. It is predicted that a read request will be made continuously thereafter, and a command having a data transfer size larger than the upper limit of the data transfer size for each command divided by the software is issued to read data from the peripheral device, and the cache Perform processing to cache in memory, then higher Wherein for a control unit to be transferred from the cache memory the data to the upper side, characterized in that to function in the case where data corresponding to the command et sequentially transmitted read request is cached in the cache memory.

このように、本発明のデバイスドライバは、上位側のアプリケーションやデバイスドライバから受信したリード/ライトの要求を統合し、デバイスに転送する。これにより、アプリケーションやデバイスドライバから受信したデータをキャッシュし、ある程度の容量のデータとして、まとめて対象デバイスに転送する。また、その逆に、対象デバイスからある程度の容量をまとめて受信し、キャッシュしたデータとして順次アプリケーションやデバイスドライバに転送する。アプリケーションやデバイスドライバが転送データ容量を制限し、分割してデータを転送する場合であっても、ある程度の容量のデータをまとめて1つの(あるいは数を減らして)コマンド、ステータスを発行し、転送することで、高速化を実現する。また、リード要求を受信したとき、この要求に対応するデータがキャッシュメモリに記憶されていれば、これを転送することができる。一度転送したデータをキャッシュしておけば、次に同じデータのリード要求を受信したときに高速に転送することができる。また、一般に、ストレージデバイスのランダムアクセスは、ヘッドのシーク動作を伴うため、これが転送速度の低下を引き起こすが、上記のようにキャッシュメモリからデータを転送することで、対象デバイスへのリード要求の発行頻度を軽減することができるとともに、対象デバイスのランダムアクセスの発生頻度の軽減にもつながり、さらなる高速化を実現できる。   As described above, the device driver of the present invention integrates the read / write requests received from the higher-order application and the device driver and transfers them to the device. As a result, the data received from the application or device driver is cached and transferred to the target device as a certain amount of data. Conversely, a certain amount of capacity is collectively received from the target device, and sequentially transferred to the application or device driver as cached data. Even when an application or device driver limits the transfer data capacity and divides and transfers the data, it issues a single command (or a reduced number) and status and transfers it. By doing so, speeding up is realized. When a read request is received, if data corresponding to the request is stored in the cache memory, it can be transferred. If the data once transferred is cached, it can be transferred at high speed the next time a read request for the same data is received. In general, since random access of a storage device is accompanied by a seek operation of the head, this causes a decrease in transfer speed. However, by transferring data from the cache memory as described above, issuing a read request to the target device The frequency can be reduced, and the frequency of occurrence of random access of the target device can be reduced, and further speedup can be realized.

この発明によれば、アプリケーションやデバイスドライバが制限するデータ量以上のデータを転送することができるため、転送速度を向上することができる。   According to the present invention, since the data exceeding the data amount limited by the application or the device driver can be transferred, the transfer speed can be improved.

USBインタフェースで接続されるPCと外付HDDを表したブロック図である。2 is a block diagram showing a PC and an external HDD connected by a USB interface. FIG. バルクオンリープロトコルの構成を示した概念図である。It is the conceptual diagram which showed the structure of the bulk only protocol. 本実施形態におけるPCと外付HDDのブロック図である。It is a block diagram of PC and external HDD in this embodiment. OS11上に搭載されている各種ドライバの機能ブロック図である。3 is a functional block diagram of various drivers installed on the OS 11. FIG. 上位側ドライバ151および下位側ドライバ152の詳細な構成を示す機能ブロック図である。3 is a functional block diagram illustrating a detailed configuration of an upper driver 151 and a lower driver 152. FIG. OS11上に搭載されている各種ドライバの機能ブロック図である。3 is a functional block diagram of various drivers installed on the OS 11. FIG. 上位側ドライバ151の動作を示すフローチャートである。3 is a flowchart showing the operation of the upper driver 151. 下位側ドライバ152の動作を示すフローチャートである。5 is a flowchart showing the operation of a lower driver 152. コマンド終了割り込み時の動作を示すフローチャートである。It is a flowchart which shows the operation | movement at the time of a command end interruption. タイマ割り込み、初期化時、ドライバ終了時の動作を示すフローチャートである。It is a flowchart which shows the operation | movement at the time of a timer interruption, initialization, and a driver termination. 本発明のデバイスコントローラを実現する他の例を示すブロック図である。It is a block diagram which shows the other example which implement | achieves the device controller of this invention. 上位側ドライバ151および下位側ドライバ152が別の動作を行う場合の構成を示す機能ブロック図である。It is a functional block diagram which shows a structure in case the high-order side driver 151 and the low-order side driver 152 perform another operation | movement.

PCに搭載されるOSで一般的に普及しているものとしてWindows(登録商標)がある。本実施形態では、Windows(登録商標)XPを搭載しているPCに、USBインタフェースの外付HDDを接続する場合について、図を用いて説明する。なお、本発明においてOSの種別や接続デバイスの種別、インタフェースを限定するものではない。   Windows (registered trademark) is a commonly used OS installed on a PC. In the present embodiment, a case where an external HDD with a USB interface is connected to a PC equipped with Windows (registered trademark) XP will be described with reference to the drawings. In the present invention, the type of OS, the type of connected device, and the interface are not limited.

図3は、本実施形態におけるPCと外付HDDのブロック図である。PC1と外付HDD2はUSBインタフェース(I/F)で接続される。PC1は、全体を管理するOS11上に、種々の処理を行うアプリケーション101、および周辺機器を動作させるための各種ドライバが含まれるドライバ102を搭載している。アプリケーション101は、ドライバ102、USBコントローラ12、およびUSBI/F13を介して外付HDD2に記憶されているデータを読み出し(リード)、外付HDD2にデータを書き込む(ライト)。   FIG. 3 is a block diagram of the PC and the external HDD in this embodiment. The PC 1 and the external HDD 2 are connected by a USB interface (I / F). The PC 1 includes an application 101 that performs various processes and a driver 102 that includes various drivers for operating peripheral devices on an OS 11 that manages the whole. The application 101 reads (reads) data stored in the external HDD 2 via the driver 102, the USB controller 12, and the USB I / F 13, and writes data to the external HDD 2 (write).

外付HDD2は、コントローラ22がUSBI/F21を介してリードまたはライトの要求を受信し、これに応じてHDD23に記憶されているデータをリード、またはHDD23にデータをライトする。   In the external HDD 2, the controller 22 receives a read or write request via the USB I / F 21, and reads data stored in the HDD 23 or writes data to the HDD 23 in response thereto.

図4は、OS11上に搭載されている各種ドライバの機能ブロック図である。同図において、アプリケーション101、汎用ディスクドライバ502、USBマスストレージドライバ503、USBホストコントローラドライバ504、上位側ドライバ151、および下位側ドライバ152は、OS11上に搭載されている機能部である。実際には、これらの機能部は、OS11にインストールされるソフトウェアとして実現する。   FIG. 4 is a functional block diagram of various drivers installed on the OS 11. In the figure, an application 101, a general-purpose disk driver 502, a USB mass storage driver 503, a USB host controller driver 504, an upper driver 151, and a lower driver 152 are functional units mounted on the OS 11. Actually, these functional units are realized as software installed in the OS 11.

アプリケーション101は、ドライバ102に含まれる各種ドライバを介して外付HDD2にリードまたはライトの要求を行う。同図においては、アプリケーション101がライトの要求を行い、データ転送する例を示す。   The application 101 makes a read or write request to the external HDD 2 via various drivers included in the driver 102. FIG. 2 shows an example in which the application 101 makes a write request and transfers data.

アプリケーション101は、上位側ドライバ151に、ライト要求を行い、外付HDD2のHDD23に書き込むべきデータを転送する。上位側ドライバ151は、このライト要求およびデータを下位側である汎用ディスクドライバ502に転送するとともに、アプリケーション101からライト要求があった旨、およびそのデータ量を示す情報をアクセス情報として下位側ドライバ152に送信する。上位側ドライバ151が下位側ドライバ152に転送するアクセス情報については後に詳しく述べる。   The application 101 makes a write request to the higher-level driver 151 and transfers data to be written to the HDD 23 of the external HDD 2. The upper driver 151 transfers this write request and data to the lower-level general-purpose disk driver 502, and uses the information indicating the write request from the application 101 and the amount of data as access information as the lower driver 152. Send to. The access information transferred from the upper driver 151 to the lower driver 152 will be described in detail later.

汎用ディスクドライバ502は、上位側ドライバ151から受信したデータをUSBマスストレージドライバ503に転送する。このとき、USBマスストレージドライバ503のデータ転送サイズの上限が64kBであるため、汎用ディスクドライバ502は、64kB毎に分割してUSBマスストレージドライバ503にデータを転送する。   The general-purpose disk driver 502 transfers the data received from the upper driver 151 to the USB mass storage driver 503. At this time, since the upper limit of the data transfer size of the USB mass storage driver 503 is 64 kB, the general-purpose disk driver 502 transfers the data to the USB mass storage driver 503 by dividing it into 64 kB.

USBマスストレージドライバ503は、バルクオンリープロトコル(図2参照)によりデータ転送を行うため、この64kBに分割されたデータにコマンド、ステータスを付与し、順次、下位側ドライバ152に転送する。   The USB mass storage driver 503 assigns a command and a status to the data divided into 64 kB in order to perform data transfer by the bulk-only protocol (see FIG. 2), and sequentially transfers the data to the lower driver 152.

下位側ドライバ152は、USBマスストレージドライバ503から転送されたデータをキャッシュし、所定のタイミングでUSBホストコントローラドライバ504に転送する。USBホストコントローラドライバ504は、このデータを外付HDD2に転送する。下位側ドライバ152が、USBマスストレージドライバ503から転送されたデータをキャッシュし、ある程度の容量(64kB以上)のデータとして、まとめてUSBホストコントローラドライバ504に転送するため、コマンド、ステータスの発行が1度で(あるいは64kB毎に付与するよりも少なくて)済む。したがって、コマンド、ステータスの処理時間による遅延が最小限で済む。なお、汎用ディスクドライバ502から下位側ドライバ152まで転送されるデータは、64kB毎にコマンド、ステータスが付与されているが、この転送は、OS上のメモリ(RAM)転送であるため、外付HDD2へのデータ転送速度に比較して非常に高速である(RAM転送速度に依存する)。   The lower driver 152 caches the data transferred from the USB mass storage driver 503 and transfers the data to the USB host controller driver 504 at a predetermined timing. The USB host controller driver 504 transfers this data to the external HDD 2. Since the lower-level driver 152 caches the data transferred from the USB mass storage driver 503 and transfers it to the USB host controller driver 504 as a certain amount of data (64 kB or more), the command and status are issued 1 (Or less than every 64 kB). Therefore, the delay due to the command and status processing time can be minimized. The data transferred from the general-purpose disk driver 502 to the lower-level driver 152 is given a command and status every 64 kB. Since this transfer is memory (RAM) transfer on the OS, the external HDD 2 It is very fast compared to the data transfer rate to (depending on the RAM transfer rate).

また、この実施形態において、アプリケーション101が直接USBマスストレージドライバ503にデータ転送する場合があるが、上記と同様、USBマスストレージドライバ503のデータ転送サイズの上限が64kBであるため、アプリケーション101が64kB毎に分割してデータを転送し、USBマスストレージドライバ503がコマンド、ステータスを付与したデータを転送する。この場合においても、下位側ドライバ152がデータをキャッシュしてから下位側にデータ転送するため、コマンド、ステータスの処理時間による遅延が最小限で済む。
次に、上位側ドライバ151および下位側ドライバ152の詳細な動作について説明する。図5は、上位側ドライバ151および下位側ドライバ152の詳細な構成を示す機能ブロック図である。なお、図4と共通する構成については同一の符号を付し、その説明を省略する。上位側ドライバ151は、リード、ライト要求受信部155を備えている。また、下位側ドライバ152は、コントローラ156、データベース157、キャッシュメモリ158A〜158C、タイマ159、およびコマンドキュー160を備えている。
In this embodiment, the application 101 may directly transfer data to the USB mass storage driver 503. As described above, since the upper limit of the data transfer size of the USB mass storage driver 503 is 64 kB, the application 101 has 64 kB. The data is divided for each transfer, and the USB mass storage driver 503 transfers the data with the command and status. Even in this case, since the lower-level driver 152 caches the data and then transfers the data to the lower-level side, the delay due to the command and status processing time can be minimized.
Next, detailed operations of the upper driver 151 and the lower driver 152 will be described. FIG. 5 is a functional block diagram showing a detailed configuration of the upper driver 151 and the lower driver 152. In addition, about the structure which is common in FIG. 4, the same code | symbol is attached | subjected and the description is abbreviate | omitted. The upper driver 151 includes a read / write request receiving unit 155. The lower driver 152 includes a controller 156, a database 157, cache memories 158A to 158C, a timer 159, and a command queue 160.

リード、ライト要求受信部155は、アプリケーション101からリードまたはライトの要求を受信する。リード、ライト要求受信部155は、この要求を下位側の汎用ディスクドライバ502に転送するとともに、要求の内容をアクセス情報として下位側ドライバ152に送信する。リードまたはライトの要求は、汎用ディスクドライバ502、およびUSBマスストレージドライバ503を介して下位側ドライバ152に転送される。   The read / write request receiving unit 155 receives a read or write request from the application 101. The read / write request receiving unit 155 transfers this request to the lower-level general-purpose disk driver 502 and transmits the content of the request to the lower-level driver 152 as access information. The read or write request is transferred to the lower-level driver 152 via the general-purpose disk driver 502 and the USB mass storage driver 503.

アクセス情報には、LBA(Logical Block Addressing:HDDのセクタ指定番号)、転送ブロック数、転送方向などが記載されている。転送ブロック数は転送データの容量を示す。転送方向は、下位側から上側への転送(リード)であるか、上位側から下位側への転送(ライト)であるかを示す情報である。   The access information includes LBA (Logical Block Addressing: HDD sector designation number), the number of transfer blocks, the transfer direction, and the like. The number of transfer blocks indicates the capacity of transfer data. The transfer direction is information indicating whether the transfer is from the lower side to the upper side (read) or from the upper side to the lower side (write).

このアクセス情報は、下位側ドライバ152のデータベース157に予想データベースとして記憶される。下位側ドライバ152のコントローラ156は、USBマスストレージドライバ503からリードまたはライトの要求を受信したとき、データベース157を参照する。予想データベースを参照することで、転送データ容量を予測することができる。   This access information is stored as a prediction database in the database 157 of the lower-level driver 152. When the controller 156 of the lower driver 152 receives a read or write request from the USB mass storage driver 503, the controller 156 refers to the database 157. By referring to the prediction database, the transfer data capacity can be predicted.

また、コントローラ156は、USBマスストレージドライバ503から受信したリードまたはライトの要求を履歴データベースとしてデータベース157に記憶する。履歴データベースは、コントローラ156が予想データベースを作成、修正する場合に用いられる。すなわち、USBマスストレージドライバ503からリードまたはライトの要求を受信したとき、過去の履歴データベースを参照し、LBA、転送ブロック数、転送方向が同一または一部一致する(類似する)ものを予想データベースとして転記する。また、一致する履歴が存在した場合、これと関連する履歴(例えばLBAと転送ブロック数に基づいて、連続して要求があったと判断できるもの)をまとめ、1つのコマンドとして予想データベースに記憶することもできる。なお、履歴データベースは、同図においてはデータベース157内に記憶され、RAM上に一時的に記憶されているが、これをPC1のOS11上、または外付HDD2のHDD23に記憶しておいてもよい。これにより、外付HDD2を再接続したときやPC1を再起動したときにおいても過去の履歴を参照することができる。   Further, the controller 156 stores the read or write request received from the USB mass storage driver 503 in the database 157 as a history database. The history database is used when the controller 156 creates and corrects the prediction database. That is, when a read or write request is received from the USB mass storage driver 503, the past history database is referenced, and the LBA, the number of transfer blocks, and the transfer direction are the same or partially match (similar) are assumed as the expected database. copy. Also, if there is a matching history, the history related to this (for example, one that can be determined to have been continuously requested based on the LBA and the number of transfer blocks) is collected and stored as one command in the prediction database. You can also. In the figure, the history database is stored in the database 157 and temporarily stored in the RAM. However, the history database may be stored in the OS 11 of the PC 1 or the HDD 23 of the external HDD 2. . Thereby, the past history can be referred to even when the external HDD 2 is reconnected or the PC 1 is restarted.

コントローラ156は、USBマスストレージドライバ503から転送された要求がライトの要求であれば、予想データベースの転送ブロック数を参照することで、転送データ容量を予測することができる。このとき、上位側ドライバ151が下位側ドライバ152に、アクセス情報を送信して予想データベースに記憶されている場合は、転送データ容量(ライトすべき全データ)を予測することができる。コントローラ156は、64kB以上のデータ転送が行われると予測した場合、上位側から転送されたデータをキャッシュメモリ158A〜158Cのいずれかに格納する。   If the request transferred from the USB mass storage driver 503 is a write request, the controller 156 can predict the transfer data capacity by referring to the number of transfer blocks in the prediction database. At this time, when the upper driver 151 transmits access information to the lower driver 152 and is stored in the prediction database, the transfer data capacity (all data to be written) can be predicted. When the controller 156 predicts that data transfer of 64 kB or more will be performed, the controller 156 stores the data transferred from the upper side in any of the cache memories 158A to 158C.

キャッシュメモリ158A〜158Cは、RAM上に仮想的に形成されたエリアであり、その数および容量はコントローラ156が設定する。キャッシュメモリの数および容量は、適宜設定し得るが、同図の例では、3つのキャッシュメモリを用意し、それぞれ1MBの容量を設定しているものとする。なお、動作中にキャッシュメモリの数および容量を変化させることも可能である。キャッシュメモリの数および容量はユーザが手動で設定するようにしてもよいし、後述のように動作状態に応じて適宜変化させるようにしてもよい。   The cache memories 158A to 158C are areas virtually formed on the RAM, and the number and capacity thereof are set by the controller 156. The number and capacity of the cache memories can be set as appropriate, but in the example shown in the figure, it is assumed that three cache memories are prepared and each has a capacity of 1 MB. It is also possible to change the number and capacity of cache memories during operation. The number and capacity of the cache memories may be set manually by the user, or may be changed as appropriate according to the operating state as will be described later.

上記のように、コントローラ156は、キャッシュメモリ158A〜158Cのうち、いずれか1つに上位側から転送されたデータを順次、格納する。このライト用のデータを格納したキャッシュメモリがライト用キャッシュメモリとなる。ただし、USBマスストレージドライバ503から64kB毎にコマンド、ステータスが付与されてデータ転送されるため、コントローラ156は、64kBのデータを受信する度に、USBマスストレージドライバ503に対してコマンド終了を擬似的に返信する。   As described above, the controller 156 sequentially stores the data transferred from the higher-order side in any one of the cache memories 158A to 158C. The cache memory storing the write data becomes the write cache memory. However, since a command and status are assigned every 64 kB from the USB mass storage driver 503 and data is transferred, the controller 156 pseudo-ends the command to the USB mass storage driver 503 every time 64 kB data is received. Reply to

コントローラ156は、所定のタイミングで下位側のUSBホストコントローラドライバ504に対し、ライト要求を行い、ライト用キャッシュメモリのデータを転送する。この所定のタイミングは、ライト用キャッシュメモリの容量が一杯になったタイミング、またはタイマ159の割り込み処理により決定されるタイミングである。コントローラ156は、USBマスストレージドライバ503からライト要求を受信したときにタイマ159を作動させる。また、ライト用キャッシュメモリの容量が一杯になった場合も、USBホストコントローラドライバ504に対し、ライト要求を行い、ライト用キャッシュメモリのデータを転送する。   The controller 156 makes a write request to the lower USB host controller driver 504 at a predetermined timing, and transfers the data in the write cache memory. This predetermined timing is the timing when the capacity of the write cache memory is full or the timing determined by the interrupt processing of the timer 159. The controller 156 activates the timer 159 when receiving a write request from the USB mass storage driver 503. Even when the capacity of the write cache memory becomes full, a write request is sent to the USB host controller driver 504 to transfer the data in the write cache memory.

なお、USBホストコントローラドライバ504以下の下位側において他の処理を行っている場合、コントローラ156は、一旦ライト要求をコマンドキュー160に登録しておき、後に下位側の処理が空いているときにライト要求を行う。なお、タイマが無い場合、ライト用キャッシュメモリの内容がそのまま保持され、HDD23に書き込まれなくなるため、この状態で異常発生した場合(USBケーブルが切断されたり、PC1がハングアップした場合)、本来HDD23に書き込まれるべきであったデータが破棄され、ファイル破損等の被害が想定される。そのため、タイマを使用して、例えば一定時間コマンド発行が無い状態が経過した場合に、ライト用キャッシュメモリの内容を書き込みすることで、異常時のファイル破壊等を防止するようにしている。   When other processing is performed on the lower side below the USB host controller driver 504, the controller 156 once registers a write request in the command queue 160, and then writes when the lower side processing is free. Make a request. If there is no timer, the contents of the write cache memory are held as they are and cannot be written to the HDD 23. Therefore, when an abnormality occurs in this state (when the USB cable is disconnected or the PC 1 is hung up), the HDD 23 is originally used. Data that should have been written to is discarded, and damage such as file corruption is assumed. For this reason, for example, when a state in which no command is issued has elapsed for a certain period of time using a timer, the contents of the write cache memory are written to prevent file destruction at the time of abnormality.

以上のようにして、アプリケーション101からデータのライトが行われる。次に、図6において、アプリケーション101がリードの要求を行い、データ転送する例を示す。   Data is written from the application 101 as described above. Next, FIG. 6 shows an example in which the application 101 makes a read request and transfers data.

図6は、OS11上に搭載されている各種ドライバの機能ブロック図である。なお、図4と共通する構成については同一の符号を付し、その説明を省略する。   FIG. 6 is a functional block diagram of various drivers installed on the OS 11. In addition, about the structure which is common in FIG. 4, the same code | symbol is attached | subjected and the description is abbreviate | omitted.

まず、アプリケーション101は、上位側ドライバ151に、リード要求を行う。上位側ドライバ151は、この要求を下位側である汎用ディスクドライバ502に転送するとともに、アプリケーション101からリード要求があった旨(アクセス情報)を下位側ドライバ152に送信する。   First, the application 101 makes a read request to the higher-level driver 151. The higher-level driver 151 transfers this request to the lower-level general-purpose disk driver 502 and transmits a read request (access information) from the application 101 to the lower-level driver 152.

汎用ディスクドライバ502は、上位側ドライバ151から受信したリード要求をUSBマスストレージドライバ503に転送する。このとき、USBマスストレージドライバ503のデータ転送サイズの上限が64kBであるため、汎用ディスクドライバ502は、64kB毎にリード要求を分割する。USBマスストレージドライバ503は、下位側ドライバ152に64kB毎に分割されたリード要求を転送する。   The general-purpose disk driver 502 transfers the read request received from the upper driver 151 to the USB mass storage driver 503. At this time, since the upper limit of the data transfer size of the USB mass storage driver 503 is 64 kB, the general-purpose disk driver 502 divides the read request every 64 kB. The USB mass storage driver 503 transfers the read request divided every 64 kB to the lower driver 152.

下位側ドライバ152は、USBマスストレージドライバ503から64kB毎に分割されたリード要求を受信した場合、この後連続してリード要求がされると予測し、ある程度の容量のデータを転送するように、USBホストコントローラドライバ504に予測リード要求を行う。USBホストコントローラドライバ504は、この予測リード要求に基づいて、ある程度の容量のデータをHDD2のHDD23から読み出す。このリードデータが下位側ドライバ152にキャッシュされる。下位側ドライバ152は、USBマスストレージドライバ503から受信したリード要求にしたがって、キャッシュしたデータを順次、上位側に転送する。ある程度の容量とは、適宜設定すればよいが、転送容量が大きすぎる場合は、転送速度が遅くなる。すなわち、その転送の終了を待ち、その転送の正常終了のステータスを確認するまで、上位側にキャッシュしたデータの転送を開始できないため、転送速度が遅くなる原因となる。また、リード用キャッシュメモリの容量を大きくする必要がある。   When the low-order driver 152 receives a read request divided every 64 kB from the USB mass storage driver 503, the low-order driver 152 predicts that the read request will be continuously issued thereafter, and transfers a certain amount of data. A prediction read request is sent to the USB host controller driver 504. The USB host controller driver 504 reads a certain amount of data from the HDD 23 of the HDD 2 based on the predicted read request. This read data is cached in the lower driver 152. The lower driver 152 sequentially transfers the cached data to the upper side in accordance with the read request received from the USB mass storage driver 503. The certain amount of capacity may be set as appropriate. However, if the transfer capacity is too large, the transfer speed becomes slow. That is, since the transfer of the data cached on the upper side cannot be started until the end of the transfer is waited and the status of the normal end of the transfer is confirmed, the transfer speed becomes slow. In addition, it is necessary to increase the capacity of the read cache memory.

そのため、コントローラ156は、最初に64kB(あるいはそれ以下、32kB等であってもよい。)のリード要求を受信したとき、その所定倍(例えば32kBの4倍である128kB)の容量のデータを読み出してキャッシュする。このキャッシュしたデータが、結果的に全て上位側に転送される場合、さらに所定倍(例えば128kBの4倍である512kB)の容量のデータを読み出す。このように、順次、キャッシュするデータの容量を大きくすることで、転送時間を抑えながら、好適なリード用キャッシュメモリの容量に設定することができる。   Therefore, when the controller 156 first receives a read request of 64 kB (or less, it may be 32 kB, etc.), the controller 156 reads data having a capacity of a predetermined multiple (for example, 128 kB that is four times 32 kB). Cache. When all the cached data is transferred to the upper side as a result, data having a capacity of a predetermined multiple (for example, 512 kB which is four times 128 kB) is read. In this way, by sequentially increasing the capacity of the data to be cached, it is possible to set a suitable capacity of the read cache memory while suppressing the transfer time.

このように、下位側ドライバ152が、外付HDD2からある程度の容量を一度に読み出し、キャッシュしておくことで、外付HDD2に対するコマンド、ステータスの発行が1度で(あるいは64kB毎に付与するよりも少なくて)済む。したがって、コマンド、ステータスの処理時間による遅延が最小限で済む。なお、下位側ドライバ152から汎用ディスクドライバ502まで転送されるデータは、64kBに分割されるが、この転送は、OS上のメモリ(RAM)転送であるため、外付HDD2からのデータ転送速度に比較して非常に高速である(RAM転送速度に依存する)。   In this way, the lower-level driver 152 reads a certain amount of capacity from the external HDD 2 at a time and caches it, thereby issuing commands and statuses to the external HDD 2 at a time (or by giving every 64 kB). Less). Therefore, the delay due to the command and status processing time can be minimized. Note that the data transferred from the lower-level driver 152 to the general-purpose disk driver 502 is divided into 64 kB, but since this transfer is a memory (RAM) transfer on the OS, the data transfer rate from the external HDD 2 is increased. It is very fast compared (depends on the RAM transfer rate).

図5を参照して、上記リード要求発生時の上位側ドライバ151および下位側ドライバ152の詳細な動作について説明する。リード、ライト要求受信部155は、アプリケーション101からリードの要求を受信する。リード、ライト要求受信部155は、この要求を下位側の汎用ディスクドライバ502に転送するとともに、要求の内容をアクセス情報として下位側ドライバ152に送信する。リード要求は、汎用ディスクドライバ502、およびUSBマスストレージドライバ503を介して下位側ドライバ152に転送される。なお、汎用ディスクドライバ502、およびUSBマスストレージドライバ503から転送されるリード要求は64kB毎のリード要求に分割されている。   With reference to FIG. 5, detailed operations of the upper driver 151 and the lower driver 152 when the read request is generated will be described. The read / write request receiving unit 155 receives a read request from the application 101. The read / write request receiving unit 155 transfers this request to the lower-level general-purpose disk driver 502 and transmits the content of the request to the lower-level driver 152 as access information. The read request is transferred to the lower driver 152 via the general-purpose disk driver 502 and the USB mass storage driver 503. Note that read requests transferred from the general-purpose disk driver 502 and the USB mass storage driver 503 are divided into read requests every 64 kB.

上位側ドライバ151が送信したアクセス情報は、下位側ドライバ152のデータベース157に予想データベースとして記憶される。下位側ドライバ152のコントローラ156は、USBマスストレージドライバ503からリード要求を受信したとき、データベース157を参照する。予想データベースを参照することで、転送データ容量(リードすべき全データ)を予測することができる。   The access information transmitted by the upper driver 151 is stored in the database 157 of the lower driver 152 as a prediction database. When the controller 156 of the lower driver 152 receives a read request from the USB mass storage driver 503, the controller 156 refers to the database 157. By referring to the prediction database, the transfer data capacity (all data to be read) can be predicted.

また、USBマスストレージドライバ503から受信したリード要求を履歴データベースとしてデータベース157に記憶する。履歴データベースは、コントローラ156が予想データベースを作成、修正する場合に用いられる。すなわち、USBマスストレージドライバ503からリード要求を受信したとき、過去の履歴データベースを参照し、LBA、転送ブロック数、転送方向が同一または類似するものを予想データベースとして転記する。一致する履歴が存在する場合、これと関連する履歴(例えばLBAと転送ブロック数に基づいて、連続して要求があったと判断できるもの)をまとめ、1つのコマンドとして予想データベースに記憶することもできる。   Further, the read request received from the USB mass storage driver 503 is stored in the database 157 as a history database. The history database is used when the controller 156 creates and corrects the prediction database. That is, when a read request is received from the USB mass storage driver 503, a past history database is referred to, and an LBA, the number of transfer blocks, and a transfer direction that are the same or similar are transferred as a prediction database. If there is a matching history, the history related to this (for example, it can be determined that there is a continuous request based on the LBA and the number of transfer blocks) can be collected and stored as one command in the prediction database. .

コントローラ156は、USBマスストレージドライバ503からリード要求を受信したとき、予想データベースの転送ブロック数を参照することで、転送データ容量(リードすべき全データ)を予測することができる。コントローラ156は、64kB以上のデータ転送が行われると予測した場合、USBホストコントローラドライバ504に予想データベースに記載された64kB以上のデータを転送するようにリード要求を行い、転送されたデータをキャッシュメモリ158A〜158Cのいずれかに格納する。   When the controller 156 receives a read request from the USB mass storage driver 503, the controller 156 can predict the transfer data capacity (all data to be read) by referring to the number of transfer blocks in the prediction database. When the controller 156 predicts that data transfer of 64 kB or more will be performed, it makes a read request to the USB host controller driver 504 to transfer data of 64 kB or more described in the prediction database, and the transferred data is transferred to the cache memory. Store in one of 158A to 158C.

このデータを格納したキャッシュメモリがリード用キャッシュメモリとなる。 コントローラ156は、USBマスストレージドライバ503から転送されるリード要求に応じて、順次リード用キャッシュメモリのデータを転送する。なお、上位側ドライバ151が、リードすべき全データのアクセス情報を送信した場合は、リード用キャッシュメモリに正確に全データをキャッシュすることができるが、アプリケーション101が直接USBマスストレージドライバ503にリード要求を行う場合や上位側ドライバ151がリードすべき全データのアクセス情報を送信しない場合は、コントローラ156が上位側からリード要求を受信したときに予想データベースを作成する必要がある。この場合、上記のように履歴データベースを参照すればよい。例えば、最初に64kB(あるいはそれ以下)のリード要求を受信したとき、そのリード要求に連続した開始LBAから、所定倍の容量のデータがリードされるように予測する。この予測した開始LBAに対するリード要求を上位側のドライバから受信した場合、その予測容量分のリードを行い、予測したデータが全て上位側のドライバからリードされた場合、さらにその予測リードに連続する開始LBAから、さらに所定倍の容量のデータがリードされるように予測する。   The cache memory storing this data becomes the read cache memory. The controller 156 sequentially transfers the data in the read cache memory in response to the read request transferred from the USB mass storage driver 503. When the upper driver 151 transmits access information for all data to be read, all data can be accurately cached in the read cache memory, but the application 101 directly reads the USB mass storage driver 503. When making a request or when the higher-level driver 151 does not transmit access information for all data to be read, it is necessary to create a prediction database when the controller 156 receives a read request from the higher-level side. In this case, the history database may be referred to as described above. For example, when a read request of 64 kB (or less) is received for the first time, it is predicted that a predetermined amount of data will be read from the start LBA continuous with the read request. When a read request for the predicted start LBA is received from the higher-level driver, the predicted capacity is read, and when all predicted data is read from the higher-level driver, the start that continues to the predicted read It is predicted that a predetermined amount of data is read from the LBA.

以上のようにして、アプリケーション101からデータのリードが行われる。   Data is read from the application 101 as described above.

次に、上位側ドライバ151および下位側ドライバ152の動作をフローチャートを用いて説明する。図7(A)は、上位側ドライバ151の動作を示すフローチャートである。上位側ドライバ151は、アプリケーションからリード、ライト要求を受信したとき、この要求の内容をアクセス情報として下位側ドライバ152に送信する(s1)。また、上位側ドライバ151は、下位側(汎用ディスクドライバ502)にリード、ライト要求を転送する(s2)。アクセス情報は、下位側ドライバ152のデータベース157に予想データベースとして記憶される。   Next, operations of the upper driver 151 and the lower driver 152 will be described with reference to flowcharts. FIG. 7A is a flowchart showing the operation of the upper driver 151. When the upper driver 151 receives a read / write request from the application, the upper driver 151 transmits the content of the request to the lower driver 152 as access information (s1). The upper driver 151 transfers a read / write request to the lower side (general-purpose disk driver 502) (s2). The access information is stored as a prediction database in the database 157 of the lower driver 152.

なお、上位側ドライバ151は、図7(B)および図12に示すような動作を行うこともできる。図7(B)は、上位側ドライバ151の別の動作を示す図であり、図12は、この動作を行う場合の上位側ドライバ151および下位側ドライバ152の詳細な構成を示す機能ブロック図である。なお、図5と共通する構成については、同一の符号を付し、その説明を省略する。   Note that the upper driver 151 can also perform the operations shown in FIGS. 7B and 12. FIG. 7B is a diagram showing another operation of the upper driver 151, and FIG. 12 is a functional block diagram showing a detailed configuration of the upper driver 151 and the lower driver 152 when this operation is performed. is there. In addition, about the structure which is common in FIG. 5, the same code | symbol is attached | subjected and the description is abbreviate | omitted.

図7(B)において、上位側ドライバ151は、アプリケーションからリード、ライト要求を受信したとき、転送されるデータ容量が所定量以上(例えば64kB以上)であるか否かを判断する(s5)。所定量以上でなければ要求の内容をアクセス情報として下位側ドライバ152に転送し(s6)、汎用ディスクドライバ502にリード、ライト要求を転送する(s7)。所定量以上であれば、図12に示すように、リード、ライト要求を直接下位側ドライバ152のコントローラ156に転送する(s8)。この場合、汎用ディスクドライバ502にはリード、ライト要求を転送しない。リード、ライト要求を直接コントローラ156に転送することで、64kBにデータが分割されることなく転送することができる。また、汎用ディスクドライバ502、およびUSBマスストレージドライバ503を介さないため、処理時間を短縮することができ、より高速化を期待できる。転送されるデータ容量が所定量以上でなければ、USBマスストレージドライバ503が一度にデータを処理することができるため、下位側(汎用ディスクドライバ502)に転送するようにしている。   In FIG. 7B, when the upper driver 151 receives a read / write request from an application, the upper driver 151 determines whether or not the transferred data capacity is equal to or larger than a predetermined amount (for example, 64 kB or more) (s5). If the amount is not greater than the predetermined amount, the contents of the request are transferred as access information to the lower driver 152 (s6), and the read / write request is transferred to the general-purpose disk driver 502 (s7). If it is equal to or larger than the predetermined amount, as shown in FIG. 12, the read / write request is directly transferred to the controller 156 of the lower driver 152 (s8). In this case, no read / write request is transferred to the general-purpose disk driver 502. By transferring the read / write request directly to the controller 156, the data can be transferred to 64 kB without being divided. Further, since the general-purpose disk driver 502 and the USB mass storage driver 503 are not used, the processing time can be shortened and higher speed can be expected. If the data capacity to be transferred is not a predetermined amount or more, the USB mass storage driver 503 can process the data at a time, so that it is transferred to the lower level (general-purpose disk driver 502).

なお、s5の処理に換えて、リード要求であるか否かの判断としてもよい。リード要求であれば直接下位側ドライバ152のコントローラ156に転送する。コントローラ156では、上位側(USBマスストレージドライバ)からリード、ライト要求を受信したときに予測処理を行うため、特に、リード時には予測結果に基づいてある程度のデータ容量をデバイス側から読み出し、キャッシュしてから上位側に返信するため、その分の遅延が生じる可能性がある。そのため、リード要求時には上位側ドライバ151からコントローラ156に直接この要求を転送し、予測処理やキャッシュ処理を行わず、転送時間(転送開始までの時間)を短縮することができる。   Note that it may be determined whether or not the request is a read request instead of the process of s5. If it is a read request, it is directly transferred to the controller 156 of the lower driver 152. The controller 156 performs prediction processing when a read / write request is received from the upper side (USB mass storage driver). In particular, when reading, a certain amount of data capacity is read from the device side based on the prediction result and cached. Since a reply is sent from the top to the top, there is a possibility that a delay will occur. Therefore, at the time of a read request, this request is directly transferred from the higher-level driver 151 to the controller 156, and the transfer time (time until the start of transfer) can be shortened without performing prediction processing or cache processing.

なお、リード要求であるか否かの判断とs5の判断とをいずれか1つ行うようにしてもよいし、両方行ってもよい。なお、その他の判断手法を用いてもよい。例えば、デバイス側から予めデータを読み出しておき、キャッシュしておくことを重視する場合(アプリケーションが同じデータ内容にアクセスすることを繰り返すような場合)、リード要求時においても直接コントローラ156に要求を転送せずに、下位側に転送する。上位側ドライバ151が下位側ドライバ152のコントローラ156に直接リード、ライト要求を転送する場合、キャッシュメモリにデータが蓄積されない。そのため、アプリケーションが同じファイルにアクセスするような場合であればキャッシュメモリにデータが蓄積されるように下位側に転送すればよい。ただし、下位側ドライバ152がデータを転送するとともに、このデータをキャッシュメモリにコピーすることで、直接リード、ライト要求を受信した場合であっても、データを蓄積することが可能である。この場合、RAM上のコピーであるため、コピー速度は高速であり、処理速度が著しく低下することはない。   It should be noted that either one of the determination as to whether the request is a read request and the determination at s5 may be performed, or both may be performed. Other determination methods may be used. For example, when it is important to read data from the device side in advance and cache it (when the application repeatedly accesses the same data contents), the request is transferred directly to the controller 156 even at the time of a read request. Without transferring to the lower side. When the upper driver 151 transfers a read / write request directly to the controller 156 of the lower driver 152, data is not accumulated in the cache memory. Therefore, if the application accesses the same file, it may be transferred to the lower side so that the data is accumulated in the cache memory. However, by transferring the data and copying the data to the cache memory by the lower driver 152, the data can be accumulated even when a direct read / write request is received. In this case, since the copy is on the RAM, the copy speed is high, and the processing speed is not significantly reduced.

図8は、下位側ドライバ152の動作を示すフローチャートである。上位側ドライバ(USBマスストレージドライバ503またはアプリケーション101)からリード要求、ライト要求、またはその他の要求を受信するとこの動作を開始する。   FIG. 8 is a flowchart showing the operation of the lower driver 152. This operation is started when a read request, write request, or other request is received from the higher-level driver (USB mass storage driver 503 or application 101).

まず、下位側ドライバ152は、アクセス予測を行う(s11)。アクセス予測は、上位側ドライバ151から送信されたアクセス情報や履歴データベースを参照することで行う。また、以下のようにして、精密にアクセス予測を行ってもよい。   First, the lower driver 152 performs access prediction (s11). Access prediction is performed by referring to access information and a history database transmitted from the higher-level driver 151. Further, the access prediction may be performed accurately as follows.

(1)ファイルシステムに基づく予測
この予測手法は、外付HDD2のファイルシステムを解析することでアクセス予測を行う手法である。HDDのファイルシステムが、例えばFATファイルシステムフォーマットである場合、ファイル管理領域を参照することで、個々のファイルの記録位置(セクタ)やサイズを判断することができる。よって、上位側のアプリケーションやドライバからリード要求が有ったとき、その要求が示す記録位置に対応するファイルのデータにアクセスが有ると予測する。またファイルサイズ以上のリードを行わないように予測することで、必要以上のリードをせずに、無駄な処理時間を削減する。
(1) Prediction Based on File System This prediction method is a method for performing access prediction by analyzing the file system of the external HDD 2. When the HDD file system is, for example, the FAT file system format, the recording position (sector) and size of each file can be determined by referring to the file management area. Therefore, when there is a read request from an upper application or driver, it is predicted that there is access to the file data corresponding to the recording position indicated by the request. In addition, by predicting that reading exceeding the file size will not be performed, unnecessary processing time is reduced without excessive reading.

なお、このファイル管理領域は、頻繁にアクセスを行う領域であるため、リード用キャッシュメモリにリードし、保持しておいてもよい。都度、HDD2にアクセスしなくとも、リード用キャッシュメモリに保持しているファイル管理領域にアクセスすることで、アクセス予測の処理時間を削減することができる。   Since this file management area is an area that is frequently accessed, it may be read and held in the read cache memory. Even when the HDD 2 is not accessed each time, the access prediction processing time can be reduced by accessing the file management area held in the read cache memory.

(2)デバイス種別、コンテンツ種別に基づく予測
この予測手法は、接続される対象デバイスのタイプ(上記実施形態ではHDD)や転送すべきデータのファイル構成(コンテンツ種別)に基づいてアクセス予測を行う手法である。例えば、接続されるデバイスがDVD−ROMであり、このデバイスにDVD−Videoメディアが挿入されている場合、順次リードがされ、ライト要求がされることがない。そのため、リード用キャッシュメモリの容量一杯までデータがキャッシュされるように予測データベースを作成する。なお、リード用キャッシュメモリにキャッシュしたデータが全てリードされた場合、即時このキャッシュを破棄し、新たなデータをキャッシュすれば、効率的にリード用キャッシュメモリを用いることができる。
(2) Prediction based on device type and content type This prediction method is a method of performing access prediction based on the type of target device to be connected (HDD in the above embodiment) and the file configuration (content type) of data to be transferred. It is. For example, when the device to be connected is a DVD-ROM and a DVD-Video medium is inserted in this device, reading is sequentially performed and no write request is made. Therefore, a prediction database is created so that data is cached to the full capacity of the read cache memory. When all the data cached in the read cache memory is read, the read cache memory can be used efficiently if the cache is immediately discarded and new data is cached.

また、キャッシュメモリの数および容量を変化させる場合、デバイス種別に基づいて変化させることができる。例えば、上記のようにDVD−Videoメディアが挿入されている場合、ライト要求されることがないため、リード用キャッシュメモリの数を増やし、その容量も大きく設定する。逆に未書き込みのDVD−Rメディアが挿入されている場合、主にライト要求がされるため、ライト用キャッシュメモリの数を増やし、その容量を大きく設定する。   Further, when changing the number and capacity of cache memories, they can be changed based on the device type. For example, when a DVD-Video medium is inserted as described above, no write request is made, so the number of read cache memories is increased and the capacity thereof is set to be large. Conversely, when an unwritten DVD-R medium is inserted, a write request is mainly made, so the number of write cache memories is increased and the capacity thereof is set large.

(3)転送速度の解析に基づく予測
この予測手法は、上記デバイス種別、コンテンツ種別に基づく予測の応用例であり、デバイス種別に応じてデータ転送速度の傾向を判断し、これに基づいてアクセス予測を行う手法である。例えば、多層型DVDメディアが接続される場合、各層の境界線を越えるランダムアクセスは、転送速度が非常に遅くなる。そのため、各層の境界線をまたぐアクセスの頻度が低くなるようにキャッシュするようにして、予測データベースを作成する。
(3) Prediction based on transfer rate analysis This prediction method is an application example of prediction based on the above device type and content type, and determines a data transfer rate trend according to the device type, and access prediction based on this It is a technique to do. For example, when a multi-layer DVD medium is connected, a random access exceeding the boundary line of each layer has a very low transfer rate. Therefore, the prediction database is created by caching so that the frequency of access across the boundary lines of each layer is low.

また、キャッシュメモリの数および容量を変化させる場合には、このデバイス種別やデータ転送速度の傾向に基づいて変化させることもできる。例えば、対象デバイスとのデータ転送速度が遅い場合(例えばUSB MO(光磁気ディスク)のように4MB/s程度である場合)、キャッシュメモリの容量を大きくして大量にデータをキャッシュしても、そもそもデータ転送速度が遅いために転送速度の向上が望めない。そのため、対象デバイスとのデータ転送速度が遅い場合、キャッシュメモリの容量を小さく設定し、RAMの消費を抑える。   Further, when changing the number and capacity of the cache memories, they can be changed based on the tendency of the device type and data transfer speed. For example, when the data transfer speed with the target device is slow (for example, about 4 MB / s as in USB MO (magneto-optical disk)), even if a large amount of data is cached by increasing the capacity of the cache memory, In the first place, since the data transfer speed is slow, it is not possible to improve the transfer speed. For this reason, when the data transfer rate with the target device is slow, the cache memory capacity is set to be small, and the RAM consumption is suppressed.

(4)リード要求時に1度に転送するデータを徐々に増加させる手法
この予測手法は、リード要求時に、上記(1)〜(3)の手法で予測したリード要求に基づいて、対象デバイスから一度にデータ転送しないように、予測データベースを修正する(分割する)手法である。例えばリード要求の所定倍(例えば4倍)の容量のデータをまずキャッシュするように予測データベースを修正する。このキャッシュしたデータが、結果的に全て上位側に転送される場合、さらに所定倍の容量のデータをキャッシュするように予想データベースを修正する。順次、キャッシュするデータの容量を大きくすることで、転送時間を抑えることができる。また、実際の要求が予想データベースと異なり、その後リードが無かった場合に無駄となるデータ量を削減することができる。また、都度キャッシュメモリの容量を変化させることで、RAMの消費を抑えることもできる。なお、予想データベースの修正処理は、実際にリードを行うとき(後述のs29の処理時)に行ってもよい。
(4) Method of gradually increasing data to be transferred at a time at the time of a read request This prediction method is performed once from a target device based on the read request predicted by the methods (1) to (3) above at the time of a read request. This is a method of correcting (dividing) the prediction database so that data is not transferred to the network. For example, the prediction database is modified so that data having a predetermined capacity (for example, four times) of the read request is first cached. When all the cached data is transferred to the upper side as a result, the prediction database is corrected so as to cache data of a predetermined multiple capacity. Sequentially increasing the capacity of the data to be cached can reduce the transfer time. Further, it is possible to reduce the amount of data that is wasted when the actual request is different from the prediction database and there is no read thereafter. In addition, the consumption of RAM can be suppressed by changing the capacity of the cache memory each time. Note that the prediction database correction processing may be performed when reading is actually performed (during the processing of s29 described later).

以上のようにして、アクセス予測を行う。なお、キャッシュメモリの数および容量はユーザが手動で設定することができる。また、ライト用キャッシュメモリ、リード用キャッシュメモリの確保数もユーザが設定することができる。ユーザがリードを優先したい場合はリード用キャッシュメモリの数を増やし、ライトを優先したい場合はライト用キャッシュメモリの数を増やす。   Access prediction is performed as described above. Note that the number and capacity of the cache memory can be manually set by the user. In addition, the number of reserved cache memories for write and read can be set by the user. If the user wants to give priority to reading, the number of read cache memories is increased. If the user wants to give priority to writing, the number of write cache memories is increased.

次に、図8において、下位側ドライバ152は、上側から送信された要求の内容を判断する(s12)。リード、ライトの要求でなければ、対象デバイスが他のリード、ライト等の処理を行っているか否かを判断し(s13)、処理が空いていればこの要求を下位側に転送する(s14)。他の処理を行っていればこの要求をコマンドキューに登録する(s15)。コマンドキューに登録しておけば、後に処理が空いたときに実行することができる。また、FLUSH CACHEコマンドのような、ライト用キャッシュメモリのデータを書き込み指示するようなコマンドを受領した場合、このときにライト用キャッシュメモリにキャッシュされているデータを下位側へ転送する。   Next, in FIG. 8, the lower driver 152 determines the content of the request transmitted from the upper side (s12). If the request is not a read / write request, it is determined whether the target device is performing another read / write process (s13). If the process is not available, the request is transferred to the lower side (s14). . If other processing is being performed, this request is registered in the command queue (s15). If it is registered in the command queue, it can be executed when the process becomes available later. When a command for instructing writing of data in the write cache memory such as the FLUSH CACHE command is received, the data cached in the write cache memory at this time is transferred to the lower side.

s12において、下位側ドライバ152は、リード、ライトの要求であると判断した場合、キャッシュメモリを参照する(s16)。ここで、上位側からの要求がリード要求であり、リード用キャッシュメモリまたはライト用キャッシュメモリに該当するデータがキャッシュされていれば、これを上側に転送し、コマンド終了を返信する(s17)。   In s12, when the lower driver 152 determines that the request is a read / write request, the lower driver 152 refers to the cache memory (s16). Here, if the request from the upper side is a read request and the corresponding data is cached in the read cache memory or the write cache memory, it is transferred to the upper side, and the command end is returned (s17).

s12において、下位側ドライバ152は、上位側からの要求が連続したライト要求であると判断した場合、ライト用キャッシュメモリに連続してデータを書き込み、コマンド終了を返信する(s18)。その後、ライト用キャッシュメモリの容量が一杯であるかを判断し(s19)、容量が一杯でなければタイマを起動させ(s20)、動作を終える。   In s12, if the lower driver 152 determines that the request from the upper side is a continuous write request, the lower driver 152 continuously writes data in the write cache memory and returns a command end (s18). Thereafter, it is determined whether the capacity of the write cache memory is full (s19). If the capacity is not full, a timer is started (s20), and the operation ends.

s19において、ライト用キャッシュメモリの容量が一杯であれば、対象デバイスが他のリード、ライト等の処理を行っているか否かを判断し(s21)、処理が空いていればライト要求を下位側に送信し、キャッシュしたデータを転送する(s22)。他の処理を行っていればこのライト要求をコマンドキューに登録する(s23)。コマンドキューに登録しておけば、後に処理が空いたときに実行することができる。   In s19, if the capacity of the write cache memory is full, it is determined whether or not the target device is performing another read or write process (s21). If the process is free, the write request is sent to the lower side. And cached data is transferred (s22). If other processing is being performed, this write request is registered in the command queue (s23). If it is registered in the command queue, it can be executed when the process becomes available later.

s16において、下位側ドライバ152は、上位側からの要求に該当するキャッシュデータがないと判断した場合、予想データベースを参照し、上位側からの要求と予想データベースの内容を比較する(s24)。上位側からの要求と予想データベースの内容が不一致(LBAや転送ブロック数が不一致)であれば、この要求をそのまま下位側に転送する(s25)。なお、このとき、下位側が他の処理を行っていればコマンドキューに登録し、後に実行するようにしてもよい。   If the lower driver 152 determines in step s16 that there is no cache data corresponding to the request from the upper side, the lower side driver 152 refers to the prediction database and compares the request from the higher side with the content of the prediction database (s24). If the request from the upper side does not match the contents of the prediction database (the LBA and the number of transfer blocks do not match), the request is transferred to the lower side as it is (s25). At this time, if the lower side is performing other processing, it may be registered in the command queue and executed later.

上位側からの要求がライト要求であり、予想データベースの内容と一致(LBAや転送ブロック数が一致)すれば、ライト用キャッシュメモリを確保する(s26)。ここで、空きキャッシュメモリが有れば、そのキャッシュメモリをライト用キャッシュメモリとして確保し、キャッシュメモリが全てライト用またはリード用に用いられていた場合、最も過去に更新したキャッシュメモリの内容を消去してライト用キャッシュメモリを確保する。なお、ライト用キャッシュメモリのデータは、リード用キャッシュメモリのデータとしても使用可能である。   If the request from the upper side is a write request and matches the contents of the expected database (the LBA and the number of transfer blocks match), the write cache memory is secured (s26). Here, if there is an empty cache memory, the cache memory is secured as a write cache memory, and when the cache memory is all used for writing or reading, the contents of the cache memory updated most recently are erased. To secure a write cache memory. Note that the data in the write cache memory can also be used as the data in the read cache memory.

その後、確保したライト用キャッシュメモリに上位側から転送されるデータを保存し、コマンド終了を返信する(s27)。   Thereafter, the data transferred from the upper side is stored in the secured write cache memory, and the command end is returned (s27).

s24において、下位側ドライバ152は、上位側からの要求がリード要求であり、予想データベースの内容と一致(LBAや転送ブロック数が一致)すると判断した場合、リード用キャッシュメモリを確保する(s28)。上記と同様、空きキャッシュメモリが有ればこれをリード用キャッシュメモリとし、空きが無ければ最も過去に更新したキャッシュメモリの内容を消去してリード用キャッシュメモリを確保する。   If the lower driver 152 determines in step s24 that the request from the upper side is a read request and matches the contents of the expected database (the LBA and the number of transfer blocks match), the read side driver memory is secured (s28). . Similarly to the above, if there is a free cache memory, this is used as a read cache memory, and if there is no free space, the contents of the cache memory updated most recently are erased to secure the read cache memory.

その後、予想データベースに基づいて、予想分のリード要求を下位側に送信し、リード用キャッシュメモリにデータをキャッシュする(s29)。このとき、一度に大量のデータをキャッシュするのではなく、複数回に分けてデータキャッシュしてもよい。この場合、残りのリード要求はコマンドキューに登録する。リード要求を複数に分割することで、キャッシュ済みデータを上位側のドライバへ転送しながら、それと並行して、次に連続するリードデータをキャッシュすることができ、USBバスの使用率向上が期待できる。   Thereafter, based on the prediction database, an expected read request is transmitted to the lower side, and the data is cached in the read cache memory (s29). At this time, instead of caching a large amount of data at a time, the data cache may be divided into a plurality of times. In this case, the remaining read requests are registered in the command queue. By dividing the read request into multiple parts, the cached data can be transferred to the higher-level driver, while the next continuous read data can be cached in parallel with it, and the USB bus usage rate can be expected to improve. .

次に、図9は、下位側からのコマンド終了割り込みがあった場合の動作を示すフローチャートである。   Next, FIG. 9 is a flowchart showing the operation when there is a command end interrupt from the lower side.

まず、下位側ドライバ152は、下位側から受信したコマンド終了が、ライト用キャッシュメモリにキャッシュしておいたデータを書き終えた旨を示すコマンドであるか否かを判断する(s31)。ライト用キャッシュメモリのデータが書き終わった場合は、このライト用キャッシュメモリをリード用キャッシュメモリに変更する(s32)。なお、ライト用キャッシュメモリをリード用キャッシュメモリに変更するタイミングは、このタイミングに限るものではない。また、上述のように、ライト用キャッシュメモリのデータをリード用キャッシュメモリのデータとして用いることも無論可能である。   First, the lower driver 152 determines whether or not the command end received from the lower side is a command indicating that the data cached in the write cache memory has been written (s31). When the data in the write cache memory has been written, the write cache memory is changed to a read cache memory (s32). The timing for changing the write cache memory to the read cache memory is not limited to this timing. Of course, as described above, it is possible to use the data in the write cache memory as the data in the read cache memory.

その後、下位側ドライバ152は、上位側に対して終了報告(転送)が必要なコマンドであるか否かを判断する(s33)。必要であれば上位側にコマンド終了を返送する(s34)。   Thereafter, the lower driver 152 determines whether or not the command requires a completion report (transfer) to the upper side (s33). If necessary, the command end is returned to the upper side (s34).

さらに、下位側ドライバ152は、コマンドキュー160を参照し、キューイングされたコマンドが存在するか否かを判断する(s35)。キューイングされたコマンドが存在すれば、これを下位側に転送する(s36)。   Further, the lower-level driver 152 refers to the command queue 160 and determines whether there is a queued command (s35). If there is a queued command, it is transferred to the lower side (s36).

次に、図10は、タイマ割り込み、ドライバ初期化時、ドライバ終了時の動作を示すフローチャートである。   Next, FIG. 10 is a flowchart showing operations at the time of timer interrupt, driver initialization, and driver termination.

まず、同図(A)は、タイマ割り込み動作を示すフローチャートである。下位側ドライバ152は、タイマがタイムアップするとこの動作を開始する。下位側ドライバ152は、ライト用キャッシュメモリにデータがキャッシュされているか否かを確認する(s41)。キャッシュされていれば、下位側にライト要求を送信し、ライト用キャッシュメモリにキャッシュされているデータを下位側に転送し(s42)、動作を終える。ライト用キャッシュメモリにデータがキャッシュされていなければ動作を終える。   First, FIG. 4A is a flowchart showing a timer interrupt operation. The lower driver 152 starts this operation when the timer expires. The lower driver 152 checks whether data is cached in the write cache memory (s41). If it is cached, a write request is transmitted to the lower side, the data cached in the write cache memory is transferred to the lower side (s42), and the operation ends. If no data is cached in the write cache memory, the operation ends.

同図(B)は、ドライバ終了時の動作を示すフローチャートである。PCのシャットダウン時、外付HDD2の接続を解除する時にこの動作を開始する。下位側ドライバ152は、履歴データベースを外付HDD2またはOS11に転記して保存する(s51)。   FIG. 5B is a flowchart showing the operation at the end of the driver. This operation is started when the external HDD 2 is disconnected when the PC is shut down. The lower driver 152 transfers the history database to the external HDD 2 or the OS 11 and saves it (s51).

同図(C)は、ドライバ初期化時の動作を示すフローチャートである。PC1を再起動したり、外付HDD2を再接続した場合にこの動作を開始する。下位側ドライバ152は、履歴データベースを外付HDD2またはOS11から読み出し、RAMに展開してデータベース157を構築する(s61)。   FIG. 3C is a flowchart showing the operation at the time of driver initialization. This operation is started when the PC 1 is restarted or the external HDD 2 is reconnected. The lower driver 152 reads the history database from the external HDD 2 or the OS 11 and expands it in the RAM to construct the database 157 (s61).

なお、上記実施形態では、上位側ドライバ151、下位側ドライバ152を実現し、汎用ディスクドライバ502、またはUSBマスストレージドライバ503に接続される例を示したが、USBマスストレージドライバを専用ドライバに置き換える形でも、本発明のデバイスコントローラを実現することができる。図11は、USBマスストレージドライバを専用ドライバに置き換える場合の例を示す機能ブロック図である。なお、図4と共通する構成については同一の符号を付し、その説明を省略する。   In the above embodiment, the upper driver 151 and the lower driver 152 are realized and connected to the general-purpose disk driver 502 or the USB mass storage driver 503. However, the USB mass storage driver is replaced with a dedicated driver. Also in the form, the device controller of the present invention can be realized. FIG. 11 is a functional block diagram illustrating an example of replacing the USB mass storage driver with a dedicated driver. In addition, about the structure which is common in FIG. 4, the same code | symbol is attached | subjected and the description is abbreviate | omitted.

この例では、USBホストコントローラドライバ504、汎用ディスクドライバ502、およびアプリケーション101に接続される専用USBマスストレージクラスドライバ171を備えている。専用USBマスストレージクラスドライバ171は、従来の標準のUSBマスストレージドライバを置き換えるものである(図1を参照)。   In this example, a USB host controller driver 504, a general-purpose disk driver 502, and a dedicated USB mass storage class driver 171 connected to the application 101 are provided. The dedicated USB mass storage class driver 171 replaces the conventional standard USB mass storage driver (see FIG. 1).

この専用USBマスストレージクラスドライバ171は、上記実施形態と同様に、キャッシュメモリを内蔵しており、上位側から受信したリード、ライト要求に応じてデータをキャッシュする。専用マスストレージクラスドライバ171の動作は図8から図10に示した下位側ドライバの動作と同様である。   This dedicated USB mass storage class driver 171 has a built-in cache memory, as in the above embodiment, and caches data in response to read and write requests received from the upper side. The operation of the dedicated mass storage class driver 171 is the same as the operation of the lower side driver shown in FIGS.

この例においても、アプリケーション101が64kB毎にデータを分割して、リード/ライトの要求を発行する場合は、専用USBマスストレージクラスドライバ171がキャッシュメモリにデータをキャッシュし、データ転送する。   Also in this example, when the application 101 divides data every 64 kB and issues a read / write request, the dedicated USB mass storage class driver 171 caches the data in the cache memory and transfers the data.

なお、この専用USBマスストレージクラスドライバ171は、64kBのデータ転送サイズの上限を持たず、64kBより大きいサイズのリード/ライトの要求を処理可能なものである。したがって、アプリケーション101、または汎用ディスクドライバ501は、リード/ライトの要求を64kB単位に分割することなく発行することが可能であるため、コマンド、ステータスの処理の遅延が少なくて済み、データ転送を高速にすることができる。   The dedicated USB mass storage class driver 171 does not have an upper limit of the data transfer size of 64 kB, and can process a read / write request having a size larger than 64 kB. Therefore, since the application 101 or the general-purpose disk driver 501 can issue a read / write request without dividing it into 64 kB units, the delay of command and status processing can be reduced, and data transfer can be performed at high speed. Can be.

1−PC
2−外付HDD
1-PC
2-External HDD

Claims (4)

周辺機器が接続されたパーソナルコンピュータのOSに搭載され、
前記周辺機器に対するライトの要求を上限のデータ転送サイズで複数のコマンドに分割して順次送信するソフトウェアの下位側に配置されるデバイスドライバであって、
前記パーソナルコンピュータを、
前記ライトの要求に対応するデータをキャッシュするキャッシュメモリと、
当該デバイスドライバが前記上限のデータ転送サイズのライトの要求を受信したとき、この後連続してライトの要求がされると予測し、各コマンドに対するコマンド終了を擬似的に上位側に返信するとともに、上位側から転送されるデータを順次前記キャッシュメモリにキャッシュし、前記ソフトウェアが分割する各コマンドあたりのデータ転送サイズの上限よりも大きいデータ転送サイズのコマンドを発行して前記キャッシュメモリのデータを前記周辺機器に転送する処理を行う制御部と、
して機能させるデバイスドライバ。
Installed in the OS of a personal computer to which peripheral devices are connected,
A device driver arranged on the lower side of software that sequentially transmits a request for writing to the peripheral device by dividing it into a plurality of commands with an upper limit data transfer size,
The personal computer;
A cache memory that caches data corresponding to the write request;
When the device driver receives a write request for the upper limit data transfer size, it predicts that a write request will be continuously issued thereafter, and returns a pseudo command end to each command to the upper side. Data transferred from the upper side is sequentially cached in the cache memory, and a command having a data transfer size larger than the upper limit of the data transfer size for each command divided by the software is issued to transfer the data in the cache memory to the peripheral A control unit that performs processing to transfer to the device;
Device driver to function.
周辺機器が接続されたパーソナルコンピュータのOSに搭載され、
前記周辺機器に対するリードの要求を上限のデータ転送サイズで複数のコマンドに分割して順次送信するソフトウェアの下位側に配置されるデバイスドライバであって、
前記パーソナルコンピュータを、
前記リードの要求に対応するデータをキャッシュするキャッシュメモリと、
当該デバイスドライバが前記上限のデータ転送サイズのリードの要求を受信したとき、この後連続してリードの要求がされると予測し、前記ソフトウェアが分割する各コマンドあたりのデータ転送サイズの上限よりも大きいデータ転送サイズのコマンドを発行して前記周辺機器からデータを読み出して前記キャッシュメモリにキャッシュする処理を行い、その後上位側から順次送信されたリード要求のコマンドに対応するデータが前記キャッシュメモリにキャッシュされている場合に前記キャッシュメモリから当該データを上位側に転送する制御部と、
して機能させるデバイスドライバ。
Installed in the OS of a personal computer to which peripheral devices are connected,
A device driver arranged on the lower side of software that sequentially sends a read request to the peripheral device by dividing it into a plurality of commands with an upper limit data transfer size,
The personal computer;
A cache memory that caches data corresponding to the read request;
When the device driver receives a read request for the upper limit data transfer size, it is predicted that a read request will be continuously issued thereafter, and the software driver divides the upper limit of the data transfer size per command divided by the software. Issue a command with a large data transfer size, read the data from the peripheral device and cache it in the cache memory, and then cache the data corresponding to the read request command sequentially sent from the upper side in the cache memory A control unit that transfers the data from the cache memory to the higher-order side when
Device driver to function.
前記制御部は、USBマスストレージデバイスである前記周辺機器とデータ転送を行うことを特徴とする請求項1または2に記載のデバイスドライバ。   The device driver according to claim 1, wherein the control unit performs data transfer with the peripheral device that is a USB mass storage device. 前記制御部は、OS標準のUSBマスストレージドライバで動作する前記周辺機器とデータ転送を行うことを特徴とする請求項3に記載のデバイスドライバ。   The device driver according to claim 3, wherein the control unit performs data transfer with the peripheral device operating with an OS standard USB mass storage driver.
JP2009233192A 2009-10-07 2009-10-07 Device driver Active JP4959766B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009233192A JP4959766B2 (en) 2009-10-07 2009-10-07 Device driver

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009233192A JP4959766B2 (en) 2009-10-07 2009-10-07 Device driver

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2007112043A Division JP4391548B2 (en) 2007-04-20 2007-04-20 Device driver

Publications (2)

Publication Number Publication Date
JP2010009622A JP2010009622A (en) 2010-01-14
JP4959766B2 true JP4959766B2 (en) 2012-06-27

Family

ID=41589940

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009233192A Active JP4959766B2 (en) 2009-10-07 2009-10-07 Device driver

Country Status (1)

Country Link
JP (1) JP4959766B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9563443B2 (en) 2014-08-22 2017-02-07 Renesas Electronics Corporation Information processing device, peripheral device control method, and non-transitory computer readable medium storing filter driver for controlling a power state of a peripheral device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6539874B2 (en) * 2016-03-29 2019-07-10 サイレックス・テクノロジー株式会社 Device server system

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5519853A (en) * 1993-03-11 1996-05-21 Legato Systems, Inc. Method and apparatus for enhancing synchronous I/O in a computer system with a non-volatile memory and using an acceleration device driver in a computer operating system
JPH1040170A (en) * 1996-07-26 1998-02-13 Toshiba Corp Disk cache system
JP2000353126A (en) * 1999-06-09 2000-12-19 Mitsubishi Electric Corp Method for redividing buffer cache of computer system and computer system with buffer cache redividing function
JP4176933B2 (en) * 1999-10-29 2008-11-05 株式会社東芝 RECORDING MEDIUM RECORDING EXTERNAL STORAGE DEVICE DRIVER PROGRAM AND COMPUTER HAVING EXTERNAL STORAGE DEVICE ACCESS FUNCTION
JP2001154811A (en) * 1999-11-30 2001-06-08 Toshiba Corp Computer system
JP4053842B2 (en) * 2002-03-13 2008-02-27 株式会社日立製作所 Computer system
JP2006309579A (en) * 2005-04-28 2006-11-09 Hitachi Ltd Storage control apparatus and storage system
US7383392B2 (en) * 2005-05-31 2008-06-03 Hewlett-Packard Development Company, L.P. Performing read-ahead operation for a direct input/output request

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9563443B2 (en) 2014-08-22 2017-02-07 Renesas Electronics Corporation Information processing device, peripheral device control method, and non-transitory computer readable medium storing filter driver for controlling a power state of a peripheral device

Also Published As

Publication number Publication date
JP2010009622A (en) 2010-01-14

Similar Documents

Publication Publication Date Title
JP4391548B2 (en) Device driver
TWI394164B (en) Interruptible cache flushing in flash memory systems
TWI438628B (en) Data storage system and data storage medium
US6467022B1 (en) Extending adapter memory with solid state disks in JBOD and RAID environments
US7447836B2 (en) Disk drive storage defragmentation system
JP4788528B2 (en) Disk control device, disk control method, and disk control program
US8225044B2 (en) Storage system which utilizes two kinds of memory devices as its cache memory and method of controlling the storage system
US20100325352A1 (en) Hierarchically structured mass storage device and method
WO2014102879A1 (en) Data storage apparatus and control method thereof
JP2007241927A (en) Data storage device and method
US9104578B2 (en) Defining address ranges used to cache speculative read data
US20080025706A1 (en) Information recording apparatus and control method thereof
JP3568110B2 (en) Cache memory control method, computer system, hard disk drive, and hard disk controller
WO2007146845A2 (en) Configurable and scalable hybrid multi-tiered caching storage system
JP4959766B2 (en) Device driver
JP4391569B2 (en) Information processing system
JP2007102436A (en) Storage controller and storage control method
JP5594647B2 (en) Storage apparatus and control method thereof
JP4563314B2 (en) Storage system control device, storage system control program, and storage system control method
JP2007323377A (en) Recording apparatus, method for writing management data and method for repairing management data
JP4814983B2 (en) Data storage control device, data storage control method, and data storage control program
JP5216719B2 (en) Information processing apparatus and control apparatus
JP2007188408A (en) Storage device and its method
JP2006185335A (en) Information processor and method for controlling this information processor
JP2020115275A (en) Information processing device and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100414

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120306

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120321

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

Free format text: PAYMENT UNTIL: 20150330

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4959766

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250