JPS62241036A - Protecting system for program runway - Google Patents
Protecting system for program runwayInfo
- Publication number
- JPS62241036A JPS62241036A JP61082127A JP8212786A JPS62241036A JP S62241036 A JPS62241036 A JP S62241036A JP 61082127 A JP61082127 A JP 61082127A JP 8212786 A JP8212786 A JP 8212786A JP S62241036 A JPS62241036 A JP S62241036A
- Authority
- JP
- Japan
- Prior art keywords
- program
- error
- flag
- error processing
- runaway
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 abstract description 18
- 238000010586 diagram Methods 0.000 description 7
- 238000001514 detection method Methods 0.000 description 3
- 230000007257 malfunction Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 230000006378 damage Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は、計算機の誤動作防止手段に係り、特にプログ
ラムが暴走した場合の保護方式に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to means for preventing malfunction of a computer, and particularly to a protection system when a program runs out of control.
ストアドブログラム方式を用いた計算機システムにおい
ては、ハードウェアの故障や、プログラムミス、または
誤書き込みによるプログラム内容の破壊等によシ、所望
の順序制御が乱れ予期せぬ動作を起すことが考えられる
。このような誤動作をプログラムの暴走と呼んでいる。In computer systems that use the stored program method, it is possible that the desired sequence control may be disrupted and unexpected operations may occur due to hardware failure, program errors, or destruction of program contents due to erroneous writing. . This kind of malfunction is called program runaway.
制御用計算機においては、プログラム暴走により該計算
機の制御下にあるプラントが誤動作し、大きな災害をひ
きおこす危険性がある。In a control computer, there is a risk that a program runaway may cause a plant under the control of the computer to malfunction, causing a major disaster.
上記の理由によシ、プログラムの暴走が発生した場合は
、速やかに暴走を検出し、計算機動作を停止させなくて
はならない。If a program runaway occurs due to the above reasons, it is necessary to promptly detect the runaway and stop computer operation.
プログラムの暴走を検出する方式として従来はウォッチ
ドッグタイマ一方式と、イリーガル命令埋込み方式があ
った。Conventionally, there have been two methods for detecting program runaway: a watchdog timer method and an illegal instruction embedding method.
ウォッチドッグタイマ一方式は、特開昭60−2057
57号に記載の様に、周期的にトリガされるタイマーと
、単位時間毎に該タイマーをリセットするプログラムと
を設け、一定時間内に該タイマーのリセットが行われな
いと外部に対して暴走を報告する方式である。この方式
においては計算機7ステム自体は、暴走発生時Pζ自分
自身を停止する手段を持たず、暴走停止は外部手段によ
っておこなわれる1、このため、外部に計算機システム
。One type of watchdog timer is disclosed in Japanese Patent Application Laid-Open No. 60-2057.
As described in No. 57, a timer that is triggered periodically and a program that resets the timer every unit time are provided, and if the timer is not reset within a certain period of time, it will cause a runaway to the outside. This is a reporting method. In this method, the computer 7 stem itself does not have a means to stop Pζ itself when runaway occurs, and stoppage of runaway is performed by external means 1. Therefore, the computer system is externally connected.
暴走検出時に、該システムを停止する手段を必要とし、
また暴走全検出する手段として時間を用いているため、
暴走から検出するまでの時間が比較的長くなってしまう
。Requires a means to stop the system when runaway is detected;
Also, since time is used as a means of detecting all runaways,
The time from runaway to detection is relatively long.
イリーガル命令埋込み方式は、特開昭60−14345
に記載の様に、プログラムが格納されていないメモリの
空きエリア′に、特定の命令コードを埋込み、プログラ
ムが暴走1.空きエリア内の命令を実行したときに暴走
を検出する方式である。The illegal instruction embedding method is disclosed in Japanese Patent Application Laid-Open No. 60-14345.
As described in 1., a specific instruction code is embedded in an empty area of memory where no program is stored, and the program runs out of control. This method detects runaway when an instruction in an empty area is executed.
イリーガル命令埋込み方式においては、プログラムが暴
走するときに、必ず空きエリア内の命令を実行するとい
う前提に基づいているため、核エリアを実行しない故障
モードにおいては、配慮されていなかった。The illegal instruction embedding method is based on the premise that when a program goes out of control, instructions in an empty area are always executed, so failure modes in which the core area is not executed are not considered.
従来、比較的小形の計算機システム、例えばマイコン7
スデムでは、プログラム容量が小さく、限定された目的
で使用されていたため、ブ【1グラムは、読み出し専用
、メモリ(T(、ead 0nly Memory 。Conventionally, relatively small computer systems, such as microcontroller 7
In Sudem, the program capacity was small and was used for limited purposes, so the program was read-only, memory (T(, ead ONLY Memory).
以下ROMと略す)のみに格納されていた。しかし、マ
イクロプロセッサの処理能力の向上とともにプログラム
容量の増加や、汎用性、拡張性が要求される様になった
。そのため、中太形シスデムの様に、外部補助記憶装置
からプログラムを読み書き可能メモリ(R+andum
Access Memory 、以下RA Mと略す
)にローディングする方法がとられる様になった。(hereinafter abbreviated as ROM) only. However, as the processing power of microprocessors has improved, there has been a need for increased program capacity, versatility, and expandability. Therefore, like the medium-thick system system, programs can be read and written from an external auxiliary storage device (R+andum).
A method of loading data into Access Memory (hereinafter abbreviated as RAM) has come to be used.
この場合の問題点として、rLAM内のプログラムがハ
ードウェアの故障やプログラムミスによって誤って書込
まれ、破壊されてしまった場合にプログラムが暴走して
しまう。特に破壊されたプログラムがエラー処理に関れ
るものである時には。The problem in this case is that if the program in the rLAM is erroneously written and destroyed due to a hardware failure or a program error, the program will run out of control. Especially when the corrupted program involves error handling.
計算機を停止させることもできなくなる。It will also no longer be possible to stop the computer.
ウォッチドッグタイマ一方式においては、外部の停止手
段が必要であることを111Jに述べたが、小さなシス
テムにおいてその様な手段を別途設けることが困難であ
り、暴走から検出までの時間が長い問題がある。As stated in 111J that an external stop means is required for the watchdog timer type, it is difficult to separately provide such a means in a small system, and there is a problem that it takes a long time from runaway to detection. be.
また、イリーガル命令埋込み方式においては・誤書込み
に起因する場合、暴走検出が困難となる。Furthermore, in the illegal instruction embedding method, it is difficult to detect runaway if it is caused by erroneous writing.
本発明の目的は、エラー処理などのプログラムがRAM
に格納されるシステムにおけるプログラムの暴走を検出
し、システムt−確爽に停止させる方式を提供すること
にある。An object of the present invention is to store programs such as error processing in RAM.
An object of the present invention is to provide a method for detecting runaway programs in a system stored in a system and reliably stopping the system.
プログラムが暴走した場合、何らかの例外が発生するだ
ろうことは容易に考えられる。通常の場合は1例外処理
プログラムが実行され、その暴走を検出することが可能
である。しかしながら、該例外処理プログラムもまた、
破壊されていると、その実行途中で再び例外が発生する
ため、永久ループに落人9、暴走の検出は不可能となる
。If the program runs out of control, it is easy to imagine that some kind of exception will occur. Normally, one exception handling program is executed, and runaway can be detected. However, the exception handling program also
If it is destroyed, an exception will occur again during execution, so the user 9 will fall into an endless loop and it will be impossible to detect a runaway.
第3図は上記プロセスの説明図である。暴走したプログ
ラム4が、イリーガル発生時のエラー処理プログラム5
を破壊した後でイリーガル命令によるエラー発生した場
合、イリーガル発生時のエラー処理が実行される。しか
し、この処理グログラムが破壊されているため、再び同
じイリーガルエラーが発生しループしてしまう。または
、他のエラーが発生し、他のエラー処理6が実行される
。FIG. 3 is an explanatory diagram of the above process. The runaway program 4 is an error processing program 5 when an illegal occurrence occurs.
If an error occurs due to an illegal instruction after destroying the , the error handling at the time of illegal occurrence is executed. However, since this processing program has been destroyed, the same illegal error occurs again, resulting in a loop. Alternatively, another error occurs and other error processing 6 is executed.
そこで、本発明は、上記永久ループに落人ることなしく
、暴走を検出するため、絶対に書込まれることのないR
OM上のプログラムでエラー処理中か否かの判定を行う
こととしたものである。Therefore, the present invention detects runaway without falling into the above-mentioned eternal loop.
The program on the OM determines whether or not error processing is in progress.
ソフトウェアで書込みができるメモリ上の7ラグをエラ
ー処理開始時にセットし、終了時にクリアされるように
プログラムで制御する。このフラグの判定をエラー処理
開始時に、かつ、ソフトウェアで書込みができないメモ
リ上のプログラムで判定することで、エラー処理中に再
度、エラーが発生した211エラーを検出することがで
き、プログラムの暴走を防止できる。Seven lags on memory that can be written to by software are set at the start of error processing and are controlled by the program to be cleared at the end. By determining this flag at the start of error processing and by a program in memory that cannot be written to by software, it is possible to detect the 211 error that occurred again during error processing, and prevent the program from running out of control. It can be prevented.
次に本発明の実施例について図面をもちいて説明する。 Next, embodiments of the present invention will be described with reference to the drawings.
まず、プログラムの暴走のプロセスを第3図を用いて説
明する。暴走したプログラム4が、実行中にエラー処理
プログラム(イリーガルも含む)を破壊し喪後で、何ら
かのエラー、この場合はイリーガル命令によるエラーが
発生した場合、イリーガル発生時のエラー処理が実行さ
れる。しかし、この処理プログラムが破壊されているた
め。First, the process of program runaway will be explained with reference to FIG. When the runaway program 4 destroys the error processing program (including illegal) during execution and some error occurs, in this case an error due to an illegal instruction, error processing at the time of illegal occurrence is executed. However, this processing program has been destroyed.
エラー、即ち同じイリーガルエラーが発生し無限ループ
を形成したシ、イリーガル以外の他のエラーが発生し、
他のエラー処理6が実行される。An error, that is, the same illegal error occurs and an infinite loop is formed, or another error other than illegal occurs,
Other error processing 6 is executed.
第1図は本発明の全体構成図でプログラム1が暴走しイ
リーガル命令によるエラーが発生した場合のエラー処3
1170−は次の様になる。まず、ROM上のエラー処
理プログラム2でエラー処理中フラグが11”であるか
どうか1判定する。プログラム1でエラー発生時には、
フラグがクリア(二〇)されているので1次にこのフラ
グをセットし、R,AM上のエラー処理プログラム3に
分岐する。プログラム3ではエラー処理終了後、フラグ
をクリアする。プログラム3が破壊されている場合は、
フラグがセットされた状態で再度プログラム2に分岐す
る。フラグが11”であるから、フラグの判定後CI)
U ’6−ス)・ツブする処理を行う。Figure 1 is an overall configuration diagram of the present invention, and error processing 3 is performed when program 1 goes out of control and an error occurs due to an illegal instruction.
1170- becomes as follows. First, the error processing program 2 on the ROM determines whether the error processing flag is 11". When an error occurs in the program 1,
Since the flag has been cleared (20), this flag is set as the primary step, and the program branches to error processing program 3 on R and AM. In program 3, the flag is cleared after the error processing is completed. If program 3 is destroyed,
The program branches to program 2 again with the flag set. Since the flag is 11”, CI after flag determination)
U '6-S) - Performs the process of squishing.
第2図は本発明に必要なノ・−ドウエアのシステム構成
を示している。CPUl0と、rLAMll。FIG. 2 shows the system configuration of the hardware necessary for the present invention. CPUl0 and rLAMll.
ROMI 2.l1013間には、アドレスバス14と
データバス15がインターフェイスされ。ROMI 2. An address bus 14 and a data bus 15 are interfaced between l1013.
このバスを介してデータ転送を行う。さらにこのデータ
転送を制御するためのリード信号16が、同じ<CPU
l0.aAMl 1.ROMI 2.l1013間にイ
ンターフェイスされている。もう一つの制御信号である
ライト信号17は、几0M12を除いて、インターフェ
イスされている。以上の構成において、CPUl0から
RAMIIの内容をリードまたはライトすることができ
、CPU10からROM12の内容はリードのみ行える
。Data transfer is performed via this bus. Furthermore, the read signal 16 for controlling this data transfer is
l0. aAMl 1. ROMI 2. 11013. The write signal 17, which is another control signal, is interfaced except for the signal 0M12. In the above configuration, the content of RAMII can be read or written from CPU10, and the content of ROM12 can only be read from CPU10.
次に、ROM12内のエラー処理フローは第1図に示さ
れるごとく、処理21でエラー処理フラグ=1′?であ
るかの判定を行う。このフラグが11“でめった場合は
、エラー処理中に再度エラーが発生し九2重障害である
から、プログラムの暴走、無限ループを防止するため、
エラー処理を行なわず処理22でCPUをストラグさせ
る。フラグが0”であった場合は、前記した2重障害で
はない。処理23でエラー処理中フラグをセットシ、処
理24でR,AM上のエラー処理に分岐する。Next, the error processing flow in the ROM 12 is as shown in FIG. 1, and in process 21, the error processing flag=1'? Determine whether the If this flag is set to 11, it is a 92-fold failure as an error occurs again during error processing, so to prevent the program from running out of control or from an infinite loop,
The CPU is made to stagger in process 22 without performing error processing. If the flag is 0'', it is not the above-mentioned double failure.In step 23, the error processing flag is set, and in step 24, the process branches to error processing on R and AM.
エラー処理中7ラグCPUl0からリードまたはライト
可能なR,AMII内にあシ、セット即ち“1#の時は
、エラー処理中であシ、クリア即ち′O”の時はエラー
処理中でないことを示す。During error processing 7 lags In R, AMII which can be read or written from CPUl0, when set (1#), it means error processing is in progress; when cleared ('O'), error processing is not in progress. show.
RAM内のエラー処理70−は第1図に示されるごとく
処理31ではエラー要因の判定さらにエラーメツセージ
の出力などのエラー処理を行った後、処理32でエラー
処理中フラグをクリアする。As shown in FIG. 1, the error processing 70- in the RAM performs error processing such as determining the cause of the error and outputting an error message in step 31, and then clears the error processing flag in step 32.
計算機における障害、エラー要因は、ン7トウエアまた
はハードウェア両面とも当然一つの要因だけでなく多数
存在する。エラー発生時にCPU1Oは、その要因を判
定し、各、エラー処理の先頭アドレスがセーブされてい
るエラー処理用ベクfiテーブルから対応するエラー処
理先頭アドレスをリードし、このリードし九アドレスか
らエラー処理を行う。第4図は本発明に用いられるベク
タテーブルの構成図を示す。全てのエラー処理用ペクタ
テーブルにエラー処理中フラグを判定するROMのエラ
ー処理プログラム2の先頭アドレスを格納する。Naturally, there are many causes of failures and errors in computers, both in terms of software and hardware, rather than just one. When an error occurs, the CPU 10 determines the cause, reads the corresponding error processing start address from the error processing vector fi table in which the start address of each error processing is saved, and executes error processing from this read address. conduct. FIG. 4 shows a configuration diagram of a vector table used in the present invention. The start address of the error processing program 2 in the ROM that determines the error processing flag is stored in all error processing vector tables.
以上のように本発明によれば、プログラムで破壊されな
い様にハードウェアによシライトプロテクトされている
メモリ上のプログラムが、エラーフラグの判定を行うこ
とで、2重エラーを検出できるので、実際にはプログラ
ムが暴走していてもそれを検出できないという事態、°
または、直接のエラー要因に対するエラー処理が行なわ
れず、エラー解析が複雑になるという事態を避けること
ができ、プログラム暴走検出時間の減少と、信頼性を向
上させることができる。As described above, according to the present invention, a program in memory that is write-protected by hardware to prevent it from being destroyed by the program can detect a double error by determining the error flag. is a situation in which it is not possible to detect even if a program runs out of control, °
Alternatively, it is possible to avoid a situation where error processing is not performed for a direct error cause and error analysis becomes complicated, and the program runaway detection time can be reduced and reliability can be improved.
第1図は本発明の全体構成図、第2図は本発明のシステ
ム構成図、第3図は従来のプログラム暴走保護方式の問
題点を示す図、第4図はエラー処運用のベクタテーブル
と処理フローの関係を示す図である。
1.4・・・暴走プログラム、2・・・ROM上のエラ
ー処理プログラム、3・・・R= A M上のエラー処
理プログラム、5・・・イリーガル活生時のエラー処理
プログラム、6・・・他のエラー処理プログラム、10
・・・CPU、11・・・P−A M、12・・・RO
M、13・・・Ilo、14・・・アドレスバス、15
・・・データバス、16・・・リード1g号、17・・
・ライト信号。Figure 1 is an overall configuration diagram of the present invention, Figure 2 is a system configuration diagram of the present invention, Figure 3 is a diagram showing problems with the conventional program runaway protection system, and Figure 4 is a vector table for error handling operation. FIG. 3 is a diagram showing the relationship of processing flows. 1.4... Runaway program, 2... Error processing program on ROM, 3... Error processing program on R=AM, 5... Error processing program during illegal life, 6...・Other error handling programs, 10
...CPU, 11...P-A M, 12...RO
M, 13...Ilo, 14...Address bus, 15
...Data bus, 16...Lead No. 1g, 17...
・Light signal.
Claims (1)
ログラムが格納されているデータ処理装置において、 例外処理開始時に、読み出し専用メモリ領域にあるプロ
グラムでセットされ、例外処理終了時にクリアされるフ
ラグを有し、該フラグがセット中に、例外が発生した場
合、後続の読み書き可能メモリ領域中の制御プログラム
の実行を抑止するようにしたことを特徴とするプログラ
ム暴走保護方式。[Claims] 1. In a data processing device in which a control program is stored in a read-only memory and a read/write memory, the control program is set by the program in the read-only memory area at the start of exception processing, and is cleared at the end of the exception processing. 1. A program runaway protection system, comprising a flag, and when an exception occurs while the flag is set, execution of a subsequent control program in a read/write memory area is inhibited.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP61082127A JPS62241036A (en) | 1986-04-11 | 1986-04-11 | Protecting system for program runway |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP61082127A JPS62241036A (en) | 1986-04-11 | 1986-04-11 | Protecting system for program runway |
Publications (2)
Publication Number | Publication Date |
---|---|
JPS62241036A true JPS62241036A (en) | 1987-10-21 |
JPH0580692B2 JPH0580692B2 (en) | 1993-11-10 |
Family
ID=13765746
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP61082127A Granted JPS62241036A (en) | 1986-04-11 | 1986-04-11 | Protecting system for program runway |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS62241036A (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS56164444A (en) * | 1980-05-23 | 1981-12-17 | Toshiba Corp | Error check method for controller of microprogram |
JPS57199056A (en) * | 1981-06-03 | 1982-12-06 | Nec Corp | Execution and monitoring device for control program |
-
1986
- 1986-04-11 JP JP61082127A patent/JPS62241036A/en active Granted
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS56164444A (en) * | 1980-05-23 | 1981-12-17 | Toshiba Corp | Error check method for controller of microprogram |
JPS57199056A (en) * | 1981-06-03 | 1982-12-06 | Nec Corp | Execution and monitoring device for control program |
Also Published As
Publication number | Publication date |
---|---|
JPH0580692B2 (en) | 1993-11-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5214652A (en) | Alternate processor continuation of task of failed processor | |
JPH02156357A (en) | Program destruction preventing method | |
JPS62241036A (en) | Protecting system for program runway | |
JPH07113898B2 (en) | Failure detection method | |
KR890003322B1 (en) | Data processing system | |
JPH0469744A (en) | Runaway detector for microcomputer | |
JP2562838B2 (en) | Processor and store buffer control method | |
JPH0230060B2 (en) | ||
KR890001796B1 (en) | System for processing machine check interruption | |
JPS61101844A (en) | Fault processing system | |
JP3183982B2 (en) | Digital controller | |
JPH0644145A (en) | Memory error saving system | |
JPS62175834A (en) | Detecting circuit for runaway of central processing unit | |
JPS5975348A (en) | Method and device for detecting abnormality of computer | |
JPS61224056A (en) | Processing system for detecting trouble of channel | |
JPH01166145A (en) | Cpu monitor | |
JPH02226451A (en) | Memory protecting system | |
JPH06242973A (en) | Method for informing vm of virtual computer system of vp machine check | |
JPH06168161A (en) | Executing error detecting method for unstored program area in data processor | |
JPS61112251A (en) | Runaway detecting system | |
JPH03230216A (en) | Processing system for writing processing part to storage device | |
JPS6232544A (en) | Abnormally detecting circuit for information processor | |
JPH01229335A (en) | Computer system | |
JPS63150732A (en) | Program running supervisory equipment | |
JPS63168733A (en) | Microprogram controller |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
LAPS | Cancellation because of no payment of annual fees |