JP2004287618A - Starting control method of operating system, program making computer execute its method, and starting control device of operating system - Google Patents
Starting control method of operating system, program making computer execute its method, and starting control device of operating system Download PDFInfo
- Publication number
- JP2004287618A JP2004287618A JP2003076496A JP2003076496A JP2004287618A JP 2004287618 A JP2004287618 A JP 2004287618A JP 2003076496 A JP2003076496 A JP 2003076496A JP 2003076496 A JP2003076496 A JP 2003076496A JP 2004287618 A JP2004287618 A JP 2004287618A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- operating system
- instruction group
- group
- control method
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
- Stored Programmes (AREA)
Abstract
Description
【0001】
【発明の属する技術分野】
この発明は、一台のコンピュータで同時に動作する複数のオペレーティングシステムのうちの一つのオペレーティングシステムの起動を制御するオペレーティングシステム起動制御方法およびその方法をコンピュータに実行させるプログラム、ならびにオペレーティングシステム起動制御装置に関し、特に、起動されるオペレーティングシステムの改造を不要とし、もって開発期間の短縮および開発コストの低減を図ることができるオペレーティングシステム起動制御方法およびその方法をコンピュータに実行させるプログラム、ならびにオペレーティングシステム起動制御装置に関する。
【0002】
【従来の技術】
通常のコンピュータでは、一つのオペレーティングシステムがプロセッサ、メモリ、二次記憶装置などのコンピュータ資源を管理し、コンピュータが効率良く動作できるように資源スケジュールを実施している。しかし、オペレーティングシステムには、バッチ処理に優れているもの、TSS(Time Sharing System)に優れているもの、GUI(Graphical User Interface)に優れているものなど様々な種類があることから、各OSの特徴を活かして複数のOSを同時に利用したいという要求がある。
【0003】
たとえば、大型計算機においては、実際の業務に伴うオンライン処理を実行するオペレーティングシステムと、開発用のオペレーティングシステムとを一台のコンピュータで動作させたいという要求がある。あるいは、GUIの整っているオペレーティングシステムと、実時間性に優れているオペレーティングシステムとを同時に稼動させたいという要求もある。
【0004】
しかしながら、個々のオペレーティングシステムは、単独でコンピュータ資源の管理を実施することを前提として設計されていることから、複数のオペレーティングシステムを共存させるためには、個々のオペレーティングシステムに対して何らかの改造が必要となる。
【0005】
特に、あるオペレーティングシステムを起動した後で他のオペレーティングシステムを起動するためには、先に起動したオペレーティングシステムの走行環境を破壊することなく他のオペレーティングシステムを起動する必要がある。したがって、他のオペレーティングシステムを物理メモリへロードする場合に、先に起動したオペレーティングシステムがロードされている物理メモリ領域が上書きされることや、コンピュータに接続された入出力装置の初期化が繰り返しおこなわれることなどを防ぐ必要がある。
【0006】
そこで、先に起動したオペレーティングシステムの走行環境を破壊することなく他のオペレーティングシステムを起動する技術が開発されている(たとえば、特許文献1、2および3参照。)。
【0007】
また、先に起動したオペレーティングシステムの走行環境を破壊しないように他のオペレーティングシステムを起動する場合に利用可能な技術として、プログラムの内容を変更する技術が開発されている(たとえば、特許文献4〜7参照。)。
【0008】
【特許文献1】
特開平11−149385号公報
【特許文献2】
特開2001−216172号公報
【特許文献3】
特開平08−212089号公報
【特許文献4】
特開2000−181725号公報
【特許文献5】
特開2000−305768号公報
【特許文献6】
特開平11−65854号公報
【特許文献7】
特開平6−332751号公報
【0009】
【発明が解決しようとする課題】
しかしながら、かかる従来技術では、後から起動するオペレーティングシステムを改造する必要があるか、あるいは、改造する必要がない場合にも、特別なハードウェアが必要であるなどの問題がある。
【0010】
この発明は、上述した従来技術による問題点を解消するためになされたものであり、起動されるオペレーティングシステムの改造を不要とし、もって開発期間の短縮および開発コストの低減を図ることができるオペレーティングシステム起動制御方法およびその方法をコンピュータに実行させるプログラム、ならびにオペレーティングシステム起動制御装置を提供することを目的とする。
【0011】
【課題を解決するための手段】
上述した課題を解決し、目的を達成するため、請求項1の発明に係るオペレーティングシステムは、一台のコンピュータで同時に動作する複数のオペレーティングシステムのうちの一つのオペレーティングシステムの起動を制御するオペレーティングシステム起動制御方法であって、起動されるオペレーティングシステムの処理として次に実行される命令が特定の命令群に属する命令であるか否かの判定をおこなう命令群判定工程と、前記命令群判定工程が特定の命令群に属する命令であると判定をおこなった場合に、該特定の命令群に対して代替処理をおこなう代替処理工程と、を含んだことを特徴とする。
【0012】
この請求項1の発明によれば、起動されるオペレーティングシステムの処理として次に実行される命令が特定の命令群に属する命令であるか否かの判定をおこない、特定の命令群に属する命令であると判定をおこなった場合に、特定の命令群に対して代替処理をおこなう代替処理工程おこなうこととしたので、起動されるオペレーティングシステムの改造を不要とし、もって開発期間の短縮および開発コストの低減を図ることができる。
【0013】
また、請求項2の発明に係るオペレーティングシステム起動制御方法は、請求項1の発明において、前記命令群判定工程は、コンピュータを構成する中央演算装置のトレースモードにおいて各命令が実行される際に発生する割込みの処理の中で前記判定をおこなうことを特徴とする。
【0014】
この請求項2の発明によれば、コンピュータを構成する中央演算装置のトレースモードにおいて各命令が実行される際に発生する割込みの処理の中で判定をおこなうこととしたので、起動されるオペレーティングシステムの処理から自動的に制御を受け取って代替処理をおこなうことができる。
【0015】
また、請求項3の発明に係るオペレーティングシステム起動制御方法は、請求項1の発明において、前記命令群判定工程は、起動されるオペレーティングシステムの命令アドレスに設定したブレークポイントにおいて発生する割込みの処理の中で前記判定をおこなうことを特徴とする。
【0016】
この請求項3の発明によれば、起動されるオペレーティングシステムの命令アドレスに設定したブレークポイントにおいて発生する割込みの処理の中で判定をおこなうこととしたので、起動されるオペレーティングシステムの処理から自動的に制御を受け取って代替処理をおこなうことができる。
【0017】
また、請求項4の発明に係るオペレーティングシステム起動制御方法は、請求項3の発明において、前記割込みの処理を終了する際に、中央演算装置をトレースモードに設定することを特徴とする。
【0018】
この請求項4の発明によれば、割込みの処理を終了する際に、中央演算装置をトレースモードに設定することとしたので、起動されるオペレーティングシステムの処理として引き続き実行される命令毎に割込みを発生させ、判定をおこなうことができる。
【0019】
また、請求項5の発明に係るオペレーティングシステム起動制御方法は、請求項1〜4のいずれか一つに記載の発明において、前記命令群判定工程は、割込みが発生した際に中央演算装置がスタックに積んだ次命令アドレスを用いて次に実行される命令を取り出し、該取り出した命令に対して前記判定をおこなうことを特徴とする。
【0020】
この請求項5の発明によれば、割込みが発生した際に中央演算装置がスタックに積んだ次命令アドレスを用いて次に実行される命令を取り出し、取り出した命令に対して判定をおこなうこととしたので、次に実行される命令の判定をおこなうことができる。
【0021】
また、請求項6の発明に係るオペレーティングシステム起動制御方法は、請求項2〜5のいずれか一つに記載の発明において、前記命令群判定工程は、前記特定の命令群が連続している場合に、該連続する特定の命令群の最後の命令に続く命令のアドレスに中央演算装置がスタックに積んだ次命令アドレスを書き換えることを特徴とする。
【0022】
この請求項6の発明によれば、特定の命令群が連続している場合に、連続する特定の命令群の最後の命令に続く命令のアドレスに中央演算装置がスタックに積んだ次命令アドレスを書き換えることとしたので、特定の命令群が連続している場合にも代替処理をおこなうことができる。
【0023】
また、請求項7の発明に係るオペレーティングシステム起動制御方法は、請求項1〜6のいずれか一つに記載の発明において、前記命令群判定工程は、前記特定の命令群の最初のいくつかの命令または最後のいくつかの命令を用いて前記判定をおこなうことを特徴とする。
【0024】
この請求項7の発明によれば、特定の命令群の最初のいくつかの命令または最後のいくつかの命令を用いて判定をおこなうこととしたので、特定の命令群であるか否かを効率良く判定することができる。
【0025】
また、請求項8の発明に係るオペレーティングシステム起動制御方法は、請求項1〜7のいずれか一つに記載の発明において、前記代替処理工程は、いくつかの特定の命令群に対しては代替処理をおこなうことなくスキップすることを特徴とする。
【0026】
この請求項8の発明によれば、いくつかの特定の命令群に対しては代替処理をおこなうことなくスキップすることとしたので、実行不要な命令群をスキップすることができる。
【0027】
また、請求項9の発明に係るオペレーティングシステム起動制御方法は、請求項7の発明において、前記次に実行される命令がメモリマップ取得をおこなう命令群の最初の命令または最初のいくつかの命令である場合に、前記命令群判定工程は、該次に実行される命令を前記特定の命令群に属する命令であると判定をおこない、前記代替処理工程は、メモリマップ情報を書き換える処理を含む代替処理をおこなうことを特徴とする。
【0028】
この請求項9の発明によれば、次に実行される命令がメモリマップ取得をおこなう命令群の最初の命令または最初のいくつかの命令である場合に、次に実行される命令を特定の命令群に属する命令であると判定をおこない、メモリマップ情報を書き換える処理を含む代替処理をおこなうこととしたので、起動されるオペレーティングシステムが使用できる物理メモリ領域を制限することができる。
【0029】
また、請求項10の発明に係るオペレーティングシステム起動制御方法は、請求項7の発明において、前記次に実行される命令がメモリマップ取得をおこなう命令群の途中の命令あるいは最後の命令あるいは最後のいくつかの命令である場合に、前記命令群判定工程は、前記特定の命令群が実行されたと判定し、前記代替処理工程は、メモリマップ情報を書き換える処理を含む代替処理をおこなうことを特徴とする。
【0030】
この請求項10の発明によれば、次に実行される命令がメモリマップ取得をおこなう命令群の途中の命令あるいは最後の命令あるいは最後のいくつかの命令である場合に、特定の命令群が実行されたと判定し、メモリマップ情報を書き換える処理を含む代替処理をおこなうこととしたので、起動されるオペレーティングシステムが使用できる物理メモリ領域を制限することができる。
【0031】
また、請求項11の発明に係るプログラムは、上記発明のいずれか一つに記載されたオペレーティングシステム起動方法をコンピュータに実行させるプログラムであり、そのプログラムがコンピュータ読み取り可能となり、これによって、上記の発明のいずれか一つの動作をコンピュータによって実行することができる。
【0032】
また、請求項12の発明に係るオペレーティングシステム起動制御装置は、一台のコンピュータで同時に動作する複数のオペレーティングシステムのうちの一つのオペレーティングシステムの起動を制御するオペレーティングシステム起動制御装置であって、起動されるオペレーティングシステムの処理として次に実行される命令が特定の命令群に属する命令であるか否かの判定をおこなう命令群判定手段と、前記命令群判定手段が特定の命令群に属する命令であると判定をおこなった場合に、該特定の命令群に対して代替処理をおこなう代替処理手段と、を備えたことを特徴とする。
【0033】
この請求項12の発明によれば、起動されるオペレーティングシステムの処理として次に実行される命令が特定の命令群に属する命令であるか否かの判定をおこない、特定の命令群に属する命令であると判定をおこなった場合に、特定の命令群に対して代替処理をおこなうこととしたので、起動されるオペレーティングシステムの改造を不要とし、もって開発期間の短縮および開発コストの低減を図ることができる。
【0034】
【発明の実施の形態】
以下に添付図面を参照して、この発明に係るオペレーティングシステム起動制御方法、およびその方法をコンピュータに実行させるプログラム、ならびにオペレーティングシステム起動制御装置の好適な実施の形態を詳細に説明する。なお、本実施の形態では、CPU(Central Processing Unit:中央演算装置)に米国Intel社 IA−32アーキテクチャ、Pentium(R)を使用する場合について説明する。
【0035】
まず、本実施の形態に係るオペレーティングシステ起動制御方法による命令群代替処理の概念について説明する。図1は、本実施の形態に係るオペレーティングシステム起動制御方法による命令群代替処理の概念を説明するための説明図である。
【0036】
同図は、オペレーティングシステムOS−Aを物理メモリの高アドレス領域にロードして起動後、OS−Aの制御のもとに他のオペレーティングシステムOS−Bを物理メモリの低アドレス領域にロードして起動する状態を示している。なお、OS−Aは、通常OS−Bと同じ低アドレス領域にロードされるが、ここでは、OS−Aを改造することによって、OS−Aを物理メモリの高アドレス領域にロードして起動している。ここでは、OS−Aを物理メモリの高アドレス領域にOS−Bを低アドレス領域にロードすることで説明するが、この高低が逆でもよい。
【0037】
同図に示した状態で、OS−Aは、OS−Bが初期化処理を実行する前に、CPUの走行モードをトレースモード(IA−32アーキテクチャでは、デバッグモードと呼ぶ。さらに詳しく言うと、1命令実行毎にデバッグ例外が発生するモードを、シングル・ステップ・モードと呼ぶ。)に設定する。なお、トレースモードの設定は、フラグレジスタ(EFLAGS)の所定のビットをセットすることによっておこなう。
【0038】
すると、OS−Bの初期化処理において、一つの命令を実行するごとにデバッグ例外(int 0x01)が発生し、割込みディスクリプタテーブルレジスタ(IDTR)で指定されるOS−Aの割込みディスクリプタテーブルに登録されているデバッグ例外処理が起動される。
【0039】
そして、起動されたデバッグ例外処理の中で、前記デバッグ例外発生時にCPUがスタックに積んだセグメントレジスタ(CS)およびインストラクションポインタ(EIP)の組み合わせで指定される次命令を読み出し、読み出した命令がOS−Aの走行環境を破壊するような命令群の先頭の命令であるか否かを調べる。
【0040】
その結果、読み出した命令がOS−Aの走行環境を破壊するような命令群の先頭の命令である場合には、その命令群に対してOS−Aの走行環境を破壊しないように代替処理をおこなう。あるいは、いくつかの命令群に対しては代替処理が必要ない場合もあり、そのような場合には、読み出した命令以下の命令群の実行をスキップする。
【0041】
このように、本実施の形態では、OS−Bの初期化処理をトレースモードで実行することによって各命令を実行するごとにデバッグ例外を発生させ、デバッグ例外処理内で次に実行する命令を調べる。そして、次に実行する命令がOS−Aの走行環境を破壊するような命令群の先頭の命令である場合には、その命令群を代替処理に置き換えることによって、OS−Bがどのようなオペレーティングシステムであっても、OS−Aの走行環境を破壊することなくOS−Bを起動することができる。
【0042】
次に、本実施の形態に係るオペレーティングシステムの構成について説明する。図2は、本実施の形態に係るオペレーティングシステムの構成を示す機能構成図である。同図に示すように、このオペレーティングシステム200は、割込み振分処理部210と、デバッグ例外処理部220と、割込みディスクリプタテーブル230と、スタック240とを有する。
【0043】
割込み振分処理部210は、CPUに割込みが発生した場合に、割込みディスクリプタテーブル230を用いて、割込み要因に対応した割込み処理をおこなう処理部に制御を渡す処理部である。
【0044】
デバッグ例外処理部220は、デバッグ例外の割込みを処理する処理部であり、CPUをトレースモードで走行すると、各命令を実行するたびにデバッグ例外が発生し、割込み振分処理部210によって起動される。このデバッグ例外処理部220は、次に実行される命令を先読みし、先読みした命令が特定の命令群の先頭の命令であるか否かを調べ、特定の命令群の先頭の命令である場合には、その命令群の代替処理をおこなう。
【0045】
このように、このデバッグ例外処理部220が次に実行される命令を調べ、次に実行される命令が特定の命令群の先頭の命令である場合に代替処理をおこなうことによって、オペレーティングシステム200の走行環境を破壊する命令群の実行を防ぐことができる。
【0046】
割込みディスクリプタテーブル230は、割込み番号とその割込みを処理する処理ルーチンのアドレスを対応させて記憶したテーブルであり、割込み番号の若い順に、テーブル内のエントリが作られている。この割込みディスクリプタテーブル230のアドレスはCPU内の割込みディスクリプタテーブルレジスタ(IDTR)に格納されている。
【0047】
スタック240は、割込み発生時のオペレーティングシステム200の走行状態を保存するためにレジスタなどの値を一時的に保存する記憶部である。このスタック240に積まれるレジスタには、CPUによって自動的に値が積まれるレジスタとデバッグ例外処理部220によって値が積まれるレジスタとがある。
【0048】
図3は、割込み発生時にCPUによって自動的にスタック240に値が積まれるレジスタおよびデバッグ例外処理部220によってスタック240に値が積まれるレジスタなどを示す図である。
【0049】
同図に示すように、割込みが発生すると、CPUは、セグメントレジスタ(SS)、スタックポインタ(ESP)、フラグレジスタ(EFLAGS)、セグメントレジスタ(CS)およびインストラクションポインタ(EIP)の値をスタック240に積む。
【0050】
ここで、スタック240に格納されたセグメントレジスタ(CS)とインストラクションポインタ(EIP)は、CPUが次に実行する命令を格納したメモリのアドレスを指す値であり、これらの値から、デバッグ例外処理部220は、CPUが次に実行する命令を先読みすることができる。
【0051】
また、デバッグ例外処理部220は、セグメントレジスタ(DS)、汎用レジスタ(EAX〜EDX、EDI、ESI)、ベースポインタ(EBP)の値やデバッグ例外処理本体関数(do_debug)の引数などをスタック240に積む。
【0052】
次に、図2に示したデバッグ例外処理部220の処理手順について説明する。図4は、図2に示したデバッグ例外処理部220の処理手順を示すフローチャートである。
【0053】
同図に示すように、このデバッグ例外処理部220は、割込み振分処理部210によって起動されると、割込みを禁止し(ステップS401)、走行状態を保存するために必要なレジスタのうちCPUが保存していないレジスタや引数などをスタック240に積む(ステップS402)。
【0054】
そして、CPUがスタック240に格納したセグメントレジスタ(CS)の値とインストラクションポインタ(EIP)の値を取り出す(ステップS403)。ここで、これらのセグメントレジスタ(CS)の値とインストラクションポインタ(EIP)の値の取り出しは、スタック240に対してPOP命令を実行しておこなうが、POP命令と同じ回数分、かつPOP命令で取り出した順番と逆の順番でPUSH命令を実行することで、ステップS403実行前の状態に、スタック240を戻すことができる。
【0055】
そして、スタック240から取り出したセグメントレジスタ(CS)の値およびインストラクションポインタ(EIP)の値を用いてCPUが次に実行する命令を取得し(ステップS404)、取得した命令が特定の命令群の先頭の命令であるか否かを調べる(ステップS405)。
【0056】
ここで、先頭の命令だけでは特定の命令群の先頭であるか否かが判定できない場合には、順次、次の命令を調べることによって特定の命令群であるか否かを判定する。すなわち、このデバッグ例外処理部220は、代替処理が必要な特定の命令群を保持し、CPUが実行しようとする命令群とのマッチングをとることによって特定の命令群であるか否かの判定をおこなう。
【0057】
そして、特定の命令群である場合には、その特定の命令群に対応する代替処理をおこなう(ステップS406)。ここで、代替処理としては、おこなうべき処理が何もない場合もある。そして、代替処理した特定の命令群をスキップし(ステップS407)、ステップS404に戻って次の命令を取得し、取得した命令が新たな特定の命令群の始まりであるか否かを調べる。
【0058】
一方、取得した命令が特定の命令群の先頭の命令でない場合には、スタックに積んだレジスタの値を元に戻すなどの復帰処理をおこない(ステップS409)、割込み禁止を解除する(ステップS410)。
【0059】
また、いくつかの特定の命令群の処理後、特定の命令群の先頭でない命令を取得した場合には、代替処理をおこなった命令群をCPUにスキップさせるために、スタック240に格納されたセグメントレジスタ(CS)の値とインストラクションポインタ(EIP)の値を次にCPUに実行させたい命令のアドレスに書き換え(ステップS408)、その後で復帰処理をおこなう(ステップS409)。
【0060】
このように、CPUの走行モードをトレースモードに設定し、各命令を実行するごとにデバッグ例外を発生させることによって、次にCPUによって実行される命令が特定の命令群の先頭の命令である場合に、デバッグ例外処理部220がその特定の命令群に対して代替処理をおこなうことができる。
【0061】
したがって、他のオペレーティングシステムの初期化処理をトレースモードで実行することによって、初期化処理中の特定の命令群を代替処理することができ、起動済のオペレーティングシステムの走行環境を破壊することなく他のオペレーティングシステムを起動することができる。
【0062】
次に、代替処理の一例として、特定の命令群がメモリマップの取得をおこなう命令群である場合の代替処理について説明する。また、メモリマップとは、物理メモリ領域のどの部分がオペレーティングシステムで使用可能であるかを示す情報であり、オペレーティングシステムの初期化処理でおこなわれ、このメモリマップの情報に基づいて、オペレーティングシステムのメモリ管理機能が構成される。図5に、メモリマップのデータ構造の一例を示す。
【0063】
同図に示すように、メモリマップは、複数のエントリから構成され、各エントリは物理メモリの部分領域を示している。また、各エントリは、ベースアドレスの低32ビットを示す4バイト、ベースアドレスの高32ビットを示す4バイト、領域の大きさの低32ビットを示す4バイト、領域の大きさの高32ビットを示す4バイトおよびオペレーティングシステムがその領域を使用可能か否かを示すメモリタイプの4バイトの計20バイトの大きさを有する。
【0064】
ここで、メモリタイプが「1」である場合には、オペレーティングシステムはその領域を使用することができ、メモリタイプが「1」以外である場合には、オペレーティングシステムはその領域を使用することができない。
【0065】
たとえば、あるエントリのベースアドレスの低32ビットが「0x00100000」であり、ベースアドレスの高32ビットが「0x00000000」であり、領域の大きさの低32ビットが「0x05f00000」であり、領域の大きさの高32ビットが「0x00000000」であり、メモリタイプが「0x1」である場合には、先頭アドレスが「0x100000」から「0x5f00000」分の物理メモリ領域をオペレーティングシステムが使用することができる。
【0066】
また、オペレーティングシステムが使用できない領域としては、ACPI(Advanced Configuration and Power Interface:電源管理の仕様)が使用する領域などがあり、たとえばメモリタイプの値は「4」である。
【0067】
オペレーティングシステムは、初期化処理時に、このメモリマップに基づいて物理メモリをどのように利用するか、オペレーティングシステムのメモリ管理機能部で構成するため、このオペレーティングシステムの初期化処理内でメモリマップを書き換えることによって、オペレーティングシステムが使用する物理メモリ領域を制限することができる。
【0068】
たとえば、図1において、OS−Aが既に起動している状態でOS−Bの初期化をおこなう場合、OS−Bが使用可能な物理メモリ情報を得るために、OS−Bの初期化処理の中でBIOS(Basic Input Output System)からメモリマップ取得をおこなうが、ここで得られるメモリマップは、実装している物理メモリ全体を見てBIOSがオペレーティングシステムに使用可能か否かの物理メモリ情報であり、つまり、OS−Aの使用している物理メモリ領域もOS−Bが使用可能な物理メモリ領域であると示す内容の物理メモリ情報である。したがって、このままではOS−AがOS−Bの使用している物理メモリを破壊してしまうので、OS−Aの使用している物理メモリ領域はOS−Bが使用不可能な領域であるとする物理メモリ情報を、OS−Bに認識させる必要がある。すなわち、OS−BがBIOSから取得したメモリマップを、OS−Aが使用している物理メモリ領域を使用不可能な領域とする内容を書き加える必要がある。
【0069】
図6は、OS−Bの初期化処理として実行されるメモリマップ取得命令群に対してデバッグ例外処理部220がおこなう代替処理の処理手順を示すフローチャートである。なお、この代替処理の処理手順は、図4に示したステップS405の代替処理がメモリマップ取得命令群に対しておこなう処理である。
【0070】
同図に示すように、デバッグ例外処理部220は、BIOSに対して、メモリマップ情報取得を依頼する(ステップS601)。すると、BIOSがメモリマップを物理メモリ上に出力する(ステップS602)。
【0071】
そして、デバッグ例外処理部220が、BIOSが物理メモリ上に出力したメモリマップを書き換える(ステップS603)。このようにして、デバッグ例外処理部220は、OS−Aが使用している物理メモリ領域をOS−Bが使用できないようにすることができる。
【0072】
このように、デバッグ例外処理部220が、OS−Bの初期化処理として実行されるメモリマップ取得命令群に対してBIOSが出力したメモリマップを書き換えることによって、OS−Bが使用できる物理メモリ領域を制限することができる。
【0073】
また、ここでは、メモリマップ取得命令群に対してデバッグ例外処理部220が代替処理をおこなうこととしたが、メモリマップ取得命令群の一部をそのまま実行し、デバッグ例外処理部220が実行を引き継いで代替処理をおこなうこともできる。あるいは、メモリマップ取得命令群の全部をそのまま実行し、実行直後にデバッグ例外処理部220がメモリマップを書き換えることもできる。
【0074】
次に、本実施の形態に係るオペレーティングシステム200を実行するコンピュータについて説明する。図7は、本実施の形態に係るオペレーティングシステム200を実行するコンピュータを示す図である。
【0075】
同図に示すように、このコンピュータ700は、オペレーティングシステム200などのプログラムを実行するCPU710と、キーボードやマウスなどの入力装置720と、各種データを記憶するROM(Read Only Memory)730と、実行するプログラムや演算の一時結果などを記憶する物理メモリ(RAM:Random Access Memory)740と、記録媒体800からプログラムを読み取る読取装置750と、ディスプレイやプリンタなどの出力装置760と、装置各部を接続するバス770とから構成される。
【0076】
また、CPU710は、読取装置750を経由して記録媒体800に記録されているオペレーティングシステム200などのプログラムを物理メモリ740に読み込んで実行する。なお、記録媒体800としては、光ディスク、フレキシブルディスク、ハードディスクなどが挙げられる。
【0077】
上述してきたように、本実施の形態では、OS−Bの初期化処理を実行する前にCPUの走行モードをトレースモードに設定し、各命令を実行するごとにデバッグ例外を発生させ、デバッグ例外処理部220が次の命令が特定の命令群の先頭の命令であるか否かを調べ、次の命令が特定の命令群の先頭の命令である場合には、その特定の命令群を実行する代わりに代替処理をおこなうこととしたので、OS−Aの走行環境を破壊することなくOS−Bを起動することができる。
【0078】
なお、本実施の形態では、特定の命令群の先頭の命令およびそれに続く命令を用いて代替処理が必要な命令群であるか否かを判定する場合について説明したが、本発明はこれに限定されるものではなく、特定の命令群の最後の命令を用いて代替処理が必要な命令群であるか否かを判定する場合にも、同様に適用することができる。
【0079】
また、本実施の形態では、特定の命令群に対して代替処理または飛び越し処理をおこなう場合について説明したが、本発明はこれに限定されるものではなく、特定の命令に対しても代替処理または飛び越し処理をおこなう場合にも、同様に適用することができる。たとえば、LANカードの初期化命令(Reset命令など)は、2回以上おこなわせたくない命令であり、飛び越し処理が必要な命令である。
【0080】
また、本実施の形態では、CPUにPentium(R)を用いる場合について説明したが、本発明はこれに限定されるものではなく、他のCPUを用いる特場合にも、同様に適用することができる。
【0081】
また、本実施の形態では、OS−Bの初期化処理を実行する前に、1命令を実行するごとにデバッグ例外を発生するトレースモード(シングル・ステップ・モード)に設定する場合について説明したが、本発明はこれに限定されるものではなく、たとえばOS−Bの初期化処理中の所定の場所にブレークポイントを設定し、設定したブレークポイントでデバッグ例外を発生させる種類のトレースモードにおいて、前記設定したブレークポイントで発生したデバッグ例外によってデバッグ例外処理部220を起動する場合にも、同様に適用することができる。
【0082】
また、ブレークポイントでデバッグ例外を発生させてデバッグ例外処理部220を起動し、デバッグ例外処理部220の処理終了直後に、1命令を実行するごとにデバッグ例外を発生するトレースモード(シングル・ステップ・モード)に設定することもできる。
【0083】
【発明の効果】
以上説明したように、請求項1の発明によれば、起動されるオペレーティングシステムの処理として次に実行される命令が特定の命令群に属する命令であるか否かの判定をおこない、特定の命令群に属する命令であると判定をおこなった場合に、特定の命令群に対して代替処理をおこなう代替処理工程おこなうこととしたので、起動されるオペレーティングシステムの改造を不要とし、もって開発期間の短縮および開発コストの低減を図ることができるという効果を奏する。
【0084】
また、請求項2の発明によれば、コンピュータを構成する中央演算装置のトレースモードにおいて各命令が実行される際に発生する割込みの処理の中で判定をおこなうこととしたので、起動されるオペレーティングシステムの処理から自動的に制御を受け取って代替処理をおこなうことができるという効果を奏する。
【0085】
また、請求項3の発明によれば、起動されるオペレーティングシステムの命令アドレスに設定したブレークポイントにおいて発生する割込みの処理の中で判定をおこなうこととしたので、起動されるオペレーティングシステムの処理から自動的に制御を受け取って代替処理をおこなうことができるという効果を奏する。
【0086】
また、請求項4の発明によれば、割込みの処理を終了する際に、中央演算装置をトレースモードに設定することとしたので、起動されるオペレーティングシステムの処理として引き続き実行される命令毎に割込みを発生させ、判定をおこなうことができるという効果を奏する。
【0087】
また、請求項5の発明によれば、割込みが発生した際に中央演算装置がスタックに積んだ次命令アドレスを用いて次に実行される命令を取り出し、取り出した命令に対して判定をおこなうこととしたので、次に実行される命令の判定をおこなうことができるという効果を奏する。
【0088】
また、請求項6の発明によれば、特定の命令群が連続している場合に、連続する特定の命令群の最後の命令に続く命令のアドレスに中央演算装置がスタックに積んだ次命令アドレスを書き換えることとしたので、特定の命令群が連続している場合にも代替処理をおこなうことができるという効果を奏する。
【0089】
また、請求項7の発明によれば、特定の命令群の最初のいくつかの命令または最後のいくつかの命令を用いて判定をおこなうこととしたので、特定の命令群であるか否かを効率良く判定することができるという効果を奏する。
【0090】
また、請求項8の発明によれば、いくつかの特定の命令群に対しては代替処理をおこなうことなくスキップすることとしたので、実行不要な命令群をスキップすることができるという効果を奏する。
【0091】
また、請求項9の発明によれば、次に実行される命令がメモリマップ取得をおこなう命令群の最初の命令または最初のいくつかの命令である場合に、次に実行される命令を特定の命令群に属する命令であると判定をおこない、メモリマップ情報を書き換える処理を含む代替処理をおこなうこととしたので、起動されるオペレーティングシステムが使用できる物理メモリ領域を制限することができるという効果を奏する。
【0092】
また、請求項10の発明によれば、次に実行される命令がメモリマップ取得をおこなう命令群の途中の命令あるいは最後の命令あるいは最後のいくつかの命令である場合に、特定の命令群が実行されたと判定し、メモリマップ情報を書き換える処理を含む代替処理をおこなうこととしたので、起動されるオペレーティングシステムが使用できる物理メモリ領域を制限することができるという効果を奏する。
【0093】
また、請求項11の発明によれば、上記発明のいずれか一つに記載されたオペレーティングシステム起動方法をコンピュータに実行させるようにしたので、そのプログラムがコンピュータ読み取り可能となり、これによって、上記の発明のいずれか一つの動作をコンピュータによって実行することができるという効果を奏する。
【0094】
また、請求項12の発明によれば、起動されるオペレーティングシステムの処理として次に実行される命令が特定の命令群に属する命令であるか否かの判定をおこない、特定の命令群に属する命令であると判定をおこなった場合に、特定の命令群に対して代替処理をおこなうこととしたので、起動されるオペレーティングシステムの改造を不要とし、もって開発期間の短縮および開発コストの低減を図ることができるという効果を奏する。
【図面の簡単な説明】
【図1】本実施の形態に係るオペレーティングシステム起動制御方法による命令群代替処理の概念を説明するための説明図である。
【図2】本実施の形態に係るオペレーティングシステムの構成を示す機能構成図である。
【図3】割込み発生時にCPUによって自動的にスタックに値が積まれるレジスタおよびデバッグ例外処理部によってスタックに値が積まれるレジスタなどを示す図である。
【図4】図2に示したデバッグ例外処理部の処理手順を示すフローチャートである。
【図5】メモリマップのデータ構造の一例を示す図である。
【図6】OS−Bの初期化処理として実行されるメモリマップ取得命令群に対してデバッグ例外処理部がおこなう代替処理の処理手順を示すフローチャートである。
【図7】本実施の形態に係るオペレーティングシステムを実行するコンピュータを示す図である。
【符号の説明】
200 オペレーティングシステム
210 割込み振分処理部
220 デバッグ例外処理部
230 割込みディスクリプタテーブル
240 スタック
700 コンピュータ
710 CPU
720 入力装置
730 ROM
740 RAM
750 読取装置
760 出力装置
770 バス
800 記録媒体[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an operating system activation control method for controlling activation of one operating system of a plurality of operating systems simultaneously operating on one computer, a program for causing a computer to execute the method, and an operating system activation control device. In particular, an operating system startup control method and a program for causing a computer to execute the operating system startup control method capable of shortening the development period and reducing the development cost without modifying the operating system to be started, and an operating system startup control device About.
[0002]
[Prior art]
In an ordinary computer, one operating system manages computer resources such as a processor, a memory, and a secondary storage device, and implements a resource schedule so that the computer can operate efficiently. However, there are various types of operating systems, such as those that are excellent in batch processing, those that are excellent in TSS (Time Sharing System), and those that are excellent in GUI (Graphical User Interface). There is a demand to utilize a plurality of OSs at the same time by utilizing the features.
[0003]
For example, in a large-scale computer, there is a demand that an operating system for executing online processing associated with actual work and an operating system for development be operated by one computer. Alternatively, there is a demand that an operating system having a GUI and an operating system having an excellent real-time property be operated at the same time.
[0004]
However, since each operating system is designed on the assumption that computer resources are managed independently, some modification of each operating system is required to allow multiple operating systems to coexist. It becomes.
[0005]
In particular, in order to start another operating system after starting one operating system, it is necessary to start the other operating system without destroying the running environment of the operating system that was started first. Therefore, when another operating system is loaded into the physical memory, the physical memory area in which the operating system that has been started first is loaded is overwritten, and the input / output device connected to the computer is repeatedly initialized. Need to be prevented.
[0006]
Therefore, a technology for starting another operating system without destroying the running environment of the operating system that has been started first has been developed (for example, see Patent Documents 1, 2, and 3).
[0007]
Further, as a technique that can be used when starting another operating system so as not to destroy the running environment of the operating system that has been started earlier, a technique for changing the contents of a program has been developed (for example, Patent Documents 4 to 4). 7).
[0008]
[Patent Document 1]
JP-A-11-149385
[Patent Document 2]
JP 2001-216172 A
[Patent Document 3]
JP 08-212089 A
[Patent Document 4]
JP 2000-181725 A
[Patent Document 5]
JP 2000-305768 A
[Patent Document 6]
JP-A-11-65854
[Patent Document 7]
JP-A-6-327551
[0009]
[Problems to be solved by the invention]
However, such a conventional technique has a problem that it is necessary to modify an operating system to be started later, or special hardware is required even when the modification is not necessary.
[0010]
SUMMARY OF THE INVENTION The present invention has been made to solve the above-described problems caused by the related art, and does not require modification of an operating system to be started, thereby shortening a development period and reducing a development cost. An object of the present invention is to provide an activation control method, a program for causing a computer to execute the method, and an operating system activation control device.
[0011]
[Means for Solving the Problems]
In order to solve the above-mentioned problem and achieve the object, an operating system according to the present invention is an operating system that controls activation of one of a plurality of operating systems operating simultaneously on a single computer. An activation control method, comprising: an instruction group determination step of determining whether an instruction to be executed next as a process of an operating system to be activated is an instruction belonging to a specific instruction group; and the instruction group determination step. And an alternative processing step of performing an alternative process on the specific instruction group when it is determined that the instruction belongs to the specific instruction group.
[0012]
According to the first aspect of the present invention, it is determined whether or not the next instruction to be executed as a process of the operating system to be started is an instruction belonging to a specific instruction group. If it is determined that there is, an alternative processing step that performs alternative processing for a specific instruction group is not required, so it is not necessary to modify the operating system to be started, thereby shortening the development period and reducing the development cost Can be achieved.
[0013]
According to a second aspect of the present invention, in the operating system activation control method according to the first aspect, the instruction group determining step is performed when each instruction is executed in a trace mode of a central processing unit constituting a computer. The determination is performed in the processing of the interrupt to be performed.
[0014]
According to the second aspect of the present invention, the determination is made in the processing of the interrupt generated when each instruction is executed in the trace mode of the central processing unit constituting the computer. The control can be automatically received from the processing of (1) to perform the alternative processing.
[0015]
In the operating system activation control method according to a third aspect of the present invention, in the first aspect of the invention, the instruction group determining step includes a step of processing an interrupt generated at a breakpoint set at an instruction address of the operating system to be activated. Wherein the determination is performed.
[0016]
According to the third aspect of the present invention, the determination is made in the processing of the interrupt generated at the breakpoint set at the instruction address of the operating system to be started. , And can perform an alternative process.
[0017]
Further, in the operating system activation control method according to a fourth aspect of the present invention, in the third aspect of the present invention, the central processing unit is set to a trace mode when ending the interrupt processing.
[0018]
According to the fourth aspect of the present invention, the central processing unit is set to the trace mode at the time of ending the interrupt processing. Can be generated and a determination can be made.
[0019]
According to a fifth aspect of the present invention, in the operating system activation control method according to any one of the first to fourth aspects, the instruction group determining step includes a step in which the central processing unit stacks when an interrupt occurs. The instruction to be executed next is fetched by using the next instruction address piled up in the instruction, and the determination is performed on the fetched instruction.
[0020]
According to the fifth aspect of the present invention, when an interrupt occurs, the central processing unit fetches the next instruction to be executed using the next instruction address stacked on the stack, and makes a determination on the fetched instruction. Therefore, the instruction to be executed next can be determined.
[0021]
According to a sixth aspect of the present invention, in the operating system activation control method according to any one of the second to fifth aspects, the instruction group determination step is performed when the specific instruction group is continuous. The central processing unit rewrites the address of the instruction following the last instruction of the continuous specific instruction group with the address of the next instruction stacked on the stack.
[0022]
According to the invention of claim 6, when the specific instruction group is continuous, the next instruction address that is loaded on the stack by the central processing unit is added to the address of the instruction following the last instruction of the continuous specific instruction group. Since rewriting is performed, an alternative process can be performed even when a specific instruction group is continuous.
[0023]
Also, in the operating system activation control method according to the invention of claim 7, in the invention according to any one of claims 1 to 6, the instruction group determining step includes the first several instruction groups of the specific instruction group. The determination is performed using an instruction or the last several instructions.
[0024]
According to the seventh aspect of the present invention, the determination is made by using the first few instructions or the last several instructions of the specific instruction group. A good judgment can be made.
[0025]
According to an eighth aspect of the present invention, in the operating system activation control method according to any one of the first to seventh aspects, the alternative processing step includes an alternative processing for some specific instruction groups. It is characterized by skipping without performing processing.
[0026]
According to the eighth aspect of the present invention, some specific instruction groups are skipped without performing alternative processing, so that instruction groups that do not need to be executed can be skipped.
[0027]
According to a ninth aspect of the present invention, in the operating system activation control method according to the seventh aspect, the next instruction to be executed is a first instruction or a first few instructions of an instruction group for acquiring a memory map. In some cases, the instruction group determining step determines that the next instruction to be executed is an instruction belonging to the specific instruction group, and the alternative processing step includes a process of rewriting memory map information. It is characterized by performing.
[0028]
According to the ninth aspect of the present invention, when the next instruction to be executed is the first instruction or the first few instructions in the instruction group for acquiring the memory map, the next instruction to be executed is replaced with the specific instruction. Since it is determined that the instruction belongs to the group and the alternative processing including the processing of rewriting the memory map information is performed, the physical memory area that can be used by the activated operating system can be limited.
[0029]
An operating system activation control method according to a tenth aspect of the present invention is the operating system startup control method according to the seventh aspect, wherein the next instruction to be executed is an instruction in the middle of an instruction group for acquiring a memory map, the last instruction or the last instruction. In the case of such an instruction, the instruction group determining step determines that the specific instruction group has been executed, and the alternative processing step performs an alternative process including a process of rewriting memory map information. .
[0030]
According to the tenth aspect, when the next instruction to be executed is an instruction in the middle of the instruction group for acquiring the memory map, the last instruction, or the last several instructions, the specific instruction group is executed. Since it is determined that the process has been performed and the alternative process including the process of rewriting the memory map information is performed, the physical memory area that can be used by the activated operating system can be limited.
[0031]
According to an eleventh aspect of the present invention, there is provided a program for causing a computer to execute the operating system activation method according to any one of the above aspects of the invention, and the program becomes readable by a computer. Can be performed by a computer.
[0032]
An operating system activation control device according to a twelfth aspect of the present invention is an operating system activation control device for controlling activation of one operating system of a plurality of operating systems operating simultaneously on a single computer. Instruction group determining means for determining whether or not the next instruction to be executed as a process of the operating system to be executed belongs to a specific instruction group; and And an alternative processing unit for performing an alternative process on the specific instruction group when it is determined that there is a specific instruction group.
[0033]
According to the twelfth aspect of the present invention, it is determined whether or not the next instruction to be executed as a process of the operating system to be started is an instruction belonging to a specific instruction group. When it is determined that there is, an alternative process is performed for a specific instruction group, so that it is not necessary to modify the operating system to be started, thereby shortening the development period and reducing the development cost. it can.
[0034]
BEST MODE FOR CARRYING OUT THE INVENTION
Exemplary embodiments of the present invention will be explained in detail below with reference to the accompanying drawings. In the present embodiment, a case will be described in which Pentium®, an IA-32 architecture of Intel Corporation, USA, is used as a CPU (Central Processing Unit).
[0035]
First, the concept of the instruction group substitution processing by the operating system activation control method according to the present embodiment will be described. FIG. 1 is an explanatory diagram for explaining the concept of the instruction group substitution process by the operating system activation control method according to the present embodiment.
[0036]
The figure shows that after the operating system OS-A is loaded into the high address area of the physical memory and started, another operating system OS-B is loaded into the low address area of the physical memory under the control of the OS-A. This shows the state of starting. Note that the OS-A is normally loaded in the same low address area as the OS-B, but here, by modifying the OS-A, the OS-A is loaded into the high address area of the physical memory and activated. ing. Here, the description will be made by loading the OS-A into the high address area of the physical memory and loading the OS-B into the low address area. However, the level may be reversed.
[0037]
In the state shown in the figure, the OS-A calls the running mode of the CPU a trace mode (debug mode in the IA-32 architecture) before the OS-B executes the initialization processing. The mode in which a debug exception occurs every time one instruction is executed is called a single step mode.) The setting of the trace mode is performed by setting a predetermined bit of a flag register (EFLAGS).
[0038]
Then, in the initialization process of the OS-B, a debug exception (int 0x01) occurs every time one instruction is executed, and is registered in the interrupt descriptor table of the OS-A specified by the interrupt descriptor table register (IDTR). Debug exception handling is started.
[0039]
Then, in the activated debug exception processing, when the debug exception occurs, the CPU reads the next instruction specified by the combination of the segment register (CS) and the instruction pointer (EIP) stacked on the stack, and the read instruction is the OS. -Check whether the instruction is the first instruction in the instruction group that destroys the traveling environment of A.
[0040]
As a result, if the read instruction is the first instruction of an instruction group that destroys the running environment of the OS-A, an alternative process is performed on the instruction group so as not to destroy the running environment of the OS-A. Do it. Alternatively, there is a case where the substitution process is not required for some instruction groups. In such a case, the execution of the instruction group following the read instruction is skipped.
[0041]
As described above, in the present embodiment, a debug exception is generated each time an instruction is executed by executing the initialization process of the OS-B in the trace mode, and the next instruction to be executed is checked in the debug exception process. . If the next instruction to be executed is the first instruction in an instruction group that destroys the running environment of the OS-A, the OS-B replaces the instruction group with an alternative process to determine what operating system Even in a system, the OS-B can be started without destroying the running environment of the OS-A.
[0042]
Next, the configuration of the operating system according to the present embodiment will be described. FIG. 2 is a functional configuration diagram showing a configuration of the operating system according to the present embodiment. As shown in the figure, the
[0043]
The interrupt
[0044]
The debug
[0045]
As described above, the debug
[0046]
The interrupt descriptor table 230 is a table in which an interrupt number and an address of a processing routine for processing the interrupt are stored in association with each other, and entries in the table are created in ascending order of the interrupt number. The address of the interrupt descriptor table 230 is stored in an interrupt descriptor table register (IDTR) in the CPU.
[0047]
The
[0048]
FIG. 3 is a diagram illustrating registers whose values are automatically stacked on the
[0049]
As shown in the figure, when an interrupt occurs, the CPU stores the values of the segment register (SS), stack pointer (ESP), flag register (EFLAGS), segment register (CS), and instruction pointer (EIP) in the
[0050]
Here, the segment register (CS) and the instruction pointer (EIP) stored in the
[0051]
The debug
[0052]
Next, a processing procedure of the debug
[0053]
As shown in the figure, when the debug
[0054]
Then, the CPU extracts the value of the segment register (CS) and the value of the instruction pointer (EIP) stored in the stack 240 (step S403). Here, the value of the segment register (CS) and the value of the instruction pointer (EIP) are fetched by executing a POP instruction for the
[0055]
Then, using the value of the segment register (CS) and the value of the instruction pointer (EIP) extracted from the
[0056]
Here, if it is not possible to determine whether or not the instruction is the head of a specific instruction group only by the head instruction, the next instruction is sequentially examined to determine whether or not the head is a specific instruction group. That is, the debug
[0057]
If the instruction group is a specific instruction group, an alternative process corresponding to the specific instruction group is performed (step S406). Here, as an alternative process, there is a case where there is no process to be performed. Then, the specific instruction group subjected to the substitution processing is skipped (step S407), and the process returns to step S404 to acquire the next instruction, and checks whether the acquired instruction is the beginning of a new specific instruction group.
[0058]
On the other hand, if the acquired instruction is not the first instruction of the specific instruction group, a return process such as restoring the value of the register stacked on the stack is performed (step S409), and the inhibition of the interrupt is released (step S410). .
[0059]
Further, when an instruction that is not the head of the specific instruction group is acquired after processing of some specific instruction groups, the segment stored in the
[0060]
As described above, by setting the running mode of the CPU to the trace mode and generating a debug exception every time each instruction is executed, the next instruction executed by the CPU is the first instruction of a specific instruction group. Then, the debug
[0061]
Therefore, by executing the initialization process of another operating system in the trace mode, a specific instruction group during the initialization process can be replaced, and the other operation system can be executed without destroying the running environment of the activated operating system. You can boot the operating system.
[0062]
Next, as an example of the substitution processing, the substitution processing in the case where the specific instruction group is an instruction group for acquiring a memory map will be described. The memory map is information indicating which part of the physical memory area can be used by the operating system. The memory map is performed in the initialization process of the operating system, and based on the information of the memory map, A memory management function is configured. FIG. 5 shows an example of the data structure of the memory map.
[0063]
As shown in the figure, the memory map is composed of a plurality of entries, and each entry indicates a partial area of the physical memory. Each entry has 4 bytes indicating the low 32 bits of the base address, 4 bytes indicating the high 32 bits of the base address, 4 bytes indicating the low 32 bits of the area size, and high 32 bits of the area size. It has a total of 20 bytes, including 4 bytes for indicating and 4 bytes for a memory type indicating whether the operating system can use the area.
[0064]
Here, when the memory type is “1”, the operating system can use the area. When the memory type is other than “1”, the operating system can use the area. Can not.
[0065]
For example, the low 32 bits of the base address of a certain entry are “0x00100000”, the high 32 bits of the base address are “0x00000000”, the low 32 bits of the area size are “0x05f00000”, and the size of the area. If the high 32 bits of “.” Are “0x00000000” and the memory type is “0x1”, the operating system can use the physical memory area starting from “0x100000” to “0x5f00000”.
[0066]
Areas that cannot be used by the operating system include areas used by ACPI (Advanced Configuration and Power Interface: specifications of power management). For example, the value of the memory type is “4”.
[0067]
The operating system rewrites the memory map in the initialization processing of the operating system because the operating system uses the memory management function unit of the operating system to determine how to use the physical memory based on the memory map during the initialization processing. Thus, the physical memory area used by the operating system can be limited.
[0068]
For example, in FIG. 1, when the OS-B is initialized while the OS-A has already been started, the OS-B initialization process is performed to obtain physical memory information usable by the OS-B. A memory map is obtained from a BIOS (Basic Input Output System), and the obtained memory map is based on physical memory information indicating whether or not the BIOS can be used for an operating system by looking at the entire mounted physical memory. Yes, that is, physical memory information having a content indicating that the physical memory area used by the OS-A is also a physical memory area usable by the OS-B. Therefore, since the OS-A destroys the physical memory used by the OS-B in this state, the physical memory area used by the OS-A is an area where the OS-B cannot be used. It is necessary for OS-B to recognize the physical memory information. That is, it is necessary to add the content that makes the physical memory area used by the OS-A an unusable area in the memory map acquired by the OS-B from the BIOS.
[0069]
FIG. 6 is a flowchart illustrating a processing procedure of an alternative process performed by the debug
[0070]
As shown in the drawing, the debug
[0071]
Then, the debug
[0072]
As described above, the debug
[0073]
Further, here, the debug
[0074]
Next, a computer that executes the
[0075]
As shown in the figure, the
[0076]
Further, the
[0077]
As described above, in the present embodiment, the CPU sets the run mode of the CPU to the trace mode before executing the initialization processing of the OS-B, and generates a debug exception every time each instruction is executed. The
[0078]
In the present embodiment, a case has been described where the first instruction of a specific instruction group and the following instruction are used to determine whether or not the instruction group requires an alternative process. However, the present invention is not limited to this. However, the present invention can be similarly applied to a case where it is determined whether or not an instruction group requires an alternative process using the last instruction of a specific instruction group.
[0079]
Further, in the present embodiment, the case where the alternative processing or the skip processing is performed on a specific instruction group has been described. However, the present invention is not limited to this. The same can be applied to the case where the jump processing is performed. For example, a LAN card initialization command (such as a Reset command) is a command that is not desired to be performed more than once, and is a command that requires jump processing.
[0080]
Further, in this embodiment, the case where Pentium (R) is used for the CPU has been described. However, the present invention is not limited to this, and can be similarly applied to a special case using another CPU. it can.
[0081]
Further, in the present embodiment, a case has been described in which the trace mode (single step mode) in which a debug exception is generated each time one instruction is executed before executing the initialization processing of the OS-B. However, the present invention is not limited to this. For example, in a trace mode of a type in which a breakpoint is set at a predetermined location during the initialization process of the OS-B and a debug exception occurs at the set breakpoint, The same applies to the case where the debug
[0082]
In addition, a trace mode (single-step / single-step mode) in which a debug exception is generated at a breakpoint, the debug
[0083]
【The invention's effect】
As described above, according to the first aspect of the present invention, it is determined whether or not the next instruction to be executed as a process of the operating system to be started belongs to a specific instruction group. When it is determined that an instruction belongs to a group, an alternative processing step of performing alternative processing for a specific instruction group is performed, so that it is not necessary to modify the operating system to be started, thereby shortening the development period. Also, there is an effect that the development cost can be reduced.
[0084]
According to the second aspect of the present invention, the determination is made in the processing of an interrupt generated when each instruction is executed in the trace mode of the central processing unit constituting the computer. There is an effect that the control can be automatically received from the processing of the system to perform the substitution processing.
[0085]
According to the third aspect of the present invention, the determination is made in the processing of the interrupt that occurs at the breakpoint set at the instruction address of the operating system to be started. This has the effect that the alternative processing can be performed by receiving the control in a controlled manner.
[0086]
According to the fourth aspect of the present invention, the central processing unit is set to the trace mode at the time of ending the processing of the interrupt. Is generated, and the determination can be performed.
[0087]
According to the fifth aspect of the present invention, when an interrupt occurs, the central processing unit fetches the next instruction to be executed using the next instruction address stacked on the stack, and makes a determination on the fetched instruction. Therefore, there is an effect that the instruction to be executed next can be determined.
[0088]
According to the invention of claim 6, when the specific instruction group is continuous, the next instruction address that the central processing unit puts on the stack at the address of the instruction following the last instruction of the continuous specific instruction group. Is rewritten, so that it is possible to perform an alternative process even when a specific instruction group is continuous.
[0089]
According to the seventh aspect of the present invention, since the determination is made using the first few instructions or the last several instructions of the specific instruction group, it is determined whether the instruction is a specific instruction group. There is an effect that the determination can be made efficiently.
[0090]
According to the eighth aspect of the present invention, some specific instruction groups are skipped without performing alternative processing, so that an instruction group that does not need to be executed can be skipped. .
[0091]
According to the ninth aspect of the present invention, when the next instruction to be executed is the first instruction or the first few instructions in the instruction group for acquiring the memory map, the next instruction to be executed is specified. Since it is determined that the instruction belongs to the instruction group and the alternative processing including the processing of rewriting the memory map information is performed, the physical memory area that can be used by the activated operating system can be limited. .
[0092]
According to the tenth aspect of the present invention, when the next instruction to be executed is an instruction in the middle of the instruction group for acquiring the memory map, the last instruction, or the last several instructions, the specific instruction group is Since it is determined that the execution has been performed and the alternative process including the process of rewriting the memory map information is performed, it is possible to limit the physical memory area that can be used by the activated operating system.
[0093]
According to the eleventh aspect of the present invention, the operating system activation method according to any one of the above aspects of the invention is caused to be executed by a computer, so that the program becomes readable by a computer. And any one of the operations can be executed by a computer.
[0094]
According to the twelfth aspect of the present invention, it is determined whether or not the next instruction to be executed as a process of the operating system to be started is an instruction belonging to a specific instruction group. If it is determined that the instruction is a substitute, a specific instruction group will be replaced.Therefore, it is not necessary to modify the operating system to be started, thereby shortening the development period and reducing the development cost. This has the effect that it can be performed.
[Brief description of the drawings]
FIG. 1 is an explanatory diagram for explaining a concept of an instruction group substitution process by an operating system activation control method according to an embodiment;
FIG. 2 is a functional configuration diagram showing a configuration of an operating system according to the present embodiment.
FIG. 3 is a diagram illustrating a register whose value is automatically stacked on a stack by a CPU when an interrupt occurs, a register whose value is stacked on a stack by a debug exception processing unit, and the like.
FIG. 4 is a flowchart illustrating a processing procedure of a debug exception processing unit illustrated in FIG. 2;
FIG. 5 is a diagram illustrating an example of a data structure of a memory map.
FIG. 6 is a flowchart illustrating a procedure of an alternative process performed by a debug exception processing unit on a memory map acquisition instruction group executed as an initialization process of the OS-B.
FIG. 7 is a diagram showing a computer that executes an operating system according to the present embodiment.
[Explanation of symbols]
200 operating system
210 Interrupt distribution processing unit
220 Debug exception handling unit
230 Interrupt Descriptor Table
240 stack
700 computer
710 CPU
720 input device
730 ROM
740 RAM
750 reader
760 output device
770 bus
800 recording medium
Claims (12)
起動されるオペレーティングシステムの処理として次に実行される命令が特定の命令群に属する命令であるか否かの判定をおこなう命令群判定工程と、
前記命令群判定工程が特定の命令群に属する命令であると判定をおこなった場合に、該特定の命令群に対して代替処理をおこなう代替処理工程と、
を含んだことを特徴とするオペレーティングシステム起動制御方法。An operating system start-up control method for controlling start-up of one operating system among a plurality of operating systems operating simultaneously on one computer,
An instruction group determining step of determining whether an instruction to be executed next as a process of the operating system to be started is an instruction belonging to a specific instruction group;
An alternative processing step of performing an alternative process on the specific instruction group when the instruction group determination step determines that the instruction belongs to a specific instruction group;
An operating system startup control method, comprising:
起動されるオペレーティングシステムの処理として次に実行される命令が特定の命令群に属する命令であるか否かの判定をおこなう命令群判定手段と、
前記命令群判定手段が特定の命令群に属する命令であると判定をおこなった場合に、該特定の命令群に対して代替処理をおこなう代替処理手段と、
を備えたことを特徴とするオペレーティングシステム起動制御装置。An operating system activation control device that controls activation of one operating system among a plurality of operating systems that operate simultaneously on one computer,
Instruction group determining means for determining whether an instruction to be executed next as a process of the operating system to be started is an instruction belonging to a specific instruction group,
When the instruction group determination unit determines that the instruction belongs to a specific instruction group, an alternative processing unit that performs an alternative process on the specific instruction group;
An operating system activation control device comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003076496A JP2004287618A (en) | 2003-03-19 | 2003-03-19 | Starting control method of operating system, program making computer execute its method, and starting control device of operating system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003076496A JP2004287618A (en) | 2003-03-19 | 2003-03-19 | Starting control method of operating system, program making computer execute its method, and starting control device of operating system |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2004287618A true JP2004287618A (en) | 2004-10-14 |
Family
ID=33291540
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003076496A Pending JP2004287618A (en) | 2003-03-19 | 2003-03-19 | Starting control method of operating system, program making computer execute its method, and starting control device of operating system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2004287618A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8051281B2 (en) | 2007-01-29 | 2011-11-01 | Toyota Jidosha Kabushiki Kaisha | Operating system startup control method and information processing apparatus |
JP2012194707A (en) * | 2011-03-15 | 2012-10-11 | Fujitsu Ltd | Information processing device, portable terminal device, and control method of log output in information processing device |
US9959225B2 (en) | 2013-01-31 | 2018-05-01 | Mitsubishi Electric Corporation | Computer apparatus and control method of computer apparatus |
CN110457154A (en) * | 2019-07-25 | 2019-11-15 | Oppo广东移动通信有限公司 | Exception service processing method and processing device, storage medium, communication terminal |
-
2003
- 2003-03-19 JP JP2003076496A patent/JP2004287618A/en active Pending
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8051281B2 (en) | 2007-01-29 | 2011-11-01 | Toyota Jidosha Kabushiki Kaisha | Operating system startup control method and information processing apparatus |
JP2012194707A (en) * | 2011-03-15 | 2012-10-11 | Fujitsu Ltd | Information processing device, portable terminal device, and control method of log output in information processing device |
US9959225B2 (en) | 2013-01-31 | 2018-05-01 | Mitsubishi Electric Corporation | Computer apparatus and control method of computer apparatus |
CN110457154A (en) * | 2019-07-25 | 2019-11-15 | Oppo广东移动通信有限公司 | Exception service processing method and processing device, storage medium, communication terminal |
CN110457154B (en) * | 2019-07-25 | 2023-12-22 | Oppo广东移动通信有限公司 | Abnormal service processing method and device, storage medium and communication terminal |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10318407B2 (en) | Allocating a debug instruction set based on the current operating state in a multi-instruction-set data processing apparatus | |
KR102084816B1 (en) | Layout and execution of software applications using bpram | |
US7937700B1 (en) | System, processor, and method for incremental state save/restore on world switch in a virtual machine environment | |
JP3546678B2 (en) | Multi-OS configuration method | |
US9189248B2 (en) | Specialized boot path for speeding up resume from sleep state | |
US5634046A (en) | General purpose use of a stack pointer register | |
US9298472B2 (en) | High-speed restart method, information processing device, and program | |
US6751737B1 (en) | Multiple protected mode execution environments using multiple register sets and meta-protected instructions | |
US20130232490A1 (en) | Virtual machine control method and virtual machine system | |
US7962734B2 (en) | Method of restarting a computer platform | |
JP5783809B2 (en) | Information processing apparatus, activation method, and program | |
US7454547B1 (en) | Data exchange between a runtime environment and a computer firmware in a multi-processor computing system | |
JPH06324849A (en) | Method and system for activation of operating system environment | |
JP5778296B2 (en) | Virtual computer system, virtualization mechanism, and data management method | |
US7600111B2 (en) | Method of restarting a computer platform | |
US7484083B1 (en) | Method, apparatus, and computer-readable medium for utilizing BIOS boot specification compliant devices within an extensible firmware interface environment | |
JP2005122334A (en) | Memory dump method, memory dumping program and virtual computer system | |
US6820254B2 (en) | Method and system for optimizing code using an optimizing coprocessor | |
CN113127263B (en) | Kernel crash recovery method, device, equipment and storage medium | |
JP2009134565A (en) | Virtual machine system and method for controlling virtual machine system | |
US9223697B2 (en) | Computer reprogramming method, data storage medium and motor vehicle computer | |
JP2004287618A (en) | Starting control method of operating system, program making computer execute its method, and starting control device of operating system | |
KR100534613B1 (en) | apparatus and method for booting system using flash memory | |
JP2004030224A (en) | Processor, method for retracting register and method for designating register | |
US20080072009A1 (en) | Apparatus and method for handling interrupt disabled section and page pinning apparatus and method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20060201 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20060214 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20060413 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20060530 |