JP2010271945A - Computer system and method for supporting kernel mode operation of application program - Google Patents

Computer system and method for supporting kernel mode operation of application program Download PDF

Info

Publication number
JP2010271945A
JP2010271945A JP2009123492A JP2009123492A JP2010271945A JP 2010271945 A JP2010271945 A JP 2010271945A JP 2009123492 A JP2009123492 A JP 2009123492A JP 2009123492 A JP2009123492 A JP 2009123492A JP 2010271945 A JP2010271945 A JP 2010271945A
Authority
JP
Japan
Prior art keywords
mode
operation mode
application program
kernel
computer system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2009123492A
Other languages
Japanese (ja)
Inventor
Hideji Ishii
秀治 石井
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.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2009123492A priority Critical patent/JP2010271945A/en
Publication of JP2010271945A publication Critical patent/JP2010271945A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To run an application program in a kernel mode in order to improve performance without modifying the program, and to increase the speed of determining the operational mode. <P>SOLUTION: A computer system 1A includes: an operational mode determining unit 112 which determines an operational mode set by the application program, and a function call unit 113 which selects a method of calling a kernel function according to the operational mode determined by the operational mode determining unit 112. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、コンピュータシステム、および同システムにおけるアプリケーションプログラムのカーネルモード動作支援方法、ならびにカーネルモード動作支援プログラムに関し、具体的には、オペレーティングシステムが提供するカーネル機能を使用してアプリケーションプログラムを実行する技術に関する。   The present invention relates to a computer system, a kernel mode operation support method for an application program in the system, and a kernel mode operation support program, and more specifically, a technique for executing an application program using a kernel function provided by an operating system. About.

オペレーティングシステム(以下、OS:Operating Systemという)は、データ入力や画面出力といった入出力機能、およびディスクやメモリ管理等、多くのアプリケーションプログラムから共通に利用されるカーネル機能を提供し、コンピュータシステム全体を管理する。   Operating system (hereinafter referred to as OS: Operating System) provides input / output functions such as data input and screen output, and kernel functions commonly used by many application programs such as disk and memory management. to manage.

非特許文献1に、上記したOSによる処理の一例が開示されている。非特許文献1によれば、コンピュータシステムは、ユーザモードで動作するアプリケーションプログラムと、カーネルモードで動作するカーネルプログラムで構成され、アプリケーションプログラムは、必要なカーネルプログラムの機能をシステムコールにより利用することが開示されている。   Non-Patent Document 1 discloses an example of processing by the OS described above. According to Non-Patent Document 1, a computer system is composed of an application program that operates in a user mode and a kernel program that operates in a kernel mode, and the application program can use a function of a necessary kernel program by a system call. It is disclosed.

また、コンピュータシステムは、目的の処理を実行する前後において、ユーザモードからカーネルモードへ、あるいはカーネルモードからユーザモードへの移行を制御するために、内部レジスタ群やメモリ管理に関係する情報、バラメータ類の退避・復帰のためのコピー操作を行う。   In addition, the computer system controls information and parameters related to internal register groups and memory management in order to control the transition from the user mode to the kernel mode or from the kernel mode to the user mode before and after executing the target processing. Copy operations for saving and restoring files.

アプリケーションプログラムはユーザモードで実行され、必要に応じてカーネルモードに切り替えてOSが提供する機能を利用する。この動作モード切替えの際、コンピュータシステムは、上述したように内部レジスタやメモリ管理情報の退避・復帰等のオーバーヘッドが発生し、このため性能が劣化する。したがって、性能を向上させるためにはカーネルモードでプログラムを実行させるのが望ましいが、ユーザモードからのカーネル機能の呼出し方法と、カーネルモードからのカーネル機能の呼出し方法とが異なるため、同じ処理プログラムを、ユーザモード向けと、カーネルモード向けの2つ実装しなくてはならない場合があった。   The application program is executed in the user mode, and uses the function provided by the OS by switching to the kernel mode as necessary. When the operation mode is switched, the computer system generates overhead such as saving / returning internal registers and memory management information as described above, and the performance deteriorates. Therefore, in order to improve the performance, it is desirable to execute the program in the kernel mode. However, since the method of calling the kernel function from the user mode is different from the method of calling the kernel function from the kernel mode, the same processing program is executed. In some cases, it was necessary to implement two for user mode and one for kernel mode.

一方、特許文献1には、コンピュータシステムが、現在、スーパパイザモード(カーネルモード)、ユーザモードのいずれで動作しているかを認識する情報を共有メモリ上に割り付けられた仮想ステイタスレジスタに記録しておく技術が開示されている。すなわち、システムコール発生時、コンピュータシステムは、このメモリ上の情報を参照し、スーパバイザモードのとき、内部レジスタ類の退避・復元操作を行わず、ダイレクトに関数呼出しを行うことで、システムコール発生時の無用なレジスタ類の退避・復元操作をなくし、モード切替え時の処理の高速化をはかっている。   On the other hand, in Patent Document 1, information for recognizing whether a computer system is currently operating in a supervisor mode (kernel mode) or a user mode is recorded in a virtual status register allocated on a shared memory. Techniques are disclosed. In other words, when a system call occurs, the computer system refers to the information in this memory, and in supervisor mode, does not save and restore internal registers, but directly calls a function to generate a system call. This saves unnecessary register saving / restoring operations and speeds up the process when switching modes.

特開2001−109634号公報JP 2001-109634 A

A.S.タネンパウム,A.S.ウッドハル著「オペレーティングシステム第2版」プレンティスホール,1998年5月,pp24−50A. S. Tanenpaum, A.M. S. Woodhal "Operating System 2nd Edition" Prentice Hall, May 1998, pp 24-50

上述した非特許文献1に開示された技術の問題点は、性能を向上させるためにアプリケーションプログラムをカーネルモードで動作させる場合にプログラムを修正しなくてはならないことである。また、モード毎にアプリケーションプログラムを開発するため、生産性、保守性が悪くなることである。その理由は、いずれもカーネル機能の呼出しが、カーネルモードとユーザモードとでは異なることに起因する。   The problem of the technique disclosed in Non-Patent Document 1 described above is that the program must be corrected when the application program is operated in the kernel mode in order to improve performance. Further, since an application program is developed for each mode, productivity and maintainability are deteriorated. The reason is that the kernel function call is different between the kernel mode and the user mode.

これに対し、特許文献1に開示された技術では、システムコール発生時、メモリ上に記録された情報を参照し、カーネルモード時、退避・復元操作を省略してシステムコール発生時の処理の高速化をはかっている。このため、スーババイザモードのときの無用なレジスタやメモリ内容の退避・復元操作を必要としないことから処理の高速がはかれる。しかしながら、コンピュータシステムが、現在、どのモードで動作しているかを示す情報がメモリ上に記録され、この情報を参照してシステムコール発生時の退避・復元操作を制御するため、動作モード判定の高速化の面で新たな問題が生じる。   On the other hand, the technique disclosed in Patent Document 1 refers to information recorded in the memory when a system call occurs, skips save / restore operations in the kernel mode, and performs high-speed processing when the system call occurs. I am trying to make it. This eliminates the need for unnecessary register and memory contents saving / restoring operations in the supervisor mode, thereby speeding up the processing. However, information indicating in which mode the computer system is currently operating is recorded in the memory, and the save / restore operation when a system call occurs is controlled with reference to this information. A new problem arises in terms of conversion.

(発明の目的)
本発明の目的は、性能を向上させるためにアプリケーションプログラムをカーネルモードで動作させる場合のプログラム修正を不要とするとともに、動作モード判定の高速化をはかった、コンピュータシステム、および同システムにおけるアプリケーションプログラムのカーネルモード動作支援方法、ならびにカーネルモード動作支援プログラムを提供することにある。
(Object of invention)
An object of the present invention is to make it unnecessary to modify a program when an application program is operated in a kernel mode in order to improve performance, and to improve the operation mode determination, and to improve the speed of operation mode determination. It is an object to provide a kernel mode operation support method and a kernel mode operation support program.

本発明の第1のコンピュータシステムは、オペレーティングシステムが提供するカーネル機能を使用してアプリケーションプログラムを実行するコンピュータシステムであって、前記アプリケーションプログラムにより設定される動作モードを判定する動作モード判定部と、前記動作モード判定部により判定された動作モードに応じて前記カーネル機能の呼出し方法を選択する機能呼出し部と、を含む。   A first computer system of the present invention is a computer system that executes an application program using a kernel function provided by an operating system, and an operation mode determination unit that determines an operation mode set by the application program; A function call unit that selects a method for calling the kernel function according to the operation mode determined by the operation mode determination unit.

本発明の第2のコンピュータシステムにおけるアプリケーションプログラムのカーネルモード動作支援方法は、オペレーティングシステムが提供するカーネル機能を使用してアプリケーションプログラムを実行するコンピュータシステムにおけるアプリケーションプログラムのカーネルモード動作支援方法であって、前記アプリケーションプログラムにより設定される動作モードを判定する動作モード判定ステップと、前記判定された動作モードに応じて前記カーネル機能の呼出し方法を選択する機能呼出しステップと、を含む。   A kernel mode operation support method for an application program in a second computer system of the present invention is a kernel mode operation support method for an application program in a computer system that executes an application program using a kernel function provided by an operating system, An operation mode determination step for determining an operation mode set by the application program; and a function call step for selecting a method for calling the kernel function according to the determined operation mode.

本発明の第3のカーネルモード動作支援プログラムは、コンピュータ上で実行され、オペレーティングシステムが提供するカーネル機能を使用してアプリケーションプログラムを実行するコンピュータシステムのカーネルモード動作支援プログラムであって、前記コンピュータに、前記アプリケーションプログラムにより設定される動作モードを判定する動作モード判定処理と、前記判定された動作モードに応じて前記カーネル機能の呼出し方法を選択する機能呼出し処理と、を実行させる。   A third kernel mode operation support program according to the present invention is a kernel mode operation support program for a computer system that is executed on a computer and executes an application program using a kernel function provided by an operating system. Then, an operation mode determination process for determining an operation mode set by the application program and a function call process for selecting a method for calling the kernel function according to the determined operation mode are executed.

本発明によれば、性能を向上させるためにアプリケーションプログラムをカーネルモードで動作させる場合のプログラム修正を不要とするとともに、動作モード判定の高速化をはかった、コンピュータシステム、および同システムにおけるアプリケーションプログラムのカーネルモード動作支援方法、ならびにカーネルモード動作支援プログラムを提供することができる。   According to the present invention, it is not necessary to modify a program when an application program is operated in the kernel mode in order to improve performance, and the computer system and the application program in the system are improved in speeding up the operation mode determination. A kernel mode operation support method and a kernel mode operation support program can be provided.

その理由は、判定された動作モードに応じてカーネル機能の呼出し方法が自動的に選択されるためであり、更に、このとき、メモリを参照することなくモード判定を可能にするためである。   The reason is that the kernel function call method is automatically selected according to the determined operation mode, and further, at this time, the mode can be determined without referring to the memory.

本発明の第1の実施の形態によるコンピュータシステムの構成を示すブロック図である。It is a block diagram which shows the structure of the computer system by the 1st Embodiment of this invention. 本発明の第1の実施の形態によるコンピュータシステムのプロセッサユニットが実行するプログラム構造を機能展開して示したブロック図である。It is the block diagram which expanded the function and showed the program structure which the processor unit of the computer system by the 1st Embodiment of this invention performs. 本発明の第1の実施の形態によるコンピュータシステムの動作を示すフローチャートである。It is a flowchart which shows operation | movement of the computer system by the 1st Embodiment of this invention. 本発明の第2の実施の形態によるコンピュータシステムのプロセッサユニットが実行するプログラム構造を機能展開して示したブロック図である。It is the block diagram which expanded the function and showed the program structure which the processor unit of the computer system by the 2nd Embodiment of this invention performs. 本発明の第2の実施の形態によるコンピュータシステムの動作を示すフローチャートである。It is a flowchart which shows operation | movement of the computer system by the 2nd Embodiment of this invention.

次に、本発明の実施の形態について図面を参照して詳細に説明する。   Next, embodiments of the present invention will be described in detail with reference to the drawings.

(第1の実施の形態の構成)
図1は、本発明の第1の実施の形態によるコンピュータシステム1Aの構成を示すブロック図である。
(Configuration of the first embodiment)
FIG. 1 is a block diagram showing a configuration of a computer system 1A according to the first embodiment of the present invention.

図1を参照すると、本発明の第1の実施の形態によるコンピュータシステム1Aは、プロセッサユニット11と、主メモリ12と、補助メモリ13と、入出力装置14とを含む構成となっている。これらはいずれも、アドレス、データ、コントロールのためのラインが複数本で構成されるシステムバス15に共通に接続されている。   Referring to FIG. 1, a computer system 1A according to the first embodiment of the present invention includes a processor unit 11, a main memory 12, an auxiliary memory 13, and an input / output device 14. All of these are commonly connected to a system bus 15 including a plurality of lines for address, data, and control.

プロセッサユニット11は、コンピュータシステム1Aの制御中枢となり、主メモリ12に格納された各種プログラムを実行して演算制御を実行する他、システムバス15経由で接続された主メモリ12、補助メモリ13、入出力装置14を制御する。ここでは、プロセッサユニット11は、アプリケーションプログラムの実行により動的に設定される動作モードを保持するモードレジスタ110を内蔵する。プロセッサユニット11が実行するカーネルモード動作支援プログラムの構造は、図2を参照して後述する。   The processor unit 11 serves as a control center of the computer system 1A. The processor unit 11 executes various programs stored in the main memory 12 and executes arithmetic control. In addition to the main memory 12, the auxiliary memory 13, and the input connected via the system bus 15. The output device 14 is controlled. Here, the processor unit 11 includes a mode register 110 that holds an operation mode that is dynamically set by executing an application program. The structure of the kernel mode operation support program executed by the processor unit 11 will be described later with reference to FIG.

主メモリ12には、上述したOSやアプリケーションプログラムの他に、補助メモリ13や入出力装置14等の周辺装置を制御する入出力ドライバが割り付けられ格納される、それぞれの領域121、122、123、を有する他、これらプログラムが使用するデータ領域124を含み構成される。主メモリ12は、例えば、SRAMやDRAM等、ランダムアクセス可能な記憶デバイスや、不揮発性の半導体メモリデバイス等によって構成される。   In the main memory 12, in addition to the OS and application programs described above, input / output drivers for controlling peripheral devices such as the auxiliary memory 13 and the input / output device 14 are allocated and stored. The respective areas 121, 122, 123, And a data area 124 used by these programs. The main memory 12 includes, for example, a randomly accessible storage device such as SRAM or DRAM, a nonvolatile semiconductor memory device, or the like.

補助メモリ13には、主メモリ12には収容しきれない各種プログラムやデータが格納され、ハードディスク装置や、光ディスク装置等、大容量の不揮発性の記憶デバイスによって構成される。入出力装置14は、例えば、キーボードやLCD(Liquid Crystal Display Device)ディスプレイである。   The auxiliary memory 13 stores various programs and data that cannot be accommodated in the main memory 12, and is configured by a large-capacity nonvolatile storage device such as a hard disk device or an optical disk device. The input / output device 14 is, for example, a keyboard or an LCD (Liquid Crystal Display Device) display.

図2は、本発明の第1の実施の形態によるコンピュータシステム1Aのプロセッサユニット11が実行するカーネルモード動作支援プログラムの構造を機能展開して示したブロック図である。なお、カーネルモード動作支援プログラムは、OSの一部として、もしくは、OSやアプリケーションプログラムに属さないユーティリティプログラム等のミドルウエアとして主メモリ12に格納されるものとする。   FIG. 2 is a functional block diagram showing the structure of the kernel mode operation support program executed by the processor unit 11 of the computer system 1A according to the first embodiment of the present invention. It is assumed that the kernel mode operation support program is stored in the main memory 12 as part of the OS or as middleware such as a utility program that does not belong to the OS or application program.

図2を参照すると、プロセッサユニット11か実行するカーネルモード動作支援プログラムは、プログラム実行制御部111と、動作モード判定部112と、機能呼出し部113を含む構造になっている。   Referring to FIG. 2, the kernel mode operation support program executed by the processor unit 11 has a structure including a program execution control unit 111, an operation mode determination unit 112, and a function call unit 113.

プログラム実行制御部111は、主メモリ12に格納されたOS(領域121)、アプリケーションプログラム(領域122)、入出力ドライバ(領域123)等、各種プログラムを逐次読み出し実行する機能を有する。   The program execution control unit 111 has a function of sequentially reading and executing various programs such as an OS (area 121), an application program (area 122), and an input / output driver (area 123) stored in the main memory 12.

動作モード判定部112は、プログラムを実行するプロセッサユニット11が内蔵するモードレジスタ110を参照し、このモードレジスタ110に保持された動作モードを判定する機能を有する。   The operation mode determination unit 112 has a function of referring to a mode register 110 built in the processor unit 11 that executes a program and determining an operation mode held in the mode register 110.

機能呼出し部113は、動作モード判定部112により判定された動作モードに応じてカーネル機能の呼出し方法を選択する機能を有する。具体的に、機能呼出し部113は、モードレジスタ110に第1の動作モード(後述するユーザモード)が設定されていた場合、システムコールにより、第2の動作モード(後述するカーネルモード)が設定されていた場合、サブルーチンコールにより、カーネル機能の呼出しを選択して実行する。   The function call unit 113 has a function of selecting a kernel function call method according to the operation mode determined by the operation mode determination unit 112. Specifically, when the first operation mode (user mode described later) is set in the mode register 110, the function calling unit 113 sets the second operation mode (kernel mode described later) by a system call. If so, a kernel function call is selected and executed by a subroutine call.

なお、ここでいうカーネル機能とは、OSの中でハードウェアを直接管理し操作する最も中心的に機能部分をいい、例えば、アプリケーションプログラムが入出力指令を発行したときに、OSがこれを解釈して入出力ドライバを起動し、入出力ドライバによる入出力サービスを提供する機能をいう。   The kernel function here means the most central functional part that directly manages and operates the hardware in the OS. For example, when the application program issues an input / output command, the OS interprets this. The function that starts the input / output driver and provides the input / output service by the input / output driver.

(第1の実施の形態の動作) (Operation of the first embodiment)

上述した構成において、モードレジスタ110は、プロセッサユニット11の動作モードを決定するための情報を保持する。ここで、動作モードとは、ユーザモードと、カーネルモードをいう。ユーザモードで動作している場合、プロセッサユニット11は、決められた命令群の実行と、主メモリ12の固定したメモリ領域へのアクセスしか許されない。これに対し、カーネルモードで動作している場合にはこのような制限はない。   In the configuration described above, the mode register 110 holds information for determining the operation mode of the processor unit 11. Here, the operation mode refers to a user mode and a kernel mode. When operating in the user mode, the processor unit 11 is only allowed to execute a predetermined group of instructions and access a fixed memory area of the main memory 12. On the other hand, there is no such limitation when operating in kernel mode.

また、ユーザモードからカーネルモードへは、システムコール命令の発行により移行し、カーネルモードからユーザモードへは、割込み復帰命令により移行する。動作モードが変更されると、プログラム実行制御部111は、モードレジスタ110を更新する。そして、動作モード判定部1112は、モードレジスタ110の内容から現在の動作モードを判定し、機能呼出部113は、動作モード判定部112に設定された動作モードに応じたカーネル機能の呼出しを行う。このとき、機能呼出し部113は、ユーザモードの場合にシステムコールを発行し、カーネルモードの場合に通常のサブルーチン呼出しによりカーネル機能の呼出しを行う。   Further, the user mode is changed to the kernel mode by issuing a system call instruction, and the kernel mode is changed to the user mode by an interrupt return instruction. When the operation mode is changed, the program execution control unit 111 updates the mode register 110. Then, the operation mode determination unit 1112 determines the current operation mode from the contents of the mode register 110, and the function call unit 113 calls a kernel function according to the operation mode set in the operation mode determination unit 112. At this time, the function calling unit 113 issues a system call in the user mode, and calls a kernel function by a normal subroutine call in the kernel mode.

次に、本発明の第1の実施の形態によるコンピュータシステム1Aの動作について図3に示すフローチャートを参照して説明する。   Next, the operation of the computer system 1A according to the first embodiment of the present invention will be described with reference to the flowchart shown in FIG.

図3を参照すると、まず、プロセッサユニット11上で主メモリ12に格納されたアプリケーションプログラム(領域123)が起動され、その実行が開始される(ステップS301)。   Referring to FIG. 3, first, the application program (area 123) stored in the main memory 12 is started on the processor unit 11, and its execution is started (step S301).

アプリケーションプーグラムの実行に際し、プロセッサユニット11(プログラム実行制御部111)は、カーネル機能の呼出しの有無を判定する(ステップS302)。ここで、カーネル機能の呼出しの有無とは、例えば、アプリケーションプログラムに、入出力ドライバを含むOSに処理を委ねる入出力命令が記述されているか否かをいう。プログラム実行制御部111は、主メモリ12から読み出されるアプリケーションプログラムが、カーネル機能呼出し以外の通常命令を示していた場合は(ステップS302“NO”)、プログラム実行制御部111がその通常命令を実行する(ステップS303)。   When executing the application program, the processor unit 11 (program execution control unit 111) determines whether or not a kernel function is called (step S302). Here, the presence / absence of a kernel function call refers to, for example, whether or not an input / output instruction that entrusts processing to an OS including an input / output driver is described in an application program. When the application program read from the main memory 12 indicates a normal instruction other than a kernel function call (step S302 “NO”), the program execution control unit 111 executes the normal instruction. (Step S303).

一方、カーネル機能呼出しの場合(ステップS302“YES”)、プログラム実行制御部111は、動作モード判定部112に制御を移し、これを受けた動作モード判定部112は、モードレジスタ110を参照して(ステップS304)、現在の動作モードを判定して機能呼出し部113に制御を移す(ステップS305)。   On the other hand, in the case of a kernel function call (step S302 “YES”), the program execution control unit 111 transfers control to the operation mode determination unit 112, and the operation mode determination unit 112 that receives this refers to the mode register 110. (Step S304), the current operation mode is determined, and control is transferred to the function calling unit 113 (Step S305).

ここで、動作モードがユーザモードの場合(ステップS305“ユーザ”)、システムコールを発行してプログラム実行制御部111に制御を移し(ステップS306)、カーネルモードの場合(ステップS305”カーネル”)、機能呼出し部113は、そのままサブルーチンコールを実行する(ステップS307)。   If the operation mode is the user mode (step S305 “user”), a system call is issued to transfer control to the program execution control unit 111 (step S306). If the operation mode is the kernel mode (step S305 “kernel”), The function calling unit 113 executes a subroutine call as it is (step S307).

上述した処理は、プログラム終了まで繰り返し実行され、プログラム終了指示があれば(ステップS308“YES”)、プログラム実行制御部111は、プログラムの終了処理を行い(ステップS309)、アプリケーションプログラムによる一連の処理を終了する。   The above-described processing is repeatedly executed until the program ends, and if there is a program end instruction (step S308 “YES”), the program execution control unit 111 performs the program end processing (step S309), and a series of processing by the application program Exit.

(第1の実施の形態による効果)
本実施の形態によるコンピュータシステム1Aでは、アプリケーションプログラムからカーネル機能が呼び出される際に、動作モード判定部112で動作モードを判定後、機能呼出し部113が、適切なカーネル機能の呼出しを行うため、プログラマは、動作モードを意識する必要がなく、アプリケーションプログラムを開発することができる。したがって、アプリケーションプログラムの修正を要することなく、アプリケーションプログラムの生産性、保守性を高めることができる。
(Effects of the first embodiment)
In the computer system 1A according to the present embodiment, when a kernel function is called from an application program, the function call unit 113 calls an appropriate kernel function after the operation mode determination unit 112 determines the operation mode. Can develop an application program without having to be aware of the operation mode. Therefore, productivity and maintainability of the application program can be improved without requiring modification of the application program.

その理由は、ユーザが動作モードを意識せずにプログラムを開発することができるためである。   This is because the user can develop a program without being aware of the operation mode.

また、本実施の形態によるコンピュータシステム1Aでは、動作モード判定の際の高速処理を実現できる。   Further, the computer system 1A according to the present embodiment can realize high-speed processing at the time of operation mode determination.

その理由は、低速の主メモリ12を参照することなく、プロセッサユニット11が内蔵するモードレジスタ110を参照することによって動作モードの判定を可能とするためである。 This is because the operation mode can be determined by referring to the mode register 110 built in the processor unit 11 without referring to the low-speed main memory 12.

なお、図2のプロセッサユニット11が有する機能は、全てをソフトウェアによって実現しても、あるいはその少なくとも一部をハードウェアで実現してもよい。例えば、動作モード判定部112が、アプリケーションプログラムにより設定される動作モードを判定し、機能呼出し部113が、動作モード判定部112により判定された動作モードに応じてカーネル機能の呼出し方法を選択するデータ処理は、1または複数のプログラムによりコンピュータ上で実現してもよく、また、その少なくとも一部をハードウェアで実現してもよい。   2 may be realized entirely by software, or at least a part of them may be realized by hardware. For example, the operation mode determination unit 112 determines the operation mode set by the application program, and the function call unit 113 selects the kernel function call method according to the operation mode determined by the operation mode determination unit 112. The processing may be realized on a computer by one or a plurality of programs, and at least a part thereof may be realized by hardware.

(第2の実施の形態の構成)
図4は、本発明の第2の実施の形態によるコンピュータシステムのプロセッサユニットが実行するプログラムの構造を機能展開して示したブロック図である。なお、以下に説明する第2の実施の形態においても、上述した第1の実施の形態同様、図1に示すコンピュータシステム1Aが有する構成を利用することとする。
(Configuration of Second Embodiment)
FIG. 4 is a block diagram showing the function of the structure of the program executed by the processor unit of the computer system according to the second embodiment of the present invention. Also in the second embodiment described below, the configuration of the computer system 1A shown in FIG. 1 is used as in the first embodiment described above.

図4を参照すると、本発明の第2の実施の形態によるコンピュータシステム1Bは、第1の実施の形態1のプロセッサユニット11が実行するプログラム構造に、更に、フラグ領域125を含む構造になっている。このフラグ領域125は、主メモリ12の一部に割り付けられ、アプリケーションプログラムの実行に先だち動作モードが設定され、記憶されるものとする。   Referring to FIG. 4, a computer system 1B according to the second embodiment of the present invention has a structure that further includes a flag area 125 in addition to the program structure executed by the processor unit 11 of the first embodiment. Yes. This flag area 125 is allocated to a part of the main memory 12, and the operation mode is set and stored prior to the execution of the application program.

(第2の実施の形態の動作)
次に、本発明の第2の実施の形態によるコンピュータシステム1Bの動作について図5に示すフローチャートを参照して説明する。
(Operation of Second Embodiment)
Next, the operation of the computer system 1B according to the second embodiment of the present invention will be described with reference to the flowchart shown in FIG.

図5を参照すると、まず、プロセッサユニット11上で主メモリ12に格納されたアプリケーションプログラム(領域123)が起動され、その実行が開始される(ステップS501)。なお、本実施の形態2では、このプログラム開始に先立ち、予め動作モードが設定されており、ここで設定された動作モードは、フラグ領域125にモードフラグとして記録され、プログラム実行開始時に、この動作モードをモードレジスタ201へコピーするものとする(ステップS502)。   Referring to FIG. 5, first, an application program (area 123) stored in the main memory 12 is started on the processor unit 11, and its execution is started (step S501). In the second embodiment, the operation mode is set in advance prior to the start of the program, and the operation mode set here is recorded as a mode flag in the flag area 125, and this operation is performed when the program execution is started. It is assumed that the mode is copied to the mode register 201 (step S502).

アプリケーションプーグラムの実行に際し、プロセッサユニット11(プログラム実行制御部111)は、カーネル機能の呼出しの有無を判定する(ステップS503)。プログラム実行制御部111は、主メモリ12から読み出されるアプリケーションプログラムが、カーネル機能呼出し以外の通常命令を示していた場合は(ステップS503“NO”)、プログラム実行制御部111がその通常命令を実行する(ステップS504)。   When executing the application program, the processor unit 11 (program execution control unit 111) determines whether or not a kernel function is called (step S503). When the application program read from the main memory 12 indicates a normal instruction other than the kernel function call (step S503 “NO”), the program execution control unit 111 executes the normal instruction. (Step S504).

一方、カーネル機能呼出しの場合(ステップS503“YES”)、プログラム実行制御部111は、動作モード判定部112に制御を移し、これを受けた動作モード判定部112は、モードレジスタ110を参照して(ステップS505)、現在の動作モードを判定して機能呼出し部113に制御を移す(ステップS506)。   On the other hand, in the case of a kernel function call (step S503 “YES”), the program execution control unit 111 transfers control to the operation mode determination unit 112, and the operation mode determination unit 112 that receives this refers to the mode register 110. (Step S505) The current operation mode is determined, and the control is transferred to the function calling unit 113 (Step S506).

ここで、動作モードがユーザモードの場合(ステップS506“ユーザ”)、システムコールを発行してプログラム実行制御部111に制御を移し(ステップS507)、カーネルモードの場合(ステップS506”カーネル”)、機能呼出し部113は、そのままサブルーチンコールを実行する(ステップS508)。   When the operation mode is the user mode (step S506 “user”), a system call is issued to transfer control to the program execution control unit 111 (step S507). When the operation mode is the kernel mode (step S506 “kernel”), The function calling unit 113 executes the subroutine call as it is (step S508).

上述した処理は、プログラム終了まで繰り返し実行され、プログラム終了指示があれば(ステップS509“YES”)、プログラム実行制御部111は、プログラムの終了処理を行い(ステップS510)、アプリケーションプログラムによる一連の処理を終了する。   The process described above is repeatedly executed until the program ends, and if there is a program end instruction (“YES” in step S509), the program execution control unit 111 performs a program end process (step S510), and a series of processes by the application program Exit.

(第2の実施の形態による効果)
本実施の形態によるコンピュータシステム1Bでは、実行するアプリケーションプログラムの動作モードをフラグ領域125に予め設定しておき、動作モード判定部112で動作モードを判定後、機能呼出し部113が適切なカーネル機能の呼出しを行なう。このため、上述した第1の実施の形態同様、プログラマは、動作モードを意識せずにアプリケーションプログラムを開発することができる。したがって、アプリケーションプログラムの修正を要することなく、アプリケーションプログラムの生産性、保守性を高めることができる。
(Effects of the second embodiment)
In the computer system 1B according to the present embodiment, the operation mode of the application program to be executed is set in the flag area 125 in advance, and after the operation mode determination unit 112 determines the operation mode, the function call unit 113 has an appropriate kernel function. Make a call. Therefore, as in the first embodiment described above, the programmer can develop an application program without being aware of the operation mode. Therefore, productivity and maintainability of the application program can be improved without requiring modification of the application program.

その理由は、ユーザが動作モードを意識せずにプログラムを開発することができるためである。   This is because the user can develop a program without being aware of the operation mode.

また、本実施の形態によるコンピュータシステム1Bでは、動作モード判定の際の高速処理を実現できる。   In the computer system 1B according to the present embodiment, high-speed processing at the time of operation mode determination can be realized.

その理由は、一旦、フラグ領域125に設定されたモードフラグの内容をプロセッサユニット11が内蔵するモードレジスタ110にコピーし、動作モード判定部112がこのモードレジスタ110を参照することによって動作モードの判定を可能とするためである。   The reason is that, once the content of the mode flag set in the flag area 125 is copied to the mode register 110 built in the processor unit 11, the operation mode determination unit 112 refers to this mode register 110 to determine the operation mode. This is to make it possible.

なお、図4のプロセッサユニット11が有する機能は、全てをソフトウェアによって実現しても、あるいはその少なくとも一部をハードウェアで実現してもよい。例えば、動作モード判定部112が、アプリケーションプログラムにより設定される動作モードを判定し、機能呼出し部113が、動作モード判定部112により判定された動作モードに応じてカーネル機能の呼出し方法を選択するデータ処理は、1または複数のプログラムによりコンピュータ上で実現してもよく、また、その少なくとも一部をハードウェアで実現してもよい。   Note that all of the functions of the processor unit 11 in FIG. 4 may be realized by software, or at least a part thereof may be realized by hardware. For example, the operation mode determination unit 112 determines the operation mode set by the application program, and the function call unit 113 selects the kernel function call method according to the operation mode determined by the operation mode determination unit 112. The processing may be realized on a computer by one or a plurality of programs, and at least a part thereof may be realized by hardware.

以上好ましい実施の形態と実施例をあげて本発明を説明したが、本発明は必ずしも、上述実施の形態及び実施例に限定されるものでなく、その技術的思想の範囲内において様々に変形して実施することができる。   Although the present invention has been described with reference to the preferred embodiments and examples, the present invention is not necessarily limited to the above-described embodiments and examples, and various modifications may be made within the scope of the technical idea. Can be implemented.

本発明は、アプリケーションプログラムのカーネルモード動作による高速化の用途全般に適用が可能である。   The present invention can be applied to all uses for speeding up the application program in the kernel mode operation.

1A、1B:コンピュータシステム
11:プロセッサユニット
12:主メモリ
13:補助メモリ
14:入出力装置
15:システムバス
110:モードレジスタ
111:プログラム実行制御部
112:動作モード判定部
113:機能呼出し部
125:フラグ領域
1A, 1B: Computer system 11: Processor unit 12: Main memory 13: Auxiliary memory 14: Input / output device 15: System bus 110: Mode register 111: Program execution control unit 112: Operation mode determination unit 113: Function call unit 125: Flag area

Claims (12)

オペレーティングシステムが提供するカーネル機能を使用してアプリケーションプログラムを実行するコンピュータシステムであって、
前記アプリケーションプログラムにより設定される動作モードを判定する動作モード判定部と、
前記動作モード判定部により判定された動作モードに応じて前記カーネル機能の呼出し方法を選択する機能呼出し部と、
を備えたことを特徴とするコンピュータシステム。
A computer system that executes an application program using a kernel function provided by an operating system,
An operation mode determination unit for determining an operation mode set by the application program;
A function calling unit that selects a calling method of the kernel function according to the operation mode determined by the operation mode determination unit;
A computer system comprising:
前記動作モード判定部は、
前記アプリケーションプログラムを実行するプロセッサユニットが内蔵するモードレジスタを参照し、前記モードレジスタに保持された動作モードを判定することを特徴とする請求項1記載のコンピュータシステム。
The operation mode determination unit
2. The computer system according to claim 1, wherein an operation mode held in the mode register is determined with reference to a mode register built in a processor unit that executes the application program.
前記アプリケーションプログラムの実行に先だち動作モードが設定されるフラグメモリを有し、
前記動作モード判定部は、
前記フラグメモリに設定された動作モードを前記モードレジスタに保持することを特徴とする請求項1または請求項2記載のコンピュータシステム。
A flag memory in which an operation mode is set prior to execution of the application program;
The operation mode determination unit
3. The computer system according to claim 1, wherein the operation mode set in the flag memory is held in the mode register.
前記機能呼出し部は、
前記モードレジスタに第1の動作モードが設定されていた場合、システムコールにより、第2の動作モードが設定されていた場合、サブルーチンコールにより、前記カーネル機能の呼出しを実行することを特徴とする請求項1から請求項3のいずれか1項記載のコンピュータシステム。
The function calling unit is
The kernel function is called by a subroutine call when the second operation mode is set by a system call when the first operation mode is set in the mode register. The computer system according to any one of claims 1 to 3.
オペレーティングシステムが提供するカーネル機能を使用してアプリケーションプログラムを実行するコンピュータシステムにおけるアプリケーションプログラムのカーネルモード動作支援方法であって、
前記アプリケーションプログラムにより設定される動作モードを判定する動作モード判定ステップと、
前記判定された動作モードに応じて前記カーネル機能の呼出し方法を選択する機能呼出しステップと、
を有することを特徴とするアプリケーションプログラムのカーネルモード動作支援方法。
A kernel mode operation support method for an application program in a computer system that executes an application program using a kernel function provided by an operating system,
An operation mode determination step for determining an operation mode set by the application program;
A function call step of selecting a method of calling the kernel function according to the determined operation mode;
A kernel mode operation support method for an application program, comprising:
前記動作モード判定ステップは、
前記アプリケーションプログラムを実行するプロセッサユニットが内蔵するモードレジスタを参照し、前記モードレジスタに保持された動作モードを判定するサブステップを含むことを特徴とする請求項5記載のアプリケーションプログラムのカーネルモード動作支援方法。
The operation mode determination step includes
6. The kernel mode operation support of an application program according to claim 5, further comprising a sub-step of referring to a mode register built in a processor unit that executes the application program and determining an operation mode held in the mode register. Method.
前記動作モード判定ステップは、
前記アプリケーションプログラムの実行に先だち動作モードが設定されるフラグメモリに設定された動作モードを前記モードレジスタに保持するサブステップを含むことを特徴とする請求項5または請求項6記載のアプリケーションプログラムのカーネルモード動作支援方法。
The operation mode determination step includes
7. The kernel of the application program according to claim 5, further comprising a sub-step of holding in the mode register an operation mode set in a flag memory in which an operation mode is set prior to execution of the application program. Mode operation support method.
前記機能呼出しステップは、
前記モードレジスタに第1の動作モードが設定されていた場合、システムコールにより、第2の動作モードが設定されていた場合、サブルーチンコールにより、前記カーネル機能の呼出しを実行するサブステップを含むことを特徴とする請求項5から請求項7のいずれか1項記載のアプリケーションプログラムのカーネルモード動作支援方法。
The function calling step includes:
Including a sub-step for executing a call to the kernel function by a subroutine call when the second operation mode is set by a system call when the first operation mode is set in the mode register. The kernel mode operation support method for an application program according to any one of claims 5 to 7.
コンピュータ上で実行され、オペレーティングシステムが提供するカーネル機能を使用してアプリケーションプログラムを実行するコンピュータシステムのカーネルモード動作支援プログラムであって、
前記コンピュータに、
前記アプリケーションプログラムにより設定される動作モードを判定する動作モード判定処理と、
前記判定された動作モードに応じて前記カーネル機能の呼出し方法を選択する機能呼出し処理と、
を実行させることを特徴とするカーネルモード動作支援プログラム。
A computer system kernel mode operation support program that is executed on a computer and executes an application program using a kernel function provided by an operating system,
In the computer,
An operation mode determination process for determining an operation mode set by the application program;
A function call process for selecting a call method of the kernel function according to the determined operation mode;
A kernel mode operation support program characterized by causing
前記動作モード判定処理は、
前記アプリケーションプログラムを実行するプロセッサユニットが内蔵するレジスタを参照し、前記レジスタに保持された動作モードを判定することを特徴とする請求項9記載のカーネルモード動作支援プログラム。
The operation mode determination process includes
The kernel mode operation support program according to claim 9, wherein an operation mode held in the register is determined with reference to a register built in a processor unit that executes the application program.
前記動作モード判定処理は、
前記アプリケーションプログラムの実行に先だち動作モードが設定されるフラグメモリに設定された動作モードを前記モードレジスタに保持することを特徴とする請求項9または請求項10記載のカーネルモード動作支援プログラム。
The operation mode determination process includes
11. The kernel mode operation support program according to claim 9, wherein an operation mode set in a flag memory in which an operation mode is set prior to execution of the application program is held in the mode register.
前記機能呼出し処理は、
前記モードレジスタに第1の動作モードが設定されていた場合、システムコールにより、第2の動作モードが設定されていた場合、サブルーチンコールにより、前記カーネル機能の呼出しを実行することを特徴とする請求項9から請求項11のいずれか1項記載のカーネルモード動作支援プログラム。
The function call process is
When the first operation mode is set in the mode register, the kernel function is called by a subroutine call when the second operation mode is set by a system call. The kernel mode operation support program according to any one of claims 9 to 11.
JP2009123492A 2009-05-21 2009-05-21 Computer system and method for supporting kernel mode operation of application program Pending JP2010271945A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009123492A JP2010271945A (en) 2009-05-21 2009-05-21 Computer system and method for supporting kernel mode operation of application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009123492A JP2010271945A (en) 2009-05-21 2009-05-21 Computer system and method for supporting kernel mode operation of application program

Publications (1)

Publication Number Publication Date
JP2010271945A true JP2010271945A (en) 2010-12-02

Family

ID=43419916

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009123492A Pending JP2010271945A (en) 2009-05-21 2009-05-21 Computer system and method for supporting kernel mode operation of application program

Country Status (1)

Country Link
JP (1) JP2010271945A (en)

Similar Documents

Publication Publication Date Title
KR100746797B1 (en) Processor and information processing method
JP5323828B2 (en) Virtual machine control device, virtual machine control program, and virtual machine control circuit
JP5655677B2 (en) Hypervisor replacement method and information processing apparatus
KR100848603B1 (en) A data processing apparatus and method for saving return state
JP5385347B2 (en) Method and computer for enlarging free memory in main memory
US10242420B2 (en) Preemptive context switching of processes on an accelerated processing device (APD) based on time quanta
US9092255B2 (en) Multi-core processor system, computer product, and control method for interrupt execution
US9043806B2 (en) Information processing device and task switching method
US9563466B2 (en) Method and apparatus for supporting programmable software context state execution during hardware context restore flow
US20200050478A1 (en) Data processing systems
JP2009157684A (en) Virtualization program, simulation device, and virtualization method
JP2006351013A (en) Method and system for storing/restoring procedure in electronic equipment
JP2005050208A (en) Memory managing system in multi-task system and task controller
US9122522B2 (en) Software mechanisms for managing task scheduling on an accelerated processing device (APD)
JP2011060225A (en) Operating system booting method
JP2006243864A (en) Processor and information processing method
JP2014503898A (en) Method and system for synchronous operation of processing equipment
US20120188259A1 (en) Mechanisms for Enabling Task Scheduling
JP5131269B2 (en) Multi-processing system
JP2010271945A (en) Computer system and method for supporting kernel mode operation of application program
JP5017784B2 (en) Processor and interrupt processing control method applied to the processor
JP5858947B2 (en) Information processing apparatus and operating frequency / operating voltage control method
JP2005275703A (en) Processor, and context switching method
US20130155079A1 (en) Saving and Restoring Shader Context State
JPS61184644A (en) Control system of virtual computer system