JPH02282832A - Memory protection system for task - Google Patents

Memory protection system for task

Info

Publication number
JPH02282832A
JPH02282832A JP10529389A JP10529389A JPH02282832A JP H02282832 A JPH02282832 A JP H02282832A JP 10529389 A JP10529389 A JP 10529389A JP 10529389 A JP10529389 A JP 10529389A JP H02282832 A JPH02282832 A JP H02282832A
Authority
JP
Japan
Prior art keywords
memory protection
task
memory
protection data
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP10529389A
Other languages
Japanese (ja)
Inventor
Shigeyuki Hiwatari
樋渡 林志
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP10529389A priority Critical patent/JPH02282832A/en
Publication of JPH02282832A publication Critical patent/JPH02282832A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To improve the processing efficiency of a memory protection system for tasks by producing the memory protection data only when a task is executed at first, storing this produced data into a load module for tasks and then reading out the protection data to use it when the control is shifted to a current task. CONSTITUTION:A memory protection data saving area 2 is provided in a load module 10 at every task. Then the memory protection data is produced and a set initial routine is carried out only when the control is shifted to a due task at first. The memory protection data is taken out of the area 2 when the control is shifted to a current task. Then the protection data is set to a memory protection register which is controlled by an operation system. Thus it is not required to produce the memory protection data nor to set it to the memory protection register at every execution of a task. Consequently, the overhead can be eliminated for such processes where the memory protection data is produced and set to the memory protection register, and the overall system processing efficiency is improved.

Description

【発明の詳細な説明】 [発明の目的] (産業上の利用分野) 本発明はタスクのメモリ保護方式に関する。[Detailed description of the invention] [Purpose of the invention] (Industrial application field) The present invention relates to a memory protection scheme for tasks.

(従来の技術) コンピュータは一般にオペレーティングシステム(O8
)若しくは、モニタの管理下で各種タスクを実行するが
、このうち、単一タスクしか制御しないものをシングル
タスキング機能、そして、複数のタスクを交互に実行す
ることのできるものをマルチタスキング機能と云う。
(Prior Art) Computers generally have an operating system (O8
) or execute various tasks under the control of the monitor, among which the single-tasking function is used to control only a single task, and the multi-tasking function is used to execute multiple tasks alternately. That's what I say.

ところで、従来のマルチタスキング機能を有するオペレ
ーティングシステムにおけるタスク管理において、実行
中のタスクから別タスクに実行を切替える操作に要する
時間をオーバヘッドと云い、シングル・タスク・モニタ
に比べて純粋にタスクの実行を遅らせるロスタイムとな
るので、般にはこの時間が短い方が性能が良いとされる
By the way, in task management in conventional operating systems with multitasking functions, the time required to switch execution from one task to another is called overhead, and compared to a single task monitor, the time required to switch execution from one task to another is called overhead. Generally, the shorter this time, the better the performance.

従来のマルチタスキング機能を有する小規模オベレーテ
ィングシステムにおいては、そのタスク管理は、タスク
に制御を移す前に毎回、そのタスク自身で書込み可能な
領域を調査させ、これをメモリ保護データとしてメモリ
保護レジスタに設定させるようにし、このメモリ保護レ
ジスタに設定したメモリ保護データの範囲をそのタスク
の実施に使用可能な各種ワーキングエリア等として利用
できるように管理しつつタスクを実行させるようにして
いた。
In a conventional small-scale operating system with a multitasking function, each time before transferring control to a task, the task checks its own writable area, and stores this data as memory protection data. A task is executed while managing the range of memory protection data set in the memory protection register so that it can be used as various working areas etc. that can be used to execute the task.

このため、別のタスクに制御を移す際にはこのような書
込み可能な領域の調査、メモリ保護データの生成、メモ
リ保護レジスタへの設定と云った一連の処理を行う分、
オーバヘッドが大きくなり、全体的なシステムの処理効
率が低下していた。
Therefore, when transferring control to another task, a series of processes such as checking the writable area, generating memory protection data, and setting the memory protection register are necessary.
The overhead was large and the overall system processing efficiency was reduced.

鍵θ目 (0JIF#が解決しようとする課題)上述の始<、マ
ルチタスキング機能を有する小規模オペレーティングシ
ステムのタスク管理においては別のタスクに制御を移す
前に毎回、そのタスク自身で書込み可能な領域を調べ、
メモリ保護データとしてメモリ保護レジスタに設定して
いた。このため、別のタスクに制御を移す際にはこのよ
うな書込み可能な領域の調査、メモリ保護データを生成
、メモリ保護レジスタへの設定と云った一連の処理を行
う分、オーバヘッドが大きくなり、全体的なシステムの
処理効率が低下すると云う問題があった。
Key θth (Problem that 0JIF# tries to solve) As mentioned above, in task management of a small operating system with multitasking function, a task can write by itself each time before transferring control to another task. Investigate the area,
It was set in the memory protection register as memory protection data. Therefore, when transferring control to another task, a series of processes such as checking the writable area, generating memory protection data, and setting the memory protection register are performed, resulting in a large overhead. There was a problem in that the processing efficiency of the overall system was reduced.

そこで、この発明の目的とするところは、メモリ保護デ
ータは各タスクについて、そのタスクに最初に制御を移
す時にのみ生成し、タスク実行の都度、生成せずとも良
いようにすることによってその生成処理性のオーバヘッ
ドを取除くようにし、これによる全体的なシステムの処
理効率向上を図ったタスクのメモリ保護制御方式を提供
することにある。
Therefore, the purpose of this invention is to generate memory protection data for each task only when control is transferred to that task for the first time, so that it is not necessary to generate it each time a task is executed, so that the generation process The object of the present invention is to provide a task memory protection control method that removes the processing overhead and thereby improves the processing efficiency of the overall system.

[発明の構成コ (課題を解決するための手段) 上記目的を達成するため、本発明は次のように構成する
。すなわち、複数のタスクを交互に実行するマルチタス
キング機能を有するオペレーティングシステムにおいて
、 各タスク毎のロードモジュール内にメモリ保護データセ
ーブエリアを設け、各タスクには最初に制御を移す時に
自身で書込み可能なメモリ領域を調べ、これに基づく使
用可能なメモリ領域情報を生成し、前記メモリ保護デー
タセーブエリアにセットさせるとともにオペレーティン
グシステムの管理するメモリ保護レジスタに設定させる
ようにし、オペレーティングシステムにはこのメモリ保
護レジスタの設定情報を用いて実行タスクの使用メモリ
領域を管理させ、以後、カレントのタスクに制御を移す
ときはメモリ保護データセーブエリアよりメモリ保護デ
ータを取出し、メモリ保護レジスタに設定して管理に使
用するようにする。
[Configuration of the Invention (Means for Solving the Problem) In order to achieve the above object, the present invention is configured as follows. In other words, in an operating system that has a multitasking function that executes multiple tasks alternately, a memory-protected data save area is provided in the load module for each task, and each task can be written to by itself when control is transferred for the first time. The available memory area information is generated based on the available memory area information, and the information is set in the memory protection data save area and in the memory protection register managed by the operating system. The memory area used by the execution task is managed using register setting information, and from then on, when transferring control to the current task, the memory protection data is retrieved from the memory protection data save area, set in the memory protection register, and used for management. I'll do what I do.

(作 用) 本発明では各タスク毎のロードモジュール内に設けられ
たメモリ保護データセーブエリアにタスクに最初に制御
を移す時はそのタスク自身で書込み可能なメモリ領域を
調べ、メモリ保護データを生成し、それをセーブすると
ともにメモリ保護レジスタに設定する。その後、カレン
トのタスクに制御を移すときはメモリ保護データセーブ
エリアよりメモリ保護データを取出し、メモリ保護レジ
スタに設定する。これによって別のタスクに制御を移す
たびに毎回実施していたメモリ保護データを生成する処
理骨のオーバヘッドを取除く。
(Function) In the present invention, when control is first transferred to a task in the memory protection data save area provided in the load module for each task, the memory area that can be written by the task itself is checked and memory protection data is generated. and save it and set it in the memory protection register. Thereafter, when transferring control to the current task, the memory protection data is retrieved from the memory protection data save area and set in the memory protection register. This eliminates the processing overhead of generating memory protection data every time control is transferred to another task.

このように、各タスク毎のロードモジュール内にメモリ
保護データセーブエリアを設け、当該タスクに最初に制
御を移す時のみ、メモリ保護データの生成、設定の初期
ルーチンを実施し、その後、カレントのタスクに制御を
移すときはメモリ保護データセーブエリアよりメモリ保
護データを取出し、オペレーションシステムの管理する
メモリ保護レジスタに設定することによってタスクの実
行毎に毎回、メモリ保護データを生成、メモリ保護レジ
スタへの設定と云った処理をしなくとも良いようにした
ので、これにより他のタスクに制御を移す際のオーバヘ
ッドを取除くことができるよになって、全体的なシステ
ムの処理効率を向上させることができる。
In this way, a memory protection data save area is provided in the load module for each task, and the initial routine for generating and setting memory protection data is executed only when control is transferred to the task for the first time. When transferring control to the memory protection data save area, the memory protection data is retrieved from the memory protection data save area and set in the memory protection register managed by the operating system.Memory protection data is generated every time a task is executed, and the memory protection data is set in the memory protection register. Since this process is no longer necessary, the overhead of transferring control to other tasks can be removed, and the overall system processing efficiency can be improved. .

(実施例) 次に本発明の一実施例について図面を参照して説明する
。第1図は本発明を適用したタスクのロードモジュール
IOのフォーマットである。図に示すように、各タスク
のロードモジュールは少なくともプログラムの先頭ブロ
ックへの分岐命令エリア1と、メモリ保護データセーブ
エリア2と、プログラムロジック部3よりなる。各タス
クには自タスクを最初に実行する際にのみ、実行するル
ーチンとして、そのタスク自身で書込み可能なメモリ領
域を調べるルーチン、この調べた結果からメモリ保護デ
ータを生成するルーチン、この生成したメモリ保護デー
タをメモリ保護データセーブエリア2にセットするとと
もにオペレーションシステムの管理するメモリ保護レジ
スタにメモリ保護データをセットするルーチンを持たせ
、この−連のルーチンを初期時にのみ実施させるように
設定する。また、タスクの実行を管理するオペレーショ
ンシステムにはあるタスクに制御を移すにあたり、その
タスクを初めて実行させる場合以外は上記初期時の実行
ルーチンを実施させず、当該タスクのメモリ保護データ
セーブエリア2内に格納されているメモリ保護データを
読出し、オペレーションシステムの管理するメモリ保護
レジスタにセットした後、プログラムのロジック部3に
分岐させて当該タスクを実行させるようにしである。
(Example) Next, an example of the present invention will be described with reference to the drawings. FIG. 1 shows the format of a task load module IO to which the present invention is applied. As shown in the figure, the load module of each task consists of at least a branch instruction area 1 to the first block of the program, a memory protection data save area 2, and a program logic section 3. Each task has a routine that is executed only when it executes for the first time: a routine that checks the writable memory area by itself, a routine that generates memory protection data from the results of this check, and a routine that generates memory A routine is provided to set the protected data in the memory protected data save area 2 and set the memory protected data in the memory protected register managed by the operating system, and this series of routines is set to be executed only at the initial stage. In addition, when the operation system that manages the execution of a task transfers control to a certain task, it does not execute the above initial execution routine unless the task is to be executed for the first time, and stores the memory protection data save area 2 of the task. After reading the memory protection data stored in the memory protection register and setting it in the memory protection register managed by the operating system, the program branches to the logic section 3 to execute the task.

このような本方式ではオペレーションシステムは各タス
クを順次交互に実行するが、各タスクについて最初の実
行時にのみ、初期ルーチンを実行させ、次回からの実行
時にはそのタスクのメモリ保護データセーブエリア2に
セットしであるメモリ保護データを読出してオペレーシ
ョンシステムの管理するメモリ保護レジスタにセットし
た後、そのタスクのプログラムロジック部3に分岐させ
て当該タスクを実行させる。すなわち、オペレーション
システムは各タスクについて最初の実行時にのみ、その
タスクの初期ルーチンを実行させ、そのタスク自身で書
込み可能なメモリ領域を調べ、メモリ保護データを生成
し、それをタスク毎のロードモジュールIO内に設けら
れたメモリ保護データセーブエリア1にセットするとと
もにオペレーションシステムのメモリ保護レジスタに設
定する。
In this method, the operating system executes each task sequentially and alternately, but the initial routine is executed only for the first execution of each task, and is set in the memory protected data save area 2 of that task from the next execution. After reading out the memory protection data and setting it in the memory protection register managed by the operating system, the program logic section 3 of the task is branched to execute the task. That is, the operating system executes the initial routine of each task only at the first execution, checks the writable memory area by the task itself, generates memory protection data, and transfers it to the load module IO for each task. The data is set in the memory protection data save area 1 provided in the memory protection data save area 1, and is also set in the memory protection register of the operating system.

そして、メモリ保護レジスタ内のメモリ保護データを参
照してこのデータの示すアドレス範囲内をワーキングエ
リアとして使用しつつ、当該タスクを実行する。そして
、他のタスクに制御を移して後、次回からの実行時には
そのタスクのメモリ保護データセーブエリア2にセット
しであるメモリ保護データを読出してオペレーションシ
ステムの管理するメモリ保護レジスタにセットすること
により、初期ルーチンに替え、そのタスクの実行に移る
Then, the task is executed while referring to the memory protection data in the memory protection register and using the address range indicated by this data as a working area. Then, after transferring control to another task, the next time it is executed, the memory protection data set in the memory protection data save area 2 of that task is read out and set in the memory protection register managed by the operating system. , it switches to the initial routine and moves on to executing that task.

このように、各タスク毎のロードモジュールIO内にメ
モリ保護データセーブエリア1を設け、当該タスクに最
初に制御を移す時のみ、メモリ保護データの生成、設定
の初期ルーチンを実施し、その後、カレントのタスクに
制御を移すときはメモリ保護データセーブエリア1より
メモリ保護データを取出し、オペレーションシステムの
管理するメモリ保護レジスタに設定することによってタ
スクの実行毎に毎回、メモリ保護データを生成、メモリ
保護レジスタへの設定と云った処理をしなくとも良いよ
うにしたものである。そして、これによりメモリ保護デ
ータを生成、メモリ保護レジスタへの設定と云った処理
性のオーバヘッドを取除くことができることにより、全
体的なシステムの処理効率を向上させることができる。
In this way, memory protection data save area 1 is provided in the load module IO for each task, and only when control is transferred to the task for the first time, the initial routine for generating and setting memory protection data is executed, and then the current When transferring control to a task, the memory protection data is extracted from the memory protection data save area 1 and set in the memory protection register managed by the operating system, so that the memory protection data is generated every time the task is executed. This eliminates the need for settings such as settings. This makes it possible to eliminate the processing overhead of generating memory protection data and setting it in the memory protection register, thereby improving the processing efficiency of the overall system.

尚、本発明は上記しかつ、図面に示す実施例に限定する
ことなくその要旨を変更しない範囲内で適宜変形して実
施し得るものである。
It should be noted that the present invention is not limited to the embodiments described above and shown in the drawings, and can be implemented with appropriate modifications within the scope of the gist thereof.

[発明の効果] 以上、説明したように、本方式によればマルチタスキン
グにおいて、タスクを最初に実行させた際にのみメモリ
保護データの生成を行い、これを当該タスクのロードモ
ジュール内に保存し、カレントとなったタスクに制御を
移す時には前記保存したメモリ保護データを読出して利
用するようにしたことにより、毎回毎回、メモリ保護デ
ータを生成する必要を無くし、メモリ保護データ生成処
理性のオーバヘッドを取除くことにより、全体的なシス
テムの処理効率を高くすることができるようにしたタス
クのメモリ保護方式を提供できる。
[Effects of the Invention] As explained above, according to this method, in multitasking, memory protection data is generated only when a task is executed for the first time, and this data is saved in the load module of the task. However, by reading and using the saved memory protection data when transferring control to the current task, it is no longer necessary to generate memory protection data each time, and the processing overhead of generating memory protection data is reduced. By removing this, it is possible to provide a task memory protection scheme that can increase the overall system processing efficiency.

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

第1図は本発明の一実施例を示すメモリマツプである。 l・・・プログラムの分岐命令エリア、2・・・メモリ
保護データセーブエリア、3・・・プログラムロジック
部、10・・・タスクのロードモジュール。
FIG. 1 is a memory map showing one embodiment of the present invention. 1... Program branch instruction area, 2... Memory protection data save area, 3... Program logic section, 10... Task load module.

Claims (1)

【特許請求の範囲】 複数のタスクを交互に実行するマルチタスキング機能を
有するオペレーティングシステムにおいて、 各タスク毎のロードモジュール内にメモリ保護データセ
ーブエリアを設け、各タスクには最初に制御を移す時に
自身で書込み可能なメモリ領域を調べ、これに基づく使
用可能なメモリ領域情報を生成し、前記メモリ保護デー
タセーブエリアにセットさせるとともにオペレーティン
グシステムの管理するメモリ保護レジスタに設定させる
ようにし、オペレーティングシステムにはこのメモリ保
護レジスタの設定情報を用いて実行タスクの使用メモリ
領域を管理させ、以後、カレントのタスクに制御を移す
ときはメモリ保護データセーブエリアよりメモリ保護デ
ータを取出し、メモリ保護レジスタに設定して管理に使
用することを特徴とするタスクのメモリ保護方式。
[Claims] In an operating system having a multitasking function that alternately executes multiple tasks, a memory-protected data save area is provided in the load module for each task, and each task has a Checks the memory area that can be written by itself, generates usable memory area information based on the information, sets it in the memory protection data save area, and also sets it in the memory protection register managed by the operating system. uses the setting information of this memory protection register to manage the memory area used by the execution task, and from then on, when transferring control to the current task, the memory protection data is retrieved from the memory protection data save area and set in the memory protection register. A task memory protection method characterized by being used for task management.
JP10529389A 1989-04-25 1989-04-25 Memory protection system for task Pending JPH02282832A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10529389A JPH02282832A (en) 1989-04-25 1989-04-25 Memory protection system for task

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10529389A JPH02282832A (en) 1989-04-25 1989-04-25 Memory protection system for task

Publications (1)

Publication Number Publication Date
JPH02282832A true JPH02282832A (en) 1990-11-20

Family

ID=14403642

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10529389A Pending JPH02282832A (en) 1989-04-25 1989-04-25 Memory protection system for task

Country Status (1)

Country Link
JP (1) JPH02282832A (en)

Similar Documents

Publication Publication Date Title
US4851992A (en) Register/saving/restoring system for saving and restoring data in a register of a slave processor
EP0373790A2 (en) Data processing apparatus for saving and restoring
JPH02282832A (en) Memory protection system for task
JPS6314241A (en) Memory expansion system
JPS62168497A (en) Data base processing system for exchange-processing program
JPS6269321A (en) Process switching system
JPH0363822A (en) Computer control system
JP2695930B2 (en) Intelligent I / O module
JP2590872B2 (en) Task scheduling method
JPH0221610B2 (en)
Rappaport Implementing multi-process primitives in a multiplexed computer system
JPH0465717A (en) Method for accessing program
JP2002259209A (en) Arithmetic processing system
JPS62109135A (en) Program producing method
JPS6155752A (en) Control of expanded memory device
JPH11316691A (en) Execution method for operating system and information processor using the method
JPH0325645A (en) Swapping system for virtual space
JPS63155338A (en) Control system for record of program executing history
JPH10289113A (en) Register context storage and restoration system for computer
JPH07107666B2 (en) Computer system
JPS62140145A (en) Virtual computer system
JPH0782443B2 (en) Task management method for operating system
JPH0218687A (en) Pipe line processor control system
JPS62145327A (en) Merging system for common subroutine
JPH0283623A (en) Microprocessor