JP3641239B2 - Apparatus and method for controlling a memory card - Google Patents
Apparatus and method for controlling a memory card Download PDFInfo
- Publication number
- JP3641239B2 JP3641239B2 JP2001398177A JP2001398177A JP3641239B2 JP 3641239 B2 JP3641239 B2 JP 3641239B2 JP 2001398177 A JP2001398177 A JP 2001398177A JP 2001398177 A JP2001398177 A JP 2001398177A JP 3641239 B2 JP3641239 B2 JP 3641239B2
- Authority
- JP
- Japan
- Prior art keywords
- command
- memory card
- state
- direct
- extended
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Description
【0001】
【発明の属する技術分野】
本発明はメモリカードを制御するための装置および方法に関し、特に受付可能な動作コマンドの種類が異なる複数のステートのいずれかで動作するメモリカードをホストシステムからのアクセスコマンドに応じて制御するための装置および方法に関する。
【0002】
【従来の技術】
近年、パーソナルコンピュータ、PDA、カメラ、携帯電話等の様々な携帯型電子機器が開発されている。これら電子機器においては、リムーバブル記憶デバイスの1つであるメモリカードが多く用いられている。メモリカードとしては、PCMCIAカード(PCカード)、およびそれよりもさらに小型のSD(Secure Digital)カード、が知られている。
【0003】
このSDカードはフラッシュメモリを内蔵するメモリカードであり、セキュリティ、容量、および高速化の要求に見合うように特に設計されている。SDカードは音楽データなどのコンテンツの著作権保護を目的としたセキュリティ機能を有しており、SDカードに記憶した音楽データをその不正コピーなどから保護することができる。
【0004】
一般に、このようなセキュリティ機能付きメモリカードは、カード内にコントローラと、ユーザが自由にアクセス可能なデータ記憶領域であるユーザデータエリアと、セキュリティ機能に守られたデータ記憶領域であるセキュアエリアが設けられている。
【0005】
メモリカードがメモリカードアダプタ(ホストコントローラ)のようなメモリカード制御装置を介してパーソナルコンピュータに接続された場合、オペレーティングシステムからのアクセスコマンドはメモリカード制御装置によってカード制御用の1以上の動作コマンドに変換された後にメモリカードに送られる。オペレーティングシステムからはメモリカード内のユーザデータエリアはディスク装置と同様のストレージデバイスとして見えるが、セキュアエリアの存在は全く知ることができない。セキュアエリアをアクセスできるのは、コンテンツ保護のための専用の認証機構を備えた特別なアプリケーションプログラム及び再生機器のみである。
【0006】
これらアプリケーションプログラム及び再生機器は、セキュアエリアをアクセスするために、メモリカード制御装置に対してセキュアエリアアクセス用の専用のアクセスコマンドを発行する。専用のアクセスコマンドはメモリカード制御装置によって1以上の動作コマンドに変換されてメモリカードに送られる。
【0007】
【発明が解決しようとする課題】
しかし、このように専用のアクセスコマンドをメモリカード用の動作コマンドに変換してセキュアエリアをアクセスするという構成では、メモリカードのセキュリティ機能等に関する動作コマンドの拡張や、アプリケーションプログラムインタフェース(API)の変更に伴う専用コマンドの変更等が生じると、それに合わせてメモリカード制御装置自体も新たに設計し直す必要がある。
【0008】
さらに、一般にメモリカードにおいては、様々なステートが定義されており、ステート毎に受け付け可能な動作コマンドが決まっている。よって、メモリカード制御装置はメモリカードの現在のステートを常に意識しながら、発行すべき動作コマンドの実行に必要なステートにメモリカードを遷移させるという複雑なステート管理制御を行う必要がある。
【0009】
本発明は上述の事情を考慮してなされたもので、メモリカードのセキュリティ機能等に関する動作コマンドの拡張やアプリケーションプログラムインタフェース(API)の変更等に柔軟に対応することができ、しかもメモリカードのステート管理制御の単純化を図ることが可能なメモリカード制御装置およびメモリカード制御方法を提供することを目的とする。
【0010】
【課題を解決するための手段】
上述の課題を解決するため、本発明は、受付可能な動作コマンドの種類が異なる複数のステートのいずれかで動作するメモリカードを、ホストシステムからのアクセスコマンドに応じて制御するメモリカード制御装置において、前記ホストシステムが前記メモリカードのアクセスのために発行する、前記メモリカードが実行すべき動作を直接的に指定する動作コマンドとその動作コマンドが修飾コマンドの発行が必要な拡張コマンドであるか否かを示す拡張コマンドフラグ情報と前記動作コマンドに対応する動作を実行すべき前記メモリカードのステートを示す実行ステート情報とを含むダイレクトコマンドを受信する手段と、前記受信したダイレクトコマンドに従って、前記メモリカードをその定常ステートとして予め決められた特定のステートから前記受信したダイレクトコマンドに含まれる実行ステート情報によって指定されたステートに遷移させる処理、前記拡張コマンドフラグ情報が前記ダイレクトコマンドに含まれる動作コマンドが拡張コマンドであることを示すことを条件に、修飾コマンドを前記メモリカードに発行する処理、前記受信したダイレクトコマンドに含まれる前記動作コマンドを前記メモリカードに発行して前記動作コマンドに対応する動作を前記メモリカードに実行させる処理、および前記メモリカードを前記特定のステートに戻す処理を、順次実行するダイレクトコマンド実行手段とを具備することを特徴とする。
【0011】
このメモリカード制御装置においては、ホストシステムからメモリカードをアクセスするためのアクセスコマンドとして、メモリカードに実行すべき動作を直接的に指定する動作コマンドを含むダイレクトコマンドが用いられている。さらに、このダイレクトコマンドには拡張コマンドフラグ情報と実行ステート情報とが含まれており、ダイレクトコマンドに含まれる動作コマンドが修飾コマンドの発行が必要な拡張コマンドであるか否か、およびその動作コマンドをメモリカードのどのステートで実行すべきかも、ダイレクトコマンドによって同時に指定される。ホストシステム上で実行されるソフトウェア等からダイレクトコマンドを受信した場合、1)メモリカードをダイレクトコマンドに含まれる実行ステート情報によって指定されたステートに遷移させる処理、2)拡張コマンドフラグ情報がダイレクトコマンドに含まれる動作コマンドが拡張コマンドであることを示す際に、修飾コマンドをメモリカードに発行する処理、3)ダイレクトコマンドに含まれる動作コマンドをメモリカードに発行して動作コマンドに対応する動作をメモリカードに実行させる処理、および4)メモリカードをその定常ステートとして予め決められた特定のステートに戻す処理が、順次実行される。
【0012】
このようなダイレクトコマンドを用いることにより、ダイレクトコマンドに含まれる動作コマンドをそのままメモリカードに発行することが可能となるので、インテレジェントなアクセスコマンドを解釈してそのアクセスコマンドを1以上の動作コマンドに変換するといった処理は不要となる。このため、ダイレクトコマンドを例えばセキュアエリアのアクセスに使用することにより、セキュリティ機能の追加・変更等に伴う動作コマンドの拡張、およびアプリケーションプログラムインタフェース(API)の変更等がなされても、ダイレクトコマンドを発行するソフトウェアのアップデートのみでそれに対応することが可能となる。
【0013】
さらに、1つのダイレクトコマンドの実行処理過程において、メモリカードを実行ステート情報で指定されたステートに遷移させた後に、拡張コマンドであれば修飾コマンドの発行後に動作コマンドを発行し、拡張コマンドでなければ修飾コマンドを発行せずに動作コマンドを発行し、そしてその動作コマンドの発行後にメモリカードのステートを定常ステートに戻すという処理が自動的に行われるので、ステート遷移を伴うダイレクトコマンドを実行しても、必要な修飾コマンドおよび動作コマンドを正しいステートで実行させることが可能となると共に、その実行処理後は常にメモリカードのステートはステート遷移前の定常ステートに戻される。このようにメモリカードを定常ステートに維持しておくことにより、ホストシステムおよびメモリカード制御装置のどちらにおいても、メモリカードのステート管理を一切行うことなく、ダイレクトコマンドに含まれる実行ステージ情報に従ってメモリカードのステートを遷移させるだけで、所望の動作をメモリカードに正常に実行させることが可能となる。特に、修飾コマンドそれ自体をダイレクトコマンドとするのではなく、上述したように拡張コマンドフラグ情報をダイレクトコマンドに含ませているので、ステート遷移後に修飾コマンドと動作コマンドをこの順に発生するという一連の処理を一つのダイレクトコマンドに対する処理として実行することが可能となり、拡張コマンドについても正しく実行することが可能となる。
【0014】
【発明の実施の形態】
以下、図面を参照して本発明の実施形態を説明する。
図1には、本発明の一実施形態に係るメモリカード制御装置を用いたデータ処理装置システムの構成が示されている。このデータ処理装置システムは、ホスト装置11と、ホスト装置11にSDメモリカード13を接続するためのSDカードアダプタ12とから構成されている。ホスト装置11は例えばパーソナルコンピュータなどのデータ処理装置である。本例では、SDカードアダプタ12はUSB(Universal Serial Bus)デバイスとして実現されており、USBケーブル117を介してホスト装置11のUSBコントローラ116に接続される。
【0015】
SDカードアダプタ12には、SDメモリカード13を着脱自在に装着することができる。SDメモリカード13はコンテンツの著作権保護を目的としたセキュリティ機能を有するメモリカードである。SDメモリカード13には、ユーザが自由にリード/ライトアクセス可能なデータ記憶領域であるストレージエリア(ユーザデータエリアとも言う)131と、セキュリティ機能に守られたデータ記憶領域であるセキュアエリア132が設けられている。
【0016】
SDメモリカード13には様々なステートが定義されており、SDカードアダプタ12からの動作コマンド、およびSDメモリカード13の内部動作の進捗に合わせてステートの遷移が行われる。この場合、SDメモリカード13が受け付けおよび実行可能な動作コマンドの種類はステート毎に決められており、ある動作コマンドに対応する動作をSDメモリカード13に実行させるためには、その動作コマンドを受付けおよび実行可能なステートにSDメモリカード13を前もって設定しておくことが必要となる。
【0017】
ホスト装置11においては、図示のように、データファイルを扱うファイラソフトなどの通常のアプリケーションプログラム111と、著作権保護機能を持つアプリケーションプログラム(SDアプリケーションプログラム)112が実行される。
【0018】
アプリケーションプログラム111は、ホスト装置11上で実行されるオペレーティングシステム(OS)の一部であるファイルシステム113を通じて、ストレージエリア131へのデータファイルの書き込み、およびストレージエリア131からのデータファイルの読み出しを行うことが出来る。
【0019】
すなわち、オペレーティングシステム(OS)のUSBストレージクラスドライバ114は、ファイルシステム113を介して入力されるアプリケーションプログラム111からのファイル操作要求に応じて、USBドライバ115、USBコントローラ116を介してSDカードアダプタ12に対してアクセスコマンドを発行する。これにより、OSのファイルシステム113は、SDメモリカード13のストレージエリア131をディスク装置と同様のストレージデバイスとして扱うことが出来る。
【0020】
このアクセスコマンドはATAコマンドに準拠したインテリジェントなディスクアクセスコマンドであり、SDカードアダプタ12によってSDメモリカード13用の1以上の動作コマンドに変換された後にSDメモリカード13に送られる。以下、ストレージエリア131のアクセスのためにOSのUSBストレージクラスドライバ114からSDカードアダプタ12に発行されるアクセスコマンドを、“OSストレージコマンド”と称することにする。
【0021】
SDアプリケーションプログラム112は、SDメモリカード13のセキュリティ機能に対応した専用の認証機構を備えており、SDメモリカード13のストレージエリア131のみならず、セキュアエリア132をもアクセスすることができる。セキュアエリア132をアクセスする場合、SDアプリケーションプログラム112は、USBドライバ115、USBコントローラ116を介してSDカードアダプタ12に対してアクセスコマンドを発行する。
【0022】
このアクセスコマンドはSDメモリカード13にそのまま発行することが可能なダイレクトコマンドであり(パススルーコマンド)、SDメモリカード13に実行させるべき動作を直接的に指定可能なSDカード13用の動作コマンドを含んでいる。
【0023】
さらに、このダイレクトコマンドには、そのダイレクトコマンドのパラメータとして実行ステート情報と拡張コマンドフラグ情報とが含まれている。実行ステート情報は、当該ダイレクトコマンドに含まれる動作コマンドに対応する動作をSDメモリカード13のどのステートで実行すべきかを指定する。また拡張コマンドフラグ情報は、当該ダイレクトコマンドに含まれる動作コマンドが修飾コマンドの発行が必要な拡張コマンドであるか否かを示す。拡張コマンドとは、修飾コマンドと動作コマンドとのペアで表現されるコマンドであり、ダイレクトコマンドに含まれる動作コマンドが拡張コマンドである場合には、修飾コマンドの発行の後に動作コマンドの発行が行われることになる。
【0024】
以下、セキュアエリア132のアクセスのためにSDアプリケーションプログラム112からSDカードアダプタ12に発行されるアクセスコマンドを、“実行ステート付きSDダイレクトコマンド”と称することにする。
【0025】
SDカードアダプタ12は、そのSDカードスロットに装着されたSDメモリカード13を、SDメモリカード13を使用するホストシステムからのアクセスコマンドに応じて制御する。SDカードアダプタ12が接続されたホスト装置11が、具体的にはホスト装置11上で実行されるOSおよびSDアプリケーションプログラム112がそれぞれホストシステムとして機能する。
【0026】
SDカードアダプタ12には、ホストコントローラ121が内蔵されている。ホストコントローラ121はホスト装置11とSDメモリカード13との間のインタフェースを行うためのものであり、SDバス124を介してSDメモリカード13との間の通信を実行する。このホストコントローラ121はマイクロコンピュータを用いて実現されている。SDメモリカード13とホストコントローラ121との間の通信は全てホストコントローラ121からの動作コマンドによって制御される。
【0027】
ホストコントローラ121は、OSストレージコマンド実行部122とSDダイレクトコマンド実行部123を有している。OSストレージコマンド実行部122は上述のOSストレージコマンドを解釈及び実行して、OSストレージコマンドで要求されたデータリード/ライト動作をSDメモリカード13に実行させる為に必要な1以上の動作コマンドを生成し、それら動作コマンドを用いてSDメモリカード13を制御する。
【0028】
さらに、OSストレージコマンド実行部122は、OSストレージコマンドを解釈及び実行した後、SDメモリカード13のステートを予め決められた特定のステートに戻すための処理を実行する。これは、OSストレージコマンドのコマンド処理実行後は、常にSDメモリカード13をある特定の定常ステートに維持しておくためである。
【0029】
SDダイレクトコマンド実行部123は上述の実行ステート付きSDダイレクトコマンドを実行する。この実行ステート付きSDダイレクトコマンドの実行過程においては、1)SDメモリカード13を実行ステート情報によって指定されたステートに遷移させる処理、2)拡張コマンドフラグ情報が、実行ステート付きSDダイレクトコマンドに含まれる動作コマンドが拡張コマンドであることを示す際に、修飾コマンドをメモリカードに発行する処理、3)実行ステート付きSDダイレクトコマンドに含まれる動作コマンドをSDメモリカード13にそのまま発行してその動作コマンドに対応する動作をSDメモリカード13に実行させる処理、および4)SDメモリカード13を上述の特定のステートに遷移させてSDメモリカード13のステートを定常ステートに戻す処理が、この順で順次実行される。これにより、ステート遷移を伴う実行ステート付きダイレクトコマンドを実行しても、その実行処理後は常にSDメモリカード13のステートはステート遷移前の定常ステートに戻されることになる。
【0030】
なお、実行ステート情報によって指定されたステートが定常ステートである場合は、1)と4)の処理は省略され、2)3)の処理だけが実行される。また、実行ステート付きSDダイレクトコマンドに含まれる動作コマンドが拡張コマンドではない場合には、2)の修飾コマンドの発行処理は行われず、3)の実行ステート付きSDダイレクトコマンドに含まれる動作コマンドの発行処理のみが実行される。
【0031】
このように、SDカードアダプタ12においては、ホスト装置11からのアクセスコマンドが受信され、その受信されたアクセスコマンドがOSストレージコマンドであるか、実行ステート付きダイレクトコマンドであるかに応じて、互いに異なる処理が実行される。
【0032】
次に、図2を参照して、SDメモリカード13の構成の一例について説明する。
【0033】
SDメモリカード13には、図示のように、インタフェースドライバ回路201、カードインタフェースコントローラ202、メモリコアインタフェース203、およびメモリコア204が内蔵されている。メモリコア204は例えばフラッシュEEPROM等の不揮発性メモリから構成されており、この不揮発性メモリの記憶空間に上述のストレージエリア131とセキュアエリア132が設けられている。
【0034】
カードインタフェースコントローラ202は、インタフェースドライバ回路201を介してホストコントローラ121から受信した動作コマンドに応じた動作を実行する内部コア回路である。このカードインタフェースコントローラ202には、セキュアエリア132に関する各種ステータス情報の格納に用いられるレジスタ群も内蔵されている。
【0035】
セキュアエリア132に関する各種ステータス情報もセキュアエリア132と同様にカードインタフェースコントローラ202のセキュリティ機能によって保護されており、その意味で、セキュアエリア132に関する各種ステータス情報の格納に用いられるレジスタ群も、セキュアエリア132の一部である。よって、セキュアエリア132に関する各種ステータス情報のリードアクセスについても、上述の実行ステート付きダイレクトコマンドを用いて実行される。
【0036】
メモリコアインタフェース203は、カードインタフェースコントローラ202の制御の下、メモリコア204へのデータ書き込み及びメモリコア204からのデータ読み出しを実行する。
【0037】
SDバス124には、6本の通信線(データDAT0−3,コマンドCMD,クロックCLK)と3本の電源供給線(VDD,VSS,VSS)が定義されている。6本の通信線(データDAT0−3,コマンドCMD,クロックCLK)の機能は次の通りである。
【0038】
・DAT0−3: 各データ線はホストコントローラ121とSDメモリカード13との間のデータ転送に使用される双方向信号線である。
・CMD: ホストコントローラ121からSDメモリカード13への動作コマンド(単にコマンドと言う場合もある)の転送、およびSDメモリカード13からホストコントローラ121へのレスポンスの転送に使用される。
【0039】
・CLK: クロック信号線はホストコントローラ121からSDメモリカード13へクロック信号CLKを送信するための信号線である。ホストコントローラ121からSDメモリカード13への動作コマンドの転送、およびホストコントローラ121とSDメモリカード13との間のデータ転送などは、クロック信号CLKに同期して実行される。
【0040】
図3には、SDメモリカード13の代表的な2つのステートとそれらステートそれぞれで受付および実行可能な動作コマンドとの関係の一例が示されている。
【0041】
SDメモリカード13においては、以下のようなステートが定義されている。
【0042】
・ スタンドバイステート(Stand-by State)
・ トランスファステート(Transfer State)
・ データ送信ステート(Sending-data State)
・ データ受信ステート(Receive-data State)
・ プログラミングステート(Programming State)
・ ディスクコネクトステート(Disconnect State)
この内、スタンドバイステート(Stand-by State)は電力消費の少ない一種のパワーセーブステートであり、このステートで受付け及び実行可能な動作コマンドは、メモリコア204のアクセスに関する動作コマンド以外の動作コマンド、例えば、“SD_information”コマンド、“SD_transfer”コマンド、等である。“SD_information”コマンドは、セキュアエリア132に関する各種ステータス情報などの取得を要求する動作コマンドである。“SD_transfer”コマンドはトランスファステートへの遷移を要求する動作コマンドである。
【0043】
トランスファステート(Transfer State)は、SDメモリカード13がホストコントーラ121からのメモリコア204のアクセスに関する動作コマンドを受付けることが可能なステートであり、このステートでは、例えば、“SD_read”コマンド、“SD_write”コマンド、“SD_standby”コマンド、等が受け付け可能である。
【0044】
“SD_read”コマンドはメモリコア204のストレージエリア131からのデータ読み出しを要求する動作コマンドであり、また“SD_write”コマンドはメモリコア204のストレージエリア131へのデータ書き込みを要求する動作コマンドである。トランスファステート(Transfer State)で“SD_read”コマンドを受信したとき、SDメモリカード13は、データ送信ステート(Sending-data State)に移行する。データ送信ステート(Sending-data State)はメモリコア204からデータを読み出して、SDメモリカード13からホストコントローラ121に、読み出しデータを送信するステートである。リードコマンド処理が完了すると、SDメモリカード13は、トランスファステート(Transfer State)に戻る。
【0045】
トランスファステート(Transfer State)で“SD_write”コマンドを受信したときは、SDメモリカード13は、データ受信ステート(Receive-data State)に移行する。データ受信ステート(Receive-data State)はホストコントーラ121から転送される書き込みデータを受信してカードインタフェースコントローラ202内のバッファメモリに蓄積するステートである。全ての書き込みデータの受信が終了すると、SDメモリカード13は、データ受信ステート(Receive-data State)からプログラミングステート(Programming State)に移る。プログラミングステート(Programming State)は、バッファメモリに蓄積されている書き込みデータをメモリコア204に書き込んでいるステートである。データ書き込みが終了すると、SDメモリカード13は、トランスファステート(Transfer State)に戻る。
【0046】
“SD_standby”コマンドは、トランスファステートへの遷移を要求する動作コマンドである。なお、“SD_standby”コマンドと“SD_transfer”コマンドは実際には同一の動作コマンド(CMD7)で表現され、スタンバイステートで動作コマンド(CMD7)を受信すると、トランスファステートへの遷移が行われ、トランスファステートで動作コマンド(CMD7)を受信すると、スタンバイステートへの遷移が行われる。
【0047】
さらに、トランスファステートにおいては、メモリコア204のセキュアエリア132からのデータ読み出しを要求する“SD_secure_read”コマンド、メモリコア204のセキュアエリア132へのデータ書き込みを要求する“SD_secure_write”コマンド、さらに、セキュアエリア132の記憶サイズを取得するための拡張コマンドである“SDA_SecureSize”コマンドを受付けることも出来る。“SD_secure_read”コマンド、および“SD_secure_write”コマンドを受付けたときのSDメモリカード13のステート遷移動作は、上述した“SD_read”コマンド、および“SD_write”コマンドを受付けた場合と同様である。また、“SDA_SecureSize”コマンドは拡張コマンドであるので、“SDA_SecureSize”コマンドの発行前に、修飾コマンド“SD_ACMD”を発行することが必要となる。
【0048】
なお、修飾コマンド“SD_ACMD”はスタンバイステート、およびトランスファステートのどちらでも使用可能なコマンドではあるが、修飾コマンド“SD_ACMD”に後続して発行される動作コマンドがスタンバイステートでのみ使用可能なコマンドであれば修飾コマンド“SD_ACMD”もスタンバイステートで発行することが必要となり、また修飾コマンド“SD_ACMD”に後続して発行される動作コマンドがトランスファステートでのみ使用可能なコマンドであれば修飾コマンド“SD_ACMD”もトランスファステートで発行することが必要となる。
【0049】
本実施形態では、上述の定常ステートしてトランスファステートが用いられる。スタンバイステートに設定する必要がある場合以外はSDメモリカード13を常にトランスファステートに維持しておくことにより、メモリコア204のアクセスに関する動作コマンドをSDメモリカード13に即座に発行することが可能となる。この場合、実行ステート情報としては、スタンバイステートに遷移する必要があるかどうかを示す実行ステート遷移フラグ情報であるスタンバイフラグ情報(Stand-by flag)を使用することが出来る。
【0050】
次に、OSから発行されるアクセスコマンド(OSストレージコマンド)と、SDアプリケーションプログラム112から発行されるアクセスコマンド(実行ステート付きダイレクトコマンド)との間の調停動作について説明する。
【0051】
ここでは、まず、実行ステート付きダイレクトコマンドを用いる意味を明確にするために、SDアプリケーションプログラム112から発行されるダイレクトコマンドに実行ステートが付随していない場合を想定する。
【0052】
SDアプリケーションプログラム112はSDメモリカード13が直接解釈可能な動作コマンドを用いたダイレクトコマンドをアクセスコマンドとして発行する。このため、セキュアエリア132に関する各種ステータス情報などの取得を要求する場合には、SDアプリケーションプログラム112は、図4に示すように、3つのダイレクトコマンド、すなわち“SD_standby”コマンド、“SD_information”コマンド、“SD_transfer”コマンド、を順次発行する。
【0053】
ホスト装置11においては、全てのプログラムがマルチタスク形式で並列的に実行されている。オペレーティングシステムとSDアプリケーションプログラム112も並列実行されるので、例えばSDアプリケーションプログラム112からの“SD_standby”コマンドの発行と“SD_information”コマンドの発行との間に、OSからOSストレージコマンドが発行される場合もある。このOSストレージコマンドがストレージエリア131からのデータ読み出しを要求するためのIOリード要求コマンドOS_readである場合、SDカードアダプタ12はIOリード要求コマンドOS_readを“SD_read”コマンドに変換して、SDメモリカード13に発行する。
【0054】
したがって、SDメモリカード13が受信する動作コマンドの順番は、“SD_standby”コマンド、“SD_read”コマンド、“SD_information”コマンド、“SD_transfer”コマンドとなる。
【0055】
“SD_read”コマンドはトランスファステートでのみ受付け可能なコマンドであるので、“SD_read”コマンドに対応する動作を正常にSDメモリカード13に実行させることはできない。以降の“SD_information”コマンド、“SD_transfer”コマンドに対応するSDメモリカード13の動作も保証されない。
【0056】
本実施形態では、実行ステート付きダイレクトコマンドを用いているので、上述のような不具合は生じない。この様子を図5に示す。
【0057】
図5に示されているように、SDアプリケーションプログラム112は、“SD_information”コマンドとそれを実行すべきステート(ここではスタンバイステート)を示す実行ステート情報(Stand-by flag=“1”)とを含む実行ステート付きダイレクトコマンドを生成し、それをSDカードアダプタ12に1つのアクセスコマンドとして発行する。
【0058】
SDカードアダプタ12は、SDアプリケーションプログラム112から実行ステート付きダイレクトコマンドを受信すると、その実行ステート付きダイレクトコマンドを実行して、3つの動作コマンド、すなわち“SD_standby”コマンド、“SD_information”コマンド、“SD_transfer”コマンド、をSDメモリカード13に順次発行する。SDカードアダプタ12はOSまたはSDアプリケーションプログラム112からのアクセスコマンドを受付順に順次実行する。したがって、OSからSDカードアダプタ12に対してアクセスコマンド、例えばIOリード要求コマンドOS_readが何時発行されても、図4で説明したような不具合は生じない。
【0059】
さらに、本実施形態では、修飾コマンド“SD_ACMD”自体を実行ステート付きダイレクトコマンドとして発行するのではなく、当該実行ステート付きダイレクトコマンド内に、そのダイレクトコマンド内に含まれる動作コマンドが拡張コマンドであるかどうかを示す拡張コマンドフラグ情報をパラメータとして含めている。これは、もし、修飾コマンド“SD_ACMD”自体をダイレクトコマンドとして発行すると、図6に示すような問題が生ずるからである。
【0060】
図6は、拡張コマンドフラグ情報を用いずに、修飾コマンド“SD_ACMD”自体をダイレクトコマンドとして発行する場合の例である。ここでは、拡張コマンドである“SDA_SecureSize”コマンドを用いてセキュアエリア132のサイズを取得するために、SDアプリケーションプログラム112が、まず、修飾コマンド“SD_ACMD”コマンドをダイレクトコマンドとして発行し、その後に“SDA_SecureSize”コマンドをダイレクトコマンドとして発行した場合を想定する。
【0061】
もしSDアプリケーションプログラム112からの“SD_ACMD”コマンドの発行と“SDA_SecureSize”コマンドの発行との間に、OSから例えばOS_readが発行された場合には、SDメモリカード13が受信する動作コマンドの順番は、“SD_ACMD”コマンド、“SD_read”コマンド、“SDA_SecureSize”コマンドとなる。
【0062】
“SD_read”コマンドは拡張コマンドではないにも関わらず、その直前に“SD_ACMD”コマンドが発行されているので、SDメモリカード13は“SD_ACMD”コマンドを正常に実行することが出来なくなる。また後続する“SDA_SecureSize”コマンドについても、SDメモリカード13はその“SDA_SecureSize”コマンドを拡張コマンドであると認識することが出来ないので、“SDA_SecureSize”コマンドを正常に実行することはできなくなる。
【0063】
本実施形態では、修飾コマンド“SD_ACMD”コマンドを独立したダイレクトコマンドとして発行するのではなく、実行ステート付きダイレクトコマンドの中に当該ダイレクトコマンドに含まれる動作コマンドが拡張コマンドであるかどうかを示す拡張フラグ情報(ACMD flag)を埋め込んでいるので、上述のような不具合は生じない。この様子を図7に示す。
【0064】
図7に示されているように、“SDA_SecureSize”コマンドを発行する場合には、SDアプリケーションプログラム112は、“SDA_SecureSize”コマンドと、それが拡張コマンドであることを示す拡張フラグ情報(ACMD flag=“1”)と、“SDA_SecureSize”コマンドを実行すべきステートを示す実行ステート情報(ここではトランスファステートであるので、Stand-by flag=“0”)とを含む実行ステート付きダイレクトコマンドを生成し、それをSDカードアダプタ12に1つのアクセスコマンドとして発行する。
【0065】
SDカードアダプタ12は、SDアプリケーションプログラム112から上述の実行ステート付きダイレクトコマンドを受信すると、その実行ステート付きダイレクトコマンドを実行して、“SD_ACMD”コマンド、“SDA_SecureSize”、をSDメモリカード13に順次発行する。SDカードアダプタ12はOSまたはSDアプリケーションプログラム112からのアクセスコマンドを受付順に順次実行する。したがって、OSからSDカードアダプタ12に対してアクセスコマンド、例えばIOリード要求コマンドOS_readが何時発行されても、図6で説明したような不具合は生じない。
【0066】
また、ここでは実行ステートの遷移を伴わない場合を例示したが、Stand-by flag=“1”で、且つACMD flag=“1”の場合には、先に“SD_standby”コマンドを発行してスタンバイステートへのステート遷移を行った後に、“SD_ACMD”コマンドが発行される。これは、“SD_ACMD”コマンドとそれに後続する拡張コマンドとを常に一対のコマンドとしてSDメモリカード13に渡すためである。よって、例えば、スタンバイステートで実行することが必要なある特定の拡張コマンド、例えば“SDA_information”、を実行する場合を想定すると(Stand-by flag=“1”、ACMD flag=“1”)、SDカードアダプタ12は、“SD_standby”コマンド、“SD_ACMD”コマンド、“SDA_information”コマンド、“SD_transfer”コマンド、をこの順でSDメモリカード13に発行することになる。
【0067】
次に、図8を参照して、受信したアクセスコマンドがOSストレージコマンドであるか実行ステート付きダイレクトコマンドであるかをSDカードアダプタ12がどのようにして判別するかについて説明する。
【0068】
本例では、SDカードアダプタ12をUSBデバイスとして実現しているので、OSまたはSDアプリケーションプログラム112からのアクセスコマンドはUSBパケットの形式でSDカードアダプタ12に送られる。USBパケット内には通常は使用されない予約フィールドがある。
【0069】
SDアプリケーションプログラム112は、USBドライバ115に実行ステート付きダイレクトコマンドの送信を要求するとき、予約フィールドにフラグ“1”を設定するようにUSBドライバ115に要求する。SDカードアダプタ12は、受信したUSBパケットの予約フィールドが“1”であるか“0”であるかによって、受信したUSBパケットのペイロード等に含まれるアクセスコマンドがOSストレージコマンドであるか実行ステート付きダイレクトコマンド(ベンダ・ユニークコマンド)であるかを判別することが出来る。
【0070】
図9には、実行ステート付きダイレクトコマンドのフォーマットの一例が示されている。
【0071】
実行ステート付きダイレクトコマンドは4バイトからなる。オペレーションコード(Operation Code)は、実行ステート付きダイレクトコマンドに含まれる動作コマンドのタイプを示すパラメータである。動作コマンドのタイプは、
・データなしコマンド: SDメモリカード13との間のデータ転送が一切不要な動作コマンド
・リードデータありコマンド: SDメモリカード13からのデータ読み出しを伴う動作コマンド
・ライトデータありコマンド: SDメモリカード13へ書き込むべきライトデータを伴う動作コマンド
の3種類がある。
【0072】
スタンバイフラグ情報(Stand-by flag)は、上述したように、実行ステートを指定するパラメータ(実行ステート情報)である。Stand-by flag=“1”は、動作コマンド(動作コマンドが拡張コマンドの場合には、修飾コマンドと動作コマンド)をスタンバイステートで実行すべきことを示す。本実施形態では、SDメモリカード13の定常ステートはトランスファステートであるので、Stand-by flag=“1”は、動作コマンド発行前にSDメモリカード13をスタンバイステートに遷移させ、動作コマンド(動作コマンドが拡張コマンドの場合には、修飾コマンドと動作コマンド)を発行してそれに対応する動作が完了した後にSDメモリカード13をトランスファステートに戻すことを、意味している。Stand-by flag=“0”は、動作コマンド(動作コマンドが拡張コマンドの場合には、修飾コマンドと動作コマンド)の発行前にSDメモリカード13のステート遷移を行う必要がないこと、言い換えれば、動作コマンドを定常ステートであるトランスファステートで実行すべきことを示す。
【0073】
拡張コマンドフラグ情報(ACMD flag)は、上述したように実行ステート付きダイレクトコマンドに含まれる動作コマンドが拡張コマンドであるかどうかを示す。ACMD flag=“1”は拡張コマンドであることを示す。コマンドインデックス情報(Command Index to the memory card)は動作コマンドを示すものであり、当該動作コマンドのコマンド番号から構成される。ACMD flag=“1”の場合には、コマンドインデックス情報で指定されたコマンド番号の動作コマンドの発行に先立って、拡張コマンドであることを示す動作コマンド(CMD55)が発行される。
【0074】
アーギュメント情報(Command Argument to the memory card)は当該動作コマンドに関する変数等を示す。転送長情報(Data transfer length)は、当該動作コマンドが書き込みデータまたは読み出しデータを伴うコマンドである場合に、その書き込みデータまたは読み出しデータのデータ転送長を示す。
【0075】
次に、図10を参照して、ホストコントローラ121の具体的な構成の一例について説明する。
【0076】
ホストコントローラ121には、上述のOSストレージコマンド実行部122、およびSDダイレクトコマンド実行部123に加え、図示のように、コマンド入力バッファ301、コマンドディスパッチャ302、SDバスインタフェース309を備えている。コマンド入力バッファ301は例えば先入れ先出し方式のプーリングバッファであり、OSまたはSDアプリケーションプログラム112から発行されるアクセスコマンドを受信し、その受信したアクセスコマンドを一時的に蓄積する。
【0077】
コマンドディスパッチャ302は、コマンド入力バッファ301に蓄積されたアクセスコマンドの種類に応じて、それをOSストレージコマンド実行部122およびSDダイレクトコマンド実行部123のどちらに実行させるかを決定する。すなわち、コマンドディスパッチャ302は、OSまたはSDアプリケーションプログラム112から発行されたアクセスコマンドがOSストレージコマンドと実行ステート付きダイレクトコマンドのいずれであるかを判別し、OSストレージコマンドであればOSストレージコマンド実行部122にそのコマンドを処理させ、実行ステート付きダイレクトコマンドであればSDダイレクトコマンド実行部123にそのコマンドを処理させる。この判別処理は、先に発行されたアクセスコマンドから順に行われる。
【0078】
OSストレージコマンド実行部122には、OSストレージコマンド解釈部303、SDコマンド発行部304、およびステート復元部305が設けられている。OSストレージコマンド解釈部303は、コマンドディスパッチャ302から受け取ったOSストレージコマンドを解釈し、そのOSストレージコマンドによって指定された要求に対応する動作をSDメモリカード13に実行させるために必要な1以上の動作コマンドを決定する。これら決定された動作コマンドはSDコマンド発行部304に通知される。また決定された動作コマンドの中に、スタンバイステートへの遷移を示す“SD_standby”コマンドが含まれる場合には、そのことがステート復元部305に通知される。つまり、OSストレージコマンド解釈部303は、どの動作コマンドがSDメモリカード13のどのステートで実行可能であるかを管理しており、定常ステートであるトランスファステートでは実行できず、スタンバイステートに遷移させることが必要な動作コマンドについては、その動作コマンドの前に“SD_standby”コマンドを発行すべきことを決定する。
【0079】
SDコマンド発行部304は、OSストレージコマンドによって指定された要求に対応する動作をSDメモリカード13に実行させるために、OSストレージコマンド解釈部303から通知された1以上の動作コマンドをSDバスインタフェースを通じてSDメモリカード13に発行する。
【0080】
ステート復元部305は、SDメモリカード13の動作完了後に、SDメモリカード13のステートを定常ステート(トランスファステート)に戻すために、“SD_transfer”コマンドを発行する。OSストレージコマンドによって指定された要求に対応する動作が全てトランスファステートで実行できる場合、つまりSDメモリカード13に発行された動作コマンドの中に、スタンバイステートへの遷移を示す“SD_standby”コマンドが含まれていない場合には、SDメモリカード13はトランスファステートに維持されているため、ステート復元部305による“SD_transfer”コマンドの発行は行われない。
【0081】
SDダイレクトコマンド実行部123には、SDダイレクトコマンド解釈部306、実行ステート解釈部307、およびSDコマンド発行部308が設けられている。SDダイレクトコマンド解釈部306はコマンドディスパッチャ302から受け取った実行ステート付きダイレクトコマンドに含まれるコマンドインデックス情報を取り出し、そのコマンドインデックス情報で示されるコマンドコード番号をそのまま、発行すべき動作コマンドとしてSDコマンド発行部308に通知する(コマンドパススルー)。さらに、SDダイレクトコマンド解釈部306は、拡張コマンドフラグ情報(ACMD flag)に基づいて当該実行ステート付きダイレクトコマンドに含まれるコマンドインデックス情報(動作コマンド)が拡張コマンドであるか否かの判別も行う。拡張コマンドであれば、SDダイレクトコマンド解釈部306、先に修飾コマンド“SD_ACMD”を発行した後にコマンドインデックス情報で示されるコマンドコード番号を発行すべきことをSDコマンド発行部308に指示する。
【0082】
実行ステート解釈部307は、コマンドディスパッチャ302から受け取った実行ステート付きダイレクトコマンドに含まれる実行ステート情報(Stand-by flag)を解釈し、Stand-by flag=“1”であれば、SDコマンド発行部308に対して、SDダイレクトコマンド実行部123から通知された動作コマンド(拡張コマンドの場合には、修飾コマンドと動作コマンド)の発行前に“SD_standby”コマンドを発行し、且つSDダイレクトコマンド実行部123から通知された動作コマンド(拡張コマンドの場合には、修飾コマンドと動作コマンド)に対応するSDメモリカード13の動作が完了した後に“SD_transfer”コマンドを発行すべきことを、通知する。
【0083】
SDコマンド発行部308は、SDダイレクトコマンド解釈部306および実行ステート解釈部307からの指示に従い、SDバスインタフェース309を介してSDメモリカード13に動作コマンドを発行する。
【0084】
次に、図11を参照して、OSストレージコマンドおよび実行ステート付きダイレクトコマンドがSDカードアダプタ12によってどのように処理されるかについて説明する。
【0085】
例えばアプリケーションプログラム111がOSのファイルシステム113に対してストレージエリア131に記憶されているデータの読み出しを要求した場合には、OSのUSBストレージクラスドライバ114からはIOリード要求コマンドOS_readがアクセスコマンドとして発行され、それがUSBドライバ115を介してSDカードアダプタ12のOSストレージコマンド実行部122に送られる。OSストレージコマンド実行部122では、IOリード要求コマンドOS_readがSDメモリカード13用の動作コマンドであるSD_readに変換される。このSD_readがSDメモリカード13に送られることにより、ストレージエリア131からデータを読み出すためのリードアクセスが実行される。ストレージエリア131から読み出されたデータは、IOリード要求コマンドOS_readに対する応答として、SDカードアダプタ12、USBストレージクラスドライバ114、ファイルシステム113を介して、アプリケーションプログラム111に渡される。
【0086】
一方、例えばSDアプリケーションプログラム112がセキュアエリア132に関するステータス情報を取得する場合には、SDアプリケーションプログラム112は、スタンバイステートで“SD_information”コマンドを実行すべきことを示す、実行ステート付きダイレクトコマンド(SD_information on standby state)を発行する(ACMD flagは“0”)。この実行ステート付きダイレクトコマンドは、OSのファイルシステム113およびUSBクラスドライバ114を介さずに、SDカードアダプタ12のSDダイレクトコマンド実行部123に送られる。SDダイレクトコマンド実行部123からSDメモリカード13には、“SD_standby”コマンド、“SD_information”コマンド、“SD_transfer”コマンド、がこの順に送られる。“SD_information”コマンドに対応する動作を実行することによってSDメモリカード13から読み出された情報は、OSのファイルシステム113などを介さずに、実行ステート付きダイレクトコマンド(SD_information on standby state)に対する応答としてSDアプリケーションプログラム112に渡される。
【0087】
次に、図12のフローチャートを参照して、SDカードアダプタ12のホストコントローラ121によって実行されるカード制御処理の手順について説明する。
【0088】
ホストコントローラ121は、コマンド入力バッファ301に蓄積されている最も旧いアクセスコマンドをコマンド入力バッファ301から取り出し、それがOSストレージコマンドであるか、実行ステート付きSDダイレクトコマンドであるかを判別する(ステップS101)。この判別は、例えば、図8で説明したようにUSBパケットの予約フィールドのビット値に基づいて行えばよい。もしOSストレージコマンドであれば(ステップS101のNO)、ホストコントローラ121は、OSストレージコマンド実行部122を起動し、それにOSストレージコマンドを処理させる(ステップS109)。OSストレージコマンド実行部122によるOSストレージコマンド処理の詳細は図13で後述する。
【0089】
一方、実行ステート付きSDダイレクトコマンドであれば(ステップS101のYES)、ホストコントローラ121は、SDダイレクトコマンド実行部123を起動し、それに実行ステート付きSDダイレクトコマンドを処理させる。SDダイレクトコマンド実行部123は、まず、Stand-by flag=“1”であるかどうかを判別し(ステップS102)、もしStand-by flag=“1”であれば(ステップS102のYES)、スタンバイステートへの遷移を示す“SD_standby”コマンド(CMD7)をSDメモリカード13に発行して、SDメモリカード13を定常ステート(トランスファステート)からスタンバイステートに遷移させる(ステップS103)。一方、Stand-by flag=“0”であれば(ステップS102のNO)、“SD_standby”コマンド(CMD7)は発行されず、SDメモリカード13は定常ステート(トランスファステート)に維持される。
【0090】
次いで、SDダイレクトコマンド実行部123は、ACMD flag=“1”であるかどうかを判別し(ステップS104)、もしACMD flag=“1”であれば(ステップS104のYES)、後続して発行される動作コマンドが拡張コマンドであることを示す動作コマンドである修飾コマンド“SD_ACMD”(=CMD55)をSDメモリカード13に発行する(ステップS105)。一方、ACMD flag=“0”であれば(ステップS104のNO)、CMD55は発行されない。そして、SDダイレクトコマンド実行部123は、コマンドインデックス情報(Command Index to the memory card)で指定されたコマンド番号の動作コマンドをSDメモリカード13に発行して、その動作コマンドに対応する動作をSDメモリカード13に実行させる(ステップS106)。この場合、必要に応じて、アーギュメント情報(Command Argument to the memory card)で指定された変数等も、当該動作コマンドのパラメータとしてSDメモリカード13に発行される。
【0091】
当該動作コマンドに対応する処理が完了した後、SDダイレクトコマンド実行部123は、SDメモリカード13がスタンバイステートに遷移されているかどうか、つまりStand-by flag=“1”に起因してステップS103にてCMD7を発行したかどうかを判別する(ステップS107)。SDメモリカード13がスタンバイステートに遷移されている場合、つまりステップS103にてCMD7を発行した場合には(ステップS107のYES)、SDダイレクトコマンド実行部123は、SDメモリカード13を定常ステートであるトランスファステートに戻すために、CMD7をSDメモリカード13に再度発行する。
【0092】
以下、SDアプリケーションプログラム112がセキュアエリア132の記憶サイズを取得する場合と、SDメモリカード13のカード属性(メモリクラスタサイズ等)を取り出す場合の例を示す。SDメモリカード13のカード属性は、セキュアエリア132と直接関係する情報ではないが、SDアプリケーションプログラム112から発行されるアクセスコマンドは常に実行ステート付きダイレクトコマンドである。
【0093】
<セキュアエリア132の記憶サイズを取得する場合>
SDメモリカード13からセキュアエリア132の記憶サイズを取得するための動作コマンド“SDA_SecureSize”は、コマンド番号13の拡張コマンド(ACMD13)である。この拡張コマンド(ACMD13)はトランスファステートで受け付けおよび実行可能なコマンドである。SDアプリケーションプログラム112が発行する実行ステート付きダイレクトコマンドは、以下の通りである。
【0094】
Operation Code =リードデータありコマンド
Stand-by flag =0
ACMD flag =1
Command Index =13
この実行ステート付きダイレクトコマンドを受け取ったホストコントローラ121は以下の処理を実行する。
【0095】
(1)Stand-by flag=0であることを確認する。
【0096】
(2)ACMD flag=1、つまり拡張コマンドであることを確認する。
【0097】
(3)CMD55を発行する。
【0098】
(4)Command Indexの内容(13)をCMD13として発行して、SDメモリカード13からセキュアエリア132の記憶サイズを取得する。
【0099】
(5)Stand-by状態に遷移していないことを確認し、終了する。
【0100】
<カード属性(メモリクラスタサイズ等)を取得する場合>
SDメモリカード13からカード属性(メモリクラスタサイズ等)を取得するための動作コマンドは、コマンド番号9の動作コマンド(CMD9)である。この動作コマンド(CMD9)はスタンバイステートで受け付けおよび実行可能なコマンドである。SDアプリケーションプログラム112が発行する実行ステート付きダイレクトコマンドは、以下の通りである。
【0101】
Operation Code =リードデータありコマンド
Stand-by flag =1
ACMD flag =0
Command Index =9
この実行ステート付きダイレクトコマンドを受け取ったホストコントローラ121は以下の処理を実行する。
【0102】
(1)Stand-by flag=1であることを確認する。
【0103】
(2)CMD7を発行して、SDメモリカード13をその定常ステートであるトランスファステートからスタンバイステートに遷移させる。
【0104】
(3)ACMD flag=0、つまり拡張コマンドではないことを確認する。
【0105】
(4)Command Indexの内容(9)をCMD9として発行して、SDメモリカード13からカード属性を取得する。
【0106】
(5)Stand-by状態に遷移していることを確認する。
【0107】
(6)CMD7を再度発行して、SDメモリカード13をトランスファステートに戻し、終了する。
【0108】
以上のように、本実施形態おいては、受信したアクセスコマンドに対応する処理が完了するたびにSDメモリカード13はトランスファステートに戻されるので、SDアプリケーションプログラム112は、SDメモリカード13の現在のステートを一切考慮する必要が無く、単にスタンバイステートに遷移する必要がある動作コマンドを発行する場合にStand-by flagを“1”に設定すればよい。この場合、Stand-by flagを“1”に設定すべきか否かは、発行すべき動作コマンドによって一義的に決定される。また、ホストコントローラ121もStand-by flagの内容に従ってステート遷移が必要か否かを判断できるので、SDメモリカード13の現在のステートを一切考慮する必要はない。また実行ステート付きダイレクトコマンドには拡張コマンドフラグ情報(ACMD flag)も含まれているので、修飾コマンドを独立したダイレクトコマンドとして発行することによる不具合を回避できる。特にStand-by flag=“1”、ACMD flag=“1”の場合には、状態遷移後に、修飾コマンドと動作コマンドをこの順に発行することで、拡張コマンドを正常に実行することが可能となる。
【0109】
さらに、SDメモリカード13に直接発行可能な動作コマンドのコマンド番号自体がSDアプリケーションプログラム112から指定されるので、セキュリティ機能の拡張などの目的でSDメモリカード13のコマンド拡張等が行われても、それに合わせてSDアプリケーションプログラム112をバージョンアップするだけで済み、ホストコントローラ121の仕様については一切変更する必要がない。
【0110】
次に、図13のフローチャートを参照して、図12のステップS109で実行されるOSストレージコマンド処理の手順を説明する。
【0111】
OSストレージコマンド実行部122は、まず、受信したOSストレージコマンドを解釈して、OSストレージコマンドで要求された処理をSDメモリカード13に実行させるために必要な動作コマンド、およびその動作コマンドを受付けることが可能なSDメモリカード13のステートを決定する(ステップS201)。OSストレージコマンド実行部122は、決定した動作コマンドを受付けることが可能なSDメモリカード13のステートがもしスタンバイステートであれば(ステップS202のNO)、SDメモリカード13はその定常ステートであるトランスファステートに維持されているので、スタンバイステートへの遷移を示す“SD_standby”コマンド(CMD7)をSDメモリカード13に発行して、SDメモリカード13を定常ステート(トランスファステート)からスタンバイステートに遷移させる(ステップS203)。一方、決定した動作コマンドを受付けることが可能なSDメモリカード13のステートがもしトランスファステートであれば(ステップS202のYES)、SDメモリカード13はその定常ステートであるトランスファステートに維持されているので、トランスファステートに遷移させるための処理は省略される。
【0112】
この後、OSストレージコマンド実行部122は、ステップS201で決定した動作コマンドをSDメモリカード13に発行して、その動作コマンドに対応する動作をSDメモリカード13に実行させる(ステップS204)。この場合、必要に応じて、変数等も当該動作コマンドのパラメータとしてSDメモリカード13に発行される。当該動作コマンドに対応する処理が完了した後、OSストレージコマンド実行部122は、SDメモリカード13がスタンバイステートに遷移されているかどうか、つまりステップS203にてCMD7を発行したかどうかを判別する(ステップS205)。SDメモリカード13がスタンバイステートに遷移されている場合、つまりステップS203にてCMD7を発行した場合には(ステップS205のYES)、OSストレージコマンド実行部122は、SDメモリカード13を定常ステートであるトランスファステートに戻すために、CMD7をSDメモリカード13に再度発行する(ステップS206)。
【0113】
このように、OSストレージコマンドの処理のためにSDメモリカード13をスタンバイステートに遷移させた場合には、そのコマンド処理後に、SDメモリカード13は自動的にトランスファステートに戻される。よって、OSストレージコマンドの実行後も、SDメモリカード13をトランスファステートに維持することが出来る。
【0114】
なお、本実施形態では、トランスファステートをSDメモリカード13の定常ステートとして使用したが、これはSDメモリカード13がトランスファステートである間は、SDメモリカード13のステート遷移処理無しで、メモリコア204のアクセスに関する動作コマンドを即座にSDメモリカード13に発行できるようにするためである。
【0115】
原理的には、スタンバイステートをSDメモリカード13の定常ステートとして使用してもよい。この場合、実行ステート付きダイレクトコマンドには、Stand-by flagの代わりに、トランスファステートに遷移すべきかいなかを示すTransfer flagが設定されることになる。
【0116】
また、ホストコントローラ121は、パーソナルコンピュータ、PDA、デー処理装置として機能するホスト装置11に内蔵することも出来る。この場合、SDメモリカード13はホスト装置11に設けられたカードスロットに取り外し自在に装着されることになる。
【0117】
またホスト装置11をSDメモリカード13に記憶された音楽データの再生専用のプレイヤーとして実現した場合には、ストレージエリア131およびセキュアエリア132を問わず、SDメモリカード13に対する全てのアクセスを、上述の実行ステート付きダイレクトコマンドを用いて行うようにしても良い。また実行ステート付きダイレクトコマンドを用いたカード制御はセキュアエリアを有するメモリカードに最も適しているが、メモリカードに限らず、I/Oカードの制御に適用することも可能である。
【0118】
また、上述のホストコントローラ121の機能はすべて、そのホストコントローラ121のマイクロコンピュータの動作を制御するためのプログラムであるファームウェアによって実現することが出来る。
【0119】
更に、上記実施形態には種々の段階の発明が含まれており、開示される複数の構成要件における適宜な組み合わせにより種々の発明が抽出され得る。例えば、実施形態に示される全構成要件から幾つかの構成要件が削除されても、発明が解決しようとする課題の欄で述べた課題が解決でき、発明の効果の欄で述べられている効果が得られる場合には、この構成要件が削除された構成が発明として抽出され得る。
【0120】
【発明の効果】
以上説明したように、本発明によれば、メモリカードのセキュリティ機能等に関する動作コマンドの拡張やアプリケーションプログラムインタフェース(API)の変更等に柔軟に対応することができ、しかもメモリカードのステート管理制御の単純化を図ることが可能となる。
【図面の簡単な説明】
【図1】本発明の一実施形態に係るメモリカード制御装置を用いたデータ処理装置システムの構成を示すブロック図。
【図2】本実施形態で使用されるメモリカードの構成の一例を示すブロック図。
【図3】本実施形態で使用されるメモリカードの代表的な2つのステートとそれらステートそれぞれで受付および実行可能な動作コマンドとの関係の一例を示す図。
【図4】本実施形態で実行ステート付きダイレクトコマンドを使用しなかった場合に生じ得る不具合を説明するための図。
【図5】本実施形態において実行ステート付きダイレクトコマンドを用いて実行されるアクセスコマンド間の調停処理を説明するための図。
【図6】本実施形態において修飾コマンドを独立したダイレクトコマンドとして発行した場合に生じ得る不具合を説明するための図。
【図7】本実施形態において拡張コマンドフラグ情報を含む実行ステート付きダイレクトコマンドを用いて実行されるアクセスコマンド間の調停処理を説明するための図。
【図8】本実施形態においてアクセスコマンドとして用いられるUSBパケットの一例を示す図。
【図9】本実施形態において用いられる実行ステート付きダイレクトコマンドの構造の一例を示す図。
【図10】本実施形態において用いられるホストコントローラの構成の一例を示すブロック図。
【図11】本実施形態においてOSストレージコマンドおよび実行ステート付きダイレクトコマンドがどのように処理されるかを説明するための図。
【図12】本実施形態で実行されるカード制御処理の手順を示すフローチャート。
【図13】本実施形態で実行されるOSストレージコマンド処理の手順を示すフローチャート。
【符号の説明】
11…ホスト装置
12…SDカードアダプタ
13…SDメモリカード
111…通常のアプリケーションプログラム
112…SDアプリケーションプログラム
113…ファイルシステム
114…USBストレージクラスドライバ
115…USBドライバ
116…USBコントローラ
121…ホストコントローラ
122…OSストレージコマンド実行部
123…SDダイレクトコマンド実行部
131…ストレージエリア
132…セキュアエリア[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an apparatus and a method for controlling a memory card, and more particularly to controlling a memory card that operates in any of a plurality of states with different types of operation commands that can be accepted according to an access command from a host system. The present invention relates to an apparatus and a method.
[0002]
[Prior art]
In recent years, various portable electronic devices such as personal computers, PDAs, cameras, and mobile phones have been developed. In these electronic devices, a memory card which is one of removable storage devices is often used. As the memory card, a PCMCIA card (PC card) and a smaller SD (Secure Digital) card are known.
[0003]
This SD card is a memory card with built-in flash memory, and is specifically designed to meet the demands for security, capacity, and speed. The SD card has a security function for the purpose of protecting the copyright of contents such as music data, and can protect the music data stored in the SD card from unauthorized copying.
[0004]
Generally, such a memory card with a security function includes a controller, a user data area that is a data storage area that a user can freely access, and a secure area that is a data storage area protected by the security function. It has been.
[0005]
When a memory card is connected to a personal computer via a memory card controller such as a memory card adapter (host controller), the access command from the operating system is converted into one or more operation commands for card control by the memory card controller. Sent to the memory card. From the operating system, the user data area in the memory card appears as a storage device similar to the disk device, but the existence of the secure area cannot be known at all. Only a special application program and a playback device having a dedicated authentication mechanism for content protection can access the secure area.
[0006]
These application programs and playback devices issue a dedicated access command for accessing the secure area to the memory card control device in order to access the secure area. The dedicated access command is converted into one or more operation commands by the memory card control device and sent to the memory card.
[0007]
[Problems to be solved by the invention]
However, in such a configuration in which a dedicated access command is converted into an operation command for a memory card and a secure area is accessed, the operation command related to the security function of the memory card and the application program interface (API) are changed. When the change of the dedicated command accompanying the change occurs, the memory card control device itself needs to be newly designed accordingly.
[0008]
Furthermore, in general, in a memory card, various states are defined, and an operation command that can be accepted is determined for each state. Therefore, the memory card control device needs to perform complicated state management control in which the memory card is transitioned to a state necessary for executing an operation command to be issued while always being aware of the current state of the memory card.
[0009]
The present invention has been made in consideration of the above-mentioned circumstances, and can flexibly cope with expansion of operation commands relating to the security function of the memory card, change of application program interface (API), and the like, and the state of the memory card. An object is to provide a memory card control device and a memory card control method capable of simplifying management control.
[0010]
[Means for Solving the Problems]
In order to solve the above-described problems, the present invention provides a memory card control device that controls a memory card that operates in any of a plurality of states having different types of operation commands that can be accepted according to an access command from a host system. , An operation command issued by the host system for accessing the memory card, directly specifying an operation to be executed by the memory card, and whether or not the operation command is an extended command that requires issuing a modifier command Means for receiving a direct command including extended command flag information indicating whether or not an operation corresponding to the operation command is to be executed, and the memory card according to the received direct command. As a steady state. On the condition that the extended command flag information indicates that the operation command included in the direct command is an extended command. Processing for issuing a modification command to the memory card, processing for issuing the operation command included in the received direct command to the memory card, and causing the memory card to execute an operation corresponding to the operation command, and the memory And direct command execution means for sequentially executing processing for returning the card to the specific state.
[0011]
In this memory card control device, a direct command including an operation command for directly specifying an operation to be executed on the memory card is used as an access command for accessing the memory card from the host system. Further, this direct command includes extended command flag information and execution state information, and whether or not the operation command included in the direct command is an extended command that needs to be issued a modifier command, and the operation command is displayed. Which state of the memory card should be executed is simultaneously specified by a direct command. When a direct command is received from software or the like executed on the host system, 1) a process of transitioning the memory card to a state specified by the execution state information included in the direct command, 2) extended command flag information becomes a direct command Processing for issuing a modification command to the memory card when the operation command included is an extended command, and 3) issuing an operation command included in the direct command to the memory card and performing an operation corresponding to the operation command on the memory card. And 4) the process of returning the memory card to a specific state predetermined as its steady state is sequentially executed.
[0012]
By using such a direct command, an operation command included in the direct command can be issued to the memory card as it is. Therefore, an intelligent access command is interpreted and the access command is converted into one or more operation commands. Processing such as conversion is unnecessary. For this reason, direct commands can be issued even if the operation command is expanded or the application program interface (API) is changed by adding or changing the security function by using the direct command, for example, for accessing the secure area. It becomes possible to cope with it only by updating the software.
[0013]
Furthermore, in the process of executing one direct command, after the memory card is changed to the state specified by the execution state information, if it is an extended command, an operation command is issued after issuing a modifier command, and if it is not an extended command Since the operation command is issued without issuing the modifier command, and the process of returning the memory card state to the steady state is automatically performed after the operation command is issued, even if a direct command with state transition is executed The necessary modification command and operation command can be executed in the correct state, and the state of the memory card is always returned to the steady state before the state transition after the execution process. By maintaining the memory card in the steady state in this way, the memory card is managed according to the execution stage information included in the direct command without performing any memory card state management in either the host system or the memory card control device. It is possible to cause the memory card to execute a desired operation normally only by changing the state. In particular, the extended command flag information is included in the direct command, as described above, instead of using the modified command itself as a direct command. Therefore, a series of processes in which a modified command and an operation command are generated in this order after a state transition is made. Can be executed as a process for one direct command, and an extended command can also be executed correctly.
[0014]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 shows the configuration of a data processing apparatus system using a memory card control apparatus according to an embodiment of the present invention. This data processing apparatus system includes a
[0015]
An
[0016]
Various states are defined in the
[0017]
In the
[0018]
The
[0019]
That is, the USB
[0020]
This access command is an intelligent disk access command conforming to the ATA command, and is converted to one or more operation commands for the
[0021]
The
[0022]
This access command is a direct command that can be issued to the
[0023]
Further, the direct command includes execution state information and extended command flag information as parameters of the direct command. The execution state information specifies in which state of the
[0024]
Hereinafter, an access command issued from the
[0025]
The
[0026]
A
[0027]
The
[0028]
Further, after interpreting and executing the OS storage command, the OS storage
[0029]
The SD direct
[0030]
If the state specified by the execution state information is a steady state, the processes 1) and 4) are omitted, and only the processes 2) and 3) are executed. In addition, when the operation command included in the SD direct command with execution state is not an extended command, the modification command issuance process 2) is not performed, and the operation command included in the SD direct command with execution state 3) is issued. Only processing is performed.
[0031]
As described above, the
[0032]
Next, an example of the configuration of the
[0033]
As shown in the figure, the
[0034]
The
[0035]
Various status information related to the
[0036]
The
[0037]
In the
[0038]
DAT0-3: Each data line is a bidirectional signal line used for data transfer between the
CMD: Used for transferring operation commands (sometimes simply referred to as commands) from the
[0039]
CLK: The clock signal line is a signal line for transmitting the clock signal CLK from the
[0040]
FIG. 3 shows an example of the relationship between two typical states of the
[0041]
In the
[0042]
・ Stand-by State
・ Transfer State
・ Sending-data state
-Receive-data state
・ Programming State
-Disk Connect State
Among these, the standby state (Stand-by State) is a kind of power save state with low power consumption, and the operation commands that can be accepted and executed in this state are operation commands other than the operation commands related to the access of the
[0043]
The transfer state is a state in which the
[0044]
The “SD_read” command is an operation command that requests data reading from the
[0045]
When the “SD_write” command is received in the transfer state, the
[0046]
The “SD_standby” command is an operation command for requesting a transition to the transfer state. Note that the “SD_standby” command and the “SD_transfer” command are actually expressed by the same operation command (CMD7), and when the operation command (CMD7) is received in the standby state, the transition to the transfer state is performed. When the operation command (CMD7) is received, a transition to the standby state is performed.
[0047]
Further, in the transfer state, an “SD_secure_read” command that requests data reading from the
[0048]
The modification command “SD_ACMD” can be used in both the standby state and the transfer state, but the operation command issued after the modification command “SD_ACMD” can be used only in the standby state. For example, the modification command “SD_ACMD” needs to be issued in the standby state, and if the operation command issued subsequent to the modification command “SD_ACMD” can be used only in the transfer state, the modification command “SD_ACMD” is also issued. It is necessary to issue in the transfer state.
[0049]
In the present embodiment, the transfer state is used as the above-described steady state. Unless the
[0050]
Next, an arbitration operation between an access command (OS storage command) issued from the OS and an access command (direct command with execution state) issued from the
[0051]
Here, first, in order to clarify the meaning of using the direct command with execution state, it is assumed that the execution state is not attached to the direct command issued from the
[0052]
The
[0053]
In the
[0054]
Therefore, the order of the operation commands received by the
[0055]
Since the “SD_read” command is a command that can be accepted only in the transfer state, the operation corresponding to the “SD_read” command cannot be normally executed by the
[0056]
In the present embodiment, since the direct command with execution state is used, the above-described problems do not occur. This is shown in FIG.
[0057]
As shown in FIG. 5, the
[0058]
When the
[0059]
Furthermore, in this embodiment, the modification command “SD_ACMD” itself is not issued as a direct command with an execution state, but whether the operation command included in the direct command is an extended command in the direct command with an execution state. Extended command flag information indicating whether or not is included as a parameter. This is because if the modification command “SD_ACMD” itself is issued as a direct command, a problem as shown in FIG. 6 occurs.
[0060]
FIG. 6 shows an example in which the modification command “SD_ACMD” itself is issued as a direct command without using the extended command flag information. Here, in order to obtain the size of the
[0061]
If, for example, OS_read is issued from the OS between the issuance of the “SD_ACMD” command from the
[0062]
Although the “SD_read” command is not an extended command, the “SD_ACMD” command is issued immediately before the “SD_read” command, so that the
[0063]
In the present embodiment, the modification command “SD_ACMD” command is not issued as an independent direct command, but an extended flag indicating whether the operation command included in the direct command is an extended command in the direct command with execution state. Since the information (ACMD flag) is embedded, the above-described problems do not occur. This is shown in FIG.
[0064]
As shown in FIG. 7, when issuing the “SDA_SecureSize” command, the
[0065]
When the
[0066]
In this example, the execution state is not changed. However, when Stand-by flag = “1” and ACMD flag = “1”, the “SD_standby” command is issued first to enter the standby state. After the state transition to the state, the “SD_ACMD” command is issued. This is because the “SD_ACMD” command and the subsequent extension command are always passed to the
[0067]
Next, how the
[0068]
In this example, since the
[0069]
When the
[0070]
FIG. 9 shows an example of the format of the direct command with execution state.
[0071]
The direct command with execution state consists of 4 bytes. The operation code is a parameter indicating the type of operation command included in the direct command with execution state. The operation command type is
Command without data: Operation command that does not require any data transfer with the
[0072]
As described above, the standby flag information (Stand-by flag) is a parameter (execution state information) that specifies an execution state. Stand-by flag = "1" indicates that the operation command (modification command and operation command when the operation command is an extended command) should be executed in the standby state. In this embodiment, since the steady state of the
[0073]
The extended command flag information (ACMD flag) indicates whether the operation command included in the direct command with execution state is an extended command as described above. ACMD flag = "1" indicates an extended command. Command index information (Command Index to the memory card) indicates an operation command, and is composed of a command number of the operation command. When ACMD flag = "1", an operation command (CMD55) indicating that it is an extended command is issued prior to issuing the operation command having the command number specified by the command index information.
[0074]
The argument information (Command Argument to the memory card) indicates variables related to the operation command. The transfer length information (Data transfer length) indicates the data transfer length of the write data or read data when the operation command is a command with write data or read data.
[0075]
Next, an example of a specific configuration of the
[0076]
In addition to the OS storage
[0077]
The
[0078]
The OS storage
[0079]
The SD
[0080]
After the operation of the
[0081]
The SD direct
[0082]
The execution
[0083]
The SD
[0084]
Next, how the OS storage command and the direct command with execution state are processed by the
[0085]
For example, when the
[0086]
On the other hand, for example, when the
[0087]
Next, a procedure of card control processing executed by the
[0088]
The
[0089]
On the other hand, if it is an SD direct command with execution state (YES in step S101), the
[0090]
Next, the SD direct
[0091]
After the processing corresponding to the operation command is completed, the SD direct
[0092]
Hereinafter, an example in which the
[0093]
<When acquiring the storage size of the
The operation command “SDA_SecureSize” for acquiring the storage size of the
[0094]
Operation Code = Command with read data
Stand-by flag = 0
ACMD flag = 1
Command Index = 13
Receiving this direct command with execution state, the
[0095]
(1) Confirm that Stand-by flag = 0.
[0096]
(2) Confirm that ACMD flag = 1, that is, an extended command.
[0097]
(3) Issue CMD55.
[0098]
(4) The content (13) of the Command Index is issued as CMD13, and the storage size of the
[0099]
(5) Confirm that it has not transitioned to the Stand-by state, and end.
[0100]
<When acquiring card attributes (memory cluster size, etc.)>
The operation command for acquiring card attributes (memory cluster size and the like) from the
[0101]
Operation Code = Command with read data
Stand-by flag = 1
ACMD flag = 0
Command Index = 9
Receiving this direct command with execution state, the
[0102]
(1) Confirm that Stand-by flag = 1.
[0103]
(2) Issuing CMD7 to change the
[0104]
(3) Confirm that ACMD flag = 0, that is, not an extended command.
[0105]
(4) The contents (9) of the Command Index are issued as CMD9, and the card attribute is acquired from the
[0106]
(5) Confirm that the transition is to the Stand-by state.
[0107]
(6) CMD7 is issued again, the
[0108]
As described above, in the present embodiment, the
[0109]
Furthermore, since the command number itself of the operation command that can be directly issued to the
[0110]
Next, the procedure of OS storage command processing executed in step S109 in FIG. 12 will be described with reference to the flowchart in FIG.
[0111]
First, the OS storage
[0112]
Thereafter, the OS storage
[0113]
As described above, when the
[0114]
In the present embodiment, the transfer state is used as the steady state of the
[0115]
In principle, the standby state may be used as the steady state of the
[0116]
The
[0117]
When the
[0118]
All the functions of the
[0119]
Further, the above embodiments include inventions at various stages, and various inventions can be extracted by appropriately combining a plurality of disclosed constituent elements. For example, even if some constituent requirements are deleted from all the constituent requirements shown in the embodiment, the problem described in the column of the problem to be solved by the invention can be solved, and the effect described in the column of the effect of the invention Can be obtained as an invention.
[0120]
【The invention's effect】
As described above, according to the present invention, it is possible to flexibly cope with the expansion of operation commands related to the security function of the memory card and the change of the application program interface (API), and the state management control of the memory card. Simplification can be achieved.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a data processing system using a memory card control device according to an embodiment of the present invention.
FIG. 2 is a block diagram showing an example of the configuration of a memory card used in the present embodiment.
FIG. 3 is a diagram showing an example of a relationship between two typical states of a memory card used in the present embodiment and operation commands that can be accepted and executed in each of the states.
FIG. 4 is a diagram for explaining a problem that may occur when a direct command with an execution state is not used in the present embodiment.
FIG. 5 is a diagram for explaining arbitration processing between access commands executed using a direct command with an execution state in the present embodiment.
FIG. 6 is a diagram for explaining a problem that may occur when a modification command is issued as an independent direct command in the present embodiment.
FIG. 7 is a diagram for explaining an arbitration process between access commands executed using a direct command with an execution state including extended command flag information in the present embodiment.
FIG. 8 is a diagram showing an example of a USB packet used as an access command in the present embodiment.
FIG. 9 is a diagram showing an example of the structure of a direct command with execution state used in the present embodiment.
FIG. 10 is a block diagram showing an example of the configuration of a host controller used in this embodiment.
FIG. 11 is a diagram for explaining how an OS storage command and a direct command with execution state are processed in the present embodiment;
FIG. 12 is a flowchart illustrating a procedure of card control processing executed in the present embodiment.
FIG. 13 is a flowchart showing the procedure of OS storage command processing executed in this embodiment.
[Explanation of symbols]
11:
Claims (12)
前記ホストシステムが前記メモリカードのアクセスのために発行する、前記メモリカードが実行すべき動作を直接的に指定する動作コマンドとその動作コマンドが修飾コマンドの発行が必要な拡張コマンドであるか否かを示す拡張コマンドフラグ情報と前記動作コマンドに対応する動作を実行すべき前記メモリカードのステートを示す実行ステート情報とを含むダイレクトコマンドを受信する手段と、
前記受信したダイレクトコマンドに従って、前記メモリカードをその定常ステートとして予め決められた特定のステートから前記受信したダイレクトコマンドに含まれる実行ステート情報によって指定されたステートに遷移させる処理、前記拡張コマンドフラグ情報が前記ダイレクトコマンドに含まれる動作コマンドが拡張コマンドであることを示すことを条件に、修飾コマンドを前記メモリカードに発行する処理、前記受信したダイレクトコマンドに含まれる前記動作コマンドを前記メモリカードに発行して前記動作コマンドに対応する動作を前記メモリカードに実行させる処理、および前記メモリカードを前記特定のステートに戻す処理を、順次実行するダイレクトコマンド実行手段とを具備することを特徴とするメモリカード制御装置。In a memory card control device that controls a memory card that operates in any of a plurality of states with different types of operation commands that can be accepted in accordance with an access command from a host system,
An operation command that is issued by the host system for accessing the memory card and that directly specifies an operation to be executed by the memory card, and whether or not the operation command is an extended command that requires issuing of a modification command Means for receiving a direct command including extended command flag information indicating the state of the memory card that should execute the operation corresponding to the operation command;
In accordance with the received direct command, the process of transitioning the memory card from a specific state predetermined as its steady state to a state specified by the execution state information included in the received direct command, the extended command flag information Processing for issuing a modification command to the memory card on condition that the operation command included in the direct command is an extended command, and issuing the operation command included in the received direct command to the memory card And a direct command execution means for sequentially executing a process for causing the memory card to execute an operation corresponding to the operation command and a process for returning the memory card to the specific state. apparatus
前記実行ステート情報は、前記メモリカードを前記第2のステートに遷移させる必要があるかどうかを示す実行ステート遷移フラグ情報を含み、
前記ダイレクトコマンド実行手段は、
前記実行ステート遷移フラグ情報が前記第2のステートに遷移させる必要があることを示し、且つ前記拡張コマンドフラグ情報が前記ダイレクトコマンドに含まれる動作コマンドが拡張コマンドであることを示す場合には、修飾コマンドおよび前記受信したダイレクトコマンドに含まれる動作コマンドが、前記第2のステートに設定されたメモリカードに対して発行されるように、前記メモリカードを前記特定のステートである第1のステートから前記第2のステートに遷移させる処理を実行した後に、前記修飾コマンドおよび動作コマンドをこの順で前記メモリカードに発行することを特徴とする請求項1記載のメモリカード制御装置。The plurality of states include a first state and a second state, and the specific state predetermined as the steady state is the first state,
The execution state information includes execution state transition flag information indicating whether or not the memory card needs to transition to the second state,
The direct command execution means includes
If the execution state transition flag information indicates that it is necessary to transition to the second state, and the extended command flag information indicates that the operation command included in the direct command is an extended command, a modification Command and the operation command included in the received direct command are issued to the memory card set in the second state from the first state, which is the specific state, to the memory card. 2. The memory card control device according to claim 1, wherein after executing the process of transitioning to the second state, the modification command and the operation command are issued to the memory card in this order.
前記ホストシステム上で実行される前記コンテンツ保護機能を持つ専用のプログラムが前記セキュアエリアのアクセスのために発行するアクセスコマンドは、前記ダイレクトコマンドであることを特徴とする請求項1記載のメモリカード制御装置。The memory card is provided with a secure area that is a data storage area accessible only by a dedicated program having a content protection function,
2. The memory card control according to claim 1, wherein an access command issued for accessing the secure area by a dedicated program having the content protection function executed on the host system is the direct command. apparatus.
前記ホストシステムから、前記ユーザデータエリアへのデータ書き込みまたは前記ユーザデータエリアからのデータ読み出しを要求するストレージアクセスコマンドを受信した場合、前記ストレージアクセスコマンドを解釈および実行して当該ストレージアクセスコマンドで指定された要求に対応する動作を前記メモリカードに実行させるために必要な1以上の動作コマンドを前記メモリカードに発行した後、前記メモリカードを前記定常ステートとして予め決められた前記特定のステートに戻す処理を実行するストレージアクセスコマンド実行手段をさらに具備することを特徴とする請求項1記載のメモリカード制御装置。The memory card is provided with a user data area which is a data storage area accessible by an operating system executed on the host system,
When a storage access command for requesting data write to the user data area or data read from the user data area is received from the host system, the storage access command is interpreted and executed, and specified by the storage access command. Processing for returning one or more operation commands necessary for causing the memory card to execute an operation corresponding to the requested request to the memory card, and then returning the memory card to the specific state predetermined as the steady state 2. The memory card control device according to claim 1, further comprising storage access command execution means for executing.
前記メモリカードには、前記ホストシステム上で実行されるオペレーティングシステムがアクセス可能なデータ記憶領域であるユーザデータエリアと、前記ホストシステム上で実行されるコンテンツ保護機能を持つ専用のプログラムのみがアクセス可能なデータ記憶領域であるセキュアエリアとが設けられており、
前記ホストシステムからのアクセスコマンドが、前記メモリカードに実行させるべき前記セキュアエリアのアクセスに関する動作を直接的に指定する動作コマンドとその動作コマンドが修飾コマンドの発行が必要な拡張コマンドであるか否かを示す拡張コマンドフラグ情報と前記動作コマンドに対応する動作を実行すべき前記メモリカードのステートを示す実行ステート情報とを含むダイレクトコマンド、および前記ユーザデータエリアへのデータ書き込みまたは前記ユーザデータエリアからのデータ読み出しを要求するストレージアクセスコマンド、のいずれであるかを判別する手段と、
前記アクセスコマンドが前記ダイレクトコマンドである場合、前記メモリカードを前記ダイレクトコマンドに含まれる実行ステート情報によって指定されたステートに遷移させる処理、前記拡張コマンドフラグ情報が前記ダイレクトコマンドに含まれる動作コマンドが拡張コマンドであることを示すことを条件に、修飾コマンドを前記メモリカードに発行する処理、前記受信したダイレクトコマンドに含まれる前記動作コマンドを前記メモリカードに発行して前記動作コマンドに対応する動作を前記メモリカードに実行させる処理、および前記メモリカードをその定常ステートとして予め決められた特定のステートに戻す処理を、順次実行するダイレクトコマンド実行手段と、
前記アクセスコマンドが前記ストレージアクセスコマンドである場合、前記ストレージアクセスコマンドを解釈および実行して当該ストレージアクセスコマンドで指定された要求に対応する動作を前記メモリカードに実行させるために必要な1以上の動作コマンドを前記メモリカードに発行した後、前記メモリカードを前記定常ステートとして予め決められた前記特定のステートに戻す処理を実行するストレージアクセスコマンド実行手段とを具備することを特徴とするメモリカード制御装置。In a memory card control device that controls a memory card that operates in any of a plurality of states with different types of operation commands that can be accepted in accordance with an access command from a host system,
The memory card can be accessed only by a user data area which is a data storage area accessible by an operating system executed on the host system and a dedicated program having a content protection function executed on the host system. Secure area, which is a secure data storage area,
Whether the access command from the host system directly specifies an operation related to access to the secure area to be executed by the memory card, and whether the operation command is an extended command that requires a modification command to be issued A direct command including extended command flag information indicating the state of the memory card and an execution state information indicating the state of the memory card on which the operation corresponding to the operation command is to be executed, and data writing to the user data area or from the user data area Means for determining which is a storage access command for requesting data reading;
When the access command is the direct command, a process for transitioning the memory card to a state specified by the execution state information included in the direct command, and an operation command whose extended command flag information is included in the direct command are extended. A process for issuing a modification command to the memory card on the condition that the command is a command, and an operation corresponding to the operation command by issuing the operation command included in the received direct command to the memory card. Direct command execution means for sequentially executing processing to be executed by the memory card, and processing for returning the memory card to a specific state predetermined as the steady state;
When the access command is the storage access command, one or more operations necessary for interpreting and executing the storage access command and causing the memory card to perform an operation corresponding to the request specified by the storage access command A memory card control device comprising storage access command execution means for executing processing for returning the memory card to the specific state predetermined as the steady state after issuing a command to the memory card .
前記実行ステート情報は、前記メモリカードを前記第2のステートに遷移させる必要があるかどうかを示す実行ステート遷移フラグ情報を含み、
前記ダイレクトコマンド実行手段は、
前記実行ステート遷移フラグ情報が前記第2のステートに遷移させる必要があることを示し、且つ前記拡張コマンドフラグ情報が、前記動作コマンドが前記拡張コマンドであることを示す場合、修飾コマンドおよび前記受信したダイレクトコマンドに含まれる動作コマンドが、前記第2のステートに設定されたメモリカードに対して発行されるように、前記メモリカードを前記特定のステートである第1のステートから前記第2のステートに遷移させる処理を実行した後に、前記修飾コマンドおよび動作コマンドをこの順で前記メモリカードに発行することを特徴とする請求項6記載のメモリカード制御装置。The plurality of states include a first state and a second state, and the specific state predetermined as the steady state is the first state,
The execution state information includes execution state transition flag information indicating whether or not the memory card needs to transition to the second state,
The direct command execution means includes
If the execution state transition flag information indicates that it is necessary to transition to the second state, and the extended command flag information indicates that the operation command is the extended command, the modification command and the received The memory card is changed from the first state, which is the specific state, to the second state so that an operation command included in the direct command is issued to the memory card set in the second state. The memory card control device according to claim 6, wherein after executing the transition process, the modification command and the operation command are issued to the memory card in this order.
前記メモリカードには、前記データ処理装置上で実行されるオペレーティングシステムがアクセス可能なデータ記憶領域であるユーザデータエリアと、前記データ処理装置上で実行されるコンテンツ保護機能を持つ専用のプログラムのみがアクセス可能なデータ記憶領域であるセキュアエリアとが設けられており、
前記オペレーティングシステムまたは前記コンテンツ保護機能を持つ専用のプログラムから発行されるアクセスコマンドを順次受け付け、その受付順に、前記アクセスコマンドが、前記メモリカードに実行させるべき前記セキュアエリアのアクセスに関する動作を直接的に指定する動作コマンドとその動作コマンドが修飾コマンドの発行が必要な拡張コマンドであるか否かを示す拡張コマンドフラグ情報と前記動作コマンドに対応する動作を実行すべき前記メモリカードのステートを示す実行ステート情報とを含むダイレクトコマンド、および前記ユーザデータエリアへのデータ書き込みまたは前記ユーザデータエリアからのデータ読み出しを要求するストレージアクセスコマンド、のいずれであるかを判別する手段と、
前記アクセスコマンドが前記ダイレクトコマンドである場合、前記メモリカードを前記実行ステート情報によって指定されたステートに遷移させる処理、前記拡張コマンドフラグ情報が前記ダイレクトコマンドに含まれる動作コマンドが拡張コマンドであることを示すことを条件に、修飾コマンドを前記メモリカードに発行する処理、前記受信したダイレクトコマンドに含まれる前記動作コマンドを前記メモリカードに発行して前記動作コマンドに対応する動作を前記メモリカードに実行させる処理、および前記メモリカードをその定常ステートとして予め決められた特定のステートに戻す処理を、順次実行するダイレクトコマンド実行手段と、
前記アクセスコマンドが前記ストレージアクセスコマンドである場合、前記ストレージアクセスコマンドを解釈および実行して当該ストレージアクセスコマンドで指定された要求に対応する動作を前記メモリカードに実行させるために必要な1以上の動作コマンドを前記メモリカードに発行した後、前記メモリカードを前記定常ステートとして予め決められた前記特定のステートに戻す処理を実行するストレージアクセスコマンド実行手段とを具備することを特徴とするデータ処理装置。In a data processing device capable of controlling a memory card that operates in any of a plurality of states with different types of operation commands that can be accepted,
The memory card has only a user data area, which is a data storage area accessible by an operating system executed on the data processing device, and a dedicated program having a content protection function executed on the data processing device. A secure area, which is an accessible data storage area, is provided.
The access commands issued from the operating system or the dedicated program having the content protection function are sequentially received, and the access commands directly perform operations related to access to the secure area to be executed by the memory card in the order of reception. An operation command to be specified, extended command flag information indicating whether or not the operation command is an extended command for which a modification command needs to be issued, and an execution state indicating the state of the memory card on which the operation corresponding to the operation command is to be executed Means for determining whether a direct command including information and a storage access command for requesting data writing to the user data area or data reading from the user data area;
When the access command is the direct command, a process of transitioning the memory card to a state specified by the execution state information, and an operation command whose extended command flag information is included in the direct command is an extended command. Processing to issue a modification command to the memory card, and to issue the operation command included in the received direct command to the memory card to cause the memory card to execute an operation corresponding to the operation command. Direct command execution means for sequentially executing processing, and processing for returning the memory card to a specific state predetermined as its steady state;
When the access command is the storage access command, one or more operations necessary for interpreting and executing the storage access command and causing the memory card to perform an operation corresponding to the request specified by the storage access command A data processing apparatus comprising storage access command execution means for executing processing for returning the memory card to the specific state predetermined as the steady state after issuing a command to the memory card.
前記ホストシステムが前記メモリカードのアクセスのために発行するアクセスコマンドを受信し、
受信したアクセスコマンドが、前記メモリカードが実行すべき動作を直接的に指定する動作コマンドとその動作コマンドが修飾コマンドの発行が必要な拡張コマンドであるか否かを示す拡張コマンドフラグ情報と前記動作コマンドに対応する動作を実行すべき前記メモリカードのステートを示す実行ステート情報とを含むダイレクトコマンドである場合、前記メモリカードをその定常ステートとして予め決められた特定のステートから前記受信したダイレクトコマンドに含まれる実行ステート情報によって指定されたステートに遷移させる処理、前記拡張コマンドフラグ情報が前記ダイレクトコマンドに含まれる動作コマンドが拡張コマンドであることを示すことを条件に、修飾コマンドを前記メモリカードに発行する処理、前記受信したダイレクトコマンドに含まれる前記動作コマンドを前記メモリカードに発行して前記動作コマンドに対応する動作を前記メモリカードに実行させる処理、および前記メモリカードを前記特定のステートに戻す処理を、順次実行することを特徴とするメモリカード制御方法。In a memory card control method for controlling a memory card that operates in any of a plurality of states having different types of operation commands that can be accepted, according to an access command from a host system,
Receiving an access command issued by the host system for accessing the memory card;
The received access command is an operation command that directly designates an operation to be executed by the memory card, extended command flag information indicating whether the operation command is an extended command that requires a modification command, and the operation In the case of a direct command including execution state information indicating the state of the memory card that is to execute an operation corresponding to the command, the memory card is changed from the specific state determined in advance as the steady state to the received direct command. Processing to transition to the state specified by the included execution state information, and issue a modification command to the memory card on condition that the extended command flag information indicates that the operation command included in the direct command is an extended command Processing, the received A process of issuing the operation command included in the rect command to the memory card and causing the memory card to execute an operation corresponding to the operation command, and a process of returning the memory card to the specific state are sequentially executed. A memory card control method.
前記メモリカードには、前記ホストシステム上で実行されるオペレーティングシステムがアクセス可能なデータ記憶領域であるユーザデータエリアと、前記ホストシステム上で実行されるコンテンツ保護機能を持つ専用のプログラムのみがアクセス可能なデータ記憶領域であるセキュアエリアとが設けられており、
前記ホストシステムからのアクセスコマンドが、前記メモリカードに実行させるべき前記セキュアエリアのアクセスに関する動作を直接的に指定する動作コマンドとその動作コマンドが修飾コマンドの発行が必要な拡張コマンドであるか否かを示す拡張コマンドフラグ情報と前記動作コマンドに対応する動作を実行すべき前記メモリカードのステートを示す実行ステート情報とを含むダイレクトコマンド、および前記ユーザデータエリアへのデータ書き込みまたは前記ユーザデータエリアからのデータ読み出しを要求するストレージアクセスコマンド、のいずれであるかを判別し、
前記アクセスコマンドが前記ダイレクトコマンドである場合、前記メモリカードを前記ダイレクトコマンドに含まれる実行ステート情報によって指定されたステートに遷移させる処理、前記拡張コマンドフラグ情報が前記ダイレクトコマンドに含まれる動作コマンドが拡張コマンドであることを示すことを条件に、修飾コマンドを前記メモリカードに発行する処理、前記受信したダイレクトコマンドに含まれる前記動作コマンドを前記メモリカードに発行して前記動作コマンドに対応する動作を前記メモリカードに実行させる処理、および前記メモリカードをその定常ステートとして予め決められた特定のステートに戻す処理を、順次実行し、
前記アクセスコマンドが前記ストレージアクセスコマンドである場合、前記ストレージアクセスコマンドを解釈および実行して当該ストレージアクセスコマンドで指定された要求に対応する動作を前記メモリカードに実行させるために必要な1以上の動作コマンドを前記メモリカードに発行した後、前記メモリカードを前記定常ステートとして予め決められた前記特定のステートに戻す処理を実行することを特徴とするメモリカード制御方法。In a memory card control method for controlling a memory card that operates in any of a plurality of states having different types of operation commands that can be accepted in accordance with an access command from a host system,
The memory card can be accessed only by a user data area which is a data storage area accessible by an operating system executed on the host system and a dedicated program having a content protection function executed on the host system. Secure area, which is a secure data storage area,
Whether the access command from the host system directly specifies an operation related to access to the secure area to be executed by the memory card, and whether the operation command is an extended command that requires a modification command to be issued A direct command including extended command flag information indicating the state of the memory card and an execution state information indicating the state of the memory card on which the operation corresponding to the operation command is to be executed, and data writing to the user data area or from the user data area Determine which of the storage access commands to request data read,
When the access command is the direct command, a process for transitioning the memory card to a state specified by the execution state information included in the direct command, and an operation command whose extended command flag information is included in the direct command are extended. A process for issuing a modification command to the memory card on the condition that the command is a command, and an operation corresponding to the operation command by issuing the operation command included in the received direct command to the memory card. A process for causing the memory card to execute, and a process for returning the memory card to a specific state predetermined as its steady state are sequentially executed,
When the access command is the storage access command, one or more operations necessary for interpreting and executing the storage access command and causing the memory card to perform an operation corresponding to the request specified by the storage access command A method for controlling a memory card, comprising: issuing a command to the memory card; and executing a process for returning the memory card to the specific state that is predetermined as the steady state.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2001398177A JP3641239B2 (en) | 2001-12-27 | 2001-12-27 | Apparatus and method for controlling a memory card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2001398177A JP3641239B2 (en) | 2001-12-27 | 2001-12-27 | Apparatus and method for controlling a memory card |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2003196613A JP2003196613A (en) | 2003-07-11 |
JP3641239B2 true JP3641239B2 (en) | 2005-04-20 |
Family
ID=27603718
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2001398177A Expired - Fee Related JP3641239B2 (en) | 2001-12-27 | 2001-12-27 | Apparatus and method for controlling a memory card |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3641239B2 (en) |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7653796B2 (en) * | 2003-02-20 | 2010-01-26 | Panasonic Corporation | Information recording medium and region management method for a plurality of recording regions each managed by independent file system |
JP2005310118A (en) * | 2004-03-23 | 2005-11-04 | Toshiba Corp | Information terminal and data transfer method for information terminal |
KR100586063B1 (en) * | 2005-05-06 | 2006-06-08 | 주식회사 아이오셀 | Data structure of flash memory with variable size system field which can be updated, usb memory therewith and a control method of the system field |
JP2007164377A (en) * | 2005-12-12 | 2007-06-28 | Toshiba Corp | Data processor and data processing method |
JP4823009B2 (en) | 2006-09-29 | 2011-11-24 | 株式会社東芝 | Memory card and host device |
JP2008147871A (en) * | 2006-12-07 | 2008-06-26 | Sony Corp | Communication system and repeater |
JP5221915B2 (en) * | 2007-08-31 | 2013-06-26 | 株式会社アイ・オー・データ機器 | Content management method, program thereof, and recording medium |
US9727473B2 (en) | 2008-09-30 | 2017-08-08 | Intel Corporation | Methods to communicate a timestamp to a storage system |
JP2009116889A (en) * | 2008-12-11 | 2009-05-28 | Toshiba Corp | Data processor and data processing method |
JP2021163998A (en) | 2020-03-30 | 2021-10-11 | キヤノン株式会社 | Imaging apparatus, device, control method and program |
JP2021163997A (en) | 2020-03-30 | 2021-10-11 | キヤノン株式会社 | Imaging apparatus, device, communication method and program |
-
2001
- 2001-12-27 JP JP2001398177A patent/JP3641239B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2003196613A (en) | 2003-07-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3641230B2 (en) | Apparatus and method for controlling a memory card | |
US8135871B2 (en) | Computer system and control method of the same | |
US7797490B2 (en) | Memory card authentication system, memory card host device, memory card, storage area switching method, and storage area switching program | |
KR100745603B1 (en) | Secure mmc card and memory card system having them | |
US8250245B2 (en) | Information processing system, with information processing terminal capable of operating in multiple operation modes when connected to a host device | |
JPH1153485A (en) | Computer system, storage device, conversion system and storage medium | |
US20100122017A1 (en) | Memory controller, non-volatile memory system, and host device | |
JP3641239B2 (en) | Apparatus and method for controlling a memory card | |
US8850086B2 (en) | SD switch box in a cellular handset | |
KR20020036717A (en) | Microcomputer and method for controlling the same | |
US20070005847A1 (en) | Data transfer control device and electronic instrument | |
US7424580B2 (en) | Data transfer control device, electronic instrument, program and method of fabricating electronic instrument | |
CN110795373B (en) | I2C bus-to-parallel bus conversion method, terminal and storage medium | |
JP4793798B2 (en) | Microcomputer | |
US8028102B2 (en) | Electronic apparatus and method of controlling a memory unit connected to the same | |
JP2006031123A (en) | Usb memory device and usb memory device control program | |
JP2006350881A (en) | Memory card controller and memory card control system | |
JP3531438B2 (en) | Data management device, data management method, data management system, and external storage device | |
US20080294824A1 (en) | Device information management systems and methods | |
CN113971146A (en) | USB hub device with automatic firmware updating function and host system with same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20040220 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20040316 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20040512 |
|
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: 20050118 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20050120 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080128 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090128 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100128 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110128 Year of fee payment: 6 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120128 Year of fee payment: 7 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130128 Year of fee payment: 8 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130128 Year of fee payment: 8 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140128 Year of fee payment: 9 |
|
LAPS | Cancellation because of no payment of annual fees |