[go: up one dir, main page]

JPH10105415A - Real time os - Google Patents

Real time os

Info

Publication number
JPH10105415A
JPH10105415A JP25287696A JP25287696A JPH10105415A JP H10105415 A JPH10105415 A JP H10105415A JP 25287696 A JP25287696 A JP 25287696A JP 25287696 A JP25287696 A JP 25287696A JP H10105415 A JPH10105415 A JP H10105415A
Authority
JP
Japan
Prior art keywords
task
control block
time
real
tasks
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
JP25287696A
Other languages
Japanese (ja)
Inventor
Yasuhiro Inoue
康博 井ノ上
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.)
NIPPON DENKI MICOM TECHNOL KK
Original Assignee
NIPPON DENKI MICOM TECHNOL KK
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 DENKI MICOM TECHNOL KK filed Critical NIPPON DENKI MICOM TECHNOL KK
Priority to JP25287696A priority Critical patent/JPH10105415A/en
Publication of JPH10105415A publication Critical patent/JPH10105415A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To improve the reutilizing property of a task (program) by sharing a stack area with TCB between the tasks which are not simultaneously operated at the time of using a real time OS, reducing the capacitance of RAM to be used and also dividing the task into the operation units of a system. SOLUTION: The plural tasks 1 which are not simultaneously used within the tasks are made into a group, the plural tasks which are not simultaneously used share a task control block and the stack area 2, the usage of the stack area is exclusively controlled and memory capacity (RAM) 10 to be used is reduced. Actually, queuing is executed in the task control block waiting task queue of the task by the start system call of the task, the task control block is opened whenever the task using the task control block finishes execution and the queued task is executed.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、リアルタイムOS
に関し、特に、組込用途のマイクロコンピュータの省メ
モリ組込型リアルタイムOSに関する。
[0001] The present invention relates to a real-time OS.
In particular, the present invention relates to a memory-saving embedded real-time OS of an embedded microcomputer.

【0002】[0002]

【従来の技術】従来のリアルタイムOSでは、個々のタ
スクを管理するためにタスク制御ブロック(TCB)を
使用している。このTCBは、タスク1個につき、1個
必要で、システム起動時に静的に生成される。このTC
Bには、タスクの動作に必要な情報が格納されており、
OSはTCBを参照することでタスクの状態やその他の
各種情報を知ることができる。TCB内の情報を変更す
るには、OSのシステムコールを使用して、OSがその
内容を変更する。ユーザが直接操作することはできな
い。また、タスク固有のメモリ空間はそのタスクのスタ
ック領域として、システム起動時に静的に生成される。
つまり、リアルタイムOSを使用したシステムでは、以
下のRAMが必要となる。
2. Description of the Related Art A conventional real-time OS uses a task control block (TCB) to manage individual tasks. One TCB is required for each task, and is generated statically when the system is started. This TC
B stores information necessary for the operation of the task.
The OS can know the status of the task and other various information by referring to the TCB. To change information in the TCB, the OS changes the contents using a system call of the OS. The user cannot operate it directly. A task-specific memory space is statically created at system startup as a stack area for the task.
In other words, a system using a real-time OS requires the following RAM.

【0003】タスク数×TCBサイズ+Σタスクnのス
タックサイズ+タスク以外に必要なメモリ。
The number of tasks × TCB size + Σstack size of task n + memory required other than tasks.

【0004】図18〜図21に、従来のリアルタイムO
Sの動作例を示す。図18は、システムが起動した直後
の状態である。タスク1がRUN状態になり、その他の
タスクはドルマント状態である。その後、タスク1はタ
スク2を起動し、タスク2のプライオリティがタスク1
のプライオリティよりも高いので、タスク2がRUN状
態になり、タスク1はレディ状態となる(図19)。タ
スク2が処理を終了すると、再びタスク1がRUN状態
となる(図20)。その後、タスク1がタスク3を起動
すると、タスク3のプライオリティがタスク1のプライ
オリティよりも高いので、タスク3がRUN状態にな
り、タスク1はレディ状態となる(図21)。
FIGS. 18 to 21 show a conventional real-time O / O.
An operation example of S will be described. FIG. 18 shows a state immediately after the system is started. Task 1 is in the RUN state, and the other tasks are in the dormant state. After that, task 1 activates task 2 and the priority of task 2 becomes task 1
, The task 2 enters the RUN state, and the task 1 enters the ready state (FIG. 19). When the task 2 completes the processing, the task 1 enters the RUN state again (FIG. 20). Thereafter, when task 1 activates task 3, task 3 enters the RUN state and task 1 enters the ready state because the priority of task 3 is higher than the priority of task 1 (FIG. 21).

【0005】[0005]

【発明が解決しようとする課題】上述した従来のリアル
タイムOSでは、すべてのタスクのためのTCBとスタ
ック領域を静的に確保し、同時に動作しないタスクのた
めのメモリ空間が別々に存在する。従って、静的に生成
するタスク1個につき、1組のTCBとスタック領域が
必要になり、多くのタスクを生成すると、多くのメモリ
(RAM)を必要とするという問題を有している。
In the above-described conventional real-time OS, the TCB and the stack area for all tasks are statically secured, and there are separate memory spaces for tasks that do not operate at the same time. Therefore, one set of TCB and a stack area are required for each task generated statically, and there is a problem that generating many tasks requires a large amount of memory (RAM).

【0006】また、リアルタイムOSのタスク分割にお
いて、各タスクをシステム中の1個の動作を基準に分割
して定義すると、タスクの数が多くなり、使用するRA
Mの容量が増える。一方、RAMの使用量を低減するた
めにタスクの数を少なくするには、いくつかの動作を1
個のタスクにまとめることになるが、タスクの内容が複
雑になり、他のシステムへの流用が困難になるという問
題を有している。
Further, in the task division of the real-time OS, if each task is divided and defined based on one operation in the system, the number of tasks increases, and the RA to be used increases.
The capacity of M increases. On the other hand, in order to reduce the number of tasks in order to reduce the amount of RAM used, some operations are performed in one operation.
Although the tasks are grouped into individual tasks, there is a problem that the contents of the tasks become complicated, and it is difficult to divert them to other systems.

【0007】従って、本発明の目的は、リアルタイムO
Sを使用する際に同時に動作しないタスクでTCBとス
タック領域を共有して使用するRAM容量を低減し、か
つ、タスクをシステムの動作単位に分割することによ
り、タスク(プログラム)の再利用性を向上させること
のできるリアルタイムOSを提供することにある。
Accordingly, an object of the present invention is to provide a real-time O
By reducing the amount of RAM used by sharing the stack area with the TCB for tasks that do not operate at the same time when using S, and by dividing the tasks into system operation units, the reusability of the tasks (programs) is improved. It is to provide a real-time OS that can be improved.

【0008】[0008]

【課題を解決するための手段】本発明は、タスクの動作
に必要な情報が格納されるタスク制御ブロック(TC
B)を参照することによって、タスクの状態およびその
他の各種情報を制御するリアルタイムOSにおいて、タ
スクのうち、複数の同時に使用しないタスクをグループ
化し、グループ化されたタスク内で、複数の同時に使用
しないタスクがタスク制御ブロックとスタック領域とを
共有し、スタック領域の使用を排他的に制御し、使用す
るメモリ容量(RAM)を低減することを特徴とするリ
アルタイムOSである。
According to the present invention, there is provided a task control block (TC) in which information necessary for the operation of a task is stored.
In the real-time OS controlling the task status and other various information by referring to B), a plurality of non-simultaneous tasks among the tasks are grouped, and a plurality of non-simultaneous tasks are not used in the grouped tasks. A real-time OS is characterized in that a task shares a stack area with a task control block, exclusively controls use of the stack area, and reduces a memory capacity (RAM) used.

【0009】また、タスクの起動システムコールによ
り、タスクのタスク制御ブロック待ちタスク行列(TC
B待ちタスクキュー)にキューイングし、タスク制御ブ
ロックを使用しているタスクが実行を終了する毎にタス
ク制御ブロックを開放し、タスク制御ブロック待ちキュ
ーにキューイングされた(TCB待ち状態)タスクが実
行されると好ましい。
In addition, a task control block waiting task queue (TC
B task queue), releases the task control block each time the task using the task control block finishes execution, and the task queued in the task control block waiting queue (TCB waiting state) Preferably, it is performed.

【0010】さらに、タスクのタスク制御ブロック待ち
キューが、先入れ先出し法(FIFO)で処理されると
好ましい。
[0010] Furthermore, the task control block wait queue of the task is preferably processed on a first-in first-out (FIFO) basis.

【0011】またさらに、タスクのタスク制御ブロック
待ちキューがプライオリチィ順で処理されると好まし
い。
Still preferably, the task control block wait queue of the task is processed in priority order.

【0012】また、タスク制御ブロックの他に副タスク
制御ブロックを有すると良い。
It is preferable that a sub-task control block is provided in addition to the task control block.

【0013】さらに、この副タスク制御ブロックが、タ
スク1個につき1個用意されると良い。
Further, it is preferable that one subtask control block is prepared for each task.

【0014】またさらに、この副タスク制御ブロックが
タスク本体を管理し、タスク制御ブロックがタスクの動
作を管理すると良い。
Further, it is preferable that the sub-task control block manages the task body, and the task control block manages the operation of the task.

【0015】本発明は、特に、複数の同時に動作しない
タスクをグループ化し、そのグループ内のタスクが1組
のTCBとスタック領域を利用する。
In particular, the present invention groups a plurality of non-simultaneous tasks, and the tasks in the group utilize a set of TCBs and a stack area.

【0016】複数の同時に動作しないタスクが1組のT
CBとスタック領域を使用することにより、システム中
のメモリ(RAM)を有効に利用できる。
A plurality of non-simultaneous tasks are a set of T
By using the CB and the stack area, the memory (RAM) in the system can be used effectively.

【0017】また、その結果RAMの使用量を増加させ
ることなくタスク分割することが可能になるので、作成
したタスク(プログラム)の再利用性を向上させること
ができる。
Further, as a result, the task can be divided without increasing the use amount of the RAM, so that the reusability of the created task (program) can be improved.

【0018】[0018]

【発明の実施の形態】本発明の実施例について図面を参
照して詳細に説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Embodiments of the present invention will be described in detail with reference to the drawings.

【0019】図1〜図6は、本発明の第1の実施例を示
す図である。本発明のリアルタイムOSの動作時のTC
Bとスタック領域の使用状況を示す。ここでは、タスク
1,タスク2,タスク3の3つのタスクが存在し、タス
ク2とタスク3が同時に動作しないタスクである。した
がって、タスク2およびタスク3がグループ化されてい
る。
FIGS. 1 to 6 show a first embodiment of the present invention. TC during operation of the real-time OS of the present invention
B shows the usage status of the stack area. Here, there are three tasks of task 1, task 2, and task 3, and task 2 and task 3 do not operate at the same time. Therefore, task 2 and task 3 are grouped.

【0020】図1は、システムが起動した直後の状態で
ある。符号10はRAM,符号20はROMを示してい
る。図1では、タスク1がRUN状態になり、その他の
タスクはドルマント(DORMANT)状態である。
FIG. 1 shows a state immediately after the system is started. Reference numeral 10 denotes a RAM, and reference numeral 20 denotes a ROM. In FIG. 1, task 1 is in the RUN state, and other tasks are in the dormant (DORMANT) state.

【0021】その後、タスク1はタスク2を起動する。
タスク2の使用するTCBは、タスク初期化情報からT
CB2であるとわかる。TCB2は現在使用されていな
いので、タスク2はTCB2を獲得して起動処理が行わ
れる。タスク2のプライオリティがタスク1のプライオ
リティよりも低いので、タスク1がRUN状態のまま
で、タスク2はレディ(READY)状態となる(図
2)。
Thereafter, task 1 starts task 2.
The TCB used by task 2 is T
It turns out that it is CB2. Since TCB2 is not currently used, task 2 acquires TCB2 and performs startup processing. Since the priority of task 2 is lower than the priority of task 1, task 1 remains in the RUN state and task 2 enters the ready state (FIG. 2).

【0022】続いて、タスク1がタスク3を起動するシ
ステムコールを発行する。タスク2の場合と同様に、タ
スク初期化情報から、タスク3が使用するTCBもTC
B2である。しかし、タスク3が使用するTCB2は、
タスク2が使用しているので、システムコールには“T
CBが使用中である”というエラーが返る(図3)。
Subsequently, the task 1 issues a system call for activating the task 3. As in the case of the task 2, the TCB used by the task 3 is also determined by the TC from the task initialization information.
B2. However, TCB2 used by task 3 is
Since task 2 is using it, the system call contains "T
The error "CB is in use" is returned (FIG. 3).

【0023】次に、タスク1のプライオリティを下げて
タスク2をRUN状態にし、タスク2が実行され、処理
を終了すると、タスク2はTCB2を解放する(図
4)。
Next, the priority of the task 1 is lowered, the task 2 is set to the RUN state, the task 2 is executed, and when the processing is completed, the task 2 releases the TCB 2 (FIG. 4).

【0024】タスク2が処理を終了すると、再びタスク
1がRUN状態となり、再度タスク3を起動するシステ
ムコールを発行する(図5)。
When the task 2 completes the processing, the task 1 is again in the RUN state, and issues a system call to activate the task 3 again (FIG. 5).

【0025】今回は、タスク3の使用するTCB2は使
用されていないので、タスク3がTCB2を獲得して、
RUN状態となる(図6)。
This time, since TCB2 used by task 3 is not used, task 3 acquires TCB2 and
The RUN state is set (FIG. 6).

【0026】TCB2を使用するタスクグループのう
ち、動作するタスクは1個だけなので、タスクのスタッ
ク領域はタスクごとに存在する必要はなく、タスクグル
ープに1個、つまり、TCBごとに1個存在すればよ
い。
In the task group using TCB2, since only one task is operated, the stack area of the task does not need to exist for each task. One stack area exists for each task group, that is, one task area exists for each TCB. I just need.

【0027】第1の実施例では、タスクを起動するシス
テムコールを発行して、そのタスクが使用するTCBが
他のタスクに使用されていると、エラーが返り、そのT
CBが開放されてから再度タスクを起動するシステムコ
ールを発行する必要がある。
In the first embodiment, a system call for activating a task is issued, and if the TCB used by the task is used by another task, an error is returned and the TCB is used.
It is necessary to issue a system call to start the task again after the CB is released.

【0028】図7〜図11は、本発明の第2の実施例を
示す。第2の実施例では、タスクの起動要求をキューイ
ングする方式を示す。ここでは、タスク1〜タスク5の
5つのタスクが存在し、タスク2〜タスク5が同時に動
作しないタスクである。したがって、タスク2へタスク
5がグループ化されている。本実施例のリアルタイムO
Sでは、TCBの他に副タスク制御ブロック(以下Su
bTCB)という制御ブロックを導入する。このSub
TCBは、タスク1個につき1個用意される。つまり、
従来のリアルタイムOSでは、TCBがタスクのすべて
を管理していたのに対し、本実施例のリアルタイムOS
ではTCBがタスクの動作を管理し、SubTCBがタ
スク本体(プログラム)を管理することになる。
FIGS. 7 to 11 show a second embodiment of the present invention. In the second embodiment, a method for queuing a task activation request will be described. Here, there are five tasks, task 1 to task 5, and task 2 to task 5 do not operate at the same time. Therefore, task 5 is grouped into task 2. Real-time O of this embodiment
In S, in addition to the TCB, a subtask control block (hereinafter referred to as Su)
bTCB) is introduced. This Sub
One TCB is prepared for each task. That is,
In the conventional real-time OS, the TCB manages all of the tasks.
Then, the TCB manages the operation of the task, and the SubTCB manages the task body (program).

【0029】図7は、システムが起動した直後の状態で
ある。タスク1が RUN状態になり、その他のタスク
はドルマント状態である。その後、タスク1はタスク2
を起動する。タスク2の使用するTCBは、タスク2の
タスク初期化情報からTCB2であるとわかる。TCB
2は現在使用されていないので、タスク2はTCB2を
獲得して起動処理が行われる。タスク2のプライオリテ
ィがタスク1のプライオリティよりも低いので、タスク
1がRUN状態のままで、タスク2はレディ状態となる
(図8)。
FIG. 7 shows a state immediately after the system is started. Task 1 is in the RUN state, and the other tasks are in the dormant state. Then task 1 becomes task 2
Start The TCB used by task 2 is found to be TCB2 from the task initialization information of task 2. TCB
Since task 2 is not used at present, task 2 acquires TCB2 and starts up. Since the priority of task 2 is lower than the priority of task 1, task 2 remains in the RUN state and task 2 is in the ready state (FIG. 8).

【0030】続いて、タスク1がタスク3を起動するシ
ステムコールを発行する。タスク2の場合と同様に、タ
スク3のタスク初期化情報から、タスク3が使用するT
CBもTCB2である。しかし、タスク3が使用するT
CB2は、タスク2が使用しているので、タスク3のS
ubTCBはTCB2の待ちタスクキュー(TCB待ち
タスクキュー)にリンクされる(図9)。
Subsequently, the task 1 issues a system call for activating the task 3. As in the case of task 2, the task initialization information of task 3
CB is also TCB2. However, the T used by task 3
Since CB2 is used by task 2, S3 of task 3
ubTCB is linked to the waiting task queue of TCB2 (TCB waiting task queue) (FIG. 9).

【0031】さらに、タスク4,タスク5も起動され、
同じくTCB2のTCB待ちタスクキューにリンクされ
る。この時のタスク3,タスク4,タスク5の状態を
“TCB待ち状態”と呼ぶ(図10)。
Further, tasks 4 and 5 are also started,
It is also linked to the TCB waiting task queue of TCB2. The state of task 3, task 4, and task 5 at this time is called "TCB waiting state" (FIG. 10).

【0032】次に、タスク1のプライオリティを下げて
タスク2をRUN状態にし、タスク2が実行され、処理
を終了すると、タスク2はTCB2を解放し、OSは、
TCB待ちキューの先頭にリンクされたSubTCBの
タスクにTCBを割り当ててスケジューリングを行う。
タスク3の初期プライオリティがタスク1のプライオリ
ティより高ければ、タスク3がRUN状態となり、タス
ク1はレディ状態となる。タスク4,タスク5はTCB
待ち状態のままである(図11)。
Next, the priority of the task 1 is lowered, the task 2 is set to the RUN state, the task 2 is executed, and when the processing is completed, the task 2 releases the TCB 2 and the OS
The TCB is allocated to the task of the SubTCB linked to the head of the TCB waiting queue, and scheduling is performed.
If the initial priority of task 3 is higher than the priority of task 1, task 3 is in the RUN state and task 1 is in the ready state. Task 4 and task 5 are TCB
It remains in the waiting state (FIG. 11).

【0033】以後、TCB2を使用しているタスクが終
了する毎に、TCB2が解放され、TCB2に対してT
CB待ち状態のタスクが順次レディ状態またはRUN状
態に遷移する。
Thereafter, every time the task using TCB2 is completed, TCB2 is released and TCB2 is released to TCB2.
The tasks in the CB waiting state sequentially transition to the ready state or the RUN state.

【0034】第2の実施例では、TCB待ちのタスクは
起動要求があった順に起動されるが、第3の実施例で
は、TCB待ちのタスクの起動順序をそのタスクが持つ
プライオリティの高い順に変更する。
In the second embodiment, the tasks waiting for TCB are activated in the order in which the activation requests are issued. In the third embodiment, the activation order of tasks waiting for TCB is changed in the order of higher priority of the task. I do.

【0035】図12〜図17に第3の実施例のTCBお
よびスタック領域の使用状況を示す。ここでは、タスク
1〜タスク5の5つのタスクが存在し、タスク2〜タス
ク5が同時に動作しないタスクである。したがって、タ
スク2〜タスク5がグループ化されている。本実施例の
リアルタイムOSでは、第2の実施例と同様に、TCB
の他に副タスク制御ブロック(以下SubTCB)とい
う制御ブロックを導入し、第の実施例ではTCBにあっ
たタスクのプライオリティ情報をSubTCBに移動す
る。
FIGS. 12 to 17 show the usage status of the TCB and the stack area according to the third embodiment. Here, there are five tasks, task 1 to task 5, and task 2 to task 5 do not operate at the same time. Therefore, tasks 2 to 5 are grouped. In the real-time OS according to the present embodiment, as in the second embodiment, the TCB
In addition, a control block called a sub-task control block (hereinafter referred to as SubTCB) is introduced, and in the present embodiment, the priority information of the task that has been in the TCB is moved to the SubTCB.

【0036】図12は、システムが起動した直後の状態
である。タスク1がRUN状態になり、その他のタスク
はドルマント状態である。
FIG. 12 shows a state immediately after the system is started. Task 1 is in the RUN state, and the other tasks are in the dormant state.

【0037】その後、タスク1はタスク2を起動する。
タスク2の使用するTCBは、タスク2のタスク初期化
情報からTCB2であるとわかる。TCB2は現在使用
されていないので、タスク2はTCB2を獲得して起動
処理が行われる。タスク2のプライオリティがタスク1
のプライオリティよりも低いので、タスク1がRUN状
態のままで、タスク2はレディ状態となる(図13)。
Thereafter, task 1 activates task 2.
The TCB used by task 2 is found to be TCB2 from the task initialization information of task 2. Since TCB2 is not currently used, task 2 acquires TCB2 and performs startup processing. Task 2 priority is Task 1
, The task 2 remains in the RUN state and the task 2 enters the ready state (FIG. 13).

【0038】続いて、タスク1がタスク3を起動するシ
ステムコールを発行する。タスク2の場合と同様に、タ
スク3のタスク初期化情報から、タスク3が使用するT
CBもTCB2である。しかし、タスク3が使用するT
CB2は、タスク2が使用しているので、タスク3のS
ubTCBはTCB2の待ちキューにリンクされる(図
14)。
Subsequently, the task 1 issues a system call for activating the task 3. As in the case of task 2, the task initialization information of task 3
CB is also TCB2. However, the T used by task 3
Since CB2 is used by task 2, S3 of task 3
ubTCB is linked to the wait queue of TCB2 (FIG. 14).

【0039】タスク3は、タスク2よりプライオリティ
が高いが、現在実行中またはレディ状態のタスクをTC
B待ち状態にすると、スタック内の情報が失われてしま
うので、タスク2をTCB待ちにして、タスク3をレデ
ィにすることはしない。
The task 3 has a higher priority than the task 2, but the task that is currently being executed or is ready
Since the information in the stack is lost in the B wait state, the task 2 is not placed in the TCB wait state and the task 3 is not made ready.

【0040】さらに、タスク1がタスク4を起動する。
タスク4はタスク3よりもプライオリティが高いので、
TCB2の待ちタスクキューのタスク3の前にリンクさ
れる。つづいてタスク5も起動され、タスク5はタスク
4と同じプライオリティであるので、TCB2の待ちタ
スクキューのタスク4の後ろにリンクされる。これは、
同一プライオリティのタスクでは、ファースト・カム・
ファースト・サービス(First Come Fir
stService;FCFS)処理に従っているため
である(図15)。
Further, task 1 activates task 4.
Because task 4 has a higher priority than task 3,
It is linked before task 3 in the waiting task queue of TCB2. Subsequently, the task 5 is also activated. Since the task 5 has the same priority as the task 4, the task 5 is linked behind the task 4 in the waiting task queue of the TCB2. this is,
For tasks of the same priority, first come
First Service (First Come Fir)
stService (FCFS) processing (FIG. 15).

【0041】次に、タスク1がタスク3のプライオリテ
ィをタスク4のプライオリティよりも高くするシステム
コールを発行すると、TCB2の待ちタスクキューは変
更される(図16)。
Next, when the task 1 issues a system call for setting the priority of the task 3 higher than the priority of the task 4, the waiting task queue of the TCB 2 is changed (FIG. 16).

【0042】その後、タスク1のプライオリティを下げ
てタスク2をRUN状態にし、タスク2が実行され、処
理を終了すると、タスク2はTCB2を解放し、OS
は、TC3待ちキューの先頭にリンクされたSubTC
BのタスクにTCBを割り当ててスケジューリングを行
う。タスク3のその時点でのプライオリティがタスク1
のプライオリティより高ければ、タスク3がRUN状態
となり、タスク1はレディ状態となる。タスク4,タス
ク5はTCB待ち状態のままである(図17)。
After that, the priority of the task 1 is lowered, the task 2 is set to the RUN state, the task 2 is executed, and when the processing is completed, the task 2 releases the TCB 2 and the OS 2
Is the SubTC linked to the head of the TC3 wait queue.
The TCB is assigned to the task B and scheduling is performed. The priority of task 3 at that time is task 1.
, The task 3 is in the RUN state and the task 1 is in the ready state. Task 4 and task 5 remain in the TCB waiting state (FIG. 17).

【0043】以後、TCB2を使用しているタスクが終
了する毎に、TCB2が解放され、TCB2に対してT
CB待ち状態のタスクが順次レディ状態またはRUN状
態に遷移する。
Thereafter, every time the task using TCB2 is completed, TCB2 is released and TCB2 is released to TCB2.
The tasks in the CB waiting state sequentially transition to the ready state or the RUN state.

【0044】[0044]

【発明の効果】本発明によると、同時に動作しないタス
クでTCBとスタック領域を共有することによりRAM
の利用効率が向上する。従って、複数のタスクでTCB
とスタック領域を共有することにより、使用するメモリ
(RAM)を低減することができるという効果を奏す
る。
According to the present invention, by sharing the stack area with the TCB for tasks that do not operate at the same time,
Use efficiency is improved. Therefore, TCB in multiple tasks
By sharing the stack area with the memory, it is possible to reduce the number of memories (RAM) used.

【0045】また、本発明によると、使用するRAM容
量を増加させることなく、システムの動作にあわせたタ
スク分割をすることにより、タスクの再利用が容易にな
るという効果も奏する。
Further, according to the present invention, the task can be divided according to the operation of the system without increasing the RAM capacity to be used, so that the task can be easily reused.

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

【図1】本発明の第1の実施例のリアルタイムOS起動
時のメモリマップを示すブロック図である。
FIG. 1 is a block diagram showing a memory map when a real-time OS is started according to a first embodiment of the present invention.

【図2】第1の実施例のリアルタイムOS起動後の状態
を示すブロック図である。
FIG. 2 is a block diagram illustrating a state after a real-time OS is started according to the first embodiment;

【図3】第1の実施例のリアルタイムOS起動後の状態
を示すブロック図である。
FIG. 3 is a block diagram illustrating a state after a real-time OS is started according to the first embodiment.

【図4】第1の実施例のリアルタイムOS起動後の状態
を示すブロック図である。
FIG. 4 is a block diagram illustrating a state after the real-time OS is started according to the first embodiment.

【図5】第1の実施例のリアルタイムOS起動後の状態
を示すブロック図である。
FIG. 5 is a block diagram illustrating a state after the real-time OS is started according to the first embodiment.

【図6】第1の実施例のリアルタイムOS起動後の状態
を示すブロック図である。
FIG. 6 is a block diagram illustrating a state after the real-time OS is started according to the first embodiment.

【図7】本発明の第2の実施例のリアルタイムOS起動
時のメモリマップを示すブロック図である。
FIG. 7 is a block diagram illustrating a memory map when a real-time OS is started according to a second embodiment of this invention.

【図8】第2の実施例のリアルタイムOS起動後の状態
を示すブロック図である。
FIG. 8 is a block diagram illustrating a state after the real-time OS is started according to the second embodiment.

【図9】第2の実施例のリアルタイムOS起動後の状態
を示すブロック図である。
FIG. 9 is a block diagram illustrating a state after activation of a real-time OS according to the second embodiment.

【図10】第2の実施例のリアルタイムOS起動後の状
態を示すブロック図である。
FIG. 10 is a block diagram illustrating a state after the real-time OS is started according to the second embodiment.

【図11】第2の実施例のリアルタイムOS起動後の状
態を示すブロック図である。
FIG. 11 is a block diagram illustrating a state after the real-time OS is started according to the second embodiment.

【図12】本発明の第3の実施例のリアルタイムOS起
動時のメモリマップを示すブロック図である。
FIG. 12 is a block diagram showing a memory map when a real-time OS is started according to a third embodiment of the present invention.

【図13】第3の実施例のリアルタイムOS起動後の状
態を示すブロック図である。
FIG. 13 is a block diagram illustrating a state after the real-time OS is started according to the third embodiment.

【図14】第3の実施例のリアルタイムOS起動後の状
態を示すブロック図である。
FIG. 14 is a block diagram illustrating a state after activation of a real-time OS according to the third embodiment.

【図15】第3の実施例のリアルタイムOS起動後の状
態を示すブロック図である。
FIG. 15 is a block diagram illustrating a state after activation of a real-time OS according to the third embodiment.

【図16】第3の実施例のリアルタイムOS起動後の状
態を示すブロック図である。
FIG. 16 is a block diagram illustrating a state after the real-time OS is started according to the third embodiment.

【図17】第3の実施例のリアルタイムOS起動後の状
態を示すブロック図である。
FIG. 17 is a block diagram showing a state after the real-time OS is started according to the third embodiment.

【図18】従来のリアルタイムOS起動時のメモリマッ
プを示すブロック図である。
FIG. 18 is a block diagram showing a memory map when a conventional real-time OS is started.

【図19】従来のリアルタイムOS起動後のメモリマッ
プを示すブロック図である。
FIG. 19 is a block diagram showing a memory map after a conventional real-time OS is started.

【図20】従来のリアルタイムOS起動後のメモリマッ
プを示すブロック図である。
FIG. 20 is a block diagram showing a memory map after a conventional real-time OS is started.

【図21】従来のリアルタイムOS起動後のメモリマッ
プを示すブロック図である。
FIG. 21 is a block diagram showing a memory map after a conventional real-time OS is started.

【符号の説明】[Explanation of symbols]

10 RAM 20 ROM 10 RAM 20 ROM

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】タスクの動作に必要な情報が格納されるタ
スク制御ブロックを参照することによって、前記タスク
の状態およびその他の各種情報を制御するリアルタイム
OSにおいて、 前記タスクのうち、複数の同時に使用しないタスクをグ
ループ化し、グループ化されたタスク内で、前記複数の
同時に使用しないタスクが前記タスク制御ブロックとス
タック領域とを共有し、前記スタック領域の使用を排他
的に制御し、使用するメモリ容量(RAM)を低減する
ことを特徴とするリアルタイムOS。
1. A real-time OS for controlling a state of a task and various other information by referring to a task control block in which information necessary for the operation of the task is stored. Grouping tasks that are not to be used, and within the grouped tasks, the plurality of tasks that are not used at the same time share the stack area with the task control block, exclusively control use of the stack area, and use the memory capacity. A real-time OS characterized by reducing (RAM).
【請求項2】前記タスクの起動システムコールにより、
前記タスクのタスク制御ブロック待ちタスクキューにキ
ューイングし、前記タスク制御ブロックを使用している
タスクが実行を終了する毎に前記タスク制御ブロックを
開放し、前記タスク制御ブロック待ちキューにキューイ
ングされたタスクが実行されることを特徴とする、請求
項1に記載のリアルタイムOS。
2. The system according to claim 1, wherein said task activation system call comprises:
The task is queued in a task control block waiting task queue, the task control block is released each time a task using the task control block finishes executing, and the task is queued in the task control block waiting queue. The real-time OS according to claim 1, wherein the task is executed.
【請求項3】前記タスクの前記タスク制御ブロック待ち
キューが、先入れ先出し法で処理されることを特徴とす
る、請求項2に記載のリアルタイムOS。
3. The real-time OS according to claim 2, wherein the task control block waiting queue of the task is processed in a first-in first-out manner.
【請求項4】前記タスクの前記タスク制御ブロック待ち
キューがプライオリチィ順で処理されることを特徴とす
る、請求項2に記載のリアルタイムOS。
4. The real-time OS according to claim 2, wherein the task control block waiting queue of the task is processed in a priority order.
【請求項5】前記タスク制御ブロックの他に副タスク制
御ブロックを有することを特徴とする請求項1〜4のい
ずれかに記載のリアルタイムOS。
5. The real-time OS according to claim 1, further comprising a sub-task control block in addition to said task control block.
【請求項6】前記副タスク制御ブロックが、タスク1個
につき1個用意されることを特徴とする1〜5のいずれ
かに記載のリアルタイムOS。
6. The real-time OS according to claim 1, wherein one subtask control block is prepared for each task.
【請求項7】前記副タスク制御ブロックがタスク本体を
管理し、前記タスク制御ブロックがタスクの動作を管理
することを特徴とする、請求項5または6に記載のリア
ルタイムOS。
7. The real-time OS according to claim 5, wherein the sub-task control block manages a task body, and the task control block manages a task operation.
JP25287696A 1996-09-25 1996-09-25 Real time os Pending JPH10105415A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP25287696A JPH10105415A (en) 1996-09-25 1996-09-25 Real time os

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25287696A JPH10105415A (en) 1996-09-25 1996-09-25 Real time os

Publications (1)

Publication Number Publication Date
JPH10105415A true JPH10105415A (en) 1998-04-24

Family

ID=17243399

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25287696A Pending JPH10105415A (en) 1996-09-25 1996-09-25 Real time os

Country Status (1)

Country Link
JP (1) JPH10105415A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011216118A (en) * 2000-11-27 2011-10-27 Arm Ltd Data processing apparatus and method for executing data processing instruction
WO2024050965A1 (en) * 2022-09-08 2024-03-14 深圳市正浩创新科技股份有限公司 Task execution method, computer readable medium, and electronic device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011216118A (en) * 2000-11-27 2011-10-27 Arm Ltd Data processing apparatus and method for executing data processing instruction
WO2024050965A1 (en) * 2022-09-08 2024-03-14 深圳市正浩创新科技股份有限公司 Task execution method, computer readable medium, and electronic device

Similar Documents

Publication Publication Date Title
US20050125793A1 (en) Operating system kernel-assisted, self-balanced, access-protected library framework in a run-to-completion multi-processor environment
JP3920818B2 (en) Scheduling method and information processing system
JP4057989B2 (en) Scheduling method and information processing system
US5168566A (en) Multi-task control device for central processor task execution control provided as a peripheral device and capable of prioritizing and timesharing the tasks
US6269391B1 (en) Multi-processor scheduling kernel
JP2561801B2 (en) Method and system for managing process scheduling
JPH07504058A (en) Multitasking low power controller
KR970016979A (en) Queuing system and method of tasks in a multiprocessing system
WO2009096935A1 (en) Uniform synchronization between multiple kernels running on single computer systems
CN101414270A (en) Method for implementing assist nuclear task dynamic PRI scheduling with hardware assistant
JP3215264B2 (en) Schedule control apparatus and method
KR20070090649A (en) Apparatus and method for providing cooperative scheduling in a multicore system
US20060150187A1 (en) Decoupling a central processing unit from its tasks
KR20080013993A (en) Use of Data Engines in Data Processing Units
EP0052713B1 (en) A process management system for scheduling work requests in a data processing system
JPH11272480A (en) On-chip real time os
US20060112394A1 (en) Computer system
JP3644042B2 (en) Multitask processing device
JPH10105415A (en) Real time os
JP2001256062A (en) Interruption processing method and operation processor using the same
JP2902746B2 (en) Virtual computer control method
JP3524961B2 (en) Multiprocessor system and task scheduling method in the system
JP2001155001A (en) Method and device for controlling multiprocessor task
JPH11249917A (en) Parallel computers, their batch processing method, and storage medium
JP7608760B2 (en) Transaction control device, transaction control method, and program