JPS6035694B2 - Main memory protection method - Google Patents

Main memory protection method

Info

Publication number
JPS6035694B2
JPS6035694B2 JP8237980A JP8237980A JPS6035694B2 JP S6035694 B2 JPS6035694 B2 JP S6035694B2 JP 8237980 A JP8237980 A JP 8237980A JP 8237980 A JP8237980 A JP 8237980A JP S6035694 B2 JPS6035694 B2 JP S6035694B2
Authority
JP
Japan
Prior art keywords
main memory
key
protection
circuit
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.)
Expired
Application number
JP8237980A
Other languages
Japanese (ja)
Other versions
JPS578860A (en
Inventor
篤雄 馬屋原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP8237980A priority Critical patent/JPS6035694B2/en
Publication of JPS578860A publication Critical patent/JPS578860A/en
Publication of JPS6035694B2 publication Critical patent/JPS6035694B2/en
Expired legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/14Protection against unauthorised use of memory or access to memory

Description

【発明の詳細な説明】 本発明は主記憶保護方式に関し、特に、主記憶に主記憶
キーをそなえ、中央処理装置から主記憶をアクセスする
とき、中央処理装置内部に用意した保護キーと主記憶キ
ーとの比較を行うことにより主記憶保護を行うデータ処
理システムにおいて、従来から存在するプログラム状態
語内の保護キーを主記憶へのアクセスの都度書換えなく
てもよいようにした主記憶保護方式に関する。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a main memory protection system, and in particular, when a main memory is provided with a main memory key and the main memory is accessed from a central processing unit, the protection key provided inside the central processing unit and the main memory are protected. Relating to a main memory protection method that eliminates the need to rewrite the conventional protection key in the program state word each time the main memory is accessed in a data processing system that protects the main memory by comparing it with a key. .

一般にデータ処理システムにおいては、プログラムの誤
りによる主記憶の内容の破壊や不当な読出しを防ぐため
に、主記憶キーと保護キーを用いた主記憶保護機能が採
用される。
Generally, in data processing systems, a main memory protection function using a main memory key and a protection key is employed to prevent the contents of main memory from being destroyed or improperly read due to program errors.

これは、例えば主記憶の204&ゞィトのブロックに対
してそれぞれ4ビットのコード(主記憶キー)を与え、
これに対してプログラム状態語(PSW)内の4ビット
のコード(保護キー)が合わなければアクセスを制限す
るものである。このように、各キーが4ビットからなる
場合には、記憶保護の対象として、16通りの識別が可
能であり、したがってハードウェアは、最大1畝固のプ
ログラムを同時に主記憶保護することができるようにな
る。ところで、あるプログラムが別のプログラムにより
使用されていた主記憶領域をアクセスするような場合に
は、その別のプログラムから当該主記憶領域のアドレス
と主記憶キーを通知してもらうことにより、プログラム
状態語内の保護キーを書換えてからアクセスを行うよう
にしている。
This gives, for example, a 4-bit code (main memory key) to each block of 204 & 2 in the main memory,
On the other hand, if the 4-bit code (protection key) in the program status word (PSW) does not match, access is restricted. In this way, when each key consists of 4 bits, it is possible to identify 16 ways as a target for memory protection, and therefore the hardware can protect a maximum of one program in the main memory at the same time. It becomes like this. By the way, when a program accesses a main memory area that is being used by another program, the program status can be determined by having the other program notify the address of the main memory area and the main memory key. Access is performed after rewriting the protection key within the word.

そのため、例えば、あるプログラムが自己の主記憶領域
と、他のプログラムに属する主記憶領域を交互にアクセ
スするような場合には、アクセスの都度、プログラム状
態語内の保護キーを書換えねばならす、プログラム作成
が煩雑になるという問題点を有していた。本発明は、上
記問題点を鱗結し、主記憶をアクセスするときに用いる
ベースレジスタにも保護キーを設けることにより、プロ
グラム状態語内の保護キーを変更することなく主記憶保
護を行うことができるようすることを目的とし、そのた
め本発明は主記憶に主記憶キーをそなえ、中央処理装置
から主記憶をアクセスするとき、中央処理装置内部に用
意した保護キーと上記主記憶キーとの比較を行うことに
より主記憶保護を行うデータ処理システムにおいて、上
記保護キーをプログラム状態語内と、ベースレジスタ内
の両方にもうけるとともに、上記プログラム状態語内の
保護キーと上記ベースレジスタ内の保護キーと比較する
第1の比較手段と、上記ベースレジスタ内の保護キーと
上記主記憶キーとを比較する第2の比較手段をもうけ、
上記第1および第2の比較手段の比較結果にもとずし、
て、主記憶アクセスを制御するようにしたことを特徴と
する。
Therefore, for example, if a program alternately accesses its own main storage area and the main storage area belonging to another program, the protection key in the program state word must be rewritten each time the program accesses the main storage area. This has the problem that it is complicated to create. The present invention addresses the above problems and provides a protection key in the base register used when accessing the main memory, thereby making it possible to protect the main memory without changing the protection key in the program state word. Therefore, the present invention provides a main memory key in the main memory, and when the main memory is accessed from the central processing unit, a protection key prepared inside the central processing unit is compared with the main memory key. In a data processing system that protects main memory by performing, the above-mentioned protection key is provided both in the program state word and in the base register, and the protection key in the above-mentioned program state word is compared with the protection key in the above-mentioned base register. and a second comparing means for comparing the protection key in the base register and the main memory key,
Based on the comparison results of the first and second comparison means,
The present invention is characterized in that access to the main memory is controlled.

以下、図面により本発明を説明する。The present invention will be explained below with reference to the drawings.

第1図は、主記憶保護をつかさどる各キーの存在場所を
示す図であり、第2図は、本発明による実施例のデータ
処理装置のブロック構成図である。第1図において、1
は中央処理装置に1つだけ存在するプログラム状態語(
PSW)内の保護キー(以下、PSWキーと称す)(P
k)、2はベースレジスタ内の保護キー(Rk)、3は
ベースレジスタ内のアクセスしたいアドレス(R^)、
4は主記憶キー(M比)、5は主記憶キー4に対応する
主記憶領域(M)である。
FIG. 1 is a diagram showing the location of each key responsible for main memory protection, and FIG. 2 is a block diagram of a data processing device according to an embodiment of the present invention. In Figure 1, 1
is a program state word that exists only once in the central processing unit (
The protection key (hereinafter referred to as the PSW key) within the PSW (PSW)
k), 2 is the protection key (Rk) in the base register, 3 is the address you want to access in the base register (R^),
4 is a main memory key (M ratio), and 5 is a main memory area (M) corresponding to the main memory key 4.

第2図において、1川ま第1図の1と同じくPSWキー
、1 1は命令レジスタ内のベースレジスタ番号(B)
、12は命令レジスタ内のインデックスレジスタ番号(
X)、13は変位(D)、14はPkが“0”であるか
否かを判定するチェック回路、15はベースレジスタ番
号(B)からベースレジスタを求め当該ベースレジスタ
のRkを求めるRkキー読取回路、16はベースレジス
タ番号(B)、インデックスレジスタ番号(×)および
変位(D)にもとすいてアクセスしたい主記憶アドレス
を求める主記憶アドレス作成回路、17はPkとRkと
を比較する比較回路、18はアクセスしたい主記憶アド
レスが示す主記憶領域の主記憶キー(M比)を求めるM
kキー読取回路、1 9はRkとMkとを比較する比較
回路、2川まエラー通知回路、21はアクセス可能信号
発生回路、22は主記憶アクセス回路、3川ま主記憶で
ある。
In Figure 2, 1 is the PSW key, same as 1 in Figure 1, and 1 is the base register number (B) in the instruction register.
, 12 is the index register number (
13 is a displacement (D), 14 is a check circuit that determines whether Pk is "0", 15 is an Rk key that calculates the base register from the base register number (B) and calculates the Rk of the base register. A reading circuit, 16, a main memory address creation circuit that calculates the main memory address to be accessed based on the base register number (B), index register number (x), and displacement (D); 17, a comparison between Pk and Rk; Comparison circuit 18 is M for determining the main memory key (M ratio) of the main memory area indicated by the main memory address to be accessed.
19 is a comparison circuit for comparing Rk and Mk, 2 is an error notification circuit, 21 is an access enable signal generation circuit, 22 is a main memory access circuit, and 3 are main memories.

以下、第2図の実施例についてその動作を説明する。中
央処理装置があるプログラムのある命令を取出したとす
ると、PSWキー10にはそのプログラムのもつPSW
キーが設定されている。
The operation of the embodiment shown in FIG. 2 will be explained below. When the central processing unit retrieves a certain command from a certain program, the PSW key 10 contains the PSW of that program.
key is set.

そして、命令レジスタに保持されている命令は、命令部
と番地部(ベースレジス夕番号11、インデックスレジ
スタ番号12、変位13)とから構成されている。○}
PSWキー10が“0”の場合は、特権プログラムと
して主記憶キーの値にかかわらずアクセスを許すように
するため、チェック回路14にて、PSWキー10の値
を判定する。
The instruction held in the instruction register is composed of an instruction part and an address part (base register number 11, index register number 12, displacement 13). ○}
If the PSW key 10 is "0", the check circuit 14 determines the value of the PSW key 10 in order to permit access as a privileged program regardless of the value of the main memory key.

PSWキーの値が“0”の場合は、直ちに、主記憶アド
レス作成回路16で得られたアドレスにもとづいて主記
憶30へのアクセスを行う。一方、PSWキー10が“
0”でない場合は、チェック回路14から比較回路17
へPkの値を送出する。■ Rkキー謙取回路15は、
ベースレジスタ番号11よりベースレジスタ内の保護キ
ーRkを求め、比較回路17へ送出する。
If the value of the PSW key is "0", the main memory 30 is immediately accessed based on the address obtained by the main memory address generation circuit 16. On the other hand, the PSW key 10 is “
0”, the check circuit 14 to the comparison circuit 17
The value of Pk is sent to. ■ Rk key Kendori circuit 15 is
The protection key Rk in the base register is determined from the base register number 11 and sent to the comparison circuit 17.

【3’主記憶アドレス作成回路16は、ベースレジスタ
番号11により指定されたベースレジスタ内の値と、イ
ンデックスレジスタ番号12により指定されたインデッ
クスレジスタ内の値と、変位13の値とを加えて、アク
セスしたい主記憶アドレスを求める。
[3' The main memory address creation circuit 16 adds the value in the base register specified by base register number 11, the value in the index register specified by index register number 12, and the value of displacement 13, Find the main memory address you want to access.

求めた主記憶アドレスは、主記憶アクセス回路22へ送
出すると同時に、M比キー読取回路18へも送出する。
【4’Mkキー読取回路18では、アクセスしたいアド
レスが示す主記憶の主記憶キーMkを求め、比較回路1
9へ送出する。
The obtained main memory address is sent to the main memory access circuit 22 and also to the M ratio key reading circuit 18 at the same time.
[4' The Mk key reading circuit 18 finds the main memory key Mk of the main memory indicated by the address to be accessed, and the comparison circuit 1
Send to 9.

【5} 一方、比較回路17は、チェック回路14から
のキーと、Rkキー読取回路15からのキーの比較を行
うものであるが、キー全ての比較ではなく、キーの値に
より問題プログラムかモニタプログラムかの判定を行う
[5} On the other hand, the comparison circuit 17 compares the key from the check circuit 14 and the key from the Rk key reading circuit 15, but it does not compare all the keys, but rather determines whether the problem program is a problem program or the monitor based on the value of the key. Determine whether it is a program.

例えば、キーの値を、0〜nまでをモニタブログラムで
使用し、n+1〜mまでを問題プログラムで使用させて
いたとすると、Pk=0〜nのときは全てアクセス化と
し、Pk=n十1〜mでかつRk=n+1〜mのときは
アクセス可、Pk=n十1〜mでかつRk=0〜nのと
きはエラーとあるように論理を組んでおけば、モニタプ
ログラムに全てのキーの値のメモ川こ対するアクセスを
許しておくことができる。
For example, if key values from 0 to n are used in the monitor program, and values from n+1 to m are used in the problem program, when Pk = 0 to n, all are accessed, and Pk = n + 1 to m and Rk = n+1 to m, access is possible, and if Pk = n11 to m and Rk = 0 to n, it is an error, then all You can allow access to a memo of key values.

一方、問題プログラムの場合は、その問題プログラム自
身に許されたキーの値のメモリしかアクセスできなくす
るようにすることができる。比較回路17でアクセス可
となった場合は、キーRkを比較回路19へ送出する。
また、比較回路17でエラーとなった場合は、エラー信
号をエラー通知回路20へ送出する。(6’比較回路1
9は、キ−値が完全に一致しないとエラーとする回路で
ある。
On the other hand, in the case of a problem program, the problem program itself can only access memory whose key values are allowed. If the comparison circuit 17 allows access, the key Rk is sent to the comparison circuit 19.
Further, if an error occurs in the comparison circuit 17, an error signal is sent to the error notification circuit 20. (6' Comparison circuit 1
9 is a circuit that generates an error if the key values do not completely match.

比較回路19において、不一致が検出されたならば、エ
ラー通知回路20へエラー信号を送出し、一致が検出さ
れたならば、アクセス可信号をアクセス可能信号発生回
路21へ送出する。‘7} エラー通知回路20は、比
較回路17または比較回路19からエラー信号を受信す
ると、プログラムエラー信号を発信する。
In the comparison circuit 19, if a mismatch is detected, an error signal is sent to the error notification circuit 20, and if a match is detected, an accessible signal is sent to the accessible signal generating circuit 21. '7} When the error notification circuit 20 receives an error signal from the comparison circuit 17 or the comparison circuit 19, it transmits a program error signal.

‘8) アクセス可能信号発生回路21は、チェック回
路14がPk=0を判定したとき、または、比較回路1
9がRk=Mkを検出したとき、アクセス可能信号を主
記憶アクセス回路22へ送出する。
'8) When the check circuit 14 determines that Pk=0, the access enable signal generation circuit 21
9 detects Rk=Mk, it sends an access enable signal to the main memory access circuit 22.

‘9) 主記憶アクセス回路22は、アクセス可能信号
発生回路21からのアクセス可能信号の受信により、主
記憶アドレス作成回路16から送られてきたアドレスで
主記憶をアクセスする。
'9) The main memory access circuit 22 receives the access enable signal from the access enable signal generation circuit 21 and accesses the main memory using the address sent from the main memory address generation circuit 16.

上記のように構成することにより、PSWキーを変更し
なくても、異なる主記憶キーを有する主記憶領域へのア
クセスが可能となる。即ち、一般的にモニタプログラム
等はいくつかの異なった主記憶キーをもつ主記憶領域を
アクセスすることが多く、このようなとき、従来はPS
Wキーをその都度変更していたが本方式によればその中
央処理装置で許される複数個のベースレジスタにアクセ
スしたい主記憶アドレスとそれに対応するそれぞれ異な
る保護キーを前もって格納しておくことにより、PSW
キーを変更することなく、当該使用中のベースレジスタ
内の保護キーを使用して主記憶アクセスを行うことがで
きる。例えば、それぞれ異なる主記憶キーa,b,cを
有する主記憶領域A,B,Cを交互にアクセスするよう
な場合においては、従来方式においてはアクセスの都度
、PSWキーの内容をa→b→c→a→b→c・・・・
・・というように書替えていたが、本方式によれば、主
記憶領域A,B,Cに対応してそれぞれベースレジスタ
B^,BB,Bcを割当て、該ベースレジスタ内の保護
キーを前もってそれぞれa,b,cとなるように設定し
ておけば、上記の如く、主記憶領域A,B,Cを交互に
アクセスするような場合においても、PSWキーの変更
は全く必要としなくなる。
By configuring as described above, it is possible to access a main storage area having a different main storage key without changing the PSW key. That is, in general, monitor programs etc. often access main memory areas with several different main memory keys, and in such cases, conventionally, PS
The W key was changed each time, but according to this method, by storing in advance the main memory address to be accessed and the corresponding different protection keys in multiple base registers allowed by the central processing unit, PSW
Main memory access can be performed using the protected key in the base register in use without changing the key. For example, when main memory areas A, B, and C having different main memory keys a, b, and c are accessed alternately, in the conventional method, the contents of the PSW key are changed from a → b → c→a→b→c・・・・・
However, according to this method, base registers B^, BB, and Bc are allocated to main storage areas A, B, and C, respectively, and the protection keys in the base registers are rewritten in advance. If the settings are set to be a, b, and c, there is no need to change the PSW key even when the main storage areas A, B, and C are accessed alternately as described above.

以上説明したように本発明によれば、主記憶保護を満足
しながら、かつ中央処理装置のPSW内の保護キーを変
更することなく主記憶をアクセスできるので、プログラ
ム作成が容易になるという優れた効果を奏する。
As explained above, according to the present invention, the main memory can be accessed without changing the protection key in the PSW of the central processing unit while satisfying the main memory protection, which is an excellent feature of facilitating program creation. be effective.

さらに、本発明においては、保護キーの値を更に増加さ
せた場合の主記憶保護に対しても対応できる効果を有し
ている。
Furthermore, the present invention has the effect of being able to handle main memory protection when the value of the protection key is further increased.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は主記憶保護をつかさどる各キーの存在場所を示
す図、第2図は本発明による実施例のデータ処理装置の
ブロック構成図である。 図中、1と10はPSWキー、2はベースレジスタ内の
保護キー、4は主記憶キー、5は主記憶領域、11はベ
ースレジスタ番号、12はインデックスレジスタ番号、
13は変位、14はチェック回路、15はRkキー読取
回路、16は主記憶アドレス作成回路、17は比較回路
、18はMkキー読取回路、19は比較回路、2川まエ
ラー通知回路、21はアクセス可能信号発生回路、22
は主記憶アクセス回路、3川ま主記憶である。 第1図第2図
FIG. 1 is a diagram showing the location of each key responsible for main memory protection, and FIG. 2 is a block diagram of a data processing apparatus according to an embodiment of the present invention. In the figure, 1 and 10 are PSW keys, 2 is a protection key in the base register, 4 is a main memory key, 5 is a main memory area, 11 is a base register number, 12 is an index register number,
13 is a displacement, 14 is a check circuit, 15 is an Rk key reading circuit, 16 is a main memory address creation circuit, 17 is a comparison circuit, 18 is an Mk key reading circuit, 19 is a comparison circuit, 2 rivers and error notification circuits, 21 is a Accessible signal generation circuit, 22
is the main memory access circuit, and the main memory is the main memory. Figure 1 Figure 2

Claims (1)

【特許請求の範囲】 1 主記憶に主記憶キーをそなえ、中央処理装置から主
記憶をアクセスするとき、中央処理装置内部に用意した
保護キーと上記主記憶キーとの比較を行うデータ処理シ
ステムにおいて、上記保護キーをプログラム状態語内と
、ベースレジスタ内の両方にもうけるとともに、上記プ
ログラム状態語内の保護キーと上記ベースレジスタ内の
保護キーとを比較する第1の比較手段と、上記ベースレ
ジスタ内の保護キーと上記主記憶キーとを比較する第2
の比較手段をもうけ、上記第1および第2の比較手段の
比較結果にもとづいて、主記憶アクセスを制御するよう
にしたことを特徴とする主記憶保護方式。 2 主記憶キーの異なる複数の主記憶をアクセスすると
き、それぞれの主記憶に対して異なるベースレジスタを
割当てておくことにより、上記プログラム状態語内の保
護キーを変更することなく、主記憶アクセスを可能とす
ることを特徴とする特許請求の範囲第1項記載の主記憶
保護方式。
[Scope of Claims] 1. In a data processing system in which a main memory key is provided in a main memory, and when the main memory is accessed from a central processing unit, a protection key prepared inside the central processing unit is compared with the main memory key. , a first comparing means for providing the protection key in both the program state word and the base register, and comparing the protection key in the program state word with the protection key in the base register; A second step that compares the protection key in the main memory key with the main memory key.
1. A main memory protection system, comprising a comparison means, and main memory access is controlled based on the comparison results of the first and second comparison means. 2. When accessing multiple main memories with different main memory keys, by assigning different base registers to each main memory, main memory access can be performed without changing the protection key in the program state word. The main memory protection system according to claim 1, wherein the main memory protection system enables
JP8237980A 1980-06-18 1980-06-18 Main memory protection method Expired JPS6035694B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8237980A JPS6035694B2 (en) 1980-06-18 1980-06-18 Main memory protection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8237980A JPS6035694B2 (en) 1980-06-18 1980-06-18 Main memory protection method

Publications (2)

Publication Number Publication Date
JPS578860A JPS578860A (en) 1982-01-18
JPS6035694B2 true JPS6035694B2 (en) 1985-08-16

Family

ID=13772941

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8237980A Expired JPS6035694B2 (en) 1980-06-18 1980-06-18 Main memory protection method

Country Status (1)

Country Link
JP (1) JPS6035694B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0235594U (en) * 1988-08-25 1990-03-07
JPH0235595U (en) * 1988-08-25 1990-03-07
JPH0238891U (en) * 1988-09-07 1990-03-15

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6376034A (en) * 1986-09-19 1988-04-06 Hitachi Ltd Multiple address space control system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0235594U (en) * 1988-08-25 1990-03-07
JPH0235595U (en) * 1988-08-25 1990-03-07
JPH0238891U (en) * 1988-09-07 1990-03-15

Also Published As

Publication number Publication date
JPS578860A (en) 1982-01-18

Similar Documents

Publication Publication Date Title
US4434464A (en) Memory protection system for effecting alteration of protection information without intervention of control program
US5056009A (en) IC memory card incorporating software copy protection
GB1495332A (en) Memory having non-fixed relationships between addresses and storage locations
US20040177266A1 (en) Data processing system with peripheral access protection and method therefor
US5611042A (en) Data error detection and correction for a shared SRAM
US5901311A (en) Access key protection for computer system data
US7558940B2 (en) Virtual memory translator for real-time operating systems
US6647475B2 (en) Processor capable of enabling/disabling memory access
JPS6035694B2 (en) Main memory protection method
JPH01152589A (en) Portable data carrier
US6807602B1 (en) System and method for mapping bus addresses to memory locations utilizing access keys and checksums
JPS6044706B2 (en) Memory access method
JP4260805B2 (en) CAM device and CAM control method
JPS6329859A (en) Memory protection circuit
JPS6136669B2 (en)
JP2587468B2 (en) Lock data setting device
JPS6120160A (en) Method for detecting exception of addressing
JP2547329B2 (en) Lock data setting device
JP2581057B2 (en) Evaluation microcomputer
JPS59154698A (en) Protecting system of control storage
JPS6020779B2 (en) Composite computer system
JPH01166148A (en) Memory access device
JPS62212852A (en) Storage protecting system
JPS62266602A (en) Setting guard device for system parameter
JP2002032352A (en) Multiprocessor system