JP4155545B2 - Computer system and data transfer control method - Google Patents

Computer system and data transfer control method Download PDF

Info

Publication number
JP4155545B2
JP4155545B2 JP2000290939A JP2000290939A JP4155545B2 JP 4155545 B2 JP4155545 B2 JP 4155545B2 JP 2000290939 A JP2000290939 A JP 2000290939A JP 2000290939 A JP2000290939 A JP 2000290939A JP 4155545 B2 JP4155545 B2 JP 4155545B2
Authority
JP
Japan
Prior art keywords
cpu
mode
operation mode
disk
address
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
Application number
JP2000290939A
Other languages
Japanese (ja)
Other versions
JP2002099502A (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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2000290939A priority Critical patent/JP4155545B2/en
Publication of JP2002099502A publication Critical patent/JP2002099502A/en
Application granted granted Critical
Publication of JP4155545B2 publication Critical patent/JP4155545B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Bus Control (AREA)

Description

【0001】
【発明の属する技術分野】
本発明はコンピュータシステムおよび同システムで使用されるデータ転送制御方法に関し、特にディスク装置との間のデータ転送を効率よく実行できるように改良されたコンピュータシステムおよびデータ転送制御方法に関する。
【0002】
【従来の技術】
近年、携帯可能なノートブックタイプまたはサブノートタイプの携帯型パーソナルコンピュータや、携帯情報端末などのポケットコンピュータが種々開発されている。
【0003】
この種の携帯型コンピュータは、バッテリ駆動可能な時間を延ばすために、コンピュータシステムの電力を節約するための種々のパワーセーブモードが設けられている。サスペンドモードは、最も電力消費の少ないパワーセーブモードの1つである。すなわち、コンピュータシステムがサスペンドモードの時は、オペレーティングシステムやユーザプログラムなどの再スタートに必要なシステムデータが記憶されている主メモリを除く、システム内の他のほとんどのデバイスはパワーオフされる。
【0004】
主メモリにセーブされるシステムデータは、コンピュータシステムがサスペンドモードに設定される直前のCPUのステータスおよび各種周辺LSIのステータスである。また、この主メモリには、オペレーティングシステムおよびアプリケーションプログラムの実行状態やそのアプリケーションプログラムによって作成されたユーザデータも記憶されている。主メモリにセーブされた情報は、サスペンドモード直前の作業状態を復元するために用いられる。
【0005】
システムデータのセーブは、システムBIOS(基本入出力プログラム)に組み込まれたサスペンドルーチンによって実行される。システムBIOSはオペレーティングシステムからの要求にしたがってシステム内のハードウェアを制御するためのものであり、システム内の各種ハードウェアデバイスを制御するデバイスドライバ群を含んでいる。システムBIOSのサスペンドルーチンは、システムの電源オフ時などに起動され、CPUのレジスタおよび各種周辺LSIのステータスをメモリにセーブした後、システムをパワーオフする。
【0006】
主メモリへの電源供給は、システムがパワーオフの期間中ずっとバッテリによって維持される。このため、システムのステータスおよびユーザデータは消失されることなく、サスペンド前の作業状態にシステムを高速に戻すことができる。
【0007】
ところが、もしシステムがサスペンドモード状態の時にバッテリの容量が低下してローバッテリ状態となると、主メモリ内のデータは消失される。この場合、サスペンド前の状態にシステムを戻すことができ無くなるばかりか、主メモリに展開されているユーザデータも消失されてしまう。
【0008】
そこで、最近では、サスペンドモードに代わる新たなパワーセーブモードとして、ハイバネーションが使用され始めている。ハイバネーションは、システム電源オフ時にCPUおよび各種周辺LSIのステータス、および主メモリの内容などをハードディスクにセーブした後に主メモリを含むシステム内のほとんどすべてのデバイスをパワーダウンさせるモードであり、サスペンドモードよりも電力消費を低減できる。また、バッテリ容量が低下してもハードディスクにセーブした情報は消失されないので、システム状態をハイバネーション処理直前の状態に正常に復元することができる。したがって、ACアダプタを使用できない外出先での使用が多い携帯型コンピュータの多くは、ハイバネーションをパワーセーブモードとして実装している。
【0009】
ところで、近年のオペレーティングシステムおよびアプリケーションプログラムの機能向上に伴い、携帯型コンピュータにおいても、その主メモリとして実装されるメモリ容量は増大する一途にある。主メモリの記憶容量が増えると、その分、主メモリの内容をハードディスクにセーブするのに要する時間、およびハードディスクの内容を主メモリにリストアするのに要する時間も増大する。このため、ハイバネーションモードを使用するシステムでは、ハイバネーション処理に要する時間、つまりユーザが電源スイッチをオフしてからシステムが実際にパワーオフされるまでに要する時間、およびユーザが電源スイッチをオンしてからシステム状態が復元されるまでに要する時間が非常に大きくなりつつある。
【0010】
また、従来では、BIOSを介したハードディスク装置との間のデータ入出力動作は常にPIO(Programmed Input/Output)モードによって行われていた。
【0011】
すなわち、携帯型コンピュータでは、ハードディスクドライブの接続に使用されるインターフェイスとして、ATA(Enhanced IDE)が使用されている。このEnhanced IDEで用いられている典型的な転送モードが前述のPIOモードである。ATAでは、PIOモード0〜4まで定義されており、それぞれ最大転送速度が異なっている。PIOモードとは、CPUとハードディスクドライブとのハンドシェイクを用いた転送モードであり、CPUが直接ハードディスクドライブのI/Oポートを繰り返しアクセスすることによってデータ転送を行う。よって、その転送速度は決して高速ではないが、シーク動作やスピンドルの回転といった機械的動作を必要とするハードディスクドライブ自体のデータ転送能力を考慮すると、この転送方式で十分であったのである。
【0012】
しかし、最近では、ハードディスクの高密度化が急速に進み、これに伴ってハードディスク自体のデータ転送能力も大幅に向上しており、PIOモード4に加え、現在ではDMAモード、さらにはUltraDMAモードに対応したディスクインターフェースを持つものが主流となっている。このため、常にPIOモードのみを使用してディスク装置との間のデータ入出力を行うという従来のBIOSによるデータ転送方法では、ディスク装置の性能を十分に引き出すことが出来ないという問題が生じる。
【0013】
【発明が解決しようとする課題】
しかし、オペレーティングシステムなどの上位プログラムからBIOSのディスクアクセスルーチン(INT13h)がコールされた時に、常にDMA転送を用いてデータ転送を行うようにすると、その時のCPUの動作モードによっては重大なエラーが引き起こされる危険がある。
【0014】
すなわち、DMA転送(DMAモードまたはUltraDMA)を実行する場合には、CPUのアドレス変換機構を用いるのではなく、BIOS自体が転送先/転送元となる物理メモリアドレスを算出して、それを転送元/転送先メモリアドレスとしてバスマスタIDEコントローラなどのDMA制御ロジックに設定することが必要となる。DMA転送では、メモリアクセスはCPUではなく、バスマスタIDEコントローラなどのDMA制御ロジックによって実行されるからである。ところが、実際には物理メモリアドレスの算出方法はCPUの動作モード(リアルモード、仮想アドレスモード)によって異なる。
【0015】
すなわち、リアルモードでは、セグメント×16+オフセット=物理メモリアドレスという計算によってセグメントおよびオフセットから物理アドレスへの変換が行われるが、V86モードやプロテクトモードなどの仮想アドレスモードでは、ディスクプリタテーブルと称される仮想アドレス変換テーブルを参照することが必要となる。ディスクプリタテーブルの参照には特権レベルが必要であり、通常は、オペレーティングシステム以外の他のプログラム(BIOSを含む)はそれをアクセスすることはできない。
【0016】
したがって、もしBIOSがCPUの動作モードに関係なく常にセグメント×16+オフセット=物理メモリアドレスという計算によって物理メモリアドレスを計算して、それを用いてDMA転送のための処理を開始すると、CPUが仮想アドレスモード(例えばV86モード)であった場合には誤った物理メモリアドレスが算出されてしまい、結果的に誤動作を引き起こすことになる。
【0017】
本発明は上述の事情に鑑みてなされたものであり、CPUの動作モードを考慮してDMA転送モードの実行条件を決定できるようにし、動作の信頼性が高く、しかも十分にディスク装置との間のデータ転送効率の向上を図ることが可能なコンピュータシステムおよびデータ転送制御方法を提供することを目的とする。
【0018】
【課題を解決するための手段】
上述の課題を解決するため、本発明は、仮想アドレス変換テーブルを使用せずにセグメントおよびオフセットから物理アドレスを計算する第1動作モードと、前記セグメントおよびオフセットを含む仮想アドレスと仮想アドレス変換テーブルとを用いて物理メモリアドレスを計算する第2動作モードとを有するCPUを備えたコンピュータシステムにおいて、前記コンピュータシステムに設けられたディスク装置と前記コンピュータシステムのメモリとの間でDMA転送を実行するためのDMAコントローラと、前記ディスク装置に対するアクセスが上位プログラムから要求されたことに応答して前記CPUの動作モードが前記第1動作モードおよび前記第2動作モードのいずれであるかを判別する処理を実行すると共に、前記CPUの動作モードが前記第1動作モードであることが判別された場合には、前記CPUのレジスタにセットされている前記セグメントおよびオフセットから物理メモリアドレスを算出し、その算出した物理メモリアドレスおよび前記CPUの別のレジスタにセットされているディスクアドレスを前記DMAコントローラにセットすることにより、前記上位プログラムから要求された前記ディスク装置との間のデータ転送を前記DMAコントローラによるDMA転送によって実行し、前記CPUの動作モードが前記第2動作モードであることが判別された場合には、前記CPUに前記ディスク装置に対するアクセスを繰り返し実行させるPIO転送モードによって、前記上位プログラムから要求された前記ディスク装置との間のデータ転送を実行するディスクアクセス制御手段とを具備することを特徴とする。
【0019】
このコンピュータシステムにおいては、ディスク装置に対するアクセスが上位プログラムから要求された場合、そのときのCPUの動作モードが判別され、セグメントおよびオフセットから物理メモリアドレスを直接的に計算できる第1動作モードであることことを条件に、DMA転送のための処理が実行される。よって、誤った物理メモリアドレスの算出などの不具合を招くことなく、ディスク装置とメモリとの間のデータ転送を効率よく実行することが可能となり、通常のディスク入出力動作のみならず、オペレーティングシステムのブートストラップ処理、およびハイバネーションからの復帰処理の高速化を図ることが可能となる。
【0020】
前記ディスクアクセス制御手段は、前記動作モード判別手段によって前記CPUの現在の動作モードが前記第2動作モードであると判別された場合には、前記CPUに前記ディスク装置に対するアクセスを繰り返し実行させるPIO転送モードによって、前記上位プログラムから要求された前記ディスク装置との間のデータ転送を実行するように構成することが好ましい。これにより、CPUの現在の動作モードに応じてDMA転送モードとPIO転送モードを選択的に実行することが可能となり、常に最適な転送モードを利用することができる。
【0021】
【発明の実施の形態】
以下、図面を参照して本発明の実施形態を説明する。
図1には、本発明の一実施形態に係るコンピュータシステムの構成が示されている。このコンピュータシステムは、ノートブックタイプまたはサブノートタイプのポータブルパーソナルコンピュータであり、コンピュータ本体と、このコンピュータ本体に開閉自在に取り付けられたLCDパネルユニットとから構成されている。このコンピュータは、内蔵バッテリを有しており、その内蔵バッテリからの電力によって動作可能に構成されている。また、ACアダプタを介してAC商用電源などの外部電源から電力供給を受けることもできる。外部電源から電力供給を受けているときは、その外部電源からの電力がコンピュータシステムの動作電源として用いられる。このとき、外部電源からの電力によって内蔵バッテリの充電も自動的に行われる。ACアダプタが取り外されたり、あるいはAC商用電源のブレーカが落とされたときなどは、内蔵バッテリからの電力がコンピュータシステムの動作電源として用いられる。
【0022】
また、コンピュータ本体には、IDEインターフェイスを有するハードディスクドライブ(HDD)17が取り外し自在に装着されている。このHDD17はコンピュータの二次記憶として使用されるものである。
【0023】
また、このコンピュータのシステムボード上には、図示のように、CPU11、ホスト−PCIブリッジ12、主メモリ13、VGAコントローラ14、PCI−ISAブリッジ15、バスマスタIDEコントローラ16、BIOS−ROM18、埋め込みコントローラ(EC)20、電源コントローラ(PSC)21などが設けられている。
【0024】
CPU11は、このシステム全体の動作制御およびデータ処理を実行する。このCPU11としては、メモリセグメンテーション機構および仮想アドレッシング機構をサポートするもの、例えば、米インテル社により製造販売されているマイクロプロセッサ“Pentium”などが使用される。この場合、CPU11は、次のような動作を持つ。
【0025】
すなわち、CPU11は、アプリケーションプログラムやオペレーティングシステム(OS)などのプログラムを実行するための動作モードとしてリアルモード、プロテクトモード、仮想8086モード(V86モード)を有している。リアルモードはメモリセグメンテーションを利用した実アドレスモードであり、プロテクトモードおよび仮想86モードは仮想アドレスモードである。
【0026】
すなわち、リアルモードは、最大で1Mバイトのメモリ空間をアクセスできるモードであり、論理アドレスから物理アドレスへの変換は、セグメントレジスタで表されるベースアドレスからのオフセット値で物理アドレスを決定するアドレス計算形式によって行われる。つまり、図2に示すように、セグメントはメモリ・セグメントを仮想的に表す16ビットの値(セレクタと称する場合もある)であり、物理メモリアドレスは、セグメントの値を4ビット左にシフトした(16倍)値をベースアドレスとし、それに16ビットで表されるオフセット値を加えることによって算出される。
【0027】
一方、プロテクトモードは1タスク当たり最大4Gバイトのメモリ空間をアクセスできるモードであり、ディスクプリタテーブルと称される仮想アドレス変換テーブルを用いてリニアアドレスが決定される。このリニアアドレスは、ページングによって最終的に物理アドレスに変換される。つまり、図3に示すように、セグメントの値はディスクプリタテーブルを参照するためのポインタとして使用され、そのディスクプリタテーブルから得られた値をベースアドレスとし、それに16ビットで表されるオフセット値を加えることによってリニアアドレスが算出される。V86モードはプロテクトモード環境下でリアルモードをエミュレーションするための動作モードであり、プロテクトモードと同じ仮想アドレス計算方式が用いられる。
【0028】
CPU11の初期化時の動作モードはリアルモードであり、オペレーティングシステム等のソフトウェア制御の下に、プロテクトモード、V86モードにスイッチされる。
【0029】
ホスト−PCIブリッジ12はCPUバス1とPCIバス2間を双方向でつなぐブリッジであり、ここには主メモリ13を制御するためのメモリコントローラも内蔵されている。主メモリ13はこのシステムの主記憶つまりシステムメモリとして使用されるものであり、オペレーティングシステム、処理対象のアプリケーションプログラム、およびアプリケーションプログラムによって作成されたユーザデータ等が格納される。この主メモリ13はDRAMなどの半導体メモリによって実現されている。
【0030】
BIOS−ROM18は、システムBIOS(Basic I/O System)を記憶するためのものであり、プログラム書き替えが可能なようにフラッシュメモリによって構成されている。システムBIOSは、このシステム内の各種ハードウェアをアクセスするためのファンクション実行ルーチンを体系化したものであり、リアルモードで動作するように構成されている。このシステムBIOSには、システムのパワーオン時にオペレーティングシステムをブートストラップするための処理ルーチンと、各種ハードウェア制御のためのBIOSドライバ群などが含まれている。各BIOSドライバは、ハードウェア制御のための複数の機能をオペレーティングシステムやアプリケーションプログラムに提供するためにそれら機能に対応する複数のファンクション実行ルーチン群を含んでいる。上位プログラムからINT13hがコールされると、BIOSのハードディスクドライバが実行される。このドライバ(INT13h)には、HDD17との間のデータ転送をDMA転送によって行うための機能とPIO転送によって行う機能とが含まれている。
【0031】
EC20は、システムが持つ付加機能を制御するためのコントローラであり、CPU周辺温度などに応じてクーリングファンの回転制御などを行うための熱制御機能、システムの各種状態をLEDの点灯やビープ音によってユーザに通知するためのLED/ビープ音制御機能、電源コントローラ21と共同してシステム電源のオン/オフなどを制御する電源シーケンス制御機能、および電源ステータス通知機能などを有している。ハイバネーション状態においても、EC20および電源コントローラ21には動作電源が供給されており、電源スイッチ22およびパネルスイッチ23のオン・オフが監視される。
【0032】
ハイバネーションはシステム電源オフなどのパワーセーブモードへの移行イベントの発生時にCPU11および各種周辺LSIのステータス、および主メモリ13の内容などをハードディスク17にセーブした後に主メモリ17を含むシステム内のほとんどすべてのデバイスをパワーダウンさせるモードである。ハイバネーション状態においてシステム電源オフなどのウェイクアップイベントが発生すると、ハードディスク17にセーブされているメモリイメージが主メモリ13にリストアされ、ハイバネーション前の作業状態に復元される。ハイバネーションの実行および復帰処理の制御はACPI(Advanced Configuration and Power
Interface)対応のOSの管理下で実行される。
【0033】
VGAコントローラ14は、このシステムのディスプレイモニタとして使用されるLCDおよび外部CRTを制御するためのものであり、VRAMに描画された画面データをLCDおよび外部CRTの一方または双方に表示する。
【0034】
バスマスタIDEコントローラ16は、コンピュータ本体に装着されたIDEデバイス(ここでは、HDD17)を制御するためのものであり、IDEデバイスと主メモリ13との間のDMA転送を実行可能なバスマスタ機能(DMAコントローラ)を有している。このバスマスタ機能は、CPU11からのコマンドに応じて自らデータ転送のためのバスサイクル(DMA転送)を実行するものであり、PIOモードよりもCPU負荷を低減した状態で、IDEデバイスと主メモリ13との間のデータ転送を高速実行する事ができる。
【0035】
次に、図4を参照して、BIOSのディスクアクセス動作について説明する。
【0036】
ここでは、オペレーティングシステムなどの上位プログラムからBIOSのディスクドライバ(INT13h)がコールされた場合を想定する。INT13hのBIOSコールはCPU11のソフトウェア割り込み機能を用いて実現されている。この場合、上位プログラムからBIOSのディスクドライバ(INT13h)には、CPU11のレジスタを通じて以下のI/Oパラメタが通知される。
【0037】
R/Wファンクション:ディスクリードまたはディスクライトを示す
転送セクタ数: ディスク装置との間でデータ転送すべきセクタ数
セグメント: 上述の16ビットのセグメント値
オフセット: 上述の16ビットのオフセット値
HDDアドレス:ディスクアクセスを行うべき開始アドレス
ドライブ番号: アクセス対象のディスク装置のドライブ番号
上位プログラムは、これらR/Wファンクション、転送セクタ数、セグメント、オフセット、HDDアドレス、ドライブ番号をそれぞれCPU11のAHレジスタ、ALレジスタ、ESレジスタ、BXレジスタ、CX/DHレジスタ、DLレジスタなどにセットした後に、INT13hをコールする。これにより、BIOSのディスクドライバ(INT13h)に制御が移る。
【0038】
BIOSのディスクドライバ(INT13h)は、まず、上位プログラムが動作していたCPU11の動作モード、つまり現在のCPU11の動作モードをチェックし、仮想アドレスモードであるか、リアルモードであるかを判別する(ステップS101,S102)。上述したようにBIOSはリアルモードで動作するように構成されているので、上位プログラムからのBIOSコールは、リアルモード又はV86モードで行われる。したがって、CPU11内のステータスレジスタのV86フラグがオンであるか否かを調べることにより、仮想アドレスモードであるか、リアルモードであるかを判別することができる。
【0039】
仮想アドレスモード、つまりV86モードである場合、BIOSのディスクドライバ(INT13h)は、CPU11にHDD17に対するアクセスを繰り返し実行させるというPIO転送モードによってHDD17との間のデータ転送を実行する(ステップS103)。
【0040】
一方、リアルモードであれば、BIOSのディスクドライバ(INT13h)は、DMA転送モードによってHDD17との間のデータ転送を実行する(ステップS104)。この場合、BIOSのディスクドライバ(INT13h)は、まず、ESレジスタのセグメントとBXレジスタのオフセットの値から物理メモリアドレスを計算し(セグメント×16+オフセット=物理メモリアドレス)、そしてその物理メモリアドレスを計算する。そして、BIOSのディスクドライバ(INT13h)は、その物理メモリアドレスと、CX/DHにセットされているHDDアドレスをそれぞれ転送元/転送先アドレスの初期値としてバスマスタIDEコントローラ16にセットすると共に、ALレジスタの転送セクタ数をデータ転送幅としてバスマスタIDEコントローラ16にセットする。これにより、バスマスタIDEコントローラ16は、DMA転送を開始する。例えば、ディスクから主メモリ13のディスクリードの場合には、バスマスタIDEコントローラ16は、HDDアドレスで指定された位置のセクタデータから順にデータを読み出すと共に、その読み出したデータを物理メモリアドレスで指定される主メモリ13のメモリ番地から順に書き込むバスサイクルを実行する。
【0041】
図5は、仮想アドレスモードであるか否かだけではなく、HDD17がサポートする転送モードも考慮してデータ転送モードを決定する場合の処理例である。
【0042】
即ち、BIOSのディスクドライバ(INT13h)は、まず、上位プログラムが動作していたCPU11の動作モード、つまり現在のCPU11の動作モードをチェックし、仮想アドレスモードであるか、リアルモードであるかを判別する(ステップS101,S102)。ここまでは、図4と同じである。
【0043】
仮想アドレスモード、つまりV86モードである場合、BIOSのディスクドライバ(INT13h)は、HDD17からリードしたドライブパラメータ情報に基づいて、HDD17がRead/Write Multipleコマンドをサポートしているかどうかを判断し(ステップS201)、その結果に基づいて、Read/Write Multipleコマンド、またはRead/Write Sectorコマンドを用いたデータ転送を実行する(ステップS202)。Read/Write Multipleは複数セクタ分のリード/ライトをまとめて指定可能なコマンドであり、このRead/Write Multipleコマンドをサポートしていない場合には、HDDアクセスには単一のセクタ単位でリード/ライトを指定するRead/Write Sectorコマンドを用いたデータ転送モードが使用される。Read/Write Multiple、およびRead/Write Sectorのどちらも、PIO転送モードである。
【0044】
リアルモードである場合には、BIOSのディスクドライバ(INT13h)は、HDD17からリードしたドライブパラメータ情報に基づいて、HDD17がDMAをサポートしているかどうかを判断する(ステップS204)。サポートしていない場合は、HDDアクセスには前述のRead/Write Multipleコマンドを使用する。DMAをサポートしている場合には、次に、Ultra DMAをサポートしているかどうかを判断する(ステップS205)。サポートしていない場合は、HDDアクセスにはDMA Read/Writeコマンドを使用する(ステップS207)。サポートしている場合は、Ultra DMA Read/Writeコマンドを使用する(ステップS208)。DMA Read/Writeコマンド、およびUltra DMA Read/Writeコマンドのどちらも前述のDMA転送のためのコマンドである。
【0045】
多くのHDDはRead/Write MultipleおよびUltra DMA Read/Writeをサポートしているので、転送セクター数が2以上であれは、実際には、仮想アドレスモードではRead/Write MultipleコマンドによるPIO転送が実行され、リアルモードではUltraDMA Read/Writeコマンドを用いたDMA転送が実行されることになる。
【0046】
データ転送レートは、Ultra DMA Read/Writeが最も高く、次いで、DMA Read/Write、Read/Write Multiple、Read/Write Sectorの順となる。
【0047】
次に、図6を参照して、システム起動時、つまりオペレーティングシステム(OS)をブートストラップするときの動作について説明する。
【0048】
電源スイッチ22がオンされることによってシステムがパワーオンされると、BIOSはそのディスクドライバ(INT13h)を用いて、HDD17のMBR(Master Boot Record)の内容を主メモリ13に読み込むためのディスクアクセスを行う。MBRにはアクティブパーティションからブートコード(OSローダ)を読み出してくるためのマスターブートコードが含まれており、マスターブートコードに制御が渡される。マスターブートコードは、CPU11のレジスタにOSローダの読み込みに必要なパラメータを設定した後、BIOSのディスクドライバ(INT13h)をコールする。ディスクドライバ(INT13h)は、マスターブートコードから指定されたディスクリードを実行して、OSローダを主メモリ13に読み込む。この後、OSローダに制御が渡され、OSローダはCPU11のレジスタにカーネルの読み込みに必要なパラメータを設定した後、BIOSのディスクドライバ(INT13h)をコールする。
【0049】
ディスクドライバ(INT13h)は、OSローダから指定されたディスクリードを実行して、カーネルを主メモリ13に読み込む。この後、OSローダからカーネルに制御が渡される。カーネルは各種ドライバの読み込みをBIOSのディスクドライバ(INT13h)を用いて行うが、その途中で、リアルモードからプロテクトモードへの切り換えが行われる。BIOSのディスクドライバ(INT13h)をコールする場合には、V86モードが用いられる。ディスクドライバ(INT13h)がコールされる環境がリアルモードからV86モードに切り替えられるまでは、ディスクドライバ(INT13h)によるディスク装置とメモリとの間のデータ転送は全てDMA転送によって行われる。そして、V86モードに切り替えられた後は、PIOモードによるディスクアクセスが行われる。これにより、ディスクドライバ(INT13h)が常にPIOモードによってディスクアクセスを行う場合に比べ、OSのブートストラップシーケンスの高速化を図ることが可能となる。
【0050】
次に、図7を参照して、ハイバネーション状態からの復帰時の動作について説明する。
【0051】
電源スイッチ22のオンなどのウェイクアップイベントが発生すると、BIOSはそのディスクドライバ(INT13h)を用いて、HDD17のMBR(Master Boot Record)の内容を主メモリ13に読み込むためのディスクアクセスを行う。MBRにはアクティブパーティションからブートコード(OSローダ)を読み出してくるためのマスターブートコードが含まれており、マスターブートコードに制御が渡される。マスターブートコードは、CPU11のレジスタにOSローダの読み込みに必要なパラメータを設定した後、BIOSのディスクドライバ(INT13h)をコールする。ディスクドライバ(INT13h)は、マスターブートコードから指定されたディスクリードを実行して、OSローダを主メモリ13に読み込む。この後、OSローダに制御が渡される。OSローダは、ハイバネーションからの復帰であるか通常のブートストラップであるかを判定する。この判定は、例えばハイバネーション状態への移行時にそれを示すフラグをOS内部やEC20のレジスタなどに記憶しておき、OSローダの実行時にそれを参照すること等によって行うことができる。
【0052】
ハイバネーションからの復帰である場合には、OSローダは、CPU11のレジスタに、HDD17にセーブされているメモリイメージの読み込みに必要なパラメータを設定した後、BIOSのディスクドライバ(INT13h)をコールする。ディスクドライバ(INT13h)は、OSローダから指定されたディスクリードを実行して、メモリイメージを主メモリ13に読み込む。この時、CPU11はまだリアルモードであるので、HDD17から主メモリ13へのメモリイメージの転送はDMA転送によって高速実行される。この後、OSによって各主デバイスの状態復元に必要な処理等が実行されることにより、ハイバネーション移行前の作業環境が復元される。
【0053】
以上のように、本実施形態によれば、上位プログラムからディスク入出力動作が要求された時のCPU11の動作モードに応じてDMA転送とPIO転送を選択的に切り替えて実行することにより、誤った物理メモリアドレスの算出などの不具合を招くことなく、ディスク装置とメモリとの間のデータ転送を効率よく実行することが可能となる。特に、ハイバネーションからの復帰時には大量のメモリイメージデータを高速データ転送可能なUltra DMA Read/Writeコマンドを用いることにより、PIOを用いる場合比べ、メモリイメージデータの読み込みに要する時間を大幅に短縮することができる。
【0054】
【発明の効果】
以上説明したように、本発明によれば、動作の信頼性を損なうことなく、ディスク装置との間のデータ転送効率を十分に向上させることが可能となる。
【図面の簡単な説明】
【図1】本発明の一実施形態に係るコンピュータシステムの構成を示すブロック図。
【図2】同実施形態においてCPUがリアルモード時における物理アドレス計算方式を説明するための図。
【図3】同実施形態においてCPUがプロテクトモード時における物理アドレス計算方式を説明するための図。
【図4】同実施形態で実行されるディスクアクセス動作を説明するためのフローチャート。
【図5】同実施形態で実行されるディスクアクセス動作の第2の例を説明するためのフローチャート。
【図6】同実施形態におけるオペレーティングシステムのブートストラップ動作を説明するためのフローチャート。
【図7】同実施形態におけるハイバネーションからの復帰動作を説明するためのフローチャート。
【符号の説明】
11…CPU
12…ホスト−PCIブリッジ
13…主メモリ
16…バスマスタIDEコントローラ
17…HDD
18…BIOS−ROM
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a computer system and a data transfer control method used in the system, and more particularly to a computer system and a data transfer control method improved so as to efficiently execute data transfer with a disk device.
[0002]
[Prior art]
2. Description of the Related Art In recent years, various portable notebook computers or sub-notebook portable personal computers and pocket computers such as portable information terminals have been developed.
[0003]
This type of portable computer is provided with various power saving modes for saving the power of the computer system in order to extend the battery-operable time. The suspend mode is one of the power save modes with the least power consumption. That is, when the computer system is in the suspend mode, most other devices in the system are powered off except for the main memory storing system data necessary for restarting the operating system and user programs.
[0004]
The system data saved in the main memory is the status of the CPU and the status of various peripheral LSIs immediately before the computer system is set to the suspend mode. The main memory also stores the operating state of the operating system and application program and user data created by the application program. Information saved in the main memory is used to restore the work state immediately before the suspend mode.
[0005]
The system data is saved by a suspend routine incorporated in the system BIOS (basic input / output program). The system BIOS is for controlling hardware in the system according to a request from the operating system, and includes a device driver group for controlling various hardware devices in the system. The system BIOS suspend routine is activated when the system is powered off, etc., saves the CPU registers and various peripheral LSI statuses in the memory, and then powers off the system.
[0006]
Power to the main memory is maintained by the battery throughout the system power off. For this reason, the system status and user data are not lost, and the system can be returned to the working state before the suspension at high speed.
[0007]
However, if the capacity of the battery is reduced to the low battery state when the system is in the suspend mode, the data in the main memory is lost. In this case, the system cannot be returned to the state before suspending, and user data expanded in the main memory is also lost.
[0008]
Therefore, recently, hibernation has begun to be used as a new power save mode that replaces the suspend mode. Hibernation is a mode that powers down almost all devices in the system including the main memory after saving the status of the CPU and various peripheral LSIs and the contents of the main memory to the hard disk when the system power is turned off. Power consumption can be reduced. Further, even if the battery capacity is reduced, the information saved in the hard disk is not lost, so that the system state can be normally restored to the state immediately before the hibernation process. Therefore, many portable computers that are frequently used on the go where the AC adapter cannot be used implement hibernation as a power save mode.
[0009]
By the way, with the recent improvements in functions of operating systems and application programs, the memory capacity mounted as the main memory of portable computers is increasing. As the storage capacity of the main memory increases, the time required to save the contents of the main memory to the hard disk and the time required to restore the contents of the hard disk to the main memory also increase accordingly. For this reason, in a system using the hibernation mode, the time required for the hibernation process, that is, the time required from when the user turns off the power switch until the system is actually powered off, and after the user turns on the power switch. The time required to restore the system state is becoming very large.
[0010]
Conventionally, the data input / output operation with the hard disk device via the BIOS is always performed in the PIO (Programmed Input / Output) mode.
[0011]
That is, in a portable computer, ATA (Enhanced IDE) is used as an interface used to connect a hard disk drive. A typical transfer mode used in this Enhanced IDE is the aforementioned PIO mode. In ATA, PIO modes 0 to 4 are defined, and the maximum transfer rates are different from each other. The PIO mode is a transfer mode using a handshake between the CPU and the hard disk drive, and the CPU performs data transfer by repeatedly accessing the I / O port of the hard disk drive directly. Therefore, although the transfer speed is not high at all, this transfer method is sufficient in consideration of the data transfer capability of the hard disk drive itself that requires mechanical operations such as seek operation and spindle rotation.
[0012]
Recently, however, the density of hard disks has rapidly increased, and the data transfer capability of the hard disk itself has been greatly improved. In addition to PIO mode 4, it now supports DMA mode and Ultra DMA mode. Those with a disk interface are the mainstream. For this reason, the conventional BIOS data transfer method in which only the PIO mode is used to input / output data to / from the disk device causes a problem that the performance of the disk device cannot be fully exploited.
[0013]
[Problems to be solved by the invention]
However, when a BIOS disk access routine (INT13h) is called from a higher-level program such as an operating system, if data transfer is always performed using DMA transfer, a serious error may occur depending on the operation mode of the CPU at that time. There is a risk that
[0014]
That is, when executing DMA transfer (DMA mode or UltraDMA), the BIOS itself calculates the physical memory address that is the transfer destination / transfer source instead of using the CPU address conversion mechanism, and uses it as the transfer source. / It is necessary to set in a DMA control logic such as a bus master IDE controller as a transfer destination memory address. This is because in DMA transfer, memory access is executed not by the CPU but by a DMA control logic such as a bus master IDE controller. However, in practice, the method of calculating the physical memory address differs depending on the CPU operation mode (real mode, virtual address mode).
[0015]
That is, in the real mode, the conversion from the segment and the offset to the physical address is performed by the calculation of segment × 16 + offset = physical memory address, but in the virtual address mode such as the V86 mode and the protect mode, it is referred to as a descriptor table. It is necessary to refer to the virtual address translation table. Referring to the descriptor table requires a privilege level, and normally other programs (including BIOS) other than the operating system cannot access it.
[0016]
Therefore, if the BIOS always calculates the physical memory address by the calculation of segment × 16 + offset = physical memory address regardless of the operation mode of the CPU, and starts processing for DMA transfer using it, the CPU In the case of the mode (for example, V86 mode), an incorrect physical memory address is calculated, resulting in a malfunction.
[0017]
The present invention has been made in view of the above-described circumstances. The execution condition of the DMA transfer mode can be determined in consideration of the operation mode of the CPU, the operation is highly reliable, and the disk device is sufficiently connected. An object of the present invention is to provide a computer system and a data transfer control method capable of improving the data transfer efficiency.
[0018]
[Means for Solving the Problems]
In order to solve the above problems, the present invention provides: Without using virtual address translation table A computer having a CPU having a first operation mode for calculating a physical address from a segment and an offset, and a second operation mode for calculating a physical memory address by using a virtual address including the segment and the offset and a virtual address conversion table In the system, A DMA controller for executing DMA transfer between a disk device provided in the computer system and a memory of the computer system; Access to the disk unit was requested by a higher-level program In response to It is determined whether the operation mode of the CPU is the first operation mode or the second operation mode When executing the process and determining that the operation mode of the CPU is the first operation mode, A physical memory address is calculated from the segment and offset set in the CPU register, and the calculated physical memory address and a disk address set in another register of the CPU are calculated. By setting in the DMA controller, data transfer to and from the disk device requested by the host program is executed by DMA transfer by the DMA controller, and the operation mode of the CPU is the second operation mode. Is determined, the data transfer to and from the disk device requested by the higher-level program is executed in the PIO transfer mode in which the CPU repeatedly executes the access to the disk device. And a disk access control means.
[0019]
In this computer system, when access to a disk device is requested from a higher-level program, the CPU operation mode at that time is determined, and this is the first operation mode in which the physical memory address can be directly calculated from the segment and offset. On the condition, the processing for DMA transfer is executed. Therefore, it is possible to efficiently execute data transfer between the disk device and the memory without causing problems such as incorrect calculation of the physical memory address, and not only the normal disk input / output operation but also the operating system The bootstrap process and the return process from hibernation can be speeded up.
[0020]
The disk access control means causes the CPU to repeatedly execute access to the disk device when the current operation mode of the CPU is determined to be the second operation mode by the operation mode determination means. It is preferable that data transfer to and from the disk device requested by the higher-level program is executed depending on the mode. As a result, the DMA transfer mode and the PIO transfer mode can be selectively executed according to the current operation mode of the CPU, and the optimum transfer mode can always be used.
[0021]
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 computer system according to an embodiment of the present invention. This computer system is a notebook-type or sub-notebook-type portable personal computer, and is composed of a computer main body and an LCD panel unit attached to the computer main body so as to be freely opened and closed. This computer has a built-in battery, and is configured to be operable by electric power from the built-in battery. In addition, power can be supplied from an external power source such as an AC commercial power source via an AC adapter. When power is supplied from an external power source, the power from the external power source is used as an operating power source for the computer system. At this time, the built-in battery is automatically charged by the power from the external power source. When the AC adapter is removed or the AC commercial power supply breaker is turned off, the power from the built-in battery is used as the operating power supply for the computer system.
[0022]
A hard disk drive (HDD) 17 having an IDE interface is detachably mounted on the computer body. The HDD 17 is used as a secondary storage for the computer.
[0023]
On the system board of this computer, as shown, a CPU 11, a host-PCI bridge 12, a main memory 13, a VGA controller 14, a PCI-ISA bridge 15, a bus master IDE controller 16, a BIOS-ROM 18, an embedded controller ( EC) 20, a power supply controller (PSC) 21, and the like are provided.
[0024]
The CPU 11 executes operation control and data processing of the entire system. As the CPU 11, a CPU that supports a memory segmentation mechanism and a virtual addressing mechanism, for example, a microprocessor “Pentium” manufactured and sold by Intel Corporation is used. In this case, the CPU 11 has the following operation.
[0025]
That is, the CPU 11 has a real mode, a protect mode, and a virtual 8086 mode (V86 mode) as operation modes for executing a program such as an application program or an operating system (OS). The real mode is a real address mode using memory segmentation, and the protect mode and the virtual 86 mode are virtual address modes.
[0026]
In other words, the real mode is a mode in which a memory space of 1 Mbyte at the maximum can be accessed, and the conversion from a logical address to a physical address is an address calculation in which a physical address is determined by an offset value from a base address represented by a segment register. Done by the format. That is, as shown in FIG. 2, the segment is a 16-bit value (sometimes referred to as a selector) that virtually represents the memory segment, and the physical memory address is shifted by 4 bits to the left of the segment value ( 16 times) as a base address, and an offset value represented by 16 bits is added to the base address.
[0027]
On the other hand, the protect mode is a mode in which a memory space of up to 4 Gbytes per task can be accessed, and a linear address is determined using a virtual address conversion table called a descriptor table. This linear address is finally converted into a physical address by paging. That is, as shown in FIG. 3, the segment value is used as a pointer for referring to the descriptor table, the value obtained from the descriptor table is used as a base address, and an offset value represented by 16 bits is used as the base address. In addition, a linear address is calculated. The V86 mode is an operation mode for emulating the real mode in the protect mode environment, and uses the same virtual address calculation method as the protect mode.
[0028]
The operation mode at the time of initialization of the CPU 11 is a real mode, and is switched to the protect mode and the V86 mode under the control of software such as an operating system.
[0029]
The host-PCI bridge 12 is a bridge that connects the CPU bus 1 and the PCI bus 2 bidirectionally, and a memory controller for controlling the main memory 13 is also incorporated therein. The main memory 13 is used as a main memory of this system, that is, a system memory, and stores an operating system, an application program to be processed, user data created by the application program, and the like. The main memory 13 is realized by a semiconductor memory such as a DRAM.
[0030]
The BIOS-ROM 18 is for storing a system BIOS (Basic I / O System), and is configured by a flash memory so that the program can be rewritten. The system BIOS is a systematic function execution routine for accessing various hardware in the system, and is configured to operate in a real mode. The system BIOS includes a processing routine for bootstrapping the operating system when the system is powered on, a BIOS driver group for various hardware control, and the like. Each BIOS driver includes a plurality of function execution routine groups corresponding to these functions in order to provide a plurality of functions for hardware control to the operating system and application programs. When INT13h is called from the upper program, the BIOS hard disk driver is executed. This driver (INT13h) includes a function for performing data transfer with the HDD 17 by DMA transfer and a function for performing PIO transfer.
[0031]
The EC 20 is a controller for controlling additional functions of the system. A thermal control function for controlling the rotation of the cooling fan in accordance with the temperature around the CPU and the like, and various states of the system are controlled by lighting of LEDs and beeps. It has an LED / beep sound control function for notifying the user, a power sequence control function for controlling on / off of the system power in cooperation with the power controller 21, a power status notification function, and the like. Even in the hibernation state, the operation power is supplied to the EC 20 and the power controller 21, and the on / off of the power switch 22 and the panel switch 23 is monitored.
[0032]
Hibernation saves the status of the CPU 11 and various peripheral LSIs and the contents of the main memory 13 to the hard disk 17 at the occurrence of an event for transition to the power save mode such as system power off, and then almost all the systems including the main memory 17 in the system. In this mode, the device is powered down. When a wake-up event such as system power off occurs in the hibernation state, the memory image saved in the hard disk 17 is restored to the main memory 13 and restored to the work state before hibernation. The control of hibernation execution and return processing is ACPI (Advanced Configuration and Power).
Interface) is executed under the management of the corresponding OS.
[0033]
The VGA controller 14 is for controlling an LCD and an external CRT used as a display monitor of this system, and displays screen data drawn in the VRAM on one or both of the LCD and the external CRT.
[0034]
The bus master IDE controller 16 is for controlling an IDE device (here, the HDD 17) mounted on the computer main body, and is a bus master function (DMA controller) capable of executing DMA transfer between the IDE device and the main memory 13. )have. This bus master function executes a bus cycle (DMA transfer) for data transfer by itself in response to a command from the CPU 11, and with the IDE device and the main memory 13 in a state where the CPU load is reduced as compared with the PIO mode. Can be transferred at high speed.
[0035]
Next, the BIOS disk access operation will be described with reference to FIG.
[0036]
Here, it is assumed that a BIOS disk driver (INT13h) is called from a higher-level program such as an operating system. The BIOS call of INT13h is realized by using the software interrupt function of the CPU 11. In this case, the following I / O parameters are notified from the host program to the BIOS disk driver (INT13h) through the register of the CPU 11.
[0037]
R / W function: Indicates disk read or disk write
Number of transfer sectors: Number of sectors to transfer data to / from the disk unit
Segment: 16-bit segment value as described above
Offset: The above 16-bit offset value
HDD address: Start address for disk access
Drive number: Drive number of the disk device to be accessed
The upper program sets the R / W function, transfer sector number, segment, offset, HDD address, and drive number in the AH register, AL register, ES register, BX register, CX / DH register, DL register, etc. of the CPU 11, respectively. Later, INT13h is called. As a result, the control is transferred to the BIOS disk driver (INT13h).
[0038]
The BIOS disk driver (INT13h) first checks the operation mode of the CPU 11 in which the host program was operating, that is, the current operation mode of the CPU 11, and determines whether it is the virtual address mode or the real mode ( Steps S101 and S102). As described above, since the BIOS is configured to operate in the real mode, the BIOS call from the host program is performed in the real mode or the V86 mode. Therefore, by checking whether or not the V86 flag of the status register in the CPU 11 is on, it is possible to determine whether it is the virtual address mode or the real mode.
[0039]
In the virtual address mode, that is, the V86 mode, the BIOS disk driver (INT13h) executes data transfer with the HDD 17 in the PIO transfer mode in which the CPU 11 repeatedly executes access to the HDD 17 (step S103).
[0040]
On the other hand, in the real mode, the BIOS disk driver (INT13h) executes data transfer with the HDD 17 in the DMA transfer mode (step S104). In this case, the BIOS disk driver (INT13h) first calculates the physical memory address from the segment of the ES register and the offset value of the BX register (segment × 16 + offset = physical memory address), and then calculates the physical memory address. To do. Then, the BIOS disk driver (INT13h) sets the physical memory address and the HDD address set in CX / DH in the bus master IDE controller 16 as initial values of the transfer source / destination addresses and the AL register. Are set in the bus master IDE controller 16 as the data transfer width. As a result, the bus master IDE controller 16 starts DMA transfer. For example, in the case of disk read from the main memory 13 from the disk, the bus master IDE controller 16 reads data sequentially from the sector data at the position specified by the HDD address, and the read data is specified by the physical memory address. A bus cycle for writing in order from the memory address of the main memory 13 is executed.
[0041]
FIG. 5 shows a processing example when determining the data transfer mode in consideration of not only the virtual address mode but also the transfer mode supported by the HDD 17.
[0042]
That is, the BIOS disk driver (INT13h) first checks the operation mode of the CPU 11 in which the host program was operating, that is, the current operation mode of the CPU 11, and determines whether it is the virtual address mode or the real mode. (Steps S101 and S102). Up to this point, the process is the same as in FIG.
[0043]
In the virtual address mode, that is, the V86 mode, the BIOS disk driver (INT13h) determines whether the HDD 17 supports the Read / Write Multiple command based on the drive parameter information read from the HDD 17 (step S201). ), Based on the result, data transfer using a Read / Write Multiple command or a Read / Write Sector command is executed (step S202). Read / Write Multiple is a command that can specify read / write for a plurality of sectors at a time. If this Read / Write Multiple command is not supported, read / write in units of a single sector for HDD access. A data transfer mode using a Read / Write Sector command that designates “” is used. Both Read / Write Multiple and Read / Write Sector are PIO transfer modes.
[0044]
In the real mode, the BIOS disk driver (INT13h) determines whether the HDD 17 supports DMA based on the drive parameter information read from the HDD 17 (step S204). If not supported, the aforementioned Read / Write Multiple command is used for HDD access. If the DMA is supported, it is next determined whether or not the Ultra DMA is supported (step S205). If not supported, a DMA Read / Write command is used for HDD access (step S207). If it is supported, an Ultra DMA Read / Write command is used (step S208). Both the DMA Read / Write command and the Ultra DMA Read / Write command are commands for the aforementioned DMA transfer.
[0045]
Many HDDs support Read / Write Multiple and Ultra DMA Read / Write, so even if the number of transfer sectors is 2 or more, PIO transfer is actually executed in the virtual address mode using the Read / Write Multiple command. In the real mode, DMA transfer using the UltraDMA Read / Write command is executed.
[0046]
The data transfer rate is highest for Ultra DMA Read / Write, followed by DMA Read / Write, Read / Write Multiple, and Read / Write Sector.
[0047]
Next, with reference to FIG. 6, the operation when the system is started, that is, when the operating system (OS) is bootstrapped will be described.
[0048]
When the system is powered on by turning on the power switch 22, the BIOS uses the disk driver (INT 13 h) to access the disk for reading the contents of the MBR (Master Boot Record) of the HDD 17 into the main memory 13. Do. The MBR includes a master boot code for reading the boot code (OS loader) from the active partition, and control is transferred to the master boot code. The master boot code sets a parameter necessary for reading the OS loader in the register of the CPU 11 and then calls the BIOS disk driver (INT13h). The disk driver (INT 13h) executes a disk read designated by the master boot code, and reads the OS loader into the main memory 13. Thereafter, control is transferred to the OS loader. The OS loader sets parameters necessary for reading the kernel in the register of the CPU 11, and then calls the BIOS disk driver (INT13h).
[0049]
The disk driver (INT13h) reads the kernel into the main memory 13 by executing the disk read designated by the OS loader. Thereafter, control is transferred from the OS loader to the kernel. The kernel reads various drivers by using a BIOS disk driver (INT13h), and the mode is switched from the real mode to the protected mode. When calling the BIOS disk driver (INT13h), the V86 mode is used. Until the environment in which the disk driver (INT13h) is called is switched from the real mode to the V86 mode, all data transfer between the disk device and the memory by the disk driver (INT13h) is performed by DMA transfer. Then, after switching to the V86 mode, disk access in the PIO mode is performed. As a result, it is possible to increase the speed of the bootstrap sequence of the OS as compared with the case where the disk driver (INT 13h) always accesses the disk in the PIO mode.
[0050]
Next, with reference to FIG. 7, the operation at the time of returning from the hibernation state will be described.
[0051]
When a wake-up event such as turning on the power switch 22 occurs, the BIOS uses the disk driver (INT13h) to perform disk access for reading the contents of the MBR (Master Boot Record) of the HDD 17 into the main memory 13. The MBR includes a master boot code for reading the boot code (OS loader) from the active partition, and control is transferred to the master boot code. The master boot code sets a parameter necessary for reading the OS loader in the register of the CPU 11 and then calls the BIOS disk driver (INT13h). The disk driver (INT 13h) executes a disk read designated by the master boot code, and reads the OS loader into the main memory 13. Thereafter, control is passed to the OS loader. The OS loader determines whether it is a return from hibernation or a normal bootstrap. This determination can be performed, for example, by storing a flag indicating the status in the hibernation state in the OS or in a register of the EC 20 and referring to the flag when executing the OS loader.
[0052]
In the case of returning from hibernation, the OS loader sets a parameter necessary for reading the memory image saved in the HDD 17 in the register of the CPU 11, and then calls the BIOS disk driver (INT13h). The disk driver (INT13h) reads the memory image into the main memory 13 by executing the disk read designated by the OS loader. At this time, since the CPU 11 is still in the real mode, the transfer of the memory image from the HDD 17 to the main memory 13 is executed at a high speed by the DMA transfer. Thereafter, processing necessary for restoring the state of each main device is executed by the OS, so that the work environment before the transition to hibernation is restored.
[0053]
As described above, according to the present embodiment, an error is caused by selectively switching between DMA transfer and PIO transfer according to the operation mode of the CPU 11 when a disk input / output operation is requested from a higher-level program. Data transfer between the disk device and the memory can be performed efficiently without causing problems such as calculation of the physical memory address. In particular, when returning from hibernation, using the Ultra DMA Read / Write command that can transfer a large amount of memory image data at a high speed can significantly reduce the time required for reading the memory image data compared to the case of using PIO. it can.
[0054]
【The invention's effect】
As described above, according to the present invention, it is possible to sufficiently improve the data transfer efficiency with the disk device without impairing the reliability of the operation.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a computer system according to an embodiment of the present invention.
FIG. 2 is a view for explaining a physical address calculation method when the CPU is in a real mode in the embodiment;
FIG. 3 is a view for explaining a physical address calculation method when the CPU is in a protect mode in the embodiment;
FIG. 4 is a flowchart for explaining a disk access operation executed in the embodiment;
FIG. 5 is a flowchart for explaining a second example of the disk access operation executed in the embodiment;
FIG. 6 is a flowchart for explaining a bootstrap operation of the operating system in the embodiment;
FIG. 7 is a flowchart for explaining a return operation from hibernation in the embodiment;
[Explanation of symbols]
11 ... CPU
12 ... Host-PCI bridge
13 ... Main memory
16 ... Bus master IDE controller
17 ... HDD
18 ... BIOS-ROM

Claims (3)

仮想アドレス変換テーブルを使用せずにセグメントおよびオフセットから物理アドレスを計算する第1動作モードと、前記セグメントおよびオフセットを含む仮想アドレスと仮想アドレス変換テーブルとを用いて物理メモリアドレスを計算する第2動作モードとを有するCPUを備えたコンピュータシステムにおいて、
前記コンピュータシステムに設けられたディスク装置と前記コンピュータシステムのメモリとの間でDMA転送を実行するためのDMAコントローラと、
前記ディスク装置に対するアクセスが上位プログラムから要求されたことに応答して前記CPUの動作モードが前記第1動作モードおよび前記第2動作モードのいずれであるかを判別する処理を実行すると共に、前記CPUの動作モードが前記第1動作モードであることが判別された場合には、前記CPUのレジスタにセットされている前記セグメントおよびオフセットから物理メモリアドレスを算出し、その算出した物理メモリアドレスおよび前記CPUの別のレジスタにセットされているディスクアドレスを前記DMAコントローラにセットすることにより、前記上位プログラムから要求された前記ディスク装置との間のデータ転送を前記DMAコントローラによるDMA転送によって実行し、前記CPUの動作モードが前記第2動作モードであることが判別された場合には、前記CPUに前記ディスク装置に対するアクセスを繰り返し実行させるPIO転送モードによって、前記上位プログラムから要求された前記ディスク装置との間のデータ転送を実行するディスクアクセス制御手段とを具備することを特徴とするコンピュータシステム。
A first operation mode for calculating a physical address from a segment and an offset without using a virtual address conversion table, and a second operation for calculating a physical memory address using the virtual address and the virtual address conversion table including the segment and the offset In a computer system comprising a CPU having a mode,
A DMA controller for executing a DMA transfer between a disk device provided in the computer system and a memory of the computer system;
In response to a request from the host program to access the disk device, the CPU executes a process for determining whether the operation mode of the CPU is the first operation mode or the second operation mode, and the CPU When it is determined that the operation mode is the first operation mode, a physical memory address is calculated from the segment and offset set in the register of the CPU, and the calculated physical memory address and the CPU By setting a disk address set in another register in the DMA controller to the DMA controller, data transfer to and from the disk device requested by the host program is executed by DMA transfer by the DMA controller, and the CPU Is the second operation mode. Disk access that executes data transfer to and from the disk device requested by the higher-level program in a PIO transfer mode that causes the CPU to repeatedly execute access to the disk device. And a control means.
前記上位プログラムはオペレーティングシステムであり、前記オペレーティングシステムが、そのブートストラップシーケンスの途中でディスク装置に対するアクセスを行うディスクドライバを呼び出す際の前記CPUの動作モードが第1の動作モードであると判別された場合は、前記CPUの動作モードを前記第1動作モードから前記第2動作モードに切り替えるまでは、前記ディスクアクセス制御手段は、前記ブートストラップシーケンス中の前記オペレーティングシステムからの要求に応じて、前記オペレーティングシステムを構成するファイル群を前記ディスク装置からリードするためのデータ転送を前記DMAコントローラによるDMA転送によって実行することを特徴とする請求項1記載のコンピュータシステム。The upper program is an operating system, and it is determined that the operating mode of the CPU when the operating system calls a disk driver that accesses the disk device during the bootstrap sequence is the first operating mode. If the operation mode of the CPU to switch from the first operation mode to the second operation mode, the disk access control means, in response to a request from the operating system in the bootstrap sequence, the operating 2. The computer system according to claim 1, wherein data transfer for reading a file group constituting the system from the disk device is executed by DMA transfer by the DMA controller. 仮想アドレス変換テーブルを使用せずにセグメントおよびオフセットから物理アドレスを計算する第1動作モードと、前記セグメントおよびオフセットを含む仮想アドレスと仮想アドレス変換テーブルとを用いて物理メモリアドレスを計算する第2動作モードとを有するCPUを備えたコンピュータシステムに適用されるデータ転送制御方法であって、
前記コンピュータシステムに設けられたディスク装置に対するアクセスが上位プログラムから要求されたことに応答して前記CPUの動作モードが前記第1動作モードおよび前記第2動作モードのいずれであるかを判別するステップと、
前記CPUの動作モードが前記第1動作モードであることが判別された場合、前記CPUのレジスタにセットされている前記セグメントおよびオフセットから物理メモリアドレスを算出し、その算出した物理メモリアドレスおよび前記CPUの別のレジスタにセットされているディスクアドレスを、前記コンピュータシステムに設けられたDMAコントローラにセットすることにより、前記上位プログラムから要求された前記ディスク装置との間のデータ転送を前記DMAコントローラによるDMA転送によって実行するステップと、
前記CPUの動作モードが前記第2動作モードであることが判別された場合、前記CPUに前記ディスク装置に対するアクセスを繰り返し実行させるPIO転送モードによって、前記上位プログラムから要求された前記ディスク装置との間のデータ転送を実行するステップとを具備することを特徴とするデータ転送制御方法。
A first operation mode for calculating a physical address from a segment and an offset without using a virtual address conversion table, and a second operation for calculating a physical memory address using the virtual address and the virtual address conversion table including the segment and the offset A data transfer control method applied to a computer system including a CPU having a mode,
Determining whether the operation mode of the CPU is the first operation mode or the second operation mode in response to a request from a higher-level program to access a disk device provided in the computer system; ,
When it is determined that the operation mode of the CPU is the first operation mode, a physical memory address is calculated from the segment and offset set in the register of the CPU, and the calculated physical memory address and the CPU By setting a disk address set in another register in the DMA controller provided in the computer system, data transfer to and from the disk device requested by the higher-level program is performed by the DMA by the DMA controller. Steps to be performed by transfer,
When it is determined that the operation mode of the CPU is the second operation mode, the PIO transfer mode in which the CPU repeatedly executes access to the disk device, and the disk device requested by the higher-level program. A data transfer control method comprising the steps of:
JP2000290939A 2000-09-25 2000-09-25 Computer system and data transfer control method Expired - Fee Related JP4155545B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000290939A JP4155545B2 (en) 2000-09-25 2000-09-25 Computer system and data transfer control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000290939A JP4155545B2 (en) 2000-09-25 2000-09-25 Computer system and data transfer control method

Publications (2)

Publication Number Publication Date
JP2002099502A JP2002099502A (en) 2002-04-05
JP4155545B2 true JP4155545B2 (en) 2008-09-24

Family

ID=18774095

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000290939A Expired - Fee Related JP4155545B2 (en) 2000-09-25 2000-09-25 Computer system and data transfer control method

Country Status (1)

Country Link
JP (1) JP4155545B2 (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4436219B2 (en) 2004-09-10 2010-03-24 富士通株式会社 Information processing apparatus and power supply control method
JP5017785B2 (en) 2005-03-18 2012-09-05 富士通株式会社 Information processing apparatus, high-speed startup method, and program
US8095816B1 (en) 2007-04-05 2012-01-10 Marvell International Ltd. Processor management using a buffer
US8443187B1 (en) 2007-04-12 2013-05-14 Marvell International Ltd. Authentication of computing devices in server based on mapping between port identifier and MAC address that allows actions-per-group instead of just actions-per-single device
JP4400650B2 (en) 2007-05-23 2010-01-20 セイコーエプソン株式会社 Data transfer control device and electronic device
US8321706B2 (en) 2007-07-23 2012-11-27 Marvell World Trade Ltd. USB self-idling techniques
US8510560B1 (en) 2008-08-20 2013-08-13 Marvell International Ltd. Efficient key establishment for wireless networks
WO2010033497A1 (en) 2008-09-18 2010-03-25 Marvell World Trade Ltd. Preloading applications onto memory at least partially during boot up
CN102272734B (en) * 2009-01-05 2014-09-10 马维尔国际贸易有限公司 Method and system for hibernation or suspend using a non-volatile-memory device
JP5598144B2 (en) 2010-08-04 2014-10-01 ソニー株式会社 Information processing apparatus, power supply control method, and program
US9411517B2 (en) * 2010-08-30 2016-08-09 Vmware, Inc. System software interfaces for space-optimized block devices
US9141394B2 (en) 2011-07-29 2015-09-22 Marvell World Trade Ltd. Switching between processor cache and random-access memory
US9436629B2 (en) 2011-11-15 2016-09-06 Marvell World Trade Ltd. Dynamic boot image streaming
US9575768B1 (en) 2013-01-08 2017-02-21 Marvell International Ltd. Loading boot code from multiple memories
US9736801B1 (en) 2013-05-20 2017-08-15 Marvell International Ltd. Methods and apparatus for synchronizing devices in a wireless data communication system
US9521635B1 (en) 2013-05-21 2016-12-13 Marvell International Ltd. Methods and apparatus for selecting a device to perform shared functionality in a deterministic and fair manner in a wireless data communication system
EP3028145A1 (en) 2013-07-31 2016-06-08 Marvell World Trade Ltd. Parallelizing boot operations
EP3427435A1 (en) 2016-03-08 2019-01-16 Marvell World Trade Ltd. Methods and apparatus for secure device authentication

Also Published As

Publication number Publication date
JP2002099502A (en) 2002-04-05

Similar Documents

Publication Publication Date Title
JP4155545B2 (en) Computer system and data transfer control method
US8843733B2 (en) Switching between multiple operating systems (OSes) using sleep state management and sequestered re-baseable memory
TWI407300B (en) Method and controller for power management
JP4580528B2 (en) Computer system and its resume processing method
US5931951A (en) Computer system for preventing cache malfunction by invalidating the cache during a period of switching to normal operation mode from power saving mode
US20070022241A1 (en) Dual media storage device
JPH05289854A (en) Access device for external storage device
KR20010033687A (en) Information handling system with suspend/resume operation
JPH07200112A (en) Information processing system
JPH07219848A (en) Cache control system
EP1710674A1 (en) Storage device and information processing system
US6154846A (en) System for controlling a power saving mode in a computer system
US7096299B2 (en) Method and apparatus for transferring system context information between mobile computer and base station
KR970011216B1 (en) Information processing system
JP2974577B2 (en) Computer system
JPH0944418A (en) Information-processing system and its control method
JP3943764B2 (en) Computer system and CPU performance control method thereof
US6282645B1 (en) Computer system for reading/writing system configuration using I/O instruction
JP2003085041A (en) Disc cache system
JP3238097B2 (en) Computer system and data save control method in the system
JP3961669B2 (en) Computer system and data transfer control method
JPH11194847A (en) Computer system and initialization controller
JP5894044B2 (en) Method and portable computer for storing data in a hybrid disk drive
JP3702233B2 (en) Information processing system and program execution mode control method
US7937577B2 (en) Information processing apparatus and operating system determination method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040301

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060731

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060808

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061010

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070417

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070613

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20070620

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: 20080704

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: 20080707

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

Free format text: PAYMENT UNTIL: 20110718

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110718

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120718

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees