JP2007310834A - Data protection method, information processor and operating system - Google Patents

Data protection method, information processor and operating system Download PDF

Info

Publication number
JP2007310834A
JP2007310834A JP2006141992A JP2006141992A JP2007310834A JP 2007310834 A JP2007310834 A JP 2007310834A JP 2006141992 A JP2006141992 A JP 2006141992A JP 2006141992 A JP2006141992 A JP 2006141992A JP 2007310834 A JP2007310834 A JP 2007310834A
Authority
JP
Japan
Prior art keywords
task
area
information
write
memory
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
JP2006141992A
Other languages
Japanese (ja)
Inventor
Takanori Tawara
孝宣 田原
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2006141992A priority Critical patent/JP2007310834A/en
Publication of JP2007310834A publication Critical patent/JP2007310834A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To protect data to be stored in a memory even though a plurality of tasks sharing the memory do not perform control for protecting the data. <P>SOLUTION: An OS associates specific information of each storage area obtained by logically partitioning the memory with writing acceptance/rejection information to be referred to by a CPU in order to determine the acceptance/rejection to write data into each storage area during writing the data in each storage area, the OS associates identification information of each task with specific information of a writable area configured by including one or more storage areas allocated to each task as a write destination during executing each task, and the OS updates the writing acceptance/rejection information of each storage area constituting a first writable area allocated to a first task to information showing write rejection and the writing acceptance/rejection information of each storage area constituting a second writable area allocated to a second task to information showing writing acceptance during switching the first task to the second task. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、複数のタスクが実行される情報処理装置においてメモリに記憶されるデータを保護する方法、情報処理装置及びオペレーティングシステムに関する。   The present invention relates to a method for protecting data stored in a memory in an information processing apparatus that executes a plurality of tasks, an information processing apparatus, and an operating system.

複数のタスクを実行する情報処理装置において、メモリに記憶されるデータを保護するための技術として、実メモリに対して保護キーを割り当てる技術が開発されている(例えば特許文献1参照)。   In an information processing apparatus that executes a plurality of tasks, a technique for assigning a protection key to a real memory has been developed as a technique for protecting data stored in a memory (see, for example, Patent Document 1).

また仮想記憶システムにおいて、仮想アドレスから実アドレスへアドレス変換を行う時に参照されるページテーブル内に、主記憶装置のアクセスのための制御情報を付加してアドレス変換時に判定する技術も開発されている。この技術によれば、保護キーが一致していても書込み禁止にすることができる。
特開昭62−100851号公報
In a virtual storage system, a technique has been developed in which control information for accessing the main storage device is added to a page table that is referred to when address conversion from a virtual address to a real address is performed, and determination is performed at the time of address conversion. . According to this technique, even if the protection keys match, writing can be prohibited.
JP-A-62-100851

ところで、仮想アドレスから実アドレスへの変換を行うアドレス変換機構によって実現される仮想記憶システムにおける仮想領域は、その使用目的により、システム領域、空間固有領域、ジョブ固有領域、プログラム固有領域、システム共通領域、空間間共通作業領域などに分類される。   By the way, a virtual area in a virtual storage system realized by an address conversion mechanism that performs conversion from a virtual address to a real address depends on the purpose of use, a system area, a space specific area, a job specific area, a program specific area, and a system common area. It is classified into a common work area between spaces.

従来の技術は、システム共通領域や空間間共通作業領域においては、アドレス空間の異なる複数のタスクが他のタスクが確保した領域に書込みを行うことを目的としていることから、書込み禁止にするよりも、保護キーの設定で書込み保護を行う場合が多い。   In the conventional technology, in the system common area and inter-space common work area, multiple tasks with different address spaces are intended to write to areas reserved by other tasks. In many cases, write protection is performed by setting a protection key.

保護キーのみで書込み保護を行った場合には、複数のタスクが無規則に確保した領域に対して、タスクに割り当てられた実行キーと同一保護キーの領域に対して保護キーが有効にならず、他タスクが確保した同一保護キーの領域に不当に書込むことが可能である。さらに、保護キーでの書込み保護の場合、不特定多数の同一保護キーのタスクが存在することになり、領域破壊が発生した場合の原因特定に時間を要する場合もある。   When write protection is performed using only the protection key, the protection key is not valid for the area of the same protection key as the execution key assigned to the task for the area that is randomly allocated by multiple tasks. It is possible to write illegally in the same protection key area secured by another task. Furthermore, in the case of write protection with a protection key, there are many unspecified tasks with the same protection key, and it may take time to specify the cause when an area destruction occurs.

またページテーブルに制御情報を付加してアドレス変換時に判定する方法を用いて書込み保護を行うシステムの場合には、領域を確保したタスク、または、その領域に書込みを行うタスクが必要に応じてページテーブルに制御情報を付加して、書込み保護の設定や解除を行う必要がある。このため、書込み保護の設定や解除のオーバヘッドを削減することを目的に、書込み保護を行わない場合がある。さらに、書込み保護解除中のタスクスイッチにより、他のタスク動作中に保護が解除されている状態となり、システムとしての書込み保護が不十分となる場合もある。   In addition, in the case of a system that performs write protection using a method that adds control information to the page table and determines at the time of address translation, the task that secures the area or the task that writes to the area requires the page as needed. It is necessary to set or cancel write protection by adding control information to the table. For this reason, the write protection may not be performed for the purpose of reducing the overhead of setting or releasing the write protection. Furthermore, the task switch being released from the write protection may be in a state in which the protection is released during the operation of another task, and the write protection as the system may be insufficient.

本発明は、複数のタスクが共有するシステム共通領域や空間間共通作業領域等のメモリにおいて、各タスクが書込み保護のための制御をしなくても書込み保護を実現することを可能とするデータ保護方法、情報処理装置及びオペレーティングシステムを提供することを主たる目的とする。   The present invention provides data protection that enables write protection to be realized even if each task does not perform control for write protection in a memory such as a system common area or an inter-space common work area shared by a plurality of tasks. It is a main object to provide a method, an information processing apparatus, and an operating system.

上記目的を達成するに、本発明は、CPUとメモリとを備え、オペレーティングシステムと複数のタスクとが実行される情報処理装置における、前記メモリに記憶されるデータの保護方法であって、前記オペレーティングシステムが、前記メモリを論理的に区画してなる各記憶領域の特定情報と、前記各記憶領域にデータを書き込む際に、前記各記憶領域へのデータの書き込み可否を判断するために前記CPUにより参照される書き込み可否情報と、をそれぞれ対応付けて前記メモリに記憶し、前記オペレーティングシステムが、前記各タスクの識別情報と、前記各タスクの実行中におけるデータの書き込み先として前記各タスクにそれぞれ割り当てられる、1以上の前記記憶領域含んで構成される書込み可能領域の特定情報と、をそれぞれ対応付けて前記メモリに記憶し、前記オペレーティングシステムが、前記情報処理装置により実行されるタスクを第1のタスクから第2のタスクに切り替える際に、前記第1のタスクに割り当てられている第1の書込み可能領域を構成する各記憶領域の特定情報と対応付けられている書き込み可否情報を、書込み不可を示す情報に更新し、前記第2のタスクに割り当てられている第2の書込み可能領域を構成する各記憶領域の特定情報と対応付けられている書き込み可否情報を、書込み可を示す情報に更新する。   In order to achieve the above object, the present invention provides a method for protecting data stored in a memory in an information processing apparatus that includes a CPU and a memory and that executes an operating system and a plurality of tasks. When the system writes specific information of each storage area obtained by logically partitioning the memory and writing data to each storage area, the CPU determines whether data can be written to each storage area. Referenced write permission / rejection information is associated with each other and stored in the memory, and the operating system assigns each task identification information and data write destination during each task execution to each task. Specific information of a writable area configured to include one or more of the storage areas. The first is assigned to the first task when the operating system switches the task executed by the information processing apparatus from the first task to the second task. The writability information associated with the specific information of each storage area constituting the writable area is updated to information indicating that writing is impossible, and the second writable area allocated to the second task is updated. The write enable / disable information associated with the specific information of each storage area to be configured is updated to information indicating write enable.

このような態様によって、各タスクがメモリ上に記憶されるデータを保護するための制御を行わなくても、メモリ上に記憶されるデータが保護されるようにすることが可能となる。つまり、オペレーティングシステムが、タスク選択時に、実行状態のタスクが必要な領域、すなわち、自タスクが確保した領域が書込み可能となるようにし、他タスクが確保した領域は、書込み禁止となるようにすることによって、システム共通領域や空間間共通作業領域の共通領域において、複数のタスクが確保した領域が混在する中で、他タスクが確保した領域に対して、ユーザタスクが領域の書込み保護の制御を考慮しなくても、自タスクが確保した領域のみが書込み可能となり、他タスクが確保した領域は、書込み禁止とすることが可能となる。これにより、他タスクの領域破壊を防止し、領域破壊による他タスクの誤動作を防止することができる。このため例えば、タスクが暴走し、メモリへのデータの書き込み先が制御不能になったとしても、そのタスクに割り当てられていない領域へデータが書き込まれることはないので、メモリに記憶されているデータを保護することが可能となる。また例えば、悪意を持ってタスクが実行され、他のタスクにより書き込まれたデータを不正に書き換えようとしても、本データ保護方法によれば、そのような不正を阻止することが可能となる。そのため、情報処理装置のセキュリティを向上させることも可能となる。   According to such an aspect, it is possible to protect the data stored on the memory without each task performing control for protecting the data stored on the memory. In other words, when the task is selected, the operating system must be able to write to the area where the task in the execution state is required, that is, the area reserved by the invoking task, and the area reserved by other tasks should be write-protected. As a result, in the common area of the system common area and the common work area between spaces, the areas reserved by multiple tasks are mixed, and the user task controls the write protection of the areas for the areas reserved by other tasks. Even without consideration, only the area reserved by the invoking task can be written, and the area reserved by other tasks can be write-protected. Thereby, the area destruction of other tasks can be prevented, and malfunction of other tasks due to the area destruction can be prevented. For this reason, for example, even if a task runs out of control and the write destination of data to the memory becomes uncontrollable, data is not written to an area that is not assigned to the task, so the data stored in the memory Can be protected. In addition, for example, even if a task is executed with malicious intent and data written by another task is illegally rewritten, according to the present data protection method, such fraud can be prevented. Therefore, the security of the information processing apparatus can be improved.

また前記オペレーティングシステムが、第3のタスクの実行中におけるデータの書き込み先として当該第3のタスクに割り当てられている第3の書込み可能領域を構成する少なくとも一部の記憶領域を、前記第2のタスクの実行中においてもデータを書き込み可能な第4の書込み可能領域として前記第2のタスクに割り当て、前記第2のタスクの識別情報と前記第4の書込み可能領域の特定情報とを対応付けて前記メモリに記憶し、前記オペレーティングシステムは、前記情報処理装置により実行されるタスクを前記第1のタスクから前記第2のタスクに切り替える際に、前記第4の書き込み可能領域を構成する各記憶領域の特定情報と対応付けられている書き込み可否情報についても、書込み可を示す情報に更新するようにすることもできる。   Further, the operating system assigns at least a part of the storage area constituting the third writable area allocated to the third task as a data write destination during execution of the third task to the second task. A fourth writable area in which data can be written even during execution of the task is assigned to the second task, and the identification information of the second task and the specific information of the fourth writable area are associated with each other. Each storage area stored in the memory and constituting the fourth writable area when the operating system switches a task executed by the information processing apparatus from the first task to the second task. The writability information associated with the specific information can also be updated to information indicating writable. .

このような態様によって、他タスクが確保した領域であっても、書込みが必要であるとあらかじめ判っている領域を宣言しておくことで、その領域へのデータの書込みを可能とすることもできる。このように、複数のタスクで共通の記憶領域へのデータの書き込みを可能とすることによって、タスク間でのデータの受け渡し等が可能となり、より高度な情報処理サービスを提供することも可能となる。   In this manner, even if an area is secured by another task, it is possible to write data to the area by declaring an area that is known to be written in advance. . As described above, by enabling writing of data to a common storage area by a plurality of tasks, data can be transferred between tasks, and a more advanced information processing service can be provided. .

また前記オペレーティングシステムは、前記第3の書込み可能領域の特定情報と、前記第3の書込み可能領域を構成する記憶領域を、前記第4の書込み可能領域として割り当てるためのパスワードと、を対応付けて前記メモリに記憶し、前記オペレーティングシステムは、前記第2のタスクから前記メモリに前記パスワードに一致するパスワードの書込みがなされた場合には、前記情報処理装置により実行されるタスクを前記第1のタスクから前記第2のタスクに切り替える際に、前記第4の書き込み可能領域を構成する各記憶領域の特定情報と対応付けられている書き込み可否情報についても、書込み可を示す情報に更新するようにすることもできる。   Further, the operating system associates the specific information of the third writable area with a password for allocating the storage area constituting the third writable area as the fourth writable area. When the password that matches the password is written in the memory from the second task, the operating system stores the task executed by the information processing apparatus in the first task. When switching from the second task to the second task, the writability information associated with the specific information of each storage area constituting the fourth writable area is also updated to information indicating writable. You can also.

このような態様によって、パスワードを知っている特定のタスク間でのみ、メモリ上の記憶領域を共用することが可能となる。これにより、あるタスクがメモリに書き込んだデータがそのタスクとは無関係のタスクに漏洩するようなことを防止できるため、情報処理装置のセキュリティを向上させることが可能となる。   By such an aspect, it becomes possible to share the storage area on the memory only between specific tasks that know the password. As a result, it is possible to prevent data written in a memory by a certain task from leaking to a task unrelated to the task, so that the security of the information processing apparatus can be improved.

また前記情報処理装置は、仮想記憶方式により前記複数のタスクを実行し、前記各記憶領域は、仮想記憶方式における各ページであり、前記各記憶領域の特定情報は、各ページの先頭アドレスであり、前記各書込み可能領域の特定情報は、前記各書込み可能領域を構成する各ページのうちの先頭ページの先頭アドレス及び前記各書込み可能領域を構成するページの数であるようにすることもできる。   Further, the information processing apparatus executes the plurality of tasks by a virtual storage method, each storage area is each page in the virtual storage method, and the specific information of each storage area is a head address of each page The specific information of each writable area may be the top address of the top page of each page constituting each writable area and the number of pages constituting each writable area.

このような態様によって、仮想記憶システムのシステム共通領域や空間間共通作業領域の共通領域において、複数のタスクが確保した領域が混在する中で、他タスクが確保した領域に対して、ユーザタスクで領域の書込み保護の制御を考慮しなくても、自タスクが確保した領域のみが書込み可能となり、他タスクが確保した領域は、書込み禁止となり、他タスクの領域破壊を防止し、領域破壊による他タスクの誤動作を防止することができる。   In such a manner, in the common area of the system common area of the virtual storage system and the common work area between the spaces, the area secured by a plurality of tasks is mixed, and the user task is compared with the area secured by other tasks. Even without considering the write protection control of the area, only the area reserved by the invoking task can be written, and the area reserved by the other task is prohibited from being written to prevent other tasks from destroying the area. Task malfunction can be prevented.

また前記CPUは仮想アドレスを実アドレスに変換するアドレス変換機構を有し、前記書込み可否情報は、前記CPUが前記各記憶領域にデータを書き込む際に、前記各記憶領域へのデータの書き込み可否を判断するために前記アドレス変換機構により参照されるようにしてもよい。   The CPU has an address conversion mechanism for converting a virtual address into a real address. The write enable / disable information indicates whether or not data can be written to each storage area when the CPU writes data to each storage area. Reference may be made by the address translation mechanism to determine.

このような態様によって、あるタスクを実行中に、CPUがデータの書き込み命令を実行した場合、アドレス変換機構が仮想アドレスから実アドレスへの変換を行う時点で、メモリ上のページへのアクセスの可否を判断することが可能となる。これにより、情報処理装置が実行する情報処理の高速化を図ることが可能となる。   In this manner, when a CPU executes a data write instruction while executing a certain task, whether or not the page on the memory can be accessed when the address conversion mechanism converts from a virtual address to a real address. Can be determined. As a result, it is possible to increase the speed of information processing executed by the information processing apparatus.

メモリを共有する複数のタスクが、メモリに記憶されるデータを保護するための制御をしなくても、メモリに記憶されるデータを保護することが可能となる。   Even if a plurality of tasks sharing the memory do not control to protect the data stored in the memory, the data stored in the memory can be protected.

以下、本発明を実施するための最良の形態を、図面を参照しながら詳細に説明する。   Hereinafter, the best mode for carrying out the present invention will be described in detail with reference to the drawings.

===情報処理装置===
図1は、本実施形態に係る情報処理装置100のハードウェア構成を示すものである。
情報処理装置100は、CPU1、メモリ4、ハードディスクドライブ110、I/Oインタフェース120、通信インタフェース130を備えて構成される。
=== Information Processing Device ===
FIG. 1 shows a hardware configuration of an information processing apparatus 100 according to the present embodiment.
The information processing apparatus 100 includes a CPU 1, a memory 4, a hard disk drive 110, an I / O interface 120, and a communication interface 130.

CPU1は情報処理装置100の全体の制御を司る装置である。CPU1は、ハードディスクドライブ110に記憶されたオペレーティングシステム200やユーザプログラム300をメモリ4に読み出して実行する。これにより情報処理装置100としての各種機能が実現される。図1には、オペレーティングシステム200やユーザプログラム300がメモリ4に読み出されている様子を示す。なお、図1にはユーザプログラム300として、ユーザプログラムA310、ユーザプログラムB320、ユーザプログラムC330、ユーザプログラムX340が例示されている。   The CPU 1 is a device that controls the entire information processing apparatus 100. The CPU 1 reads the operating system 200 and user program 300 stored in the hard disk drive 110 into the memory 4 and executes them. Thereby, various functions as the information processing apparatus 100 are realized. FIG. 1 shows a state in which the operating system 200 and the user program 300 are read into the memory 4. In FIG. 1, as the user program 300, a user program A310, a user program B320, a user program C330, and a user program X340 are illustrated.

またメモリ4には、セグメントテーブル13、ページテーブル14、実メモリ管理テーブル15、書込み禁止制御テーブル16、共通領域確保テーブル17、書き込み宣言テーブル18、タスク制御テーブル19、共通領域空きテーブル66が記憶される。詳細は後述する。   The memory 4 also stores a segment table 13, a page table 14, an actual memory management table 15, a write prohibition control table 16, a common area reservation table 17, a write declaration table 18, a task control table 19, and a common area free table 66. The Details will be described later.

CPU1がユーザプログラム300を実行する際には、ユーザプログラム300は、オペレーティングシステム200によってユーザタスク31として管理される。図1に示す例では、ユーザプログラムA310、ユーザプログラムB320、ユーザプログラムC330、ユーザプログラムX340は、ユーザタスクA311、ユーザタスクB321、ユーザタスクC331、ユーザタスクX341として管理される。なお以下の説明では、ユーザタスクA311、ユーザタスクB321、ユーザタスクC331、ユーザタスクX341、ユーザタスク31をそれぞれ、単にタスクA311、タスクB321、タスクC331、タスクX341、タスク31とも記す。   When the CPU 1 executes the user program 300, the user program 300 is managed as the user task 31 by the operating system 200. In the example illustrated in FIG. 1, the user program A310, the user program B320, the user program C330, and the user program X340 are managed as a user task A311, a user task B321, a user task C331, and a user task X341. In the following description, user task A 311, user task B 321, user task C 331, user task X 341, and user task 31 are also simply referred to as task A 311, task B 321, task C 331, task X 341, and task 31, respectively.

また詳細は後述するが、本実施形態に係る情報処理装置100は、仮想記憶方式により各ユーザタスク31を実行する。そしてCPU1は制御レジスタ2及びアドレス変換機構3を備える。制御レジスタ2には、メモリ4に記憶されるセグメントテーブル13の先頭アドレスが記憶される。またセグメントテーブル13には、メモリ4に記憶されるページテーブル14の先頭アドレスが記憶される。ページテーブル14には、メモリ4に記憶されるページの先頭アドレスが記憶される。   Although details will be described later, the information processing apparatus 100 according to the present embodiment executes each user task 31 by a virtual storage method. The CPU 1 includes a control register 2 and an address conversion mechanism 3. The control register 2 stores the start address of the segment table 13 stored in the memory 4. The segment table 13 stores the start address of the page table 14 stored in the memory 4. The page table 14 stores the top address of the page stored in the memory 4.

アドレス変換機構3は、CPU1がユーザタスク31を実行し、メモリ4にアクセスする際に、制御レジスタ2、セグメントテーブル13、ページテーブル14を参照することにより、仮想アドレスから実アドレスへの変換を行う。   The address conversion mechanism 3 performs conversion from a virtual address to a real address by referring to the control register 2, the segment table 13, and the page table 14 when the CPU 1 executes the user task 31 and accesses the memory 4. .

I/Oインタフェース120は、オペレータ等による情報処理装置100へのデータの入力に用いられる入力装置や、情報を外部へ出力する出力装置を含み、ユーザインタフェースとして機能する。入力装置としては例えばキーボードやマウス等とすることができる。出力装置としては例えばディスプレイやプリンタ等とすることができる。   The I / O interface 120 includes an input device used to input data to the information processing apparatus 100 by an operator or the like, and an output device that outputs information to the outside, and functions as a user interface. For example, a keyboard or a mouse can be used as the input device. For example, a display or a printer can be used as the output device.

通信インタフェース130は通信を行うための装置である。例えばインタネット等の通信網を介して行われる他のコンピュータとの通信は、通信インタフェース130を介して行われる。   The communication interface 130 is a device for performing communication. For example, communication with other computers performed via a communication network such as the Internet is performed via the communication interface 130.

なお図1に示す情報処理装置100は、CPU1を1個のみ備える構成であるが、複数のCPU1を備える構成であっても良い。   The information processing apparatus 100 illustrated in FIG. 1 is configured to include only one CPU 1, but may be configured to include a plurality of CPUs 1.

===アドレス変換機構===
アドレス変換機構3は、CPU1がメモリ4にアクセスする際に、仮想アドレスを実アドレスに変換する。
=== Address translation mechanism ===
The address conversion mechanism 3 converts a virtual address into a real address when the CPU 1 accesses the memory 4.

本実施形態にかかるオペレーティングシステム200は、メモリ4が提供する実アドレス空間とは異なる仮想アドレス空間をユーザプログラム300に対して提供することができる。このためユーザプログラム300を構成する各命令は、仮想アドレスに基づいて記述されている。そしてCPU1がユーザプログラム300の各命令を実行しメモリ4にアクセスする際には、アドレス変換機構3が仮想アドレスを実アドレスに変換する。   The operating system 200 according to the present embodiment can provide the user program 300 with a virtual address space different from the real address space provided by the memory 4. Therefore, each instruction constituting the user program 300 is described based on a virtual address. When the CPU 1 executes each instruction of the user program 300 and accesses the memory 4, the address conversion mechanism 3 converts the virtual address into a real address.

アドレス変換機構3による仮想アドレスから実アドレスへの変換は、アドレス変換機構3が制御レジスタ2、セグメントテーブル13、ページテーブル14を参照することにより行われる。
すなわち、まずアドレス変換機構2は、制御レジスタ2を参照してセグメントテーブル13の先頭アドレスを取得する。
そしてアドレス変換機構2は、そのセグメントテーブル13の先頭アドレスの値とCPU1が実行中の命令に記述されているセグメント番号とを加算して得られるメモリ4上のアドレスにアクセスし、ページテーブル14の先頭アドレスを取得する。
そしてアドレス変換機構2は、そのページテーブル14の先頭アドレスの値とCPU1が実行中の命令に記述されているページ番号を加算して得られるメモリ4上のアドレスにアクセスしてページの先頭アドレスを取得する。
そしてアドレス変換機構2は、そのページの先頭アドレスの値とCPU1が実行中の命令に記述されているオフセットとを加算して得られるメモリ4上のアドレスを、CPU1がアクセスすべき実アドレスとして求める。
なお、セグメントテーブル13とページテーブル14は、オペレーティングシステム200の実行開始時に作成される。
The translation from the virtual address to the real address by the address translation mechanism 3 is performed by the address translation mechanism 3 referring to the control register 2, the segment table 13, and the page table 14.
That is, first, the address translation mechanism 2 refers to the control register 2 and acquires the head address of the segment table 13.
Then, the address translation mechanism 2 accesses the address on the memory 4 obtained by adding the value of the start address of the segment table 13 and the segment number described in the instruction being executed by the CPU 1, and Get the start address.
Then, the address translation mechanism 2 accesses the address on the memory 4 obtained by adding the value of the top address of the page table 14 and the page number described in the instruction being executed by the CPU 1 to obtain the top address of the page. get.
Then, the address conversion mechanism 2 obtains an address on the memory 4 obtained by adding the value of the head address of the page and the offset described in the instruction being executed by the CPU 1 as a real address to be accessed by the CPU 1. .
The segment table 13 and the page table 14 are created when the operating system 200 starts execution.

ここでアドレス変換機構3は、制御レジスタ2に示されるセグメントテーブル13に示されるページテーブル14のみを参照する。言い換えれば、制御レジスタ2で示されないセグメントテーブル13で示されるページテーブル14は参照しない。あるページテーブル14をあるセグメントテーブル13に固有のものとした場合、そのページテーブル14により管理されるセグメントは、そのセグメントテーブル13によって管理される仮想アドレス空間に固有の仮想メモリ領域(空間固有領域24)とすることができる。また、あるページテーブル14を複数のセグメントテーブル13で共有すると、そのページテーブル14により管理されるセグメントは、複数のセグメントテーブル13によってそれぞれ管理される複数の仮想アドレス空間で共有することができ、複数の仮想アドレス空間で共通の仮想メモリ領域(共通領域25)となる。   Here, the address translation mechanism 3 refers only to the page table 14 shown in the segment table 13 shown in the control register 2. In other words, the page table 14 indicated by the segment table 13 not indicated by the control register 2 is not referred to. When a certain page table 14 is specific to a certain segment table 13, a segment managed by the page table 14 is a virtual memory area (space specific area 24) specific to the virtual address space managed by the segment table 13. ). When a certain page table 14 is shared by a plurality of segment tables 13, segments managed by the page table 14 can be shared by a plurality of virtual address spaces respectively managed by the plurality of segment tables 13. Are common virtual memory areas (common areas 25).

===制御レジスタ===
制御レジスタ2は、メモリ4に記憶されるセグメントテーブル13の先頭アドレスを記憶する。アドレス変換機構3は、制御レジスタ2を参照することによりセグメントテーブル13の先頭アドレスを取得することができる。
制御レジスタ2に設定されるセグメントテーブル13の先頭アドレスを変更することにより、複数の仮想アドレス空間を形成することができる。制御レジスタ2に設定するセグメントテーブル13の先頭アドレスは、CPU1が特権命令を実行することによって変更することができる。
=== Control register ===
The control register 2 stores the start address of the segment table 13 stored in the memory 4. The address translation mechanism 3 can obtain the head address of the segment table 13 by referring to the control register 2.
A plurality of virtual address spaces can be formed by changing the top address of the segment table 13 set in the control register 2. The start address of the segment table 13 set in the control register 2 can be changed by the CPU 1 executing a privileged instruction.

===オペレーティングシステム===
オペレーティングシステム200は、タスク制御部5とメモリ制御部8とを有する。
タスク制御部5は、タスク選択部6と、タスク終了部7とを有する。
メモリ制御部8は、領域確保・解放部9、ユーザ用書込み禁止設定・解除部69、タスク制御用書込み禁止設定・解除部10、書き込み宣言登録・解除部11、実記憶制御部12を有する。
=== Operating System ===
The operating system 200 includes a task control unit 5 and a memory control unit 8.
The task control unit 5 includes a task selection unit 6 and a task end unit 7.
The memory control unit 8 includes an area allocation / release unit 9, a user write prohibition setting / cancellation unit 69, a task control write prohibition setting / cancellation unit 10, a write declaration registration / cancellation unit 11, and a real storage control unit 12.

<タスク制御部>
タスク制御部5は、各ユーザタスク31の実行順序をスケジューリングする。タスク制御部5は、複数のユーザタスク31の中から一つのユーザタスク31を所定のアルゴリズムに従って順次選択することにより、CPU1により実行されるユーザタスク31を切り替える。例えばタスク制御部5は、ユーザタスクA311、ユーザタスクB321、ユーザタスクC331、ユーザタスクX341の中からタスク31を順次選択することにより、CPU1によって実行されるタスク31を切り替える。
<Task control unit>
The task control unit 5 schedules the execution order of each user task 31. The task control unit 5 switches the user task 31 executed by the CPU 1 by sequentially selecting one user task 31 from a plurality of user tasks 31 according to a predetermined algorithm. For example, the task control unit 5 switches the task 31 executed by the CPU 1 by sequentially selecting the task 31 from the user task A 311, the user task B 321, the user task C 331, and the user task X 341.

またタスク制御部5によるタスク31の切り替えに伴って、後述するページテーブル14の書込み保護ビット(特許請求の範囲に記載の書き込み可否情報に相当する)の「ON」または「OFF」の設定が行われる。これによりアドレス変換機構3における書込み保護制御(書込み禁止、および解除)が可能となる。   Further, along with the switching of the task 31 by the task control unit 5, “ON” or “OFF” of a write protection bit (corresponding to write permission / prohibition information described in claims) of the page table 14 to be described later is set. Is called. This enables write protection control (write prohibition and release) in the address translation mechanism 3.

<メモリ制御部>
メモリ制御部8は、ユーザタスク31の切り替えに伴って、ページテーブル14の書込み保護ビットの「ON」または「OFF」の設定を行う。
<Memory control unit>
The memory control unit 8 sets “ON” or “OFF” of the write protection bit of the page table 14 in accordance with the switching of the user task 31.

またメモリ制御部8は、ユーザタスク31から共通領域25の確保の要求を受信した場合に、共通領域25の確保を行う。共通領域25の確保とは、ユーザタスク31の実行時にそのユーザタスク31がデータを書き込める共通領域25の割り当てを受けることをいう。要求された共通領域25の確保ができた場合には、メモリ制御部8は、後述する共通領域確保テーブル17を作成し、確保した仮想メモリの先頭アドレス、確保サイズ(ページ数)、パスワードを設定する。またメモリ制御部8は、確保した共通領域25の仮想メモリに対応するページテーブル14の書込み保護ビットをONにする。なお、ユーザタスク31に確保された領域は、特許請求の範囲に記載の書込み可能領域に相当する。   Further, when the memory control unit 8 receives a request for securing the common area 25 from the user task 31, the memory control section 8 secures the common area 25. The securing of the common area 25 means that when the user task 31 is executed, the user task 31 receives an allocation of the common area 25 in which data can be written. When the requested common area 25 can be secured, the memory control unit 8 creates a common area securing table 17 to be described later, and sets the reserved virtual memory start address, secured size (number of pages), and password. To do. Further, the memory control unit 8 turns on the write protection bit of the page table 14 corresponding to the virtual memory in the secured common area 25. The area reserved for the user task 31 corresponds to the writable area described in the claims.

またメモリ制御部8は、ページ例外の割り込みが発生した場合には、後述する実メモリ管理テーブル15を参照して、未使用の実メモリをページ単位で求める。そしてメモリ制御部8は、それらの各ページの先頭アドレスをページテーブル14に設定する。メモリ制御部8は、実メモリを仮想メモリに割り当てると、実メモリ管理テーブル15に、割り当てたページの仮想アドレスを登録する。   Further, when a page exception interrupt occurs, the memory control unit 8 refers to a real memory management table 15 to be described later and obtains unused real memory in units of pages. Then, the memory control unit 8 sets the top address of each page in the page table 14. When the real memory is allocated to the virtual memory, the memory control unit 8 registers the virtual address of the allocated page in the real memory management table 15.

またメモリ制御部8は、ページテーブル14の先頭アドレスを、セグメントテーブル13に設定する。   Further, the memory control unit 8 sets the top address of the page table 14 in the segment table 13.

===仮想アドレス空間===
図2は、本実施形態にかかる情報処理装置100により順次実行されるタスクA311、タスクB321、タスクC331、タスクX341のうち、タスクA311がタスク制御部5によるタスク選択処理で選択されて実行状態となっている場合における、各タスク31への仮想メモリの割り当て状態を示している。
=== Virtual address space ===
2 shows that the task A311 is selected by the task selection process by the task control unit 5 among the tasks A311, B321, C331, and X341 sequentially executed by the information processing apparatus 100 according to the present embodiment. In this case, the virtual memory allocation state to each task 31 is shown.

本実施形態に係る仮想メモリは、一つのタスク31のみが参照・更新可能な空間固有領域24と、複数のタスク31が参照・更新可能な共通領域25を有して構成されている。   The virtual memory according to the present embodiment includes a space specific area 24 that can be referred to and updated by only one task 31 and a common area 25 that can be referenced and updated by a plurality of tasks 31.

空間固有領域24は、n個の仮想アドレス空間(仮想アドレス空間1(20)から仮想アドレス空間n(23))で構成されている。各仮想アドレス空間にはそれぞれタスク31が割り当てられている。また各タスク31は共通領域25を個々に確保できるものとする。   The space specific area 24 is composed of n virtual address spaces (virtual address space 1 (20) to virtual address space n (23)). A task 31 is assigned to each virtual address space. Each task 31 can secure the common area 25 individually.

仮想メモリに対して実メモリを割り付ける場合、CPU1は、用意した特権命令で実メモリに保護キーを割り当てる。保護キーは、実メモリに割り当てるキーである。CPU1は、実メモリに割り当てた保護キーと各タスク31に割り当てた実行キー(PSW(Processor Status Word)に設定するキー)が一致している場合には、そのタスク31による実メモリへの書込みを可能とし、不一致の場合は書込みを不可(禁止)とする。   When assigning a real memory to a virtual memory, the CPU 1 assigns a protection key to the real memory with a prepared privileged instruction. The protection key is a key assigned to the real memory. When the protection key assigned to the real memory matches the execution key assigned to each task 31 (the key set in the PSW (Processor Status Word)), the CPU 1 writes the task 31 to the real memory. If it does not match, write is disabled (prohibited).

PSWは、命令が存在するメモリ4上のアドレス(命令アドレスとも呼ぶ)の他に、CPU1の動作を制御するための制御ビットを含んで構成されている。制御ビットには、前述した実行キーやアドレス変換機構3を有効にするか無効にするかのビットが含まれる。   The PSW includes a control bit for controlling the operation of the CPU 1 in addition to an address on the memory 4 where the instruction exists (also referred to as an instruction address). The control bits include bits for enabling or disabling the execution key and the address translation mechanism 3 described above.

CPU1は、このPSWの制御ビットに従って動作する。アドレス変換機構3を有効にするビットがONになっている場合は、CPU1は、メモリ4上のセグメントテーブル13、ページテーブル14を参照し、PSWに記憶されている命令アドレスから命令を読み込む。その命令が更新命令であれば、アドレス変換機構3は、その更新命令に記載されている仮想アドレスから実アドレスを求める。CPU1は、メモリ4へアクセスをする際に、ページテーブル14の書込み保護ビットがONになっている場合には、その更新命令を実行せずに書き込みを抑止する。そしてCPU1はプログラムチェック割り込みを発生させる。これにより書込み保護を実現する。このように、アドレス変換機構3が仮想アドレスから実アドレスを求める際に、ページテーブル14の書込み保護ビットを参照するようにすることによって、更新命令の実行可否を迅速に判断できるので、情報処理装置100における処理を高速化することが可能となる。   The CPU 1 operates according to the control bit of this PSW. When the bit for enabling the address conversion mechanism 3 is ON, the CPU 1 refers to the segment table 13 and the page table 14 on the memory 4 and reads an instruction from the instruction address stored in the PSW. If the instruction is an update instruction, the address translation mechanism 3 obtains a real address from the virtual address described in the update instruction. When the CPU 1 accesses the memory 4 and the write protection bit of the page table 14 is ON, the CPU 1 inhibits writing without executing the update instruction. Then, the CPU 1 generates a program check interrupt. This realizes write protection. As described above, when the address translation mechanism 3 obtains the real address from the virtual address, it is possible to quickly determine whether or not the update instruction can be executed by referring to the write protection bit of the page table 14. The processing at 100 can be speeded up.

情報処理装置100は、各タスク31に対して、各空間固有領域24の実メモリに割り当てる保護キーと同一の実行キーをPSWに指定する。この際、隣り合う仮想アドレス空間のタスク31の実行キーは異なるものが割り当てられる。しかし保護キーの種類よりも仮想アドレス空間の数が多くなると、異なる仮想アドレス空間に対して同一の保護キーが実行キーとして割り当てられることになる。本実施例では、仮想アドレス空間1(20)と仮想アドレス空間3(22)が同一保護キーであるものとする。仮想アドレス空間2(21)には、仮想アドレス空間1(20)や仮想アドレス空間3(22)とは異なる保護キーが割り当てられるものとする。   The information processing apparatus 100 designates, for each task 31, the same execution key as the protection key assigned to the real memory of each space specific area 24 in the PSW. At this time, different execution keys are assigned to tasks 31 in adjacent virtual address spaces. However, when the number of virtual address spaces is larger than the type of protection key, the same protection key is assigned as an execution key to different virtual address spaces. In this embodiment, it is assumed that the virtual address space 1 (20) and the virtual address space 3 (22) are the same protection key. It is assumed that a protection key different from the virtual address space 1 (20) and the virtual address space 3 (22) is assigned to the virtual address space 2 (21).

<共通領域>
共通領域25を各タスク31が確保する場合には、確保要求するタスク31の順や、確保する領域のサイズにより、同一保護キーの領域が連続または不連続で各タスク31に割り当てられる。
また、共通領域25が、タスクA311が確保した領域26、タスクB321が確保した領域27、タスクC331が確保した領域28、タスクx341が確保した領域29、未割り当て(解放された)領域30からなる場合、タスクA311は、タスクA311が確保した領域26に対して書込みを行うことができればよく、他の領域27〜30には書込むことができなくても支障は生じない。
そこで、タスク制御部5によって例えばタスクA311が選択されて、タスクA311が実行状態となっている場合には、タスクA311が確保した領域26のみを書込み可能とすればよく、他の領域27〜30は、書込み禁止とすればよい。
また、タスクA311が確保した領域26とタスクC331が確保した領域28は、保護キーが同一であるが、タスクA311は、タスクC331が確保した領域28には書込む必要はないため、書込み禁止としてよい。
<Common area>
When each task 31 secures the common area 25, the same protection key area is assigned to each task 31 continuously or discontinuously depending on the order of the tasks 31 that require securing and the size of the area to be secured.
The common area 25 includes an area 26 secured by the task A 311, an area 27 secured by the task B 321, an area 28 secured by the task C 331, an area 29 secured by the task x 341, and an unallocated (released) area 30. In this case, the task A 311 only needs to be able to write to the area 26 secured by the task A 311, and there is no problem even if it cannot write to the other areas 27 to 30.
Therefore, for example, when the task control unit 5 selects the task A 311 and the task A 311 is in the execution state, only the area 26 reserved by the task A 311 needs to be writable, and the other areas 27 to 30 can be written. May be write-protected.
The area 26 reserved by the task A 311 and the area 28 reserved by the task C 331 have the same protection key. However, since the task A 311 does not need to write to the area 28 reserved by the task C 331, writing is prohibited. Good.

===タスク切り替え処理===
図3は、タスクA311からタスクB321に切り替えた場合の共通領域25の状態を示している。
タスクA311からタスクB321に切り替わることで、タスクA311は実行状態から実行可能状態となる。またタスクB321は、実行可能状態から実行状態となる。
これに伴って、タスクA311が確保した領域26は、書込み可能から書込み禁止とする。またタスクB321が確保した領域27は、書込み禁止から書込み可能とする。
このように、共通領域25に対する書き込みは、実行状態にあるタスク31が確保した領域に対してのみ可能であり、他のタスク31が確保した領域に対する書込みは原則として禁止される。これにより、実行中のタスク31が、誤って他タスク31により確保された領域を破壊し、それに起因して他のタスク31が誤動作を起こすことを防止することが可能となる。タスク選択時の書込み禁止および解除の方法については後述する。
=== Task switching processing ===
FIG. 3 shows the state of the common area 25 when the task A311 is switched to the task B321.
By switching from the task A 311 to the task B 321, the task A 311 is changed from the execution state to the executable state. In addition, the task B321 is changed from the executable state to the execution state.
Along with this, the area 26 secured by the task A 311 is made writable to write prohibited. In addition, the area 27 secured by the task B 321 is made writable from write prohibition.
As described above, writing to the common area 25 can be performed only to the area secured by the task 31 in the execution state, and writing to the area secured by the other tasks 31 is prohibited in principle. As a result, it is possible to prevent the currently executing task 31 from destroying the area secured by the other task 31 by mistake and causing the other task 31 to malfunction. A method of writing prohibition and cancellation at the time of task selection will be described later.

===セグメントテーブル===
図4は、セグメントテーブル13の内容例を示す。
セグメントテーブル13は、ページテーブル14のメモリ4上の先頭アドレスを記憶する。セグメントテーブル13は、アドレス変換機構3により参照される。
セグメントテーブル13は、”ページテーブルアドレス”欄と、”有効ビット”欄と、”共通ビット”欄と、”ページテーブル長”欄とを備える。
=== Segment table ===
FIG. 4 shows an example of the contents of the segment table 13.
The segment table 13 stores the start address on the memory 4 of the page table 14. The segment table 13 is referred to by the address translation mechanism 3.
The segment table 13 includes a “page table address” field, an “effective bit” field, a “common bit” field, and a “page table length” field.

”ページテーブルアドレス”欄には、ページテーブル14の先頭アドレスが記載される。”有効ビット”欄には、上記ページテーブル14のアドレスが有効か否かを示す情報が記載される。「ON」が記載されている場合は有効であることをあらわし、「OFF」が記載されている場合は無効であることを表す。”共通ビット”欄には、”ページテーブルアドレス”欄に示されるページテーブル14が他のセグメントテーブル13と共通に使用されるか否かを示す情報が記載される。「ON」が記載されている場合は他のセグメントテーブル13と共用されることをあらわし、「OFF」が記載されている場合は共用されていないことを表す。”ページテーブル長”欄には、ページテーブル長が記載される。   In the “page table address” column, the top address of the page table 14 is described. In the “valid bit” column, information indicating whether the address of the page table 14 is valid is described. When “ON” is described, it indicates that it is valid, and when “OFF” is described, it indicates that it is invalid. In the “common bit” column, information indicating whether or not the page table 14 shown in the “page table address” column is used in common with other segment tables 13 is described. When “ON” is described, it indicates that the segment table 13 is shared, and when “OFF” is described, it is not shared. The page table length is written in the “page table length” column.

セグメントテーブル13は、仮想アドレス空間を示すことができる。また”共通ビット”欄を「ON」に設定することにより、そのページアドレスで示されるページテーブル14を、他の仮想アドレス空間と共用することができる。その場合、”ページテーブルアドレス”欄に記載されるページテーブル14のアドレスは、共通アドレス空間(共通領域25)であることを示す。ページテーブル14との関連は後述する。   The segment table 13 can indicate a virtual address space. Also, by setting the “common bit” field to “ON”, the page table 14 indicated by the page address can be shared with other virtual address spaces. In this case, the address of the page table 14 described in the “page table address” column indicates a common address space (common area 25). The relationship with the page table 14 will be described later.

===ページテーブル===
図5は、ページテーブル14の内容例を示す。
ページテーブル14は、メモリ4上のページの先頭アドレスを記憶する。ページテーブル14は、セグメントテーブル13と同様に、アドレス変換機構3によって参照されるテーブルである。ページテーブル14に、ページの先頭アドレスが記憶されていることにより、CPU1は実メモリの内容を参照することができる。
=== Page table ===
FIG. 5 shows an example of the contents of the page table 14.
The page table 14 stores the top address of the page on the memory 4. The page table 14 is a table that is referred to by the address translation mechanism 3 in the same manner as the segment table 13. By storing the page top address in the page table 14, the CPU 1 can refer to the contents of the real memory.

ページテーブル14は、”ページアドレス”欄と、”有効ビット”欄と、”書き込み保護ビット”欄と、を備える。
”ページアドレス”欄には、ページの先頭アドレスが記載される。各ページは4kB(キロバイト)単位に仮想メモリと対応付けられている。”有効ビット”欄には、ページに対応する仮想メモリに実メモリが割り当てられているか否かを示す情報が記載される。「ON」が記載されている場合はページに対応する仮想メモリに実メモリが割り当てられていることを示す。「OFF」が記載されている場合はそのページに対応する仮想メモリに実メモリが割り当てられていないことを示す。”書き込み保護ビット”欄には、CPU1によるそのページへの書き込みの可否を示す情報が記載される。「ON」が記載されている場合は、CPU1はそのページに対して書き込みを行うことができない。書き込みを行おうとすると、CPU1は例外を発生させ、書き込みの実行を抑止する。
The page table 14 includes a “page address” column, a “valid bit” column, and a “write protection bit” column.
In the “page address” column, the top address of the page is described. Each page is associated with a virtual memory in units of 4 kB (kilobytes). In the “valid bit” column, information indicating whether or not a real memory is allocated to the virtual memory corresponding to the page is described. When “ON” is described, it indicates that the real memory is allocated to the virtual memory corresponding to the page. When “OFF” is described, it indicates that the real memory is not allocated to the virtual memory corresponding to the page. In the “write protection bit” column, information indicating whether or not the CPU 1 can write to the page is described. When “ON” is described, the CPU 1 cannot perform writing on the page. When writing is attempted, the CPU 1 generates an exception and inhibits execution of writing.

仮想メモリに実メモリが割り当てられているか否かは、ページテーブル14の”有効ビット”に「ON」が記載されているか「OFF」が記載されているかで判断することができる。「ON」が記載されていればそのページに対応する仮想メモリに実メモリが割り付けられていると判断し、そのページテーブル14から実アドレスを求めることができる。「OFF」が記載されていれば、そのページに対応する仮想メモリに実メモリが割り付けられていないと判断し、CPU1はページ例外の割り込みを発生させる。   Whether the real memory is allocated to the virtual memory can be determined by whether “ON” is described in the “valid bit” of the page table 14 or “OFF” is described. If “ON” is described, it is determined that the real memory is allocated to the virtual memory corresponding to the page, and the real address can be obtained from the page table 14. If “OFF” is described, it is determined that the real memory is not allocated to the virtual memory corresponding to the page, and the CPU 1 generates a page exception interrupt.

ページ例外の割り込みが発生すると、メモリ制御部8は、図6に示す実メモリ管理テーブル8を参照して未使用の実メモリをページ単位で求める。そしてメモリ制御部8は、そのページの先頭アドレスをページテーブル14に設定する。このとき、ページの有効性を示す有効ビットを「ON」に設定することで仮想メモリに実メモリを割り付けたことになる。   When a page exception interrupt occurs, the memory control unit 8 refers to the real memory management table 8 shown in FIG. 6 to obtain unused real memory in units of pages. Then, the memory control unit 8 sets the top address of the page in the page table 14. At this time, the real memory is allocated to the virtual memory by setting the valid bit indicating the validity of the page to “ON”.

また、アドレス変換機構3は、ページテーブル14上の”書込み保護ビット”欄が「ON」の場合は、そのページに対する書込みを行わない。書込みを行おうとするとプログラム割り込みが発生する。   In addition, when the “write protection bit” column on the page table 14 is “ON”, the address translation mechanism 3 does not perform writing on the page. A program interrupt occurs when trying to write.

本実施形態では、メモリ制御部8が、ページテーブル14の書込み保護ビットを「ON」または「OFF」に設定する。これによりアドレス変換機構3における書込み保護動作の制御(書込み禁止、および解除)を行う。そしてこれにより、オペレーティングシステム200により実行される書込み保護ビットの「ON」、「OFF」を、ユーザプログラムが個別に考慮しなくとも行えるようになる。   In the present embodiment, the memory control unit 8 sets the write protection bit of the page table 14 to “ON” or “OFF”. As a result, the write protection operation in the address translation mechanism 3 is controlled (write prohibition and release). As a result, the write protection bits “ON” and “OFF” executed by the operating system 200 can be performed without the user program individually considering them.

なお詳細は後述するが、メモリ制御部8は、書込み保護ビットの「ON」または「OFF」の設定を行う際に、メモリ制御部8により作成される書込み禁止制御テーブル16および書込み宣言テーブル18を参照する。   Although details will be described later, the memory control unit 8 sets the write prohibition control table 16 and the write declaration table 18 created by the memory control unit 8 when setting the write protection bit “ON” or “OFF”. refer.

===実メモリ管理テーブル===
図6は、実メモリ管理テーブル15の内容例を示す。
実メモリ管理テーブル15は、実メモリをページ単位で管理するためのテーブルである。つまり実メモリ管理テーブル15は、実メモリ上の各ページが、仮想メモリのどのアドレスに割り当てられているかを示すテーブルである。実メモリ管理テーブル15の”仮想アドレス”欄には、各ページが割り当てられている仮想メモリの仮想アドレスが記載される。仮想メモリに割り当てられていないページに対しては、”仮想アドレス”欄には0が記載される。
メモリ制御部8は、実メモリを仮想メモリに割り当てると、実メモリ管理テーブル15に、割り当てた仮想メモリのアドレスを登録する。なお、実メモリを仮想メモリに割り当てていない場合には、本実施例では0が登録される。
=== Real memory management table ===
FIG. 6 shows an example of the contents of the real memory management table 15.
The real memory management table 15 is a table for managing real memory in units of pages. That is, the real memory management table 15 is a table indicating to which address in the virtual memory each page in the real memory is assigned. In the “virtual address” column of the real memory management table 15, the virtual address of the virtual memory to which each page is allocated is described. For pages not allocated to virtual memory, 0 is written in the “virtual address” column.
When the real memory is allocated to the virtual memory, the memory control unit 8 registers the address of the allocated virtual memory in the real memory management table 15. If real memory is not allocated to virtual memory, 0 is registered in this embodiment.

===書き込み禁止制御テーブル===
図7は、書込み禁止制御テーブル16の内容例を示す。
書込み禁止制御テーブル16は、各ページテーブル14の書込み保護ビットが本実施例で示す方式で解除されているか否かを示すテーブルである。
=== Write prohibition control table ===
FIG. 7 shows an example of the contents of the write prohibition control table 16.
The write prohibition control table 16 is a table indicating whether or not the write protection bit of each page table 14 is released by the method shown in this embodiment.

つまり、書込み禁止の解除を行う場合には、メモリ制御部8が”解除フラグ”欄に記載される書込み禁止の解除を行おうとしているCPU1に対するビットを”1”にする。また”ページテーブルアドレス”欄に記載されている仮想アドレスにより特定されるページテーブル14に、実アドレスが設定されているならば、その実メモリに対して書込み禁止解除を行うために、メモリ制御部8は、そのページテーブル14の書込み保護ビットをOFFにする。   That is, when canceling the write prohibition, the memory control unit 8 sets the bit for the CPU 1 that is going to cancel the write prohibition described in the “release flag” column to “1”. Further, if a real address is set in the page table 14 specified by the virtual address described in the “page table address” column, the memory control unit 8 is used to cancel the write prohibition for the real memory. Turns off the write protection bit of the page table 14.

書込み禁止設定を行う場合は、メモリ制御部8は、書込み禁止制御テーブル16の解除フラグの自CPUに対するビットを”0”にする。そして解除フラグの全てのビットが”0”ならば、他のCPUでの書込み禁止解除が無くなるため、メモリ制御部8は、”ページテーブルアドレス”欄に記載されている仮想アドレスにより特定されるページテーブル14の書込み保護ビットをONにする。   When performing the write prohibition setting, the memory control unit 8 sets the bit for the own CPU of the release flag of the write prohibition control table 16 to “0”. If all the bits of the release flag are “0”, the write prohibition release by other CPUs is eliminated, so the memory control unit 8 determines the page specified by the virtual address described in the “page table address” column. The write protection bit of table 14 is turned ON.

このように、解除フラグをCPU対応のビットに振り分けることで、他のCPUで書込み禁止解除中のページに対して、書込み保護の設定・解除を制御することができる。なお本実施例では、書込み禁止制御テーブル16に”ページテーブルアドレス”欄を設け、書込み禁止制御テーブル16とページテーブル14とを1対1で対応させるようにしている。   In this way, by assigning the release flag to the bits corresponding to the CPU, it is possible to control the setting / release of the write protection for the page whose write prohibition is being canceled by another CPU. In this embodiment, the “page table address” column is provided in the write prohibition control table 16 so that the write prohibition control table 16 and the page table 14 are in a one-to-one correspondence.

”抑止ビット”欄は、メモリ制御部8によってページテーブル14の書込み保護ビットの設定・解除が行われない様にするためのデータが記載される欄である。
つまり、従来、ユーザが書込み禁止設定要求を行って、ページテーブル14の書込み保護ビットを「ON」にした場合は、ユーザ要求を優先し、メモリ制御部8での書込み禁止設定・解除を抑止する必要がある。このため、書込み禁止制御テーブル16に”抑止ビット”欄を設け、ユーザ要求の書込み禁止設定を行った場合は、”抑止ビット”欄をONにし、ページテーブル14の書込み保護ビットの設定・解除が行われない様にする。
The “inhibition bit” column is a column in which data for preventing the memory control unit 8 from setting / releasing the write protection bit of the page table 14 is described.
That is, conventionally, when the user makes a write prohibition setting request and sets the write protection bit of the page table 14 to “ON”, the user request is prioritized and the write prohibition setting / cancellation in the memory control unit 8 is suppressed. There is a need. For this reason, the “prohibit bit” column is provided in the write prohibition control table 16 and when the user request write prohibition is set, the “suppress bit” column is turned ON and the write protection bit of the page table 14 is set / released. Do not do it.

===共通領域確保テーブル===
図8は、共通領域確保テーブル17の内容例を示す。
共通領域確保テーブル17は、”仮想アドレス”欄と、”サイズ”欄と、”パスワード”欄とを有する。”仮想アドレス”欄には、ユーザタスク31が確保した共通領域25の仮想アドレスの先頭アドレスが記載される。”サイズ”欄には、その仮想アドレスから始まる共通領域25のサイズが記載される。サイズはページ単位とすることができる。”パスワード”欄には、パスワードが記載される。パスワードを記憶するのは、あるタスク31が、他のタスク31が確保した共通領域25に対して書き込み宣言を行う場合があるためである。
メモリ制御部8は、ユーザタスク31から、後述する領域確保要求パラメタ67を受信すると、領域確保・解放部9が、後述する共通領域空きテーブル66を参照し、要求されたページ数の領域を確保する。要求されたページ数の領域の確保ができた場合には、メモリ制御部8は、共通領域確保テーブル17を作成する。そして確保した仮想メモリの先頭アドレス、確保サイズ(ページ数)、パスワードを設定する。
=== Common area reservation table ===
FIG. 8 shows an example of the contents of the common area reservation table 17.
The common area reservation table 17 has a “virtual address” column, a “size” column, and a “password” column. In the “virtual address” column, the head address of the virtual address of the common area 25 secured by the user task 31 is described. In the “size” column, the size of the common area 25 starting from the virtual address is described. The size can be in units of pages. A password is written in the “password” column. The reason for storing the password is that a certain task 31 may make a write declaration to the common area 25 secured by another task 31.
When the memory control unit 8 receives an area allocation request parameter 67 (to be described later) from the user task 31, the area allocation / release unit 9 refers to a common area free table 66 (to be described later) and allocates an area having the requested number of pages. To do. When the area of the requested number of pages can be secured, the memory control unit 8 creates the common area securing table 17. Then, the start address of the reserved virtual memory, the reserved size (number of pages), and the password are set.

===共通領域空きテーブル===
図9は、共通領域空きテーブル66の内容例を示す。
共通領域空きテーブル66は、”仮想アドレス”欄と、”サイズ”欄と、”パスワード”欄とを有する。”仮想アドレス”欄には、まだどのタスク31にも確保されていない共通領域25の仮想アドレスが記載される。”サイズ”欄には、その仮想アドレスから始まる共通領域25のサイズが記載される。サイズはページ単位とすることができる。”パスワード”欄には、X’00’で初期化されたパスワードが記載される。
=== Common area free table ===
FIG. 9 shows an example of the contents of the common area empty table 66.
The common area empty table 66 has a “virtual address” column, a “size” column, and a “password” column. In the “virtual address” column, the virtual address of the common area 25 that is not yet secured for any task 31 is described. In the “size” column, the size of the common area 25 starting from the virtual address is described. The size can be in units of pages. In the “password” column, a password initialized with X′00 ′ is described.

===書き込み宣言テーブル===
図10は、書き込み宣言テーブル18の内容例を示す。
書き込み宣言テーブル18は、”仮想アドレス”欄と、”サイズ”欄と、”パスワード”欄とを有する。”仮想アドレス”欄には、書き込み宣言がなされた領域の仮想アドレスが記載される。”サイズ”欄には、その仮想アドレスから始まる領域のサイズ(ページ単位)が記載される。”パスワード”欄には、その領域に対して書き込み許可を受けるためのパスワードが記載される。
=== Write declaration table ===
FIG. 10 shows an example of the contents of the write declaration table 18.
The write declaration table 18 has a “virtual address” column, a “size” column, and a “password” column. In the “virtual address” column, the virtual address of the area where the write declaration is made is described. In the “size” column, the size (page unit) of the area starting from the virtual address is described. In the “password” column, a password for receiving write permission for the area is described.

ユーザタスク31は、他のユーザタスク31が確保した領域に書き込みを行なおうとする場合には、他のユーザタスク31が確保した共通領域25に対する書き込み宣言をメモリ制御部8に対して行う。そうするとメモリ制御部8の書き込み宣言登録・解除部11は、書き込み宣言テーブル18を作成し、書き込み宣言を行ったタスク31のタスク制御テーブル19からチェインする。つまり、後述するタスク制御テーブル19の”書き込み宣言テーブルアドレス”欄に、上記作成した書き込み宣言テーブル18のアドレスを記載する。   When the user task 31 intends to write in an area secured by another user task 31, the user task 31 makes a write declaration for the common area 25 secured by the other user task 31 to the memory control unit 8. Then, the write declaration registration / cancellation unit 11 of the memory control unit 8 creates the write declaration table 18 and chains from the task control table 19 of the task 31 that has made the write declaration. That is, the address of the created write declaration table 18 is described in a “write declaration table address” column of the task control table 19 described later.

書き込み宣言テーブル18は、タスク31が書き込み宣言を行う毎に作成される。書き込み宣言テーブル18には、書き込みを行う仮想メモリの仮想アドレス(ページ境界)と連続して行う場合のためにサイズを設定する。書き込み宣言テーブル18の作成に当たっては、要求された仮想領域に対して書き込みを許可して良いかどうかの判断を共通領域確保テーブル17に登録されているパスワードに一致しているかどうかで行えるようにする。   The write declaration table 18 is created every time the task 31 makes a write declaration. In the write declaration table 18, a size is set for the case where the write declaration table 18 is continuously performed with the virtual address (page boundary) of the virtual memory to be written. In creating the write declaration table 18, it is possible to determine whether or not to allow writing to the requested virtual area based on whether or not it matches the password registered in the common area securing table 17. .

===タスク制御テーブル===
図11は、タスク制御テーブル19の内容例を示す。
タスク制御テーブル19は、”タスク識別子”欄と、”確保テーブルアドレス”欄と、”書き込み宣言テーブルアドレス”欄とを有する。
”タスク識別子”欄には、タスクの識別情報を示すタスク識別子が記載される。”確保テーブルアドレス”欄には、そのタスクの共通領域確保テーブル17の先頭アドレスが記載される。つまり本実施形態においては、タスク制御テーブル19と共通領域確保テーブル17とでもって、特許請求の範囲に記載の書込み領域管理テーブルが実現される。また”書き込み宣言テーブルアドレス”欄には、そのタスクが書き込み宣言を行った場合に登録される書き込み宣言テーブル18の先頭アドレスが記載される。つまり本実施形態においては、タスク制御テーブル19と書き込み宣言テーブル18とでもって、特許請求の範囲に記載の書込み領域拡張テーブルが実現される。
=== Task control table ===
FIG. 11 shows an example of the contents of the task control table 19.
The task control table 19 has a “task identifier” column, a “reserved table address” column, and a “write declaration table address” column.
In the “task identifier” column, a task identifier indicating task identification information is described. In the “reserved table address” column, the head address of the common area securing table 17 of the task is described. That is, in this embodiment, the write area management table described in the claims is realized by the task control table 19 and the common area securing table 17. In the “write declaration table address” column, the head address of the write declaration table 18 registered when the task makes a write declaration is described. That is, in the present embodiment, the write area expansion table described in the claims is realized by the task control table 19 and the write declaration table 18.

<共通領域確保時>
タスク31がメモリ制御部8に対して、共通領域25の確保を要求すると、領域確保・解放部9は、タスク制御テーブル19の”タスク識別子”欄に、要求元タスク31の識別子を記載し、”確保テーブルアドレス”欄に、確保された共通領域25の仮想アドレスを示す共通領域確保テーブル17の先頭アドレスを記載する。これにより、要求元タスク31のタスク制御テーブル19から確保した領域を示す共通領域確保テーブル17がチェインされる。共通領域確保テーブル17は、タスク31が領域確保を行うごとにチェインされる。
なおメモリ制御部8は、共通領域25を確保すると、その仮想メモリに対応するページテーブル14の書込み保護ビットをONにする。その後、要求元タスク31にタスク制御部5を経由して戻るときに、書き込み禁止解除を行うため該当するページテーブル14の書込み保護ビットをOFFにし、書き込み禁止制御テーブル16の解除ビットをONにする。
<When securing a common area>
When the task 31 requests the memory control unit 8 to secure the common area 25, the area securing / releasing unit 9 describes the identifier of the request source task 31 in the “task identifier” column of the task control table 19, In the “reserved table address” column, the head address of the common area securing table 17 indicating the virtual address of the secured common area 25 is described. As a result, the common area reservation table 17 indicating the area reserved from the task control table 19 of the request source task 31 is chained. The common area securing table 17 is chained every time the task 31 secures an area.
When the memory control unit 8 secures the common area 25, the memory control unit 8 turns on the write protection bit of the page table 14 corresponding to the virtual memory. After that, when returning to the request source task 31 via the task control unit 5, the write protection bit of the corresponding page table 14 is turned OFF and the release bit of the write prohibition control table 16 is turned ON in order to release the write prohibition. .

<書き込み宣言時>
ユーザタスク31は、他のユーザタスク31が確保した領域に書き込みを行う必要がある場合には、他のユーザタスク31が確保した共通領域25に対する書き込み宣言をメモリ制御部8に対して行う。そうすると書き込み宣言登録・解除部11は、書き込み宣言テーブル18を作成し、書き込み宣言を行ったタスク31のタスク制御テーブル19の”書き込み宣言テーブルアドレス”欄に、上記書き込み宣言テーブル18のアドレスを記載する。書き込み宣言テーブル18は、タスク31が書き込み宣言を行う毎に作成される。
<When writing declaration>
When the user task 31 needs to write to an area reserved by another user task 31, the user task 31 makes a write declaration for the common area 25 reserved by the other user task 31 to the memory control unit 8. Then, the write declaration registration / cancellation unit 11 creates the write declaration table 18 and writes the address of the write declaration table 18 in the “write declaration table address” column of the task control table 19 of the task 31 that has made the write declaration. . The write declaration table 18 is created every time the task 31 makes a write declaration.

===領域確保要求パラメタ、書き込み宣言要求パラメタ===
図12は、タスク31が共通領域25を確保する場合の領域確保要求パラメタ67と、書込み宣言を行う場合の書込み宣言要求パラメタ68を示すものである。
=== Area allocation request parameter, write declaration request parameter ===
FIG. 12 shows an area securing request parameter 67 when the task 31 secures the common area 25 and a write declaration request parameter 68 when performing a write declaration.

<領域確保要求パラメタ>
領域確保要求パラメタ67には、”確保要求ページ数”と”パスワード”とが含まれる。パスワードは、確保した共通領域25に対して他のタスク31が書込み宣言をしてきた場合に、そのタスク31に書き込みを許可するか否かを判定する制御を行うために指定しておく。
メモリ制御部8の領域確保・解放部9は、ユーザタスク31から領域確保要求パラメタ67がメモリ4に書き込まれたことを検知すると、要求されたページ数の領域を確保する。要求されたページ数の領域の確保ができた場合には、メモリ制御部8は、共通領域確保テーブル17を作成する。そして確保した仮想メモリの先頭アドレス、確保サイズ(ページ数)、パスワードを設定する。
<Area allocation request parameter>
The area allocation request parameter 67 includes “number of allocation request pages” and “password”. The password is designated in order to perform control for determining whether or not to permit writing to the task 31 when another task 31 declares writing to the secured common area 25.
When the area securing / releasing unit 9 of the memory control unit 8 detects that the area securing request parameter 67 is written to the memory 4 from the user task 31, the area securing / releasing unit 9 secures an area having the requested number of pages. When the area of the requested number of pages can be secured, the memory control unit 8 creates the common area securing table 17. Then, the start address of the reserved virtual memory, the reserved size (number of pages), and the password are set.

<書き込み宣言要求パラメタ>
書込み宣言要求パラメタ68には、”要求アドレス”と、”要求ページ数”と、”パスワード”と、が含まれる。”要求アドレス”には、他のタスク31が確保している共通領域25の仮想アドレス(ページ境界)が記載される。
<Write declaration request parameter>
The write declaration request parameter 68 includes “request address”, “request page number”, and “password”. In the “request address”, a virtual address (page boundary) of the common area 25 reserved by another task 31 is described.

メモリ制御部8の書き込み宣言登録・解除部11は、ユーザタスク31から書込み宣言要求パラメタ68がメモリ4に書き込まれたことを検知すると、”要求アドレス”欄に記載されている仮想アドレスと同一の仮想アドレスが記載されている共通領域確保テーブル17を検索する。そして書き込み宣言登録・解除部11は、検索された共通領域確保テーブル17の”パスワード”欄に記載されているパスワードと、書込み宣言要求パラメタ68に記載されているパスワードとを比較する。両パスワードが一致する場合には、書き込み宣言登録・解除部11は、書込み宣言テーブル18を生成する。そして書き込み宣言登録・解除部11は、書き込み宣言を行ったタスク31のタスク制御テーブル19の”書き込み宣言テーブルアドレス”欄に、上記書き込み宣言テーブル18のアドレスを記載し、チェインする。
該当する共通領域確保テーブル17が無い場合や、要求ページ数が含まれない場合、あるいはパスワードが一致しない場合は、書き込み宣言を許可しないで、書き込み宣言の要求元にエラーリターンする。また共通領域確保テーブル17にパスワードが設定されていない場合には、パスワードが不一致でも書き込み宣言を許可する。
When the write declaration registration / cancellation unit 11 of the memory control unit 8 detects that the write declaration request parameter 68 has been written to the memory 4 from the user task 31, it is the same as the virtual address described in the “request address” column. The common area reservation table 17 in which the virtual address is described is searched. The write declaration registration / cancellation unit 11 compares the password described in the “password” column of the searched common area reservation table 17 with the password described in the write declaration request parameter 68. If the two passwords match, the write declaration registration / cancellation unit 11 generates a write declaration table 18. Then, the write declaration registration / cancellation unit 11 writes the address of the write declaration table 18 in the “write declaration table address” column of the task control table 19 of the task 31 that has made the write declaration, and chains.
If there is no corresponding common area allocation table 17, the number of requested pages is not included, or the passwords do not match, the write declaration is not permitted, and an error is returned to the requester of the write declaration. If a password is not set in the common area securing table 17, a write declaration is permitted even if the passwords do not match.

===タスク切り替え制御、メモリ保護制御===
図13は、タスク制御部5、メモリ制御部8、ユーザタスク31の各ソフトウェアの機能構成を示すものである。
=== Task switching control, Memory protection control ===
FIG. 13 shows a functional configuration of each software of the task control unit 5, the memory control unit 8, and the user task 31.

メモリ制御部8は、領域確保・解放部9、ユーザ用書込み禁止設定・解除部69、タスク制御用書込み禁止設定・解除部10、書き込み宣言登録・解除部11、実記憶制御部12を備える。
タスク制御用書込み禁止設定・解除部10は、ページテーブル14の書込み保護ビットのONまたはOFFの設定を行う。これによりタスク選択時の仮想メモリに対する書込み禁止あるいは書込み許可が可能となる。
書込み宣言登録・解除部11は、他タスク31とのインタフェースにおいて、他タスク31の確保した領域にデータを書込む必要がある場合に必要となる機能である。タスク制御用書込み禁止設定・解除部10、書込み宣言登録・解除部11については、後述する。
領域確保・解放部9は、ユーザタスク31からの要求を受信し、領域の確保や解放を行う。
実記憶制御部12は、仮想メモリに対する実メモリの割り当てを行う。
ユーザ用書込み禁止設定・解除部69は、ユーザタスク31の書込み禁止設定要求部70や書込み禁止解除要求部71からの書込み保護の設定・解除の要求に応じて、書込みを禁止する設定や解除する設定を行う。
The memory control unit 8 includes an area reservation / release unit 9, a user write prohibition setting / cancellation unit 69, a task control write prohibition setting / cancellation unit 10, a write declaration registration / cancellation unit 11, and a real storage control unit 12.
The task control write prohibition setting / cancellation unit 10 sets the write protection bit of the page table 14 to ON or OFF. This makes it possible to prohibit or permit writing to the virtual memory when selecting a task.
The write declaration registration / cancellation unit 11 is a function necessary when data needs to be written in an area secured by the other task 31 in the interface with the other task 31. The task control write prohibition setting / cancellation unit 10 and the write declaration registration / cancellation unit 11 will be described later.
The area securing / releasing unit 9 receives a request from the user task 31 and secures or releases the area.
The real storage control unit 12 assigns real memory to virtual memory.
The user write prohibition setting / cancelling unit 69 sets or cancels the write prohibition in response to the write protection setting / cancellation requesting unit 70 or the write prohibition canceling requesting unit 71 of the user task 31. Set up.

一方、タスク制御部5は、タスク選択部6と、タスク終了部7とを備える。
タスク選択部6は、タスク選択時にメモリ制御部8のタスク制御用書込み禁止設定・解除部10を呼び出す。これにより、タスク制御用書込み禁止設定・解除部10は、各領域の仮想メモリに対する書込み禁止、書込み可能の状態にするためにページテーブル14の書込み保護ビットをONまたは、OFFにする。
On the other hand, the task control unit 5 includes a task selection unit 6 and a task end unit 7.
The task selection unit 6 calls the task control write prohibition setting / cancellation unit 10 of the memory control unit 8 when a task is selected. As a result, the task control write prohibition setting / cancelling unit 10 turns the write protection bit of the page table 14 ON or OFF in order to enable writing to the virtual memory in each area and enable writing.

<共通領域の確保>
メモリ制御部8の領域確保・解放部9は、ユーザタスク31の領域確保・解放部32から領域確保の要求を受信すると、共通領域空きテーブル66を検索し、要求サイズ分の領域を確保する。そして確保した共通領域25の仮想アドレス、サイズ、パスワードを共通領域確保テーブル17に追加し、共通領域空きテーブル66から削除する。
このとき、タスク制御用書込み禁止設定・解除部10は、確保した領域の仮想アドレスを共通領域確保テーブル17から求め、その仮想アドレスに対応するページテーブル14の書込み保護ビットをONにする。またその仮想アドレスに対応する書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットをOFFにする。これにより、ユーザタスク31が確保した領域に対する書き込み保護が行われる。
<Securing common areas>
When the area securing / releasing unit 9 of the memory control unit 8 receives the area securing request from the area securing / releasing unit 32 of the user task 31, the area securing / releasing unit 9 searches the common area free table 66 and secures an area for the requested size. Then, the virtual address, size, and password of the secured common area 25 are added to the common area securing table 17 and deleted from the common area free table 66.
At this time, the task control write prohibition setting / cancellation unit 10 obtains the virtual address of the reserved area from the common area reservation table 17, and turns ON the write protection bit of the page table 14 corresponding to the virtual address. Further, the bit corresponding to the own CPU of the release flag of the write prohibition control table 16 corresponding to the virtual address is turned OFF. Thereby, write protection is performed on the area secured by the user task 31.

<領域解放>
ユーザタスク31の領域確保・解放部32がメモリ制御部8に対して領域解放要求を送信すると、メモリ制御部8のタスク制御用書込み禁止設定・解除部10は、解放する共通領域25の仮想アドレスを共通領域確保テーブル17から求める。そしてタスク制御用書込み禁止設定・解除部10は、その仮想アドレスに対応するページテーブル14の有効ビットをOFFにすると共に、書込み保護ビットをOFFにする。また解放した共通領域25の仮想アドレス、サイズ、パスワードを共通領域確保テーブル17から削除し、共通領域空きテーブル66に追加する。
また、ユーザタスク31が終了した場合には、タスク制御部5のタスク終了部7は、領域解放要求をメモリ制御部8のタスク制御用書込み禁止設定・解除部10に対して行う。これにより、ユーザタスク31の終了時に、ユーザタスク31が確保していた領域の解放を行う。
<Release area>
When the area allocation / release unit 32 of the user task 31 transmits an area release request to the memory control unit 8, the task control write prohibition setting / release unit 10 of the memory control unit 8 sets the virtual address of the common area 25 to be released. Is obtained from the common area securing table 17. Then, the task control write prohibition setting / cancelling unit 10 turns off the valid bit of the page table 14 corresponding to the virtual address and turns off the write protection bit. Further, the virtual address, size, and password of the released common area 25 are deleted from the common area securing table 17 and added to the common area free table 66.
When the user task 31 is completed, the task end unit 7 of the task control unit 5 issues an area release request to the task control write prohibition setting / release unit 10 of the memory control unit 8. Thereby, when the user task 31 ends, the area reserved by the user task 31 is released.

<書き込み宣言>
他のタスク31が確保している領域にデータを書込む必要がある場合には、ユーザタスク31の書込み宣言・解除部33は、書込み宣言を行う。書き込み宣言は、必要な仮想メモリのアドレス、サイズ、パスワードをパラメタとして、メモリ制御部8に要求を送信することにより行う。
<Write declaration>
When it is necessary to write data to an area secured by another task 31, the write declaration / cancellation unit 33 of the user task 31 makes a write declaration. The write declaration is performed by transmitting a request to the memory control unit 8 using the necessary virtual memory address, size, and password as parameters.

メモリ制御部8の書き込み宣言登録・解除部11は、ユーザタスク31から書込み宣言要求パラメタ68を受信すると、書込み宣言要求パラメタ68の”要求アドレス”欄に記載されている仮想アドレスと同一の仮想アドレスが記載されている共通領域確保テーブル17を検索する。そして書き込み宣言登録・解除部11は、検索された共通領域確保テーブル17の”パスワード”欄に記載されているパスワードと、書込み宣言要求パラメタ68に記載されているパスワードとを比較する。両パスワードが一致する場合には、書き込み宣言登録・解除部11は、書込み宣言テーブル18を生成する。そして書き込み宣言登録・解除部11は、書き込み宣言を行ったタスク31のタスク制御テーブル19の”書き込み宣言テーブルアドレス”欄に、上記書き込み宣言テーブル18のアドレスを記載し、チェインする。   When the write declaration registration / cancellation unit 11 of the memory control unit 8 receives the write declaration request parameter 68 from the user task 31, the same virtual address as the virtual address described in the “request address” column of the write declaration request parameter 68. Is searched for the common area securing table 17 in which is written. The write declaration registration / cancellation unit 11 compares the password described in the “password” column of the searched common area reservation table 17 with the password described in the write declaration request parameter 68. If the two passwords match, the write declaration registration / cancellation unit 11 generates a write declaration table 18. Then, the write declaration registration / cancellation unit 11 writes the address of the write declaration table 18 in the “write declaration table address” column of the task control table 19 of the task 31 that has made the write declaration, and chains.

またタスク制御用書込み禁止設定・解除部10は、書き込み宣言された領域に対して、ページテーブル14の書込み保護ビットをOFFにし、書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットを”1”にして、書き込み宣言を行ったユーザタスク31による書込みを可能にする。   Further, the task control write prohibition setting / cancellation unit 10 turns off the write protection bit of the page table 14 for the area declared to be written, and sets the bit corresponding to the own CPU of the release flag of the write prohibition control table 16 " 1 "to enable writing by the user task 31 that has made the write declaration.

<書き込み宣言解除>
ユーザタスク31の書き込み宣言・解除部33がメモリ制御部8に対して書込み宣言の解除要求を送信すると、メモリ制御部8の書込み宣言登録・解除部11は、書込み宣言を解除する共通領域25の仮想アドレスを書込み宣言テーブル18から求める。そして書込み宣言登録・解除部11は、その仮想アドレスに対応するページテーブル14の有効ビットをONにすると共に、書込み宣言テーブル18を削除する。
<Release write declaration>
When the write declaration / cancellation unit 33 of the user task 31 transmits a write declaration cancellation request to the memory control unit 8, the write declaration registration / cancellation unit 11 of the memory control unit 8 cancels the write declaration. A virtual address is obtained from the write declaration table 18. Then, the write declaration registration / cancellation unit 11 turns on the valid bit of the page table 14 corresponding to the virtual address and deletes the write declaration table 18.

また、ユーザタスク31が終了した場合には、タスク制御部5のタスク終了部7は、書き込み宣言の解除要求をメモリ制御部8の書込み宣言登録・解除部11に対して行う。これにより、ユーザタスク31の終了時に、ユーザタスク31の書込み宣言の解除を行う。   When the user task 31 is completed, the task end unit 7 of the task control unit 5 makes a write declaration release request to the write declaration registration / release unit 11 of the memory control unit 8. As a result, when the user task 31 ends, the writing declaration of the user task 31 is canceled.

===タスク切り替え時の処理の流れ===
次に、タスク制御部5がCPU1に実行させるタスク31を切り替える際の処理の流れを説明する。
ここでは、タスクA311からタスクB321に切り替える場合を例に説明する。
まずタスク制御部5は、現在実行状態にあるタスクA311を実行可能状態に遷移させる。
その際に、メモリ制御部8は、タスクA311が確保していた共通領域25に対する書き込みを禁止すると共に、タスクA311が書き込み宣言していた共通領域25に対する書き込みを禁止する。
そして、タスク制御部5は、CPU1に次に実行させるタスクB321を、実行可能状態から実行状態に遷移させる。
その際に、メモリ制御部8は、タスクB321が確保している共通領域25に対する書き込みを許可すると共に、タスクB321が書き込み宣言している共通領域25に対する書き込みを許可する。
=== Flow of processing when switching tasks ===
Next, a flow of processing when the task control unit 5 switches the task 31 to be executed by the CPU 1 will be described.
Here, a case where the task A311 is switched to the task B321 will be described as an example.
First, the task control unit 5 shifts the task A311 that is currently in the execution state to an executable state.
At this time, the memory control unit 8 prohibits writing to the common area 25 reserved by the task A 311 and prohibits writing to the common area 25 declared to be written by the task A 311.
Then, the task control unit 5 causes the task B321 to be executed next by the CPU 1 to transition from the executable state to the execution state.
At this time, the memory control unit 8 permits writing to the common area 25 reserved by the task B321 and permits writing to the common area 25 declared to be written by the task B321.

以下、タスク制御部5が、CPU1に実行させるタスク31をタスクA311からタスクB321に切り替える場合の処理を、図14〜図23を参照しながら、詳細に説明する。   Hereinafter, a process when the task control unit 5 switches the task 31 to be executed by the CPU 1 from the task A 311 to the task B 321 will be described in detail with reference to FIGS.

<タスクAを実行状態から実行可能状態に遷移させる場合の処理>
図14は、タスク選択部6により選択されるタスクA311を実行状態から実行可能状態あるいは、待ち状態に遷移させる場合の処理の流れを示すフローチャートである。
<Processing when task A is transitioned from an execution state to an executable state>
FIG. 14 is a flowchart showing a flow of processing when the task A 311 selected by the task selection unit 6 is changed from an execution state to an executable state or a wait state.

まずメモリ制御部8は、タスクA311が確保している共通領域25に対する書き込みを禁止する(S50)。
すなわち、タスク制御用書込み禁止設定・解除部10は、タスクA311が確保している共通領域25に対して、共通領域確保テーブル17を参照して、その共通領域確保テーブル17に示される仮想アドレスからページテーブル14と書込み禁止制御テーブル16を求める。そしてタスク制御用書込み禁止設定・解除部10は、ページテーブル14の書込み保護ビットをONにし、書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットを0にする。これにより、タスクA311が確保している共通領域25に対する書込みを禁止するテーブル設定を行う。なおS50の処理については、図15を参照しながら、以下に詳細に説明する。
First, the memory control unit 8 prohibits writing to the common area 25 secured by the task A 311 (S50).
That is, the task control write prohibition setting / releasing unit 10 refers to the common area reservation table 17 for the common area 25 reserved by the task A 311, and starts from the virtual address indicated in the common area reservation table 17. The page table 14 and the write prohibition control table 16 are obtained. Then, the task control write prohibition setting / cancellation unit 10 turns on the write protection bit of the page table 14 and sets the bit corresponding to the own CPU of the release flag of the write prohibition control table 16 to 0. As a result, a table setting for prohibiting writing to the common area 25 reserved by the task A 311 is performed. The process of S50 will be described in detail below with reference to FIG.

図15は、タスクA311が確保している共通領域25に対する書込みを禁止するための設定を行う際の処理の流れを示すフローチャートである。   FIG. 15 is a flowchart showing the flow of processing when setting for prohibiting writing to the common area 25 secured by the task A 311 is performed.

まずタスク制御用書込み禁止設定・解除部10は、共通領域確保テーブル17を参照し、選択したタスクA311が共通領域25を確保しているか否かを判定する(S53)。
タスク制御用書込み禁止設定・解除部10は、選択したタスクA311が共通領域を確保していない場合にはなにもしないが、共通領域25を確保している場合には、選択したタスクA311の共通領域確保テーブル17を1つずつ参照して、仮想アドレスからページテーブル14と書込み禁止制御テーブル16を求める(S54)。
そしてタスク制御用書込み禁止設定・解除部10は、書き込み禁止設定処理を行う(S55)。書込み禁止設定処理は、ページテーブル14の書込み保護ビットをONにし、書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットを0にする。このようにして、タスクA311が確保している共通領域25に対する書込みを禁止するためのテーブルの設定を行う。なお、書込み禁止設定処理については、図17を参照しながら、以下に詳細に説明する。
First, the task control write prohibition setting / releasing unit 10 refers to the common area securing table 17 and determines whether or not the selected task A 311 has secured the common area 25 (S53).
The task control write prohibition setting / cancelling unit 10 does nothing when the selected task A 311 does not secure the common area, but does not do anything when the common area 25 is secured. The common area allocation table 17 is referred to one by one, and the page table 14 and the write prohibition control table 16 are obtained from the virtual address (S54).
Then, the task control write prohibition setting / cancelling unit 10 performs a write prohibition setting process (S55). In the write prohibition setting process, the write protection bit of the page table 14 is turned ON, and the bit corresponding to the CPU of the release flag of the write prohibition control table 16 is set to 0. In this way, a table is set to prohibit writing to the common area 25 reserved by the task A311. The write prohibition setting process will be described in detail below with reference to FIG.

図17は、タスク制御用書込み禁止設定処理の流れを示すフローチャートである。
タスク制御用書込み禁止設定・解除部10は、選択されたタスクA311が確保している共通領域25の共通領域確保テーブル17、または選択されたタスクA311が書き込み宣言している共通領域25の書込み宣言テーブル18を参照して、該当する仮想アドレスからページテーブル14と書込み禁止制御テーブル16を求めて書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットを0にする(S61)。
次に、タスク制御用書込み禁止設定・解除部10は、書込み禁止制御テーブル16の解除フラグのCPU1に対応するビットが全て0であるか否かを判定する(S74)。
書込み禁止制御テーブル16の解除フラグのCPU1に対応するビットが全て0でない場合は、解除フラグを1に設定しているCPU1による書込みを保証するために、タスク制御用書込み禁止設定・解除部10は、ページテーブル14の書込み保護ビットをONにしないで、タスクA311が確保している共通領域確保テーブル17、書込み宣言テーブル18に示される次の仮想アドレスに対して書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットを0にする処理を行う(S65、S61)。
FIG. 17 is a flowchart showing the flow of task control write prohibition setting processing.
The task control write prohibition setting / cancellation unit 10 writes the common area reservation table 17 of the common area 25 reserved by the selected task A311 or the write declaration of the common area 25 declared by the selected task A311. Referring to the table 18, the page table 14 and the write prohibition control table 16 are obtained from the corresponding virtual address, and the bit corresponding to the own CPU of the release flag of the write prohibition control table 16 is set to 0 (S61).
Next, the task control write prohibition setting / cancelling unit 10 determines whether or not all the bits corresponding to the CPU1 of the cancel flag of the write prohibition control table 16 are 0 (S74).
If all the bits corresponding to CPU1 of the release flag of the write prohibition control table 16 are not 0, the task control write prohibition setting / release unit 10 guarantees writing by the CPU1 with the release flag set to 1. Without releasing the write protection bit of the page table 14, the release flag of the write prohibition control table 16 is set for the next virtual address indicated in the common area reservation table 17 and the write declaration table 18 reserved by the task A311. Processing to set the bit corresponding to the own CPU to 0 is performed (S65, S61).

一方、S74において、書込み禁止制御テーブル16の解除フラグのCPU1に対応するビットが全て0である場合は、仮想メモリに実メモリが割り当てられているかの判定に、CPU1が用意した仮想アドレスから実アドレスへの変換命令を使用する(S62)。
変換命令のコンディションコードが0以外であれば、実メモリの割り当てがないと判断してなにもしないが、コンディションコードが0であれば、実メモリの割り当てがあると判断する(S63)。そしてページテーブル14上の書込み保護ビットをONにする(S64)。これらの処理(S61、S74、S62、S63、S64)は、タスクA311が確保している共通領域確保テーブル17、書込み宣言テーブル18に示される仮想アドレスの全てに対して行う(S65)。
図15に戻って、S54及びS55の処理は、タスクA311が確保している全ての共通領域25に対して行う(S56)。
On the other hand, if all the bits corresponding to CPU1 of the release flag of the write prohibition control table 16 are 0 in S74, the real address is determined from the virtual address prepared by CPU1 in determining whether the real memory is allocated to the virtual memory. The conversion instruction is used (S62).
If the condition code of the conversion instruction is other than 0, it is determined that there is no real memory allocation, but nothing is done, but if the condition code is 0, it is determined that there is real memory allocation (S63). Then, the write protection bit on the page table 14 is turned ON (S64). These processes (S61, S74, S62, S63, and S64) are performed for all the virtual addresses indicated in the common area securing table 17 and the write declaration table 18 secured by the task A311 (S65).
Returning to FIG. 15, the processes of S54 and S55 are performed for all the common areas 25 reserved by the task A311 (S56).

次に、図14に戻ってメモリ制御部8は、タスクA311が書き込み宣言していた共通領域25に対する書き込みを禁止する処理を行う(S51)。
すなわち、書込み宣言登録・解除部11は、タスクA311の書込み宣言テーブル18を参照して、その書込み宣言テーブル18に示される仮想アドレスからページテーブル14と書込み禁止制御テーブル16を求める。そして書込み宣言登録・解除部11は、ページテーブル14の書込み保護ビットをONにし、書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットを0にする。これにより、タスクA311が宣言した他のタスク31が確保している共通領域25に対する書込みを禁止するテーブル設定を行う。なおS51の処理については、図16を参照しながら、以下に詳細に説明する。
Next, returning to FIG. 14, the memory control unit 8 performs a process of prohibiting writing to the common area 25 that the task A 311 has declared to write (S51).
That is, the write declaration registration / cancellation unit 11 refers to the write declaration table 18 of the task A 311 and obtains the page table 14 and the write prohibition control table 16 from the virtual address indicated in the write declaration table 18. Then, the write declaration registration / cancellation unit 11 turns on the write protection bit of the page table 14 and sets the bit corresponding to the CPU of the release flag of the write prohibition control table 16 to 0. As a result, a table setting for prohibiting writing to the common area 25 reserved by the other task 31 declared by the task A 311 is performed. The process of S51 will be described in detail below with reference to FIG.

図16は、タスクA311が他のタスク31が確保している共通領域25に対して書込みを宣言している場合に、その共通領域25に対する書込みを禁止するための設定を行う際の処理の流れを示すフローチャートである。   FIG. 16 shows a flow of processing when setting is performed to prohibit writing to the common area 25 when the task A 311 declares writing to the common area 25 reserved by the other tasks 31. It is a flowchart which shows.

まず書込み宣言登録・解除部11は、書き込み宣言テーブル18を参照し、選択したタスクA311が書き込み宣言を行っているか否かを判定する(S57)。
書込み宣言登録・解除部11は、選択したタスクA311が書き込み宣言を1つも行っていない場合はなにもしないが、書き込み宣言を行っている場合は、タスク制御用書込み禁止設定・解除部10を呼出して、選択したタスクA311の書込み宣言テーブル18を参照して、書込み宣言テーブル18の仮想アドレスからページテーブル14と書込み禁止制御テーブル16を求める(S58)。
First, the write declaration registration / cancellation unit 11 refers to the write declaration table 18 and determines whether or not the selected task A 311 has made a write declaration (S57).
The write declaration registration / cancellation unit 11 does nothing if the selected task A 311 has not made any write declaration, but if it has made a write declaration, the task control write prohibition setting / cancellation unit 10 The page table 14 and the write prohibition control table 16 are obtained from the virtual address of the write declaration table 18 by referring to the write declaration table 18 of the selected task A311 (S58).

そしてタスク制御用書込み禁止設定・解除部10は、書き込み禁止設定処理を行う(S59)。書込み禁止設定処理は、ページテーブル14の書込み保護ビットをONにし、書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットを0にする。このようにして、タスクA311が他のタスク31が確保している共通領域25に対する書込みを禁止するためのテーブルの設定を行う。なお、書込み禁止設定処理については、図17に示す。
このS58、S59の処理は、選択したタスクA311が書き込み宣言している全ての共通領域25に対して行う(S60)。
そして図14に戻って、タスク選択部6は、選択したタスクA311を実行可能状態あるいは、待ち状態にする(S52)。
Then, the task control write prohibition setting / cancelling unit 10 performs a write prohibition setting process (S59). In the write prohibition setting process, the write protection bit of the page table 14 is turned ON, and the bit corresponding to the CPU of the release flag of the write prohibition control table 16 is set to 0. In this way, the table is set so that the task A 311 prohibits writing to the common area 25 reserved by the other tasks 31. The write prohibition setting process is shown in FIG.
The processing of S58 and S59 is performed for all the common areas 25 declared to be written by the selected task A311 (S60).
Returning to FIG. 14, the task selection unit 6 puts the selected task A 311 into an executable state or a waiting state (S52).

<タスクBを実行可能状態から実行状態に遷移させる場合の処理>
図18は、タスク選択部6により選択されるタスクB321を実行可能状態から実行状態に遷移させる場合の処理の流れを示すフローチャートである。
まずメモリ制御部8は、タスクB321が確保している共通領域25に対する書き込みの禁止を解除する(S34)。
すなわち、タスク制御用書込み禁止設定・解除部10は、タスクB321が確保している共通領域25に対して、共通領域確保テーブル17を参照して、その共通領域確保テーブル17に示される仮想アドレスからページテーブル14と書込み禁止制御テーブル16を求める。そしてタスク制御用書込み禁止設定・解除部10は、ページテーブル14の書込み保護ビットをOFFにし、書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットを1にする。これにより、タスクB321が確保している共通領域25に対する書込みの禁止を解除するテーブル設定を行う。なお、S34の処理については、図19を参照しながら、以下に詳細に説明する。
<Processing when task B is transitioned from an executable state to an executable state>
FIG. 18 is a flowchart showing the flow of processing when the task B321 selected by the task selection unit 6 is changed from the executable state to the execution state.
First, the memory control unit 8 cancels the prohibition of writing to the common area 25 secured by the task B321 (S34).
That is, the task control write prohibition setting / cancellation unit 10 refers to the common area reservation table 17 for the common area 25 reserved by the task B 321, and starts from the virtual address indicated in the common area reservation table 17. The page table 14 and the write prohibition control table 16 are obtained. Then, the task control write prohibition setting / release unit 10 turns OFF the write protection bit of the page table 14 and sets the bit corresponding to the own CPU of the release flag of the write prohibition control table 16 to 1. As a result, a table is set to cancel the prohibition of writing to the common area 25 secured by the task B321. The process of S34 will be described in detail below with reference to FIG.

図19は、タスクB321が確保している共通領域25に対する書込み禁止解除処理の流れを示すフローチャートである。
まずタスク制御用書込み禁止設定・解除部10は、共通領域確保テーブル17を参照し、選択したタスクB321が共通領域25を確保しているか否かを判定する(S37)。
タスク制御用書込み禁止設定・解除部10は、選択したタスクB321が共通領域25を確保していなければなにもしないが、共通領域25を確保していれば、選択したタスクB321の共通領域確保テーブル17を1つずつ参照して、仮想アドレスからページテーブル14と書込み禁止制御テーブル16を求める(S38)。
FIG. 19 is a flowchart showing the flow of write prohibition release processing for the common area 25 reserved by the task B321.
First, the task control write prohibition setting / cancelling unit 10 refers to the common area securing table 17 and determines whether or not the selected task B321 has secured the common area 25 (S37).
The task control write prohibition setting / cancellation unit 10 does not have to secure the common area 25 for the selected task B321, but if the common area 25 is secured, the task B321 secures the common area for the selected task B321. The table 17 is referred to one by one, and the page table 14 and the write prohibition control table 16 are obtained from the virtual address (S38).

そしてタスク制御用書込み禁止設定・解除部10は、書き込み禁止解除処理を行う(S39)。書込み禁止解除処理は、ページテーブル14の書込み保護ビットをOFFにし、書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットを1にする。このようにして、タスクB321が確保している共通領域25に対する書込み禁止解除のためのテーブル設定を行う。なお、書込み禁止解除処理については、図21を参照しながら、以下に詳細に説明する。   Then, the task control write prohibition setting / cancelling unit 10 performs a write prohibition canceling process (S39). In the write prohibition release process, the write protection bit of the page table 14 is turned OFF, and the bit corresponding to the own CPU of the release flag of the write prohibition control table 16 is set to 1. In this way, the table setting for canceling write prohibition for the common area 25 reserved by the task B321 is performed. The write prohibition release process will be described in detail below with reference to FIG.

図21は、タスク制御用書込み禁止解除処理の流れを示すフローチャートである。
タスク制御用書込み禁止設定・解除部10は、選択されたタスクB321が確保している共通領域25の共通領域確保テーブル17、または選択されたタスクB321が書き込み宣言している共通領域25の書込み宣言テーブル18を参照し、該当する仮想アドレスに対応する書込み禁止制御テーブル16を参照する。そしてタスク制御用書込み禁止設定・解除部10は、書込み禁止制御テーブル16の抑止ビットがOFFであるか否かを判定する(S72)。
FIG. 21 is a flowchart showing the flow of task control write prohibition release processing.
The task control write prohibition setting / cancelling unit 10 writes the common area reservation table 17 of the common area 25 reserved by the selected task B321 or the write declaration of the common area 25 declared by the selected task B321. The table 18 is referred to, and the write prohibition control table 16 corresponding to the corresponding virtual address is referred to. Then, the task control write prohibition setting / releasing unit 10 determines whether or not the inhibition bit of the write prohibition control table 16 is OFF (S72).

タスク制御用書込み禁止設定・解除部10は、書込み禁止制御テーブル16の抑止ビットがONならば、ユーザ要求の書込み保護を有効とするために、書込み保護の解除を行わずに”yes”に進むが、抑止ビットがOFFならば、書込み保護の解除を行うために”no”に進む。   If the inhibit bit in the write prohibition control table 16 is ON, the task control write prohibition setting / cancelling unit 10 proceeds to “yes” without canceling the write protection in order to validate the write protection of the user request. However, if the inhibit bit is OFF, the process proceeds to “no” to cancel the write protection.

書込み禁止制御テーブル16の解除フラグのCPU1に対応する全てのビットが0でなければ、タスク制御用書込み禁止設定・解除部10は、書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットを1にする(S45)。そしてタスク制御用書込み禁止設定・解除部10は、タスクB321が確保している共通領域確保テーブル17、書込み宣言テーブル18に示される次の仮想アドレスに対して書込み禁止制御テーブル16の解除フラグの判定処理(S49、S73)を行う。   If all the bits corresponding to CPU1 of the release flag of the write prohibition control table 16 are not 0, the task control write prohibition setting / release unit 10 sets the bit corresponding to the own CPU of the release flag of the write prohibition control table 16. Set to 1 (S45). Then, the task control write prohibition setting / cancellation unit 10 determines the release flag of the write prohibition control table 16 for the next virtual address indicated in the common area reservation table 17 and the write declaration table 18 secured by the task B321. Processing (S49, S73) is performed.

一方S73において、書込み禁止制御テーブル16の解除フラグのCPUに対応する全てのビットが0ならば(S73)、タスク制御用書込み禁止設定・解除部10は、ページテーブル14上の書込み保護ビットをONにするために、仮想メモリに実メモリが割り当てられているかの判定を行う(S46)。仮想メモリに実メモリが割り当てられているかの判定には、CPU1が用意している仮想アドレスから実アドレスへの変換命令を使用する。   On the other hand, if all the bits corresponding to the CPU of the release flag of the write prohibition control table 16 are 0 in S73 (S73), the task control write prohibition setting / release unit 10 turns on the write protect bit on the page table 14 Therefore, it is determined whether or not real memory is allocated to the virtual memory (S46). In order to determine whether the real memory is allocated to the virtual memory, a conversion instruction from a virtual address to a real address prepared by the CPU 1 is used.

変換命令のコンディションコードが0以外で実メモリの割り当てがないと判断した場合には(S47:なし)、タスク制御用書込み禁止設定・解除部10は、書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットのみ1にする(S45)。
変換命令のコンディションコードが0であり実メモリの割り当てがあると判断した場合には(S47:あり)、タスク制御用書込み禁止設定・解除部10は、仮想アドレスに対応するページテーブル14上の書込み保護ビットをOFFにする(S48)。そしてタスク制御用書込み禁止設定・解除部10は、書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットを1にする(S45)。
If the condition code of the conversion instruction is other than 0 and it is determined that no real memory is allocated (S47: none), the task control write prohibition setting / cancellation unit 10 uses the own CPU of the cancel flag of the write prohibition control table 16 Only the bit corresponding to 1 is set to 1 (S45).
When it is determined that the condition code of the conversion instruction is 0 and real memory is allocated (S47: present), the task control write prohibition setting / cancelling unit 10 writes on the page table 14 corresponding to the virtual address. The protection bit is turned OFF (S48). Then, the task control write prohibition setting / cancellation unit 10 sets the bit corresponding to the CPU of the cancel flag of the write prohibition control table 16 to 1 (S45).

これらの処理(S73、S46、S47、S48、S45)は、タスクB321が確保している共通領域確保テーブル17、書込み宣言テーブル18に示される仮想アドレス全てに対して行う(S49)。
図19に戻って、S38、S39の処理は、タスクB321が確保している共通領域25の共通領域管理テーブルの確保テーブル17全てに対して行う(S40)。
These processes (S73, S46, S47, S48, S45) are performed for all the virtual addresses indicated in the common area securing table 17 and the write declaration table 18 secured by the task B321 (S49).
Returning to FIG. 19, the processes of S38 and S39 are performed on all of the reservation tables 17 of the common area management table of the common area 25 reserved by the task B321 (S40).

次に図18に戻って、メモリ制御部8は、タスクB321が書き込み宣言している共通領域25に対する書き込みの禁止を解除する(S35)。
すなわち、書込み宣言登録・解除部11は、タスクB321の書込み宣言テーブル18を参照して、その書込み宣言テーブル18に登録されている仮想アドレスから対応するページテーブル14と書込み禁止制御テーブル16を求める。そして書込み宣言登録・解除部11は、ページテーブル14の書込み保護ビットをOFFにし、書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットを1にする。なお、S35の処理については、図20を参照しながら、以下に詳細に説明する。
Next, returning to FIG. 18, the memory control unit 8 cancels the prohibition of writing to the common area 25 declared to be written by the task B321 (S35).
That is, the write declaration registration / cancellation unit 11 refers to the write declaration table 18 of the task B321 and obtains the corresponding page table 14 and write prohibition control table 16 from the virtual addresses registered in the write declaration table 18. Then, the write declaration registration / cancellation unit 11 turns off the write protection bit of the page table 14 and sets the bit corresponding to the own CPU of the release flag of the write prohibition control table 16 to 1. The process of S35 will be described in detail below with reference to FIG.

図20は、タスクB321が他のタスク31が確保している共通領域25に対して書込みを宣言している場合に、その共通領域25に対する書込み禁止を解除するための処理の流れを示すフローチャートである。
まず書込み宣言登録・解除部11は、書き込み宣言テーブル18を参照し、選択したタスクB321が書き込み宣言を行っているか否かを判定する(S41)。
書込み宣言登録・解除部11は、選択したタスクB321が書き込み宣言を1つも行っていない場合はなにもしないが、書き込み宣言を行っている場合は、タスク制御用書込み禁止設定・解除部10を呼出して、選択したタスクB321の書込み宣言テーブル18を参照して、仮想アドレスからページテーブル14と書込み禁止制御テーブル16を求める(S42)。
FIG. 20 is a flowchart showing a flow of processing for releasing the write prohibition on the common area 25 when the task B 321 declares writing to the common area 25 reserved by the other task 31. is there.
First, the write declaration registration / cancellation unit 11 refers to the write declaration table 18 and determines whether or not the selected task B321 has made a write declaration (S41).
The write declaration registration / cancellation unit 11 does nothing if the selected task B 321 has not made any write declaration. The page table 14 and the write prohibition control table 16 are obtained from the virtual address by referring to the write declaration table 18 of the selected task B321 (S42).

そしてタスク制御用書込み禁止設定・解除部10は、図21に示した書き込み禁止解除処理を行う(S43)。書込み禁止解除処理は、ページテーブル14の書込み保護ビットをOFFにし、書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットを1にする。このようにして、書込み禁止解除のためのテーブル設定を行う。
このS42、S43の処理は、選択したタスクB321が書き込み宣言している共通領域25の書込み宣言テーブル18全てに対して行う(S44)。
そして図18に戻って、タスク選択部6は、選択したタスクB321を実行状態にする(S36)。
Then, the task control write prohibition setting / cancelling unit 10 performs the write prohibition canceling process shown in FIG. 21 (S43). In the write prohibition release process, the write protection bit of the page table 14 is turned OFF, and the bit corresponding to the own CPU of the release flag of the write prohibition control table 16 is set to 1. In this way, the table setting for canceling the write prohibition is performed.
The processing of S42 and S43 is performed on all the write declaration tables 18 in the common area 25 that the selected task B321 has declared to write (S44).
Returning to FIG. 18, the task selection unit 6 puts the selected task B321 into an execution state (S36).

<ユーザタスクからの要求で書込み禁止設定を行う場合の書込み禁止設定処理>
図22は、メモリ制御部8が、ユーザタスク31からの要求を受けて、書込みを禁止するための設定を行う場合の処理の流れを示すフローチャートである。
この処理は、従来、書込み保護を行うために、メモリ制御部8が用意したマクロなどを使用してユーザタスク31が要求を行った場合の書込み禁止設定を行う処理である。
<Writing prohibition setting process when writing prohibition is set by request from user task>
FIG. 22 is a flowchart showing a processing flow when the memory control unit 8 receives a request from the user task 31 and performs setting for prohibiting writing.
This process is a process for performing a write prohibition setting when the user task 31 makes a request using a macro or the like prepared by the memory control unit 8 in order to perform write protection.

本発明によるタスク制御部5からの書込み禁止設定・解除との矛盾を発生させないために、ユーザ用の書込み禁止設定処理で、タスク制御部5による書込み禁止設定・解除の状態を判断するために、書込み禁止制御テーブル16の参照と、ユーザの書込み禁止設定要求による書込み禁止設定を保証するため、タスク制御部5による書込み禁止解除を抑止するための書込み禁止制御テーブル16への抑止ビットの設定を行う。   In order to prevent a contradiction with the write prohibition setting / cancellation from the task control unit 5 according to the present invention, in order to determine the write prohibition setting / cancellation state by the task control unit 5 in the write prohibition setting process for the user, In order to guarantee the write prohibition setting by referring to the write prohibition control table 16 and the user's write prohibition setting request, a suppression bit is set in the write prohibition control table 16 for suppressing the write prohibition release by the task control unit 5. .

ユーザタスク31からの書込み禁止設定要求では、要求した仮想アドレスの仮想メモリに実メモリが割り当てられている場合のみ有効とする。仮想メモリに実メモリが割り当てられているかの判定にCPU1が用意した仮想アドレスから実アドレスへの変換命令を使用する(S76)。変換命令のコンディションコードが0以外であれば、実メモリの割り当てがないと判断してエラーリターンするが、コンディションコードが0であれば、実メモリの割り当てがあると判断して(S77)、次の処理(S78)を行う。
書込み禁止設定要求の実メモリに対する書込み禁止制御テーブル16の解除フラグが全て0でなければ(S78)、書込み禁止制御テーブル16の解除フラグ全てを0にして(S79)、ページテーブル14上の書込み保護ビットをONにする(S80)。本発明により、書込み制御テーブル16の解除フラグが0であれば、タスク制御部5による書込み禁止設定が行われているため、ページテーブル14上の書込み保護ビットをONにする必要が無い。
最後にタスク制御部5による書込み禁止設定・解除を抑止させるため、書込み禁止制御テーブル16の抑止ビットをONにして(S81)リターンする。
The write prohibition setting request from the user task 31 is valid only when real memory is allocated to the virtual memory at the requested virtual address. In order to determine whether the real memory is allocated to the virtual memory, a conversion instruction from the virtual address to the real address prepared by the CPU 1 is used (S76). If the condition code of the conversion instruction is other than 0, it is determined that there is no real memory allocation, and an error is returned. If the condition code is 0, it is determined that there is real memory allocation (S77). The process (S78) is performed.
If the release flag of the write prohibition control table 16 for the real memory of the write prohibition setting request is not all 0 (S78), all the release flags of the write prohibition control table 16 are set to 0 (S79), and the write protection on the page table 14 Set the bit to ON (S80). According to the present invention, if the release flag of the write control table 16 is 0, the write prohibition setting by the task control unit 5 is performed, so that it is not necessary to turn on the write protection bit on the page table 14.
Finally, in order to suppress the write prohibition setting / cancellation by the task control unit 5, the suppression bit of the write prohibition control table 16 is turned ON (S81) and the process returns.

<ユーザタスクからの要求で書込み禁止解除を行う場合の書込み禁止解除処理>
図23は、ユーザタスク31からの要求で書込み禁止解除を行う場合の書込み禁止解除処理の流れを示すフローチャートである。
この処理は、従来、書込み保護の解除を行うために、メモリ制御部8が用意したマクロなどを使用してユーザタスク31が要求を行った場合の書込み禁止解除を行う処理である。
<Write prohibition release processing when canceling write prohibition by request from user task>
FIG. 23 is a flowchart showing the flow of the write prohibition release process when the write prohibition release is performed in response to a request from the user task 31.
This process is conventionally a process of canceling write prohibition when the user task 31 makes a request using a macro or the like prepared by the memory control unit 8 in order to cancel write protection.

本発明によるタスク制御部5からの書込み禁止設定・解除との矛盾を発生させないため、ユーザ用の書込み禁止解除処理で、ユーザの解除要求による書込み禁止解除後、タスク制御部5による書込み禁止設定・解除を行える様にするために、書込み禁止制御テーブル16の抑止ビットの解除を行う。   In order not to cause a contradiction with the write prohibition setting / cancellation from the task control unit 5 according to the present invention, in the write prohibition release process for the user, after the write prohibition is canceled by the user's release request, the write prohibition setting / In order to enable the release, the inhibit bit in the write prohibition control table 16 is released.

ユーザタスク31からの書込み禁止解除要求では、書込み禁止制御テーブル16の抑止ビットがONでなければ、ユーザ要求による書込み禁止設定を行っていないと判断し、エラーリターンする(S83)。書込み禁止制御テーブル16の抑止ビットがONであれば、書込み禁止制御テーブル16の抑止ビットをOFFにする(S84)。   In the write prohibition release request from the user task 31, if the inhibit bit of the write prohibition control table 16 is not ON, it is determined that the write prohibition setting by the user request is not performed, and an error is returned (S83). If the inhibit bit in the write inhibit control table 16 is ON, the inhibit bit in the write inhibit control table 16 is turned OFF (S84).

書込み禁止解除要求された仮想メモリが、要求したタスク31が確保している共通領域25に含まれないあるいは、要求したタスク31が書込み宣言を行っている共通領域25に含まれなければ(S85)、そのページの書込み保護の解除は行わないで本発明によるタスク制御部5での書込み禁止解除とする。要求したタスク31が確保している共通領域25に含まれるか、要求したタスク31が書込み宣言を行っている共通領域25に含まれるのであれば(S85)、その書込み禁止解除を要求された仮想アドレスに対する仮想メモリに実メモリが割り当てられている場合、ページテーブル14上の書込み保護ビットをOFFにする。   If the requested virtual memory is not included in the common area 25 reserved by the requested task 31, or if it is not included in the common area 25 where the requested task 31 has made a write declaration (S85). The write protection is canceled in the task control unit 5 according to the present invention without canceling the write protection of the page. If the requested task 31 is included in the common area 25 reserved or if the requested task 31 is included in the common area 25 in which the write declaration is made (S85), the virtual for which the write prohibition release is requested When the real memory is assigned to the virtual memory for the address, the write protection bit on the page table 14 is turned OFF.

仮想メモリに実メモリが割り当てられているかの判定にCPU1が用意した仮想アドレスから実アドレスへの変換命令を使用する(S86)。変換命令のコンディションコードが0以外であれば、実メモリの割り当てがないと判断して、書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットを1にしてリターンするが、コンディションコードが0であれば、実メモリの割り当てがあると判断して(S87)、ページテーブル14上の書込み保護ビットをOFFにして(S88)、書込み禁止制御テーブル16の解除フラグの自CPUに対応するビットを1にして(S89)、リターンする。   In order to determine whether the real memory is allocated to the virtual memory, a conversion instruction from the virtual address to the real address prepared by the CPU 1 is used (S86). If the condition code of the conversion instruction is other than 0, it is determined that no real memory is allocated, and the bit corresponding to the own CPU of the release flag of the write prohibition control table 16 is set to 1, but the condition code is 0. If so, it is determined that there is real memory allocation (S87), the write protection bit on the page table 14 is turned OFF (S88), and the bit corresponding to the own CPU of the release flag of the write prohibition control table 16 is set. Set to 1 (S89) and return.

以上本発明の実施形態を詳細に説明したが、本実施形態によれば、メモリ4を共有する各タスク31が、メモリ4に記憶されるデータを保護するための制御をしなくても、メモリ4に記憶されるデータを保護することが可能となる。このため例えば、ユーザタスク31が暴走し、メモリ4へのデータの書き込み先が制御不能になったとしても、そのユーザタスク31が確保していない領域へデータが書き込まれることはないので、メモリ4に記憶されているデータを保護することが可能となる。また例えば、悪意を持ってユーザタスク31が実行され、他のユーザタスク31により書き込まれたデータを不正に書き換えようとしても、本実施形態に係るデータ保護方法によれば、そのような不正を阻止することが可能となる。   Although the embodiment of the present invention has been described in detail above, according to this embodiment, each task 31 sharing the memory 4 does not have to perform control for protecting the data stored in the memory 4. The data stored in 4 can be protected. For this reason, for example, even if the user task 31 runs out of control and the data write destination to the memory 4 becomes uncontrollable, data is not written to an area not secured by the user task 31. It is possible to protect the data stored in. Further, for example, even if the user task 31 is executed maliciously and the data written by another user task 31 is illegally rewritten, the data protection method according to the present embodiment prevents such fraud. It becomes possible to do.

特に仮想記憶システムのシステム共通領域や、空間間共通作業領域の共通領域25において、複数のタスクが確保した領域が混在する中で、他タスクが確保した同一の保護キーが割り当てられた領域に対して、ユーザタスク31で領域の書込み保護の制御を考慮しなくても、自タスクが確保した領域のみが書込み可能となる。これにより、自動的に他タスクが確保した領域に誤って書込むことができなくなり、他のタスクが領域破壊により誤動作することが無くなるという利点がある。さらに、実行状態でのみ書込み可能となるため、他タスクから破壊されることを防止できるという利点がある。   In particular, in the system common area of the virtual storage system and the common area 25 of the inter-space common work area, an area secured by a plurality of tasks is mixed, and an area assigned with the same protection key secured by another task Thus, even if the user task 31 does not consider the write protection control of the area, only the area secured by the own task can be written. As a result, there is an advantage that it is impossible to automatically write in an area secured by another task by mistake and other tasks do not malfunction due to the destruction of the area. Further, since writing is possible only in the execution state, there is an advantage that it can be prevented from being destroyed by other tasks.

また他のタスクと領域を介してデータの受け渡しを行う場合など、その領域のアドレスがあらかじめ判っていて、その領域が受け取り側のタスクが用意した領域であって関連したタスク間でインタフェースとして書込みを可能とするような場合、他タスクの確保した領域に対して、書込みを宣言することで、書込みが可能となり、他タスクとのインタフェースの誤りによって、用意された領域が小さい場合など、不用意に他の関係ない領域を破壊してシステムを停止させるようなことを防止することが可能となる利点がある。また領域に対する書込むタスクが限定されることで、領域破壊を検知した場合の原因特定が迅速に行えるという利点がある。   In addition, when data is exchanged with other tasks and areas, the address of the area is known in advance, and the area is an area prepared by the receiving task, and writing is performed as an interface between related tasks. In such a case, it is possible to write by declaring writing to the area reserved by another task, and inadvertently, such as when the prepared area is small due to an interface error with other tasks. There is an advantage that it is possible to prevent other unrelated areas from being destroyed and stopping the system. In addition, since the task to write to the area is limited, there is an advantage that the cause can be quickly identified when the area destruction is detected.

以上発明を実施するための最良の形態について説明したが、上記実施の形態は本発明の理解を容易にするためのものであり、本発明を限定して解釈するためのものではない。本発明はその趣旨を逸脱することなく変更、改良され得ると共に、本発明にはその等価物も含まれる。例えば、特許請求の範囲に記載の記憶領域は、ページではなくセグメントであってもよい。またメモリ4は、物理的に1個の半導体メモリで構成されるのみならず、複数の半導体メモリで構成されていてもよい。   Although the best mode for carrying out the invention has been described above, the above embodiment is intended to facilitate understanding of the present invention and is not intended to limit the present invention. The present invention can be changed and improved without departing from the gist thereof, and the present invention includes equivalents thereof. For example, the storage area described in the claims may be a segment instead of a page. Further, the memory 4 is not only physically configured by one semiconductor memory, but may be configured by a plurality of semiconductor memories.

本実施形態に係る情報処理装置のハードウェア構成を示す図である。It is a figure which shows the hardware constitutions of the information processing apparatus which concerns on this embodiment. 本実施形態に係る仮想メモリの構成を示す図である。It is a figure which shows the structure of the virtual memory which concerns on this embodiment. 本実施形態に係る仮想メモリの構成を示す図である。It is a figure which shows the structure of the virtual memory which concerns on this embodiment. 本実施形態に係るセグメントテーブルを示す図である。It is a figure which shows the segment table which concerns on this embodiment. 本実施形態に係るページテーブルを示す図である。It is a figure which shows the page table which concerns on this embodiment. 本実施形態に係る実メモリ管理テーブルを示す図である。It is a figure which shows the real memory management table which concerns on this embodiment. 本実施形態に係る書込み禁止制御テーブルを示す図である。It is a figure which shows the write prohibition control table which concerns on this embodiment. 本実施形態に係る共通領域確保テーブルを示す図である。It is a figure which shows the common area reservation table which concerns on this embodiment. 本実施形態に係る共通領域空きテーブルを示す図である。It is a figure which shows the common area free table which concerns on this embodiment. 本実施形態に係る書込み宣言テーブルを示す図である。It is a figure which shows the write declaration table which concerns on this embodiment. 本実施形態に係るタスク制御テーブルを示す図である。It is a figure which shows the task control table which concerns on this embodiment. 本実施形態に係る領域確保要求パラメタ及び書込み宣言要求パラメタを示す図である。It is a figure which shows the area ensuring request | requirement parameter and write declaration request | requirement parameter which concern on this embodiment. 本実施形態に係るソフトウェアの構成を示した図である。It is the figure which showed the structure of the software which concerns on this embodiment. 本実施形態に係るタスクを実行状態から実行可能状態に遷移させる場合の処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process in the case of making the task which concerns on this embodiment change from an execution state to an executable state. 本実施形態に係るタスクが確保している共通領域に対する書込みを禁止するための設定を行う際の処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process at the time of performing the setting for prohibiting writing with respect to the common area which the task which concerns on this embodiment has ensured. 本実施形態に係るタスクが他のタスクが確保している共通領域に対して書込みを宣言している場合に、その共通領域に対する書込みを禁止するための設定を行う際の処理の流れを示すフローチャートである。The flowchart which shows the flow of a process at the time of performing the setting for prohibiting the write with respect to the common area, when the task which concerns on this embodiment has declared writing with respect to the common area which the other task has ensured It is. 本実施形態に係るタスク制御用書込み禁止設定処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the write-inhibit setting process for task control which concerns on this embodiment. 本実施形態に係るタスクを実行可能状態から実行状態に遷移させる場合の処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process in the case of making the task which concerns on this embodiment change from an executable state to an execution state. 本実施形態に係るタスクが確保している共通領域に対する書込み禁止解除処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the write prohibition cancellation | release process with respect to the common area which the task which concerns on this embodiment has ensured. 本実施形態に係るタスクが他のタスクが確保している共通領域に対して書込みを宣言している場合に、その共通領域に対する書込み禁止を解除するための処理の流れを示すフローチャートである。When a task according to the present embodiment declares writing to a common area secured by another task, it is a flowchart showing a flow of processing for canceling write prohibition on the common area. 本実施形態に係るタスク制御用書込み禁止解除処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the write prohibition cancellation | release process for task control which concerns on this embodiment. 本実施形態に係るメモリ制御がユーザからの要求で書込み保護設定を行う際の処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process when the memory control which concerns on this embodiment performs write-protection setting by the request | requirement from a user. 本実施形態に係るメモリ制御がユーザからの要求で書込み保護解除を行う際の処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process when the memory control which concerns on this embodiment performs write-protection cancellation | release by the request | requirement from a user.

符号の説明Explanation of symbols

1 CPU 2 制御レジスタ
3 アドレス変換機構 4 メモリ
5 タスク制御 6 タスク選択部
7 タスク終了部 8 メモリ制御部
9 領域確保・解放部 10 タスク制御用書込み禁止・解除部
11 書き込み宣言登録・解除部 12 実記憶制御部
13 セグメントテーブル 14 ページテーブル
15 実メモリ管理テーブル 16 書込み禁止制御テーブル
17 共通領域確保テーブル 18 書込み宣言テーブル
19 タスク制御テーブル 20 空間1
21 空間2 22 空間3
23 空間n 24 空間固有領域
25 共通領域 26 タスクA確保領域
27 タスクB確保領域 28 タスクC確保領域
29 タスクx確保領域 30 未割当て(解放)領域
31 ユーザタスク 32 領域確保・解放部
33 書込み宣言・解除部 66 共通領域空きテーブル
67 領域確保要求パラメタ 68 書き込み要求宣言パラメタ
69 ユーザ用書込み禁止設定・解除部 70 書込み禁止設定要求部
71 書込み禁止解除要求部
100 情報処理装置 110 ハードディスクドライブ
120 I/Oインタフェース 130 通信インタフェース
200 オペレーティングシステム 300 ユーザプログラム
310 ユーザプログラムA 311 ユーザタスクA
320 ユーザプログラムB 321 ユーザタスクB
330 ユーザプログラムC 331 ユーザタスクC
340 ユーザプログラムX 341 ユーザタスクX
1 CPU 2 Control register 3 Address conversion mechanism 4 Memory 5 Task control 6 Task selection unit 7 Task end unit 8 Memory control unit 9 Area reservation / release unit 10 Task control write inhibit / release unit 11 Write declaration registration / release unit 12 Actual Storage control unit 13 Segment table 14 Page table 15 Real memory management table 16 Write prohibition control table 17 Common area reservation table 18 Write declaration table 19 Task control table 20 Space 1
21 space 2 22 space 3
23 Space n 24 Space specific area 25 Common area 26 Task A reservation area 27 Task B reservation area 28 Task C reservation area 29 Task x reservation area 30 Unallocated (release) area 31 User task 32 Area reservation / release section 33 Write declaration / Release unit 66 Common area free table 67 Area reservation request parameter 68 Write request declaration parameter 69 Write prohibition setting / release unit for user 70 Write prohibition setting request unit 71 Write prohibition release request unit 100 Information processing device 110 Hard disk drive 120 I / O interface 130 Communication Interface 200 Operating System 300 User Program 310 User Program A 311 User Task A
320 User program B 321 User task B
330 User program C 331 User task C
340 User program X 341 User task X

Claims (15)

CPUとメモリとを備え、オペレーティングシステムと複数のタスクとが実行される情報処理装置における、前記メモリに記憶されるデータの保護方法であって、
前記オペレーティングシステムが、前記メモリを論理的に区画してなる各記憶領域の特定情報と、前記各記憶領域にデータを書き込む際に、前記各記憶領域へのデータの書き込み可否を判断するために前記CPUにより参照される書き込み可否情報と、をそれぞれ対応付けて前記メモリに記憶し、
前記オペレーティングシステムが、前記各タスクの識別情報と、前記各タスクの実行中におけるデータの書き込み先として前記各タスクにそれぞれ割り当てられる、1以上の前記記憶領域含んで構成される書込み可能領域の特定情報と、をそれぞれ対応付けて前記メモリに記憶し、
前記オペレーティングシステムが、前記情報処理装置により実行されるタスクを第1のタスクから第2のタスクに切り替える際に、前記第1のタスクに割り当てられている第1の書込み可能領域を構成する各記憶領域の特定情報と対応付けられている書き込み可否情報を、書込み不可を示す情報に更新し、前記第2のタスクに割り当てられている第2の書込み可能領域を構成する各記憶領域の特定情報と対応付けられている書き込み可否情報を、書込み可を示す情報に更新する
ことを特徴とするデータ保護方法。
A method for protecting data stored in the memory in an information processing apparatus that includes a CPU and a memory and that executes an operating system and a plurality of tasks,
In order to determine whether or not data can be written to each storage area when the operating system writes specific information of each storage area obtained by logically partitioning the memory and data to each storage area. And write permission / prohibition information referred to by the CPU are stored in the memory in association with each other,
Identification information of each task, and identification information of a writable area configured to include one or more of the storage areas respectively assigned to each task as a data write destination during execution of each task. Are stored in the memory in association with each other,
When the operating system switches the task executed by the information processing apparatus from the first task to the second task, each memory constituting the first writable area allocated to the first task Update the writability information associated with the specific information of the area to information indicating that writing is impossible, and the specific information of each storage area constituting the second writable area allocated to the second task; A data protection method characterized by updating the associated writability information to information indicating writable.
請求項1に記載のデータ保護方法であって、
前記オペレーティングシステムが、第3のタスクの実行中におけるデータの書き込み先として当該第3のタスクに割り当てられている第3の書込み可能領域を構成する少なくとも一部の記憶領域を、前記第2のタスクの実行中においてもデータを書き込み可能な第4の書込み可能領域として前記第2のタスクに割り当て、前記第2のタスクの識別情報と前記第4の書込み可能領域の特定情報とを対応付けて前記メモリに記憶し、
前記オペレーティングシステムは、前記情報処理装置により実行されるタスクを前記第1のタスクから前記第2のタスクに切り替える際に、前記第4の書き込み可能領域を構成する各記憶領域の特定情報と対応付けられている書き込み可否情報についても、書込み可を示す情報に更新する
ことを特徴とするデータ保護方法。
A data protection method according to claim 1, comprising:
The operating system assigns at least a part of a storage area constituting a third writable area allocated to the third task as a data write destination during execution of the third task to the second task. Is assigned to the second task as a fourth writable area in which data can be written even during execution of the above, and the identification information of the second task and the specific information of the fourth writable area are associated with each other. Store in memory,
When the operating system switches the task executed by the information processing apparatus from the first task to the second task, the operating system associates with the specific information of each storage area constituting the fourth writable area A data protection method characterized in that the written writability information is also updated to information indicating writable.
請求項2に記載のデータ保護方法であって、
前記オペレーティングシステムは、前記第3の書込み可能領域の特定情報と、前記第3の書込み可能領域を構成する記憶領域を、前記第4の書込み可能領域として割り当てるためのパスワードと、を対応付けて前記メモリに記憶し、
前記オペレーティングシステムは、前記第2のタスクから前記メモリに前記パスワードに一致するパスワードの書込みがなされた場合には、前記情報処理装置により実行されるタスクを前記第1のタスクから前記第2のタスクに切り替える際に、前記第4の書き込み可能領域を構成する各記憶領域の特定情報と対応付けられている書き込み可否情報についても、書込み可を示す情報に更新する
ことを特徴とするデータ保護方法。
A data protection method according to claim 2, comprising:
The operating system associates the specific information of the third writable area with a password for allocating a storage area constituting the third writable area as the fourth writable area. Store in memory,
When the password matching the password is written to the memory from the second task, the operating system changes the task executed by the information processing apparatus from the first task to the second task. When switching to, the data protection method is characterized in that the write enable / disable information associated with the specific information of each storage area constituting the fourth writable area is also updated to information indicating write enable.
請求項1に記載のデータ保護方法であって、
前記情報処理装置は、仮想記憶方式により前記複数のタスクを実行し、
前記各記憶領域は、仮想記憶方式における各ページであり、
前記各記憶領域の特定情報は、各ページの先頭アドレスであり、
前記各書込み可能領域の特定情報は、前記各書込み可能領域を構成する各ページのうちの先頭ページの先頭アドレス及び前記各書込み可能領域を構成するページの数である
ことを特徴とするデータ保護方法。
A data protection method according to claim 1, comprising:
The information processing apparatus executes the plurality of tasks by a virtual storage method,
Each storage area is each page in the virtual storage system,
The specific information of each storage area is the top address of each page,
The specific information of each writable area is a start address of a top page of each page constituting each writable area and the number of pages constituting each writable area. .
請求項4に記載のデータ保護方法であって、
前記CPUは仮想アドレスを実アドレスに変換するアドレス変換機構を有し、
前記書込み可否情報は、前記CPUが前記各記憶領域にデータを書き込む際に、前記各記憶領域へのデータの書き込み可否を判断するために前記アドレス変換機構により参照されることを特徴とするデータ保護方法。
A data protection method according to claim 4, comprising:
The CPU has an address conversion mechanism for converting a virtual address into a real address;
The write protection information is referred to by the address conversion mechanism to determine whether or not data can be written to each storage area when the CPU writes data to each storage area. Method.
CPUと、
メモリと、
を備え、
オペレーティングシステムと複数のタスクとが実行される情報処理装置であって、
前記メモリを論理的に区画してなる各記憶領域の特定情報と、前記各記憶領域にデータを書き込む際に、前記各記憶領域へのデータの書き込み可否を判断するために前記CPUにより参照される書き込み可否情報と、をそれぞれ対応付けて記憶する書込み可否管理テーブルと、
前記各タスクの識別情報と、前記各タスクの実行中におけるデータの書き込み先として前記各タスクにそれぞれ割り当てられる、1以上の前記記憶領域含んで構成される書込み可能領域の特定情報と、をそれぞれ対応付けて記憶する書込み領域管理テーブルと、
前記情報処理装置により実行されるタスクを第1のタスクから第2のタスクに切り替える際に、前記第1のタスクに割り当てられている第1の書込み可能領域を構成する各記憶領域の特定情報と対応付けられている書き込み可否情報を、書込み不可を示す情報に更新し、前記第2のタスクに割り当てられている第2の書込み可能領域を構成する各記憶領域の特定情報と対応付けられている書き込み可否情報を、書込み可を示す情報に更新するタスク切替部と、
を備えることを特徴とする情報処理装置。
CPU,
Memory,
With
An information processing apparatus that executes an operating system and a plurality of tasks,
Specific information of each storage area obtained by logically partitioning the memory, and when the data is written to each storage area, it is referred to by the CPU to determine whether data can be written to each storage area. A writability management table that stores writability information in association with each other;
The identification information of each task corresponds to the specific information of the writable area including one or more of the storage areas allocated to each task as a data write destination during execution of each task. A write area management table to store with,
When switching the task executed by the information processing apparatus from the first task to the second task, the specific information of each storage area constituting the first writable area allocated to the first task; The associated writability information is updated to information indicating that writability is not possible, and is associated with the specific information of each storage area constituting the second writable area allocated to the second task. A task switching unit that updates the writability information to information indicating writable;
An information processing apparatus comprising:
請求項6に記載の情報処理装置であって、
第3のタスクの実行中におけるデータの書き込み先として当該第3のタスクに割り当てられている第3の書込み可能領域を構成する少なくとも一部の記憶領域を、前記第2のタスクの実行中においてもデータを書き込み可能な第4の書込み可能領域として前記第2のタスクに割り当て、前記第2のタスクの識別情報と前記第4の書込み可能領域の特定情報とを対応付けて記憶する書込み領域拡張テーブルと、
を備え、
前記タスク切替部は、前記情報処理装置により実行されるタスクを前記第1のタスクから前記第2のタスクに切り替える際に、前記第4の書き込み可能領域を構成する各記憶領域の特定情報と対応付けられている書き込み可否情報についても、書込み可を示す情報に更新する
ことを特徴とする情報処理装置。
The information processing apparatus according to claim 6,
Even during execution of the second task, at least a part of the storage area constituting the third writable area allocated to the third task as a data write destination during execution of the third task A write area expansion table that assigns data as a writable fourth writable area to the second task and stores the identification information of the second task and the specific information of the fourth writable area in association with each other When,
With
The task switching unit corresponds to specific information of each storage area constituting the fourth writable area when the task executed by the information processing apparatus is switched from the first task to the second task. The information processing apparatus is also characterized in that the attached writability information is updated to information indicating writability.
請求項7に記載の情報処理装置であって、
前記第3の書込み可能領域の特定情報と、前記第3の書込み可能領域を構成する記憶領域を、前記第4の書込み可能領域として割り当てるためのパスワードと、を対応付けて記憶するパスワード記憶テーブルと、
を備え、
前記タスク切替部は、前記第2のタスクから前記メモリに前記パスワードに一致するパスワードの書込みがなされた場合には、前記情報処理装置により実行されるタスクを前記第1のタスクから前記第2のタスクに切り替える際に、前記第4の書き込み可能領域を構成する各記憶領域の特定情報と対応付けられている書き込み可否情報についても、書込み可を示す情報に更新する
ことを特徴とする情報処理装置。
The information processing apparatus according to claim 7,
A password storage table for storing the specific information of the third writable area and a password for assigning a storage area constituting the third writable area as the fourth writable area in association with each other; ,
With
When the password matching the password is written to the memory from the second task, the task switching unit changes the task executed by the information processing apparatus from the first task to the second task. When switching to a task, the writability information associated with the specific information of each storage area constituting the fourth writable area is also updated to information indicating writable information .
請求項6に記載の情報処理装置であって、
前記情報処理装置は、仮想記憶方式により前記複数のタスクを実行し、
前記各記憶領域は、仮想記憶方式における各ページであり、
前記各記憶領域の特定情報は、各ページの先頭アドレスであり、
前記各書込み可能領域の特定情報は、前記各書込み可能領域を構成する各ページのうちの先頭ページの先頭アドレス及び前記各書込み可能領域を構成するページの数である
ことを特徴とする情報処理装置。
The information processing apparatus according to claim 6,
The information processing apparatus executes the plurality of tasks by a virtual storage method,
Each storage area is each page in the virtual storage system,
The specific information of each storage area is the top address of each page,
The specific information of each writable area is the start address of the first page of each page constituting each writable area and the number of pages constituting each writable area. .
請求項6に記載の情報処理装置であって、
前記CPUは仮想アドレスを実アドレスに変換するアドレス変換機構を有し、
前記書込み可否情報は、前記CPUが前記各記憶領域にデータを書き込む際に、前記各記憶領域へのデータの書き込み可否を判断するために前記アドレス変換機構により参照されることを特徴とする情報処理装置。
The information processing apparatus according to claim 6,
The CPU has an address conversion mechanism for converting a virtual address into a real address;
The write enable / disable information is referred to by the address conversion mechanism to determine whether data can be written to each storage area when the CPU writes data to each storage area. apparatus.
CPUとメモリとを備え、複数のタスクが実行される情報処理装置に、
前記メモリを論理的に区画してなる各記憶領域の特定情報と、前記各記憶領域にデータを書き込む際に、前記各記憶領域へのデータの書き込み可否を判断するために前記CPUにより参照される書き込み可否情報と、をそれぞれ対応付けて前記メモリに記憶する手順と、
前記各タスクの識別情報と、前記各タスクの実行中におけるデータの書き込み先として前記各タスクにそれぞれ割り当てられる、1以上の前記記憶領域含んで構成される書込み可能領域の特定情報と、をそれぞれ対応付けて前記メモリに記憶する手順と、
前記情報処理装置により実行されるタスクを第1のタスクから第2のタスクに切り替える際に、前記第1のタスクに割り当てられている第1の書込み可能領域を構成する各記憶領域の特定情報と対応付けられている書き込み可否情報を、書込み不可を示す情報に更新し、前記第2のタスクに割り当てられている第2の書込み可能領域を構成する各記憶領域の特定情報と対応付けられている書き込み可否情報を、書込み可を示す情報に更新する手順と、
を実行させるためのオペレーティングシステム。
An information processing apparatus that includes a CPU and a memory and executes a plurality of tasks,
Specific information of each storage area obtained by logically partitioning the memory, and when the data is written to each storage area, it is referred to by the CPU to determine whether data can be written to each storage area. A procedure for associating the write permission / rejection information with each other and storing them in the memory;
The identification information of each task corresponds to the specific information of the writable area including one or more of the storage areas allocated to each task as a data write destination during execution of each task. And the procedure of storing in the memory,
When switching the task executed by the information processing apparatus from the first task to the second task, the specific information of each storage area constituting the first writable area allocated to the first task; The associated writability information is updated to information indicating that writability is not possible, and is associated with the specific information of each storage area constituting the second writable area allocated to the second task. A procedure for updating the writability information to information indicating writable;
Operating system for running.
請求項11に記載のオペレーティングシステムであって、
第3のタスクの実行中におけるデータの書き込み先として当該第3のタスクに割り当てられている第3の書込み可能領域を構成する少なくとも一部の記憶領域を、前記第2のタスクの実行中においてもデータを書き込み可能な第4の書込み可能領域として前記第2のタスクに割り当て、前記第2のタスクの識別情報と前記第4の書込み可能領域の特定情報とを対応付けて前記メモリに記憶する手順と、
前記情報処理装置により実行されるタスクを前記第1のタスクから前記第2のタスクに切り替える際に、前記第4の書き込み可能領域を構成する各記憶領域の特定情報と対応付けられている書き込み可否情報についても、書込み可を示す情報に更新する手順と、
を実行させるためのオペレーティングシステム。
An operating system according to claim 11, comprising:
Even during execution of the second task, at least a part of the storage area constituting the third writable area allocated to the third task as a data write destination during execution of the third task Procedure for assigning data as a writable fourth writable area to the second task and storing the second task identification information and the fourth writable area specific information in association with each other in the memory When,
When the task executed by the information processing apparatus is switched from the first task to the second task, write permission / inhibition associated with the specific information of each storage area constituting the fourth writable area Regarding information, a procedure for updating to information indicating that writing is possible,
Operating system for running.
請求項12に記載のオペレーティングシステムであって、
前記第3の書込み可能領域の特定情報と、前記第3の書込み可能領域を構成する記憶領域を、前記第4の書込み可能領域として割り当てるためのパスワードと、を対応付けて前記メモリに記憶する手順と、
前記第2のタスクから前記メモリに前記パスワードに一致するパスワードの書込みがなされた場合には、前記情報処理装置により実行されるタスクを前記第1のタスクから前記第2のタスクに切り替える際に、前記第4の書き込み可能領域を構成する各記憶領域の特定情報と対応付けられている書き込み可否情報についても、書込み可を示す情報に更新する手順と、
を実行させるためのオペレーティングシステム。
An operating system according to claim 12,
Procedure for storing the specific information of the third writable area and the password for assigning the storage area constituting the third writable area as the fourth writable area in association with each other When,
When the password matching the password is written in the memory from the second task, when switching the task executed by the information processing device from the first task to the second task, A procedure for updating the writability information associated with the specific information of each storage area constituting the fourth writable area to information indicating writable; and
Operating system for running.
請求項11に記載のオペレーティングシステムであって、
前記情報処理装置は、仮想記憶方式により前記複数のタスクを実行し、
前記各記憶領域は、仮想記憶方式における各ページであり、
前記各記憶領域の特定情報は、各ページの先頭アドレスであり、
前記各書込み可能領域の特定情報は、前記各書込み可能領域を構成する各ページのうちの先頭ページの先頭アドレス及び前記各書込み可能領域を構成するページの数である
ことを特徴とするオペレーティングシステム。
An operating system according to claim 11, comprising:
The information processing apparatus executes the plurality of tasks by a virtual storage method,
Each storage area is each page in the virtual storage system,
The specific information of each storage area is the top address of each page,
The operating system characterized in that the specific information of each writable area is a head address of a head page of each page constituting each writable area and the number of pages constituting each writable area.
請求項11に記載のオペレーティングシステムであって、
前記CPUは仮想アドレスを実アドレスに変換するアドレス変換機構を有し、
前記書込み可否情報は、前記CPUが前記各記憶領域にデータを書き込む際に、前記各記憶領域へのデータの書き込み可否を判断するために前記アドレス変換機構により参照されることを特徴とするオペレーティングシステム。

An operating system according to claim 11, comprising:
The CPU has an address conversion mechanism for converting a virtual address into a real address;
The write permission / prohibition information is referred to by the address conversion mechanism to determine whether or not data can be written to each storage area when the CPU writes data to each storage area. .

JP2006141992A 2006-05-22 2006-05-22 Data protection method, information processor and operating system Pending JP2007310834A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006141992A JP2007310834A (en) 2006-05-22 2006-05-22 Data protection method, information processor and operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006141992A JP2007310834A (en) 2006-05-22 2006-05-22 Data protection method, information processor and operating system

Publications (1)

Publication Number Publication Date
JP2007310834A true JP2007310834A (en) 2007-11-29

Family

ID=38843600

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006141992A Pending JP2007310834A (en) 2006-05-22 2006-05-22 Data protection method, information processor and operating system

Country Status (1)

Country Link
JP (1) JP2007310834A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010238193A (en) * 2009-03-31 2010-10-21 Fujitsu Ltd Information processing program, information processor and information processing method
JP2012238273A (en) * 2011-05-13 2012-12-06 Denso Corp Ram write control device and unauthorized access prevention program
JP2013140476A (en) * 2012-01-04 2013-07-18 Toyota Motor Corp Information processing device, access authority giving method, program generation device, and method therefor

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010238193A (en) * 2009-03-31 2010-10-21 Fujitsu Ltd Information processing program, information processor and information processing method
JP2012238273A (en) * 2011-05-13 2012-12-06 Denso Corp Ram write control device and unauthorized access prevention program
JP2013140476A (en) * 2012-01-04 2013-07-18 Toyota Motor Corp Information processing device, access authority giving method, program generation device, and method therefor

Similar Documents

Publication Publication Date Title
CN109558211B (en) Method for protecting interaction integrity and confidentiality of trusted application and common application
KR101477080B1 (en) Memory access security management
US5892944A (en) Program execution and operation right management system suitable for single virtual memory scheme
JP4818793B2 (en) Microcomputer and memory access control method
JP5914145B2 (en) Memory protection circuit, processing device, and memory protection method
JP5581403B2 (en) Store secure mode page table data in secure and non-secure areas of memory
KR100927750B1 (en) Tamper protection of software agents operating in a vt environment methods and apparatuses
US7272832B2 (en) Method of protecting user process data in a secure platform inaccessible to the operating system and other tasks on top of the secure platform
RU2602793C2 (en) Method of modifying memory access grants in secure processor environment
US7870336B2 (en) Operating system protection against side-channel attacks on secrecy
US8850557B2 (en) Processor and data processing method with non-hierarchical computer security enhancements for context states
US8677457B2 (en) Security for codes running in non-trusted domains in a processor core
JP4939382B2 (en) Information processing apparatus and program execution control method thereof
JP4939387B2 (en) Data processing apparatus and address space protection method
JP5582971B2 (en) Memory protection method and information processing apparatus
JP5338435B2 (en) Information processing program, information processing apparatus, and information processing method
CN112256396B (en) Memory management method and system, security processing device and data processing device
JP2007310834A (en) Data protection method, information processor and operating system
JP2010186386A (en) Processor
JP2009009232A (en) Computer, kernel protection method, and computer software
JPH0652054A (en) Virtual memory controller
US11150887B2 (en) Secure code patching
JP2011150457A (en) Information processing apparatus and memory access control method
TW201702884A (en) Fine grained memory protection to thwart memory overrun attacks
JP6438381B2 (en) Electronic control unit