JPH0556539B2 - - Google Patents

Info

Publication number
JPH0556539B2
JPH0556539B2 JP60132374A JP13237485A JPH0556539B2 JP H0556539 B2 JPH0556539 B2 JP H0556539B2 JP 60132374 A JP60132374 A JP 60132374A JP 13237485 A JP13237485 A JP 13237485A JP H0556539 B2 JPH0556539 B2 JP H0556539B2
Authority
JP
Japan
Prior art keywords
processing
interrupt
system call
task
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP60132374A
Other languages
Japanese (ja)
Other versions
JPS61289433A (en
Inventor
Hajime Sakuma
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
Nippon Electric Co 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP13237485A priority Critical patent/JPS61289433A/en
Publication of JPS61289433A publication Critical patent/JPS61289433A/en
Publication of JPH0556539B2 publication Critical patent/JPH0556539B2/ja
Granted legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、マルチタスキングを行なう情報処理
装置に関して、特にオペレーテイングシステムの
実現方法に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an information processing device that performs multitasking, and particularly to a method for implementing an operating system.

〔従来の技術〕[Conventional technology]

マルチタスキングは、システム全体の処理効率
を向上させるためプログラムを複数のタスクに分
割し、各タスクを時分割に実行させることで実現
している。通常これはオペレーテイングシステム
の基本的機能であり、タスクが切替れるのは、各
タスクからオペレーテイングシステムに対する処
理要求(以下システムコール)が発行された場
合、または割込みによる場合などが考えられる。
マルチタスキングの実行環境では、各タスクは一
般的には、第4図に示すように実行状態、実行可
能状態、待ち状態をとり、これらの状態はオペレ
ーテイングシステムにより制御される。実行状態
とはある時点では唯一存在し、中央処理装置を専
有する。実行可能状態は実行するための総ての条
件は揃つているが優先順位の関係で実行状態にな
れずにいる状態、待ち状態は他のタスクの処理待
ち、他のタスクからのメツセージ待ちなどの要因
で、実行可能状態に遷移出来ずにいる状態であ
る。システムコールや外部割込(以下これらを総
称して事象と呼ぶ)などで各タスクの状態が変化
しマルチタスキングを実現する。第5図は割込処
理とシステムコールの関係を示した図で、図中の
数字は処理の手順を示している。タスクAの走行
中1のINTの点で割込が入り、制御は割込処理
2に移る。前記割込処理中2ではデータの収集作
業を行ないメツセージとしてシステムコール
SYS1でメツセージ送信を行なつた場合、オペ
レーテイングシステムは一度送信されたメツセー
ジを受け取り、もしメツセージ受信待ちを待ち状
態のタスクが存在した場合、そのタスクを実行可
能状態にした後、優先順位が最も高いタスクを選
択し実行状態とする。本例で、タスクBがメツセ
ージ待ち状態であり、且つタスクAより優先度が
高い場合、システムコールSYS1の実行でタス
クBに制御が移ることになり処理3を実行する。
実行後、システムコールSYS2でタスクBの終
了処理をオペレーテイングシステムが実行した
後、割込処理の継続処理4へ制御を渡す。処理4
では割込処理で実行すべき処理を続行した後、割
込処理からの復帰要求システムコールRETIを発
行し割込処理を終了する。オペレーテイングシス
テムは割込まれた箇所に制御を戻し、タスクAは
継続処理5を実行する。この様に割込処理中でタ
スク状態の遷移を引き起こすシステムコールを発
行した場合には前述した様な処理の流れをとるこ
とが一般的である。
Multitasking is achieved by dividing a program into multiple tasks and executing each task in a time-sharing manner in order to improve the processing efficiency of the entire system. Normally, this is a basic function of the operating system, and tasks may be switched when each task issues a processing request (hereinafter referred to as a system call) to the operating system, or due to an interrupt.
In a multitasking execution environment, each task generally takes a running state, an executable state, and a waiting state as shown in FIG. 4, and these states are controlled by the operating system. A running state is the only one that exists at a time and occupies the central processing unit. The executable state is a state in which all the conditions for execution are met but the state cannot be executed due to priority, and the wait state is a state in which the state is waiting for processing by another task, waiting for a message from another task, etc. This is a state in which the transition to the executable state is not possible due to some reason. The status of each task changes due to system calls, external interrupts (hereinafter collectively referred to as events), and multitasking is realized. FIG. 5 is a diagram showing the relationship between interrupt processing and system calls, and the numbers in the diagram indicate processing procedures. While task A is running, an interrupt occurs at INT point 1, and control shifts to interrupt processing 2. During the interrupt processing 2, data is collected and a system call is sent as a message.
When a message is sent using SYS1, the operating system receives the message once sent, and if there is a task waiting to receive a message, it makes that task executable and then assigns it the highest priority. Select a high task and put it into execution state. In this example, if task B is in a message waiting state and has a higher priority than task A, control is transferred to task B by executing system call SYS1, and processing 3 is executed.
After execution, the operating system executes end processing for task B using system call SYS2, and then passes control to continuation processing 4 of the interrupt processing. Processing 4
Then, after continuing the processing to be executed in the interrupt processing, a system call RETI is issued to request a return from the interrupt processing, and the interrupt processing is ended. The operating system returns control to the interrupted location, and task A executes continuation processing 5. In this way, when a system call that causes a task state transition is issued during interrupt processing, the processing flow as described above is generally followed.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上述した様に、通常のオペレーテイングシステ
ムでは、第5図に示したように割込処理中で発行
するシステムコールは、その種類によつては、タ
スク状態の遷移を誘発する場合があり、割込処理
中でシステムコールを発行すると、本来緊急を要
する割込処理の一部の処理(第5図の場合、継続
処理4)が割込を受けたタスクAの優先順位やタ
スク状態に左右され、その処理が後廻しになる可
能性が存在するという欠点を有していた。特に本
例のようにメツセージを送信するだけで、処理を
継続したい時に他に制御が移ると問題も多い。ま
たこの欠点を回避し、第6図に示すように、割込
処理中のシステムコールSYS1でタスクの状態
遷移を起こすような事象が発生しても保留し、処
理3を継続して行ない、割込処理から抜けるシス
テムコールRETIの実行で事象を受け付ける処理
とするためには、割込処理の先頭で割込中である
ことを示すソフトウエア的フラグにより記述し、
オペレーテイングシステムがシステムコールの処
理でそのフラグを判定しタスク状態の遷移を一時
保留するなどのソフトウエア処理を行なうことで
実現する方法をとらなければならずアプリケーシ
ヨンプログラム、オペレーテイングシステム共に
ソフトウエア処理に負担がかかり過ぎる欠点があ
る。あるいは、この様な複雑な処理を避けるため
に、割込処理中で使用できるシステムコールに制
限を設け、割込処理中にタスクの状態遷移を起こ
す様な事象の発生を禁止しているシステムもある
が、システム構成の柔軟性を欠くという問題を含
んでいる。
As mentioned above, in a normal operating system, depending on the type of system call issued during interrupt processing as shown in Figure 5, it may induce a task state transition; If a system call is issued during interrupt processing, a part of the interrupt processing that is originally urgent (continuation processing 4 in the case of Figure 5) will be affected by the priority and task status of task A that received the interrupt. However, this method has the disadvantage that the processing may be postponed. In particular, as in this example, simply by sending a message, there are many problems if control is transferred to another device when processing needs to be continued. In addition, to avoid this drawback, as shown in Figure 6, even if an event that causes a task state transition occurs in system call SYS1 during interrupt processing, it is suspended, processing 3 continues, and the interrupt is processed. In order to accept an event by executing the RETI system call that exits the interrupt processing, write a software flag at the beginning of the interrupt processing to indicate that the interrupt is in progress.
A method must be used in which the operating system determines the flag during system call processing and performs software processing such as temporarily suspending task state transitions.Both the application program and the operating system are software-based. It has the disadvantage of being too burdensome to process. Alternatively, in order to avoid such complicated processing, some systems place limits on the system calls that can be used during interrupt processing, and prohibit the occurrence of events that cause task state transitions during interrupt processing. However, the problem is that the system configuration lacks flexibility.

〔問題点を解決するための手段〕[Means for solving problems]

本発明は、マルチタスキングを実現する処理装
置において、割込処理中や割込処理中でないかを
判定する第1の手段と該第1の手段から、割込処
理中に発行されたシステムコールの処理の一部を
保留し、該保留情報を保持する第2の手段を備
え、割込処理の終了を告げるシステムコールの実
行で、前記第2の手段を判定し、保留情報に応じ
た保留処理を行なうことを特徴としている。
The present invention provides a first means for determining whether an interrupt is being processed or not, and a system call issued from the first means in a processing device that realizes multitasking. A second means for suspending a part of the processing and retaining the suspension information is provided, and the second means is determined by executing a system call indicating the end of the interrupt processing, and the suspension is executed according to the suspension information. It is characterized by processing.

〔実施例〕〔Example〕

本発明について図面を参照して説明する。 The present invention will be explained with reference to the drawings.

第1図は、本発明の一実施例によるハードウエ
ア構成図である。割込制御部1は内外の割込を検
知し、優先順位などの判定をした後割込として受
けつける。割込判定部4は割込制御部1が割込を
受け付けてから、割込処理終了のシステムコール
がオペレーテイングシステムに発せられるまで、
割込処理であることを示す情報を保持する。シス
テムコール実行部3は実際に各システムコールを
実行するための部分である。システムコール判定
部2は種々のシステムコールに応じてシステムコ
ール実行部3に信号を発生する。事象保留制御部
6は、システムコール実行部3から起動を受け、
保留情報レジスタ5に必要な情報を書き込む処理
を行なう。以下具体的な処理手順を示す。第2図
は、第6図における割込処理中のシステムコール
SYS1がオペレーテイングシステムへのメツセ
ージ送信であつた場合のオペレーテイングシステ
ムの処理を示している。処理ではオペレーテイン
グシステムが一度メツセージを受取り、メツセー
ジ待ちタスクがある場合にはメツセージを送信す
る。その後割込判定部の状態を検知し、割込中で
なければタスク状態の遷移を起こすが、割込中で
ある場合、事象保留制御部6へ制御を渡す。事象
保留制御部6は事象の種類に応じて保留情報レジ
スタ5に事象の種類を書き込む。事象の種類を記
憶するだけで、処理は行なわないため、タスク状
態の遷移を起こさず、第6図における処理3の実
行に即移行することが出来る。第3図は、割込中
からの復帰システムコールRETIの処理を示して
いる。RETIの処理では、第1図、保留情報レジ
スタ5の内容を判定し、保留情報がない時は、割
込判定部4をクリアし、通常の割込処理ルーチン
からの復帰処理を行なう。保留情報が存在した場
合、保留情報レジスタ5の内容に応じた処理を行
ない、タスク状態の遷移を起こし、実行可能状態
のタスク中1つを選択し、実行状態とする。その
後割込判定部4をクリアした後、割込処理から復
帰する。従つて割込処理からの復帰するためのシ
ステムコールの実行により初めてタスク状態の変
化が起こり、第6図で示すようにタスクBへ制御
が移り処理4を実行することになる。
FIG. 1 is a hardware configuration diagram according to an embodiment of the present invention. The interrupt control unit 1 detects internal and external interrupts, determines the priority order, and then accepts the interrupts as interrupts. The interrupt determination unit 4 processes the interrupt from the time the interrupt control unit 1 accepts the interrupt until the system call to end the interrupt processing is issued to the operating system.
Holds information indicating that it is an interrupt process. The system call execution unit 3 is a part for actually executing each system call. System call determination section 2 generates signals to system call execution section 3 in response to various system calls. The event suspension control unit 6 receives activation from the system call execution unit 3,
A process of writing necessary information into the pending information register 5 is performed. The specific processing procedure is shown below. Figure 2 shows the system call during interrupt processing in Figure 6.
This figure shows the processing of the operating system when SYS1 is for sending a message to the operating system. In processing, the operating system receives the message once, and if there is a task waiting for a message, sends the message. Thereafter, the state of the interrupt determination section is detected, and if no interruption is occurring, a transition of the task state is caused, but if no interruption is occurring, control is passed to the event suspension control section 6. The event suspension control unit 6 writes the type of event into the suspension information register 5 according to the type of event. Since the type of event is only memorized and no processing is performed, it is possible to immediately proceed to the execution of process 3 in FIG. 6 without causing a transition of the task state. FIG. 3 shows the processing of the system call RETI for returning from an interrupt. In the RETI process, the contents of the pending information register 5 shown in FIG. 1 are determined, and if there is no pending information, the interrupt determining section 4 is cleared and a return process from the normal interrupt processing routine is performed. If there is pending information, processing is performed according to the contents of the pending information register 5 to cause a task state transition, and one of the tasks in the executable state is selected and brought into the running state. Thereafter, after clearing the interrupt determination section 4, the process returns from the interrupt processing. Therefore, the task state changes only when a system call is executed to return from interrupt processing, and control is transferred to task B, which executes process 4, as shown in FIG.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明は、割込中であるか
否かを識別する手段と、事象の発生を保留するた
めの手段をハードウエアで実現することにより、
割込処理を割込時点のタスクの状態を意識せず記
述することができ、しかも状態遷移を起こすか否
かを意識することなくシステムコールを割込処理
の中で記述することが可能でアプリケーシヨンプ
ログラムの組み安さは格段と向上する。また簡単
なハードウエアで実現することが可能でマイクロ
コンピユータなどLSI化に際しても十分対応がと
れる。またオペレーテイングシステムの設計が本
発明の機構を利用することで簡単になり、従来ソ
フト処理だけに頼つた場合の処理の複雑さやアプ
リケーシヨンプログラムへの負担などから生じる
信頼性の低下を回避することが可能となる。
As explained above, the present invention uses hardware to realize means for identifying whether or not an interrupt is occurring, and means for suspending the occurrence of an event.
Interrupt processing can be written without being aware of the state of the task at the time of the interrupt, and system calls can be written within interrupt processing without being aware of whether or not a state transition will occur. The installation cost of the Yong program will be significantly improved. Furthermore, it can be realized with simple hardware and is fully compatible with LSI applications such as microcomputers. In addition, the design of an operating system is simplified by using the mechanism of the present invention, and the reduction in reliability caused by the complexity of processing and the burden on application programs that would otherwise occur when relying only on software processing can be avoided. becomes possible.

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

第1図は本発明の一実施例でハードウエア構成
のブロツク図である。 1……割込制御部、2……システムコール判定
部、3……システムコール実行部、4……割込判
定部、5……保留情報レジスタ、6……事象保留
制御部、 第2図はメツセージ送信のシステムコール処理
フロー図である。第3図は割込からの復帰システ
ムコール処理フロー図である。第4図はタスク状
態遷移図、第5図は従来例における割込処理とシ
ステムコールの関係を示した図、第6図は本実施
例における割込処理とシステムコールの関係を示
した図である。
FIG. 1 is a block diagram of a hardware configuration according to an embodiment of the present invention. DESCRIPTION OF SYMBOLS 1... Interrupt control unit, 2... System call determination unit, 3... System call execution unit, 4... Interrupt determination unit, 5... Pending information register, 6... Event pending control unit, FIG. is a system call processing flow diagram for message transmission. FIG. 3 is a flowchart of a system call process for returning from an interrupt. FIG. 4 is a task state transition diagram, FIG. 5 is a diagram showing the relationship between interrupt processing and system calls in the conventional example, and FIG. 6 is a diagram showing the relationship between interrupt processing and system calls in the present embodiment. be.

Claims (1)

【特許請求の範囲】[Claims] 1 時分割にタスクを割り当てて処理を行うマル
チタスキング方式の情報処理装置において、前記
タスクからのオペレーテイングシステムに対する
処理要求であるシステムコールを実行するシステ
ムコール実行部と、前記システムコール実行部が
タスク処理中か割込処理中かを判定する割込判定
部と、割込処理中に発行されたシステムコールを
処理する場合に前記割込判定部を参照することで
割込処理中であることを判定し、前記システムコ
ールの情報を保留する保留情報レジスタと、前記
システムコール実行部から起動を受けて前記保留
情報レジスタへの書き込みを行う事象保留制御部
とから構成され前記割込判定部と、前記情報レジ
スタと、前記事象保留制御部とを前記システムコ
ール実行部とは独立に設け、割込処理の終了を告
げるオペレーテイングシステムへの処理要求の実
行で前記保留情報レジスタを判定し、前記保留情
報レジスタに保留された情報に応じた処理を行う
ことを特徴とする情報処理装置。
1. In a multitasking type information processing device that allocates tasks in a time-sharing manner to perform processing, the system call execution unit executes a system call that is a processing request to an operating system from the task, and the system call execution unit An interrupt determination unit that determines whether a task is being processed or an interrupt is being processed, and when processing a system call issued during interrupt processing, the interrupt determination unit can be referenced to determine whether the interrupt is being processed. and an event suspension control section that receives activation from the system call execution section and writes to the suspension information register, and the interrupt determination section and , the information register and the event suspension control section are provided independently of the system call execution section, and the suspension information register is determined by executing a processing request to an operating system indicating the end of interrupt processing; An information processing device that performs processing according to information held in the pending information register.
JP13237485A 1985-06-18 1985-06-18 Information processor Granted JPS61289433A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13237485A JPS61289433A (en) 1985-06-18 1985-06-18 Information processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP13237485A JPS61289433A (en) 1985-06-18 1985-06-18 Information processor

Publications (2)

Publication Number Publication Date
JPS61289433A JPS61289433A (en) 1986-12-19
JPH0556539B2 true JPH0556539B2 (en) 1993-08-19

Family

ID=15079876

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13237485A Granted JPS61289433A (en) 1985-06-18 1985-06-18 Information processor

Country Status (1)

Country Link
JP (1) JPS61289433A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6414638A (en) * 1987-07-08 1989-01-18 Nec Corp Information processor
JP2508292B2 (en) * 1989-09-14 1996-06-19 日本電気株式会社 Exception handling method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS4990463A (en) * 1972-12-28 1974-08-29
JPS51138356A (en) * 1975-05-26 1976-11-29 Mitsubishi Electric Corp Priority interruption control circuit
JPS59163647A (en) * 1983-03-09 1984-09-14 Hitachi Ltd Task control method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS4990463A (en) * 1972-12-28 1974-08-29
JPS51138356A (en) * 1975-05-26 1976-11-29 Mitsubishi Electric Corp Priority interruption control circuit
JPS59163647A (en) * 1983-03-09 1984-09-14 Hitachi Ltd Task control method

Also Published As

Publication number Publication date
JPS61289433A (en) 1986-12-19

Similar Documents

Publication Publication Date Title
KR930000592B1 (en) Task searching apparatus
EP0359384B1 (en) Queued posted-write disk write method and apparatus with improved error handling
US5161226A (en) Microprocessor inverse processor state usage
US5390329A (en) Responding to service requests using minimal system-side context in a multiprocessor environment
US5666523A (en) Method and system for distributing asynchronous input from a system input queue to reduce context switches
US20060090104A1 (en) Adapting RCU for real-time operating system usage
KR19990044957A (en) Methods and apparatus that affect the processing of subsequent instructions in a data processor
EP1836569B1 (en) Interrupt control function adapted to control the execution of interrupt requests of differing criticality
JPS6252655A (en) Common interrupt system
JPH02171934A (en) Virtual machine system
JP3970609B2 (en) Processor system
JPS63310051A (en) Method and apparatus for executing input/output process containing program input/output instruction
JPS62184544A (en) Virtual computer system
JP3417463B2 (en) Method and system for handling interrupt requests
JPH0556539B2 (en)
JP2636722B2 (en) Multitask execution management method
JPH09160790A (en) Device and method for task schedule
JPH0668725B2 (en) Device for responding to interrupt condition in data processing system and method for responding to asynchronous interrupt condition
US6477636B1 (en) Application-specific integrated circuit for processing defined sequences of assembler instructions
CN110955507B (en) Method for multitask access to same IIC bus based on vxWorks system
JP3184380B2 (en) Interrupt control method and multitask system for implementing the same
JPH0451329A (en) Context switching device
JPS60263238A (en) Information processor
JPS63118949A (en) Information processor
JPH0219494B2 (en)

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees