JP4026667B2 - Multi-OS configuration method - Google Patents

Multi-OS configuration method Download PDF

Info

Publication number
JP4026667B2
JP4026667B2 JP2006270265A JP2006270265A JP4026667B2 JP 4026667 B2 JP4026667 B2 JP 4026667B2 JP 2006270265 A JP2006270265 A JP 2006270265A JP 2006270265 A JP2006270265 A JP 2006270265A JP 4026667 B2 JP4026667 B2 JP 4026667B2
Authority
JP
Japan
Prior art keywords
interrupt
kernel
processing
address
processor
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
JP2006270265A
Other languages
Japanese (ja)
Other versions
JP2007035066A (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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2006270265A priority Critical patent/JP4026667B2/en
Publication of JP2007035066A publication Critical patent/JP2007035066A/en
Application granted granted Critical
Publication of JP4026667B2 publication Critical patent/JP4026667B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Description

本発明は一台の計算機上で複数のオペレーティングシステムを稼働させるマルチOS構成方法に関する。   The present invention relates to a multi-OS configuration method for operating a plurality of operating systems on one computer.

通常の計算機では1つのオペレーティングシステムが動作し、それが計算機のプロセッサ、メモリ、および、二次記憶装置等の計算機資源を管理し、計算機が効率良く動作できるように資源スケジュールを実施している。オペレーティングシステムには様々な種類がある。バッチ処理に優れるものや、TSS(TimeSharing
System)に優れるもの、GUI(Graphical User Interface)に優れているものなど様
々である。
In an ordinary computer, one operating system operates, which manages computer resources such as the processor, memory, and secondary storage of the computer, and implements a resource schedule so that the computer can operate efficiently. There are various types of operating systems. Excellent batch processing and TSS (TimeSharing
There are various types such as those that excel in System) and those that excel in GUI (Graphical User Interface).

一方で、これら複数あるオペレーティングシステムを1台の計算機で同時に実行したいというニーズがある。例えば、大型計算機においては、実際の業務に伴うオンライン処理を実行するオペレーティングシステムと、開発用のオペレーティングシステムを一台の計算機で動作させたいという要求がある。あるいは、GUIの整っているオペレーティングシステムと、実時間性に優れているオペレーティングシステムを同時に稼働させたい等という要求もある。   On the other hand, there is a need to simultaneously execute a plurality of operating systems on a single computer. For example, in a large-scale computer, there is a demand to operate an operating system that executes online processing associated with actual work and an operating system for development on a single computer. Alternatively, there is a demand for simultaneously operating an operating system with a good GUI and an operating system with excellent real-time performance.

しかしながら、個々のオペレーティングシステムは、単独で計算機資源の管理を実施することを仮定しており、複数のオペレーティングシステムの共存は、何らかの機構なしには不可能である。   However, it is assumed that each operating system independently performs management of computer resources, and coexistence of a plurality of operating systems is impossible without some mechanism.

一台の計算機上で複数のオペレーティングシステムを動作させる機構としては、大型計算機で実現されている仮想計算機方式(OSシリーズ第11巻 VM、岡崎 世雄他著、共立出版株式会社)がある。仮想計算機方式では、仮想計算機制御プログラムが全ハードウェア資源を占有して管理し、それを仮想化して仮想計算機を構成する。仮想計算機を構成する制御部は、物理メモリ、入出力機器装置、外部割り込み等を仮想化する。   As a mechanism for operating a plurality of operating systems on one computer, there is a virtual computer system (OS series Vol. 11 VM, Yoshio Okazaki et al., Kyoritsu Publishing Co., Ltd.) realized by a large computer. In the virtual computer system, a virtual computer control program occupies and manages all hardware resources and virtualizes them to configure a virtual computer. The control unit constituting the virtual computer virtualizes physical memory, input / output device, external interrupt, and the like.

例えば、分割された物理メモリは、各仮想計算機に対してはあたかも0番地から始まる物理メモリのように振舞い、入出力装置を識別する装置番号も同様に仮想化されている。更に、磁気ディスクの記憶領域も分割して磁気ディスク装置の仮想化まで実現している。   For example, the divided physical memory behaves as if it were a physical memory starting from address 0 for each virtual machine, and the device number for identifying the input / output device is virtualized as well. Furthermore, the storage area of the magnetic disk is also divided to realize the virtualization of the magnetic disk device.

各オペレーティングシステムは、制御プログラムにより構築された仮想計算機上で実行されるように制御プログラムによりスケジュールされる。 しかし、大型計算機における仮想計算機方式では、計算機資源を完全に仮想化、および、分割しようとするため、仮想計算機を構成する制御部分が複雑であり問題である。   Each operating system is scheduled by the control program to be executed on the virtual machine constructed by the control program. However, in the virtual computer system in a large computer, since it is going to completely virtualize and divide a computer resource, the control part which comprises a virtual computer is complicated and is a problem.

また、特別なハードウェア支援がない場合、仮想計算機上で動作するオペレーティングシステムが発行する制御レジスタの設定、入出力命令等の特権命令は、仮想計算機制御プログラムによりエミュレートしなければならないため、オーバーヘッドが大きくなり問題である。実際、仮想計算機を実装している大型計算機では、仮想計算機用に特別なプロセッサ機能やマイクロコード等のハードウェアを追加してオーバーヘッドの削減を図っている。仮想計算機方式は、完全に計算機資源を仮想化することを目的としているため複雑であり、更に、仮想計算機の高性能化のためには特殊なハードウェア機構が必要であり問題である。   Also, if there is no special hardware support, privileged instructions such as control register settings and I / O instructions issued by the operating system running on the virtual machine must be emulated by the virtual machine control program. Is a problem. In fact, in a large-scale computer in which a virtual computer is mounted, overhead such as a special processor function and hardware such as microcode is added for the virtual computer. The virtual computer system is complicated because it aims to completely virtualize computer resources, and further, a special hardware mechanism is necessary for improving the performance of the virtual computer, which is a problem.

一方、一台の計算機で複数のオペレーティングシステムのインターフェイスを提供する技術として、マイクロカーネルがある。マイクロカーネルでは、マイクロカーネルの上に、ユーザに見せるオペレーティングシステム機能を提供するオペレーティングシステムサーバを構築し、ユーザはそのサーバを経由して計算機資源を利用する。オペレーティングシステム毎のサーバを用意すれば、ユーザに様々のオペレーティングシステム環境を提供することができる。   On the other hand, there is a microkernel as a technique for providing an interface for a plurality of operating systems with one computer. In the microkernel, an operating system server that provides an operating system function to be shown to the user is constructed on the microkernel, and the user uses computer resources via the server. If a server for each operating system is prepared, various operating system environments can be provided to the user.

しかし、マイクロカーネル方式では、オペレーティングシステムサーバをマイクロカーネルに合わせて新規に構築する必要がある。多くの場合、現在あるオペレーティングシステムをマイクロカーネル上で動作するように変更することになるが、スケジューリング、メモリ管理等のカーネルの中枢部分も変更することになり、変更箇所が多く、また、変更箇所がオペレーティングシステムの中枢部分に及ぶため変更作業が複雑で容易でなく問題である。   However, in the microkernel method, it is necessary to construct a new operating system server in accordance with the microkernel. In many cases, the existing operating system will be changed to run on the microkernel, but the core part of the kernel such as scheduling and memory management will also be changed. However, the change work is complicated and not easy because it extends to the central part of the operating system.

また、オペレーティングシステムサーバはマイクロカーネルのサービスを利用することになるが、これは通常のオペレーティングシステムではないことであり、オーバーヘッドとなり性能低下をもたらす。
OSシリーズ第11巻 VM、岡崎 世雄他著、共立出版株式会社
In addition, the operating system server uses a microkernel service, but this is not a normal operating system, which results in overhead and performance degradation.
OS Series Vol.11 VM, Yoshio Okazaki et al., Kyoritsu Publishing Co., Ltd.

従来の仮想計算機方式は、複数のオペレーティングシステムを同時に動作させるために、全計算機資源を仮想化する手法によっていた。しかし、この方式では制御プログラムが複雑になる問題がある。更に、この方式では特権命令のエミュレーションが必要となるため、性能を得るには特別なハードウェアが必要であり問題である。   The conventional virtual computer system is based on a method of virtualizing all computer resources in order to simultaneously operate a plurality of operating systems. However, this method has a problem that the control program becomes complicated. Furthermore, since this method requires privileged instruction emulation, special hardware is required to obtain performance, which is a problem.

本発明は、オペレーティングシステムの初期化処理部分、割り込み管理部分の変更、および、割り込み管理プログラムの追加により、特別なハードウェアなしで複数オペレーティングシステムの同時実行を実現する。本発明では、特権命令のエミュレーションは不要なため、各オペレーティングシステムの実行に新たなオーバーヘッドは伴わない。   The present invention realizes simultaneous execution of a plurality of operating systems without special hardware by changing the initialization processing part, the interrupt management part of the operating system, and adding an interrupt management program. In the present invention, since emulation of privileged instructions is unnecessary, there is no new overhead in the execution of each operating system.

本発明によれば、第一のオペレーティングシステムを補完する機能を容易に追加でき、高機能な計算機システムの構築が可能になる。更に、デバイスドライバとは異なり、第一のオペレーティングシステムとは全く独立して動作する機能を組み込むことができるため、第一のオペレーティングシステムに依存しない高信頼化機能を追加することも可能になる。   According to the present invention, a function that complements the first operating system can be easily added, and a highly functional computer system can be constructed. Further, unlike the device driver, since a function that operates completely independently of the first operating system can be incorporated, a highly reliable function that does not depend on the first operating system can be added.

また、マイクロカーネル方式で複数のマルチオペレーティングシステム環境を構成する方法では、それぞれのオペレーティングシステムのインターフェイスを提供するオペレーティングシステムサーバの構築が難しいという問題がある。本発明によれば、オペレーティングシステムへの変更は初期化部分と割り込み管理部分のみに限定されるため、簡単にマルチオペレーティングシステム環境を構成できる。   Further, the method of configuring a plurality of multi-operating system environments by the microkernel method has a problem that it is difficult to construct an operating system server that provides an interface for each operating system. According to the present invention, since the change to the operating system is limited to only the initialization part and the interrupt management part, a multi-operating system environment can be configured easily.

本発明は、第一のOSにおいて、第二のOSが必要とする物理メモリ、外部デバイス等の計算機資源を予約し、どちらのOSからも独立した管理プログラムが外部割り込みを横取りして、割り込み要因によりどのOSの割り込みハンドラを起動すべきか決定し、OSの実行状態により割り込みハンドラを起動するタイミングを決定して、それの基づいて各OSの割り込みハンドラを起動することにより、2つのOSを一台の計算機で動作させる。   The present invention reserves computer resources such as a physical memory and an external device required by the second OS in the first OS, and a management program independent from either OS intercepts the external interrupt, Determines which OS's interrupt handler should be started, determines the timing for starting the interrupt handler according to the execution state of the OS, and starts the interrupt handler of each OS based on the determined OS. Operate with a calculator.

本発明は、特別なハードウェアの支援なしで、第一のOSに欠けている機能を容易に導入する方法であり、さらに、その機能は第一のOSとは全く独立して動作させることを可能にする。   The present invention is a method for easily introducing functions lacking in the first OS without the assistance of special hardware, and further, the functions are operated completely independently of the first OS. enable.

本発明によれば、第一のOSに対する変更点は、オペレーティングシステムカーネルの初期化部分、デバイス資源予約、および、割り込み禁止制御部分に限定されるため、簡単に2つのオペレーティングシステムを同時に動作させることが可能になる。   According to the present invention, changes to the first OS are limited to the initialization part of the operating system kernel, the device resource reservation, and the interrupt prohibition control part, so that two operating systems can be easily operated simultaneously. Is possible.

仮想計算機による方式で発生するオーバーヘッドについて、本発明では、それぞれのデバイスについて、デバイスを管理するオペレーティングシステムを予め決定し、さらに、物理メモリについて利用できる範囲を初期化時に決定することにより、オペレーティングシステム同士が互いに干渉しないようにして、仮想計算機でのような複雑なソフトウェアによる制御を廃止し、命令エミュレーションによるオーバーヘッドも削減し、高速化のためのハードウェアも不要とした。   Regarding the overhead generated by the virtual machine method, in the present invention, for each device, an operating system for managing the device is determined in advance, and further, a range that can be used for physical memory is determined at the time of initialization. In order not to interfere with each other, control by complicated software such as a virtual machine is abolished, overhead by instruction emulation is reduced, and hardware for speeding up is unnecessary.

従来技術においても、第一のOSの構成要素として新たな機能をカーネルに追加することは可能であるが、第一のOSが停止してしまったとき、追加した機能モジュールも動作することはできない問題があった。本発明によれば、新たな機能を実現する構成要素を、第一のOSと独立して構成しておけば、第一のOSが停止してしまったとしても、その機能モジュールだけは継続して動作することが可能になる。信頼性が要求される機能モジュールを第二のOSとして組み込めば、第一のOSが停止してしまったときでも、何らかの回復処理を実現させるといったことが可能になる。   In the prior art, it is possible to add a new function to the kernel as a component of the first OS, but when the first OS stops, the added function module cannot operate. There was a problem. According to the present invention, if a component that realizes a new function is configured independently of the first OS, even if the first OS stops, only the functional module continues. It becomes possible to operate. If a functional module that requires reliability is incorporated as the second OS, even if the first OS stops, some kind of recovery processing can be realized.

また、第一のOSは、第二のOSがアイドル時にしか動作できないことや、第二のOSの割り込みはいつでもすぐに処理することにより、第二のOSを優先させることができる。これにより、第一のOSが実時間処理に適合していなくても、第二のOSとして実時間処理に向くOSを導入すれば、第一のOSの特徴を活かしたままで、実時間処理性能に優れた計算機システムを構築することが可能になる。   In addition, the first OS can prioritize the second OS by operating only when the second OS is idle, or by immediately processing an interrupt of the second OS. As a result, even if the first OS is not suitable for real-time processing, if an OS suitable for real-time processing is introduced as the second OS, the real-time processing performance is maintained while taking advantage of the features of the first OS. It is possible to construct a computer system that is excellent in

また、第一のOSのカーネルが、カーネル本体とハードウェア依存の処理を実行するオブジェクトファイルとに分離されている場合、カーネル本体を変更しなくとも、後者のオブジェクトファイルを変更することで2つのオペレーティングシステムを同時に動作させることが可能になる。これにより、更に変更しなければならない部分が限定されるため、カーネル本体を変更するよりも容易に実施可能となる。   In addition, when the kernel of the first OS is separated into the kernel body and the object file that executes hardware-dependent processing, the two object files can be changed by changing the latter object file without changing the kernel body. It becomes possible to operate the operating system simultaneously. As a result, the parts that need to be further changed are limited, and therefore, it becomes easier to implement than changing the kernel body.

また、プログラムの記述によりオブジェクトファイル中に自由にセクションを設けることができるならば、それを利用して第一のOSと第二のOSとで共通に参照する必要のある領域を特別なセクションに閉じ込めることで、OS間の独立性を高めることができ、OS間の干渉の少ない安全な計算機システムの構築が可能になる。   If a section can be freely provided in the object file by describing the program, an area that needs to be commonly referred to by the first OS and the second OS by using the section can be used as a special section. By confining, independence between OSs can be increased, and a safe computer system with less interference between OSs can be constructed.

本発明によれば、第一のOSに対する変更点は、オペレーティングシステムカーネルの初期化部分、デバイス資源予約、および、割り込み禁止制御部分に限定されるため、簡単に複数のオペレーティングシステムを同時に動作させることが可能になる。   According to the present invention, changes to the first OS are limited to the initialization part of the operating system kernel, the device resource reservation, and the interrupt prohibition control part, so that a plurality of operating systems can be easily operated simultaneously. Is possible.

複数のオペレーティングシステムを動作実行させた場合でも、上に示した効果を得ることができる。   Even when a plurality of operating systems are executed, the above-described effects can be obtained.

従来技術においても、第一のOSの構成要素として新たな機能をカーネルに追加することは可能であるが、第一のOSが停止してしまったとき、追加した機能モジュールも動作することはできない問題があった。本発明によれば、新たな機能を実現する構成要素を、第一のOSと独立して構成しておけば、第一のOSが停止してしまったとしても、その機能モジュールだけは継続して動作することが可能になる。信頼性が要求される機能モジュールを第二、第三のOSとして組み込めば、第一のOSが停止してしまったときでも、何らかの回復処理を実現させるといったことが可能になる。   In the prior art, it is possible to add a new function to the kernel as a component of the first OS, but when the first OS stops, the added function module cannot operate. There was a problem. According to the present invention, if a component that realizes a new function is configured independently of the first OS, even if the first OS stops, only the functional module continues. It becomes possible to operate. If a functional module that requires reliability is incorporated as the second and third OSs, it is possible to realize some kind of recovery processing even when the first OS is stopped.

また、第一のOSの他に複数のOSを1つのプロセッサで実行可能なことにより、特別な機能に特化したOSを組み合わせることが可能となる。例えば、リアルタイム性に優れたOSと計算機の信頼性を補完するOSとを組み合わせて、第一のOSの機能を補うことができる。各OSは独立しているのでさまざまのOSを組み合わせることができ、他の効果を損なうことなく用途に応じた第一のOSの機能拡張が可能になる。   Further, since a plurality of OSs can be executed by a single processor in addition to the first OS, it is possible to combine OSs specialized for special functions. For example, the function of the first OS can be supplemented by combining an OS with excellent real-time characteristics and an OS that complements the reliability of the computer. Since each OS is independent, various OSs can be combined, and the function of the first OS can be expanded according to the application without impairing other effects.

また、複数のOS間に実行優先度を設定できることにより、第一のOSが実時間処理に適合していなくても、実時間処理に向く第二のOSを最高優先度に設定すれば、第一、および、第二のOS以外のOSの特徴を活かしたままで、実時間処理性能に優れた計算機システムを構築できすることが可能となる。   In addition, since the execution priority can be set between a plurality of OSs, even if the first OS is not suitable for real-time processing, if the second OS suitable for real-time processing is set to the highest priority, the first priority can be set. It is possible to construct a computer system with excellent real-time processing performance while taking advantage of the features of OSs other than the first and second OSs.

また、第一のOSのカーネルが、カーネル本体とハードウェア依存の処理を実行するオブジェクトファイルとに分離されている場合、カーネル本体を変更しなくとも、後者のオブジェクトファイルを変更することで複数のオペレーティングシステムを同時に動作させることが可能になる。また、プログラムの記述によりオブジェクトファイル中に自由にセクションを設けることができるならば、それを利用して全てのOSで共通に参照する必要のある領域を特別なセクションに閉じ込めることで、OS間の独立性を高めることができ、OS間の干渉の少ない安全な計算機システムの構築が可能になる。   In addition, when the kernel of the first OS is separated into the kernel body and the object file that executes hardware-dependent processing, the latter object file can be changed by changing the latter object file without changing the kernel body. It becomes possible to operate the operating system simultaneously. Also, if a section can be freely provided in an object file by describing a program, an area that needs to be commonly referred to by all the OSs by using it can be confined in a special section. Independence can be enhanced, and a safe computer system with less interference between OSs can be constructed.

本発明の実施の形態について説明する。   Embodiments of the present invention will be described.

以下、図面を用いて本発明の実施の形態について説明する。図1は本発明の実施の形態における計算機100の構成を示す図である。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a diagram showing a configuration of a computer 100 according to the embodiment of the present invention.

計算機100は、プロセッサ101、主記憶装置102、バス109、割り込み信号線110、クロック割り込み生成器111、割り込み制御装置112、ブート手順を格納している記憶装置118、および、割り込みバス119より構成されている。   The computer 100 includes a processor 101, a main storage device 102, a bus 109, an interrupt signal line 110, a clock interrupt generator 111, an interrupt control device 112, a storage device 118 that stores a boot procedure, and an interrupt bus 119. ing.

割り込み信号線110は、外部の入出力機器と割り込み制御装置112を接続している。外部機器が割り込みを発生すると、割り込み信号線110を経由して割り込み制御装置112が信号を受けとり、割り込み制御装置112は、この信号を数値化して、割り込みバス119を介してプロセッサ101に渡す。   The interrupt signal line 110 connects an external input / output device and the interrupt control device 112. When an external device generates an interrupt, the interrupt control device 112 receives the signal via the interrupt signal line 110, and the interrupt control device 112 digitizes this signal and passes it to the processor 101 via the interrupt bus 119.

クロック割り込み生成器111は、周期的な割り込みを生成する。   The clock interrupt generator 111 generates a periodic interrupt.

割り込み制御装置112は、外部機器からの割り込み要求を受け付け、要求元にしたがって数値化された割り込み信号を生成し、プロセッサ101に送る。また、プロセッサ101からの指示により、特定の機器からの割り込み信号をプロセッサ101に通知しないようにすることができるとする。   The interrupt control device 112 receives an interrupt request from an external device, generates a numerical interrupt signal according to the request source, and sends the interrupt signal to the processor 101. Further, it is assumed that an interrupt signal from a specific device can be prevented from being notified to the processor 101 by an instruction from the processor 101.

プロセッサ101は、演算装置103、割り込みテーブルレジスタ104、ページテーブルレジスタ105、および、アドレス変換装置106より構成されている。   The processor 101 includes an arithmetic unit 103, an interrupt table register 104, a page table register 105, and an address conversion unit 106.

割り込みテーブルレジスタ104は、割り込みテーブル107の仮想アドレスを指し示している。割り込みテーブルの詳細については後述するが、割り込み番号毎の割り込みハンドラの開始アドレスを記録している。図1で、割り込みテーブルレジスタ104と割り込みテーブル107の接続を破線で記載しているのは
、割り込みテーブルレジスタ104が割り込みテーブルの仮想アドレスを指し示すためである。割り込みが発生すると、プロセッサ101は割り込み制御装置112から数値化された割り込み番号を受ける。この番号をインデックスとして割り込みテーブル107より割り込みハンドラアドレスを取得し、割り込みハンドラに制御を渡す。
The interrupt table register 104 points to the virtual address of the interrupt table 107. Although details of the interrupt table will be described later, the start address of the interrupt handler for each interrupt number is recorded. In FIG. 1, the connection between the interrupt table register 104 and the interrupt table 107 is indicated by a broken line because the interrupt table register 104 indicates the virtual address of the interrupt table. When an interrupt occurs, the processor 101 receives a digitized interrupt number from the interrupt control device 112. Using this number as an index, an interrupt handler address is obtained from the interrupt table 107, and control is passed to the interrupt handler.

ページテーブルレジスタ105は、ページテーブル108を指し示している。   The page table register 105 points to the page table 108.

ページテーブルレジスタ105は、ページテーブル108の物理アドレスを格納している。 The page table register 105 stores the physical address of the page table 108.

アドレス変換装置106は、演算装置が要求する命令アドレス、あるいは、オペランドが格納されているアドレスを受けとり、ページテーブルレジスタ105の指しているページテーブル108の内容に基づき仮想−実アドレス変換を実施する。   The address translation device 106 receives the instruction address requested by the arithmetic unit or the address where the operand is stored, and performs virtual-real address translation based on the contents of the page table 108 pointed to by the page table register 105.

計算機100には外部入出力装置としてキーボード113、ディスプレイ114、磁気ディスク115、その他の外部機器116、および、117が接続している。ディスプレイ114を除く機器は割り込み信号線110により割り込み制御装置112に接続している。   A keyboard 113, a display 114, a magnetic disk 115, other external devices 116, and 117 are connected to the computer 100 as external input / output devices. Devices other than the display 114 are connected to the interrupt control device 112 by the interrupt signal line 110.

主記憶装置102の内容について簡単に説明する。現在、計算機101では2つのオペレーティングシステムが動作している。それぞれを第一のオペレーティングシステム、第二のオペレーティングシステムと呼ぶことにする。また、計算機を起動すると第一のOSが起動するように設定されており、外部機器116、および、117は第二のOSにより管理される機器であるとする。   The contents of the main storage device 102 will be briefly described. Currently, two operating systems operate on the computer 101. Each will be referred to as a first operating system and a second operating system. Further, it is assumed that the first OS is set to start when the computer is started, and the external devices 116 and 117 are devices managed by the second OS.

第一のOSは、起動時の初期化処理で、その他のオペレーティングシステム用に、この場合は第二のOS用に物理メモリ領域を予約する。つまり、第一のOSが、第二のOS用に予約された物理メモリ領域を利用できないように物理メモリ領域を確保する。図1は、この奪った領域に第二のOSがロードされている様子を示している。   The first OS reserves a physical memory area for other operating systems, in this case for the second OS, in the initialization process at startup. That is, the first OS reserves a physical memory area so that the physical memory area reserved for the second OS cannot be used. FIG. 1 shows a state in which the second OS is loaded in this deprived area.

更に、第一のOSの初期化過程では、第一のOSから外部機器116、および
、117の利用する割り込み番号や入出力アドレスを、既に利用済みであるとして予約する。
Further, in the initialization process of the first OS, the interrupt numbers and input / output addresses used by the external device 116 and 117 are reserved from the first OS as already used.

また、第一のOSは、すべてのオペレーティングシステムから参照可能な共通領域を持つ。その共通領域に、割り込みテーブル107、割り込み管理プログラム、割り込みハンドラ、各オペレーティングシステムから呼びだし可能なインターフェイスモジュール等を格納する。   The first OS has a common area that can be referred to by all operating systems. The common area stores an interrupt table 107, an interrupt management program, an interrupt handler, an interface module that can be called from each operating system, and the like.

本発明の実施の形態の、動作概要について説明する。本実施の形態では、第二のOSは第一のOSよりも優先して動作する。優先して動作するとは、第一のOSは第二のOSがアイドル状態であるときのみ動作可能であることを示す。第二のOSの処理が終了しない限り、第一のOSは動作できない。   An outline of the operation of the embodiment of the present invention will be described. In the present embodiment, the second OS operates with priority over the first OS. The preferential operation indicates that the first OS can operate only when the second OS is in an idle state. The first OS cannot operate unless the processing of the second OS is completed.

また、第二のOSが管理するデバイスが割り込みを発生すると、第一のOSの処理は中断され、制御は第二のOSに移る。第二のOS実行中に第一の割り込みが発生しても、その割り込み処理は第一のOSが実行されるまで延期される。   When a device managed by the second OS generates an interrupt, the processing of the first OS is interrupted, and control is transferred to the second OS. Even if the first interrupt occurs during execution of the second OS, the interrupt processing is postponed until the first OS is executed.

さらに、第一のOSと第二のOSは明確に区分されており、割り込みハンドラなどを配置する共通領域以外は、互いにアクセスできないようにする。これにより、2つのオペレーティングシステムが誤って互いの領域にアクセスして障害が起きることを防いでいる。   Further, the first OS and the second OS are clearly separated so that they can not be accessed with each other except the common area where the interrupt handlers are arranged. This prevents two operating systems from accidentally accessing each other's area and causing a failure.

以下、上記の機能を実現する本発明の実施形態について説明する。   Hereinafter, an embodiment of the present invention that realizes the above function will be described.

図2は、本発明の実施の形態における2つのオペレーティングシステムの関係を概念的に示した図である。それぞれのオペレーティングシステムは、それぞれ独立したアドレス空間を保持する。201は第一のOSの仮想空間で、202は第二のOSの仮想空間を示している。ここで、第二のOSの空間202に対応する実記憶は、図1の主記憶102の第二のOSの領域になる。   FIG. 2 is a diagram conceptually showing the relationship between two operating systems in the embodiment of the present invention. Each operating system maintains an independent address space. 201 is a virtual space of the first OS, and 202 is a virtual space of the second OS. Here, the real memory corresponding to the space 202 of the second OS becomes the area of the second OS of the main memory 102 in FIG.

仮想空間の一部分には、共通領域203がマップされる。共通領域203に対応する実記憶は、図1の主記憶102の共通領域として示した領域である。共通領域203は、もともとは第一のOSのカーネルの領域の一部である。第二のOSをロードする手順が、アドレス空間202を構築する時に、共通領域203をアドレス空間202にマッピングするように第二のOS用のページテーブルを作成する。この手順については後述する。   A common area 203 is mapped to a part of the virtual space. The real memory corresponding to the common area 203 is an area shown as the common area of the main memory 102 in FIG. The common area 203 is originally a part of the kernel area of the first OS. When the procedure for loading the second OS constructs the address space 202, a page table for the second OS is created so as to map the common area 203 to the address space 202. This procedure will be described later.

図2は、各オペレーティングシステムが管理するハードウェアを示している。   FIG. 2 shows the hardware managed by each operating system.

第一のOSは、キーボード113、ディスプレイ114、および、磁気ディスク115を、第二のOSは入出力装置116、および、117を管理することを示している。クロック111と割り込み制御装置112は、もともとは第一のOSが管理しているハードウェアであるが、共通領域203中のプログラムが管理することを示している。 The first OS indicates that the keyboard 113, the display 114, and the magnetic disk 115 are managed, and the second OS indicates that the input / output devices 116 and 117 are managed. The clock 111 and the interrupt control device 112 are originally hardware managed by the first OS, but indicate that the programs in the common area 203 manage them.

次に、ページテーブルの構成について説明する。図3は、本発明の実施の実施の形態でのページテーブルの構成を示している。   Next, the configuration of the page table will be described. FIG. 3 shows the configuration of the page table in the embodiment of the present invention.

300がページテーブルである。ページテーブル300は、プロセッサ101の仮想アドレス空間の仮想ページ毎に、それぞれの仮想ページを記述するエントリを持っている。それぞれのエントリは、有効ビット301と、物理ページ番号302により構成される。   Reference numeral 300 denotes a page table. The page table 300 has an entry describing each virtual page for each virtual page in the virtual address space of the processor 101. Each entry includes a valid bit 301 and a physical page number 302.

有効ビット301は、その仮想ページに対応する物理ページが割り当てられているか、つまり、仮想−実アドレス変換が可能かを示している。例えば、ページテーブル300の仮想ページ3は、有効ビットがセットされていないので、仮想ページ3に対応する物理ページが存在しないことを示している。有効ビット301がセットされていない仮想ページへのアクセスが発生すると、プロセッサはページフォルトを発生する。   The valid bit 301 indicates whether a physical page corresponding to the virtual page is allocated, that is, whether virtual-real address conversion is possible. For example, the virtual page 3 of the page table 300 indicates that there is no physical page corresponding to the virtual page 3 because the valid bit is not set. When an access to a virtual page for which the valid bit 301 is not set occurs, the processor generates a page fault.

物理ページ番号302は、仮想ページに対応する物理ページ番号を記録している。   The physical page number 302 records the physical page number corresponding to the virtual page.

アドレス変換装置106は、ページテーブルレジスタ105の指し示しているページテーブルの内容を参照して、演算装置103の生成する仮想アドレスを実アドレスに変換する。プロセッサ101は、変換により得られた実アドレスにより主記憶装置102を参照する。   The address conversion device 106 refers to the contents of the page table indicated by the page table register 105 and converts the virtual address generated by the arithmetic device 103 into a real address. The processor 101 refers to the main storage device 102 by the real address obtained by the conversion.

ページテーブルを切替えることにより独立した空間を構築することができ、図2に示した第一のオペレーティングシステムの空間、および、第二のオペレーティングシステムの空間の構築が可能である。また、共通領域203については、両方のオペレーティングシステムのページテーブルの共通領域に対応する部分に
、同じ物理ページをマップするように設定しておけば、共通領域を実現できる。
By switching the page table, an independent space can be constructed, and the first operating system space and the second operating system space shown in FIG. 2 can be constructed. Further, if the common area 203 is set so that the same physical page is mapped to the portion corresponding to the common area of the page tables of both operating systems, the common area can be realized.

次に、割り込みテーブルの構成について説明する。図4は、割り込みテーブルの構成を示している。   Next, the configuration of the interrupt table will be described. FIG. 4 shows the structure of the interrupt table.

400が割り込みテーブルである。割り込みテーブル400は、プロセッサ101が割り込み制御装置112から受ける割り込み番号毎の、割り込みハンドラの仮想アドレス401を記録している。プロセッサ101は割り込み要求を割り込み制御装置112から受けると、割り込み番号に対応する割り込みハンドラのアドレスを、割り込みテーブルレジスタ104の指し示している割り込みテーブル400から取得し、そのアドレスに制御を移すことで割り込み処理を開始する
Reference numeral 400 denotes an interrupt table. The interrupt table 400 records a virtual address 401 of an interrupt handler for each interrupt number received by the processor 101 from the interrupt control device 112. When the processor 101 receives an interrupt request from the interrupt control device 112, the processor 101 obtains the address of the interrupt handler corresponding to the interrupt number from the interrupt table 400 indicated by the interrupt table register 104, and transfers control to that address to perform interrupt processing. To start.

図5は、割り込み制御装置112を示している。割り込み制御装置112は、割り込みマスクレジスタ501、および、選択装置502を持っている。   FIG. 5 shows the interrupt control device 112. The interrupt control device 112 has an interrupt mask register 501 and a selection device 502.

割り込みを発生する入出力装置は、割り込み信号線110により割り込み制御装置112と接続する。入出力機器の発生する割り込みは、割り込み信号線110のどの信号線に接続するかにより優先順位が付けられる。ここでは、割り込み0番に対応する割り込み信号がもっとも優先度が高い割り込みであるとする。   The input / output device that generates the interrupt is connected to the interrupt control device 112 through the interrupt signal line 110. The interrupt generated by the input / output device is prioritized depending on which signal line of the interrupt signal line 110 is connected. Here, it is assumed that the interrupt signal corresponding to interrupt 0 is the interrupt with the highest priority.

割り込み信号線110は、選択装置502に接続している。選択装置502は
、割り込み信号を受けると、プロセッサがその割り込みを受け付けたことを通知するまで、未処理の割り込みがあることを記録している。
The interrupt signal line 110 is connected to the selection device 502. When the selection device 502 receives an interrupt signal, it records that there is an unprocessed interrupt until the processor notifies that the interrupt has been received.

割り込みマスクレジスタ501は、入出力機器の発生した割り込みをプロセッサに通知してよいかを記録している。割り込みマスクレジスタ501は、プロセッサ101から入出力命令により設定可能である。   The interrupt mask register 501 records whether or not the interrupt generated by the input / output device may be notified to the processor. The interrupt mask register 501 can be set by an input / output command from the processor 101.

選択装置502は、割り込み信号線110から割り込み要求を受けた時と、割り込みマスクレジスタ501の内容が書き換えられた時に、選択装置502が記録している未処理割り込みと、割り込みマスクレジスタ502の内容を比較して
、プロセッサに割り込みを通知するかどうかを決める。具体的には、選択装置502が記録している未処理割り込みのうち、割り込みマスクレジスタ501に割り込み可能と設定されていて、優先度の最も高い割り込みから順にプロセッサに通知する。選択した割り込みについて、選択装置502は、通知する割り込み信号に対応する数字信号を、割り込みバス119経由でプロセッサ101に送る。
When the selection device 502 receives an interrupt request from the interrupt signal line 110 and when the contents of the interrupt mask register 501 are rewritten, the selection device 502 displays the unprocessed interrupts recorded by the selection device 502 and the contents of the interrupt mask register 502. Compare to determine whether to notify the processor of an interrupt. Specifically, among the unprocessed interrupts recorded by the selection device 502, the interrupt mask register 501 is set to be interruptible, and the processor is notified in order from the interrupt with the highest priority. For the selected interrupt, the selection device 502 sends a numeric signal corresponding to the interrupt signal to be notified to the processor 101 via the interrupt bus 119.

プロセッサ101は、割り込みを受けた時に、入出力命令により選択装置502に記録されている未処理割り込み記録を解消できる。   When receiving an interrupt, the processor 101 can cancel the unprocessed interrupt record recorded in the selection device 502 by an input / output command.

次に、本発明の実施の形態における、計算機のブート手順について説明する。   Next, a computer boot procedure according to the embodiment of the present invention will be described.

ブート手順の始めの部分は、読みとり専用記憶装置である118に格納されている。記憶装置118は、プロセッサの物理アドレス空間のある決められたアドレスにマップされるようにバス109を介してプロセッサ101に接続している
。この手順は、ハードウェア構成の検出、オペレーティングシステムカーネルをロードするプログラムの主記憶へのローディングを実施する。
The first part of the boot procedure is stored in the read-only storage device 118. The storage device 118 is connected to the processor 101 via the bus 109 so as to be mapped to a predetermined address in the physical address space of the processor. This procedure carries out detection of the hardware configuration and loading of the program for loading the operating system kernel into the main memory.

プロセッサ101がリセットされると、プロセッサ101は予め定められた物理アドレスに制御を移す。記憶装置118は、この時に実行されるプログラムを格納しており、プロセッサ101がリセットされた時にこのプログラムに制御を渡せるように物理アドレス空間にマップされている。   When the processor 101 is reset, the processor 101 transfers control to a predetermined physical address. The storage device 118 stores a program to be executed at this time, and is mapped to a physical address space so that control can be passed to this program when the processor 101 is reset.

記憶装置118に格納されているプログラムは、磁気ディスク装置112に格納されている第一のOSのカーネルローダを主記憶装置102にロードして実行する。カーネルローダは、磁気ディスク装置112の予め定められた位置にあり
、記憶装置118に格納されたプログラムは、容易にこれを見つけることができる。
The program stored in the storage device 118 is executed by loading the kernel loader of the first OS stored in the magnetic disk device 112 into the main storage device 102. The kernel loader is located at a predetermined position of the magnetic disk device 112, and the program stored in the storage device 118 can easily find it.

カーネルローダの処理手順について説明する。図6は、本発明の実施の形態における、オペレーティングシステムのカーネルローダの処理手順を示すフローチャートである。   The processing procedure of the kernel loader will be described. FIG. 6 is a flowchart showing the processing procedure of the kernel loader of the operating system in the embodiment of the present invention.

このカーネルローダは、オペレーティングシステムのファイルシステム構造を理解して、ファイル名よりファイルの格納位置を特定し、主記憶に読み込むことができるよう構成されている。   This kernel loader is configured to understand the file system structure of the operating system, specify the storage location of the file from the file name, and read it into the main memory.

カーネルローダの処理手順について説明する。まず、カーネルにパラメータとして渡す主記憶リスト1101、ロードモジュールリスト1104、および、デバイスリスト1102を初期化し、カーネル用のページテーブル領域を割り当てる(ステップ601)。3つのリストの構成については後述する。   The processing procedure of the kernel loader will be described. First, the main memory list 1101, the load module list 1104, and the device list 1102 to be passed as parameters to the kernel are initialized, and a page table area for the kernel is allocated (step 601). The configuration of the three lists will be described later.

主記憶リスト1101は、主記憶装置102の利用状況を示すデータ構造であり、カーネルローダが以降の処理で物理メモリの割り当てをする場合は、主記憶リスト1101を参照、および、変更して実施する。   The main memory list 1101 is a data structure indicating the usage status of the main memory device 102. When the kernel loader allocates physical memory in the subsequent processing, the main memory list 1101 is referred to and changed. .

次に、ハードウェア構成の検査(ステップ602)、および、ハードウェア構
成データの作成(ステップ603)を実施する。ステップ602においては、計算機100にどのような接続されているかハードウェアが検査する。続くステップ603では、ステップ602の結果に基づいてハードウェア構成に関するデータ構造であるデバイスリスト1102を作成する。オペレーティングシステムカーネルは、このデバイスリスト1102を参照してカーネル初期化処理を実施する。
Next, a hardware configuration check (step 602) and hardware configuration data creation (step 603) are performed. In step 602, the hardware checks how the computer 100 is connected. In the subsequent step 603, a device list 1102 that is a data structure related to the hardware configuration is created based on the result of the step 602. The operating system kernel performs kernel initialization processing with reference to the device list 1102.

次に、オペレーティングシステムカーネルの構成情報700を磁気ディスク装置112より読み込み、パラメータテーブル1100に構成情報のアドレスを設定する(ステップ604)。オペレーティングシステムのカーネルは、カーネル
本体のファイルと、その他のデバイスドライバのファイルといったように、複数のファイルから構成されていても良い。構成情報700は、予め決められたファイル名で磁気ディスク112に格納されており、ロードプログラムはこれを見つけることができる。
Next, the configuration information 700 of the operating system kernel is read from the magnetic disk device 112, and the address of the configuration information is set in the parameter table 1100 (step 604). The kernel of the operating system may be composed of a plurality of files such as a kernel body file and other device driver files. The configuration information 700 is stored in the magnetic disk 112 with a predetermined file name, and the load program can find it.

本発明の実施形態におけるカーネル構成情報のデータ構造を図7に示す。700は、カーネル構成情報を記録しているファイルの内容を示している。構成情報ファイル700は、カーネルローダやオペレーティングシステムが参照するデータを格納している。格納されているデータには名前がつけられており、プログラムは名前からそれに対応するデータを取得することができる。図7の例では、名前がオブジェクトファイル(701)というエントリがあり、そのデータが702に格納されている。また、secondary OSには、第二のOS用のデータ(704
)を格納しているとする。
The data structure of the kernel configuration information in the embodiment of the present invention is shown in FIG. Reference numeral 700 denotes the contents of a file in which kernel configuration information is recorded. The configuration information file 700 stores data referred to by the kernel loader and the operating system. The stored data is given a name, and the program can obtain the corresponding data from the name. In the example of FIG. 7, there is an entry whose name is an object file (701), and the data is stored in 702. The secondary OS includes data for the second OS (704).
) Is stored.

カーネルローダの処理手順の説明を続ける。構成情報700を読み込んだ後、構成情報700中のオブジェクトファイルという名前のつけられたデータに格納されているカーネル構成ファイルのすべてについて、主記憶装置102に読み込み(ステップ606)、ロードモジュールリスト1104にエントリを追加し(
ステップ607)、カーネル用のページテーブルの設定(ステップ608)を実
施する。ここでは、kernel、driver1、および、driver2というファイル名のオブジェクトファイルをロードする。
Continue to explain the kernel loader procedure. After reading the configuration information 700, all the kernel configuration files stored in the data named object files in the configuration information 700 are read into the main storage device 102 (step 606), and are loaded into the load module list 1104. Add an entry (
Step 607), setting a page table for the kernel (Step 608). Here, object files having file names of kernel, driver1, and driver2 are loaded.

ロードモジュールリストエントリの追加と、カーネル用のページテーブルの設定は、主記憶102にロードしたオブジェクトファイルに格納されているデータにしたがって実施する。カーネルを構成するオブジェクトファイルには、そのファイル内容をマップする仮想アドレス、ファイルの大きさなどが含まれている。   The addition of the load module list entry and the setting of the kernel page table are performed according to the data stored in the object file loaded in the main memory 102. The object file that constitutes the kernel includes a virtual address that maps the file contents, the size of the file, and the like.

これを参照してページテーブルを構築する。オブジェクトファイルのデータ構造については後述する。 The page table is constructed with reference to this. The data structure of the object file will be described later.

最後に、ページテーブルレジスタ105を、構築したページテーブルのアドレスに設定し、プロセッサを仮想アドレス変換モードに移行させ(ステップ609
)、構築した主記憶リスト1101、デバイスリスト1102、カーネル構成情
報テーブル1103、および、ロードオブジェクトリスト1104の組から成るパラメータテーブル1110をパラメータとして、カーネルの初期化ルーチンに制御を渡す(ステップ610)。カーネルのエントリポイントは、カーネルファ
イル内のデータに記録されている。
Finally, the page table register 105 is set to the address of the constructed page table, and the processor is shifted to the virtual address translation mode (step 609).
), Control is passed to the initialization routine of the kernel using the parameter table 1110 comprising the set of the main memory list 1101, the device list 1102, the kernel configuration information table 1103, and the load object list 1104 as parameters (step 610). The kernel entry point is recorded in the data in the kernel file.

次に、カーネルを構成するオブジェクトファイルの構造について説明する。図8は、本発明の実施の形態での、カーネルを構成するオブジェクトファイルの構造を示す図である。   Next, the structure of the object file constituting the kernel will be described. FIG. 8 is a diagram showing the structure of the object file constituting the kernel according to the embodiment of the present invention.

800は、オブジェクトファイル全体を示している。オブジェクトファイル800は、801ないし811のヘッダ部分と、812ないし813のセクション部分より構成される。   Reference numeral 800 denotes the entire object file. The object file 800 includes a header portion 801 to 811 and a section portion 812 to 813.

ヘッダ部分の構成について説明する。ヘッダマップアドレス801とヘッダサイズ802は、オブジェクトファイル800ヘッダ部分のカーネル空間での格納位置を記述している。ヘッダ部分は、ヘッダマップアドレス801に記録されているアドレスに読み込まれる。   The configuration of the header part will be described. The header map address 801 and the header size 802 describe the storage location in the kernel space of the header portion of the object file 800. The header part is read into the address recorded in the header map address 801.

初期化エントリ803は、オブジェクトファイル800の初期化用ルーチンのアドレスを記録している。カーネルは、カーネル初期化時に各オブジェクトファイルの初期化ルーチンを呼ぶときに、各オブジェクトファイルの初期化エントリ803を参照して初期化ルーチンを見つける。   The initialization entry 803 records the address of the initialization routine for the object file 800. When the kernel calls the initialization routine of each object file at the time of kernel initialization, the kernel refers to the initialization entry 803 of each object file to find the initialization routine.

セクション数804は、オブジェクトファイル800に含まれているセクションの数を記録している。セクションとは、オブジェクトファイル内の連続しているデータ領域で、これを単位としてカーネルの仮想空間へのマッピングを決定する。例えば、オブジェクトファイルは、実行コードが格納されているセクションと、そのオブジェクトファイルが参照するデータを格納しているセクションを含んでいる。これらのセクションはオブジェクトファイル作成時にコンパイラにより作成される。   The section number 804 records the number of sections included in the object file 800. The section is a continuous data area in the object file, and the mapping of the kernel to the virtual space is determined based on this section. For example, the object file includes a section that stores an execution code and a section that stores data referred to by the object file. These sections are created by the compiler when the object file is created.

外部参照テーブルオフセット805と外部参照テーブルサイズ806は、このオブジェクトファイル内の実行コードが参照する、他のオブジェクトファイルの公開参照の情報を格納する外部参照テーブル810を記述している。外部参照テーブル810は、オブジェクトファイル800のヘッダ部分に含まれており、外部参照テーブルオフセット805は、ヘッダの先頭からの外部参照テーブル810のオフセットを記録している。   The external reference table offset 805 and the external reference table size 806 describe an external reference table 810 that stores information on public references of other object files that are referred to by the execution code in the object file. The external reference table 810 is included in the header portion of the object file 800, and the external reference table offset 805 records the offset of the external reference table 810 from the head of the header.

公開参照テーブルオフセット807と公開参照テーブルサイズ808は、このオブジェクトファイルが他のオブジェクトファイルの実行コードに公開しているモジュールとデータの情報を格納している公開参照テーブル811を記述している。公開参照テーブル811は、オブジェクトファイル800のヘッダ部分に含まれており、公開参照テーブルオフセット807は、ヘッダの先頭からの公開参照テーブル811のオフセットを記録している。   The public reference table offset 807 and the public reference table size 808 describe a public reference table 811 in which information of modules and data disclosed by this object file in the execution code of another object file is stored. The public reference table 811 is included in the header portion of the object file 800, and the public reference table offset 807 records the offset of the public reference table 811 from the head of the header.

セクションデータ809は、オブジェクトファイル800に含まれる各セクションについてのデータを格納している。セクションデータは、セクション数804の数だけある。セクションデータの構成については後述する。   The section data 809 stores data for each section included in the object file 800. There are as many section data as the number of sections 804. The configuration of the section data will be described later.

セクションデータの後に外部参照テーブル810と、公開参照テーブル811が続き、ヘッダ部分を構成する。   After the section data, an external reference table 810 and a public reference table 811 follow to constitute a header portion.

ヘッダ部分の後には、各セクションの本体812、813が格納されている。   After the header portion, main sections 812 and 813 of each section are stored.

セクションデータ809の構成について説明する。セクション開始オフセット820とセクションサイズ821は、オブジェクトファイル800内での、当該セクションの開始オフセットと、当該セクションの大きさを記録している。   A configuration of the section data 809 will be described. The section start offset 820 and the section size 821 record the start offset of the section and the size of the section in the object file 800.

セクションは、セクションマップアドレス822に記録されたアドレスに配置されるようにカーネルの仮想空間にマップされる。セクション名称823には、当該セクションの名前を示す文字列が格納されている。   The section is mapped to the kernel virtual space so that it is located at the address recorded in the section map address 822. The section name 823 stores a character string indicating the name of the section.

外部参照テーブルの構造について説明する。図9は、外部参照テーブルの構造を示している。テーブル810の先頭には、このテーブルに含まれる外部参照情報の数901が格納されている。   The structure of the external reference table will be described. FIG. 9 shows the structure of the external reference table. At the top of the table 810, the number 901 of external reference information included in this table is stored.

続いて、オブジェクトファイル名902、外部参照名903が格納されている
。オブジェクトファイル名902と外部参照名903は、文字列テーブル905へのオフセット値を格納しており、実際の文字列による名称は文字列テーブル905内に格納されている。
Subsequently, an object file name 902 and an external reference name 903 are stored. The object file name 902 and the external reference name 903 store an offset value to the character string table 905, and the actual character string name is stored in the character string table 905.

外部参照アドレス904には、この当該外部参照エントリで記述される外部参照の実際のアドレスが格納される。カーネルは、オブジェクトファイルを主記憶にロードするときに、当該の外部参照を含むオブジェクトファイルの公開参照のテーブルを参照して関数、あるいは、データのアドレスを取得し、外部参照アドレス904に設定する。オブジェクトファイルの実行コードは、外部関数アドレス904に格納されたアドレスを参照して、他のオブジェクトファイル内の関数の呼び出しや、データの参照をするようコンパイルされており、他オブジェクトモジュールにある関数の実行や、データ参照が可能である。   The external reference address 904 stores the actual address of the external reference described by the external reference entry. When the kernel loads the object file into the main memory, the kernel obtains the address of the function or data by referring to the public reference table of the object file including the external reference, and sets it to the external reference address 904. The execution code of the object file is compiled so as to call a function in another object file or refer to data by referring to the address stored in the external function address 904. Execution and data reference are possible.

オブジェクトファイル名902、外部参照名903、および、外部参照アドレス904が1つの外部参照を定義し、外部参照数901に記録されている数だけ
、これらのエントリが連続して配置される。その後に、文字列テーブル905が格納される。文字列テーブルは、オブジェクトファイル名や、外部参照名の文字列を格納している。
The object file name 902, the external reference name 903, and the external reference address 904 define one external reference, and these entries are continuously arranged by the number recorded in the external reference number 901. After that, the character string table 905 is stored. The character string table stores character strings of object file names and external reference names.

公開参照テーブルの構造について説明する。図10は、公開参照テーブルの構造を示す図である。   The structure of the public reference table will be described. FIG. 10 is a diagram illustrating the structure of the public reference table.

テーブル811の先頭には、この公開参照テーブル811により他のオブジェクトモジュールに公開される参照名の数1001が記録されている。1つの公開参照は、公開参照名1002と公開参照アドレス1003により記述される。公開参照名1002は、文字列テーブル1004へのオフセット値を格納しており
、実際の文字列による名前は文字列テーブル1004に格納されている。公開参照アドレス1003は、この参照に対応するアドレスを格納している。
At the top of the table 811, the number of reference names 1001 disclosed to other object modules by the public reference table 811 is recorded. One public reference is described by a public reference name 1002 and a public reference address 1003. The public reference name 1002 stores an offset value to the character string table 1004, and an actual character string name is stored in the character string table 1004. The public reference address 1003 stores an address corresponding to this reference.

次に、ステップ601から始まるブート手順が作成するハードウェア構成データと、ロードオブジェクトデータの構成について説明する。図11がハードウェア構成データとロードオブジェクトデータの構成を示す図である。   Next, the hardware configuration data created by the boot procedure starting from step 601 and the configuration of the load object data will be described. FIG. 11 is a diagram showing the configuration of hardware configuration data and load object data.

パラメータテーブル1100は、カーネルローダが作成するデータ構造である
。パラメータテーブル1100から始まる3つのリストは、ローダが構築するカーネルの仮想空間に配置されるので、カーネルから参照可能である。
The parameter table 1100 is a data structure created by the kernel loader. Since the three lists starting from the parameter table 1100 are arranged in the virtual space of the kernel constructed by the loader, they can be referred to from the kernel.

パラメータテーブル1100は、ローダが構築した3つのリストの先頭へのポインタと、1つのテーブルへのポインタを保持している。3つのリストとは、主記憶リスト1101、デバイスリスト1102、および、ロードオブジェクトリスト1104で、1つのテーブルはカーネル構成情報テーブル1103である。   The parameter table 1100 holds a pointer to the head of three lists constructed by the loader and a pointer to one table. The three lists are a main storage list 1101, a device list 1102, and a load object list 1104, and one table is a kernel configuration information table 1103.

それぞれについて説明する。 Each will be described.

主記憶リスト1101は、主記憶ブロック記述データ1110のリストである
。主記憶ブロック記述データ1110は、ベースアドレス1111、ブロックサイズ1112、ブロック利用状況1113、および、次の主記憶ブロック記述データへのポインタ1114から構成されている。
The main memory list 1101 is a list of main memory block description data 1110. The main memory block description data 1110 includes a base address 1111, a block size 1112, a block usage status 1113, and a pointer 1114 to the next main memory block description data.

主記憶ブロック記述データは、ある連続した主記憶領域についての利用状況を記録している。ベースアドレス1111は連続領域の開始物理アドレスを示し、ブロックサイズ1112は連続領域の大きさを格納している。ブロック利用状況1113は、当該連続領域が未使用であるか、あるいは、ローダにより割り当て済みであるかを示す値が格納されている。そして、次エントリへのポインタ1114によりリストを構成している。図11では、1110の次のエントリは1120である。主記憶リスト1101を参照することで、物理メモリの利用状態を知ることができる。   The main memory block description data records the usage status of a certain continuous main memory area. The base address 1111 indicates the start physical address of the continuous area, and the block size 1112 stores the size of the continuous area. The block usage status 1113 stores a value indicating whether the continuous area is unused or has been allocated by the loader. A list is configured by a pointer 1114 to the next entry. In FIG. 11, the next entry after 1110 is 1120. By referring to the main memory list 1101, the use state of the physical memory can be known.

デバイスリスト1102は、カーネルローダが検出したハードウェアデバイスに関するデータを格納しており、ステップ603で作成されている。デバイスリスト1103は、デバイスデータ1150からなるリストである。デバイスデータ1150は、デバイスタイプ1151、デバイス情報1152、および、次のデバイスデータへのポインタ1153より構成される。   The device list 1102 stores data regarding hardware devices detected by the kernel loader, and is created in step 603. The device list 1103 is a list composed of device data 1150. The device data 1150 includes a device type 1151, device information 1152, and a pointer 1153 to the next device data.

デバイスタイプ1151は、このデバイスデータエントリ1150により記述されるデバイスの種類を示す値が格納されている。デバイス情報1152は、デバイスの種類に特有なデータを格納している。例えば、割り込み番号やI/Oアドレスなどがそれに相当する。そして、次エントリへのポインタ1153によりリストを構成している。   The device type 1151 stores a value indicating the type of device described by the device data entry 1150. The device information 1152 stores data specific to the device type. For example, an interrupt number or an I / O address corresponds to this. A list is configured by a pointer 1153 to the next entry.

カーネル構成情報テーブルへのポインタ1103は、カーネルローダが主記憶102に読み込んだカーネル構成情報ファイル700の内容を指し示している。   A pointer 1103 to the kernel configuration information table indicates the contents of the kernel configuration information file 700 read into the main memory 102 by the kernel loader.

ロードオブジェクトリスト1104は、カーネルローダが主記憶にロードしたオブジェクトファイルに関するデータを保持している。ロードオブジェクトリストは、ロードオブジェクトデータ1130のリストである。ロードオブジェクトデータ1130は、オブジェクトファイル名1131、オブジェクトアドレス1132、および、次のロードオブジェクトデータへのポインタ1133より構成されている。   The load object list 1104 holds data relating to object files loaded into the main memory by the kernel loader. The load object list is a list of load object data 1130. The load object data 1130 includes an object file name 1131, an object address 1132, and a pointer 1133 to the next load object data.

オブジェクトファイル名1131は、ロードオブジェクトデータ1130により記述されているオブジェクトファイルのファイル名である。オブジェクトアドレス1132は、当該オブジェクトファイルのヘッダ領域がロードされているカーネル空間のアドレスを格納している。そして、次エントリへのポインタ1133によりリストを構成している。   The object file name 1131 is the file name of the object file described by the load object data 1130. The object address 1132 stores the address of the kernel space in which the header area of the object file is loaded. A list is configured by a pointer 1133 to the next entry.

ロードオブジェクトリスト1104は、カーネルローダがカーネルを構成するオブジェクトファイルを読み込む時に同時に作成している(ステップ607)。   The load object list 1104 is created at the same time when the kernel loader reads an object file constituting the kernel (step 607).

次に、本発明の実施の形態における第一のOSの初期化手順について説明する
。図12は、第一のOSの初期化手順を示すフローチャートである。
Next, the initialization procedure of the first OS in the embodiment of the present invention will be described. FIG. 12 is a flowchart showing the initialization procedure of the first OS.

まず、パラメータとして渡されたパラメータテーブル1100中のロードオブジェクトリスト1104を参照して、カーネルローダがロードしたオブジェクトファイルの外部参照アドレス解決を実施する(ステップ1201)。アドレス解
決では、各オブジェクトファイルにある外部参照テーブル810の、外部参照アドレス904を決定する。アドレスは、各オブジェクトファイルの公開参照テーブル811を参照して決定する。
First, referring to the load object list 1104 in the parameter table 1100 passed as a parameter, the external reference address resolution of the object file loaded by the kernel loader is performed (step 1201). In address resolution, the external reference address 904 of the external reference table 810 in each object file is determined. The address is determined by referring to the public reference table 811 of each object file.

続く、ステップ1202では、カーネル起動時のパラメータとして渡されたパラメータテーブル1100の主記憶リスト1101を参照して、第二のOS用に主記憶領域を確保する。   In step 1202, a main storage area is secured for the second OS with reference to the main storage list 1101 of the parameter table 1100 passed as a parameter at the time of kernel activation.

具体的には、カーネル構成情報テーブル700より第二のOSの情報を取り出す。図7の例では、第二のOSの構成情報は704に格納されている。この構成情報704を参照して、確保すべき主記憶の大きさを決定する。そして、主記憶リスト1101の空きブロックエントリの内容を変更して、主記憶領域を割り当てる。この処理は、第一のOSが空きメモリ管理を始める前に実施する。   Specifically, the second OS information is extracted from the kernel configuration information table 700. In the example of FIG. 7, the configuration information of the second OS is stored in 704. With reference to this configuration information 704, the size of the main memory to be secured is determined. Then, the contents of the empty block entry in the main memory list 1101 are changed and a main storage area is allocated. This process is performed before the first OS starts free memory management.

これにより、第一のOSから見ると、第二のOSに割り当てた主記憶領域は存在しないことになり、第一のOSから参照されることがなくなる。したがって、割り当てた領域は、第二のOSが自由に使うことのできる主記憶領域となる。これは、図1の第二のOSの領域に相当する。   As a result, when viewed from the first OS, the main storage area allocated to the second OS does not exist and is not referenced from the first OS. Accordingly, the allocated area becomes a main storage area that can be freely used by the second OS. This corresponds to the area of the second OS in FIG.

次のステップ1203では、カーネル内部のデータ構造の初期化を実施する。   In the next step 1203, initialization of the data structure inside the kernel is performed.

この初期化には、後で述べるデバイス管理テーブルの初期化も含む。 This initialization includes initialization of a device management table described later.

ステップ1204では、第二のOSが管理するデバイスを予約する。ここで予約するとは、第一のOSから利用できないようにすることである。具体的には、第一のOSが管理しているデバイス管理テーブルへの登録を実施する。   In step 1204, a device managed by the second OS is reserved. Reserving here means making it unusable from the first OS. Specifically, registration in the device management table managed by the first OS is performed.

第二のOSが管理するデバイス資源は、パラメータテーブル1100のカーネル構成情報テーブル1103の指すテーブル700に格納されている、第二のOSの構成情報を参照して決める。この実施形態では、図7の704に格納されているデータがそれに相当する。   The device resources managed by the second OS are determined by referring to the configuration information of the second OS stored in the table 700 indicated by the kernel configuration information table 1103 of the parameter table 1100. In this embodiment, the data stored in 704 in FIG.

デバイス管理テーブルについて説明する。図13は、第一のOSのデバイス管理テーブルの構造を示した図である。デバイス管理テーブルは、割り込みベクタ管理テーブル1300と、I/Oアドレス管理リスト1310の2つのデータ構造からなる。   The device management table will be described. FIG. 13 shows the structure of the device management table of the first OS. The device management table has two data structures, an interrupt vector management table 1300 and an I / O address management list 1310.

割り込みベクタ管理テーブル1300は、プロセッサ101が受け付ける各割り込み番号について、第一のOSがその割り込み番号を利用するかどうかを示す値を格納している。カーネルは、デバイスドライバが初期化時に割り込み番号を要求した場合に、このテーブル1300を検査し、要求された割り込み番号が利用されているか検査し、そうでない場合にのみ要求された割り込み番号を使用する権利をデバイスドライバに与える。既に利用済みであると記されている場合は
、そのデバイスは第一のOSからは利用できないことになる。
The interrupt vector management table 1300 stores, for each interrupt number accepted by the processor 101, a value indicating whether or not the first OS uses the interrupt number. The kernel checks this table 1300 when the device driver requests an interrupt number at initialization, checks whether the requested interrupt number is used, and uses the requested interrupt number only when it is not. Entitle the device driver. If it is described as already used, the device cannot be used from the first OS.

図2の入出力装置116と117を例として説明する。入出力装置116と117は、それぞれ割り込み番号4と5と要求すると仮定する。入出力装置116と117は、第二のOSが管理するデバイスである。入出力装置116と117の要求する割り込み番号は、カーネル構成情報テーブル700の第二のOSの構成情報704に記録されている。ステップ1204では、この構成情報704を参照して、割り込みベクタ管理テーブルの、割り込み番号4と5のエントリに利用中であることを示す値を格納する。この処理は、第一のOSがデバイス管理を開始する前に実施するため、第一のOSは、入出力装置116と117にアクセスすることができなくなり、装置116と117を第二のOSの管理下におくことができる。   The input / output devices 116 and 117 in FIG. 2 will be described as an example. Assume that I / O devices 116 and 117 request interrupt numbers 4 and 5, respectively. The input / output devices 116 and 117 are devices managed by the second OS. The interrupt numbers requested by the input / output devices 116 and 117 are recorded in the configuration information 704 of the second OS in the kernel configuration information table 700. In step 1204, the configuration information 704 is referred to, and a value indicating that it is being used is stored in the entries of interrupt numbers 4 and 5 in the interrupt vector management table. Since this process is performed before the first OS starts device management, the first OS cannot access the input / output devices 116 and 117, and the devices 116 and 117 are connected to the second OS. Can be under control.

I/Oアドレス管理リスト1310についても同様である。I/Oアドレス管理リスト1310は、I/Oアドレス範囲を表現するエントリ1320からなるリストである。エントリ1320は、第一のOSが利用するI/Oアドレス範囲1321と、リストを構成するための次のエントリへのポインタ1322からなる。割り込みベクタ管理テーブル1300と同様、デバイスドライバが初期化時にI/Oアドレス範囲を要求した場合、カーネルは、そのアドレス範囲が既に利用されているかI/Oアドレス管理リスト1310により検査し、未使用である場合、このリスト1310にエントリを追加して、利用許可を与える。   The same applies to the I / O address management list 1310. The I / O address management list 1310 is a list made up of entries 1320 representing I / O address ranges. The entry 1320 includes an I / O address range 1321 used by the first OS and a pointer 1322 to the next entry for configuring the list. Similar to the interrupt vector management table 1300, when the device driver requests an I / O address range at the time of initialization, the kernel checks whether the address range is already used by the I / O address management list 1310, and does not use it. If there is, an entry is added to this list 1310 to give usage permission.

第二のOSが管理するデバイスが要求するI/Oアドレス範囲は、割り込み番号と同様にカーネル構成情報テーブル700に格納されているので、それを参照すれば要求アドレスを知ることができ、第一のOSがデバイス管理を開始する前にI/Oアドレスを予約できる。   Since the I / O address range requested by the device managed by the second OS is stored in the kernel configuration information table 700 in the same manner as the interrupt number, the requested address can be known by referring to it. Can reserve an I / O address before the OS starts device management.

ステップ1202の処理により、第一のOSから完全に独立した第二のOS専用の空間を構築することが可能になる。さらに、ステップ1204の処理により
、第一のOS上で動作するユーザプログラムは、第二のオペレーティングシステムが管理するデバイス、この例では、入出力装置116と117へのアクセスが不可能になる。また、装置116と117の割り込み番号とI/Oアドレスを利用するデバイスドライバを導入することを禁止できる。
By the processing in step 1202, it is possible to construct a space dedicated to the second OS that is completely independent of the first OS. Further, the processing in step 1204 makes it impossible for the user program operating on the first OS to access the devices managed by the second operating system, in this example, the input / output devices 116 and 117. In addition, it is possible to prohibit the introduction of device drivers that use the interrupt numbers and I / O addresses of the devices 116 and 117.

この2つのステップの処理の効果として、第一のOSが関知しない部分に第二のOSを導入することが可能になる。   As an effect of the processing of these two steps, it becomes possible to introduce the second OS into a portion that the first OS is not aware of.

続くステップ1205、ないし、ステップ1207は通常のオペレーティングシステムの初期化処理と同じである。ステップ1205のシステムデバイスの初期化では、カーネルが直接管理するシステムデバイスの初期化を実施する。システムデバイスとは、クロック割り込みなど、第一のOSの実行に不可欠で、第一のOSが必ず存在していると仮定しているデバイスである。   The subsequent step 1205 or 1207 is the same as the normal initialization process of the operating system. In the initialization of the system device in step 1205, the system device directly managed by the kernel is initialized. The system device is a device that is indispensable for the execution of the first OS, such as a clock interrupt, and assumes that the first OS always exists.

ステップ1206では、カーネルローダがロードしたオブジェクトファイルについて、それぞれの初期化エントリを実行する。初期化エントリアドレスは、オブジェクトファイルのヘッダ部分に格納されている。最後に、初期プロセスを作成する(ステップ1207)。   In step 1206, each initialization entry is executed for the object file loaded by the kernel loader. The initialization entry address is stored in the header portion of the object file. Finally, an initial process is created (step 1207).

次に、本発明の実施の形態における、第二のOSのロード手順について説明する。図14は、第二のOSのロード手順を示すフローチャートである。   Next, the second OS loading procedure in the embodiment of the present invention will be described. FIG. 14 is a flowchart showing the loading procedure of the second OS.

まず、第二のOS用に割り当てた物理メモリ領域に、第二のOSのオブジェクトファイルを読み込む必要がある。しかし、第二のOSの物理メモリ領域は、そのままでは第一のOSから書き込むことはできないので、割り当てた物理メモリ領域を第一のOSの仮想空間に一時的にマッピングする(ステップ1401)。   First, it is necessary to read the object file of the second OS into the physical memory area allocated for the second OS. However, since the physical memory area of the second OS cannot be written from the first OS as it is, the allocated physical memory area is temporarily mapped to the virtual space of the first OS (step 1401).

ステップ1402では、マッピングした領域に、第一のOSのファイル読み込み手順を利用して、第二のOSのオブジェクトファイルを読み込む。なお、第二のOSのオブジェクトファイルの形式は、第一のOSのオブジェクトファイル形式800と同じ形式であるとする。   In step 1402, the second OS object file is read into the mapped area using the first OS file reading procedure. It is assumed that the object file format of the second OS is the same as the object file format 800 of the first OS.

次に、第二のOS用のページテーブルを作成する(ステップ1403)。このページテーブルも第二のOS用の領域に作成する。この時に、第一のOSと共有する部分について、第二のOSの空間からも参照できるように、ページテーブルを構築する。   Next, a page table for the second OS is created (step 1403). This page table is also created in the second OS area. At this time, the page table is constructed so that the portion shared with the first OS can be referred to from the space of the second OS.

共通領域203について、割り込み処理や共通データの管理を実施するデバイスドライバ(以下サポートドライバ)をロードした領域を共通領域203とする
。このデバイスドライバがロードされたアドレスは、ロードオブジェクトリスト1104より知ることができる。また、
続くステップ1404で、第二のOSのカーネルの外部参照を解決する。但し
、第二のOSが直接参照できる他のオブジェクトファイルの参照は、共通領域203に配置されている関数とデータ、つまり、サポートドライバの公開参照のみである。したがって、ここでは、サポートドライバのオブジェクトファイルのヘッダ部分に格納されている公開参照テーブル811を参照して、第二のOSのカーネルオブジェクトファイルの外部参照テーブル810の外部アドレス904を決定する。
Regarding the common area 203, an area loaded with a device driver (hereinafter referred to as a support driver) that performs interrupt processing and common data management is referred to as a common area 203. The address at which this device driver is loaded can be known from the load object list 1104. Also,
In the following step 1404, the external reference of the kernel of the second OS is resolved. However, the other object file that can be directly referred to by the second OS is only the function and data arranged in the common area 203, that is, the public reference of the support driver. Therefore, here, the external address 904 of the external reference table 810 of the kernel object file of the second OS is determined with reference to the public reference table 811 stored in the header portion of the object file of the support driver.

次に、第二のOSの公開参照のアドレスを、共通領域のデータ領域に割り当てられた外部参照アドレステーブルに書き込む。共通領域となっているサポートドライバは、第一のOSのデバイスドライバとして、第一のOSの機構にしたがって読み込むため、第二のOSの公開参照とリンクすることはできない。   Next, the public reference address of the second OS is written into the external reference address table assigned to the data area of the common area. Since the support driver that is a common area is read as a device driver of the first OS according to the mechanism of the first OS, it cannot be linked to the public reference of the second OS.

ここでは、サポートドライバのデータ領域内に必要な外部参照名と、それに対応する外部アドレスを格納するテーブルを予め用意しておく。サポートドライバの実行コードは、このテーブルを参照して第二のOSのカーネルの公開関数の呼びだし、公開データの参照を実施するように記述する。そして、第二のOSのロード時に、このテーブルの外部アドレス欄にサポートドライバの公開参照のアドレスを書き込むこととする。   Here, a table for storing necessary external reference names and corresponding external addresses in the data area of the support driver is prepared in advance. The execution code of the support driver is described by referring to this table, calling the public function of the kernel of the second OS, and referring to the public data. Then, when the second OS is loaded, the public reference address of the support driver is written in the external address column of this table.

これで、第二のOS領域の設定を終了し、第一のOSのカーネル領域にマップした、第二のOS用の物理メモリ領域のマッピングを解除する(ステップ1406)。   This completes the setting of the second OS area and cancels the mapping of the physical memory area for the second OS mapped to the kernel area of the first OS (step 1406).

次に、OSコンテクストテーブル1510の第二のOSのコンテクストと、OS識別変数1530を設定する(ステップ1407)。OSコンテクストは、実
行オペレーティングシステムを切り替えるときに参照するデータ構造で、ページテーブルアドレス値とスタックポインタの初期値とで構成する。ここでは、ページテーブルレジスタ値として第二のOSをマップするページテーブルのアドレスを、スタックポインタ値として第二のOSのカーネルスタックの初期アドレスを設定する。OS識別変数1530には、第一のOSが実行中であることを示す値を格納する。OSコンテクストテーブル1510とOS識別変数1530については後述する。
Next, the context of the second OS in the OS context table 1510 and the OS identification variable 1530 are set (step 1407). The OS context is a data structure that is referred to when the execution operating system is switched, and includes a page table address value and an initial value of the stack pointer. Here, the page table address that maps the second OS is set as the page table register value, and the kernel stack initial address of the second OS is set as the stack pointer value. The OS identification variable 1530 stores a value indicating that the first OS is being executed. The OS context table 1510 and the OS identification variable 1530 will be described later.

次に、第二のOSの初期化モジュールを実行する(ステップ1408)。これ
には、オペレーティングシステム空間の切替が伴う。オペレーティングシステムの切替えについては、別のフローチャートにより説明する。また、第二のOSの初期化モジュールは公開参照になっており、サポートドライバはそのアドレスを知ることができる。
Next, the initialization module of the second OS is executed (step 1408). This involves switching of operating system space. The switching of the operating system will be described with reference to another flowchart. The initialization module of the second OS is publicly referenced, and the support driver can know the address.

最後に、ステップ1409にて、現在の割り込みテーブル104に登録されている第一のOSの割り込みハンドラのアドレスを、割り込み識別テーブル1520のハンドラの欄1522にコピーし、割り込みテーブルレジスタ値を、サポートドライバに割り当てた割り込みテーブルのアドレスに変更する。これは、プロセッサ101の割り込みテーブルレジスタ104の変更により実施する。   Finally, in step 1409, the address of the interrupt handler of the first OS registered in the current interrupt table 104 is copied to the handler column 1522 of the interrupt identification table 1520, and the interrupt table register value is changed to the support driver. Change to the interrupt table address assigned to. This is performed by changing the interrupt table register 104 of the processor 101.

割り込みテーブルをサポートドライバ内のテーブルに変更するのは、割り込み発生時にどちらのオペレーティングシステムが実行していても、常にプロセッサ101の仮想アドレス空間に割り込みテーブルが存在している必要があるためである。割り込みテーブルに登録される割り込みハンドラも、サポートドライバ内に配置する。サポートドライバの領域は、ステップ1403にて、第二のOSの仮想空間にもマッピングして共通領域203とするので、いつでも参照できることになる。サポートドライバの割り込み処理については後述する。   The reason why the interrupt table is changed to a table in the support driver is that the interrupt table must always exist in the virtual address space of the processor 101 regardless of which operating system is executing when an interrupt occurs. Interrupt handlers registered in the interrupt table are also placed in the support driver. In step 1403, the support driver area is also mapped to the virtual space of the second OS to form the common area 203, so that it can be referred to at any time. The interrupt processing of the support driver will be described later.

また、ステップ1409では、第一のOSの割り込み管理情報も変更する。具体的には、割り込み禁止レベルに関連するデータ構造を変更するが、これについては後述する。   In step 1409, the interrupt management information of the first OS is also changed. Specifically, the data structure related to the interrupt inhibition level is changed, which will be described later.

共通領域203に格納するデータ構造について説明する。図15は、共通領域203のうちのデータ領域1500に格納するデータ構造を示した図である。図15にしたがって順に説明する。   A data structure stored in the common area 203 will be described. FIG. 15 is a diagram showing a data structure stored in the data area 1500 in the common area 203. This will be described in order according to FIG.

1510は、OSコンテクストテーブルである。OSコンテクストテーブル1510は、第一のOSと第二のOSとの間の切替えに必要なデータを保持する。   Reference numeral 1510 denotes an OS context table. The OS context table 1510 holds data necessary for switching between the first OS and the second OS.

この実施の形態では、第一のOSは第二のOSがアイドル状態の時のみ走行できるとする。この場合、第一のOS実行中のある時点で第二のOSへの切替が起こり、第二のOSの実行が終了した時点で、第一のOSに制御を戻せば良い。 In this embodiment, it is assumed that the first OS can run only when the second OS is in an idle state. In this case, switching to the second OS occurs at a certain point during execution of the first OS, and control may be returned to the first OS when the execution of the second OS is completed.

したがって、それぞれで保存しておかなければならないコンテクストは1組で良い。第一のOSのコンテクストについては、OS切替が要求された時点でのページテーブルレジスタ値1511と、スタックポインタ値1512を保存しておけば、第二のOS実行終了後に、第一のOSに制御を復帰させることができる。   Therefore, only one set of contexts must be stored for each. As for the context of the first OS, if the page table register value 1511 and the stack pointer value 1512 at the time when the OS switching is requested are saved, the control is performed by the first OS after the execution of the second OS is completed. Can be restored.

また、第一のOSから第二のOSへ制御を切り替えるときには第二のOSは動作していない。したがって、第二のOSのコンテクストは、ページテーブルアドレスもスタックポインタも固定の値でよい。第二のOSのページテーブルレジスタ値1513とスタックポインタ値1514は、第二のOSをロードするときに設定する(ステップ1407)。   Also, when switching control from the first OS to the second OS, the second OS is not operating. Accordingly, the second OS context may be a fixed value for both the page table address and the stack pointer. The page table register value 1513 and the stack pointer value 1514 of the second OS are set when the second OS is loaded (step 1407).

1520は、割り込み識別テーブルである。割り込み識別テーブル1520は
、外部割り込みの割り込み番号毎に、どちらのオペレーティングシステムが割り込みを処理するかを示す値1521と、割り込みハンドラのアドレス1522が記録されている。外部割込みが発生すると、共通領域203内の割り込みハンドラが割り込みを捕獲し、この割り込み識別テーブル1520の処理OS1521を参照して、どちらのOSに処理させるかを決定し、ハンドラ1522のアドレスへ制御を渡す。割り込み処理の詳細については、後述する。
Reference numeral 1520 denotes an interrupt identification table. In the interrupt identification table 1520, for each interrupt number of an external interrupt, a value 1521 indicating which operating system handles the interrupt and an interrupt handler address 1522 are recorded. When an external interrupt occurs, the interrupt handler in the common area 203 captures the interrupt, refers to the processing OS 1521 of the interrupt identification table 1520, determines which OS is to be processed, and controls the address of the handler 1522. hand over. Details of the interrupt processing will be described later.

1530は、実行中のオペレーティングシステムを示す値を格納しているOS識別変数である。この変数1530は、ステップ1601から始まるOS切り替え手順でOS切り替えの度に設定する。割り込み処理では、この変数1530を参照して割り込み処理手順を決定する。   Reference numeral 1530 denotes an OS identification variable that stores a value indicating the operating system being executed. This variable 1530 is set every time the OS is switched in the OS switching procedure starting from step 1601. In interrupt processing, the interrupt processing procedure is determined with reference to the variable 1530.

1540は、第二のOSの実行中に、第一のOSが管理しているデバイスの割り込みが発生したかを示す遅延割り込み状態変数である。この変数1540は、どの割り込み番号の割り込みが発生したかを記録している。OS切り替え手順は
、第二のOSの実行が終了したときにこの変数1540を検査して、割り込み処理を起動するか決定する(ステップ1608)。
Reference numeral 1540 denotes a delayed interrupt state variable indicating whether an interrupt of a device managed by the first OS has occurred during execution of the second OS. This variable 1540 records which interrupt number of the interrupt has occurred. The OS switching procedure checks this variable 1540 when the execution of the second OS is completed, and determines whether to start interrupt processing (step 1608).

オペレーティングシステムの切替え手順について説明する。図16は、本発明の実施の形態における、オペレーティングシステムの切替え手順を示すフローチャートである。この切り替え手順は、第一のOSの実行中に呼び出され、第二のOSの切り替えを実施する。   An operating system switching procedure will be described. FIG. 16 is a flowchart showing an operating system switching procedure according to the embodiment of the present invention. This switching procedure is called during execution of the first OS, and switches the second OS.

図16に示した手順は、第二のOSへの切り替え後に実行する第二のOSのモジュールのアドレスと、そのモジュールへ渡す引数を引数として受ける。第二のOSのモジュールのアドレスは、共通領域203内に設定した、外部参照アドレステーブルを参照すれば知ることができる。   The procedure shown in FIG. 16 receives the address of the module of the second OS to be executed after switching to the second OS and an argument to be passed to the module as arguments. The address of the module of the second OS can be known by referring to the external reference address table set in the common area 203.

まず、始めのステップ1601で、現在のスタックポインタ値とページテーブルレジスタ値を、OSコンテクストテーブル1510の、第一のOSのコンテクストとして保存する。ステップ1601では、現在のスタックポインタ値を1512に、現在のページテーブルレジスタ105の値を1511に保存する。   First, in the first step 1601, the current stack pointer value and page table register value are saved as the first OS context in the OS context table 1510. In step 1601, the current stack pointer value is saved in 1512 and the current page table register 105 value is saved in 1511.

他のレジスタコンテクストについて、OSコンテクストテーブル1510に保存する必要はない。必要があれば、第一のOSのスタックに保存すればよい。   Other register contexts need not be stored in the OS context table 1510. If necessary, it can be saved in the stack of the first OS.

スタックポインタとページテーブルレジスタ値を保存した後、ステップ1602にて、ページテーブルレジスタ105に第二のOSを仮想空間にマップするページテーブルのアドレスを設定する。これは、OSコンテクストテーブル1510の1513に記録されている。更に、スタックポインタを第二のOS用に設定する。これも、テーブル1600の第二のOSのスタックポインタ1514に格納されている。   After saving the stack pointer and the page table register value, in step 1602, the page table address for mapping the second OS to the virtual space is set in the page table register 105. This is recorded in 1513 of the OS context table 1510. Further, a stack pointer is set for the second OS. This is also stored in the stack pointer 1514 of the second OS in the table 1600.

次のステップ1603で、第一のOSの割り込み状態を示す遅延割り込み状態変数1540をクリアする。状態変数1540は、第二のOS実行中に発生した
、第一のOSが管理しているデバイスからの割り込みの発生状況を記録する変数である。第二のOSを実行する前に、これをクリアしておく。
In the next step 1603, the delayed interrupt state variable 1540 indicating the interrupt state of the first OS is cleared. The status variable 1540 is a variable for recording an occurrence status of an interrupt from a device managed by the first OS that occurs during execution of the second OS. Clear this before running the second OS.

そして、現在実行中のOSの示しているOS識別変数1530を、第二のOSを示す値に書き換える(ステップ1604)。スタックポインタ、ページテーブ
ルレジスタ105、および、OS識別変数1530は、常に一貫した値になっていなければならないので、ここまでのステップ1601、ないし、1604は全ての外部割り込みを禁止した状態で実行しなければならない。
Then, the OS identification variable 1530 indicated by the currently executing OS is rewritten to a value indicating the second OS (step 1604). Since the stack pointer, page table register 105, and OS identification variable 1530 must always have consistent values, steps 1601 and 1604 up to this point must be executed with all external interrupts disabled. I must.

続くステップ1605で、引数として渡されたモジュールのアドレスへ制御を移し、第二のオペレーティングシステムに制御を渡す。本発明のこの実施の形態においては、第一のOSは第二のOSが実行していない時、つまり、第二のOSがアイドル状態のときだけ実行できるとする。したがって、第二のOSの処理が終了した時に、ステップ1606へ制御が戻る。   In subsequent step 1605, control is transferred to the address of the module passed as an argument, and control is passed to the second operating system. In this embodiment of the present invention, it is assumed that the first OS can be executed only when the second OS is not executed, that is, when the second OS is in an idle state. Therefore, when the processing of the second OS is completed, control returns to step 1606.

ステップ1606では、ステップ1601でOSコンテクストテーブル15100に保存したページテーブルレジスタ値1511と、スタックポインタ値1512のそれぞれを回復する。続くステップ1607で、OS識別変数1530を第一のOSが実行中であることを示す値に変更する。この2つのステップの処理も割り込みを禁止した状態で実行しなければならない。   In step 1606, the page table register value 1511 and the stack pointer value 1512 stored in the OS context table 15100 in step 1601 are restored. In the following step 1607, the OS identification variable 1530 is changed to a value indicating that the first OS is being executed. The processing of these two steps must also be executed with interrupts disabled.

次に、第二のOSの実行中に発生した、第一のOSが管理するデバイスの外部割り込みを処理する。まず、ステップ1608では、遅延割り込み状態変数1540を検査して、割り込みが発生したかどうか検査する。発生していない場合は
、OS切替え手順は終了し、呼出元に復帰する。
Next, an external interrupt of a device managed by the first OS that occurs during execution of the second OS is processed. First, in step 1608, the delayed interrupt state variable 1540 is inspected to determine whether an interrupt has occurred. If not, the OS switching procedure ends and returns to the caller.

そうでない場合、割り込みが発生している場合は、ステップ1609を実行する。このステップでは、第二のOSの実行中に発生した割り込みを、第一のOSが管理している延期割り込み状態変数に、未処理の割り込みがある旨を記録する
。続いて、第一のOSの割り込み処理を起動する(ステップ1610)。全ての
割り込み処理が終了した時に、OS切替え手順の呼出元に復帰する。
Otherwise, if an interrupt has occurred, step 1609 is executed. In this step, an interrupt generated during the execution of the second OS is recorded in the postponed interrupt state variable managed by the first OS that there is an unprocessed interrupt. Subsequently, interrupt processing of the first OS is started (step 1610). When all the interrupt processes are completed, the process returns to the caller of the OS switching procedure.

本発明の実施の形態における割り込み処理について説明する。図17は、本実施形態の割り込み処理手順を示すフローチャートである。この手順を実行するモジュールは、割り込みハンドラとしてプロセッサの割り込みテーブル107に登録される。さらに、この割り込みハンドラは、両方のオペレーティングシステムから参照できる共通領域203に配置する。   An interrupt process in the embodiment of the present invention will be described. FIG. 17 is a flowchart showing the interrupt processing procedure of this embodiment. A module that executes this procedure is registered in the interrupt table 107 of the processor as an interrupt handler. Further, this interrupt handler is arranged in the common area 203 that can be referred to by both operating systems.

外部割り込みが発生して、プロセッサ101により割り込みハンドラが起動されると、割り込みハンドラは割り込み要因を検査し、割り込みを発生したデバイスが第一のOSが管理するデバイスか、第二のOSが管理するデバイスか判定する(ステップ1701)。この判定は、割り込み識別テーブル1520を割り込
み番号をインデックスとしてOS欄1521を参照することより実施する。第一のOSのデバイスである場合はステップ1702へ、第二のOSのデバイスの場合はステップ1705へ進む。例えば、図15でいえば、割り込み番号が1であれば第一のOSの割り込みであり、割り込み番号4であれば第二のOSの割り込みとなる。
When an external interrupt occurs and an interrupt handler is activated by the processor 101, the interrupt handler checks the cause of the interrupt, and the device that generated the interrupt is a device managed by the first OS or managed by the second OS. It is determined whether it is a device (step 1701). This determination is performed by referring to the OS column 1521 in the interrupt identification table 1520 using the interrupt number as an index. If it is the device of the first OS, the process proceeds to step 1702, and if it is the device of the second OS, the process proceeds to step 1705. For example, in FIG. 15, if the interrupt number is 1, it is an interrupt of the first OS, and if the interrupt number is 4, it is an interrupt of the second OS.

割り込みが第一のOSのデバイスの割り込みである場合、ステップ1702を実行する。ステップ1702では、割り込み発生時に実行していたOSを判定する。この判定は、OS識別変数1530を参照して実施する。実行中のOSが第一のOSの場合はステップ1703へ、第二のOSの場合はステップ1704へ進む。   If the interrupt is a first OS device interrupt, step 1702 is executed. In step 1702, the OS executed when the interrupt occurs is determined. This determination is performed with reference to the OS identification variable 1530. If the OS being executed is the first OS, the process proceeds to step 1703, and if it is the second OS, the process proceeds to step 1704.

ステップ1703から始まる処理は、第一のOSが管理しているデバイスが、第一のOSを実行中に割り込みを発生した場合の処理である。ステップ1703では、あたかもステップ1701から始まる処理が存在せず、第一のOSの割り込みハンドラが、直接プロセッサ101から制御を受けたように見えるようにコンテクストを設定する。ここでコンテクストとは、スタックの内容やレジスタの内容を示す。そして、第一のOSの割り込みハンドラへ制御を渡す。第一のOSの割り込みハンドラのアドレスは、割り込み識別テーブル1520のハンドラ欄1522に格納されている。例えば、割り込み番号1の割り込みであるならば、1をインデックスとして割り込み識別テーブルを参照して、ハンドラアドレスを求める。   The process starting from step 1703 is a process performed when a device managed by the first OS generates an interrupt while the first OS is being executed. In step 1703, the context is set so that there is no processing starting from step 1701, and the interrupt handler of the first OS seems to be directly controlled by the processor 101. Here, the context indicates the contents of the stack and the contents of the register. Then, control is passed to the interrupt handler of the first OS. The address of the interrupt handler of the first OS is stored in the handler column 1522 of the interrupt identification table 1520. For example, if the interrupt is interrupt number 1, the handler address is obtained by referring to the interrupt identification table using 1 as an index.

この場合、ステップ1701から始まる手順には制御は戻らず、第一のOSが処理を続ける。   In this case, control does not return to the procedure starting from step 1701, and the first OS continues processing.

第一のOSが管理しているデバイスが、第二のOSを実行中に割り込みを発生した場合、ステップ1704を実行する。ステップ1704では、遅延割り込み状態変数1540に割り込みを発生したデバイスの割り込み番号を記録する。割り込みハンドラの処理はこれで終了する。この場合の割り込みの処理は、実行OSが第一のOSに切り替わったときに実行される(ステップ1608)。   If the device managed by the first OS generates an interrupt while executing the second OS, step 1704 is executed. In step 1704, the interrupt number of the device that generated the interrupt is recorded in the delayed interrupt status variable 1540. The interrupt handler process ends here. The interrupt process in this case is executed when the execution OS is switched to the first OS (step 1608).

発生した外部割込みが、第二のOSが管理するデバイスの割り込みだった場合
、ステップ1705へ進み、どちらのOSが実行中であるか検査する。ここでも
、OS識別変数1530によって実行中のOSを判定する。第一のOSが実行中の場合は、ステップ1706へ、第二のOSが実行中の場合はステップ1711へ進む。
If the generated external interrupt is an interrupt of a device managed by the second OS, the process proceeds to step 1705 to check which OS is being executed. Again, the OS being executed is determined by the OS identification variable 1530. If the first OS is being executed, the process proceeds to step 1706, and if the second OS is being executed, the process proceeds to step 1711.

第二のOSが管理するデバイスの割り込みが、第二のOSの実行中に発生した場合、ステップ1711を実行する。ステップ1711は、第二のOSの割り込みハンドラを起動する。第二のOSの割り込みハンドラのアドレスは、割り込み識別テーブル1520のハンドラ欄1522に記録されている。第二のOSの割り込みハンドラ処理が終了して制御が戻ってきたら、この割り込みハンドラも終了し、割り込まれた時のコンテクストを回復して制御を元に戻す。   If an interrupt of a device managed by the second OS occurs during execution of the second OS, step 1711 is executed. Step 1711 starts the interrupt handler of the second OS. The address of the interrupt handler of the second OS is recorded in the handler column 1522 of the interrupt identification table 1520. When the interrupt handler processing of the second OS is finished and the control is returned, this interrupt handler is also finished, the context at the time of interruption is restored, and the control is restored.

第二のOSが管理するデバイスの外部割込みが、第一のOSの実行中に発生した場合、ステップ1706を実行する。この場合は、第一のOSの実行よりも第二のOSの処理を優先して実行する。   If an external interrupt of a device managed by the second OS occurs during execution of the first OS, step 1706 is executed. In this case, the process of the second OS is executed with priority over the execution of the first OS.

まず、ステップ1706では、コンテクストを保存する。ここでのコンテクストとは、割り込み処理が終了した後で第一のOSに戻すときに、割り込まれたときの状態を回復するのに必要なスタックの内容とレジスタの内容を示す。このコンテクストは、第一のOSのカーネルのスタックに保存する。   First, in step 1706, the context is saved. The context here indicates the contents of the stack and the contents of the registers necessary to recover the state when interrupted when returning to the first OS after completion of the interrupt processing. This context is stored in the kernel stack of the first OS.

続いて、実行OSの切り替えと第二のOSの割り込み処理の起動を実行する(
ステップ1707、1708)。これは、ステップ1601から始まる手順によ
り実行する。
Subsequently, the execution OS is switched and the interrupt processing of the second OS is started (
Steps 1707, 1708). This is performed according to the procedure starting from step 1601.

第二のOSの処理が終了した時点で、第一のOSへの切り替えを実行し(ステップ1709)、割り込み時のコンテクストを回復し(ステップ1710)、第
一のOSの処理を再開する。ステップ1709の処理は、必ずしも、ステップ1701から始まる処理と同一のモジュール内で実行されなくてもよい。第一のOSへの切り替えにより処理はこのモジュールへ復帰する。
When the processing of the second OS is completed, switching to the first OS is executed (step 1709), the context at the time of interruption is recovered (step 1710), and the processing of the first OS is resumed. The processing in step 1709 need not necessarily be executed in the same module as the processing starting from step 1701. The processing returns to this module by switching to the first OS.

2つのオペレーティングシステムで共有しているクロック割り込みの処理について説明する。クロック割り込みはは、共通領域内の割り込みハンドラにより捕獲する。この割り込みハンドラでは、まず、第二のOSのクロック割り込み用の割り込みハンドラを実行する。第二のOSの割り込みハンドラはハンドラ2欄1523に格納されている。第二のOSの割り込みハンドラの実行が終了したら、図17のステップ1702から始まる処理により第一のOSの割り込み処理を実行する。第一の割り込みハンドラのアドレスはハンドラ欄1522に格納されている。   The processing of clock interrupt shared by the two operating systems will be described. A clock interrupt is captured by an interrupt handler in the common area. In this interrupt handler, first, an interrupt handler for clock interrupt of the second OS is executed. The interrupt handler of the second OS is stored in the handler 2 column 1523. When the execution of the interrupt handler of the second OS is completed, the interrupt process of the first OS is executed by the process starting from step 1702 in FIG. The address of the first interrupt handler is stored in the handler column 1522.

次に、第一のOSの割り込み制御部分について説明する。これは、第一のOSの割り込み制御によって、誤って第二のOSが管理するデバイスの割り込みが禁止にされてしまわないようにするための処理である。   Next, the interrupt control part of the first OS will be described. This is a process for preventing the interrupt of the device managed by the second OS from being erroneously prohibited by the interrupt control of the first OS.

第一のOSは、割り込み禁止レベルにより割り込みを制御しているとする。割り込み禁止レベルは、オペレーティングシステムのカーネル内の割り込み処理の延長で動作する部分と、そうでない部分との間の排他制御を実現するために必要となる機構である。   Assume that the first OS controls interrupts according to the interrupt prohibition level. The interrupt prohibition level is a mechanism necessary for realizing exclusive control between a part that operates as an extension of interrupt processing in the kernel of the operating system and a part that does not.

第一のOSは、割り込み制御装置112をプログラムすることで割り込み禁止レベルを実現する。つまり、割り込み制御装置112の割り込みマスクレジスタ502をプログラムして、選択的に外部割り込みをマスクにする。第一のOSは第二のOSについて全く知らないので、第一のOSが割り込み禁止レベルを変更したときに、第二のOSのデバイスの割り込みがマスクされてしまう可能性がある。これを防ぐために、第一のOSの割り込み制御部分を変更する。   The first OS realizes the interrupt prohibition level by programming the interrupt control device 112. That is, the interrupt mask register 502 of the interrupt controller 112 is programmed to selectively mask external interrupts. Since the first OS does not know at all about the second OS, there is a possibility that when the first OS changes the interrupt inhibition level, the interrupt of the device of the second OS is masked. In order to prevent this, the interrupt control part of the first OS is changed.

図18は、割り込み禁止レベルを実現する第一のOSが管理しているデータ構造を示している。1800は、割り込み禁止レベルテーブルである。それぞれの割り込みレベルは数値で表現され、それぞれの割り込み禁止レベルについて、何番の外部割り込みをマスクするかを示している。テーブル1800のチェックのつけられているところは割り込みをマスクする設定することを示している。例えば、割り込み禁止テーブル1800では、割り込み禁止レベル0では、どの割り込みもマスクされないことを示している。また、割り込み禁止レベル3では、割り込み番号3、ないし、5の割り込みを割り込み制御装置112によりマスクすることを示している。割り込み禁止レベル5では、すべての割り込みが割り込み制御装置112によりマスクされる。   FIG. 18 shows a data structure managed by the first OS that realizes the interrupt prohibition level. Reference numeral 1800 denotes an interrupt prohibition level table. Each interrupt level is represented by a numerical value and indicates the number of external interrupts to be masked for each interrupt disable level. In the table 1800, a check mark indicates that an interrupt is set to be masked. For example, the interrupt prohibition table 1800 indicates that no interrupt is masked at interrupt prohibition level 0. Further, in the interrupt prohibition level 3, the interrupt control device 112 masks interrupts of interrupt numbers 3 to 5. At interrupt inhibition level 5, all interrupts are masked by the interrupt controller 112.

本発明では、第二のOSの初期化時に、この割り込み禁止レベルテーブル1800を変更する(ステップ1409)。ステップ1409では、第二のOSが管
理するデバイスが発生する割り込みについて、第一のOSがそれらの割り込みをマスクしないように割り込み禁止レベルテーブルを変更する。具体的には、割り込み識別テーブル1520のOS欄1521を参照して、第二のOSが管理する割り込み番号について、割り込み禁止レベルテーブル1800のチェックをクリアする。
In the present invention, the interrupt prohibition level table 1800 is changed when the second OS is initialized (step 1409). In step 1409, for the interrupt generated by the device managed by the second OS, the interrupt prohibition level table is changed so that the first OS does not mask those interrupts. Specifically, referring to the OS column 1521 of the interrupt identification table 1520, the check of the interrupt prohibition level table 1800 is cleared for the interrupt number managed by the second OS.

この例では、割り込み番号4と5が第二のOSが処理する割り込みとなっている。したがって、割り込み禁止レベルテーブル1800のすべての割り込み禁止レベルの、割り込み番号4と5の欄(1801と1802のすべて)をクリアする。   In this example, interrupt numbers 4 and 5 are interrupts processed by the second OS. Accordingly, the columns of interrupt numbers 4 and 5 (all of 1801 and 1802) of all interrupt prohibition levels in the interrupt prohibition level table 1800 are cleared.

これにより、第一のOSが割り込み禁止レベルを変更しても、第二のOSが管理するデバイスの割り込みはマスクされなくなる。   Thereby, even if the first OS changes the interrupt prohibition level, the interrupt of the device managed by the second OS is not masked.

以上により、一台の計算機で2つのオペレーティングシステムを同時に動作させることが可能になる。   As described above, two operating systems can be operated simultaneously on one computer.

本発明によれば、第一のOSに変更を加えて2つのオペレーティングシステムを同時に動作させる場合、変更箇所がオペレーティングシステムカーネルの初期化部分、デバイス資源予約、および、割り込み禁止制御部分に限定されるため、簡単に2つのオペレーティングシステムを動作させることが可能になる。   According to the present invention, when a change is made to the first OS and two operating systems are operated simultaneously, the changed part is limited to the initialization part of the operating system kernel, the device resource reservation, and the interrupt prohibition control part. Therefore, it becomes possible to easily operate two operating systems.

仮想計算機による方式では、物理メモリやI/Oチャネルを仮想化するために特権命令のエミュレーションが必要になるが、これをソフトウェアで実現するとオーバーヘッドが大きくなり問題である。仮想計算機方式では、このオーバーヘッド削減のために、特殊なハードウェアを持つことが多くなっている。しかし、本発明では、それぞれのデバイスについて、デバイスを管理するオペレーティングシステムを予め決定し、さらに、物理メモリについて利用できる範囲を初期化時に決定することにより、オペレーティングシステム同士が互いに干渉しないようにして、仮想計算機でのような複雑なソフトウェアによる制御を廃止し、高速化のためのハードウェアも不要とした。   The virtual computer method requires emulation of privileged instructions in order to virtualize physical memory and I / O channels. However, if this is realized by software, there is a problem in that overhead increases. Virtual computer systems often have special hardware to reduce this overhead. However, in the present invention, for each device, the operating system that manages the device is determined in advance, and further, by determining the range that can be used for the physical memory at the time of initialization, the operating systems do not interfere with each other, Control by complicated software such as a virtual machine has been abolished, and hardware for speeding up is not necessary.

本発明によれば、第一のOSの機能を補完するOSを容易に追加することが可能である。従来技術においても、第一のOSの構成要素として、例えばデバイスドライバとして新たな機能をカーネルに追加することは可能である。しかし、第一のOSの構成要素としてしまったのでは、その構成要素は第一のOSの管理下でしか動作できない問題がある。つまり、第一のOSが障害により停止してしまったとき、追加した機能モジュールも動作することはできないのである。   According to the present invention, it is possible to easily add an OS that complements the function of the first OS. Also in the prior art, it is possible to add a new function to the kernel as a component of the first OS, for example, as a device driver. However, if it is a component of the first OS, there is a problem that the component can operate only under the management of the first OS. In other words, when the first OS is stopped due to a failure, the added function module cannot be operated.

本発明によれば、新たな機能を実現する構成要素を、第一のOSと独立して構成することができ、第一のOSが停止してしまったとしても、その機能モジュールだけは継続して動作することが可能になる。この実施形態については、後述する。信頼性を要求される機能モジュールを第二のOSとして組み込めば、第一のOSが停止してしまったときでも、何らかの回復処理を実現させるといったことが可能になる。このように本発明は、計算機システムの高信頼化を実現する手段となり得る発明である。   According to the present invention, a component that realizes a new function can be configured independently of the first OS, and even if the first OS stops, only the function module continues. It becomes possible to operate. This embodiment will be described later. If a functional module that requires reliability is incorporated as the second OS, even if the first OS stops, it is possible to realize some kind of recovery processing. Thus, the present invention is an invention that can be a means for realizing high reliability of a computer system.

また、この実施形態では、第二のOSが第一のOSに優先して処理を実行するとして説明した。第一のOSは、第二のOSがアイドル時にしか動作できないことや、第二のOSの割り込みはいつでもすぐに処理することにより、第二のOSを優先させている。これにより、第一のOSが実時間処理に適合していなくても
、第二のOSとして実時間処理に向くOSを導入すれば、第一のOSの特徴を活かしたままで、実時間処理性能に優れた計算機システムを構築することが可能になる。例えば、第一のOSが優れたGUI(Graphical UserInterface)を持って
いるが実時間処理性能に欠ける場合、第一のOSよりも優先して動作する実時間処理向きオペレーティングシステムを第二のOSとして導入してやることで、GUIにも優れ、実時間処理にも優れた計算機システムの構築ができる。
In this embodiment, the second OS has been described as executing processing in preference to the first OS. The first OS gives priority to the second OS by being able to operate only when the second OS is idle, and by processing interrupts of the second OS immediately at any time. As a result, even if the first OS is not suitable for real-time processing, if an OS suitable for real-time processing is introduced as the second OS, the real-time processing performance is maintained while taking advantage of the features of the first OS. It is possible to construct a computer system that is excellent in For example, if the first OS has an excellent GUI (Graphical User Interface) but lacks real-time processing performance, the second OS is the operating system for real-time processing that operates with priority over the first OS. By introducing it, it is possible to construct a computer system that is excellent in GUI and excellent in real-time processing.

このように、本発明は、特別なハードウェアの支援なしで、第一のOSに欠けている機能を容易に導入する方法であり、さらに、その機能は第一のOSとは全く独立して動作させることを可能にする。   As described above, the present invention is a method for easily introducing a function lacking in the first OS without assistance of special hardware, and the function is completely independent of the first OS. To make it work.

次に、本発明の第二の実施形態について説明する。第二の実施形態は、これまで説明してきた実施の形態の拡張である。この実施の形態では、第一のOSが障害により停止しても動作しつづける第二のOSの導入が実現可能である。   Next, a second embodiment of the present invention will be described. The second embodiment is an extension of the embodiment described so far. In this embodiment, it is possible to introduce a second OS that continues to operate even if the first OS stops due to a failure.

第一の実施形態に加えて、第一OS実行状態変数1550を共通領域に置く。   In addition to the first embodiment, the first OS execution state variable 1550 is placed in the common area.

この変数1550は、第一のOSが通常動作しているか、そうでないかを示す値を格納している。この変数1550は、第二のOSをロードする時の処理で、通常動作を示す値に初期化する。 The variable 1550 stores a value indicating whether the first OS is operating normally or not. This variable 1550 is initialized to a value indicating normal operation in the process when loading the second OS.

図19は、本発明の第二の実施の形態の第一のOSの停止処理手順を示すフローチャートである。この処理手順は、第一のOSの停止処理を実行するモジュールを変更して実装する。   FIG. 19 is a flowchart illustrating the first OS stop processing procedure according to the second embodiment of this invention. This processing procedure is implemented by changing the module that executes the first OS stop process.

まず、第一のOSの停止処理モジュールに制御がきたら、第一OS実行状態変数1550を第一のOSが停止していることを示す値に設定する(ステップ1901)。その後、第一のOSの停止処理を実行する(ステップ1902)。最後
に、第一のOSへの割り込みをマスクして、第二のOSが処理するデバイスの割り込みを許可して(ステップ1903)、割り込みが発生するまで待つ(ステッ
プ1904)。割り込みが発生すると、実行OSの切り替えられ、第二のOSが
処理を実行する。
First, when control is given to the stop processing module of the first OS, the first OS execution state variable 1550 is set to a value indicating that the first OS is stopped (step 1901). Thereafter, stop processing of the first OS is executed (step 1902). Finally, the interrupt to the first OS is masked, the interrupt of the device processed by the second OS is permitted (step 1903), and the process waits until an interrupt occurs (step 1904). When an interrupt occurs, the execution OS is switched, and the second OS executes the process.

更に、実行OS切り替え手順を変更する。第一の実施の形態では、ステップ1601から始まる手順により実行OSの切り替えを実行した。第二の実施の形態では、この手順で第二のOSのモジュールを実行した後、つまり、ステップ1605の後で、第一OS実行状態変数1550を検査する。ここで、第一OS実行状態変数1550が、第一のOSが停止していることを示す値になっているならば、ステップ1606以降の処理を実行せずに、割り込み待ちを実行する。   Further, the execution OS switching procedure is changed. In the first embodiment, the execution OS is switched according to the procedure starting from step 1601. In the second embodiment, after the second OS module is executed in this procedure, that is, after step 1605, the first OS execution state variable 1550 is checked. Here, if the first OS execution state variable 1550 is a value indicating that the first OS is stopped, the process of step 1606 and the subsequent steps is not executed, and an interrupt wait is executed.

以上のデータ構造と手順により、第一のOSが停止しても第二のOSの実行を継続することが可能になる。この実施形態では、第一のOSの停止処理モジュールを変更するとしたが、第一のOSがエラーにより停止したときの停止処理過程で実行されるモジュールを変更して、第一のOSの停止を検出して割り込み待ちをしても同様の効果を実現できる。   With the above data structure and procedure, even if the first OS is stopped, it is possible to continue the execution of the second OS. In this embodiment, the stop processing module of the first OS is changed. However, the module executed in the stop processing process when the first OS stops due to an error is changed to stop the first OS. The same effect can be realized by detecting and waiting for an interrupt.

本発明の第3の実施の形態について説明する。これまで説明してきた実施の形態では、カーネル本体を変更することにより2つのOSの同時実行等を実現してきた。第3の実施の形態では、カーネル本体を変更せずに、前記の実施の形態の機能を実現する。   A third embodiment of the present invention will be described. In the embodiments described so far, the simultaneous execution of two OSs and the like have been realized by changing the kernel body. In the third embodiment, the functions of the above-described embodiments are realized without changing the kernel body.

様々の種類のハードウェアをサポートするオペレーティングシステムでは、ハードウェア依存の処理がカーネル本体からは切り離されて、別のオブジェクトファイルとして構成されている場合がある。例えば、割り込み制御装置112が計算機により異なる場合や、バス109の構成が異なってI/Oアドレス空間が計算機により異なる場合である。   In an operating system that supports various types of hardware, hardware-dependent processing may be separated from the kernel body and configured as a separate object file. For example, there are cases where the interrupt control device 112 differs from computer to computer, or the configuration of the bus 109 is different and the I / O address space varies from computer to computer.

図20は、このようなオペレーティングシステム、つまり、割り込み制御装置やバスなどの基盤となるハードウェアの違いを吸収するためのコードやデータがカーネル本体とは分離されたオブジェクトファイルにある場合の、カーネル領域の様子を示した図である。   FIG. 20 shows the kernel in the case where the code and data for absorbing the difference in hardware such as an operating system, that is, an interrupt control device and a bus, are in an object file separated from the kernel body. It is the figure which showed the mode of the area | region.

カーネル領域2000には、プロセッサ101のカーネルモードで実行されるモジュールや、オペレーティングシステムが管理するデータ構造がある。カーネル本体2001は、メモリ管理、プロセススケジューリング、および、ファイルシステムなどの、ハードウェア非依存の処理を実施するコードやデータを持っている。カーネル本体2001とハードウェア依存部2002の間には、ハードウェア依存部2002の提供しなければならないモジュールと、カーネル本体2001が提供するモジュールに関する規約が定められている。ハードウェア依存部2002をこの規約にあわせて構築すれば、様々な計算機上でこのオペレーティングシステムを動作させることが可能になる。   The kernel area 2000 includes modules executed in the kernel mode of the processor 101 and data structures managed by the operating system. The kernel main body 2001 has code and data for performing hardware-independent processing such as memory management, process scheduling, and file system. Between the kernel main body 2001 and the hardware dependent unit 2002, a rule regarding the modules that the hardware dependent unit 2002 must provide and the modules provided by the kernel main body 2001 are defined. If the hardware-dependent unit 2002 is constructed in accordance with this rule, this operating system can be operated on various computers.

この規約に従ったハードウェア依存の処理は、別オブジェクトファイルに分離され、カーネル本体とは切り離された領域2002にマップされている。カーネル本体2001とハードウェア依存部2002は、第一の実施の形態の場合と同様の外部参照機構により互いの公開モジュールを呼び出すことができ、見かけ上は1つのカーネルとして機能する。   The hardware-dependent processing according to this rule is separated into separate object files and mapped to an area 2002 separated from the kernel body. The kernel main body 2001 and the hardware dependent unit 2002 can call each other's public modules by the same external reference mechanism as in the first embodiment, and apparently function as one kernel.

このような場合は、カーネル本体のオブジェクトファイルを変更することなく
、分離されたハードウェア依存の処理を実施するオブジェクトファイルの変更により第一の実施の形態、および、第二の実施の形態と同様の効果を得ることが可能である。
In such a case, it is the same as the first embodiment and the second embodiment by changing the object file that performs the separated hardware-dependent processing without changing the object file of the kernel body. It is possible to obtain the effect.

具体的には、分離されたオブジェクトファイルの処理において、物理メモリの割り当てが可能であること、割り込みレベル管理処理を変更できること、および
、I/O資源の予約ができることが必要である。さらに、このオブジェクトファイル中にステップ1701から始まる割り込みハンドラと割り込みテーブル107を配置し、プロセッサの割り込みテーブルレジスタ104に登録する。そして
、この分離されたオブジェクトファイルを共通領域203として第二のOSからも参照できるようにする。以上により、本発明の第一の実施の形態と同様の効果を得ることができる。
Specifically, in the processing of the separated object file, it is necessary that physical memory can be allocated, interrupt level management processing can be changed, and I / O resources can be reserved. Further, an interrupt handler starting from step 1701 and the interrupt table 107 are arranged in this object file and registered in the interrupt table register 104 of the processor. Then, the separated object file can be referred to from the second OS as the common area 203. As described above, the same effects as those of the first embodiment of the present invention can be obtained.

さらに、ハードウェア依存オブジェクトファイルが、第一のOSが停止したときに実行されるモジュールを持つ規定になっていれば、そのモジュールを変更すれば第一のOSの停止を検出でき、本発明の第二の実施の形態と同様の効果を得ることができる。   Furthermore, if the hardware-dependent object file is defined to have a module that is executed when the first OS is stopped, the stop of the first OS can be detected by changing the module. The same effect as in the second embodiment can be obtained.

この実施の形態においては、カーネル本体を変更する必要がない。これにより
、変更しなければならない部分が更に限定できる、カーネル本体を変更するよりも容易に実施可能となる。
In this embodiment, there is no need to change the kernel body. As a result, the parts that must be changed can be further limited, and can be implemented more easily than changing the kernel body.

次に、本発明の第4の実施の形態について説明する。これまで説明してきた実施の形態では、共通領域203に配置していたのはサポートドライバや、ハードウェア依存オブジェクトファイルなどのオブジェクトファイルであった。しかし
、本当に共通領域203に配置しなければならないモジュールとデータは、割り込みテーブル107、ステップ1701から始まる割り込みハンドラ、ステップ1601から始まるOS切り替え手順、および、図15に示したデータ構造分だけである。特に、第3の実施例でのようにハードウェア依存部の処理を実施するオブジェクトファイル全体を共通領域203として第二のOSからも参照できるようにしてしまうと、第二のOSが誤って第一のOSのデータ構造にアクセスしてしまう可能性が高くなり問題である。
Next, a fourth embodiment of the present invention will be described. In the embodiments described so far, the object files such as the support driver and the hardware dependent object file are arranged in the common area 203. However, the only modules and data that must be placed in the common area 203 are the interrupt table 107, the interrupt handler starting from step 1701, the OS switching procedure starting from step 1601, and the data structure shown in FIG. In particular, as in the third embodiment, if the entire object file that performs the processing of the hardware-dependent unit can be referred to from the second OS as the common area 203, the second OS mistakenly becomes the first OS. This increases the possibility of accessing the data structure of one OS.

第4の実施の形態では、オブジェクトファイルの特定のセクションのみを共通領域203として第二のOSに見せる方法を提供する。この実施の形態では、オブジェクトファイルを生成するコンパイラが、命令コードとデータを配置するセクションをプログラム上で指定できる機能を持っている必要がある。   In the fourth embodiment, a method is provided in which only a specific section of an object file is shown as a common area 203 to the second OS. In this embodiment, a compiler that generates an object file needs to have a function that can specify a section in which an instruction code and data are arranged on a program.

通常のオブジェクトファイルは、セクションとして命令コードを含むテキストセクションと、データを含むデータセクションを持っている。これに加えて、コンパイラの機能により共通領域203のためのセクションを追加する。さらに、オブジェクトファイルのヘッダ部分に格納されているセクションデータ809を参照して共通領域セクションのアドレス範囲を決定し、その部分だけを第二のOSに見せるようにページテーブルを構築すればよい。   A normal object file has a text section including an instruction code as a section and a data section including data. In addition to this, a section for the common area 203 is added by the function of the compiler. Furthermore, it is only necessary to determine the address range of the common area section with reference to the section data 809 stored in the header portion of the object file, and to construct the page table so that only the portion is shown to the second OS.

ハードウェア依存処理をするモジュールを含むオブジェクトファイルを変更する場合を例として説明する。変更個所のうち初期化に関連する部分、例えば、物理メモリの割り当て、I/O資源の予約、割り込みレベル管理部分の変更は第二のOSに見せる必要はない。第二のOSからも参照できなければならないのは、割り込みテーブル107、ステップ1701から始まる割り込みハンドラ、ステップ1601から始まるOS切り替え手順、および、図15に示したデータ構造分だけである。これらを、共通領域セクションに配置するようにプログラムを記述し、コンパイラの機能により共通領域セクションを生成する。   A case where an object file including a module that performs hardware-dependent processing is changed will be described as an example. It is not necessary to show the second OS the part related to the initialization of the changed part, for example, the allocation of the physical memory, the reservation of the I / O resource, and the change of the interrupt level management part. Only the interrupt table 107, the interrupt handler starting from step 1701, the OS switching procedure starting from step 1601, and the data structure shown in FIG. 15 need to be referenced from the second OS. A program is described so that these are arranged in the common area section, and the common area section is generated by the function of the compiler.

図21は、生成されたオブジェクトファイルの構成を示している。2100は
、生成されたオブジェクトファイルを示す。オブジェクトファイル2100のヘッダ部の2101、ないし、2104は、オブジェクトファイル2100に含まれているセクションのデータを記述している。このうち2103と2104が、共通領域203用に新規に作成したセクションを表現するセクションデータである。対応するセクションは2107と2108である。セクションデータ2103と2104の内容にしたがってセクション2107と2108のアドレスを求め、それらの領域だけを第二のOSのカーネル領域にマップするように第二のOSのページテーブルを構成すれば、ハードウェア依存オブジェクトファイル2100の他の部分を第二のOSから隠すことができる。
FIG. 21 shows the structure of the generated object file. Reference numeral 2100 denotes a generated object file. The header part 2101 to 2104 of the object file 2100 describes section data included in the object file 2100. Of these, 2103 and 2104 are section data representing sections newly created for the common area 203. The corresponding sections are 2107 and 2108. If the addresses of the sections 2107 and 2108 are obtained according to the contents of the section data 2103 and 2104, and the page table of the second OS is configured so that only those areas are mapped to the kernel area of the second OS, the hardware dependence Other parts of the object file 2100 can be hidden from the second OS.

第4の実施の形態によれば、これまで説明した実施の形態よりも、更にOS間の独立性を高めることができ、OS間の干渉の少ない安全な計算機システムの構築が可能になる。   According to the fourth embodiment, the independence between OSs can be further increased compared to the embodiments described so far, and a safe computer system with less interference between OSs can be constructed.

次に、本発明の第5の実施の形態について説明する。第5の実施の形態では、マルチプロセッサ構成の計算機で第二のOSを導入が可能になる。   Next, a fifth embodiment of the present invention will be described. In the fifth embodiment, the second OS can be introduced by a multiprocessor computer.

図22は、本発明の第5の実施の形態での計算機装置を示す図である。2200は計算機装置である。計算機2200は2つのプロセッサ2201と2202
、および、主記憶装置2203を持っている。また、第一の実施の形態と同様に
、計算機起動プログラムを格納している記憶装置2204を持っている。
FIG. 22 is a diagram illustrating a computer apparatus according to the fifth embodiment of this invention. Reference numeral 2200 denotes a computer apparatus. A computer 2200 includes two processors 2201 and 2202.
And a main memory 2203. Further, as in the first embodiment, the storage device 2204 that stores the computer activation program is provided.

プロセッサ2201と2202について、プロセッサを起動したときと、初期化のための割り込みを受けた時とでは、制御を渡す物理アドレスが異なるものとする。   With respect to the processors 2201 and 2202, the physical addresses to which control is transferred differ when the processors are activated and when an interrupt for initialization is received.

記憶装置2204に格納されている初期化割り込み処理プログラムは、予め定めた物理アドレスに格納されている値を物理アドレスとして、そのアドレスに制御を渡す。   The initialization interrupt processing program stored in the storage device 2204 uses the value stored in a predetermined physical address as a physical address, and passes control to that address.

また、バス2209を介して磁気ディスク装置2206、クロック割り込み生成装置2207、および、入出力装置2207等のデバイスが接続している。割り込みを発生するデバイスは、割り込み制御装置2205に接続し、更に、割り込みバス2211を介してプロセッサ2201と2202に接続している。各プロセッサは他のプロセッサに割り込みを送ることができるとする。   Also, devices such as a magnetic disk device 2206, a clock interrupt generation device 2207, and an input / output device 2207 are connected via a bus 2209. A device that generates an interrupt is connected to an interrupt control device 2205 and further connected to processors 2201 and 2202 via an interrupt bus 2211. Assume that each processor can send an interrupt to other processors.

割り込み制御装置2205について説明する。割り込み制御装置2205は、マルチプロセッサ構成のための機能を持っている。割り込み制御装置2205は
、第一の実施の形態での割り込み制御装置112の割り込みマスク機能に加えて
、それぞれのデバイスからの割り込みをどのプロセッサ、あるいは、プロセッサ群に通知するかを指定する機能を持っている。
The interrupt control device 2205 will be described. The interrupt control device 2205 has a function for a multiprocessor configuration. In addition to the interrupt mask function of the interrupt control device 112 in the first embodiment, the interrupt control device 2205 has a function to specify which processor or processor group is notified of an interrupt from each device. ing.

図23は、割り込み制御装置2205の構成を示す図である。選択装置2301と割り込みマスクレジスタ2302の働きは、第1の実施の形態と同じである
。それらに加えて、割り込み制御装置2205は、割り込み配送テーブル2310と、割り込み送信装置2305を持っている。
FIG. 23 is a diagram illustrating a configuration of the interrupt control device 2205. The functions of the selection device 2301 and the interrupt mask register 2302 are the same as those in the first embodiment. In addition to these, the interrupt control device 2205 has an interrupt delivery table 2310 and an interrupt transmission device 2305.

割り込み配送テーブル2310は、割り込み制御装置2205に接続されたそれぞれのデバイスについて、どのプロセッサ、あるいは、プロセッサ群に割り込みを通知するかを示す値2311と、通知するときの割り込み番号2312を記録している。割り込み配送テーブル2302は、I/O命令により変更することができ、自由に設定可能である。   The interrupt delivery table 2310 records, for each device connected to the interrupt control device 2205, a value 2311 indicating which processor or processor group is notified of an interrupt, and an interrupt number 2312 at the time of notification. . The interrupt delivery table 2302 can be changed by an I / O instruction and can be set freely.

図23の例では、割り込み0と1はCPU0に、割り込み2はCPU1に配送するように設定されている。   In the example of FIG. 23, interrupts 0 and 1 are set to be delivered to CPU 0 and interrupt 2 is set to be delivered to CPU 1.

割り込み送信装置2305は、選択装置2301からの信号を受けて、割り込み配送テーブル2310を参照して割り込み通知先と割り込み番号を決定する。   The interrupt transmission device 2305 receives a signal from the selection device 2301 and refers to the interrupt delivery table 2310 to determine an interrupt notification destination and an interrupt number.

そして、通知先と割り込み番号を表わす信号を割り込みバス2211へ送信する。 Then, a signal indicating the notification destination and the interrupt number is transmitted to the interrupt bus 2211.

計算機2200は、起動するとプロセッサ2201だけが動作を開始するように構成されており、プロセッサ2201が記憶装置2204に格納されている起動プログラムを実行する。起動プログラムは、第一の実施の形態の場合と同様に磁気ディスク装置2206に格納されているカーネルローダを主記憶2203に読み込み実行する。カーネルローダは、パラメータテーブル1100を作成する
。第5の実施の形態では、デバイスリストに計算機2200が何個のプロセッサを持っているかを示すデータが加えられる。
The computer 2200 is configured such that only the processor 2201 starts operation when activated, and the processor 2201 executes the activation program stored in the storage device 2204. As in the case of the first embodiment, the boot program reads the kernel loader stored in the magnetic disk device 2206 into the main memory 2203 and executes it. The kernel loader creates a parameter table 1100. In the fifth embodiment, data indicating how many processors the computer 2200 has is added to the device list.

第一のOSのロード後、第一のOSの初期化処理を実行する。初期化の過程で、非ブートプロセッサ以外のプロセッサ用の初期化ルーチンのアドレスを予め定めた物理アドレスに格納し、プロセッサ2202に初期化割り込みを送る。プロセッサ2202は初期化割り込みを受けると、記憶装置2204に格納されているプログラムを実行し、非ブートプロセッサ初期化ルーチンに制御がわたる。非ブートプロセッサ初期化ルーチンは、ページテーブルレジスタや割り込みテーブルレジスタを設定して仮想アドレスモードに移行し、初期化処理を続ける。   After loading the first OS, the initialization process of the first OS is executed. In the initialization process, the address of an initialization routine for a processor other than the non-boot processor is stored in a predetermined physical address, and an initialization interrupt is sent to the processor 2202. When the processor 2202 receives the initialization interrupt, the processor 2202 executes the program stored in the storage device 2204, and control is passed to the non-boot processor initialization routine. The non-boot processor initialization routine sets the page table register and the interrupt table register, shifts to the virtual address mode, and continues the initialization process.

本発明の第5の実施の形態では、図12のステップ1204の第二のOS用のデバイスの予約のときに、プロセッサも第二のOS専用であると予約する。ここでは、プロセッサ2202を予約するとして説明する。   In the fifth embodiment of the present invention, at the time of reservation of the device for the second OS in step 1204 of FIG. 12, the processor also reserves that it is dedicated to the second OS. Here, description will be made assuming that the processor 2202 is reserved.

マルチプロセッサ構成の場合、ステップ1201から始まる第一のOSの初期化手順のシステムデバイスの初期化で、非ブートプロセッサに初期化割り込みを送る。この場合、プロセッサ2201からプロセッサ2202に初期化割り込みが送られることになる。本発明では、予約されているプロセッサについては初期化割り込みを送らないことにする。したかって、カーネルの初期化がされてもプロセッサ2202はまだ動作していない。   In the case of the multiprocessor configuration, an initialization interrupt is sent to the non-boot processor at the initialization of the system device in the first OS initialization procedure starting from step 1201. In this case, an initialization interrupt is sent from the processor 2201 to the processor 2202. In the present invention, an initialization interrupt is not sent for a reserved processor. Therefore, even if the kernel is initialized, the processor 2202 is not yet operating.

また、ステップ1205のシステムデバイスの初期化では、割り込み制御装置2205の初期化も実施する。割り込み制御装置2205の初期化では、カーネル構成情報ファイル700の第二のOSの構成データ704を参照して、第二のOSが管理するデバイスの割り込みがプロセッサ2202に送られるように割り込み配送テーブル2310を設定する。   In the initialization of the system device in step 1205, the interrupt control device 2205 is also initialized. In the initialization of the interrupt control device 2205, the interrupt delivery table 2310 is referenced so that an interrupt of a device managed by the second OS is sent to the processor 2202 with reference to the configuration data 704 of the second OS in the kernel configuration information file 700. Set.

更に、図14のステップ1401から始まる第二のOSの初期化手順において
、初期化ルーチンを第二のOSの初期化ルーチンのアドレスに設定して、ステップ1407でプロセッサ2202に初期化割り込みを送る。これにより、プロセッサ2202上で、第二のOSが走行を開始する。
Further, in the initialization procedure of the second OS starting from step 1401 in FIG. 14, the initialization routine is set to the address of the initialization routine of the second OS, and an initialization interrupt is sent to the processor 2202 in step 1407. As a result, the second OS starts running on the processor 2202.

第1、ないし、第4の実施の形態と異なり、第二のOSの管理するデバイスの割り込みは、すべて割り込み制御装置2205により、第二のOSが動作しているプロセッサ2202へ送られる。このため、実行OSを切り替える必要はなくなる。第一のOSはプロセッサ2201で動作し、第二のOSはプロセッサ2202で動作することになる。したがって、ステップ1701から始まる割り込み処理も不要になる。   Unlike the first to fourth embodiments, all interrupts of devices managed by the second OS are sent by the interrupt control device 2205 to the processor 2202 in which the second OS is operating. For this reason, there is no need to switch the execution OS. The first OS operates on the processor 2201, and the second OS operates on the processor 2202. Therefore, the interrupt process starting from step 1701 is also unnecessary.

第二のOSは、独自の割り込みテーブルをプロセッサ2202の割り込みテーブルレジスタに設定し、独自の割り込みハンドラを持てる。第一のOSの割り込みテーブルを変更する必要はない。但し、第一のOSが割り込み制御装置2205の割り込みマスクレジスタ2302を変更する場合は、第二のOSのデバイスからの割り込みをマスクしてしまわないように変更を加える必要がある。   The second OS can set its own interrupt table in the interrupt table register of the processor 2202 and have its own interrupt handler. There is no need to change the interrupt table of the first OS. However, when the first OS changes the interrupt mask register 2302 of the interrupt control device 2205, it is necessary to make a change so as not to mask the interrupt from the device of the second OS.

第5の実施の形態においては、第1ないし4の実施の形態よりも、性能の良い計算機システムの構築か可能である。第1ないし4の実施の形態では、第一のOSは第二のOSがアイドルしている間のみ動作可能であったが、第5の実施の形態においては、第一のOSは、プロセッサは奪われてはいるが常に動作することが可能であり、同時に第二のOSも動作可能である。   In the fifth embodiment, it is possible to construct a computer system with better performance than in the first to fourth embodiments. In the first to fourth embodiments, the first OS can operate only while the second OS is idle. In the fifth embodiment, the first OS Although it is stolen, it can always operate, and at the same time, the second OS can also operate.

更に、第5の実施の形態によれば、第一のOSと第二のOSとで共有しなければならない領域を小さくできる。第1ないし4の実施の形態では、共通領域203に、割り込みテーブル、割り込みハンドラや割り込み処理に付随するデータ構造、および、OS切り替えコードを置かなければならなかった。第5の実施の形態では、これらはすべて必要なくなり、互いのOSが相手のOSを誤って破壊してしまう可能性を低くできる。   Furthermore, according to the fifth embodiment, an area that must be shared between the first OS and the second OS can be reduced. In the first to fourth embodiments, an interrupt table, a data structure associated with an interrupt handler or interrupt process, and an OS switching code must be placed in the common area 203. In the fifth embodiment, all of these are unnecessary, and the possibility that each other's OS accidentally destroys the other OS can be reduced.

次に、本発明の第6の実施の形態について説明する。これまで説明した実施形態が2つのOSを同時実行する方式であるのに対し、第6の実施形態は2つ以上の複数のOSを同時実行する方式である。   Next, a sixth embodiment of the present invention will be described. While the embodiment described so far is a method of executing two OSs simultaneously, the sixth embodiment is a method of simultaneously executing two or more OSs.

第一の実施形態では、第二のOSが第一のOSよりも優先して実行するように制御するが、ここで説明する方式では、複数のOS間に実行優先度を設定可能である。例えば、割り込みについては、実行中のOSの優先度よりも低い優先度のOSが管理する割り込みの処理は延期される。実行中のOSの優先度よりも高い優先度のOSが管理する割り込みが発生した場合は、即座に実行OSを切替え割り込み処理を開始する。   In the first embodiment, control is performed such that the second OS is executed with priority over the first OS. However, in the method described here, an execution priority can be set between a plurality of OSs. For example, for interrupts, interrupt processing managed by an OS having a lower priority than the priority of the OS being executed is postponed. When an interrupt managed by an OS having a higher priority than the priority of the OS being executed is generated, the execution OS is immediately switched to start interrupt processing.

また、実行中のOSが自分よりの優先度の高いOSのモジュールを呼び出す場合は即座に実行OSを切替えてモジュール呼び出しを実施する。その逆の場合、つまり、優先度の低いOSの側での処理が必要になる場合は、そのOSが実行権を得るまで要求された処理を延期するように制御する。   Further, when the OS being executed calls an OS module having a higher priority than itself, the execution OS is immediately switched to execute the module call. In the opposite case, that is, when processing on the OS side having a low priority is required, control is performed so that the requested processing is postponed until the OS obtains the execution right.

図24は、本発明の第6の実施形態の計算機構成を示した図である。計算機構成はこれまでの実施例と同じであるが、主記憶装置102に複数のOSがロードされている様子を示している。各オペレーティングシステムは、ステップ1401に示した第二のOSをロードする手順と同じ手順でロードできる。   FIG. 24 is a diagram showing a computer configuration according to the sixth embodiment of this invention. The computer configuration is the same as in the previous embodiments, but shows a state in which a plurality of OSs are loaded in the main storage device 102. Each operating system can be loaded in the same procedure as the procedure for loading the second OS shown in Step 1401.

図25は、複数のOSの関係を概念的に示した図である。第一の実施の形態では2つのOSであったのに対し、ここでは第一のOS以外に複数のOSが1つのプロセッサ上で動作していることを示している。   FIG. 25 is a diagram conceptually showing the relationship between a plurality of OSs. In the first embodiment, there are two OSs, but here, a plurality of OSs other than the first OS are operating on one processor.

第一のOSの一部である共通領域が他の第2、第3、および、第NのOSの論理空間202、2503、および、2504にマップされ全OSから共通に利用できることを示している。各OSの論理空間への共通領域のマッピングは、ステップ1401に示した手順により実施する。   The common area that is a part of the first OS is mapped to the logical spaces 202, 2503, and 2504 of the other second, third, and Nth OSs, and can be used in common by all OSs. . The mapping of the common area to the logical space of each OS is performed according to the procedure shown in Step 1401.

更に、各OSはそれぞれが管理する外部機器を持っていることを示している。   Furthermore, each OS has an external device managed by each OS.

第二のOSは機器116と117、第三のOSは機器2505と2506、第NのOSは機器2507を管理することを示している。これらの機器を制御するためのI/Oアドレス範囲、および、割り込み番号は、図7に示すカーネル構成情報ファイル700に格納しておけば良い。図7では第二のOS用の構成情報のみを格納しているように記述したが、他に第三、第四のOSの構成情報を格納しておく。ステップ1201からの初期化手順では、第二のOSだけでなく第一のOS以外の全てのOSの資源を予約して、第一のOSが第一のOS以外のOSが管理するデバイスへアクセスすることを禁止する。 The second OS indicates that the devices 116 and 117 are managed, the third OS is that the devices 2505 and 2506 are managed, and the Nth OS is that the device 2507 is managed. The I / O address range and interrupt number for controlling these devices may be stored in the kernel configuration information file 700 shown in FIG. Although it is described in FIG. 7 that only the configuration information for the second OS is stored, the configuration information of the third and fourth OSs is stored in addition. In the initialization procedure from step 1201, not only the second OS but also all OS resources other than the first OS are reserved, and the first OS accesses devices managed by the OS other than the first OS. Is prohibited.

ステップ1201から始まる手順では、ステップ1202で第二のOS用の主記憶を確保している。これを、第一のOS以外の複数のOS用の主記憶を確保する処理とする。また、ステップ1204は第二のOSが管理するデバイスを予約する処理であるが、これを第一のOS以外のOSが管理するデバイス資源を予約する処理とする。   In the procedure starting from step 1201, main memory for the second OS is secured in step 1202. This is a process of securing main memory for a plurality of OSs other than the first OS. Step 1204 is a process for reserving a device managed by the second OS. This process is a process for reserving a device resource managed by an OS other than the first OS.

本実施形態における第一のOSの初期化手順を図26に示す。ステップ2602と2604がステップ1202と1204に対応している。ステップ2604は、カーネル構成情報ファイル700を参照して第一OS以外のOSのデバイス資源を予約する。   The initialization procedure of the first OS in this embodiment is shown in FIG. Steps 2602 and 2604 correspond to steps 1202 and 1204. Step 2604 reserves device resources of OSs other than the first OS with reference to the kernel configuration information file 700.

この時、同時に割り込み管理テーブル1520の処理OS1521も設定する
。また、各OSの構成情報には、デバイス資源の他にOSの優先度も記述する。
At this time, the processing OS 1521 of the interrupt management table 1520 is also set. In addition, the OS priority is described in the configuration information of each OS in addition to the device resources.

図27は、共通領域203に配置するデータ構造を示す図である。図15に示したデータ構造と比較して、割り込み識別テーブル1520、OS識別変数1530、および、遅延割り込み状態変数1540は同一のデータ構造である。OSコンテクストテーブル2710は、1510を拡張したデータ構造となっている
FIG. 27 is a diagram illustrating a data structure arranged in the common area 203. Compared to the data structure shown in FIG. 15, the interrupt identification table 1520, the OS identification variable 1530, and the delayed interrupt state variable 1540 have the same data structure. The OS context table 2710 has a data structure obtained by extending 1510.

テーブル2710は、各OSの実行を切替える時に必要になるデータを保存している。ページテーブル設定値2701とスタックポインタ設定2702は、あるOSを実行中に他のOSのモジュールを呼び出す時に設定するページテーブルとスタックポインタのアドレスを示している。また、ページテーブル保存値2703とスタックポインタ保存値2704は、優先度の高いOSへの切替を実施した時の優先度が低い方のOSのページテーブル値、および、スタックポインタ値を保存している。   A table 2710 stores data necessary for switching execution of each OS. The page table setting value 2701 and the stack pointer setting 2702 indicate the address of the page table and the stack pointer that are set when calling a module of another OS while executing a certain OS. Further, the page table storage value 2703 and the stack pointer storage value 2704 store the page table value and the stack pointer value of the OS with the lower priority when switching to the OS with higher priority is performed. .

実行状態2705は、それぞれのOSについて稼働中であるか、および、処理待ち中であるかを示す値を格納する。ここで稼働中であるかとは、OSが起動されているかを示す。ある瞬間に実行中であることを示しているわけではない。各OSの起動処理は実行状態2705を設定する。   The execution state 2705 stores a value indicating whether each OS is operating and waiting for processing. Here, whether it is operating indicates whether the OS is activated. It does not indicate that it is running at a certain moment. Each OS activation process sets an execution state 2705.

また処理待ち中であるとは、そのOSがアイドル状態でないことを示す。つまり、優先度の高いOSが実行中のため走行待ち状態にあることを示す。処理待ち中については、具体的にどの処理が待ちになっているかを記述してもよい。   Also, waiting for processing indicates that the OS is not idle. In other words, it indicates that the OS with high priority is running and is in a waiting state for traveling. In the process waiting state, it may be specifically described which process is waiting.

優先度2706は、各OSの実行優先度を格納する。優先度は、第一OSの初期化処理手順のステップ2605で、構成ファイル700より読み出し設定する
The priority 2706 stores the execution priority of each OS. The priority is read from the configuration file 700 and set in step 2605 of the initialization procedure of the first OS.

実行OSの切替え手順について、第二のOSが実行中であるとして説明する。   The execution OS switching procedure will be described on the assumption that the second OS is being executed.

また、OSの実行優先度が第一より第二、第二より第三の方が優先度が高く設定されているとする。第二のOSの処理により第三のOS上のプロセスが走行可能になったとする。この場合、第三のOS内部のプロセス起動モジュールを実行して第三のOS上のプロセスをスケジュールする。ここで、第三のOSは第二のOSよりも優先度が高いので、実行OSを即座に切替えて第三のOSのモジュールが実行される。切替え処理では現在のページテーブルアドレスとスタックポインタ値を、第二のOSのページテーブル保存値2703とスタックポインタ保存2704値に格納し、第三のOSのページテーブル設定値2701とスタックポインタ設定値2702をページテーブルレジスタとスタックポインタに設定して実行OSを切替える。 Further, it is assumed that the execution priority of the OS is set to be higher than that of the first, and that of the third is higher than that of the second. It is assumed that the process on the third OS can be run by the processing of the second OS. In this case, a process activation module in the third OS is executed to schedule a process on the third OS. Here, since the third OS has a higher priority than the second OS, the execution OS is immediately switched to execute the module of the third OS. In the switching process, the current page table address and stack pointer value are stored in the page table saved value 2703 and stack pointer saved 2704 value of the second OS, and the page table set value 2701 and stack pointer set value 2702 of the third OS. Is set in the page table register and the stack pointer to switch the execution OS.

第二のOSが第一のOSのモジュールを呼び出す場合、第一のOSの優先度は第二のOSの優先度よりも低いため、呼び出しは延期する。この場合、呼び出し要因を実行状態2705記録しておき、第一のOSが実行権を得た時に、すなわち、第二、および、第三のOSが処理を終了した時に、モジュール呼び出しを実施する。   When the second OS calls the module of the first OS, the call is postponed because the priority of the first OS is lower than the priority of the second OS. In this case, the call factor is recorded in the execution state 2705, and the module call is performed when the first OS obtains the execution right, that is, when the second and third OSs complete the processing.

図28は、実行OSの切替え手順を示すフローチャートである。ステップ2801からの処理の大部分は図16に示したステップ1601からの処理と同じである。この手順は、OSの優先度については考慮していないが、この手順を呼び出す前に呼出先OSの優先度と実行中OSの優先度を比較して、実際に呼び出して良い場合はステップ2801からの処理を実施すれば良い。   FIG. 28 is a flowchart showing the execution OS switching procedure. Most of the processing from step 2801 is the same as the processing from step 1601 shown in FIG. This procedure does not consider the priority of the OS, but before calling this procedure, the priority of the called OS is compared with the priority of the running OS. It is sufficient to perform the process.

ステップ2801から始まる処理は、切替先OSと呼び出しモジュールのアドレスを引数として受ける。ステップ2801では、現在のページテーブルアドレスとスタックポインタを、OSコンテクストテーブル2710の現在実行中のOSのページテーブル保存値2703と、スタックポインタ保存値2704に保存する。現在実行中のOSは、OS識別変数1530により判定できる。   The process starting from step 2801 receives the address of the switching destination OS and the calling module as arguments. In step 2801, the current page table address and stack pointer are stored in the page table storage value 2703 and stack pointer storage value 2704 of the OS currently being executed in the OS context table 2710. The OS currently being executed can be determined by the OS identification variable 1530.

次のステップ2802では、OSコンテクストテーブル2710より切替先OSのページテーブル設定値2701とスタックポインタ設定値2702を取得し
、ページテーブルとスタックの切替え処理を実施する。
In the next step 2802, the page table setting value 2701 and the stack pointer setting value 2702 of the switching destination OS are acquired from the OS context table 2710, and the switching process between the page table and the stack is performed.

ステップ2803では、遅延割り込み状態をクリアする。優先度が実行中のOS以上で、切替先未満のOSが管理するデバイスの遅延割り込み状態1540をクリアする。   In step 2803, the delayed interrupt state is cleared. The delayed interrupt state 1540 of the device managed by the OS with the priority higher than the OS being executed and less than the switching destination is cleared.

例えば、第一のOSから第三のOSのモジュールを呼び出すとする。この場合
、ステップ2803では第一のOSと第二のOSが管理するデバイスの遅延割り込み状態1540をクリアする。
For example, assume that a module of the third OS is called from the first OS. In this case, in step 2803, the delayed interrupt state 1540 of the device managed by the first OS and the second OS is cleared.

続くステップ2804では、OSコンテクストテーブル2710の現在実行中のOSの実行状態2705を処理待ち中に設定し、ステップ2805でOS識別変数を切替先OSに設定し、ステップ2806で引数として渡されたモジュールを呼び出す。   In the subsequent step 2804, the execution state 2705 of the OS currently being executed in the OS context table 2710 is set to waiting for processing, the OS identification variable is set to the switching destination OS in step 2805, and the module passed as an argument in step 2806 Call.

切替先のOSは実施すべき処理がなくなった時点で、ステップ2807へ制御を戻す。ステップ2807では、OSコンテクストテーブルの各OSの実行状態2705と優先度2706を参照して、最も優先度が高い処理待ち中のOSを見つける。   The switching-destination OS returns control to step 2807 when there is no more processing to be performed. In step 2807, the execution status 2705 and priority 2706 of each OS in the OS context table is referred to, and the OS waiting for processing with the highest priority is found.

ステップ2808は、ステップ2807で選択したOSのコンテクストを、OSコンテクストテーブル2710のページテーブル保存値2703とスタックポインタ保存値2704より回復する。   In step 2808, the OS context selected in step 2807 is restored from the page table storage value 2703 and the stack pointer storage value 2704 of the OS context table 2710.

次のステップ2809で、OS識別変数1530を選択したOSに設定する。   In the next step 2809, the OS identification variable 1530 is set to the selected OS.

OSコンテクストテーブル2700の実行状態2705に延期されている処理があることが記録されている場合は、その延期されている処理を実行する(ステップ2810)。   If it is recorded that there is a postponed process in the execution state 2705 of the OS context table 2700, the postponed process is executed (step 2810).

続く処理では、遅延された割り込みを処理する。ステップ2812は、遅延割り込み状態1540を参照して、ステップ2807で選択されたOSが処理すべき割り込みが発生していないかを検査する。選択されたOSがどの割り込み番号の割り込みを管理しているかは、割り込み識別テーブル1520の処理OS1521を参照すれば分かる。   In subsequent processing, the delayed interrupt is processed. Step 2812 refers to the delayed interrupt state 1540 and checks whether an interrupt to be processed by the OS selected in Step 2807 has occurred. Which interrupt number is managed by the selected OS can be determined by referring to the processing OS 1521 of the interrupt identification table 1520.

ステップ2812の検査の結果、処理待ちの割り込みが発生していると判定した場合はステップ2813へ進む。ステップ2813では、処理しなければならない割り込みが発生していることを選択されたOSが認識できるように選択されたOSのデータ構造を設定する。続くステップ2814は、割り込み識別テーブル1520を参照して、処理する割り込みの割り込みハンドラ1522を呼び出す。ハンドラの処理終了後、回復したコンテクストにしたがって、選択されたOSの実行を再開する。   As a result of the inspection in step 2812, if it is determined that an interrupt waiting for processing has occurred, the process proceeds to step 2813. In step 2813, the data structure of the selected OS is set so that the selected OS can recognize that an interrupt to be processed has occurred. In the subsequent step 2814, the interrupt identification table 1520 is referred to and the interrupt handler 1522 of the interrupt to be processed is called. After the handler processing is completed, the selected OS is resumed according to the recovered context.

処理待ち割り込みがなければ、そのまま回復したコンテクストにしたがって、選択されたOSの実行を再開する。   If there is no processing waiting interrupt, execution of the selected OS is resumed according to the recovered context.

割り込み処理について説明する。図29は、割り込み処理手順を示すフローチャートである。図29に示す手順を実行するルーチンはプロセッサ103の割り込みハンドラとして割り込みテーブル400に登録される。また、全てのOSから参照可能な共通領域に配置される。   The interrupt process will be described. FIG. 29 is a flowchart showing an interrupt processing procedure. A routine for executing the procedure shown in FIG. 29 is registered in the interrupt table 400 as an interrupt handler of the processor 103. Further, it is arranged in a common area that can be referred to by all OSs.

処理手順について説明する。まず、ステップ2901では、割り込み要因より割り込みを処理するOSを決定する。処理OSは、割り込み識別テーブル1520の処理OS1521に記録されており、これを参照して決定する。   A processing procedure will be described. First, in step 2901, an OS for processing an interrupt is determined based on an interrupt factor. The processing OS is recorded in the processing OS 1521 of the interrupt identification table 1520 and is determined with reference to this.

割り込み発生時のOSと割り込み処理OSが同一ならば(ステップ2902)
、割り込み識別テーブル1520に登録されている割り込みハンドラ1522を実行する(ステップ2903)。ハンドラ処理終了時に割り込まれた処理を再開
する。
If the OS at the time of interrupt occurrence is the same as the interrupt processing OS (step 2902)
Then, the interrupt handler 1522 registered in the interrupt identification table 1520 is executed (step 2903). Resumes the interrupted process at the end of the handler process.

割り込み発生時のOSと割り込み処理OSが異なる場合は、2つのOSの優先度を比較する(ステップ2904)。実行中のOSの優先度の方が高い場合、ス
テップ2905へ進み、遅延割り込み状態変数1540を設定して、割り込まれた処理を再開する。
If the OS at the time of interrupt occurrence is different from the interrupt processing OS, the priorities of the two OSs are compared (step 2904). If the priority of the OS being executed is higher, the process proceeds to step 2905, where the delayed interrupt state variable 1540 is set, and the interrupted process is resumed.

割り込み処理OSの優先度の方が実行中のOSよりも高い場合は、ステップ2906へ進み、割り込み処理を開始する。   If the priority of the interrupt processing OS is higher than that of the OS being executed, the process proceeds to step 2906 to start the interrupt processing.

ステップ2906では、割り込み識別テーブル1520より割り込みハンドラアドレス1522を取得する。続いて、割り込み発生時のコンテクストを保存し(ステップ2907)、割り込みハンドラを呼び出す(ステップ2908)。割
り込みハンドラの呼び出しは、図28のステップ2801から始まる手順により実施する。
In step 2906, the interrupt handler address 1522 is acquired from the interrupt identification table 1520. Subsequently, the context at the time of occurrence of the interrupt is saved (step 2907), and the interrupt handler is called (step 2908). The call of the interrupt handler is performed by the procedure starting from step 2801 in FIG.

その後、割り込まれたOSに制御が戻った時に、割り込み発生時のコンテクストを回復し(ステップ2910)、割り込まれた処理を再開する。   After that, when control returns to the interrupted OS, the context at the time of occurrence of the interrupt is recovered (step 2910), and the interrupted process is resumed.

次に、共通領域203に配置する処理モジュールについて述べる。共通領域203には、ステップ2801からのOS切替えモジュールと2901から始まる割り込みハンドラを配置する。この他の全てのOSから呼び出されるモジュールも共通領域203に配置する。例えば、各OSの割り込みハンドラを割り込み識別テーブル1520に登録するモジュールや、OSコンテクストテーブル2710の実行状態2705を設定するモジュールである。   Next, processing modules arranged in the common area 203 will be described. In the common area 203, an OS switching module from step 2801 and an interrupt handler starting from 2901 are arranged. Modules called from all other OSs are also arranged in the common area 203. For example, a module for registering an interrupt handler of each OS in the interrupt identification table 1520 or a module for setting an execution state 2705 of the OS context table 2710.

各OSは、それぞれの初期化処理で共通領域203の登録モジュールを呼び出して割り込みハンドラを登録することにより、外部割り込みの処理が可能になる
。また、何らかの処理により実行中のOSの優先度よりも低い優先度の他のOSの処理が可能になる場合、実行状態2705に処理待ち中であること、あるいは
、処理待ちの要因を示す値を設定しなければならない。この場合も、共通領域203内の実行状態設定モジュールを呼び出すことにより設定する。
Each OS calls the registration module in the common area 203 and registers an interrupt handler in each initialization process, thereby enabling external interrupt processing. Further, when processing of another OS having a lower priority than the priority of the OS being executed becomes possible due to some processing, the execution state 2705 is waiting for processing or a value indicating the cause of processing waiting. Must be set. In this case as well, the setting is made by calling the execution state setting module in the common area 203.

本実施形態によれば、第一のOSの他に複数のOSを1つのプロセッサで実行可能となり、特別な機能に特化したOSを組み合わせることが可能となる。例えば、リアルタイム性に優れたOSと計算機の信頼性を補完するOSとを組み合わせて、第一のOSの機能を補うことができる。各OSは独立しているのでさまざまのOSを組み合わせることができ、用途に応じた第一のOSの機能拡張が可能になる。更に、これまで説明した実施形態により得られる効果も損なわれることはない。   According to the present embodiment, a plurality of OSs can be executed by one processor in addition to the first OS, and OSs specialized for special functions can be combined. For example, the function of the first OS can be supplemented by combining an OS with excellent real-time characteristics and an OS that complements the reliability of the computer. Since each OS is independent, various OSs can be combined, and the function of the first OS can be expanded according to the application. Furthermore, the effects obtained by the embodiments described so far are not impaired.

更に、OS間に優先度を設定できるので、リアルタイムOSの優先度を最も高く設定するといった設定も可能である。これにより、各OSの優れている機能を有効に利用することが可能になる。   Furthermore, since the priority can be set between the OSs, it is possible to set the real-time OS with the highest priority. This makes it possible to effectively use the excellent functions of each OS.

本発明の第7の実施の形態について説明する。本実施形態は、第6の実施の形態の拡張である。第7の実施の形態では、複数動作している内のあるOSが障害停止した場合に、他の残ったOSが実行継続可能な制御方法を示す。   A seventh embodiment of the present invention will be described. This embodiment is an extension of the sixth embodiment. In the seventh embodiment, a control method is shown in which, when a certain OS among a plurality of operating systems is stopped due to a failure, other remaining OSs can continue execution.

各OSの障害処理モジュールは、OSの実行を停止する時に、OSコンテクストテーブル2710の実行状態2705を、停止中であると設定しなければならない。これは、前記実施形態の、共通領域203に配置した実行状態設定モジュールの呼び出しにより実施する。   When the failure processing module of each OS stops the execution of the OS, the execution state 2705 of the OS context table 2710 must be set as being stopped. This is performed by calling the execution state setting module arranged in the common area 203 in the above embodiment.

また、各OSは、他のOSが実行を停止した時に呼び出されるOS停止通知ハンドラを持ち、割り込みハンドラと同様に共通領域203内のデータ構造に登録する。   Each OS has an OS stop notification handler that is called when the other OS stops execution, and registers it in the data structure in the common area 203 like the interrupt handler.

次に、実行状態設定モジュールの処理について説明する。図30は、本モジュールの処理を示したフローチャートである。第三のOSが停止したとして説明する。   Next, processing of the execution state setting module will be described. FIG. 30 is a flowchart showing the processing of this module. A description will be given assuming that the third OS has stopped.

ステップ3001では、OSコンテクストテーブル2710の実行状態2705を設定する。   In step 3001, the execution state 2705 of the OS context table 2710 is set.

ステップ3002では、設定された実行状態を検査する。もし、OS実行停止に設定されたらならば、ステップ3003へ進む。そうでなければモジュールの処理は終了する。   In step 3002, the set execution state is checked. If the OS execution stop is set, the process proceeds to step 3003. Otherwise, the module processing ends.

ステップ3003では、停止したOSよりも優先度が高い稼働中のOSのOS停止通知ハンドラを呼び出す。呼び出しは、ステップ2801からのOS切替えにより呼び出す。優先度が低いOSについては、実行状態2706にOS停止ハンドラ実行待ちであることを記録する。また、各OSのOS停止通知ハンドラは、割り込みハンドラと同様に、各OSの初期化時に共通領域内に配置されたデータ領域に登録されるものとする。   In step 3003, an OS stop notification handler of an operating OS having a higher priority than the stopped OS is called. Calling is performed by OS switching from step 2801. For an OS with a low priority, it records in the execution state 2706 that it is waiting for OS stop handler execution. Further, the OS stop notification handler of each OS is registered in the data area arranged in the common area at the time of initialization of each OS, similarly to the interrupt handler.

実行OS切替え処理では、切替先のOSが実行を停止していないかを検査する処理が必要である。図28のフローチャートにしたがって説明する。   In the execution OS switching process, it is necessary to check whether the switching destination OS has stopped executing. This will be described with reference to the flowchart of FIG.

まず、切替え処理を始める前に、切替先が稼働中かを検査しなければならない。ステップ2801の前に、OSコンテクストテーブル2710の実行状態2705を検査して、稼働中でなければ切替え処理を終了させる。   First, it is necessary to check whether the switching destination is in operation before starting the switching process. Before step 2801, the execution state 2705 of the OS context table 2710 is inspected, and if it is not in operation, the switching process is terminated.

更に、ステップ2807での次の実行OSの選択では、処理待ち中のOSの検索対象から稼働していないOSを除外するようにする。   Further, in the selection of the next execution OS in step 2807, the OS that is not operating is excluded from the search targets of the OS waiting for processing.

選択したOSの実行を再開する前に、選択したOSの実行状態2705を検査し、OS停止通知ハンドラの実行待ちが記録されているならば、OS停止通知ハンドラを実行する。   Before resuming execution of the selected OS, the execution state 2705 of the selected OS is inspected, and if execution waiting for the OS stop notification handler is recorded, the OS stop notification handler is executed.

次に、割り込み処理について説明する。図29のフローチャートにしたがって説明する。ステップ2901の割り込み処理OS決定の後、処理OSが稼働中か検査する。ここで稼働中でないと判定した場合、割り込みを解除して割り込まれた処理を再開させるようにする。   Next, interrupt processing will be described. This will be described with reference to the flowchart of FIG. After determining the interrupt processing OS in step 2901, it is checked whether the processing OS is operating. If it is determined that it is not in operation, the interrupt is released and the interrupted process is resumed.

以上の処理により、第一のOS以外に複数のOSが1つのプロセッサ上で同時に動作している時にいくつかのOSが障害により停止しても、他の残りのOSは動作を継続することが可能になる。   With the above processing, when a plurality of OSs other than the first OS are operating simultaneously on one processor, even if some OSs stop due to a failure, the other remaining OSs can continue to operate. It becomes possible.

また、各OSの障害停止が他のOSに通知されるので、OS間で連携して処理を実施している場合でも、その通知をもとに各OSで障害処理を実施することが可能であり、計算機全体としての信頼性を高めることができる。   In addition, since the failure stop of each OS is notified to the other OS, even when the processing is performed in cooperation between the OSs, it is possible to perform the failure processing in each OS based on the notification. Yes, the reliability of the entire computer can be improved.

これまで述べた実施の形態では、それぞれのOSは互いに異なるOSであっても、同一のOSが含まれていても良い。   In the embodiments described so far, the respective OSs may be different from each other or may include the same OS.

本発明の実施の形態の、計算機構成を示す図である。It is a figure which shows the computer structure of embodiment of this invention. 本発明の実施の形態の、計算機構成を示す図である。It is a figure which shows the computer structure of embodiment of this invention. 本発明の実施の形態の、ページテーブルの構成を示す図である。It is a figure which shows the structure of the page table of embodiment of this invention. 本発明の実施の形態の、割り込みテーブルの構成を示す図である。It is a figure which shows the structure of the interruption table of embodiment of this invention. 本発明の実施の形態の、割り込み制御装置の構成を示す図である。It is a figure which shows the structure of the interrupt control apparatus of embodiment of this invention. 本発明の実施の形態の、計算機のブート手順を示すフローチャートである。It is a flowchart which shows the boot procedure of the computer of embodiment of this invention. 本発明の実施の形態の、第一のOSのカーネル構成情報ファイルの構成を示す図である。It is a figure which shows the structure of the kernel configuration information file of 1st OS of embodiment of this invention. 本発明の実施の形態の、オブジェクトファイルの構成を示す図である。It is a figure which shows the structure of the object file of embodiment of this invention. 本発明の実施の形態の、オブジェクトファイルの構成を示す図である。It is a figure which shows the structure of the object file of embodiment of this invention. 本発明の実施の形態の、オブジェクトファイルの構成を示す図である。It is a figure which shows the structure of the object file of embodiment of this invention. 本発明の実施の形態の、カーネル起動パラメータテーブルのデータ構造を示す図である。It is a figure which shows the data structure of the kernel starting parameter table of embodiment of this invention. 本発明の実施の形態の、第一のOSの初期化手順を示すフローチャートである。It is a flowchart which shows the initialization procedure of 1st OS of embodiment of this invention. 本発明の実施の形態の、第一のOSのデバイス管理テーブルのデータ構造を示す図である。It is a figure which shows the data structure of the device management table of 1st OS of embodiment of this invention. 本発明の実施の形態の、第二のOSの起動手順を示すフローチャートである。It is a flowchart which shows the starting procedure of 2nd OS of embodiment of this invention. 本発明の実施の形態の、第一のOSと第二のOSが共有するデータ構造を示す図である。It is a figure which shows the data structure which 1st OS and 2nd OS share of embodiment of this invention. 本発明の実施の形態の、実行OSの切り替え手順を示すフローチャートである。It is a flowchart which shows the switching procedure of execution OS of embodiment of this invention. 本発明の実施の形態の、割り込み処理手順を示すフローチャートである。It is a flowchart which shows the interruption processing procedure of embodiment of this invention. 本発明の実施の形態の、第一のOSの割り込みマスク処理のためのデータ構造を示す図である。It is a figure which shows the data structure for the interrupt mask process of 1st OS of embodiment of this invention. 本発明の第2の実施の形態の、第一のOSの障害停止処理を示すフローチャートである。It is a flowchart which shows the failure stop process of the 1st OS of the 2nd Embodiment of this invention. 本発明の第3の実施の形態の、第一のOSと第二のOSのカーネル領域の構成を示す図である。It is a figure which shows the structure of the kernel area | region of 1st OS and 2nd OS of the 3rd Embodiment of this invention. 本発明の第4の実施の形態の、オブジェクトファイルの構成を示す図である。It is a figure which shows the structure of the object file of the 4th Embodiment of this invention. 本発明の第5の実施の形態の、計算機システムの構成を示す図である。It is a figure which shows the structure of the computer system of the 5th Embodiment of this invention. 本発明の第5の実施の形態の、割り込み制御装置の構成を示す図である。It is a figure which shows the structure of the interrupt control apparatus of the 5th Embodiment of this invention. 本発明の第6の実施の形態の、計算機構成を示す図である。It is a figure which shows the computer structure of the 6th Embodiment of this invention. 本発明の第6の実施の形態の、計算機構成を示す図である。It is a figure which shows the computer structure of the 6th Embodiment of this invention. 本発明の第6の実施の形態の、第一のOSの初期化手順を示すフローチャートである。It is a flowchart which shows the initialization procedure of 1st OS of the 6th Embodiment of this invention. 本発明の第6の実施の形態の、全てのOSが共有するデータ構造を示す図である。It is a figure which shows the data structure which all the OS of the 6th Embodiment of this invention shares. 本発明の第6の実施の形態の、実行OSの切り替え手順を示すフローチャートである。It is a flowchart which shows the switching procedure of execution OS of the 6th Embodiment of this invention. 本発明の第6の実施の形態の、割り込み処理手順を示すフローチャートである。It is a flowchart which shows the interrupt processing procedure of the 6th Embodiment of this invention. 本発明の第6の実施の形態の、OS実行状態設定手順を示すフローチャートである。It is a flowchart which shows the OS execution state setting procedure of the 6th Embodiment of this invention.

符号の説明Explanation of symbols

100は計算機、101はプロセッサ、102は主記憶装置、103は演算装置、104は割り込みレジスタ、105はページテーブルレジスタ、106はアドレス変換装置、107は割り込みテーブル、108はページテーブル、109はバス、110は割込み信号線、111はクロック生成装置、112は割り込み制御装置、113ないし117は外部入出力装置、118は割り込みバスである。
100 is a computer, 101 is a processor, 102 is a main storage device, 103 is an arithmetic unit, 104 is an interrupt register, 105 is a page table register, 106 is an address translation device, 107 is an interrupt table, 108 is a page table, 109 is a bus, 110 is an interrupt signal line, 111 is a clock generator, 112 is an interrupt controller, 113 to 117 are external input / output devices, and 118 is an interrupt bus.

Claims (3)

複数のオペレーティングシステムを計算機で動作させるコンピュータシステムのマルチOSの制御方法において、  In a multi-OS control method of a computer system that operates a plurality of operating systems on a computer,
前記コンピュータシステムは、  The computer system includes:
プロセッサと、  A processor;
複数のハードウェアデバイスと、  Multiple hardware devices,
前記プロセッサにより実行され、前記ハードウェアデバイスの第1のハードウェア資源に割り当てられる第1のオペレーティングシステム(以下、「第1のOS」)と、  A first operating system (hereinafter, “first OS”) executed by the processor and assigned to a first hardware resource of the hardware device;
前記プロセッサにより実行され、前記ハードウェアデバイスの第2のハードウェア資源に割り当てられ、前記第1のOSとは独立に実行される第2のオペレーティングシステム(以下、「第2のOS」)と、  A second operating system (hereinafter referred to as “second OS”) executed by the processor, allocated to a second hardware resource of the hardware device, and executed independently of the first OS;
前記第1のOSと前記第2のOSの仮想空間にそれぞれマッピングされる領域と、前記第1のOSと前記第2のOSから共通に使用される共通領域を有する記憶装置と、を備え、  An area mapped to the virtual space of the first OS and the second OS, and a storage device having a common area commonly used by the first OS and the second OS,
第1のOSを起動する手段が、前記第1のOSの初期化処理時に、前記第1のOSが前記記憶装置の空きメモリの管理を始める前に、前記第2のOS用の記憶領域を確保し、前記第1のOSがデバイスの管理を始める前に、前記第1のOSが管理しているデバイス管理テーブルに第1のOSから前記第2のハードウェア資源からの割り込みを使用できなくするよう登録を行う、  The means for starting up the first OS sets the storage area for the second OS before the first OS starts managing free memory of the storage device during the initialization process of the first OS. Before the first OS starts managing devices, the device management table managed by the first OS cannot use interrupts from the second hardware resource from the first OS. Register to do,
ことを特徴とするマルチOSの制御方法。  A multi-OS control method characterized by that.
請求項1に記載のマルチOSの制御方法において、  The multi-OS control method according to claim 1,
前記プロセッサにより実行され、割り込み処理を実施するサポートドライバを備え、  A support driver that is executed by the processor and performs interrupt processing;
前記サポートドライバは、前記共通領域にロードされ、  The support driver is loaded into the common area,
前記サポートドライバは、外部割り込みが発生した場合、割り込み識別テーブルの処理OSを参照して、割り込み要因に基づいて、前記第1のOS又は前記第2のOSのいずれかに処理させるか決定する  When an external interrupt occurs, the support driver refers to the processing OS in the interrupt identification table and determines whether to process the first OS or the second OS based on the interrupt factor.
ことを特徴とするマルチOSの制御方法。  A multi-OS control method characterized by that.
請求項1又は2に記載のマルチOSの制御方法において、  The multi-OS control method according to claim 1 or 2,
第2のOSを起動する手段が、前記確保した記憶領域に前記第2のOSをロードし、前記第2のOSの初期化処理時に、前記第2のハードウェア資源からの割り込みが発生した場合、前記第1のOSの割り込み制御によって前記第2のハードウェア資源の割り込みを禁止しないよう前記第1のOSが管理する割り込み禁止テーブルに登録する  The means for starting the second OS loads the second OS into the reserved storage area, and an interrupt from the second hardware resource occurs during the initialization process of the second OS And registering in the interrupt prohibition table managed by the first OS so as not to prohibit the interrupt of the second hardware resource by the interrupt control of the first OS
ことを特徴とするマルチOSの制御方法。  A multi-OS control method characterized by that.
JP2006270265A 1997-09-12 2006-10-02 Multi-OS configuration method Expired - Fee Related JP4026667B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006270265A JP4026667B2 (en) 1997-09-12 2006-10-02 Multi-OS configuration method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP24817897 1997-09-12
JP2006270265A JP4026667B2 (en) 1997-09-12 2006-10-02 Multi-OS configuration method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2000391839A Division JP2001216172A (en) 1997-09-12 2000-12-20 Multi-os constituting method

Publications (2)

Publication Number Publication Date
JP2007035066A JP2007035066A (en) 2007-02-08
JP4026667B2 true JP4026667B2 (en) 2007-12-26

Family

ID=37794161

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006270265A Expired - Fee Related JP4026667B2 (en) 1997-09-12 2006-10-02 Multi-OS configuration method

Country Status (1)

Country Link
JP (1) JP4026667B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20160097892A (en) * 2015-02-10 2016-08-18 한국전자통신연구원 Apparatus and method for security service based virtualization

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5060241B2 (en) 2007-10-10 2012-10-31 キヤノン株式会社 Information processing apparatus and control method thereof
JP5207792B2 (en) 2008-02-19 2013-06-12 キヤノン株式会社 Information processing apparatus and information processing method
US8484452B2 (en) 2008-03-14 2013-07-09 Mitsubishi Electric Corporation Multi-operating system (OS) booting apparatus, multi-OS booting program, recording medium, and multi-OS booting method
JP5146174B2 (en) 2008-07-28 2013-02-20 富士通株式会社 Virtual machine monitor device and program, and virtual machine memory sharing management method
US8862179B2 (en) * 2009-04-20 2014-10-14 Wei Wu Hand-held device integrating computer and cell phone
CN103180829B (en) 2010-10-22 2016-08-03 三菱电机株式会社 Interrupt signal receives device and computer installation

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20160097892A (en) * 2015-02-10 2016-08-18 한국전자통신연구원 Apparatus and method for security service based virtualization
KR102295960B1 (en) * 2015-02-10 2021-09-01 한국전자통신연구원 Apparatus and method for security service based virtualization

Also Published As

Publication number Publication date
JP2007035066A (en) 2007-02-08

Similar Documents

Publication Publication Date Title
JP3546678B2 (en) Multi-OS configuration method
US7712104B2 (en) Multi OS configuration method and computer system
US6996828B1 (en) Multi-OS configuration method
US9304794B2 (en) Virtual machine control method and virtual machine system using prefetch information
US6175916B1 (en) Common-thread inter-process function calls invoked by jumps to invalid addresses
JP3659062B2 (en) Computer system
US9009701B2 (en) Method for controlling a virtual machine and a virtual machine system
JP4026667B2 (en) Multi-OS configuration method
JPH1124943A (en) Computer restarting method and computer stopping method
JP2539913B2 (en) Data processing system
US7552434B2 (en) Method of performing kernel task upon initial execution of process at user level
US7546600B2 (en) Method of assigning virtual process identifier to process within process domain
JP2001216172A (en) Multi-os constituting method
JP6198858B2 (en) Resource scheduling method by computer and hypervisor
US7096472B2 (en) Systems and methods for ensuring atomicity of processes in a multitasking computing environment
JP2001236237A (en) Method for constituting multi-os
JP5584811B2 (en) Virtual computer control method, virtualization program, and virtual computer system
JP2001175486A (en) Computer system
JP2004038995A (en) Multiple operation system configuration method
JP2001290678A (en) Asynchronous memory dump executing system
JPS6097440A (en) Virtual multiprocessor device
JP2022055002A (en) Information processing device, information processing method, and information processing program
Halvorsen et al. Operating System Fundamentals
JPS59163647A (en) Task control method
JPH01217535A (en) Method for controlling additional processor unit

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070123

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070326

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071001

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

Free format text: PAYMENT UNTIL: 20101019

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20101019

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20111019

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20121019

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20121019

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20131019

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees