JP2005284925A - Computer system and program update method - Google Patents

Computer system and program update method Download PDF

Info

Publication number
JP2005284925A
JP2005284925A JP2004100444A JP2004100444A JP2005284925A JP 2005284925 A JP2005284925 A JP 2005284925A JP 2004100444 A JP2004100444 A JP 2004100444A JP 2004100444 A JP2004100444 A JP 2004100444A JP 2005284925 A JP2005284925 A JP 2005284925A
Authority
JP
Japan
Prior art keywords
function
subroutine
address
memory
program
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
JP2004100444A
Other languages
Japanese (ja)
Inventor
Masaaki Yoshimoto
正明 吉本
Seiichi Saruta
誠一 猿田
Takashi Mizukami
貴司 水上
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co 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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP2004100444A priority Critical patent/JP2005284925A/en
Publication of JP2005284925A publication Critical patent/JP2005284925A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To update an executed program without stopping processes in a computer system for executing programs on an OS such as Linux(R) or UNIX(R). <P>SOLUTION: The computer system comprises a symbol table 9 for holding, for every function included in an executed program, address information indicating the address on memory where the function is stored, interface function calling means for calling and executing an interface function 12 for jumping to a called function, calling means for detecting the address on memory that corresponds to the called function by reference to the symbol table 9 and calling and executing the function in the detected address, and table updating means for loading a new function 14 corresponding to an old function 13 to be corrected on memory and rewriting the corresponding address in the symbol table 9 with the address where the new function 14 is loaded. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、Linux・UNIX(登録商標)などのマルチプロセス・マルチCPU(Central Processing Unit)のOS(オペレーティングシステム)により、プログラムの実行を行うコンピュータシステムおいて、プロセスを停止することなく、実行プログラムを更新するプログラム更新方法に関するものである。   The present invention relates to an execution program without stopping a process in a computer system that executes a program by an OS (operating system) of a multi-process / multi-CPU (Central Processing Unit) such as Linux / UNIX (registered trademark). The present invention relates to a method for updating a program.

一般に、Linux・UNIX(登録商標)をOSとするコンピュータシステムは、実行中のプログラムを更新するときに、以下の手順を取る。
1)新しいプログラムをハードディスクにインストールする。
2)実行中の古いプログラムを停止する。
3)新しいプログラムを起動する。
In general, a computer system using Linux / UNIX (registered trademark) as an OS takes the following procedure when updating a running program.
1) Install a new program on the hard disk.
2) Stop the old program that is running.
3) Start a new program.

また、従来のプログラム更新方式として、特許文献「特開平7−319683号公報」に記載されるような方式がある。さらに特許文献「特開平7−152551号公報」に記載されるような方式がある。
従来のプログラム更新方式について図6〜図8を用いて説明する。図6は、従来技術によるコンピュータシステムの第1のプロセス内の構成を示す図である。図7は、従来技術によるコンピュータシステムの第2のプロセス内の構成を示す図である。図8は、従来技術によるコンピュータシステムの第3のプロセス内の構成を示す図である。図6〜図8に示されるプロセス内の構成は、スレッド15A、旧関数13、新関数14、関数追加スレッド15Bである。
Further, as a conventional program update method, there is a method as described in the patent document “Japanese Patent Laid-Open No. 7-319683”. Further, there is a system as described in the patent document “Japanese Patent Laid-Open No. 7-152551”.
A conventional program update method will be described with reference to FIGS. FIG. 6 is a diagram showing a configuration in a first process of a computer system according to the prior art. FIG. 7 is a diagram showing the configuration in the second process of the computer system according to the prior art. FIG. 8 is a diagram showing the configuration in the third process of the computer system according to the prior art. 6 to 8 are a thread 15A, an old function 13, a new function 14, and a function addition thread 15B.

図6に示されるように、スレッド15Aにより呼び出される旧関数13のアドレスnnn1にある旧関数を、関数追加スレッド15Bにより呼び出される新関数14のアドレスmmm1にある新関数に置き換えるとする。特開平7−319683号公報に記載されるような方式では、図7に示されるステップS1のように旧関数13の上部の命令を、新関数14へジャンプするように書き換えることで、関数の置換えを実現している。よって、これ以後、プロセス内の全スレッドは、旧関数13のアドレスnnn2を読み込むと、新関数14の先頭アドレスへジャンプし、新関数14を呼び出すことになる。 As shown in FIG. 6, it is assumed that the old function at the address nnn1 of the old function 13 called by the thread 15A is replaced with the new function at the address mmm1 of the new function 14 called by the function addition thread 15B. In the method described in Japanese Patent Application Laid-Open No. 7-319683, function replacement is performed by rewriting the instruction above the old function 13 so as to jump to the new function 14 as in step S1 shown in FIG. Is realized. Therefore, after that, when all the threads in the process read the address nnn2 of the old function 13, they jump to the top address of the new function 14 and call the new function 14.

ここで、従来方式では、旧関数13の命令書き換え時に、レジスタに新関数14のアドレスを蓄積する命令(図7の旧関数13のアドレスnnn1に相当)、及びレジスタに登録されたアドレスへジャンプする命令(図7の旧関数13のアドレスnnn2に相当)の2つの命令を書き換えなければならない。一般に、CPUが一度に処理できる命令は、32ビットまたは64ビットまでであるが、2つの命令を書き換えるには、64ビット以上の命令が必要であり、同時に2つの命令を書き換えることはできない。そこで、マルチプロセッサ環境でプログラム更新を実施する場合、他プロセスが更新途中の関数を呼び出さないように、ロックする必要があり、図7に示されるステップS2のように更新途中の関数を呼び出そうとしてもロックされているため、サービス提供中のプロセスを停止させてしまう可能性がある。UNIX(登録商標)やLinuxをOSとするコンピュータシステムでは、コンテキストスイッチ(CPUが処理中のスレッドの処理をやめ、別のスレッドの処理を開始すること)の間隔は10msecであり、ロックさせられたプロセスは、10msec以上待機させられることとなる。 Here, in the conventional method, when the instruction of the old function 13 is rewritten, the instruction for storing the address of the new function 14 in the register (corresponding to the address nnn1 of the old function 13 in FIG. 7) and the address registered in the register are jumped. Two instructions of the instruction (corresponding to the address nnn2 of the old function 13 in FIG. 7) must be rewritten. In general, instructions that can be processed by the CPU at a time are up to 32 bits or 64 bits. However, in order to rewrite two instructions, an instruction of 64 bits or more is required, and two instructions cannot be rewritten at the same time. Therefore, when updating a program in a multiprocessor environment, it is necessary to lock so that other processes do not call the function being updated. Call the function being updated as in step S2 shown in FIG. Since it is locked, there is a possibility of stopping the process that is providing the service. In a computer system using UNIX (registered trademark) or Linux as the OS, the interval of the context switch (the CPU stops the processing of the thread being processed and starts the processing of another thread) is 10 msec and is locked. The process will be kept waiting for 10 msec or longer.

また、他のプロセスが更新途中の関数を呼び出さないためのロックをしない場合、図8に示されるステップS3ように、スレッド15Aが更新途中の関数を読み込んでしまうことがある。するとアドレスnnn1とアドレスnnn2の内容が一致しないため、サービス提供中のプロセスがエラーとなる可能性がある。
特開平7−319683号公報 特開平7−152551号公報
Further, when the lock is not performed so that another process does not call the function being updated, the thread 15A may read the function being updated as shown in step S3 in FIG. Then, since the contents of the address nnn1 and the address nnn2 do not match, there is a possibility that the process that is providing the service has an error.
JP-A-7-319683 Japanese Patent Laid-Open No. 7-152551

上述のように、特開平7−319683号公報に記載されるような方式を用いた場合、プログラム関数更新時、関数更新を実施するプロセスが、他のプロセスが更新途中の関数を呼び出さないように更新対象関数をロックする必要があるため、サービス提供中のプロセスが更新対象関数へアクセスすると、更新完了まで停止させられてしまうという課題があった。
また、更新対象関数をロックせずに関数更新を実施すると、サービス提供中のプロセスがエラーとなるという課題があった。
As described above, when a method as described in Japanese Patent Laid-Open No. 7-319683 is used, when updating a program function, the process that performs the function update prevents other processes from calling the function being updated. Since it is necessary to lock the update target function, there is a problem that if the process providing the service accesses the update target function, it is stopped until the update is completed.
Further, when the function update is performed without locking the update target function, there is a problem that a process that provides a service results in an error.

そこで、本発明では、インタフェース関数と関数シンボルのテーブルを用意し、関数更新時は、1つの命令のみを書き換えることで、サービス提供中のプロセスを停止せずに関数更新を実現する。 Therefore, in the present invention, a table of interface functions and function symbols is prepared, and at the time of function update, only one instruction is rewritten, thereby realizing function update without stopping the service providing process.

かかる課題を解決するため、本発明によるコンピュータシステムは、実行対象のプログラムに含まれるサブルーチン毎にそのサブルーチンが格納されているメモリ上の先頭アドレスを示すアドレス情報を保持するアドレス管理テーブルと、呼び出し対象のサブルーチンにジャンプさせるためのインタフェースサブルーチンを呼び出して実行するインタフェースサブルーチン呼び出し手段と、アドレス管理テーブルを参照して呼び出し対象のサブルーチンに対応するメモリ上の先頭アドレスを検出し、その検出された先頭アドレスのサブルーチンを呼び出しで実行するサブルーチン呼び出し手段と、更新対象のサブルーチンに対応する新たなサブルーチンをメモリ上にロードし、アドレス管理テーブルの該当するエントリアドレスを、新たなサブルーチンをロードした先頭アドレスに書き換えるテーブル更新手段とを備えることを特徴とする。   In order to solve such a problem, a computer system according to the present invention includes an address management table that holds address information indicating a head address on a memory in which a subroutine is stored for each subroutine included in a program to be executed, and a call target. The interface subroutine calling means for calling and executing the interface subroutine for jumping to the subroutine of the above, and the head address on the memory corresponding to the subroutine to be called are detected by referring to the address management table, and the detected head address A subroutine calling means for executing a subroutine by calling and a new subroutine corresponding to the subroutine to be updated are loaded into the memory, and the corresponding entry address of the address management table is loaded into the new support. Characterized in that it comprises a table updating means for rewriting the start address loaded routine.

また本発明によるプログラム更新方法は、実行対象のプログラムに含まれる各サブルーチン毎にそのサブルーチンが格納されているメモリ上の先頭アドレスを示すアドレス情報をメモリ上に登録し、実行対象のプログラムのサブルーチン呼び出し命令に応答して、呼び出し対象のサブルーチンにジャンプさせるためのインタフェースサブルーチンを呼び出して実行し、アドレス情報を参照して呼び出し対象のサブルーチンに対応するメモリ上の先頭アドレスを検出し、その検出された先頭アドレスのサブルーチンを呼び出して実行し、更新対象のサブルーチンに対応する新たなサブルーチンをメモリ上にロードし、アドレス情報の該当するエントリアドレスを、新たなサブルーチンをロードした先頭アドレスに書き換えることを特徴とする。   The program update method according to the present invention registers, for each subroutine included in the execution target program, address information indicating the top address on the memory in which the subroutine is stored on the memory, and calls the subroutine of the execution target program. In response to the instruction, the interface subroutine for jumping to the subroutine to be called is called and executed, the address information is referenced to detect the start address on the memory corresponding to the subroutine to be called, and the detected head Calling and executing the subroutine of the address, loading a new subroutine corresponding to the subroutine to be updated onto the memory, and rewriting the corresponding entry address of the address information to the head address loaded with the new subroutine .

発明の効果として、本発明のコンピュータシステムおよびプログラム更新方法によれば、サービス提供スレッドやプロセスを停止することなく、実行プログラムを更新することができ、プログラムの問題対処や機能変更・機能追加が可能となる。   As an effect of the invention, according to the computer system and the program update method of the present invention, it is possible to update the execution program without stopping the service providing thread and the process, and it is possible to cope with the problem of the program, change the function, and add the function. It becomes.

本発明によるLinux・UNIX(登録商標)をOSとするコンピュータシステムおよびプログラム更新方法は、インタフェース関数とシンボルテーブル(関数シンボルのテーブル)を備え、以下に記載される実施例1および実施例2を用いて説明される。   A computer system and program update method using Linux / UNIX (registered trademark) as an OS according to the present invention includes an interface function and a symbol table (function symbol table), and uses Examples 1 and 2 described below. Explained.

以下、本発明によるコンピュータシステムおよびプログラム更新方法の実施例1は、図1〜図3を用いて説明される。図1は本発明によるコンピュータシステムの構成を示す図である。図2は本発明によるコンピュータシステムのプロセス内の構成を示す図である。図3は本発明によるコンピュータシステムのプロセス動作を示すフローチャート図である。   Embodiment 1 of a computer system and a program update method according to the present invention will be described below with reference to FIGS. FIG. 1 is a diagram showing the configuration of a computer system according to the present invention. FIG. 2 is a diagram showing a configuration in the process of the computer system according to the present invention. FIG. 3 is a flowchart showing the process operation of the computer system according to the present invention.

まず、本発明によるコンピュータシステムの構成が、図1を用いて説明される。コンピュータシステムは、オンラインシステムを構築する複数のコンピュータシステムの1つであり、ネットワーク1を介して他のシステムと接続されている。
図1において、コンピュータシステムはCPU2、メインメモリ3、通信制御ユニット4、外部記憶装置としてハードディスク5が設けられており、これらはシステムバス6を介して相互接続されている。
First, the configuration of a computer system according to the present invention will be described with reference to FIG. The computer system is one of a plurality of computer systems that construct an online system, and is connected to other systems via the network 1.
In FIG. 1, a computer system is provided with a CPU 2, a main memory 3, a communication control unit 4, and a hard disk 5 as an external storage device, which are interconnected via a system bus 6.

CPU2は、このコンピュータシステム全体を制御するためのものであり、メインメモリ3のOS7や各種アプリケーションプログラムを実行する。メインメモリ3はOS7、実行対象のアプリケーションプログラム8、シンボルテーブル9を格納する。 The CPU 2 controls the entire computer system, and executes the OS 7 and various application programs in the main memory 3. The main memory 3 stores an OS 7, an application program 8 to be executed, and a symbol table 9.

OS7は、システム管理のための各種プログラムから構成されており、ここには本発明のプログラム実行を実現するために必要なインタフェース関数管理プログラム10と関数更新管理プログラム11が組み込まれている。   The OS 7 includes various programs for system management, and an interface function management program 10 and a function update management program 11 necessary for realizing the program execution of the present invention are incorporated therein.

インタフェース関数管理プログラム10は、スレッドにより呼び出し対象の関数が呼び出されるときにインタフェース関数12を呼び出し、メインメモリ3に格納されたシンボルテーブル9を読み込み、該当するエントリアドレスを取得し、そのアドレスにジャンプさせる。一般に関数はサブルーチンとも呼ばれる。関数更新管理プログラム11は、新たな関数をハードディスク5またはネットワーク1からメインメモリ3の空き領域にロードして、シンボルテーブル9の該当するエントリアドレスを更新前の関数の先頭アドレスから新たな関数の先頭アドレスに変更する。   The interface function management program 10 calls the interface function 12 when a function to be called is called by a thread, reads the symbol table 9 stored in the main memory 3, acquires the corresponding entry address, and jumps to that address. . In general, a function is also called a subroutine. The function update management program 11 loads a new function from the hard disk 5 or the network 1 to an empty area of the main memory 3, and changes the corresponding entry address of the symbol table 9 from the start address of the function before the update to the start of the new function. Change to address.

アプリケーションプログラム8においては、インタフェース関数12は、呼び出し対象の関数を呼び出すものであるが、その呼び出し先の関数のエントリアドレスは、インタフェース関数12には組み込まれておらず、そのエントリアドレスはシンボルテーブル9を参照することによって求められ、呼び出し対象の関数、例えば、旧関数13や新関数14へジャンプさせる。   In the application program 8, the interface function 12 calls a function to be called, but the entry address of the call destination function is not incorporated in the interface function 12, and the entry address is the symbol table 9. , And jump to the function to be called, for example, the old function 13 or the new function 14.

シンボルテーブル9は、アプリケーションプログラム8に含まれる関数毎に、メインメモリ3のエントリアドレスを格納する。そのエントリアドレスはインタフェース関数12が呼び出された時、どの関数へジャンプするかを知らせるための各呼び出し対象関数の先頭アドレスである。   The symbol table 9 stores the entry address of the main memory 3 for each function included in the application program 8. The entry address is the head address of each function to be called for informing which function to jump to when the interface function 12 is called.

通信制御ユニット4は、ネットワーク1を介して他のシステムとの通信を実行するためのものであり、例えば、新関数14をネットワーク1からダウンロードするために用いられる。ハードディスク5は、コンピュータシステムの二次記憶装置として利用されるものであり、各種プログラムやファイルが格納されている。   The communication control unit 4 is for performing communication with other systems via the network 1, and is used for downloading the new function 14 from the network 1, for example. The hard disk 5 is used as a secondary storage device of a computer system, and stores various programs and files.

次に、本発明によるコンピュータシステムのプロセス内の構成が、図2を用いて説明される。
図2において、本発明によるコンピュータシステムのプロセス内の構成は、シンボルテーブル9、1つ以上のインタフェース関数12、旧関数13や新関数14などの関数、インタフェース関数管理プログラム10が持つ通常のサービスを提供する1つ以上のスレッド15、関数更新管理プログラム11がもつ関数更新管理スレッド16である。
Next, the configuration in the process of the computer system according to the present invention will be described with reference to FIG.
In FIG. 2, the configuration in the process of the computer system according to the present invention includes a symbol table 9, one or more interface functions 12, functions such as an old function 13 and a new function 14, and normal services that the interface function management program 10 has. One or more threads 15 to be provided are a function update management thread 16 included in the function update management program 11.

インタフェース関数12は、スレッド15が呼び出し対象の関数を呼び出すときに、常に呼び出される関数である。各スレッド15は、直接的に関数を呼び出すことはなく、最初にインタフェース関数12を呼び出し、インタフェース関数12の中の処理で、実際の呼び出し対象の関数へジャンプする。   The interface function 12 is a function that is always called when the thread 15 calls a function to be called. Each thread 15 does not call a function directly, but first calls the interface function 12 and jumps to the actual function to be called by the processing in the interface function 12.

シンボルテーブル9は、インタフェース関数12が呼び出されたとき、どの関数へジャンプするかを知らせるための各関数の先頭アドレスが格納されている。例えば、図2に示されるように、更新前の関数である旧関数foo13のエントリをシンボルテーブル9の1番目とする場合、シンボルテーブル9の1番目のエントリには関数fooの先頭アドレスxxx1が入力される。   The symbol table 9 stores the start address of each function for notifying which function to jump to when the interface function 12 is called. For example, as shown in FIG. 2, when the entry of the old function foo13 that is a function before update is the first in the symbol table 9, the first address xxx1 of the function foo is input to the first entry of the symbol table 9 Is done.

関数更新管理スレッド16は、関数更新時に更新処理を実行するスレッドである。また各スレッド15は、それぞれ非同期で処理を実行する。   The function update management thread 16 is a thread that executes an update process when a function is updated. Each thread 15 executes processing asynchronously.

よって、スレッドが呼び出し対象の関数を呼び出す際の動作概要は以下のようになる。
サービスを提供するスレッド15は、まずインタフェース関数12を呼び出し、インタフェース関数12の中の処理で、実際の呼び出し対象の関数にジャンプする。インタフェース関数12は、スレッド15に呼び出されると、シンボルテーブル9を読み込み、該当するエントリアドレスを取得し、そのエントリアドレスへジャンプする。このとき、インタフェース関数12が読み込む先のシンボルテーブル9のエントリは固定である。例えば、旧関数foo13のインタフェース関数12はシンボルテーブル9の1番目のエントリを常に読み込む。
Therefore, the operation outline when the thread calls the function to be called is as follows.
The thread 15 that provides the service first calls the interface function 12 and jumps to the function to be actually called by the processing in the interface function 12. When called by the thread 15, the interface function 12 reads the symbol table 9, acquires the corresponding entry address, and jumps to the entry address. At this time, the entry of the symbol table 9 to be read by the interface function 12 is fixed. For example, the interface function 12 of the old function foo 13 always reads the first entry of the symbol table 9.

また、旧関数foo13から新関数foo14への関数更新時の動作概要は、以下のようになる。
旧関数foo13から新関数foo14への関数更新時には、関数更新管理スレッド16が新関数foo14をメモリ上へロードする。次に、関数更新管理スレッド16は、シンボルテーブルの1番目のエントリを、新関数foo14の先頭アドレスmmm1へ変更する。以後、サービスを提供するスレッドは、関数fooのインタフェース関数12を呼び出すと、新関数foo14へジャンプするようになる。
An outline of the operation when updating the function from the old function foo13 to the new function foo14 is as follows.
When the function is updated from the old function foo13 to the new function foo14, the function update management thread 16 loads the new function foo14 onto the memory. Next, the function update management thread 16 changes the first entry of the symbol table to the start address mmm1 of the new function foo14. Thereafter, when the thread that provides the service calls the interface function 12 of the function foo, the thread jumps to the new function foo14.

なお、一般にメモリ上の内容を書き換える場合、OS7やハードウェア側にて排他制御が提供されており、複数のスレッド15が同時に同一のメモリへアクセスすることはない。例えば、図示はされていないが、サービスを提供するスレッド15がインタフェース関数12を介してシンボルテーブル9へアクセスする処理と、関数更新管理スレッドがシンボルテーブル9書き換える処理が同時に発生した場合、必ず片方が待機させられる。   Generally, when rewriting the contents on the memory, exclusive control is provided on the OS 7 or the hardware side, and a plurality of threads 15 do not access the same memory at the same time. For example, although not shown in the figure, when a process of accessing the symbol table 9 via the interface function 12 by the thread 15 that provides the service and a process of rewriting the symbol table 9 by the function update management thread occur, one of them must be executed. It is made to wait.

以下、図3を用いて、本発明によるコンピュータシステムのプロセスの動作が説明される。
図3において、ステップS101〜S105はプロセスの起動処理である。ステップS101はプロセスの起動である。ステップS102は、各関数・インタフェース関数12をメモリへロードする処理である。ステップS103は、ステップS102でロードした関数のアドレスをシンボルテーブル9に書き込む処理である。ステップS104は、関数更新管理スレッド16を起動させる。ステップS105は、サービスを提供する各種スレッド15を起動させる。
Hereinafter, the operation of the process of the computer system according to the present invention will be described with reference to FIG.
In FIG. 3, steps S101 to S105 are process activation processes. Step S101 is process activation. Step S102 is a process of loading each function / interface function 12 into the memory. Step S103 is processing for writing the address of the function loaded in step S102 into the symbol table 9. In step S104, the function update management thread 16 is activated. In step S105, various threads 15 that provide services are activated.

ステップS106は、プロセスの終了判定を行う。ステップS106でプロセスを終了すると判定された時、ステップS110以降の終了処理へ移る。ステップS106でプロセスを終了しないと判定された時、ステップS107へ移る。 In step S106, a process end determination is performed. When it is determined in step S106 that the process is to be terminated, the process proceeds to an end process after step S110. When it is determined in step S106 that the process will not be terminated, the process proceeds to step S107.

ステップS107〜S109は、関数更新に関する処理である。ステップS107では、更新する関数があるかを判定する。ステップS107で更新する関数があると判定された時、ステップS108の関数更新処理へ移る。ステップ107で更新する関数がないと判定された時はステップS103へ戻る。ステップS108は、新関数をメモリへロードする処理である。ステップS109は、ステップS108でロードした関数の先頭アドレスを、シンボルテーブル9の所定のエントリへ入力する。   Steps S107 to S109 are processing related to function update. In step S107, it is determined whether there is a function to be updated. When it is determined in step S107 that there is a function to be updated, the process proceeds to function update processing in step S108. If it is determined in step 107 that there is no function to be updated, the process returns to step S103. Step S108 is processing for loading a new function into the memory. In step S109, the start address of the function loaded in step S108 is input to a predetermined entry in the symbol table 9.

ステップS110以降は、プロセスの終了処理である。ステップS110はサービスを提供する各種スレッド15を終了させる。ステップS111は、関数更新管理スレッド16を終了させる。ステップS112はプロセス自身の終了である。   Steps S110 and after are process end processing. In step S110, the various threads 15 that provide the service are terminated. In step S111, the function update management thread 16 is terminated. Step S112 is the end of the process itself.

以上のように、本発明によるコンピュータシステムおよびプログラム更新方法を用いることにより、サービス提供スレッド15やプロセスを停止することなく、実行プログラムを更新することができ、プログラムの問題対処や機能変更・機能追加が可能となる。   As described above, by using the computer system and the program update method according to the present invention, it is possible to update the execution program without stopping the service providing thread 15 and the process, and it is possible to cope with the problem of the program, change the function, and add the function. Is possible.

以下、本発明によるコンピュータシステムおよびプログラム更新方法の実施例2は、図4および図5を用いて説明される。実施例1で説明されたコンピュータシステムおよびプログラム更新方法では、通常の関数に加え、図4に示すインタフェース関数12を予め用意する必要があった。実施例2では、実施例1で説明されたコンピュータシステムおよびプログラム更新方法において、インタフェース関数12を自動的に生成する機能および方法について説明される。図4は本発明によるコンピュータシステムのインタフェース関数とシンボルテーブルを示す図である。図5は本発明によるコンピュータシステムのインタフェース関数の自動生成動作を示すフローチャート図である。 Hereinafter, a second embodiment of the computer system and the program update method according to the present invention will be described with reference to FIGS. In the computer system and the program update method described in the first embodiment, the interface function 12 shown in FIG. 4 needs to be prepared in advance in addition to the normal function. In the second embodiment, a function and method for automatically generating the interface function 12 in the computer system and the program updating method described in the first embodiment will be described. FIG. 4 is a diagram showing an interface function and a symbol table of the computer system according to the present invention. FIG. 5 is a flowchart showing the automatic generation operation of the interface function of the computer system according to the present invention.

まず、本発明によるコンピュータシステムのインタフェース関数とシンボルテーブルが、図4を用いて説明される。
図4に示されるインタフェース関数12(アセンブラコード)は、インタフェース関数12をアセンブラで表現したプログラムである。なお、このアセンブラは、米国インテル社製のpentium(登録商標)シリーズに用いられる、i386系アーキテクチャのアセンブラコードである。図4に示すように、インタフェース関数12は、シンボルテーブルのアドレスを解決するコードにより、シンボルテーブル9へのアドレスを解決し、シンボルテーブルのアドレス取得コードおよびシンボルテーブルの先頭からのオフセットで関数の先頭アドレス取得コードにより、シンボルテーブル9の所定のエントリへアクセスし、エントリから読み出したアドレスへジャンプする、といった処理となっている。
First, the interface function and symbol table of the computer system according to the present invention will be described with reference to FIG.
The interface function 12 (assembler code) shown in FIG. 4 is a program that expresses the interface function 12 with an assembler. This assembler is an assembler code of the i386 architecture used in the Pentium (registered trademark) series manufactured by Intel Corporation. As shown in FIG. 4, the interface function 12 resolves the address to the symbol table 9 with a code that resolves the address of the symbol table, and starts the function with the address acquisition code of the symbol table and the offset from the top of the symbol table. The processing is such that a predetermined entry of the symbol table 9 is accessed by the address acquisition code, and jumps to the address read from the entry.

インタフェース関数12は、図4の関数情報17を除き、全て共通のコードとすることができる。また、関数情報17は、関数のシンボル名、及びシンボルテーブル9の先頭アドレスから、所定の関数のエントリのアドレスまでのオフセット値である。例えば、本実施例では、関数のシンボル名がfooであり、シンボルテーブル9の先頭アドレスから、関数fooのエントリのアドレスまでのオフセット値を「4」として説明する。
そこで、関数情報17を自動的に取得することで、インタフェース関数12を自動生成し、インタフェース関数を作成するための作業量を低減させる。
実施例2のプログラム運用中の動作、プログラム更新方法は、実施例1と同様である。ここでは、実施例1との差分である、インタフェース関数12の自動生成方法について説明する。
All the interface functions 12 can be a common code except for the function information 17 of FIG. The function information 17 is a symbol name of the function and an offset value from the start address of the symbol table 9 to the address of the entry of a predetermined function. For example, in this embodiment, the function symbol name is foo, and the offset value from the head address of the symbol table 9 to the address of the function foo entry is “4”.
Therefore, by automatically acquiring the function information 17, the interface function 12 is automatically generated, and the amount of work for creating the interface function is reduced.
The operation during program operation and the program update method of the second embodiment are the same as those of the first embodiment. Here, an automatic generation method of the interface function 12 that is a difference from the first embodiment will be described.

以下、図5を用いて、本発明によるコンピュータシステムのインタフェース関数12の自動生成の動作が説明される。
図5において、ステップS201はインタフェース関数12の作成が開始されることを示す。ステップS202では、関数のライブラリから、関数シンボル名を取得する。ある特定の機能を持ったプログラムを、他のプログラムから利用できるように部品化し、複数のプログラム部品を一つのファイルにまとめたものである。ライブラリ自体は単独で実行することはできず、他のプログラムの一部として動作する。関数シンボル名は、例えばLinuxなどでは、nmコマンドをスクリプトに組み込むことで取得できる。
Hereinafter, the operation of automatically generating the interface function 12 of the computer system according to the present invention will be described with reference to FIG.
In FIG. 5, step S201 indicates that the creation of the interface function 12 is started. In step S202, the function symbol name is acquired from the function library. A program having a specific function is divided into parts that can be used by other programs, and a plurality of program parts are combined into one file. The library itself cannot be run alone, but operates as part of another program. The function symbol name can be acquired by incorporating the nm command in a script, for example, in Linux.

次にステップS203でインタフェース関数12のコードを出力するためのファイルをオープンする。ステップS204では、オフセット値Nを設定する。オフセット値とは、この関数のアドレスを入力したシンボルテーブル9のエントリが、シンボルテーブル9の最初のアドレスから何バイト目であるかを示す。なお、1エントリは4バイトである。例えば、図3のステップS103において、シンボルテーブル9の3番目のエントリにこの関数のアドレスが書き込まれる場合、オフセットは最初のエントリから2エントリ分ずれているので、2エントリ×4バイト=8となる。 In step S203, a file for outputting the code of the interface function 12 is opened. In step S204, an offset value N is set. The offset value indicates how many bytes from the first address of the symbol table 9 the entry of the symbol table 9 to which the address of this function is input. One entry is 4 bytes. For example, when the address of this function is written in the third entry of the symbol table 9 in step S103 in FIG. 3, the offset is shifted by 2 entries from the first entry, so 2 entries × 4 bytes = 8. .

図5のステップS205〜S207は、図4のアセンブラコードを生成する処理である。ステップS205は、読み込んでいない関数が存在するかどうかを判定する。読み込んでいない関数が存在しない場合、ステップS208以降の終了処理へ移る。読み込んでいない関数が存在する場合、ステップS206へ移る。ステップS206は、ライブラリから関数シンボルを読み込み、アセンブラコードを生成する。ステップS207は、オフセット値を加算する処理である。   Steps S205 to S207 in FIG. 5 are processes for generating the assembler code in FIG. In step S205, it is determined whether there is a function that has not been read. If there is no function that has not been read, the process proceeds to an end process after step S208. If there is a function that has not been read, the process proceeds to step S206. A step S206 reads a function symbol from the library and generates an assembler code. Step S207 is processing to add an offset value.

ステップS208、S209はインタフェース関数生成を終了する処理である。ステップS208では、アセンブラコードを出力したファイルをクローズする。ステップS209は本処理を終えたことを示している。 Steps S208 and S209 are processes for ending the interface function generation. In step S208, the file to which the assembler code has been output is closed. Step S209 indicates that this process has been completed.

実施例1で説明されたコンピュータシステムおよびプログラム更新方法の効果に加え、図5のような処理フローのプログラムを用意することで、以後、インタフェース関数12を容易に生成することが可能となる。 In addition to the effects of the computer system and the program update method described in the first embodiment, the interface function 12 can be easily generated thereafter by preparing a program having a processing flow as shown in FIG.

本発明によるコンピュータシステムの構成を示す図The figure which shows the structure of the computer system by this invention 本発明によるコンピュータシステムのプロセス内の構成を示す図The figure which shows the structure in the process of the computer system by this invention. 本発明によるコンピュータシステムのプロセス動作を示すフローチャート図The flowchart figure which shows the process operation | movement of the computer system by this invention. 本発明によるコンピュータシステムのインタフェース関数とシンボルテーブルを示す図The figure which shows the interface function and symbol table of the computer system by this invention 本発明によるコンピュータシステムのインタフェース関数の自動生成動作を示すフローチャート図The flowchart figure which shows the automatic generation | occurrence | production operation | movement of the interface function of the computer system by this invention. 従来技術によるコンピュータシステムの第1のプロセス内の構成を示す図The figure which shows the structure in the 1st process of the computer system by a prior art. 従来技術によるコンピュータシステムの第2のプロセス内の構成を示す図The figure which shows the structure in the 2nd process of the computer system by a prior art. 従来技術によるコンピュータシステムの第3のプロセス内の構成を示す図The figure which shows the structure in the 3rd process of the computer system by a prior art.

符号の説明Explanation of symbols

2…CPU、3メインメモリ、4…通信制御ユニット、5…ハードディスク、7…OS、8…アプリケーションプログラム、9…シンボルテーブル、10…関数ロード管理プログラム、11…関数更新管理プログラム、12…インタフェース関数、13…旧関数、14…新関数、15…スレッド、16…更新管理スレッド 2 ... CPU, 3 main memory, 4 ... communication control unit, 5 ... hard disk, 7 ... OS, 8 ... application program, 9 ... symbol table, 10 ... function load management program, 11 ... function update management program, 12 ... interface function , 13 ... old function, 14 ... new function, 15 ... thread, 16 ... update management thread

Claims (3)

実行対象のプログラムに含まれるサブルーチン毎にそのサブルーチンが格納されているメモリ上の先頭アドレスを示すアドレス情報を保持するアドレス管理テーブルと、
呼び出し対象のサブルーチンにジャンプさせるためのインタフェースサブルーチンを呼び出して実行するインタフェースサブルーチン呼び出し手段と、
前記アドレス管理テーブルを参照して前記呼び出し対象のサブルーチンに対応するメモリ上の先頭アドレスを検出し、その検出された先頭アドレスのサブルーチンを呼び出して実行するサブルーチン呼び出し手段と、
更新対象のサブルーチンに対応する新たなサブルーチンをメモリ上にロードし、前記アドレス管理テーブルの該当するエントリアドレスを、前記新たなサブルーチンをロードした先頭アドレスに書き換えるテーブル更新手段と
を備えることを特徴とするコンピュータシステム。
An address management table that holds address information indicating the top address on the memory in which the subroutine is stored for each subroutine included in the program to be executed;
An interface subroutine calling means for calling and executing an interface subroutine for jumping to a subroutine to be called;
Subroutine calling means for detecting a top address on a memory corresponding to the subroutine to be called with reference to the address management table, and calling and executing a subroutine of the detected top address;
Table updating means for loading a new subroutine corresponding to a subroutine to be updated onto a memory and rewriting a corresponding entry address in the address management table to a head address loaded with the new subroutine. Computer system.
請求項1に記載のコンピュータシステムにおいて、
サブルーチンのライブラリからサブルーチンのシンボル名を取得し、該サブルーチンのメモリアドレスのオフセット値を設定し、前記ライブラリにある全てのサブルーチンを読み込むまで、前記インタフェースサブルーチンを作成する手段
を備えることを特徴とするコンピュータシステム。
The computer system of claim 1,
A computer comprising: a subroutine symbol name obtained from a subroutine library; an offset value of a memory address of the subroutine is set; and all the subroutines in the library are read. system.
実行対象のプログラムに含まれる各サブルーチン毎にそのサブルーチンが格納されているメモリ上の先頭アドレスを示すアドレス情報をメモリ上に登録し、
前記実行対象のプログラムのサブルーチン呼び出し命令に応答して、呼び出し対象のサブルーチンにジャンプさせるためのインタフェースサブルーチンを呼び出して実行し、
前記アドレス情報を参照して前記呼び出し対象のサブルーチンに対応するメモリ上の先頭アドレスを検出し、
その検出された先頭アドレスのサブルーチンを呼び出して実行し、
更新対象のサブルーチンに対応する新たなサブルーチンをメモリ上にロードし、
前記アドレス情報の該当するエントリアドレスを、前記新たなサブルーチンをロードした先頭アドレスに書き換えること
を特徴とするプログラム更新方法。
For each subroutine included in the program to be executed, register the address information indicating the start address on the memory where the subroutine is stored on the memory,
In response to a subroutine call instruction of the program to be executed, an interface subroutine for jumping to the subroutine to be called is called and executed,
Referring to the address information to detect the top address on the memory corresponding to the subroutine to be called,
Call and execute the subroutine of the detected start address,
A new subroutine corresponding to the subroutine to be updated is loaded into the memory,
A program update method, wherein a corresponding entry address of the address information is rewritten to a head address loaded with the new subroutine.
JP2004100444A 2004-03-30 2004-03-30 Computer system and program update method Pending JP2005284925A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004100444A JP2005284925A (en) 2004-03-30 2004-03-30 Computer system and program update method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004100444A JP2005284925A (en) 2004-03-30 2004-03-30 Computer system and program update method

Publications (1)

Publication Number Publication Date
JP2005284925A true JP2005284925A (en) 2005-10-13

Family

ID=35183215

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004100444A Pending JP2005284925A (en) 2004-03-30 2004-03-30 Computer system and program update method

Country Status (1)

Country Link
JP (1) JP2005284925A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009277217A (en) * 2008-03-31 2009-11-26 Symantec Corp Dynamic insertion and removal of virtual software sub-layer
US9116725B1 (en) 2011-03-15 2015-08-25 Symantec Corporation Systems and methods for using virtualization of operating-system-level components to facilitate software testing
US9223966B1 (en) 2014-05-04 2015-12-29 Symantec Corporation Systems and methods for replicating computing system environments

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02193223A (en) * 1989-01-20 1990-07-30 Fujitsu Ltd Program number calling system
JPH06222916A (en) * 1993-01-25 1994-08-12 Nec Corp On-line real-time processor
JPH07152552A (en) * 1993-11-29 1995-06-16 Nec Corp System for dynamically replacing subprogram
JP2002222081A (en) * 2000-11-22 2002-08-09 Ricoh Co Ltd Device and method for program generation, program implementing the same method on computer, image forming device, and address solving method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02193223A (en) * 1989-01-20 1990-07-30 Fujitsu Ltd Program number calling system
JPH06222916A (en) * 1993-01-25 1994-08-12 Nec Corp On-line real-time processor
JPH07152552A (en) * 1993-11-29 1995-06-16 Nec Corp System for dynamically replacing subprogram
JP2002222081A (en) * 2000-11-22 2002-08-09 Ricoh Co Ltd Device and method for program generation, program implementing the same method on computer, image forming device, and address solving method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009277217A (en) * 2008-03-31 2009-11-26 Symantec Corp Dynamic insertion and removal of virtual software sub-layer
US9081644B2 (en) 2008-03-31 2015-07-14 Symantec Corporation Dynamic insertion and removal of virtual software sub-layers
US9116725B1 (en) 2011-03-15 2015-08-25 Symantec Corporation Systems and methods for using virtualization of operating-system-level components to facilitate software testing
US9223966B1 (en) 2014-05-04 2015-12-29 Symantec Corporation Systems and methods for replicating computing system environments

Similar Documents

Publication Publication Date Title
US11853774B2 (en) Dynamically loaded plugin architecture
US5815702A (en) Method and software products for continued application execution after generation of fatal exceptions
US7774636B2 (en) Method and system for kernel panic recovery
US8286154B2 (en) Apparatus and method for live loading of version upgrades in a process control environment
US8112745B2 (en) Apparatus and method for capabilities verification and restriction of managed applications in an execution environment
US6253320B1 (en) Operating system rebooting method
KR101782313B1 (en) Apparatus and method for handling exception events
US7353507B2 (en) Intercepting function cells
JP5093259B2 (en) Communication path strengthening method between BIOS and BMC, apparatus and program thereof
JP5026494B2 (en) Computer that starts at high speed
JP2003256225A (en) Computer system, failure countermeasure and program for making computer system function
US6336215B1 (en) Apparatus and method for on-line code only replacement of a running program using checkpoints
JP2006065462A (en) Software system, software stopping method, program, and storage medium
US5953529A (en) Data processor with a debug device and a stack area control unit and corresponding data processing method
JP4275451B2 (en) Illegal memory access detection method and program thereof
JP2005284925A (en) Computer system and program update method
JPH07152551A (en) Computer system and program executing method
US7562209B2 (en) Supporting different instruction set architectures during run time
WO2011025479A1 (en) A plurality of interface files usable for access to bios
JP6691294B2 (en) Information processing apparatus, dynamic link program, and program restart method
US20080127235A1 (en) Methods, systems and computer program products for dynamic linkage
JP2002182931A (en) Common os system call method
JPH1021067A (en) Dynamic correction method for program
JP2655612B2 (en) External reference update method
JP2011118830A (en) Multitasking system and program

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20060923

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20060929

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20061013

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070202

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20091027

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100518

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100712

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100928

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20110322