Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP4423849B2 - Data protection system, data protection program, and data protection method - Google Patents
[go: Go Back, main page]

JP4423849B2 - Data protection system, data protection program, and data protection method - Google Patents

Data protection system, data protection program, and data protection method Download PDF

Info

Publication number
JP4423849B2
JP4423849B2 JP2002322604A JP2002322604A JP4423849B2 JP 4423849 B2 JP4423849 B2 JP 4423849B2 JP 2002322604 A JP2002322604 A JP 2002322604A JP 2002322604 A JP2002322604 A JP 2002322604A JP 4423849 B2 JP4423849 B2 JP 4423849B2
Authority
JP
Japan
Prior art keywords
page
task
protection
data
attribute
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2002322604A
Other languages
Japanese (ja)
Other versions
JP2004157751A (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.)
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 JP2002322604A priority Critical patent/JP4423849B2/en
Publication of JP2004157751A publication Critical patent/JP2004157751A/en
Application granted granted Critical
Publication of JP4423849B2 publication Critical patent/JP4423849B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、リアルタイムオペレーティングシステムの様に、主記憶上に全プログラムとデータをロードしておきメモリ空間を全てのプログラムで共有しているオペレーティングシステムを利用する際にプログラムのデータを保護するシステム、プログラムのデータを保護するプログラム、保護方法に関し、特にこの様なオペレーティングシステムを利用する際に、プログラムの不具合等で他のプログラムやタスクのデータが書き換えられることを防止するデータ保護システム、データ保護プログラム及びデータ保護方法に関する。
【0002】
【従来の技術】
従来、仮想記憶を備えたオペレーティングシステムではプロセス毎にアドレス空間を持ち、プロセスの切替毎にページテーブルを更新する。これにより、カレントプロセスから別のプロセスのデータを書き換えることは起きない。
【0003】
しかし、リアルタイムシステムで利用するリアルタイムオペレーティングシステムは高速な処理が必要なため、主記憶メモリ上に全プログラムとデータをロードしておきメモリ空間を全てのプログラムで共有している。
【0004】
また、プログラムとデータのアドレスは物理アドレスと一致している。
【0005】
よって、プログラムの不具合による不適当なアドレスへのアクセスを検出できない。
【0006】
一方これに類似した問題を改善する技術としてメモリ保護装置がある(例えば、特許文献1参照)。
【0007】
このメモリ保護装置は、各メモリブロックに対応して保護情報を格納する複数個のメモリ保護情報記憶手段と、あるメモリブロックに関する属性情報を記憶するカレントキー情報記憶手段とを備え、あるメモリブロックをアクセスする前に予め、該メモリブロックに対応するメモリ保護情報記憶手段に保護キーを設定し、該メモリブロックに関する属性キーをカレントキー情報記憶手段に設定しておき、メモリブロックへのアクセスがある度に該メモリアクセスと並行して、メモリ保護記憶手段内の該メモリアドレスに対応するメモリブロックの保護キーとカレントキー情報記憶手段内の属性キーとを比較し、予め定められた条件を満足すれば該メモリアクセスを許容し、満足しなければ該メモリアクセスを禁止してアクセス違反が生じたことを外部に通知するメモリ保護装置である。
【0008】
ここで保護キーレジスタのメモリブロック上位アドレスが一致し、かつカレントキーレジスタと保護キーレジスタのプロセスIDが一致すればアクセスを許可する。
【0009】
又、メモリ保護テーブルをメモリブロックを格納する一般のメモリから分離して、メモリ保護テーブルとメモリブロックとが同時アクセス出来るようにすることによって処理能力を低下させることなくメモリ保護チェックを行うものである。
【0010】
【特許文献1】
特開平5−134930号公報(段落[0008]、[0014]、[0054]〜[0056])
【0011】
【発明が解決しようとする課題】
従って、上記メモリ保護装置では、メモリ保護テーブルの各エントリがプロセスIDを保持しており、1ビットの保護ビットを設ける場合よりメモリサイズが大きくなり、又一般メモリとは分離した別のメモリ等であり、その分金物量が増えると言う問題がある。
【0012】
少なくとも、携帯端末等の小型装置におけるデータの保護システムには向かない。
【0013】
また、メモリ保護テーブルへのプロセスID等の設定は、あるメモリブロックをアクセスする前に予め設定するが、初期設定で全エントリの設定を纏めて行う手段はなく、初期に全てのプログラムを主記憶にロードし、データ域を確保して以降そのメモリマップで動作するシステムには向かない。
【0014】
本発明の目的は、リアルタイムオペレーティングシステムの様に、主記憶メモリ上に全プログラムとデータをロードしておきメモリ空間を全てのプログラムで共有しているオペレーティングシステムを利用したシステムで、個々のプログラムの所有する(書き換えできる)領域を保護するシステム、保護するためのプログラム及び方法を提供するものである。
【0015】
特に、主記憶アクセスに関する処理時間増加を少なくでき、オペレーティングシステム配下のプログラムを変更することなく、又、小型の端末や情報処理装置にも適用できるデータ保護システム、保護プログラム及び方法を提供するものである。
【0016】
【課題を解決するための手段】
本発明の第1のデータ保護システムは、一つのメモリ空間をプログラムで共有するオペレーティングシステム利用のシステムにおいて、システムの初期設定で、個々のタスクが所有する主記憶上のページ情報をタスク単位でデータ保護テーブルに設定する手段と、主記憶アクセス時そのアドレスに対応するエントリが参照されるページテーブルを前記データ保護テーブルの情報を元に作成し、これの各ページの属性を保護状態に設定する手段を有することを特徴とする。
【0017】
本発明の第2のデータ保護システムは、前記第1のデータ保護システムに於いて、前記データ保護テーブルの設定を行い、この情報を元に前記ページテーブルを作成し、各ページの属性を保護状態に設定する初期設定手段と、保護状態のページへの書込要求があれば呼び出されるページ保護例外処理手段と、タスク切替手段を備え、前記ページ保護例外処理手段は、実行していたタスクのIDを前記オペレーティングシステムより取得し、データ保護テーブルの当該タスクの保護ページ情報が前記保護例外となったページを含むかをチェックする手段と、チェックの結果前記ページを含めばページテーブルの該当ページの属性を許可状態にし、前記実行していたタスクIDがデータ許可テーブル4に登録されてなければそれを登録する手段と、前記チェックの結果、前記ページを含まなければ実行していたタスクを休止状態にする手段を有し、前記タスク切替手段は、タスクを切り替える際に、データ許可テーブルにタスクIDが登録されていればデータ保護テーブルの対応するタスクの保護ページ情報を取得し、ページテーブルの対応するページの属性を保護状態に戻し、前記データ許可テーブルのタスクIDを消去する手段を有することを特徴とする。
【0018】
本発明の第3のデータ保護システムは、前記第1のデータ保護システムに於いて、前記データ保護テーブルの設定を行い、この情報を元に前記ページテーブルを作成し、各ページの属性を保護状態に設定する初期設定手段と、保護状態のページへの書込要求があれば呼び出されるページ保護例外処理手段と、タスク切替手段を備え、前記ページ保護例外処理手段は、実行していたタスクのIDを前記オペレーティングシステムより取得し、データ保護テーブルの当該タスクの保護ページ情報が前記保護例外となったページを含むかをチェックする手段と、チェックの結果前記ページを含めばページテーブルの当該ページの属性を許可状態にし、そのページの識別情報をデータ許可テーブルに登録する手段と、チェックの結果前記ページを含まなければ実行していたタスクを休止状態にする手段を有し、前記タスク切替手段は、タスクを切り替える際に、データ許可テーブルにページ識別情報が登録されていれば、ページテーブルの対応するページの属性を保護状態に戻し、データ許可テーブルの前記ページ識別情報を消去する手段を有することを特徴とする。
【0019】
本発明の第4のデータ保護システムは、一つのメモリ空間をプログラムで共有するオペレーティングシステム利用のシステムにおいて、ページテーブルを作成する手段と、システムの初期設定で、個々のタスクが所有する主記憶上のページ情報をタスク単位でデータ保護テーブルに設定する手段と、ページテーブルの、前記データ保護テーブルが示す保護ページについて属性を保護状態に設定する手段を有することを特徴とする。
【0020】
本発明の第5のデータ保護システムは、前記第4のデータ保護システムに於いて、前記データ保護テーブルの設定を行い、この情報を元に前記ページテーブルの属性を保護状態に設定する初期設定手段と、保護状態のページへの書込要求があれば呼び出されるページ保護例外処理手段とタスク切替手段を備え、前記ページ保護例外処理手段は、実行していたタスクのIDを前記オペレーティングシステムより取得し、データ保護テーブルの当該タスクの保護ページ情報が前記保護例外となったページを含むかをチェックする手段と、チェックの結果前記ページを含めばページテーブルの該当ページの属性を許可状態にし、前記実行していたタスクIDがデータ許可テーブルに登録されてなければそれを登録する手段と、前記チェックの結果、前記ページを含まなければ実行していたタスクを休止状態にする手段を有し、前記タスク切替手段は、タスクを切り替える際に、データ許可テーブルにタスクIDが登録されていればデータ保護テーブルの対応するタスクの保護ページ情報を取得し、ページテーブルの対応するページの属性を保護状態に戻し、前記データ許可テーブルのタスクIDを消去する手段を有することを特徴とする。
【0021】
本発明の第6のデータ保護システムは、前記第4のデータ保護システムに於いて、前記データ保護テーブルの設定を行い、この情報を元に前記ページテーブルの属性を保護状態に設定する初期設定手段と、保護状態のページへの書込要求があれば呼び出されるページ保護例外処理手段とタスク切替手段を備え、ページ保護例外処理手段は、実行していたタスクのIDを前記オペレーティングシステムより取得し、データ保護テーブルの当該タスクの保護ページ情報が前記保護例外となったページを含むかをチェックする手段と、チェックの結果前記ページを含めばページテーブルの当該ページの属性を許可状態にし、そのページの識別情報をデータ許可テーブルに登録する手段と、前記チェックの結果前記ページを含まなければ実行していたタスクを休止状態にする手段を有し、前記タスク切替手段は、タスクを切り替える際に、データ許可テーブルにページ識別情報が登録されていれば、ページテーブルの対応するページの属性を保護状態に戻し、データ許可テーブルの前記ページ識別を消去する手段を有することを特徴とする。
【0022】
本発明の第1のデータ保護プログラムは、システムの初期設定で、個々のタスクが所有する主記憶上のページ情報をタスク単位でデータ保護テーブルに設定する手順と、主記憶アクセス時そのアドレスに対応するエントリが参照されるページテーブルを前記データ保護テーブルの情報を元に作成し、これの各ページの属性を保護状態に設定する手順を有することを特徴とする。
【0023】
本発明の第2のデータ保護プログラムは、前記第1のデータ保護プログラムに於いて、前記データ保護テーブルの設定を行い、この情報を元に前記ページテーブルを作成し、各ページの属性を保護状態に設定する初期設定手順と、保護状態のページへの書込要求が有れば呼び出されるページ保護例外処理手順と、タスクの切替を行うタスク切替手順を備え、前記ページ保護例外処理手順は、実行していたタスクのIDを前記オペレーティングシステムより取得し、データ保護テーブルの当該タスクの保護ページ情報が前記保護例外となったページを含むかをチェックする手順と、チェックの結果前記ページを含めばページテーブルの当該ページの属性を許可状態にし、前記実行していたタスクIDがデータ許可テーブルに登録されてなければそれを登録する手順と、チェックの結果前記ページを含まなければ実行していたタスクを休止状態にする手順を有し、前記タスク切替手順が、タスクを切り替える際に、データ許可テーブルにタスクIDが登録されていればデータ保護テーブルの対応タスクの保護ページ情報を取得し、ページテーブルの対応するページの属性を保護状態に戻し、前記データ許可テーブルのタスクIDを消去する手順を有することを特徴とする。
【0024】
本発明の第3のデータ保護プログラムは、前記第1のデータ保護プログラムに於いて、前記データ保護テーブルの設定を行い、この情報を元に前記ページテーブルを作成し、各ページの属性を保護状態に設定する初期設定手順と、保護状態のページへの書込要求が有れば呼び出されるページ保護例外処理手順とタスクの切替を行うタスク切替手順を備え、前記ページ保護例外処理手順は、実行していたタスクのIDを前記オペレーティングシステムより取得し、データ保護テーブルの当該タスクの保護ページ情報が前記保護例外となったページを含むかをチェックする手順と、チェックの結果前記ページを含めばページテーブルの当該ページの属性を許可状態にし、そのページの識別情報をデータ許可テーブルに登録する手順と、チェックの結果前記ページを含まなければ実行していたタスクを休止状態にする手順を有し、前記タスク切替手順が、タスクを切り替える際に、データ許可テーブルにページの識別情報が登録されていれば、ページテーブルの対応するページの属性を保護状態に戻し、データ許可テーブルの前記ページ識別を消去する手順を有することを特徴とする。
【0025】
本発明の第4のデータ保護プログラムは、ページテーブルを作成する手順と、システムの初期設定で、個々のタスクが所有する主記憶上のページ情報をタスク単位でデータ保護テーブルに設定する手順と、ページテーブルの、前記データ保護テーブルが示す保護ページについて属性を保護状態に設定する手順を有することを特徴とする。
【0026】
本発明の第5のデータ保護プログラムは、前記第4のデータ保護プログラムに於いて、前記データ保護テーブルの設定を行い、この情報を元に前記ページテーブルの属性を保護状態に設定する初期設定手順と、保護状態のページへの書込要求があれば呼び出されるページ保護例外処理手順と、タスクの切替を行うタスク切替手順を備え、前記ページ保護例外処理手順は、実行していたタスクのIDを前記オペレーティングシステムより取得し、データ保護テーブルの当該タスクの保護ページ情報が前記保護例外となったページを含むかをチェックする手順と、チェックの結果前記ページを含めばページテーブルの当該ページの属性を許可状態にし、前記実行していたタスクIDがデータ許可テーブルに登録されてなければそれを登録する手順と、前記チェックの結果、前記ページを含まなければ実行していたタスクを休止状態にする手順を有し、前記タスク切替手順が、タスクを切り替える際に、データ許可テーブルにタスクIDが登録されていればデータ保護テーブルの対応するタスクの保護ページ情報を取得し、ページテーブルの対応するページの属性を保護状態に戻し、前記データ許可テーブルのタスクIDを消去する手順を有することを特徴とする。
【0027】
本発明の第6のデータ保護プログラムは、前記第4のデータ保護プログラムに於いて、前記データ保護テーブルの設定を行い、この情報を元に前記ページテーブルの属性を保護状態に設定する初期設定手順と、保護状態のページへの書込要求があれば呼び出されるページ保護例外処理手順と、タスクの切替を行うタスク切替手順を備え、前記ページ保護例外処理手順は、実行していたタスクのIDを前記オペレーティングシステムより取得し、データ保護テーブルの当該タスクの保護ページ情報が前記保護例外となったページを含むかをチェックする手順と、チェックの結果前記ページを含めばページテーブルの該当ページの属性を許可状態にし、そのページの識別情報をデータ許可テーブルに登録する手順と、前記チェックの結果前記ページを含まなければ実行していたタスクを休止状態にする手順を有し、前記タスク切替手順が、タスクを切り替える際に、データ許可テーブルにページ識別情報が登録されていれば、ページテーブルの対応するページの属性を保護状態に戻し、データ許可テーブルの前記ページ識別を消去する手順を有することを特徴とする。
【0028】
本発明の第1のデータ保護方法は、システムの初期設定をする初期設定手順と、保護状態のページへの書込要求が有れば呼び出されるページ保護例外処理手順と、タスクの切替を行うタスク切替手順を備え、前記初期設定手順はタスクが所有する主記憶上のページ情報をタスク単位でデータ保護テーブルに設定する手順と、主記憶アクセス時そのアドレスに対応するエントリが参照されるページテーブルを前記データ保護テーブルの情報を元に作成し、これの各ページの属性を保護状態に設定する手順を有し、前記ページ保護例外処理手順は、実行していたタスクのIDを前記オペレーティングシステムより取得し、データ保護テーブルの当該タスクの保護ページ情報が前記保護例外となったページを含むかをチェックする手順と、チェックの結果前記ページを含めばページテーブルの当該ページの属性を許可状態にし、前記実行していたタスクIDがデータ許可テーブルに登録されてなければそれを登録する手順と、チェックの結果前記ページを含まなければ実行していたタスクを休止状態にする手順を有し、前記タスク切替手順が、タスクを切り替える際に、データ許可テーブルにタスクIDが登録されていればデータ保護テーブルの対応タスクの保護ページ情報を取得し、ページテーブルの対応するページの属性を保護状態に戻し、前記データ許可テーブルのタスクIDを消去する手順を有することを特徴とする。
【0029】
本発明の第2のデータ保護方法は、システムの初期設定をする初期設定手順と、保護状態のページへの書込要求が有れば呼び出されるページ保護例外処理手順と、タスクの切替を行うタスク切替手順を備え、前記初期設定手順はタスクが所有する主記憶上のページ情報をタスク単位でデータ保護テーブルに設定する手順と、主記憶アクセス時そのアドレスに対応するエントリが参照されるページテーブルを前記データ保護テーブルの情報を元に作成し、これの各ページの属性を保護状態に設定する手順を有し、前記ページ保護例外処理手順は、実行していたタスクのIDを前記オペレーティングシステムより取得し、データ保護テーブルの当該タスクの保護ページ情報が前記保護例外となったページを含むかをチェックする手順と、チェックの結果前記ページを含めばページテーブルの当該ページの属性を許可状態にし、そのページの識別情報をデータ許可テーブルに登録する手順と、チェックの結果前記ページを含まなければ実行していたタスクを休止状態にする手順を有し、前記タスク切替手順が、タスクを切り替える際に、データ許可テーブルにページの識別情報が登録されていれば、ページテーブルの対応するページの属性を保護状態に戻し、データ許可テーブルの前記ページ識別を消去する手順を有することを特徴とする。
【0030】
本発明の第3のデータ保護方法は、システムの初期設定をする初期設定手順と、保護状態のページへの書込要求が有れば呼び出されるページ保護例外処理手順と、タスクの切替を行うタスク切替手順を備え、前記初期設定手順はタスクが所有する主記憶上のページ情報をタスク単位でデータ保護テーブルに設定する手順と、このデータ保護テーブルの情報に従って、ページテーブルの対応ページの属性を保護状態に設定する手順を有し、前記ページ保護例外処理手順は、実行していたタスクのIDを前記オペレーティングシステムより取得し、データ保護テーブルの当該タスクの保護ページ情報が前記保護例外となったページを含むかをチェックする手順と、チェックの結果前記ページを含めばページテーブルの当該ページの属性を許可状態にし、前記実行していたタスクIDがデータ許可テーブルに登録されてなければそれを登録する手順と、チェックの結果前記ページを含まなければ実行していたタスクを休止状態にする手順を有し、前記タスク切替手順が、タスクを切り替える際に、データ許可テーブルにタスクIDが登録されていればデータ保護テーブルの対応タスクの保護ページ情報を取得し、ページテーブルの対応するページの属性を保護状態に戻し、前記データ許可テーブルのタスクIDを消去する手順を有することを特徴とする。
【0031】
本発明の第4のデータ保護方法は、システムの初期設定をする初期設定手順と、保護状態のページへの書込要求が有れば呼び出されるページ保護例外処理手順と、タスクの切替を行うタスク切替手順を備え、前記初期設定手順はタスクが所有する主記憶上のページ情報をタスク単位でデータ保護テーブルに設定する手順と、このデータ保護テーブルの情報に従って、ページテーブルの対応ページの属性を保護状態に設定する手順を有し、前記ページ保護例外処理手順は、実行していたタスクのIDを前記オペレーティングシステムより取得し、データ保護テーブルの当該タスクの保護ページ情報が前記保護例外となったページを含むかをチェックする手順と、チェックの結果前記ページを含めばページテーブルの当該ページの属性を許可状態にし、そのページの識別情報をデータ許可テーブルに登録する手順と、チェックの結果前記ページを含まなければ実行していたタスクを休止状態にする手順を有し、前記タスク切替手順が、タスクを切り替える際に、データ許可テーブルにページの識別情報が登録されていれば、ページテーブルの対応するページの属性を保護状態に戻し、データ許可テーブルの前記ページ識別を消去する手順を有することを特徴とする。
【0032】
【発明の実施の形態】
次に、本発明の実施の形態について図面を参照して詳細に説明する。先ず本発明の第1実施例を説明する。
【0033】
図1は本発明のデータ保護システムの構成を示したブロック図であり、データ保護システムは、リアルタイムオペレーティングシステム1、データ保護テーブル2、ページテーブル3、データ許可テーブル4、初期設定手段5、ページ保護例外処理手段6により構成される。
【0034】
初期設定手段5は予め決めた保護するデータのページアドレスとページ数(長さ)とそのデータを所有する(書き換える)タスクIDとをタスクID単位でデータ保護テーブル2に設定する。
【0035】
次に初期設定手段5はデータ保護テーブル2の情報をもとにMMU(メモリマネージメントユニット)の仕様に合わせてページテーブル3を作成する。
【0036】
リアルタイムオペレーティングシステム1も含めてプログラムが行う主記憶アクセス要求で、アクセスアドレスに対応したページテーブル3のエントリが参照される。
【0037】
リアルタイムオペレーティングシステム1はタスク管理手段11とタスク切替手段12を持ち、タスク切替手段12はページ情報切替手段121を有する。
【0038】
タスク管理手段11は実行中のタスク情報とプライオリティに合わせて次に実行するタスクを決める。
【0039】
タスク切替手段12はタスク切替が発生した場合、ページ情報切替手段121により実行していたタスクが保護されているデータにアクセスしていたか判断するためデータ許可テーブル4参照する。
【0040】
ページ情報切替手段121はデータ許可テーブル4にタスクのIDが登録されていれば、そのタスクが所有する保護ページがそのタスク実行期間に許可状態にされたと見なす。
【0041】
そしてデータ保護テーブル2の実行していたタスクの保護するページ情報を参照し、それに従ってページテーブル3の該当エントリの属性を保護状態にし(保護状態に戻し)、データ許可テーブル4の情報を消去し、タスク切替手段12はタスク管理手段11より次に実行するタスクを取得し、そのタスクに切替える。
【0042】
データ許可テーブル4にタスクIDが登録されてない場合は、実行していたタスクが保護ページにアクセスしていないと見なし、タスク管理手段11より次に実行するタスクを取得し、そのタスクに切替える。
【0043】
ページ保護例外が発生した場合、即ち、プログラムが行う主記憶アクセス要求で、アクセスアドレスに対応したページテーブル3のエントリが参照されその属性が保護状態で、要求が書き込みであればページ保護例外となりページ保護例外処理手段6が呼び出される。
【0044】
ページ保護例外処理手段6はタスク管理手段11より例外処理前に実行していたタスクIDを取得し、それをキーとしデータ保護テーブル2にアクセスし取得した保護ページ情報が、ページ保護例外が発生したページを含むか判断する。
【0045】
一致している場合ページテーブル3のページ保護例外が発生したページアドレスの属性を許可状態とし、データ許可テーブル4に実行中のタスクが自分の保護ページを許可状態にしたことを示す情報(実行中のタスクID)を書きタスクの実行を継続する。この際データ許可テーブル4に実行中のタスクIDが既に登録されていれば追記しない。一致しない場合はエラー情報を書き、タスクを休止状態にする。
【0046】
上記初期設定手段5、ページ保護例外処理手段6、リアルタイムオペレーティングシステム1の各手段は、システムを実現する端末(携帯端末、情報処理機能を持つ携帯電話も含む)や情報処理装置におけるプログラム手順により実現される。
【0047】
尚、リアルタイムオペレーティングシステム1を利用するシステムで、主記憶には実アドレスモードでしかアクセスしない場合は、ページテーブル3の各エントリの論理アドレス情報は設ける必要はない。
【0048】
次に、本実施例の動作について図面を参照して説明する。図2はデータ保護システムの動作やデータ保護プログラム、データ保護方法の手順を示すフローチャートである。
【0049】
図2を参照し、先ず初期設定処理を行い最初のタスクをタスク#1としこれが所有する保護されたデータにアクセスし、タスク#1が実行されタスク#2に切り替わり不具合でタスク#1等の他の保護ページの書き込み要求した場合について説明する。
【0050】
初期設定手段5は保護するページのページアドレスとページ数をタスク単位でデータ保護テーブル2に登録する(ステップ1)。データ保護テーブル2の情報を元に、MMUの仕様に合わせページテーブル3を作成し各エントリの属性を保護に設定する(ステップ2)。
【0051】
タスク管理手段11がプライオリティに従って次に実行するタスクを決める(タスク#1への切替発生)(ステップ3)。タスク切替手段12はデータ許可テーブル4に登録情報が有るかチェックし、最初につき登録されてないので(ステップ4)、直ぐに次のタスク(タスク#1)に切替えこれが実行される。
【0052】
タスク#1の主記憶アクセス(書き込み)でページ保護例外が発生する(ステップ7)。
【0053】
ページ保護例外処理手段6が実行していたタスクID(#1)をタスク管理手段11より取得し、データ保護テーブル2のID#1の保護ページ情報を取得する(ステップ8)。
【0054】
保護ページ情報が、例外が発生したページを含むか判定し、含まれるので(ステップ9)、例外が発生したページの属性を許可状態にし、データ許可テーブル4に実行中のタスクID(#1)が登録されてないのでこれを登録する(ステップ10)。
【0055】
タスク#1の実行が終了すると(ステップ11)、システムの終了条件かを判定し、終了条件はないので(ステップ13)、次のタスク(#2)への切替が発生する(ステップ3)。
【0056】
タスク切替手段12はデータ許可テーブル4に登録情報が有るかチェックし、ID#1が登録されているので、これをキーとしデータ保護テーブル2よりタスクID#1の保護ページ情報(ページアドレス)を取得し、ページテーブル3のページアドレス001(エントリ#1)の属性情報を保護状態に戻し、データ許可テーブル4の情報を消去する(ステップ5)。
【0057】
タスク切替手段12は次のタスク(#2)に切替えこれが実行され(ステップ6)、タスク#2が不具合でタスク#1の保護ページへの書き込みを要求しページ保護例外が発生する(ステップ7)。
【0058】
ページ保護例外処理手段6は実行していたタスクID(#2)を取得し、データ保護テーブル2のID#2の保護ページ情報を取得する(ステップ8)。
【0059】
そして、これには、例外が発生したページが含まれないと判定し(ステップ9)他タスクの保護ページへの書込要求が行われたとし、エラー情報を書き実行中タスクを休止状態にする(ステップ12)。
【0060】
尚、エラー情報はシリアルで外部に出してもメモリに保存してもディスプレイに表示してもよい。メモリ保護ハードウェアはMMU以外でもよい。
【0061】
次に本発明の第2実施例を説明する。本実施例ではプログラム等が主記憶にロードされる際にプログラムやデータ用の主記憶領域がMMU或いは初期設定手段5により割り付けられ、この情報に従ってページテーブル3が作成される。
【0062】
初期設定手段5は保護するデータのページアドレスとページ数(長さ)とそのデータを所有する(書き換える)タスクIDとをタスクID単位でデータ保護テーブル2に設定する。
【0063】
次に初期設定手段5はページテーブル3のエントリの内、データ保護テーブル2の保護ページ情報が指定するページの属性情報を保護状態に設定する。他の機能や処理は前記第1の実施例と同様である。
【0064】
次に本発明の第3実施例を説明する。本実施例ではページ保護例外処理手段6が、ページテーブル3の例外となったページの属性を許可状態に設定した際に、データ許可テーブル4には、実行中のタスクIDでなく、ページ識別(ページアドレス或いはページテーブルエントリ番号)を登録する(図3参照)。
【0065】
一つのタスクが複数の自分の保護ページに順次アクセスし、其の都度ページ保護例外処理手段6による許可状態設定が行われる場合は、データ許可テーブル4には、ページ識別が順次追記される。
【0066】
又、タスク切替手段12がタスクを切り替える際にデータ許可テーブル4の登録情報有無をチェックし、あればそれが示すページの属性を保護状態に設定し、データ許可テーブル4のページ識別情報を消去する。
【0067】
データ許可テーブル4に複数のページ識別情報が登録されていれば、上記動作を繰り返し行う。
【0068】
他の手段の機能ないし処理手順は第1の実施例、或いは第2の実施例と同様である。
【0069】
【発明の効果】
本発明によれば、ページ保護例外が発生したとき以外はページ情報の書換が発生しない。このためページテーブル書換時間、ページテーブルキャッシュのミスヒットによる処理時間が少なく出来る。
【0070】
特にタスク切替で次のタスクが所有する多数の保護ページについて無条件で属性を許可に変更するのでなく実際に書き換え要求が発生したページを処理するので、複数のタスクを時分割でリアルタイム処理しタスクの1回当たり処理量が限られる小型の携帯端末や携帯電話においても、データ保護に係わる余分な処理を行わず処理時間を少なくでき、複数タスクの同時処理性も維持出来る。
【0071】
また、システムの初期設定手段が個々のプログラムエリアやそれの所有する保護ページをデータ保護テーブルに設定し、その保護ページ情報をページテーブルに展開し、各ページ属性を保護状態とし、書込アクセスの内自分のページのみ一時許可するので、現状使用しているプログラムを修正することなくデータの保護機能を追加することが出来る。
【図面の簡単な説明】
【図1】本発明のデータ保護システムの構成を示したブロック図。
【図2】本発明のデータ保護システムの動作やデータ保護プログラム、データ保護方法の手順を示すフローチャート。
【図3】本発明の第3の実施例のデータ許可テーブル4の内容を示すブロック図。
【符号の説明】
1 リアルタイムオペレーティングシステム
11 タスク管理手段
12 タスク切替手段
121 ページ情報切替手段
2 データ保護テーブル
3 ページテーブル
4 データ許可テーブル
5 初期設定手段
6 ページ保護例外処理手段
[0001]
BACKGROUND OF THE INVENTION
The present invention, like a real-time operating system, protects program data when using an operating system in which all programs and data are loaded onto the main memory and the memory space is shared by all programs, Data protection system and data protection program for preventing program data from being rewritten due to a malfunction of the program, etc., especially when using such an operating system And a data protection method.
[0002]
[Prior art]
Conventionally, an operating system having a virtual memory has an address space for each process, and updates the page table every time the process is switched. As a result, the data of another process is not rewritten from the current process.
[0003]
However, since the real-time operating system used in the real-time system requires high-speed processing, all programs and data are loaded onto the main memory and the memory space is shared by all programs.
[0004]
Also, the program and data addresses coincide with the physical addresses.
[0005]
Therefore, access to an inappropriate address due to a program defect cannot be detected.
[0006]
On the other hand, there is a memory protection device as a technique for improving a similar problem (see, for example, Patent Document 1).
[0007]
The memory protection device includes a plurality of memory protection information storage means for storing protection information corresponding to each memory block, and a current key information storage means for storing attribute information relating to a certain memory block. Before accessing, a protection key is set in the memory protection information storage unit corresponding to the memory block, and an attribute key related to the memory block is set in the current key information storage unit. In parallel with the memory access, the protection key of the memory block corresponding to the memory address in the memory protection storage means is compared with the attribute key in the current key information storage means, and a predetermined condition is satisfied. If the memory access is permitted and not satisfied, the memory access is prohibited and an access violation occurs. A memory protection unit for notifying to the outside.
[0008]
Here, if the memory block upper address of the protection key register matches and the process IDs of the current key register and protection key register match, access is permitted.
[0009]
In addition, the memory protection table is separated from the general memory storing the memory block so that the memory protection table and the memory block can be accessed simultaneously, thereby performing the memory protection check without degrading the processing capability. .
[0010]
[Patent Document 1]
JP-A-5-134930 (paragraphs [0008], [0014], [0054] to [0056])
[0011]
[Problems to be solved by the invention]
Therefore, in the above memory protection device, each entry in the memory protection table holds a process ID, and the memory size becomes larger than when one protection bit is provided. There is a problem that the amount of hardware increases.
[0012]
At least, it is not suitable for a data protection system in a small device such as a portable terminal.
[0013]
In addition, the process ID and other settings in the memory protection table are set in advance before accessing a certain memory block, but there is no means for collectively setting all entries in the initial setting, and all programs are initially stored in the main memory. It is not suitable for a system that operates on the memory map after loading the data area and securing the data area.
[0014]
The object of the present invention is a system using an operating system in which all programs and data are loaded onto the main memory and the memory space is shared by all the programs, such as a real-time operating system. A system for protecting an owned (rewritable) area, and a program and method for protecting the system are provided.
[0015]
In particular, it is possible to provide a data protection system, a protection program, and a method that can reduce an increase in processing time related to main memory access, can be applied to a small terminal or an information processing apparatus without changing a program under an operating system. is there.
[0016]
[Means for Solving the Problems]
In a first data protection system according to the present invention, in a system using an operating system that shares a single memory space with a program, the page information on the main memory owned by each task is stored in units of tasks at the initial setting of the system. Means for setting in the protection table, and means for creating a page table to which an entry corresponding to the address is referred to when accessing the main memory based on the information in the data protection table, and setting the attribute of each page to the protection state It is characterized by having.
[0017]
In the second data protection system of the present invention, the data protection table is set in the first data protection system, the page table is created based on this information, and the attribute of each page is protected. Initial setting means to be set, page protection exception processing means called if there is a write request to the protected page, and task switching means, the page protection exception processing means is the ID of the task that was being executed Is acquired from the operating system, and means for checking whether the protected page information of the task in the data protection table includes the page that has become the protection exception, and if the page is included as a result of the check, the attribute of the corresponding page in the page table And means for registering the task ID that has been executed if it is not registered in the data permission table 4. If the result of the check is that the page is not included, the task has a means for putting the task that has been executed in a dormant state, and the task switching means has a task ID registered in the data permission table when the task is switched. It has means for acquiring protected page information of the corresponding task in the data protection table, returning the attribute of the corresponding page in the page table to the protected state, and erasing the task ID in the data permission table.
[0018]
In the first data protection system of the present invention, the data protection table is set in the first data protection system, the page table is created based on this information, and the attributes of each page are protected. Initial setting means to be set, page protection exception processing means called if there is a write request to the protected page, and task switching means, the page protection exception processing means is the ID of the task that was being executed Is acquired from the operating system, and means for checking whether the protected page information of the task in the data protection table includes the page that has become the protection exception, and if the page is included as a result of the check, the attribute of the page in the page table Includes a means for registering the identification information of the page in the data permission table and the result of the check. If the page identification information is registered in the data permission table when the task is switched, the task switching unit has a means for putting the corresponding task in the page table into a dormant state. Means for returning the attribute to the protected state and erasing the page identification information in the data permission table.
[0019]
According to a fourth data protection system of the present invention, in a system using an operating system in which one memory space is shared by a program, a means for creating a page table and an initial setting of the system on a main memory owned by each task Means for setting the page information in the data protection table in units of tasks, and means for setting the attribute of the page table to the protection state for the protection page indicated by the data protection table.
[0020]
The fifth data protection system of the present invention is the initial setting means for setting the data protection table in the fourth data protection system and setting the attribute of the page table to the protection state based on this information. And a page protection exception processing unit and a task switching unit which are called if there is a write request to the protected page, and the page protection exception processing unit obtains the ID of the task being executed from the operating system. Means for checking whether the protected page information of the task in the data protection table includes the page that has become the protection exception; if the page is included as a result of the check, the attribute of the corresponding page in the page table is permitted and the execution If the task ID that has been registered is not registered in the data permission table, the means for registering it, and the result of the check, If the page is not included, the task switching means has a means for putting the task that has been executed in a dormant state, and the task switching means corresponds to the data protection table if the task ID is registered in the data permission table when the task is switched. Means for acquiring the protected page information of the task to be performed, returning the attribute of the corresponding page of the page table to the protected state, and deleting the task ID of the data permission table.
[0021]
According to a sixth data protection system of the present invention, in the fourth data protection system, initial setting means for setting the data protection table and setting the attribute of the page table to a protection state based on this information And a page protection exception processing means and a task switching means that are called if there is a write request to the protected page, the page protection exception processing means obtains the ID of the task that has been executed from the operating system, A means for checking whether the protected page information of the task in the data protection table includes the page that has become the protection exception, and if the page is included as a result of the check, the attribute of the page in the page table is set to the permitted state, and the page The means for registering identification information in the data permission table and the result of the check were executed if the page was not included The task switching means returns the attribute of the corresponding page of the page table to the protected state if the page identification information is registered in the data permission table when switching the task. And means for erasing the page identification of the data permission table.
[0022]
The first data protection program of the present invention corresponds to a procedure for setting page information on the main memory owned by each task in the data protection table in units of tasks in the initial setting of the system, and the address at the time of main memory access A page table to which an entry to be referred to is created based on the information in the data protection table, and an attribute of each page of the page table is set to a protected state.
[0023]
The second data protection program of the present invention sets the data protection table in the first data protection program, creates the page table based on this information, and sets the attribute of each page to the protected state. An initial setting procedure to be set, a page protection exception handling procedure to be called if there is a write request to a protected page, and a task switching procedure to switch tasks, the page protection exception handling procedure is executed The ID of the task that has been acquired from the operating system, and the procedure for checking whether the protected page information of the task in the data protection table includes the page that has become the protection exception; If the attribute of the page in the table is set to the permitted state and the task ID being executed is not registered in the data permission table If the page is not included as a result of the check, the task that has been executed is put into a dormant state. When the task switching procedure switches the task, the task ID is stored in the data permission table. If it is registered, it has a procedure for acquiring the protection page information of the corresponding task of the data protection table, returning the attribute of the corresponding page of the page table to the protection state, and deleting the task ID of the data permission table. To do.
[0024]
In the third data protection program of the present invention, the data protection table is set in the first data protection program, the page table is created based on this information, and the attribute of each page is protected. An initial setting procedure to be set, a page protection exception handling procedure to be called if there is a write request to a protected page, and a task switching procedure for switching tasks, and the page protection exception handling procedure is executed. The ID of the task that has been acquired is acquired from the operating system, and the procedure for checking whether the protected page information of the task in the data protection table includes the page that has become the protection exception, and the page table if the page is included as a result of the check The procedure for setting the attribute of the page to be permitted and registering the identification information of the page in the data permission table and checking As a result, if the task switching procedure includes a procedure for putting a task that has been executed if the page is not included into the sleep state, and the page identification information is registered in the data permission table when the task is switched, the page A step of returning the attribute of the corresponding page of the table to the protected state and deleting the page identification of the data permission table.
[0025]
The fourth data protection program of the present invention includes a procedure for creating a page table, a procedure for setting page information on main memory owned by each task in the data protection table in units of tasks in the initial setting of the system, It has the procedure which sets an attribute to a protection state about the protection page which the said data protection table shows of a page table.
[0026]
The fifth data protection program of the present invention is an initial setting procedure for setting the data protection table in the fourth data protection program and setting the attribute of the page table to a protection state based on this information. And a page protection exception processing procedure to be called if there is a write request to a protected page, and a task switching procedure for switching tasks, wherein the page protection exception processing procedure includes the ID of the task being executed. A procedure for checking whether the protected page information of the task of the data protection table acquired from the operating system includes the page that has become the protection exception, and if the result of the check includes the page, the attribute of the page of the page table A procedure for entering a permission state and registering the executed task ID if it is not registered in the data permission table If the result of the check is that the page is not included, the task that has been executed is put in a dormant state, and when the task switching procedure switches the task, the task ID is registered in the data permission table. For example, there is a procedure for acquiring protected page information of a corresponding task of the data protection table, returning the attribute of the corresponding page of the page table to the protected state, and erasing the task ID of the data permission table.
[0027]
The sixth data protection program of the present invention is an initial setting procedure for setting the data protection table in the fourth data protection program and setting the attribute of the page table to the protection state based on this information. And a page protection exception processing procedure to be called if there is a write request to a protected page, and a task switching procedure for switching tasks, wherein the page protection exception processing procedure includes the ID of the task being executed. A procedure for checking whether the protected page information of the task in the data protection table, which is obtained from the operating system, includes the page that has become the protection exception, and if the result of the check includes the page, the attribute of the corresponding page in the page table The procedure for entering the permission state and registering the identification information of the page in the data permission table, and as a result of the check, the page If the page switching information is registered in the data permission table when the task is switched, the task switching procedure corresponds to the page table. The method includes returning the page attribute to the protected state and deleting the page identification in the data permission table.
[0028]
The first data protection method of the present invention includes an initial setting procedure for initial setting of a system, a page protection exception processing procedure that is called when there is a write request to a protected page, and a task for switching tasks. The initial setting procedure includes a procedure for setting page information on the main memory owned by the task in the data protection table for each task, and a page table in which an entry corresponding to the address is referred to when accessing the main memory. Created based on the information in the data protection table, and has a procedure for setting the attribute of each page to a protected state, and the page protection exception handling procedure obtains the ID of the task being executed from the operating system. And a procedure for checking whether the protected page information of the task in the data protection table includes the page that has become the protection exception, and a check Result If the page is included, the attribute of the page in the page table is set to the permitted state, and if the task ID that has been executed is not registered in the data permission table, the result of checking and the page must be included If the task switching procedure has a task ID registered in the data permission table when the task is switched, the protection page information of the corresponding task in the data protection table is included. Is acquired, the attribute of the corresponding page of the page table is returned to the protected state, and the task ID of the data permission table is deleted.
[0029]
The second data protection method of the present invention includes an initial setting procedure for initializing the system, a page protection exception handling procedure that is called if there is a write request to a protected page, and a task for switching tasks. The initial setting procedure includes a procedure for setting page information on the main memory owned by the task in the data protection table for each task, and a page table in which an entry corresponding to the address is referred to when accessing the main memory. Created based on the information in the data protection table, and has a procedure for setting the attribute of each page to a protected state, and the page protection exception handling procedure obtains the ID of the task being executed from the operating system. And a procedure for checking whether the protected page information of the task in the data protection table includes the page that has become the protection exception, and a check Result If the page is included, the attribute of the page in the page table is set to the permitted state, and the identification information of the page is registered in the data permission table. If the page switching information is registered in the data permission table when the task is switched, the attribute of the corresponding page in the page table is returned to the protected state, and the data switching is permitted. And a procedure for deleting the page identification of the table.
[0030]
The third data protection method of the present invention includes an initial setting procedure for initializing the system, a page protection exception handling procedure that is called when there is a write request to a protected page, and a task for switching tasks. A switching procedure, and the initial setting procedure protects the attributes of the corresponding page of the page table according to the procedure of setting the page information on the main memory owned by the task in the data protection table in units of tasks. The page protection exception processing procedure obtains the ID of the task that was being executed from the operating system, and the protected page information of the task in the data protection table becomes the protection exception. And if the page is included as a result of the check, the attribute of the page in the page table is permitted And, if the task ID being executed is not registered in the data permission table, registering it, and if it does not include the page as a result of the check, there is a procedure for putting the executed task into a dormant state, When the task switching procedure switches tasks, if the task ID is registered in the data permission table, the protected page information of the corresponding task in the data protection table is acquired, and the attribute of the corresponding page in the page table is set to the protected state. And returning and deleting a task ID in the data permission table.
[0031]
The fourth data protection method of the present invention includes an initial setting procedure for initializing the system, a page protection exception handling procedure that is called if there is a write request to a protected page, and a task for switching tasks. A switching procedure, and the initial setting procedure protects the attributes of the corresponding page of the page table according to the procedure of setting the page information on the main memory owned by the task in the data protection table in units of tasks. The page protection exception processing procedure obtains the ID of the task that was being executed from the operating system, and the protected page information of the task in the data protection table becomes the protection exception. And if the page is included as a result of the check, the attribute of the page in the page table is permitted And registering the identification information of the page in the data permission table, and if the result of the check does not include the page, the task that was executed is put into a dormant state, and the task switching procedure switches tasks. At this time, if page identification information is registered in the data permission table, the attribute of the corresponding page in the page table is returned to the protected state and the page identification in the data permission table is deleted. .
[0032]
DETAILED DESCRIPTION OF THE INVENTION
Next, embodiments of the present invention will be described in detail with reference to the drawings. First, a first embodiment of the present invention will be described.
[0033]
FIG. 1 is a block diagram showing the configuration of a data protection system according to the present invention. The data protection system includes a real-time operating system 1, a data protection table 2, a page table 3, a data permission table 4, an initial setting means 5, and page protection. The exception processing means 6 is used.
[0034]
The initial setting means 5 sets a predetermined page address and number of pages (length) of data to be protected and a task ID that owns (rewrites) the data in the data protection table 2 in units of task IDs.
[0035]
Next, the initial setting means 5 creates the page table 3 according to the specifications of the MMU (memory management unit) based on the information in the data protection table 2.
[0036]
An entry in the page table 3 corresponding to the access address is referred to by a main memory access request made by the program including the real-time operating system 1.
[0037]
The real-time operating system 1 has a task management unit 11 and a task switching unit 12, and the task switching unit 12 has a page information switching unit 121.
[0038]
The task management means 11 determines the next task to be executed in accordance with the task information being executed and the priority.
[0039]
When task switching occurs, the task switching unit 12 refers to the data permission table 4 to determine whether the task being executed by the page information switching unit 121 has accessed protected data.
[0040]
If the task ID is registered in the data permission table 4, the page information switching unit 121 regards the protected page owned by the task as being permitted during the task execution period.
[0041]
Then, the page information to be protected by the task executed in the data protection table 2 is referred to, the attribute of the corresponding entry in the page table 3 is set to the protection state (returned to the protection state) accordingly, and the information in the data permission table 4 is deleted. The task switching means 12 acquires the next task to be executed from the task management means 11 and switches to that task.
[0042]
If the task ID is not registered in the data permission table 4, it is considered that the task being executed has not accessed the protection page, the task to be executed next is acquired from the task management means 11, and the task is switched to that task.
[0043]
When a page protection exception occurs, that is, when the main memory access request made by the program refers to the entry in the page table 3 corresponding to the access address and the attribute is protected, and the request is a write, a page protection exception occurs. The protection exception processing means 6 is called.
[0044]
The page protection exception processing unit 6 obtains the task ID executed before the exception processing from the task management unit 11 and accesses the data protection table 2 using the task ID as a key. Determine whether the page is included.
[0045]
If they match, the page address attribute in which the page protection exception has occurred in the page table 3 is set to the permitted state, and information indicating that the task being executed in the data permission table 4 has permitted the protected page of its own (currently being executed) The task ID is written) and the execution of the task is continued. At this time, if the task ID being executed is already registered in the data permission table 4, no additional writing is performed. If they do not match, write error information and put the task in a dormant state.
[0046]
Each means of the initial setting means 5, the page protection exception processing means 6, and the real-time operating system 1 is realized by a program procedure in a terminal (including a mobile terminal and a mobile phone having an information processing function) and an information processing apparatus that realize the system. Is done.
[0047]
If the system uses the real-time operating system 1 and the main memory is accessed only in the real address mode, the logical address information of each entry in the page table 3 need not be provided.
[0048]
Next, the operation of the present embodiment will be described with reference to the drawings. FIG. 2 is a flowchart showing the operation of the data protection system, the data protection program, and the procedure of the data protection method.
[0049]
Referring to FIG. 2, first, the initial setting process is performed, and the first task is set to task # 1, the protected data owned by this is accessed, task # 1 is executed and switched to task # 2, etc. A case where a write request for a protected page is requested will be described.
[0050]
The initial setting means 5 registers the page address and the number of pages to be protected in the data protection table 2 for each task (step 1). Based on the information in the data protection table 2, a page table 3 is created according to the specifications of the MMU, and the attribute of each entry is set to protection (step 2).
[0051]
The task management means 11 determines the next task to be executed according to the priority (occurrence of switching to task # 1) (step 3). The task switching means 12 checks whether there is registration information in the data permission table 4, and since it is not registered at the beginning (step 4), it immediately switches to the next task (task # 1) and this is executed.
[0052]
A page protection exception occurs in task # 1 main memory access (write) (step 7).
[0053]
The task ID (# 1) executed by the page protection exception processing unit 6 is acquired from the task management unit 11, and the protected page information of ID # 1 in the data protection table 2 is acquired (step 8).
[0054]
Since it is determined whether or not the protected page information includes the page in which the exception has occurred (step 9), the attribute of the page in which the exception has occurred is permitted, and the task ID (# 1) being executed in the data permission table 4 is set. Is registered, it is registered (step 10).
[0055]
When the execution of task # 1 is completed (step 11), it is determined whether or not the system is terminated. Since there is no termination condition (step 13), switching to the next task (# 2) occurs (step 3).
[0056]
The task switching means 12 checks whether there is registration information in the data permission table 4, and since ID # 1 is registered, the task switching means 12 uses the protected page information (page address) of the task ID # 1 from the data protection table 2 as a key. The attribute information of the page address 001 (entry # 1) in the page table 3 is returned to the protected state, and the information in the data permission table 4 is deleted (step 5).
[0057]
The task switching means 12 switches to the next task (# 2), which is executed (step 6). The task # 2 is faulty and requests writing to the protected page of task # 1 and a page protection exception occurs (step 7). .
[0058]
The page protection exception processing means 6 acquires the task ID (# 2) being executed, and acquires the protected page information of ID # 2 in the data protection table 2 (step 8).
[0059]
Then, it is determined that the page in which the exception has occurred is not included (step 9), and it is assumed that a write request to the protected page of another task has been made, and the task that is currently writing error information is put into a dormant state. (Step 12).
[0060]
The error information may be serially output to the outside, stored in the memory, or displayed on the display. The memory protection hardware may be other than MMU.
[0061]
Next, a second embodiment of the present invention will be described. In this embodiment, when a program or the like is loaded into the main memory, a main storage area for the program and data is allocated by the MMU or the initial setting means 5, and the page table 3 is created according to this information.
[0062]
The initial setting means 5 sets the page address, the number of pages (length) of the data to be protected, and the task ID that owns (rewrites) the data in the data protection table 2 in units of task IDs.
[0063]
Next, the initial setting means 5 sets the attribute information of the page designated by the protected page information in the data protection table 2 among the entries in the page table 3 to the protected state. Other functions and processes are the same as those in the first embodiment.
[0064]
Next, a third embodiment of the present invention will be described. In this embodiment, when the page protection exception processing means 6 sets the attribute of the page that has become an exception of the page table 3 to the permitted state, the data permission table 4 includes not only the task ID being executed but the page identification ( A page address or page table entry number) is registered (see FIG. 3).
[0065]
When one task sequentially accesses a plurality of protected pages and the permission state is set by the page protection exception processing unit 6 each time, the page identification is sequentially added to the data permission table 4.
[0066]
Further, when the task switching means 12 switches the task, the presence / absence of registration information in the data permission table 4 is checked. If the task switching means 12 switches the task, the page attribute indicated by the data permission table 4 is set to the protected state and the page identification information in the data permission table 4 is deleted. .
[0067]
If a plurality of page identification information is registered in the data permission table 4, the above operation is repeated.
[0068]
The functions and processing procedures of other means are the same as those in the first embodiment or the second embodiment.
[0069]
【The invention's effect】
According to the present invention, page information is not rewritten except when a page protection exception occurs. Therefore, the page table rewriting time and the processing time due to page table cache misses can be reduced.
[0070]
In particular, since the page that actually received the rewrite request is processed instead of unconditionally changing the attribute to many protected pages owned by the next task in task switching, multiple tasks are processed in real time in a time-sharing manner. Even in a small-sized mobile terminal or mobile phone with a limited processing amount per time, it is possible to reduce processing time without performing extra processing related to data protection, and to maintain simultaneous processing of a plurality of tasks.
[0071]
In addition, the initial setting means of the system sets each program area and the protected page owned by it in the data protection table, expands the protected page information in the page table, sets each page attribute to the protected state, and sets the write access. Since only the user's own page is temporarily permitted, a data protection function can be added without modifying the currently used program.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a data protection system of the present invention.
FIG. 2 is a flowchart showing the operation of the data protection system of the present invention, the data protection program, and the procedure of the data protection method.
FIG. 3 is a block diagram showing the contents of a data permission table 4 according to the third embodiment of this invention.
[Explanation of symbols]
1 Real-time operating system
11 Task management means
12 Task switching means
121 Page information switching means
2 Data protection table
3 Page table
4 Data permission table
5 Initial setting means
6 Page protection exception handling means

Claims (12)

一つのメモリ空間を複数のタスクで共有するオペレーティングシステム利用のシステムにおいて、タスクが所有する主記憶上のページのページアドレスがタスク単位で設定されたデータ保護テーブルと
前記データ保護テーブルに設定されたページアドレスに対応するページテーブルのエントリ内に設定されるページの属性を保護状態に設定する初期設定手段を有することを特徴とするデータ保護システム。
One memory space Te system smell of the operating system use to be shared by multiple tasks, the data protection tables that page addresses in the main storage that task owned is set in task units,
A data protection system comprising initial setting means for setting a page attribute set in an entry of a page table corresponding to a page address set in the data protection table to a protected state.
前記保護状態のページへの書込要求があれば呼び出されて、実行していたタスクのIDを前記オペレーティングシステムより取得し、前記データ保護テーブルの当該タスクの前記ページアドレスが前記保護例外となったページを含むかをチェックし、前記チェックの結果、前記保護例外となったページを含まなければ実行していたタスクを休止状態にするページ保護例外処理手段を有することを特徴とする請求項1記載のデータ保護システム。 Is called if there is a write request to a page of the protection state, the ID of the task that was running acquired from the operating system, the page address of the task of the data protection table becomes the protection exception checks containing pages, the check result, claim 1, characterized in that to have a page protection exception processing means for the task that was running not including pages became the protection exception dormant The data protection system described. 前記チェックの結果前記保護例外となったページを含めばページテーブルの該当ページの属性を許可状態にし、前記実行していたタスクのタスクIDをデータ許可テーブルに登録する前記ページ保護例外処理手段と、The page protection exception processing means for setting the attribute of the corresponding page of the page table to the permitted state if the page that has become the protection exception as a result of the check is included, and registering the task ID of the task that has been executed in the data permission table;
タスクを切り替える際に、前記データ許可テーブルにタスクIDが登録されていればデータ保護テーブルの当該タスク対応のページアドレスを取得し、取得した当該ページアドレスに対応するページテーブルのエントリ内に設定されるページの属性を保護状態に戻し、前記データ許可テーブルのタスクIDを消去するタスク切替手段を有することを特徴とする請求項2記載のデータ保護システム。When switching tasks, if a task ID is registered in the data permission table, the page address corresponding to the task in the data protection table is acquired and set in the entry of the page table corresponding to the acquired page address. 3. The data protection system according to claim 2, further comprising task switching means for returning a page attribute to a protected state and deleting a task ID in the data permission table.
前記チェックの結果前記保護例外となったページを含めばページテーブルの当該ページの属性を許可状態にし、そのページの識別情報をデータ許可テーブルに登録する前記ページ保護例外処理手段と、
タスクを切り替える際に、データ許可テーブルにページ識別情報が登録されていれば、当該ページ識別情報に対応するページテーブルのエントリ内に設定される属性を保護状態に戻し、前記データ許可テーブルの前記ページ識別情報を消去する前記ページ保護例外処理手段を有することを特徴とする請求項記載のデータ保護システム。
The page protection exception processing means for setting the attribute of the page of the page table to a permitted state if the page that has become the protection exception as a result of the check is included, and registering the identification information of the page in the data permission table;
When switching a task, if the page identification information to the data permission table is registered, return the attributes set in the entry of the page table corresponding to the page identification information to the protection state, the said data permission table pages 3. The data protection system according to claim 2, further comprising page protection exception processing means for erasing identification information.
一つのメモリ空間を複数のタスクで共有するオペレーティングシステム利用のコンピュータに、タスクが所有する主記憶上のページのページアドレスをタスク単位でデータ保護テーブルに設定させ、設定されたページアドレスに対応するページテーブルのエントリ内に設定されるページの属性を保護状態に設定させる初期設定処理を実行させることを特徴とするデータ保護プログラム。The page corresponding to the set page address is set by letting a computer using an operating system that shares one memory space for multiple tasks set the page address of the main memory page owned by the task in the data protection table for each task. A data protection program for executing an initial setting process for setting a page attribute set in an entry of a table to a protected state. 前記コンピュータに、前記保護状態のページへの書込要求があれば呼び出されて、実行していたタスクのIDを前記オペレーティングシステムより取得させ、前記データ保護テーブルの当該タスクの前記ページアドレスが前記保護例外となったページを含むかをチェックさせ、前記チェックの結果、前記保護例外となったページを含まなければ実行していたタスクを休止状態にさせるページ保護例外処理処理を実行させることを特徴とする請求項5記載のデータ保護プログラム。The computer is called if there is a write request to the protected page, and the ID of the task that was being executed is acquired from the operating system, and the page address of the task in the data protection table is the protection A page protection exception processing process is executed to check whether an exception page is included and, if the result of the check does not include the protection exception page, a task that has been executed is put into a dormant state. The data protection program according to claim 5. 前記コンピュータに、前記チェックの結果前記保護例外となったページを含めばページテーブルの該当ページの属性を許可状態にさせ、前記実行していたタスクのタスクIDをデータ許可テーブルに登録させる前記ページ保護例外処理処理と、The page protection that causes the computer to set the attribute of the corresponding page of the page table to the permitted state and register the task ID of the task that has been executed in the data permission table if the page that includes the protection exception as a result of the check is included Exception handling,
タスクを切り替える際に、前記データ許可テーブルにタスクIDが登録されていればデータ保護テーブルの当該タスク対応のページアドレスを取得させ、取得した当該ページアドレスに対応するページテーブルのエントリ内に設定されるページの属性を保護状態に戻させ、前記データ許可テーブルのタスクIDを消去させるタスク切替処理を実行させることを特徴とする請求項6記載のデータ保護プログラム。When a task is switched, if a task ID is registered in the data permission table, the page address corresponding to the task in the data protection table is acquired and set in the entry of the page table corresponding to the acquired page address. 7. The data protection program according to claim 6, wherein a task switching process is executed to return the page attribute to the protected state and erase the task ID of the data permission table.
前記コンピュータに、前記チェックの結果前記保護例外となったページを含めばページテーブルの当該ページの属性を許可状態にさせ、そのページの識別情報をデータ許可テーブルに登録させる前記ページ保護例外処理処理と、The page protection exception processing process for causing the computer to set the attribute of the page of the page table to a permitted state and register the identification information of the page in the data permission table if the page including the protection exception as a result of the check is included in the computer. ,
タスクを切り替える際に、データ許可テーブルにページ識別情報が登録されていれば、当該ページ識別情報に対応するページテーブルのエントリ内に設定される属性を保護状態に戻させ、前記データ許可テーブルの前記ページ識別情報を消去させる前記ページ保護例外処理処理を実行させることを特徴とする請求項6記載のデータ保護プログラム。When switching the task, if the page identification information is registered in the data permission table, the attribute set in the entry of the page table corresponding to the page identification information is returned to the protected state, and the data permission table 7. The data protection program according to claim 6, wherein said page protection exception processing process for erasing page identification information is executed.
一つのメモリ空間を複数のタスクで共有するオペレーティングシステム利用のコンピュータが、タスクが所有する主記憶上のページのページアドレスをタスク単位でデータ保護テーブルに設定し、設定されたページアドレスに対応するページテーブルのエントリ内に設定されるページの属性を保護状態に設定する初期設定工程を有することを特徴とするデータ保護方法。A computer using an operating system that shares one memory space with multiple tasks sets the page address of the main memory page owned by the task in the data protection table for each task, and the page corresponding to the set page address A data protection method comprising an initial setting step of setting a page attribute set in an entry of a table to a protected state. 前記コンピュータが、前記保護状態のページへの書込要求があれば呼び出されて、実行していたタスクのIDを前記オペレーティングシステムより取得し、前記データ保護テーブルの当該タスクの前記ページアドレスが前記保護例外となったページを含むかをチェックし、前記チェックの結果、前記保護例外となったページを含まなければ実行していたタスクを休止状態にするページ保護例外工程工程を有することを特徴とする請求項9記載のデータ保護方法。The computer is called if there is a write request to the protected page, obtains the ID of the task being executed from the operating system, and the page address of the task in the data protection table is the protection A page protection exception process step of checking whether or not an exception page is included and, if the result of the check does not include the protection exception page, putting a task that has been executed into a dormant state; The data protection method according to claim 9. 前記コンピュータが、前記チェックの結果前記保護例外となったページを含めばページテーブルの該当ページの属性を許可状態にし、前記実行していたタスクのタスクIDをデータ許可テーブルに登録する前記ページ保護例外工程工程と、If the computer includes a page that has become the protection exception as a result of the check, the attribute of the corresponding page of the page table is set to a permitted state, and the task ID of the task that has been executed is registered in the data permission table. Process steps,
タスクを切り替える際に、前記データ許可テーブルにタスクIDが登録されていればデータ保護テーブルの当該タスク対応のページアドレスを取得し、取得した当該ページアドレスに対応するページテーブルのエントリ内に設定されるページの属性を保護状態に戻し、前記データ許可テーブルのタスクIDを消去するタスク切替工程を有することを特徴とする請求項10記載のデータ保護方法。When switching tasks, if the task ID is registered in the data permission table, the page address corresponding to the task in the data protection table is acquired and set in the entry of the page table corresponding to the acquired page address. 11. The data protection method according to claim 10, further comprising a task switching step of returning a page attribute to a protected state and deleting a task ID of the data permission table.
前記コンピュータが、前記チェックの結果前記保護例外となったページを含めばページテーブルの当該ページの属性を許可状態にし、そのページの識別情報をデータ許可テーブルに登録する前記ページ保護例外工程工程と、If the computer includes a page that has become the protection exception as a result of the check, the page protection exception process step of setting the attribute of the page of the page table to a permitted state and registering the identification information of the page in the data permission table;
タスクを切り替える際に、データ許可テーブルにページ識別情報が登録されていれば、当該ページ識別情報に対応するページテーブルのエントリ内に設定される属性を保護状態に戻し、前記データ許可テーブルの前記ページ識別情報を消去する前記ページ保護例外工程工程を有することを特徴とする請求項10記載のデータ保護方法。When switching the task, if the page identification information is registered in the data permission table, the attribute set in the entry of the page table corresponding to the page identification information is returned to the protected state, and the page of the data permission table 11. The data protection method according to claim 10, further comprising the page protection exception process step of deleting identification information.
JP2002322604A 2002-11-06 2002-11-06 Data protection system, data protection program, and data protection method Expired - Fee Related JP4423849B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002322604A JP4423849B2 (en) 2002-11-06 2002-11-06 Data protection system, data protection program, and data protection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002322604A JP4423849B2 (en) 2002-11-06 2002-11-06 Data protection system, data protection program, and data protection method

Publications (2)

Publication Number Publication Date
JP2004157751A JP2004157751A (en) 2004-06-03
JP4423849B2 true JP4423849B2 (en) 2010-03-03

Family

ID=32802745

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002322604A Expired - Fee Related JP4423849B2 (en) 2002-11-06 2002-11-06 Data protection system, data protection program, and data protection method

Country Status (1)

Country Link
JP (1) JP4423849B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7552436B2 (en) 2003-11-25 2009-06-23 International Business Machines Memory mapped input/output virtualization
US11762566B2 (en) 2018-01-22 2023-09-19 Arm Limited Programmable mapping of guard tag storage locations
GB2570326B (en) * 2018-01-22 2020-06-10 Advanced Risc Mach Ltd Multiple guard tag setting instruction

Also Published As

Publication number Publication date
JP2004157751A (en) 2004-06-03

Similar Documents

Publication Publication Date Title
US8453015B2 (en) Memory allocation for crash dump
US9910602B2 (en) Device and memory system for storing and recovering page table data upon power loss
US20070016719A1 (en) Memory device including nonvolatile memory and memory controller
US9218302B2 (en) Page table management
JP4519738B2 (en) Memory access control device
US20040064635A1 (en) Method of storing data in a non-volatile memory and apparatus therefor
US20040085849A1 (en) Flash memory, and flash memory access method and apparatus
JP5071798B2 (en) Computer system, memory management method, and program thereof
US20050044292A1 (en) Method and apparatus to retain system control when a buffer overflow attack occurs
JP2013037718A (en) Managing memory pages
CN109783145B (en) Method for creating multi-image-based multifunctional embedded system
CN112925606B (en) A memory management method, device and equipment
JP4423849B2 (en) Data protection system, data protection program, and data protection method
EP4121862B1 (en) Memory accessor invalidation
US20050138263A1 (en) Method and apparatus to retain system control when a buffer overflow attack occurs
JP2003256269A (en) Method of controlling nonvolatile storage device and memory device
US6658548B1 (en) System and method in a data processing system for extracting data from a protected region of memory
US20050027954A1 (en) Method and apparatus to support the maintenance and reduction of FLASH utilization as it pertains to unused or infrequently referenced FLASH data
WO2008083187A2 (en) Dynamically updateable and moveable memory zones
JP3674446B2 (en) Individual application patch management apparatus and individual application patch management method
JPH11134204A (en) Stack protection device
US20080072009A1 (en) Apparatus and method for handling interrupt disabled section and page pinning apparatus and method
JP2013109404A (en) Information processing device
CN110442558A (en) Data processing method, sliced service device, storage medium and device
JPH0784886A (en) Cache memory control method and cache memory control device

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20050309

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051017

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20070118

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20080610

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090130

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090210

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090325

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20090508

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20091117

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20091130

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20121218

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20121218

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20131218

Year of fee payment: 4

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees