JPH04322331A - Multitask controller - Google Patents

Multitask controller

Info

Publication number
JPH04322331A
JPH04322331A JP3092002A JP9200291A JPH04322331A JP H04322331 A JPH04322331 A JP H04322331A JP 3092002 A JP3092002 A JP 3092002A JP 9200291 A JP9200291 A JP 9200291A JP H04322331 A JPH04322331 A JP H04322331A
Authority
JP
Japan
Prior art keywords
task
address
tcb
page
task control
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
JP3092002A
Other languages
Japanese (ja)
Inventor
Takashi Takeda
享司 竹田
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP3092002A priority Critical patent/JPH04322331A/en
Publication of JPH04322331A publication Critical patent/JPH04322331A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To reduce the memory capacity used for management of each task and to perform the operation processing of management information at a high speed in a real time OS consisting of an 8-bit microprocessor. CONSTITUTION:A task control block arranging means 2 is provided which arranges task control blocks 4, 5, and 6 with 256 bytes as one page so that they are stored in management addresses 0 to 255 on a memory 3 designated by a page input means 11, and lower 8 bits of arrangement address information of a task connection pointer or a connection queue 7 indicating the task connection are reserved to indicate the connection destination, and upper 8 bits are regarded as 0 to perform the connection management of tasks, thereby obtaining a multitask controller which has the small memory capacity and performs the processing at a high speed.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明は、1つのマイクロプロセ
ッサで複数の固有の目的を持つプログラム(以下、タス
クと称す)を処理させるためのマルチタスクオペレーテ
ィングシステムにおいて、各タスクが各種の待ち行列を
構成する際のマルチタスク制御装置に関するものである
[Industrial Field of Application] The present invention relates to a multitasking operating system for causing one microprocessor to process programs having a plurality of unique purposes (hereinafter referred to as tasks), in which each task queues various queues. The present invention relates to a multitask control device when configuring it.

【0002】0002

【従来の技術】近年、マルチタスク制御装置は、1つの
マイクロプロセッサで複数のタスクを切り換えながら実
行させ、資源を有効に利用するためのリアルタイムオペ
レーティングシステム(以下、リアルタイムOSと称す
)として、8ビットマイクロプロセッサなどの安価なマ
イクロプロセッサでも応用されてきている。
2. Description of the Related Art In recent years, multitasking control devices have been developed as 8-bit real-time operating systems (hereinafter referred to as real-time OS) to enable a single microprocessor to execute multiple tasks while switching between them and to utilize resources effectively. It has also been applied to inexpensive microprocessors such as microprocessors.

【0003】しかしながら、安価ではあるが機能の低い
マイクロプロセッサで応用されるほど、リアルタイムO
Sを使った時のメモリの冗長性やタスク実行におけるオ
ーバーヘッドが問題となっている。
However, the more it is applied to inexpensive but low-function microprocessors, the more real-time O.
Memory redundancy and task execution overhead when using S are problems.

【0004】以下に、従来のマルチタスク制御装置につ
いて説明する。一般に、リアルタイムOSでは、各タス
クを切り換えながら実行するのに必要なタスク制御情報
を、タスクごとにブロック化して保存しており、これを
タスク制御ブロック(以下、TCBと称す)と呼んでい
る。
[0004] A conventional multitasking control device will be explained below. Generally, in a real-time OS, the task control information necessary to switch and execute each task is stored in blocks for each task, and these are called task control blocks (hereinafter referred to as TCBs).

【0005】図6は、64Kバイトのアドレス空間を持
った8ビットのマイクロプロセッサで、タスク数が3の
従来のマルチタスク制御装置の機能ブロック図である。
FIG. 6 is a functional block diagram of a conventional multitasking control device that is an 8-bit microprocessor with a 64K byte address space and has three tasks.

【0006】図6において、TCB初期化情報601は
、各TCBの初期情報が記録された読み出し専用ファイ
ルである。TCB配置手段602は、TCB初期化情報
601からTCBを生成するための初期情報を読み出し
、TCBを生成した後にメモリ603上の任意のアドレ
スに配置するもので、ここでは13F9h(16進表示
)から配置している。メモリ603は、配置されたTC
Bや接続キューを記憶しておくためのもので、第1〜第
3タスクのTCB604〜606は、TCB配置手段6
02によって配置された各タスクのTCBで、その内容
は後述する図7(a)である。接続キュー607は、待
ち行列の先頭のTCBのアドレスを示すものである。 タスク接続管理手段608は、各TCBを操作してタス
クの待ち行列を管理するものである。
In FIG. 6, TCB initialization information 601 is a read-only file in which initial information of each TCB is recorded. The TCB placement means 602 reads initial information for generating a TCB from the TCB initialization information 601, generates a TCB, and then places it at an arbitrary address on the memory 603. It is placed. The memory 603 stores the arranged TC
The TCBs 604 to 606 of the first to third tasks are used to store TCBs and connection queues.
02, the contents of which are shown in FIG. 7(a), which will be described later. The connection queue 607 indicates the address of the TCB at the head of the queue. The task connection management means 608 operates each TCB and manages the task queue.

【0007】図7(a)は、図6におけるメモリ603
上に配置される各タスクのTCB604〜606の内の
1つで、従来構成の一例を示したTCB構成図である。
FIG. 7(a) shows the memory 603 in FIG.
It is one of the TCBs 604 to 606 of each task arranged above, and is a TCB configuration diagram showing an example of a conventional configuration.

【0008】図7(a)において、701は各種の待ち
行列を構成する時にタスクのつながりを示して待ち行列
を構成するため、次のタスクのTCBアドレスを保存す
る16ビットのタスク接続ポインタである。702〜7
05はその他のタスク管理情報で、ここではたとえば以
下のように構成される。
In FIG. 7(a), 701 is a 16-bit task connection pointer that stores the TCB address of the next task in order to indicate the connection of tasks and configure the queue when configuring various queues. . 702-7
05 is other task management information, which is structured as follows, for example.

【0009】702はタスク状態を示す8ビットの情報
で、該当タスクが実行状態なのか休止状態なのかなどの
タスクの状態が保存され、703はタスク優先順位を示
す8ビットの情報である。704は16ビットのタイム
アウトカウンタで、該当タスクが時間待ち状態の時にタ
スクの時間管理が行われる。705は16ビットのタス
クスタックポインタで、該当タスクが実行状態でなくな
る際のスタックポインタが保存される。
[0009] 702 is 8-bit information indicating the task status, and the status of the task, such as whether the task is in an execution state or a dormant state, is saved, and 703 is 8-bit information indicating the task priority. A 16-bit timeout counter 704 performs task time management when the task is in a time waiting state. 705 is a 16-bit task stack pointer, and the stack pointer is saved when the corresponding task is no longer in the execution state.

【0010】図7(b)は、TCB接続の1例を示した
TCB接続図で、例えば実行待ちした際のタスクの待ち
行列を示したものである。
FIG. 7(b) is a TCB connection diagram showing an example of TCB connection, and shows, for example, a queue of tasks when waiting for execution.

【0011】図7(b)において、接続キュー711は
タスク先頭指示手段であり、待ち行列の先頭タスクのT
CBアドレスを8ビットずつ上位と下位に分けて指し示
した16ビットの接続キューである。タスク接続ポイン
タ712,713,714はタスク接続指示手段であり
、該タスクの次に待ちとなっているタスクのTCBアド
レスを指し示すものである。
In FIG. 7(b), a connection queue 711 is a task head instruction means, and the T of the head task in the queue is
It is a 16-bit connection queue that indicates the CB address divided into upper and lower parts of 8 bits each. Task connection pointers 712, 713, and 714 are task connection instructing means, and point to the TCB address of the task waiting next to the task.

【0012】図6における接続キュー607,第1タス
クのTCB604,第2タスクのTCB605,第3タ
スクのTCB606は、それぞれ図7(b)の接続キュ
ー711,第1タスクのTCB713,第2タスクのT
CB712,第3タスクのTCB714に対応する。
The connection queue 607, TCB 604 of the first task, TCB 605 of the second task, and TCB 606 of the third task in FIG. 6 are the connection queue 711, TCB 713 of the first task, and TCB 713 of the second task in FIG. T
CB712 corresponds to TCB714 of the third task.

【0013】以上のように構成された従来のマルチタス
ク制御装置について、以下図6、図7(b)、図8およ
び図9を用いて説明する。
The conventional multitask control device configured as described above will be explained below with reference to FIGS. 6, 7(b), 8, and 9.

【0014】まず、図6のTCB配置手段602は、T
CB初期化情報601からTCBの初期情報を受け、各
タスクのTCBを生成し、メモリ603の任意の場所か
ら順に(ここでは13F9(16進表示)番地から)T
CBを配置する。メモリ603上に配置されたTCB6
04〜606は以降タスク接続管理手段608によって
管理される。TCB配置手段602とタスク接続管理手
段608の処理の詳細を図8と図9に示す。
First, the TCB placement means 602 of FIG.
Receives TCB initial information from CB initialization information 601, generates TCB for each task, and sequentially writes TCB from any location in memory 603 (here, from address 13F9 (hexadecimal display)).
Place CB. TCB 6 located on memory 603
04 to 606 are thereafter managed by the task connection management means 608. Details of the processing by the TCB placement means 602 and the task connection management means 608 are shown in FIGS. 8 and 9.

【0015】図7(b)では、実行待ちタスクの順番が
、第2タスク−第1タスク−第3タスクであった時のタ
スク制御ブロックの行列である。
FIG. 7B shows a matrix of task control blocks when the order of tasks waiting to be executed is second task - first task - third task.

【0016】接続キュー711の内容は、行列の先頭と
なる第2タスクのTCB712の先頭アドレスを示し、
その内容は1401(16進数表示)となり、第2タス
クのTCB712のタスク接続ポインタの内容は、第1
タスクのTCB713の先頭アドレスを示すために13
F9(16進数表示)であり、第1タスクのTCB71
3のタスク接続ポインタの内容は、第3タスクのTCB
714の先頭アドレスを示すために1409(16進数
表示)となる。
The contents of the connection queue 711 indicate the start address of the TCB 712 of the second task which is the head of the queue,
Its content is 1401 (in hexadecimal), and the content of the task connection pointer of TCB 712 of the second task is 1401 (in hexadecimal).
13 to indicate the start address of TCB 713 of the task.
F9 (hexadecimal representation), TCB71 of the first task
The contents of the task connection pointer in No. 3 are the TCB of the third task.
714 is 1409 (hexadecimal notation).

【0017】第3タスクのTCB714のタスク接続ポ
インタの内容は、この後につながるTCBがないことを
示す特別なコード(例えばFFFF(16進数表示))
となる。
The content of the task connection pointer of TCB 714 of the third task is a special code (for example, FFFF (hexadecimal notation)) indicating that there is no TCB connected after this.
becomes.

【0018】このように、それぞれのTCBの先頭アド
レスを順次指し示して、待ち行列を構成する。
[0018] In this way, a queue is constructed by sequentially pointing to the leading address of each TCB.

【0019】図8は図6におけるTCB配置手段602
の処理を示すフロー図である。図8において、ステップ
801は、TCBの配置アドレスの初期値13F9(1
6進数表示)とタスクのカウント値Nを設定している。 ステップ802は、N番目のTCBの初期化情報を読み
込んで、ステップ803でTCBの生成を行い、ステッ
プ804では生成したTCBを配置アドレスより順に配
置する。ステップ805は、次のTCBのために配置ア
ドレスをTCBのサイズだけ移動させ、Nを1増やすこ
とによって次のTCBを対照にしている。ステップ80
6は、次のTCB初期化情報をみて、まだタスクが存在
するかを判定し、存在すればステップ802へ、存在し
なければ終了する。
FIG. 8 shows the TCB arrangement means 602 in FIG.
FIG. 2 is a flow diagram showing the processing of FIG. In FIG. 8, step 801 is the initial value 13F9(1
(in hexadecimal notation) and the task count value N. Step 802 reads the initialization information of the Nth TCB, step 803 generates a TCB, and step 804 places the generated TCB in order from the placement address. Step 805 contrasts the next TCB by moving the placement address by the size of the TCB for the next TCB and increasing N by one. step 80
Step 6 looks at the next TCB initialization information and determines whether there are any more tasks. If there are, the process proceeds to step 802; if not, the process ends.

【0020】図9は、図6のタスク接続管理手段605
の処理を示したフロー図である。図9において、ステッ
プ901は、図6の接続キュー607の下位8ビットを
読み込んで、ステップ902は、図6の接続キュー60
7の上位8ビットを読み込んで、ステップ903は、ス
テップ901とステップ902読み込んだデータをTC
Bアドレス情報としている。ステップ904で次につな
がるTCBが有るか無いかを判定し、有れば次のステッ
プ905へ戻り、無ければステップ907へ進んでTC
Bの接続を行う。ステップ905は、該TCBのタスク
接続ポインターの下位8ビットを読み込み、次に、ステ
ップ906で該TCBのタスク接続ポインターの上位8
ビットを読み込んでステップ903へ戻る。
FIG. 9 shows the task connection management means 605 of FIG.
FIG. 9, step 901 reads the lower 8 bits of the connection queue 607 of FIG. 6, and step 902 reads the connection queue 607 of FIG.
After reading the upper 8 bits of 7, step 903 transfers the data read in steps 901 and 902 to TC.
B address information. In step 904, it is determined whether there is a next TCB. If there is, the process returns to the next step 905. If there is no TCB, the process proceeds to step 907 and the TC
Connect B. Step 905 reads the lower 8 bits of the task connection pointer of the TCB, and then step 906 reads the upper 8 bits of the task connection pointer of the TCB.
The bit is read and the process returns to step 903.

【0021】[0021]

【発明が解決しようとする課題】しかしながら上記のよ
うな構成では、接続キューおよび各TCBのタスク接続
ポインタとして、各16ビットのメモリが使用されてお
り、メモリを多く使用してしまうと同時に、接続キュー
711やタスク接続ポインタ712を参照する際、8ビ
ットのマイクロプロセッサでは2回メモリをアクセスし
なければ16ビットの情報が得られないので、時間がか
かるという問題点を有していた。
[Problems to be Solved by the Invention] However, in the above configuration, 16-bit memory is used for the connection queue and the task connection pointer of each TCB, which uses a large amount of memory and at the same time When referring to the queue 711 or the task connection pointer 712, an 8-bit microprocessor requires accessing the memory twice to obtain 16-bit information, which poses a problem in that it takes time.

【0022】本発明はかかる点に鑑み、接続キューやタ
スク接続ポインタのサイズを小さくし、しかも高速に処
理を行うことのできるマルチタスク制御装置を提供する
ことを目的とする。
SUMMARY OF THE INVENTION In view of the above, an object of the present invention is to provide a multitask control device that can reduce the size of connection queues and task connection pointers, and can perform processing at high speed.

【0023】[0023]

【課題を解決するための手段】本発明は、複数のタスク
を切り換えながら実行するために必要なタスク管理情報
を保存するN個のタスク制御ブロックと、管理アドレス
を指定して任意の情報を書き込み読み出し可能なメモリ
手段と、前記N個のタスク制御ブロックを配置するアド
レスのメモリ頁を256バイトを1頁として指定する頁
入力手段と、前記N個のタスク制御ブロックが前記メモ
リ手段の前記頁入力手段より入力されたメモリ1頁内の
管理アドレス0番地から255番地までに入るように所
定のアドレス空間に配置するタスク制御ブロック配置手
段と、前記N個のタスク制御ブロックのそれぞれに含ま
れ、複数のタスクの待ち行列を構成するために、次に接
続するタスクのタスク制御ブロックの配置アドレス情報
の下位8ビットを保存してタスクの接続を示すN個のタ
スク接続指示手段と、待ち行列タスクの先頭タスクを示
すために、前記タスクのタスク制御ブロックの配置アド
レス情報の下位8ビットを保存するタスク先頭指示手段
と、前記N個のタスク制御ブロックの先頭のアドレス情
報を検出する配置開始アドレス検出手段と、前記N個の
タスク制御ブロックの最後尾のアドレス情報を検出する
配置終了アドレス検出手段と、前記配置開始アドレス検
出手段と前記配置終了アドレス検出手段より検出された
2つのアドレスが同一頁であるかどうかを判定するアド
レス判定手段と、前記アドレス比較手段の結果が256
以上であれば警告を発行する警告発行手段とにより構成
されている。
[Means for Solving the Problems] The present invention provides N task control blocks that store task management information necessary for switching and executing multiple tasks, and writing arbitrary information by specifying a management address. a readable memory means; a page input means for specifying a memory page at an address in which the N task control blocks are arranged, with 256 bytes as one page; and a page input means for specifying the page input of the N task control blocks. task control block arrangement means for arranging a task control block in a predetermined address space so as to be placed in a management address from address 0 to address 255 in one page of the memory inputted by the means; In order to configure a queue of tasks, N task connection instruction means are used to indicate the connection of tasks by saving the lower 8 bits of the arrangement address information of the task control block of the next task to be connected, and Task header indicating means for storing the lower 8 bits of placement address information of the task control block of the task to indicate the header task, and placement start address detection means for detecting the header address information of the N task control blocks. and a placement end address detection means for detecting the last address information of the N task control blocks, and two addresses detected by the placement start address detection means and the placement end address detection means are on the same page. The result of the address determination means and the address comparison means is 256.
and warning issuing means for issuing a warning if the above is the case.

【0024】[0024]

【作用】本発明は上記した構成により、タスク制御ブロ
ック配置手段が、各タスクのTCBを256バイトを1
頁として指定した頁メモリの管理アドレス0番地から2
55番地の間に入るように固定的に配置し、タスク先頭
指示手段とタスク接続指示手段がアドレス情報の下位8
ビットで指示することによって、タスク接続処理などの
TCBの操作を8ビットの演算で実施できるため高速に
処理でき、また、接続キューやTCBを構成するタスク
接続ポインタを8ビットで構成できるので、メモリの使
用量を小さくできる。
[Operation] With the above-described configuration, the present invention allows the task control block allocation means to divide the TCB of each task into 256 bytes.
Management address 0 to 2 of page memory specified as page
55 address, and the task head instruction means and task connection instruction means are placed in the lower 8 addresses of the address information.
By specifying bits, TCB operations such as task connection processing can be performed using 8-bit operations, resulting in faster processing. Also, since the connection queue and the task connection pointer that makes up the TCB can be configured with 8 bits, memory The usage amount can be reduced.

【0025】[0025]

【実施例】図1は本発明の第1の実施例(請求項1)で
あって、64Kバイトのアドレス空間を持った8ビット
のマイクロプロセッサで、タスク数N=3で頁入力手段
から値として7が入力された場合のマルチタスク制御装
置の構成を示す機能ブロック図である。
[Embodiment] FIG. 1 shows a first embodiment (claim 1) of the present invention, which is an 8-bit microprocessor with an address space of 64 Kbytes, the number of tasks N=3, and a page input means. FIG. 2 is a functional block diagram showing the configuration of the multitask control device when 7 is input.

【0026】図1において、1はTCBを生成する際に
必要な初期情報が保存されたTCB初期化情報、11は
256バイトを1頁としてTCBを配置するメモリの頁
を入力する頁入力手段、2はTCB初期化情報1を元に
TCBを作成し、メモリ3上の頁入力手段11によって
指定された頁の0番地から順に配置するTCB配置手段
である。3はTCBや接続キューを配置するためのメモ
リ、4,5,6はそれぞれTCB配置手段2によって、
メモリ3の0番地から順に配置された第1〜第3タスク
のTCBである。7は、待ち行列の先頭タスクのTCB
アドレスの下位8ビットを示す接続キューであり、0番
地から255番地に存在する必要はない。8は、頁入力
手段11によって入力されたメモリ頁のメモリ3上に配
置された各タスクのTCB4〜6、および接続キュー7
を操作してタスクの接続行列を構成管理するタスク接続
管理手段である。
In FIG. 1, reference numeral 1 indicates TCB initialization information in which initial information necessary for generating a TCB is stored; reference numeral 11 indicates page input means for inputting a memory page in which a TCB is to be placed, with 256 bytes as one page; Reference numeral 2 denotes a TCB placement means that creates a TCB based on the TCB initialization information 1 and places it sequentially from address 0 on the page designated by the page input means 11 on the memory 3. 3 is a memory for arranging TCBs and connection queues; 4, 5, and 6 are each provided by the TCB arranging means 2;
These are the TCBs of the first to third tasks arranged in order from address 0 in the memory 3. 7 is the TCB of the first task in the queue
This is a connection queue that indicates the lower 8 bits of an address, and does not need to exist at addresses 0 to 255. 8 denotes TCBs 4 to 6 of each task arranged on the memory 3 of the memory page input by the page input means 11, and a connection queue 7.
This is a task connection management means that configures and manages a task connection matrix by manipulating the task connection matrix.

【0027】図2(a)は、図1におけるメモリ3上に
配置される各タスクのTCB4〜6の内の1つで、7バ
イトのTCBの構成例を示したTCB構成図である。
FIG. 2A is a TCB configuration diagram showing an example of the configuration of a 7-byte TCB, which is one of the TCBs 4 to 6 of each task arranged on the memory 3 in FIG.

【0028】図2(a)において、201は各種の待ち
行列を構成する時にタスクのつながりを示して待ち行列
を構成するため、次のタスクのTCBアドレスの下位8
ビットのみを保存する8ビットのタスク接続ポインタで
ある。
In FIG. 2(a), 201 indicates the connection of tasks when configuring various queues and configures the queue, so the lower 8 of the TCB address of the next task is
It is an 8-bit task connection pointer that only stores bits.

【0029】202〜205はその他のタスク管理情報
であり、ここでは従来例の図7(a)の702〜705
と全く同じに構成される。
202 to 205 are other task management information, and here, 702 to 705 in FIG. 7(a) of the conventional example
is configured exactly the same.

【0030】図2(b)は、TCB接続の1例を示した
TCB接続図であり、例えば実行待ちした際のタスクの
待ち行列を示したものである。
FIG. 2(b) is a TCB connection diagram showing an example of TCB connection, and shows, for example, a queue of tasks when waiting for execution.

【0031】図2(b))において、接続キュー211
はタスク先頭指示手段であり、待ち行列の先頭タスクの
TCBアドレスの下位だけを指し示す8ビットの接続キ
ューである。
In FIG. 2(b), the connection queue 211
is a task head instruction means, which is an 8-bit connection queue that points only to the lower TCB address of the head task in the queue.

【0032】タスク接続ポインタ212,213,21
4はタスク接続指示手段であり、該タスクの次に待ちと
なっているタスクのTCBアドレスの下位8ビットを指
し示すものである。
[0032] Task connection pointers 212, 213, 21
4 is a task connection instruction means, which indicates the lower 8 bits of the TCB address of the task waiting next to the task.

【0033】図1における接続キュー7,第1タスクの
TCB4,第2タスクのTCB5,第3タスクのTCB
6は、それぞれ図2(b)の接続キュー211,第1タ
スクのTCB213,第2タスクのTCB212,第3
タスクのTCB214に対応する。
Connection queue 7, first task TCB 4, second task TCB 5, and third task TCB in FIG.
6 are the connection queue 211 of FIG. 2(b), the TCB 213 of the first task, the TCB 212 of the second task, and the third task, respectively.
It corresponds to the TCB 214 of the task.

【0034】以上のように構成されたこの実施例のマル
チタスク制御装置において、以下図1,図2(b),図
3及び図4を用いて、その動作を説明する。
The operation of the multitask control device of this embodiment constructed as described above will be explained below with reference to FIGS. 1, 2(b), 3, and 4.

【0035】図1で頁入力手段11からTCBの配置メ
モリ頁(ここでは7頁)を入力すると、TCB配置手段
2は、TCB初期化情報1からTCBの初期情報を受け
TCBを作成し、メモリの7頁目の先頭である0700
(16進表示)番地から順に配置する。メモリ3上に配
置されたTCB4,5,6は、以降タスク接続管理手段
8に頁入力手段11から配置頁情報をもらい、この頁情
報を基に管理を行う。
In FIG. 1, when a TCB arrangement memory page (page 7 in this case) is input from the page input means 11, the TCB arrangement means 2 receives TCB initial information from the TCB initialization information 1, creates a TCB, and stores it in the memory. 0700, which is the top of the 7th page of
(Displayed in hexadecimal) Arrange in order starting from address. The TCBs 4, 5, and 6 arranged on the memory 3 receive arrangement page information from the page input means 11 to the task connection management means 8, and manage them based on this page information.

【0036】図2(b)では、実行待ちタスクの順番が
、第2タスク−第1タスク−第3タスクであった時のタ
スク制御ブロックの待ち行列である。
FIG. 2B shows the queue of the task control block when the order of tasks waiting to be executed is second task - first task - third task.

【0037】接続キュー211の内容は、行列の先頭と
なる第2タスクのTCB212の先頭アドレスの下位8
ビットを示し、その内容は07(16進数表示)となり
、第2タスクのTCB212のタスク接続ポインタの内
容は、第1タスクのTCB213の先頭アドレスの下位
8ビットを示すために00(16進数表示)であり、第
1タスクのTCB213のタスク接続ポインタの内容は
、第3タスクのTCB214の先頭アドレスの下位8ビ
ットを示すために0E(16進数表示)となる。第3タ
スクのTCB214のタスク接続ポインタの内容は、こ
の後につながるTCBがないことを示す特別なコード(
例えばFF(16進数表示))となる。
The contents of the connection queue 211 are the lower 8 of the start address of the TCB 212 of the second task which is the head of the matrix.
The content of the task connection pointer of the TCB 212 of the second task is 00 (hexadecimal representation) to indicate the lower 8 bits of the start address of the TCB 213 of the first task. The contents of the task connection pointer of the TCB 213 of the first task are 0E (hexadecimal notation) to indicate the lower 8 bits of the start address of the TCB 214 of the third task. The contents of the task connection pointer of TCB 214 of the third task contain a special code (
For example, it is FF (hexadecimal notation).

【0038】このように、それぞれのTCBの先頭アド
レスの下位8ビットを順次指し示して、待ち行列を構成
する。
In this way, a queue is constructed by sequentially pointing to the lower 8 bits of the start address of each TCB.

【0039】図3は図1におけるTCB配置手段2の処
理を示すフロー図である。図3において、ステップ30
1は、配置ページとして頁アドレスを読み込み(ここで
は7)、TCB初期化情報ファイルからTCBの配置ア
ドレスの初期値とタスクのカウント値Nを設定している
。ステップ302は、N番目のTCBの初期化情報を読
み込んで、ステップ303でTCBの生成を行い、ステ
ップ304では生成したTCBを配置アドレスより順に
配置する。ステップ305は、次のTCBのために配置
アドレスをTCBのサイズだけ移動させ、Nを1増やす
ことによって次のTCBを対照にしている。ステップ3
06は、次のTCB初期化情報をみて、まだタスクが存
在するかを判定し、存在すればステップ302へ、存在
しなければ終了する。
FIG. 3 is a flowchart showing the processing of the TCB placement means 2 in FIG. In FIG. 3, step 30
1 reads a page address as a placement page (7 in this case), and sets the initial value of the TCB placement address and task count value N from the TCB initialization information file. Step 302 reads the initialization information of the Nth TCB, step 303 generates a TCB, and step 304 places the generated TCB in order from the placement address. Step 305 contrasts the next TCB by moving the placement address by the size of the TCB for the next TCB and increasing N by one. Step 3
06 looks at the next TCB initialization information and determines whether there are any more tasks. If there are, the process proceeds to step 302; if not, the process ends.

【0040】図4は、図1のタスク接続管理手段5の処
理を示したフロー図である。図4において、ステップ4
01は、図1の接続キュー7を読み込んで、ステップ4
11では、上位アドレス8ビットに頁アドレスを設定し
、ステップ402は、ステップ401で読み込んだデー
タをTCBアドレス情報としている。ステップ403は
、次につながるTCBが有るか無いかを判定し、あれば
次のステップ404へ行き、無ければステップ405で
TCBの接続を行う。ステップ404では、示されたア
ドレスのTCBのタスク接続ポインタを読み込み、ステ
ップ402へ戻る。
FIG. 4 is a flow diagram showing the processing of the task connection management means 5 of FIG. In FIG. 4, step 4
01 reads the connection queue 7 in FIG. 1 and performs step 4.
In step 11, a page address is set in the upper 8 bits of the address, and in step 402, the data read in step 401 is used as TCB address information. In step 403, it is determined whether or not there is a TCB to be connected next. If there is, the process goes to the next step 404, and if there is not, the TCB is connected in step 405. In step 404, the task connection pointer of the TCB at the indicated address is read, and the process returns to step 402.

【0041】なお、本実施例でTCBの配置アドレスの
初期値は0としたが、0から255番地までにTCBが
配置されれば、初期値は0から255のどこであっても
かまわない。
In this embodiment, the initial value of the TCB placement address is set to 0, but the initial value may be anywhere from 0 to 255 as long as the TCB is placed at addresses 0 to 255.

【0042】図5は本発明の第2の実施例(請求項2)
におけるマルチタスク制御装置の構成を示す機能ブロッ
ク図である。
FIG. 5 shows a second embodiment (claim 2) of the present invention.
FIG. 2 is a functional block diagram showing the configuration of a multitask control device in FIG.

【0043】第1の実施例と異なるのは、TCB配置手
段502からTCBの配置開始アドレスを検出して出力
する配置開始アドレス検出手段509と、TCBの配置
終了アドレスを検出して出力する配置終了アドレス検出
手段519と、この2つのアドレスが同一頁に存在して
いるかどうかを判定する配置アドレス判定手段510と
、判定結果によってエラーを出力する警告手段511を
設けた点である。
The difference from the first embodiment is a placement start address detection means 509 that detects and outputs the TCB placement start address from the TCB placement means 502, and a placement end that detects and outputs the TCB placement end address. The difference is that an address detection means 519, a layout address determination means 510 for determining whether these two addresses exist on the same page, and a warning means 511 for outputting an error based on the determination result are provided.

【0044】以上のように構成されたこの実施例のマル
チタスク制御装置において、以下図5を用いてその動作
を説明する。
The operation of the multitask control device of this embodiment configured as described above will be explained below with reference to FIG.

【0045】配置開始アドレス検出手段509はTCB
配置手段502がTCBの配置を開始した際の配置開始
アドレスを検出して出力し、配置終了アドレス検出手段
519はTCB配置手段502がTCBの配置を完了し
た際の配置終了アドレスを検出して出力する。配置アド
レス判定手段510では、この2つのアドレスが256
バイトを1頁として管理するメモリの同一頁に存在する
かどうかを判定し、同一頁で無ければ、警告手段511
はエラーを出力して警告を発する。
The placement start address detection means 509 is the TCB
The placement means 502 detects and outputs the placement start address when the TCB placement starts, and the placement end address detection means 519 detects and outputs the placement end address when the TCB placement means 502 completes the TCB placement. do. The arrangement address determination means 510 determines that these two addresses are 256
It is determined whether they exist on the same page of the memory where bytes are managed as one page, and if they are not on the same page, the warning means 511
prints an error and issues a warning.

【0046】[0046]

【発明の効果】以上説明したように、本発明によれば、
TCBを配置する頁アドレスを入力する頁入力手段と、
指定された頁アドレス空間にタスク制御ブロックを配置
する手段と、管理アドレスが0番地から255番地まで
であることを前提に下位8ビットのアドレスでタスク接
続を行うタスク接続指示手段やタスク先頭指示手段を設
けることにより、タスク接続指示手段やタスク先頭指示
手段は指示アドレスの下位8ビットのみを保存していれ
ばよいため、メモリの使用領域を少なくすることが可能
になるばかりでなく、8ビットデータバスのマイクロプ
ロセッサでは、1回のメモリアクセスを行うだけで次に
接続されたTCBのアドレスを参照できるため、タスク
接続管理手段はタスク接続処理を高速に行うことができ
る。
[Effects of the Invention] As explained above, according to the present invention,
page input means for inputting a page address for arranging the TCB;
A means for arranging a task control block in a specified page address space, and a task connection instructing means and a task head instructing means for connecting a task using a lower 8-bit address on the premise that the management address is from address 0 to address 255. By providing this, the task connection instruction means and the task start instruction means only need to save the lower 8 bits of the instruction address, which not only makes it possible to reduce the memory area used, but also allows Since the microprocessor of the bus can refer to the address of the next connected TCB by performing one memory access, the task connection management means can perform task connection processing at high speed.

【0047】また、TCBを配置した際の配置アドレス
が255を越えた場合にこれを警告する警告手段を設け
ることにより、マルチタスク制御装置の誤動作を事前に
知ることができる。
Furthermore, by providing a warning means that warns when the arrangement address exceeds 255 when the TCB is arranged, malfunctions of the multitasking control device can be known in advance.

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

【図1】本発明の第1の実施例におけるマルチタスク制
御装置の構成を示す機能ブロック図
FIG. 1 is a functional block diagram showing the configuration of a multitask control device in a first embodiment of the present invention.

【図2】(a)は第1の実施例におけるタスク制御ブロ
ックの1構成例を示したTCB構成図 (b)は第1の実施例におけるタスク制御ブロックをつ
ないで待ち行列を構成した際のタスク接続図
FIG. 2 (a) is a TCB configuration diagram showing an example of the configuration of a task control block in the first embodiment; (b) is a TCB configuration diagram showing an example of the configuration of a task control block in the first embodiment; Task connection diagram

【図3】同
実施例におけるTCB配置手段の処理の内容を示すフロ
ー図
[Fig. 3] Flow diagram showing the contents of processing by the TCB placement means in the same embodiment.

【図4】同実施例におけるタスク接続管理手段の処理手
順を示すフロー図
FIG. 4 is a flow diagram showing the processing procedure of the task connection management means in the same embodiment.

【図5】本発明の第2の実施例におけるマルチタスク制
御装置の構成を示す機能ブロック図
FIG. 5 is a functional block diagram showing the configuration of a multitask control device in a second embodiment of the present invention.

【図6】従来のマルチタスク制御装置の構成を示す機能
ブロック図
[Fig. 6] Functional block diagram showing the configuration of a conventional multitask control device

【図7】(a)は従来のタスク制御ブロックの1構成例
を示したTCB構成図 (b)は従来のタスク制御ブロックをつないで待ち行列
を構成した際のタスク接続図
[Figure 7] (a) is a TCB configuration diagram showing one configuration example of a conventional task control block; (b) is a task connection diagram when a queue is configured by connecting conventional task control blocks;

【図8】従来のTCB配置手段の処理の内容を示すフロ
ー図
[Fig. 8] Flow diagram showing the processing contents of the conventional TCB placement means

【図9】従来のタスク接続管理手段の処理手順の1例を
示すフロー図
FIG. 9 is a flow diagram showing an example of a processing procedure of a conventional task connection management means.

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

1  TCB初期化情報 2  TCB配置手段 3  メモリ 4,213  第1タスクのTCB 5,212  第2タスクのTCB 6,214  第3タスクのTCB 7,211  接続キュー 8  タスク接続管理手段 11  頁入力手段 201  タスク接続ポインタ 1 TCB initialization information 2 TCB arrangement means 3. Memory 4,213 TCB of 1st task 5,212 Second task TCB 6,214 Third task TCB 7,211 Connection queue 8 Task connection management means 11 Page input means 201 Task connection pointer

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】複数のタスクを切り換えながら実行するた
めに必要なタスク管理情報を保存するN個のタスク制御
ブロックと、管理アドレスを指定して任意の情報を書き
込み・読み出し可能なメモリ手段と、前記N個のタスク
制御ブロックを配置するアドレスのメモリ頁を、256
バイトを1頁として指定する頁入力手段と、前記N個の
タスク制御ブロックが前記メモリ手段の前記頁入力手段
より入力されたメモリ1頁内の管理アドレス0番地から
255番地までに入るように所定のアドレス空間に配置
するタスク制御ブロック配置手段と、前記N個のタスク
制御ブロックのそれぞれに含まれ、複数のタスクの待ち
行列を構成するために、次に接続するタスクのタスク制
御ブロックの配置アドレス情報の下位8ビットを保存し
て、タスクの接続を示すN個のタスク接続指示手段と、
待ち行列タスクの先頭タスクを示すために、前記タスク
のタスク制御ブロックの配置アドレス情報の下位8ビッ
トを保存するタスク先頭指示手段と、を備えたマルチタ
スク制御装置。
1. N task control blocks that store task management information necessary for switching and executing a plurality of tasks; and memory means that can write and read arbitrary information by specifying a management address; The memory page at the address where the N task control blocks are placed is 256.
a page input means for specifying a byte as one page; and a predetermined setting such that the N task control blocks are entered at management addresses 0 to 255 within page 1 of the memory input from the page input means of the memory means. a task control block arrangement means for arranging the task control block in the address space of the N task control blocks, and a task control block arrangement address of the next task to be connected in order to configure a queue of a plurality of tasks, which is included in each of the N task control blocks. N task connection instruction means for storing lower 8 bits of information and indicating task connections;
A multi-task control device comprising: task header indicating means for storing lower 8 bits of placement address information of a task control block of the task in order to indicate the header task of the queued tasks.
【請求項2】複数のタスクを切り換えながら実行するた
めに必要なタスク管理情報を保存するN個のタスク制御
ブロックと、管理アドレスを指定して任意の情報を書き
込み・読み出し可能なメモリ手段と、前記N個のタスク
制御ブロックを配置するアドレスのメモリ頁を、256
バイトを1頁として指定する頁入力手段と、前記N個の
タスク制御ブロックが前記メモリ手段の前記頁入力手段
より入力されたメモリ1頁内の管理アドレス0番地から
255番地までに入るように所定のアドレス空間に配置
するタスク制御ブロック配置手段と、前記N個のタスク
制御ブロックの先頭のアドレス情報を検出する配置開始
アドレス検出手段と、前記N個のタスク制御ブロックの
最後尾のアドレス情報を検出する配置終了アドレス検出
手段と、前記配置開始アドレス検出手段と前記配置終了
アドレス検出手段より検出された2つのアドレスが同一
頁であるかどうかを判定するアドレス判定手段と、前記
アドレス比較手段の結果が256以上であれば警告を発
行する警告発行手段と、を備えたマルチタスク制御装置
2. N task control blocks that store task management information necessary for switching and executing a plurality of tasks; and memory means that can write and read arbitrary information by specifying a management address; The memory page at the address where the N task control blocks are placed is 256.
a page input means for specifying a byte as one page; and a predetermined setting such that the N task control blocks are entered at management addresses 0 to 255 within page 1 of the memory inputted from the page input means of the memory means. task control block placement means for placing the task control block in an address space; placement start address detection means for detecting address information at the beginning of the N task control blocks; and detection means for detecting address information at the end of the N task control blocks. an arrangement end address detection means for detecting the arrangement end address, an address determination means for determining whether two addresses detected by the arrangement start address detection means and the arrangement end address detection means are on the same page, and a result of the address comparison means A multi-task control device comprising: warning issuing means for issuing a warning if the number is 256 or more.
JP3092002A 1991-04-23 1991-04-23 Multitask controller Pending JPH04322331A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3092002A JPH04322331A (en) 1991-04-23 1991-04-23 Multitask controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3092002A JPH04322331A (en) 1991-04-23 1991-04-23 Multitask controller

Publications (1)

Publication Number Publication Date
JPH04322331A true JPH04322331A (en) 1992-11-12

Family

ID=14042223

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3092002A Pending JPH04322331A (en) 1991-04-23 1991-04-23 Multitask controller

Country Status (1)

Country Link
JP (1) JPH04322331A (en)

Similar Documents

Publication Publication Date Title
JP2829091B2 (en) Data processing system
JPH02227763A (en) Data transfer control system
JP2001195384A (en) Processor and method for controlling input and output pin of the processor
JP3619532B2 (en) Semiconductor integrated circuit device
JPH10207717A (en) Microcomputer
JPH0916409A (en) Microcomputer
JP3144842B2 (en) Microprocessor
JPH04322331A (en) Multitask controller
JP2005293596A (en) Arbitration of data requests
JPH0546412A (en) Multitask controller
JP3206580B2 (en) DMA data transfer control method and input / output processing device
JPH07325779A (en) Input/output controller
JP2001255902A (en) Dual port memory, data transfer method thereof, and control system using dual port memory
JPH11306040A (en) Emulator trace device
US20240281311A1 (en) Queue adjustments to avoid message underrun and usage spikes
JP3613274B2 (en) Information processing device
JPS62120542A (en) Information processor
JPH03188531A (en) Time-division multitask executing device
JPH0413716B2 (en)
JP2003186666A (en) Microcomputer and DMA control circuit
JPH03111961A (en) Multi-CPU program loading method
JPH0736806A (en) Dma system
JP2000029508A (en) Programmable controller
JPH04184525A (en) Magnetic disk device
JPS61123937A (en) Data-driven control method for data processing equipment