[go: up one dir, main page]

JP2000066904A - Multitask control method and storage medium - Google Patents

Multitask control method and storage medium

Info

Publication number
JP2000066904A
JP2000066904A JP10236031A JP23603198A JP2000066904A JP 2000066904 A JP2000066904 A JP 2000066904A JP 10236031 A JP10236031 A JP 10236031A JP 23603198 A JP23603198 A JP 23603198A JP 2000066904 A JP2000066904 A JP 2000066904A
Authority
JP
Japan
Prior art keywords
task
execution
function
interrupt
scheduling
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
JP10236031A
Other languages
Japanese (ja)
Inventor
Atsushi Hirahara
厚志 平原
Masataka Bessho
正隆 別所
Yoichi Iwabuchi
洋一 岩渕
Junji Yamada
潤二 山田
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP10236031A priority Critical patent/JP2000066904A/en
Publication of JP2000066904A publication Critical patent/JP2000066904A/en
Pending legal-status Critical Current

Links

Abstract

(57)【要約】 【課題】複数のタスクを含むアプリケーションプログラ
ムを制御するためのマルチタスク制御において、あらゆ
るプラットフォーム上で同一のインターフェース仕様を
持ち、アプリケーションが同一の動作を行うことを可能
とする。 【解決手段】共通部分103は、アプリケーション10
1に含まれる複数のアプリケーションタスク102の実
行に関わるスケジューリングを行い、タスク中断処理や
タスク再開処理等のタスク制御指示を機種依存部分10
6に発行する。機種依存部分106は、共通部分103
より発行されたタスク制御指示に基づいてタスクの制御
を行う。ここで、当該アプリケーションの動作環境が実
機のMPU上であれば、タスク中断機能109、再開機
能110はタスクコントロールブロックの内容を直接書
き換える。一方、動作環境が汎用OS上であれば、当該
汎用OSがサポートするシステムコールを用いてタスク
の制御を行う。
(57) [Summary] [PROBLEMS] In multitask control for controlling an application program including a plurality of tasks, it is possible to have the same interface specification on all platforms and perform the same operation by an application. A common part (103) includes an application (10).
1 performs scheduling related to the execution of the plurality of application tasks 102 and issues a task control instruction such as a task suspending process or a task resuming process to the model-dependent portion 10.
Issue to 6. The model dependent part 106 is the common part 103
The task is controlled based on the issued task control instruction. Here, if the operating environment of the application is on the actual MPU, the task suspending function 109 and the resuming function 110 directly rewrite the contents of the task control block. On the other hand, if the operating environment is on a general-purpose OS, the task is controlled using a system call supported by the general-purpose OS.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、マルチタスク処理
が可能なマルチタスク制御方法及び記憶媒体に関する。
[0001] 1. Field of the Invention [0002] The present invention relates to a multitask control method and a storage medium capable of performing multitask processing.

【0002】[0002]

【従来の技術】一般に、リアルタイムOS(以下、RT
OSという)では、実機上で動作するRTOSをワーク
ステーションやPCなどの汎用開発マシン上で模擬実行
するためのRTOSシミュレーション開発環境が存在す
る。
2. Description of the Related Art Generally, a real-time OS (hereinafter, referred to as RT)
OS), there is an RTOS simulation development environment for simulating an RTOS running on a real machine on a general-purpose development machine such as a workstation or a PC.

【0003】これらのRTOSシミュレーション環境に
は、(1)RTOSのシステムコールのスタブを用意
し、アプリケーション・タスク毎の単体テストを開発マ
シン上で行うもの、(2)ターゲットのMPUの動作を
模擬するシミュレータを用いて、ターゲット用のクロス
コンパイルで生成したRTOSとアプリケーションを動
作させるもの、(3)ターゲット用RTOSのハードウ
ェア依存部分を改変して、それを汎用マシンのOS(U
NIXやWindowsなど)が提供するマルチスレッ
ド機構等を利用し、アプリケーション・タスクをスレッ
ドとして実現するもの、などが存在する。
These RTOS simulation environments include (1) a stub for RTOS system calls and a unit test for each application task performed on a development machine, and (2) a simulator for simulating the operation of a target MPU. (3) modify the hardware-dependent part of the target RTOS and convert it to a general-purpose machine OS (U
There are those that use a multi-thread mechanism provided by NIX or Windows to realize application tasks as threads.

【0004】特に(2),(3)の方法では、実機上の
RTOSとほぼ同じ関数インターフェースを持つように
作られている。これにより、実機上とほぼ同じアプリケ
ーション・プログラムをRTOSシミュレータ上で動作
させることが可能である。
In particular, the methods (2) and (3) are made to have almost the same function interface as the RTOS on the actual machine. As a result, it is possible to operate an application program that is substantially the same as that of the actual machine on the RTOS simulator.

【0005】また、RTOSアプリケーションのデバッ
グ環境として、実機上ではICEや、ROMエミュレー
タを介して、もしくはリモートデバッグなどの手法によ
り、開発マシンと実機を接続し、開発マシン上で動作す
るソースレベルデバッガを利用するものが一般的であ
る。また、開発マシン上で動作させるRTOSシミュレ
ータに対するデバッグ環境としては、上記(2)の場合
においては、通常、MPUのシミュレータが機械語もし
くはC言語などのソースレベルのデバッガを備えてい
る。また、上記(1),(3)に関しては、開発マシン
上で動作させるネイティブのソースレベルデバッガを使
用してデバッグ/テストを行うことができる。
[0005] As a debug environment for an RTOS application, a source level debugger that operates on the development machine by connecting the development machine to the real machine on the actual machine via an ICE or ROM emulator or by remote debugging is used. What is used is common. As a debug environment for an RTOS simulator operated on a development machine, in the case of the above (2), the MPU simulator usually includes a source-level debugger such as a machine language or C language. Regarding the above (1) and (3), debugging / testing can be performed using a native source level debugger operated on a development machine.

【0006】ところが、RTOSアプリケーションのデ
バッグにおいては、これらのソースレベルデバッガを用
いてブレークをかけてアプリケーションの動作を一時停
止させたり、ステップ実行を行うデバッグスタイルが必
ずしも効果的に行えるとは限らない。つまり、リアルタ
イム性が求められるこの種のアプリケーションにおいて
は、プログラムを停止させた瞬間にそのアプリケーショ
ンの再現性が失われてしまうからである。
However, in debugging an RTOS application, it is not always possible to effectively perform a debugging style in which the use of these source-level debuggers causes a break to temporarily suspend the operation of the application or perform step execution. That is, in such an application that requires real-time properties, the reproducibility of the application is lost at the moment when the program is stopped.

【0007】そのため、近年ではアプリケーションプロ
グラムを停止させること無く、システムコールやタスク
スイッチの履歴を記録しておき、しかる後にその情報を
取り出して開発マシン上などでグラフィカルに表示し、
アプリケーションタスクの動きが意図したとおりである
かを解析することができるツール(以降、タスクスイッ
チ・ビューアと呼ぶ)が開発され普及し始めている。
For this reason, in recent years, the history of system calls and task switches is recorded without stopping the application program, and the information is then taken out and displayed graphically on a development machine.
A tool (hereinafter, referred to as a task switch viewer) capable of analyzing whether the movement of an application task is as intended has been developed and started to spread.

【0008】また、特開平5−282160の「リアル
タイム・シミュレーション開発機構」のようにダイナミ
ック・ローディング方式を採用し、実機とシミュレーシ
ョン開発環境でアプリケーションをまったく変更せずに
動作させることを目的としたシステムも存在する。
Further, a system which employs a dynamic loading method, such as the "real-time simulation development mechanism" of Japanese Patent Application Laid-Open No. 5-282160, is intended to operate an application in a real machine and a simulation development environment without any change. Also exists.

【0009】[0009]

【発明が解決しようとする課題】しかしながら、上記
(1)の方法では、タスク単体の振る舞いの確認を行う
のみであり、タスク間の同期・通信に関わるテストを行
うことはできない。また、上記(2)の方法には、実行
速度が遅いために、大きな規模のアプリケーションのテ
ストにおいてリアルタイム性がないという問題や、効率
上の問題が存在する。これに対して上記(3)の方法
は、シミュレーション開発環境の実現が比較的容易で、
実行速度の面でも実機に最も近い振る舞いをするとされ
ている。しかしながら、(3)の方法においても、アプ
リケーションの振る舞いやデバッグ環境に関して以下の
ような問題点が存在する。
However, in the above method (1), only the behavior of each task is confirmed, and a test relating to synchronization and communication between tasks cannot be performed. In addition, the method (2) has a problem that the execution speed is low, so that there is no real-time property in a test of a large-scale application, and a problem in efficiency. On the other hand, the method (3) is relatively easy to realize a simulation development environment,
In terms of execution speed, it is said to be the closest to the actual machine. However, the method (3) has the following problems with respect to the behavior of the application and the debug environment.

【0010】プラットフォーム間のアプリケーション
の動作が異なる:従来のRTOSでは、実機上で動作す
るRTOSと開発用コンピュータの汎用OS上で動作さ
せるRTOSシミュレータの間には、同一のアプリケー
ションが厳密に同一の振舞を行うことが保証されていな
い。それは、シミュレーション環境では、汎用OS(U
NIXやWindowsなど)が提供するマルチスレッ
ド機構をそのまま利用してタスク(スレッド)間の同期
・通信機能などを実現しているためである。すなわち、
汎用OSが提供するマルチスレッド機構では、その汎用
OS上でスケジューリングされるため、同時に動く他の
プロセスや周辺デバイスへのアクセスの影響等で、スケ
ジューリングの結果が変化する可能性がある。
[0010] Application behavior between platforms is different: In a conventional RTOS, the same application runs exactly the same between an RTOS running on a real machine and an RTOS simulator running on a general-purpose OS of a development computer. Is not guaranteed to do so. It is a general-purpose OS (U
This is because a multi-thread mechanism provided by NIX or Windows is used as it is to realize a synchronization / communication function between tasks (threads). That is,
In the multi-thread mechanism provided by the general-purpose OS, the scheduling is performed on the general-purpose OS. Therefore, there is a possibility that the result of the scheduling may change due to the influence of access to other processes and peripheral devices running simultaneously.

【0011】プラットフォーム間の移植の問題:同様
の問題で、RTOSシミュレータを動作させる汎用OS
を変更する場合(例えば、UNIXからWindows
へ移植する等)、それぞれの汎用OSで提供しているマ
ルチスレッド機構のインターフェース仕様や動作が異な
るため、OSシミュレータ同士の間でもアプリケーショ
ンの動作の再現性を確保するのは困難である。また、シ
ミュレータプログラム中に、汎用OSが提供するマルチ
スレッド機構のAPIが散在しているため、ポーティン
グ(Porting:移植)が容易ではない。
[0011] The problem of porting between platforms: A similar problem, a general-purpose OS that runs an RTOS simulator
Is changed (for example, from UNIX to Windows
Since the interface specifications and operations of the multithread mechanism provided by each general-purpose OS are different, it is difficult to ensure the reproducibility of the operation of the application even between OS simulators. Further, since the multi-thread mechanism API provided by the general-purpose OS is scattered in the simulator program, porting (porting) is not easy.

【0012】デバッグ情報(トレース情報)取得が困
難:また、実機上でタスクスイッチ・ビューアなどのデ
バッグ装置を利用する場合は、実機上のRTOSのタス
クスイッチを行う部分にトレース情報を取り出して記録
する機能を追加し、記録された情報を何らかの方法(実
機に用意されている物理的な通信手段:例えば、シリア
ル(=シリアル通信;RS−232Cなどに代表されるビット
単位の通信手法の一つ)やソケット(TCP/IPネットワ
ークを利用するためのAPIの一つ)など)で外部の表示
装置(タスクスイッチ・ビューアなど)に取りだす仕組
みを用意すればよい。ところが、RTOSシミュレータ
において汎用OSのスレッドの同期・通信機構を利用し
ている場合、スレッドのコンテキストスイッチ(つま
り、タスクスイッチ)はその汎用OS上で行われるた
め、タスクスイッチの履歴を収集するには汎用OSの内
部にまで立ち入る必要があり、非常に困難である。従っ
て、RTOSシミュレータのトレース情報を収集するの
は容易ではない。
Difficulty acquiring debug information (trace information): When a debug device such as a task switch viewer is used on the actual device, the trace information is extracted and recorded in a portion of the actual device that performs a task switch of the RTOS. A function is added, and the recorded information is transmitted by some method (physical communication means prepared in the actual device: for example, serial (= serial communication; one of bit-based communication methods represented by RS-232C, etc.)) It is sufficient to provide a mechanism for extracting data to an external display device (such as a task switch / viewer) by using a socket or a socket (an API for using a TCP / IP network). However, when the thread synchronization / communication mechanism of the general-purpose OS is used in the RTOS simulator, the thread context switch (that is, the task switch) is performed on the general-purpose OS. It is necessary to enter the inside of the general-purpose OS, which is very difficult. Therefore, it is not easy to collect trace information of the RTOS simulator.

【0013】特開平5−282160は上記を解決す
ることを目的としているが、汎用OSで利用するシステ
ムコールの種類の言及が無く、タスクスケジューリング
はシミュレータを動作させる汎用OSに依存する構成と
なっている。また、に関する様な、タスクスイッチの
トレース情報を表示させる仕組みは持っていない。
Japanese Patent Application Laid-Open No. 5-282160 aims to solve the above problem, but there is no mention of the type of system call used in a general-purpose OS, and task scheduling depends on a general-purpose OS for operating a simulator. I have. Also, there is no mechanism for displaying task switch trace information as described above.

【0014】本発明は上記の問題点に鑑みてなされたも
のであり、その目的は、あらゆるプラットフォーム上で
同一のインターフェース仕様を持ち、アプリケーション
が同一の動作を行うことを可能とするRTOSの構造を
提供することにある。
The present invention has been made in view of the above problems, and an object of the present invention is to provide an RTOS structure that has the same interface specifications on all platforms and enables applications to perform the same operations. To provide.

【0015】また、本発明の目的は、あらゆるプラット
フォーム上で同一のインターフェース仕様を持ち、アプ
リケーションが同一の動作を行うことを可能とするRT
OS上のデバッグ環境(タスクスイッチ・ビューア等)
において、あらゆるプラットフォーム上で統一的なデバ
ッグ情報を収集することができる機構を提供することに
ある。
Another object of the present invention is to provide an RT that has the same interface specifications on all platforms and enables an application to perform the same operation.
OS debugging environment (task switch / viewer, etc.)
The object of the present invention is to provide a mechanism that can collect unified debug information on all platforms.

【0016】[0016]

【課題を解決するための手段】上記の目的を達成するた
めの本発明のマルチタスク制御方法は以下の工程を備え
る。すなわち、複数のタスクを含むアプリケーションプ
ログラムを制御するためのマルチタスク制御方法であっ
て、前記複数のタスクの実行に関わるスケジューリング
を行い、タスク制御指示を発行するスケジューリング工
程と、前記スケジューリング工程で発行されたタスク制
御指示に基づいて、当該アプリケーションプログラムの
動作環境に応じてタスクの実行を制御する実行工程とを
備える。
According to the present invention, there is provided a multitask control method comprising the following steps. That is, a multi-task control method for controlling an application program including a plurality of tasks, wherein a scheduling step of performing a scheduling related to the execution of the plurality of tasks and issuing a task control instruction is provided. Executing the task in accordance with the operation environment of the application program based on the task control instruction.

【0017】また、本発明によれば、上記マルチタスク
制御方法をコンピュータに実現させるための制御プログ
ラムを格納する記憶媒体が提供される。
Further, according to the present invention, there is provided a storage medium for storing a control program for causing a computer to implement the multitask control method.

【0018】[0018]

【発明の実施の形態】以下、添付の図面を参照して本発
明の好適な実施形態を詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Preferred embodiments of the present invention will be described below in detail with reference to the accompanying drawings.

【0019】[第1の実施形態]図24は第1の実施形
態におけるプログラムシミュレーション環境を提供する
コンピュータ装置を示す図である。10はシミュレーシ
ョン環境を提供するためのコンピュータ装置である。コ
ンピュータ装置10は、CPU11、ROM12、RA
M13、入力装置14、表示装置15、外部記憶装置1
6を備え、これらはバス17によって接続されている。
外部記憶装置16には、実機20において実行すべきア
プリケーション101と、RTOSの共通部分103
と、RTOSの汎用OS依存部分106aが格納されて
いる。
[First Embodiment] FIG. 24 is a diagram showing a computer device for providing a program simulation environment according to the first embodiment. Reference numeral 10 denotes a computer device for providing a simulation environment. The computer device 10 includes a CPU 11, a ROM 12, an RA
M13, input device 14, display device 15, external storage device 1
6 which are connected by a bus 17.
The external storage device 16 includes an application 101 to be executed in the actual device 20 and a common part 103 of the RTOS.
And the general-purpose OS-dependent portion 106a of the RTOS.

【0020】一方、実機20は制御部としてCPU2
1、ROM22、RAM23、I/Oインターフェース
24を備え、ROM22に格納されたアプリケーション
101に基づいて制御対象装置25を制御する。CPU
21はROM22に格納された制御プログラム(アプリ
ケーション101、RTOSの共通部分103、RTO
Sのハードウエア依存部分106b)を実行することで
制御対象装置25の制御を行うことになる。
On the other hand, the actual machine 20 is a CPU
1, a ROM 22, a RAM 23, and an I / O interface 24, and controls the control target device 25 based on an application 101 stored in the ROM 22. CPU
Reference numeral 21 denotes a control program (application 101, common part 103 of RTOS, RTO) stored in ROM 22.
By executing the hardware-dependent portion 106b) of S, the control target device 25 is controlled.

【0021】図1は第1の実施形態におけるRTOSの
基本的な構成図である。101は開発対象となるアプリ
ケーションである。102はアプリケーション・タスク
であり、アプリケーション101は複数のアプリケーシ
ョン・タスク102の集合である。個々のアプリケーシ
ョン・タスク102はシステムコールを発行することに
よって、RTOSの機能を利用する。
FIG. 1 is a basic configuration diagram of the RTOS in the first embodiment. Reference numeral 101 denotes an application to be developed. Reference numeral 102 denotes an application task, and the application 101 is a set of a plurality of application tasks 102. Each application task 102 uses the function of the RTOS by issuing a system call.

【0022】103はハードウェアに依存しない構成要
素からなるRTOSの共通部分である。104はRTO
Sシステムコールの実体の集合である。ここで用いるR
TOSシステムコールは、ファイルシステムやネットワ
ークインターフェースなどのハードウェア依存となるも
のは含まず、タスク制御やタスク間同期・通信機能(セ
マフォ、ロック、メールボックス、イベントフラグ、キ
ュー、etc)など一般的なハードウェアに依存しない
ものを想定している。また、システムコール実行後、ス
ケジューリング機能105によってタスク・スイッチの
リスケジューリングが行われる。
Reference numeral 103 denotes a common part of the RTOS including components independent of hardware. 104 is RTO
It is a set of entities of the S system call. R used here
The TOS system call does not include hardware-dependent ones such as a file system and a network interface, and includes general tasks such as task control and inter-task synchronization / communication functions (semaphores, locks, mailboxes, event flags, queues, etc). It is assumed that it does not depend on hardware. After the execution of the system call, the scheduling function 105 reschedules the task switch.

【0023】106はRTOSのハードウェア/機種に
依存する構成要素群(以降、機種依存部分と呼ぶ)であ
る。機種依存部分106において、109は現在実行中
のタスクを中断する機能で、110は中断状態のタスク
の実行を再開する機能である。108はタスクスイッチ
制御機能で、タスク中断機能109およびタスク再開機
能110を用いて、実行中のタスクを別のタスクに切り
替える働きをする。なお、機種依存部分106は、図2
4で上述した汎用OS依存部分106a、ハードウエア
依存部分106bを総称したものである。111はMP
Uまたは汎用OSを表す。
Reference numeral 106 denotes a component group that depends on the hardware / model of the RTOS (hereinafter, referred to as a model-dependent portion). In the model-dependent portion 106, reference numeral 109 denotes a function for interrupting a currently executing task, and reference numeral 110 denotes a function for restarting execution of a task in an interrupted state. A task switch control function 108 switches a running task to another task using the task suspending function 109 and the task resuming function 110. It should be noted that the model-dependent portion 106 is shown in FIG.
4, the generic OS-dependent part 106a and the hardware-dependent part 106b described above are collectively referred to. 111 is MP
U or a general-purpose OS.

【0024】アプリケーション・タスク102などか
ら、RTOSに対してシステムコールの発行が行われた
場合、共通部分103ではシステムコールの実体104
を実行し、その結果リスケジューリングを行う必要があ
る場合は、スケジューリング機能105を呼び出してリ
スケジューリングを行う。タスクスイッチ制御機能10
8はタスクの中断および再開の要求を受けてタスクの切
り替えを行う。
When a system call is issued to the RTOS from the application task 102 or the like, the common part 103 executes the system call entity 104.
Is executed, and as a result, when it is necessary to perform rescheduling, the scheduling function 105 is called to perform rescheduling. Task switch control function 10
8 switches the task in response to a request for suspending and resuming the task.

【0025】図2は、システムコール発行からタスクス
イッチまでの、共通部分による処理の手順を表したフロ
ーチャートである。システムコール関数の呼び出しを受
けると、ステップS702において、タスクスイッチ制
御機能108に対してタスク中断要求を発行する。そし
て、ステップS703においてシステム・コール本体1
04を実行する。本リアルタイムOSのシステムコール
関数の内部は、機能的に2つの部分に別れている。それ
は、タスクの実行制御(タスクスイッチ:タスクの中
断、リスケジユーリング、タスクの再開制御を行なう)
部分とシステムコール本体部分です。つまり、システム
コールにはタスクの生成/破壊や、メッセージキュー、
セマフオ、イベントフラグのペンド/ポストなどがある
が、それらの機能を実行する部分が「システム・コー
ル」本体で、その機能を実行した結果に応じて、タスク
の実行制御(タスクスイッチ)が行われる。そして、シ
ステム・コール本体104を実行した結果、スケジュー
リングの必要が生じた場合は、ステップS704からス
テップS705へ進み、スケジューリング機構105を
呼び出してリスケジューリングを行う。なお、システム
コールの種別や、状況によってはスケジユーリングの必
要がない場合がある。たとえば、新しいセマフオを生成
するとか、現在のイベントフラグの値を調べる、といっ
たシステムコールの実行はタスクスイッチの要因となる
状態変化を起こさないので、その場合はスケジユーリン
グ機構を呼び出す必要は無い。逆に、セマフオ、イベン
トフラグのポスト・ペンドなどは、タスクスイッチの要
因となる状態変化を引き起こすので、そのようなシステ
ムコール実行後は必ずスケジユーリングを行う。つま
り、スケジユーリングを必要とするシステムコールと必
要としないシステムコールがあり、その判断はシステム
コール本体でセットされるフラグ(スケジユーリング要
求フラグ)により行われる。次にステップS706にお
いて、タスク制御機能108へタスク再開要求を発行
し、本処理を終える。なお、次に実行を再開すべきタス
クは、ステップS705のスケジユーリング機構によっ
て決定される。スケジユーリングの必要が無い場合は、
直前のタスクが選択される。従って、ステップS706
では、現在選択されている次実行タスクを再開するため
の手続きを行っている。
FIG. 2 is a flowchart showing the procedure of processing by the common part from the system call issuance to the task switch. Upon receiving the call of the system call function, a task interruption request is issued to the task switch control function 108 in step S702. Then, in step S703, the system call body 1
Execute 04. The inside of the system call function of the real-time OS is functionally divided into two parts. It controls task execution (task switch: suspends tasks, reschedules, resumes tasks)
Part and system call body part. In other words, system calls include task creation / destruction, message queues,
There are semaphores, pending / post event flags, etc. The part that executes those functions is the "system call" itself, and task execution control (task switching) is performed according to the result of executing the function. . Then, as a result of executing the system call body 104, if scheduling becomes necessary, the process proceeds from step S704 to step S705, in which the scheduling mechanism 105 is called to perform rescheduling. Note that scheduling may not be necessary depending on the type of the system call or the situation. For example, execution of a system call, such as generating a new semaphore or checking the current value of an event flag, does not cause a state change that causes a task switch. In this case, there is no need to call the scheduling mechanism. Conversely, semaphores, post-pending of event flags, and the like cause a state change that causes a task switch. Therefore, scheduling is always performed after executing such a system call. That is, there are system calls that require scheduling and system calls that do not. The determination is made by a flag (scheduling request flag) set in the system call itself. Next, in step S706, a task restart request is issued to the task control function 108, and this processing ends. The task whose execution should be resumed next is determined by the scheduling mechanism in step S705. If there is no need for scheduling,
The previous task is selected. Therefore, step S706
Then, a procedure for restarting the currently selected next execution task is performed.

【0026】スケジューリング機能105におけるスケ
ジューリング・アルゴリズムには、プライオリティ順や
タイムシェアリング、またはそれらを組み合わせたもの
などさまざまなタイプのものが考えられる。たとえば、
図3は、プライオリティ順のスケジューリングアルゴリ
ズムを実現した一例を説明する図である。この場合、ス
ケジューリング機能105は、実行待キュー770を保
持している。実行待キュー770は、優先順位毎に実行
待状態のタスクをリスト上に保持し、その並び順は、待
ち行列としてFIFOのキューとして管理している。最
高優先順位実行待キュー771にリンクされたタスクの
中で先頭のタスク774が次実行タスクに決定される。
図3のスケジユーリングアルゴリズムは、優先度+待ち
順となっている。実行可能なタスクは優先度毎に独立し
た待ち行列(FIFO)に並べられている。実行可能な
タスク群の中で、もっとも優先度が高く、且つその待ち
行列の先頭に位置するタスクが次実行タスクとなる。つ
まり、常に図3の左上のタスクが実行権を得ることにな
る(図3ではタスク1)。よって、図3のタスク1〜タ
スク7における番号(数字)は実行される順番を表して
いるものでは無い。実行中のタスク(図のタスク1)が
資源待ちなどの要因で実行可能タスク群から外される
と、次にもっとも左上となるタスク(図ではタスク2)
が実行権を得る。また、現在実行中のタスクよりも優先
度の高いタスクが実行可能状態になった時は、そのタス
クが実行権を得ることになる。
Various types of scheduling algorithms in the scheduling function 105 can be considered, such as priority order, time sharing, or a combination thereof. For example,
FIG. 3 is a diagram illustrating an example in which a scheduling algorithm in priority order is realized. In this case, the scheduling function 105 holds an execution waiting queue 770. The execution waiting queue 770 holds tasks in the execution waiting state on a list for each priority, and manages the order of the tasks as a FIFO queue as a queue. The first task 774 among the tasks linked to the highest priority execution wait queue 771 is determined as the next execution task.
The scheduling algorithm in FIG. 3 is in priority + waiting order. Executable tasks are arranged in an independent queue (FIFO) for each priority. Among the executable tasks, the task having the highest priority and located at the head of the queue is the next task to be executed. That is, the task at the upper left of FIG. 3 always obtains the execution right (task 1 in FIG. 3). Therefore, the numbers (numbers) in tasks 1 to 7 in FIG. 3 do not indicate the order in which they are executed. When the task being executed (task 1 in the figure) is removed from the executable task group due to a resource wait or the like, the task at the next upper left (task 2 in the figure)
Gets execution right. Further, when a task having a higher priority than the task currently being executed is in an executable state, the task gets the execution right.

【0027】また、別の例として、図4は、タイムシェ
アリングによるスケジューリングを実現した一例を示す
図である。図4によれば、スケジューリング機能105
は、実行待キュー790を保持している。実行待キュー
790は、待ち行列としてFIFOのキューとして管理
している。実行状態にある先頭のタスク791が一定時
間経過した場合、そのタスクは待ち行列キューの最後尾
に送られ、キューの2番目のタスク792が先頭になり
そのタスクが次実行タスクに決定される。このように、
実行待ちのタスクは時間によって順次切り替えられてい
く。スケジューリング・アルゴリズムとしては、これら
を組み合わせたものや、さらに複雑な計算式に基づいて
決定する方式などが考えられる。
As another example, FIG. 4 is a diagram showing an example in which scheduling by time sharing is realized. According to FIG. 4, the scheduling function 105
Holds the execution wait queue 790. The execution queue 790 is managed as a FIFO queue as a queue. If the first task 791 in the execution state has passed for a certain period of time, the task is sent to the end of the queue, the second task 792 in the queue becomes the first task, and the task is determined as the next execution task. in this way,
The tasks waiting to be executed are sequentially switched over according to time. As a scheduling algorithm, a combination of these, a method of determining based on a more complicated calculation formula, and the like are conceivable.

【0028】次に、以上のような基本構成を有するRT
OSを(1)実機上と(2)UNIXワークステーショ
ン上に適用するための機種依存部分106と、スケジュ
ーリング機能105に関して説明する。なお、共通部分
103は(1)、(2)とも同一のプログラム・モジュ
ールを使用している。
Next, the RT having the above basic configuration
A description will be given of the model-dependent portion 106 for applying the OS to (1) the actual machine and (2) the UNIX workstation, and the scheduling function 105. The common part 103 uses the same program module for both (1) and (2).

【0029】(1)実機におけるRTOS CPU21として、モトローラ社製のMC68000を
搭載した実機20に対して本実施形態のRTOSを動作
させるものとする。図1における機種依存部分106
(図24におけるRTOSのハードウエア依存部分10
6b)の構成要素について説明する。本実施形態では、
メモリ(RAM23)上に、機種依存部分106がアク
セスするタスク固有のコンテキスト情報(ハードウェア
・レジスタ、プログラムカウンタ、タスクスタックな
ど)を格納するタスク・コントロール・ブロック(以
下、TCBと記す)を作成する。アプリケーション・タ
スクはRTOSの初期化ファイルの中で定義され、コン
パイル時に静的に配置されているものとする。
(1) RTOS in Real Machine The RTOS according to the present embodiment is operated on a real machine 20 equipped with a Motorola MC68000 as the CPU 21. Model dependent part 106 in FIG.
(Hardware dependent part 10 of RTOS in FIG. 24
The component 6b) will be described. In this embodiment,
A task control block (hereinafter, referred to as TCB) for storing context information (hardware register, program counter, task stack, etc.) specific to the task accessed by the model-dependent portion 106 is created on the memory (RAM 23). . It is assumed that the application task is defined in the initialization file of the RTOS and is statically arranged at the time of compilation.

【0030】タスク中断機能109:図5は、実機側
におけるタスク中断機能の処理の流れを表すフローチャ
ートである。タスクスイッチ制御機能108はタスク中
断要求を受けるとタスク中断機能109を実行する。タ
スク中断機能109は、現在実行中のタスクのコンテキ
スト情報を、そのタスクのTCBに保存する。具体的に
は、スタック上に保存されたプログラムカウンタの値を
読み出し、読み出したプログラムカウンタの値、ハード
ウェア・レジスタの値およびスタックポインタ等をその
タスクのTCBに書き込む(ステップS502、S50
3)。そして、当該TCB内のタスクの状態を中断状態
にセットして、中断処理を完了する(ステップS50
4)。
Task Suspension Function 109: FIG. 5 is a flowchart showing the flow of processing of the task suspension function on the actual machine side. Upon receiving the task suspension request, the task switch control function 108 executes the task suspension function 109. The task suspending function 109 saves context information of the currently executing task in the TCB of the task. Specifically, the value of the program counter stored on the stack is read, and the read value of the program counter, the value of the hardware register, the stack pointer, and the like are written to the TCB of the task (steps S502 and S50).
3). Then, the state of the task in the TCB is set to the suspended state, and the suspension processing is completed (step S50).
4).

【0031】タスク再開機能110:図6は、実機側
におけるタスク再開機能109の処理の流れを表すフロ
ーチャートである。タスク再開要求を受けると、まずタ
スク再開機能109はタスク再開要求から再開すべきタ
スクのIDを獲得する(ステップS602)。そして、
獲得したタスクIDに対応するタスクのTCBのタスク
の状態を実行中とする(ステップS603)。更に、中
断中のタスクのコンテキスト情報を、そのタスクのTC
Bからロードする(ステップS604)。具体的には、
該当するTCBに保存されているハードウェア・レジス
タ、プログラムカウンタ、スタックポインタの値を読み
出し、それぞれハードウエアレジスタにセットすること
によって、以前に中断した状態からそのタスクを再開す
ることができる。
Task Resuming Function 110: FIG. 6 is a flowchart showing the flow of processing of the task resuming function 109 on the actual machine side. When the task resuming request is received, the task resuming function 109 first acquires the ID of the task to be resumed from the task resuming request (step S602). And
The state of the task in the TCB of the task corresponding to the acquired task ID is set to “executing” (step S603). Further, the context information of the suspended task is stored in the TC of the task.
Load from B (step S604). In particular,
By reading the values of the hardware register, program counter, and stack pointer stored in the corresponding TCB and setting them in the respective hardware registers, the task can be resumed from the previously suspended state.

【0032】タスクスイッチ制御機能108:実行状
態のタスクを切り替える。具体的には、タスク中断要求
を受けて上述のタスク中断機能109を起動させ、実行
状態だったタスクのコンテキスト情報を保存して中断状
態にする。また、タスク再開要求を受けた場合は、上述
のタスク再開機能110を起動させ、次の実行タスクの
コンテキスト情報をロードして、中断状態のタスクを実
行状態へ切り替える。
Task switch control function 108: Switches the task in the execution state. Specifically, upon receiving the task suspension request, the above-described task suspension function 109 is activated, and the context information of the task that has been in the execution state is stored to be in the suspension state. When a task resumption request is received, the above-described task resumption function 110 is activated, the context information of the next execution task is loaded, and the task in the suspended state is switched to the execution state.

【0033】上記(1)〜(3)は、機種依存部分10
6の構成要素であり、アセンブリ言語で書かれており、
その中心となるのはタスクスイッチなどのコンテキスト
操作を行う機能である。RTOSのシステムコールの実
体104およびスケジューリング機能105は共通部分
103に含まれる。
The above (1) to (3) correspond to the model-dependent part 10.
6 are written in assembly language,
At its core is the function of performing context operations such as task switches. The RTOS system call entity 104 and the scheduling function 105 are included in the common part 103.

【0034】(2)シミュレーション環境におけるRT
OS 次に、シミュレーション環境における本RTOSの実装
例として、Sun Microsystems社の汎用UNIXOSであ
る、SunOS5.x(xはマイナーバージョンをあら
わす数字。以降、略してSunOSと呼ぶ)を搭載した
ワークステーション上で本RTOSのシミュレータを動
作させる場合を説明する。以下では、図1における機種
依存部分106(シミュレーション環境側の機種依存部
分であり、図24の汎用OS依存部分106aに対応す
る)の構成要素について説明する。なお、本実施形態で
は、SunOSが提供するマルチスレッドライブラリを
利用して、単一プロセス内でアプリケーション・タスク
をスレッドとして動作させる。
(2) RT in a simulation environment
OS Next, as an implementation example of the RTOS in the simulation environment, SunOS5. A case will be described in which the simulator of the present RTOS is operated on a workstation equipped with x (x is a number representing a minor version; hereinafter, simply referred to as SunOS). In the following, components of the model-dependent portion 106 in FIG. 1 (a model-dependent portion on the simulation environment side and corresponding to the general-purpose OS-dependent portion 106a in FIG. 24) will be described. In the present embodiment, an application task is operated as a thread in a single process by using a multithread library provided by SunOS.

【0035】SunOSでは、スレッドの中断、再開は
ライブラリが提供するシステムコールによって実現され
る。また、アプリケーション・タスクは、メイン・スレ
ッドの初期化ルーチンの中でシステムコールにより生成
されるものとする。
In SunOS, suspension and resumption of a thread are realized by a system call provided by a library. The application task is generated by a system call in the initialization routine of the main thread.

【0036】タスク中断機能109:図7はシミュレ
ーション機側におけるタスク中断機能の処理の流れを表
すフローチャートである。タスク中断要求によりタスク
中断機能が実行されると、スレッドライブラリが提供す
るthr_suspend()システムコールにより、スレッド化さ
れたタスクの実行を中断状態にする(ステップS120
2)。タスクのコンテキスト情報はSunOSによって
適切に保存される。その後、ステップS1203におい
て、当該タスクのTCBにおける“タスクの状態”を
“中断状態”にセットする。
Task Suspension Function 109: FIG. 7 is a flowchart showing the processing flow of the task suspension function on the simulation machine side. When the task suspension function is executed in response to the task suspension request, the execution of the threaded task is suspended by the thr_suspend () system call provided by the thread library (step S120).
2). Task context information is properly stored by the SunOS. After that, in step S1203, the “task state” in the TCB of the task is set to “interrupted state”.

【0037】タスク再開機能110:図8は、シミュ
レーション機側のタスク再開機能の処理の流れを表すフ
ローチャートである。タスク再開要求によりタスク再開
機能が起動されると、実行を再開すべきタスクのタスク
IDをタスク再開要求より獲得する(ステップS130
2)。次に、実行再開すべきタスクのTCBにおける
“タスクの状態”を“実行中”とする(ステップS13
02)。次に、スレッドライブラリが提供するthr_resu
me()システムコール(ステップS1302で得たタスク
IDを引数とする)により、中断状態にあるスレッド化
されたタスクを実行状態にすることができる(ステップ
S1304)。なお、タスクのコンテキスト情報はSu
nOSによって適切に復帰され、指定されたタスクを以
前の中断位置から実行を再開することができる。
Task Resume Function 110: FIG. 8 is a flow chart showing the processing flow of the task restart function on the simulation machine side. When the task resuming function is activated by the task resuming request, the task ID of the task whose execution is to be resumed is obtained from the task resuming request (step S130).
2). Next, the “task state” in the TCB of the task whose execution is to be resumed is set to “executing” (step S13).
02). Next, thr_resu provided by the thread library
By the me () system call (using the task ID obtained in step S1302 as an argument), the threaded task in the suspended state can be put into the execution state (step S1304). The context information of the task is Su
The task is properly returned by the nOS, and execution of the specified task can be resumed from the previous interrupt position.

【0038】タスクスイッチ制御機能108:実行状
態のタスクを切り替える。具体的には、タスク中断要求
を受けてタスク中断機能109を起動させ、実行状態だ
ったタスク(スレッド)を中断状態とする。また、タス
ク再開要求を受けてタスク再開機能110を起動させ、
次に実行するタスク(スレッド)を実行状態にする。こ
の結果、実行状態となるアプリケーション・タスクは、
この系の中で常に1つとなるため(あるタスクが1つ再
開すると、実行中のタスクが1つ中断するので、常に1
つのアプリケーションタスクしか動作していないことに
なる)、SunOSによるスレッド・スケジューリング
が起こっても、必ず目的とするタスク(スレッド)が実
行される。このしくみにより、実機上で動く本RTOS
と同一の順番でタスクが実行されることが保証される。
Task switch control function 108: Switches the task in the execution state. Specifically, upon receiving the task suspension request, the task suspension function 109 is activated, and the task (thread) that has been in the execution state is brought into the suspension state. In addition, the task resuming function 110 is activated in response to the task resuming request,
Put the next task (thread) to be executed. As a result, the application tasks that are in the running state are:
Since there is always one in this system (when one task is resumed, one running task is suspended, so
Even if thread scheduling by SunOS occurs, a target task (thread) is always executed. This mechanism allows this RTOS to run on real machines
The tasks are guaranteed to be executed in the same order as.

【0039】なお、上記〜は、機種依存部分106
の構成要素でSunOSのマルチスレッドライブラリを
用いてC言語で書かれており、その中心となるのはタス
クスイッチなどのコンテキスト操作を行う機能である。
It should be noted that the above-mentioned is the model-dependent portion 106
Are written in C using the multithread library of SunOS, and the main function is a function for performing a context operation such as a task switch.

【0040】以上説明したように、第1の実施形態のR
TOSによれば、ハードウェアに依存する部分を必要最
小限となるように切りだし、それ以外の部分は様々なプ
ラットフォームで共通に利用できるようにC言語で書か
れており、ハードウェアの違いによる影響が極力少なく
なるような構造を有する。
As described above, R in the first embodiment is
According to TOS, the parts that depend on the hardware are cut out to the minimum necessary, and the other parts are written in C so that they can be commonly used on various platforms. It has a structure to minimize the influence.

【0041】すなわち、ハードウェアに依存する部分と
は、タスクの実行を中断する機能と、中断されたタ
スクの実行を再開する機能と、これらの機能を用いて
タスクスイッチの制御をする機能であり、これらの機能
を実現するプログラムモジュールは対象とするMPUや
汎用OSによって書き換える必要がある。
That is, the hardware-dependent parts are a function of interrupting the execution of a task, a function of resuming the execution of the interrupted task, and a function of controlling a task switch using these functions. The program modules that realize these functions need to be rewritten by the target MPU or general-purpose OS.

【0042】一方、タスク制御やタスク間の同期・通信
機能やタスクスイッチのスケジューリング機能等、その
他すべてのRTOSの機能部分、つまり、RTOSのシ
ステムコールを提供する階層は、すべてC言語により記
述されているハードウェアに依存しない階層である。こ
のように、タスクのコンテキスト制御等ごく限られた機
能で実現する機種依存部分と、システムコール本体を実
現する共通部分が完全に切り分けられた構造を持つこと
により、あらゆるプラットフォーム上で同一のインター
フェース仕様を持ち、アプリケーションが同一の動作を
行うことが可能となる。
On the other hand, all other RTOS functional parts, such as task control, inter-task synchronization / communication functions, and task switch scheduling functions, that is, the layers that provide RTOS system calls, are all described in C language. This is a hierarchy that does not depend on the hardware. In this way, the model-dependent part realized by a very limited function such as task context control and the common part realizing the system call body have a completely separated structure, so that the same interface specifications can be used on all platforms. And the application can perform the same operation.

【0043】従って第1の実施形態によれば、RTOS
の振舞に関わるシステムコールとスケジューリング機能
などは、機種に依存しない共通部分として流用し、最小
限に抽出されたプラットフォームに依存するプリミティ
ブな機能のみを実装するだけで、実機とシミュレーショ
ン環境などプラットフォームが異なっても、アプリケー
ションに同一の振舞をさせることができる。また、機種
依存部分が少なく限られた部分に集中しているので、移
植作業を容易に行える。
Therefore, according to the first embodiment, the RTOS
The system calls and scheduling functions related to the behavior of the system are diverted as a common part that does not depend on the model, and only the primitive functions that depend on the minimally extracted platform are implemented. Even so, the application can behave the same. In addition, since the number of machine-dependent parts is small and concentrated on a limited part, transplantation can be easily performed.

【0044】[第2の実施形態]以下、第2の実施形態
を詳細に説明する。第2の実施形態では、第1の実施形
態で説明したRTOSにおいて、機種依存部分106内
に動的にタスクを生成/削除する機能を追加したもので
ある。すなわち、第1の実施形態では、タスクの動的な
生成/削除を行わない(或いは、行う必要がない)シス
テムを示したが、第2の実施形態では動的なタスクの生
成/削除を行えるように拡張したシステムを示す。
[Second Embodiment] Hereinafter, a second embodiment will be described in detail. In the second embodiment, in the RTOS described in the first embodiment, a function of dynamically generating / deleting a task is added to the model-dependent portion 106. That is, in the first embodiment, a system in which dynamic generation / deletion of a task is not performed (or need not be performed) is described. In the second embodiment, dynamic generation / deletion of a task can be performed. The expanded system is shown below.

【0045】(1)実機側のRTOS 第1の実施形態と同様に、モトローラ社製のMC680
00を搭載した実機に対して本RTOSを動作させるも
のとする。図9は、第2の実施形態による実機側のRT
OSの構成を示すブロック図である。図9のRTOS
は、図1で示すRTOSの基本的な構成に、タスク生成
機能112bと、タスク削除機能113bを加えた構成
となっている。また、114bはタスク固有のコンテキ
スト情報(ハードウェア・レジスタ、プログラムカウン
タ、タスクスタックなど)を格納するメモリ(RAM2
3)上の領域(TCB)である。
(1) RTOS on Actual Machine As in the first embodiment, an MC680 manufactured by Motorola is used.
It is assumed that the present RTOS is operated with respect to an actual device on which 00 is mounted. FIG. 9 shows the RT on the actual device side according to the second embodiment.
FIG. 2 is a block diagram illustrating a configuration of an OS. RTOS in FIG. 9
Has a configuration in which a task generation function 112b and a task deletion function 113b are added to the basic configuration of the RTOS shown in FIG. Reference numeral 114b denotes a memory (RAM2) for storing task-specific context information (hardware register, program counter, task stack, etc.).
3) The upper region (TCB).

【0046】タスク生成機能112b:タスク生成機
能112はタスクのコンテキスト情報を生成する。ここ
で、タスクのコンテキスト情報とは、タスクのある瞬間
のハードウェア・レジスタ(CPU内部のレジスタ)、
プログラムカウンタ、及びタスク・スタックの内容であ
り、タスク毎に固有の情報である。スタックポインタ
や、プログラムカウンタなどのコンテキストの内容は適
切な値に初期化される。コンテキスト情報はあらかじめ
用意されたメモリ上の空き領域に生成される(タクス情
報114b)。
Task generation function 112b: The task generation function 112 generates task context information. Here, the context information of the task is a hardware register (register inside the CPU) at a certain moment of the task,
These are the contents of the program counter and the task stack, and are information unique to each task. The contents of the context, such as the stack pointer and the program counter, are initialized to appropriate values. The context information is generated in a free area on a memory prepared in advance (tax information 114b).

【0047】図10は実機側のタスク生成機能の処理を
説明するフローチャートである。タスク生成要求によっ
てタスク生成機能112が起動すると、まず、ステップ
S302で、新たなTCBを生成するための空きメモリ
領域がRAM23に存在するかを確認する。ここで空き
メモリ領域が存在しなければステップS304でエラー
処理を行う。すなわち、システムコールの戻り値は、そ
のシステムコールの実行後の状態(成功・失敗)を示し
ているため、図10のステップS304の処理では「メ
モリ不足」を示すエラー番号を戻り値としてセットする
処理を行う。一方、空きメモリ領域が存在するならば、
ステップS303へ進み、空きメモリ領域から1つ分の
TCBを確保する。そしてステップS304において、
確保したTCBのスタックポインタや、プログラムカウ
ンタ等を適切な値に初期化する。
FIG. 10 is a flowchart for explaining the processing of the task generation function on the real machine side. When the task generation function 112 is activated by a task generation request, first, in step S302, it is checked whether or not a free memory area for generating a new TCB exists in the RAM 23. If there is no free memory area, error processing is performed in step S304. That is, since the return value of the system call indicates the state (success / failure) after the execution of the system call, an error number indicating "insufficient memory" is set as the return value in the process of step S304 in FIG. Perform processing. On the other hand, if there is a free memory area,
Proceeding to step S303, one TCB is secured from the free memory area. Then, in step S304,
The stack pointer and program counter of the secured TCB are initialized to appropriate values.

【0048】タスク削除機能113b:図11は実機
側のタスク削除機能の処理を表すフローチャートであ
る。タスク削除機能113は、タスク削除要求に応じて
該当するタスクのコンテキスト情報を削除する。具体的
には、そのコンテキスト情報を格納しているメモリ上の
領域114を開放し、未使用状態とする(ステップS4
02)。
FIG. 11 is a flowchart showing the processing of the task deletion function on the actual device side. The task deletion function 113 deletes context information of the corresponding task in response to the task deletion request. More specifically, the area 114 on the memory storing the context information is released to make it unused (step S4).
02).

【0049】(2)シミュレーション環境におけるRT
OS 第1の実施形態と同様、シミュレーション環境における
実装例として、SunOSを搭載したワークステーショ
ン上でRTOSのシミュレータを動作させるものとす
る。
(2) RT in a simulation environment
OS As in the first embodiment, as an implementation example in a simulation environment, an RTOS simulator is operated on a workstation equipped with a SunOS.

【0050】図12は、第2の実施形態によるシミュレ
ーション側のRTOSの構成を示すブロック図である。
図12のRTOSでは、図1で示すRTOSの基本的な
構成に、タスク生成機能112aと、タスク削除機能1
13aが加わっている。114aはタスク固有のコンテ
キスト情報で、SunOSのシステム内部で管理されて
いるメモリ上の領域である。
FIG. 12 is a block diagram showing the configuration of the simulation-side RTOS according to the second embodiment.
In the RTOS shown in FIG. 12, a task generation function 112a and a task deletion function 1 are added to the basic configuration of the RTOS shown in FIG.
13a is added. Reference numeral 114a denotes task-specific context information, which is an area on a memory managed inside the SunOS system.

【0051】タスク生成機能112a:タスク生成機
能112aは、タスク生成要求に応じて、スレッドライ
ブラリが提供するthr_create()システムコールを用いて
タスクをスレッドとして生成する。スレッドのコンテキ
スト情報はSunOSが管理する。つまり、図12にお
けるタスク情報114aはSunOS内部で管理される
領域である。なお、このシステムコールはスレッドを実
行状態で生成するか、中断状態で生成するかをフラグに
より指定できるが、本実施形態では、中断状態で生成
し、タスク再開機能110によって実行を開始させるも
のとする。
Task generation function 112a: The task generation function 112a generates a task as a thread using a thr_create () system call provided by a thread library in response to a task generation request. The SunOS manages thread context information. That is, the task information 114a in FIG. 12 is an area managed inside the SunOS. Note that this system call can be specified by a flag as to whether a thread is generated in an execution state or in a suspended state, but in this embodiment, it is generated in a suspended state and execution is started by the task resuming function 110. I do.

【0052】図13はシミュレーション側のタスク生成
機能の処理手順を表すフローチャートである。まず、ス
テップS1002において、空きメモリがあるかを判定
し、空きメモリが無ければステップS1004で、図1
0のステップS304と同様のエラー処理を行う。空き
メモリがあればステップS1003へ進み、空きメモリ
領域からTCBの1つ分のメモリ領域を確保する。そし
て、ステップS1005にてthr_create()システムコー
ルを呼び出して、中断状態のスレッドを生成する。その
後、ステップS1006にて、当該スレッドのIDをT
CBに登録する。なお、本RTOSでは、初期化時にワ
ークスペースと呼ばれるメモリ領域を一括して確保す
る。そして、TCBなどのシステム管理情報は、すべて
このワークスペース内に取られる。従って実機とシミュ
レーション機で同じサイズのメモリ領域を(初期化時
に)確保しておけば、実機/シミュレーション機問にお
ける所有メモリ領域(サイズ)は一致するので、実機と
同様の空きメモリチェックを行なえる。また、RTOS
の共有部分では、タスクIDでタスクの実行、中断を指
示するが、タスクID、スレッドID共にTCBの中に
保存されている。ここで、TCBは機種依存部分に存在
するため、タスクIDとスレッドIDを1対1に対応づ
けることが出来る。また、図13のステップS1005
ではthr_Create()システムコールを用いてタスク生成を
行なうが、このシステムコールによって生成されたスレ
ッドのIDが当該関数から返される。従って、このスレ
ッドIDをタスクIDに対応付けることになる。
FIG. 13 is a flowchart showing the processing procedure of the task generation function on the simulation side. First, in step S1002, it is determined whether there is a free memory, and if there is no free memory, in step S1004, FIG.
0, the same error processing as in step S304 is performed. If there is a free memory, the process advances to step S1003 to secure a memory area for one TCB from the free memory area. Then, in step S1005, a thr_create () system call is called to generate a suspended thread. Thereafter, in step S1006, the ID of the thread is set to T.
Register with CB. In this RTOS, a memory area called a workspace is collectively secured at the time of initialization. Then, all the system management information such as TCB is taken in this workspace. Therefore, if a memory area of the same size is secured between the real machine and the simulation machine (at the time of initialization), the owned memory area (size) in the real machine / simulation machine matches, so that the same free memory check as the real machine can be performed. . Also, RTOS
In the shared part of, the task execution and interruption are instructed by the task ID, but both the task ID and the thread ID are stored in the TCB. Here, since the TCB exists in the model-dependent part, the task ID and the thread ID can be associated one-to-one. Step S1005 in FIG.
Then, task creation is performed using the thr_Create () system call, and the ID of the thread created by this system call is returned from the function. Therefore, this thread ID is associated with the task ID.

【0053】タスク削除機能113a:スレッドライ
ブラリが提供するthr_delete()システムコールにより、
スレッド化されたタスクを削除する。図14はシミュレ
ーション側のタスク削除機能の処理を示すフローチャー
トである。タスク削除要求を受け付けると、当該タスク
削除要求に含まれるスレッドIDを獲得し、これを引数
としてthr_delete()システムコールを行う(ステップS
1102)。その後、当該スレッドに対応するTCBが
使用していたメモリ領域を開放し、未使用状態とする。
Task deletion function 113a: By the thr_delete () system call provided by the thread library,
Delete threaded tasks. FIG. 14 is a flowchart showing processing of the task deletion function on the simulation side. When the task deletion request is accepted, the thread ID included in the task deletion request is acquired, and the thr_delete () system call is performed using the thread ID as an argument (step S).
1102). After that, the memory area used by the TCB corresponding to the thread is released to make it unused.

【0054】[第3の実施形態]第3の実施形態では、
第1,2の実施形態におけるRTOSにおいて、更に割
込みを管理する機能を追加した場合を説明する。
[Third Embodiment] In the third embodiment,
A case in which a function of managing an interrupt is further added to the RTOS in the first and second embodiments will be described.

【0055】(1)実機におけるRTOS 第1および第2の実施形態と同様に、モトローラ社製の
MC68000を搭載した実機に対して本RTOSを動
作させるものとし、以下では第3の実施形態で新たに追
加された割込みを管理する機能について説明する。
(1) RTOS in Real Machine As in the first and second embodiments, the RTOS is operated on a real machine equipped with Motorola MC68000. Hereinafter, a new RTOS will be used in the third embodiment. A function for managing the interrupt added to the above will be described.

【0056】図15は、第3の実施形態による実機側の
RTOSの構成を示すブロック図である。図9で示した
構成に、割込み管理機能120、割込みコントローラ1
21、割込みハンドラ122が加えられている。なお、
割り込みコントローラとは、ハードウェア割り込みの制
御を行うハードウェアである。AT互換機などでは82
59AというLSIとして知られている。ハードウェア
割り込みはこの割り込みコントローラを経由してCPU
に伝えられ、発生した割り込みに対応した割り込みハン
ドラが起動される。図15における割り込みコントロー
ラおよび割り込みハンドラの役割は、ハードウェア割り
込みが生じたことを、当該RTOSの割り込み管理機能
に伝えることである。
FIG. 15 is a block diagram showing the configuration of the RTOS on the actual device according to the third embodiment. In the configuration shown in FIG. 9, the interrupt management function 120, the interrupt controller 1
21, an interrupt handler 122 has been added. In addition,
The interrupt controller is hardware that controls a hardware interrupt. 82 for AT compatible machines
It is known as a 59A LSI. Hardware interrupts are sent to the CPU via this interrupt controller.
And an interrupt handler corresponding to the generated interrupt is started. The role of the interrupt controller and the interrupt handler in FIG. 15 is to notify the interrupt management function of the RTOS that a hardware interrupt has occurred.

【0057】割込み管理機能120:割込み開始要求
を受けて、タスク中断機能109bを呼び出し、実行中
のタスクのTCB114にコンテキストの保存を行う。
割込みが多重に起こった場合は、システムスタック12
3上にレジスタを積み上げていくことにより、多重割込
みに対応する。割込み終了要求を受けて、スケジューリ
ング機能106を呼び出した後、タスク再開機能115
を呼び出して次タスクのTCB114からコンテキスト
の復帰を行う。多重割込みからの復帰の場合は、システ
ムスタック123上からコンテキストの復帰を行う。
Interrupt management function 120: In response to an interrupt start request, the task interruption function 109b is called, and the context is stored in the TCB 114 of the task being executed.
If multiple interrupts occur, the system stack 12
By stacking the registers on the number 3, it is possible to cope with multiple interrupts. In response to the interrupt end request, the scheduling function 106 is called, and then the task resuming function 115
To return the context from the TCB 114 of the next task. In the case of returning from multiple interrupts, the context is restored from the system stack 123.

【0058】図16は、実機側の割込み処理を説明する
フローチャートである。ハードウェア割込みが発生する
と、割込みハンドラ122の先頭で割込み管理機能12
0に対して割込み開始要求を出す(ステップS80
2)。なお、割り込みハンドラの先頭とは、ハンドラル
ーチンが最初に処理するステップのことである。割込み
開始要求を受けた割込み管理機能120では、まず、当
該割込み要求が多重割込みか否かを判定する。多重割込
みであった場合は、ステップS805へ進み、システム
スタック123にレジスタを待避させる。一方、多重割
込みでなければ、ステップS803からステップS80
4へ進み、タスク中断機能109を起動させる。なお、
システムの属性値として、(多重)割り込み回数をカウ
ントするカウンタが存在する。割り込み管理機能にて割
り込み処理を開始する時にカウンタをインクリメント
し、割り込み処理を終了する直前にカウンタをデクリメ
ントする。多重割り込みか否かの判断はこのカウンタの
値を元に行われる。また、ステップS805においてシ
ステムスタック123に待避されるのは、処理中の割り
込みに関わるレジスタ値である。例えば、現在処理中の
割り込みAが、それより優先度の高い割り込みBにより
中断された瞬間のレジスタ値をシステムスタックに保存
し、高優先度の割り込みBの処理が終わった後に、割り
込みAの処理を再開できるようにする。
FIG. 16 is a flowchart for explaining the interrupt processing on the real machine side. When a hardware interrupt occurs, the interrupt management function 12
0, an interrupt start request is issued (step S80).
2). Note that the beginning of the interrupt handler is a step that the handler routine processes first. Upon receiving the interrupt start request, the interrupt management function 120 first determines whether the interrupt request is a multiple interrupt. If it is a multiple interrupt, the process advances to step S805 to save the register in the system stack 123. On the other hand, if it is not a multiple interrupt, steps S803 to S80
Proceed to step 4 to activate the task suspending function 109. In addition,
As an attribute value of the system, there is a counter for counting the number of (multiple) interrupts. The counter is incremented when the interrupt processing is started by the interrupt management function, and the counter is decremented immediately before the end of the interrupt processing. The determination as to whether or not it is a multiple interrupt is made based on the value of this counter. What is saved in the system stack 123 in step S805 is a register value related to an interrupt being processed. For example, the register value at the moment when the interrupt A currently being processed is interrupted by the interrupt B having a higher priority is saved in the system stack, and after the processing of the interrupt B having the higher priority is completed, the processing of the interrupt A is performed. To be able to resume.

【0059】次にステップS806において、割込みハ
ンドラ122の本体を実行させる。割込み処理本体を実
行した後、割込みハンドラを終了する直前に、割込み管
理機能120に対して割込み終了要求を出す(ステップ
S807)。なお、ステップS806では、割り込みが
発生した要因に基づくI/O処理など、ハンドラの本来
の処理が行われる。例えば、RS−232Cなどのシリ
アル通信では、シリアルポートヘデータがセットされた
時に受信割り込みが発生し、対応する割り込みハンドラ
が起動されるが、割り込みハンドラでは受信したデータ
を読み込むためのI/O処理と読み取ったデータをバッ
ファなどにつめる等の処理とが行なわれる。これが、こ
こで言うハンドラの本体の処理になります。S807は
ステップS802と同様に、割り込み管理機能を呼び出
すという動作そのものであり、具体的な処理としては、
図16においてその下に描かれる破線の中の処理が行わ
れることになる。
Next, in step S806, the main body of the interrupt handler 122 is executed. After executing the interrupt processing main body, immediately before terminating the interrupt handler, an interrupt end request is issued to the interrupt management function 120 (step S807). In step S806, the original processing of the handler such as the I / O processing based on the cause of the interruption is performed. For example, in serial communication such as RS-232C, a reception interrupt occurs when data is set to a serial port, and a corresponding interrupt handler is activated. In the interrupt handler, I / O processing for reading the received data is performed. And processing for filling the read data into a buffer or the like. This is the processing of the body of the handler here. S807 is the operation itself of calling the interrupt management function, as in step S802.
The processing in the broken line drawn below in FIG. 16 will be performed.

【0060】割込み終了要求を受けた割込み管理異能1
20は、ステップS808において、当該割込みが多重
割込みか否かを判定する。多重割込みであった場合は、
ステップS811へ進み、システムスタック123から
レジスタを復帰させて、ステップS812へ進む。一
方、多重割込みでない場合は、ステップS809へ進
み、スケジューリング機能105を呼び出し、次に再開
すべきタスクのタスクIDを獲得する。そして、ステッ
プS810において、タスク再開機能110を起動す
る。そしてステップS812において、ハードウエア割
り込み終了、すなわち割り込み復帰命令を実行して本処
理を終える。割り込み復帰命令では、その割り込みレベ
ルを解除し(一つ前のレベルに戻す)、システムスタッ
ク上に保存されているPC(プログラムカウンタ)や、
SR(ステータスレジスタ)などを読み出して、割り込
まれた個所へ復帰を行なう。なお、その他のレジスタの
復帰は事前に行なう必要がある。なお、ステップS80
6の割り込みハンドラ本体の処理の中では、本RTOS
のシステムコールを実行する可能性がある。そのような
場合、システムコールの実行によってシステムの状態が
変化し、実行中だったタスクが資源待ちになったり、優
先度の高いタスクが実行権を獲得するような状況が生じ
る。通常はシステムコールの終了の直前にスケジユーリ
ングされるが、割り込み処理中はタスクスイッチするこ
とができないので、割り込み処理の終了の直前にスケジ
ユーリングを行う必要がある。従って、ステップS81
0で再開されるタスクは、割り込みの直前に実行されて
いたタスクとは限らない。
Interrupt management incompetence 1 receiving interrupt end request
20 determines in step S808 whether the interrupt is a multiple interrupt. If it is a multiple interrupt,
The process proceeds to step S811 to restore the register from the system stack 123, and proceeds to step S812. On the other hand, if it is not a multiple interrupt, the process advances to step S809 to call the scheduling function 105 and acquire the task ID of the task to be restarted next. Then, in step S810, the task restart function 110 is activated. Then, in step S812, the hardware interrupt is completed, that is, an interrupt return instruction is executed, and the present process ends. The interrupt return instruction releases the interrupt level (returns to the previous level), the PC (program counter) saved on the system stack,
An SR (status register) or the like is read to return to the interrupted location. Note that restoring other registers must be performed in advance. Step S80
In the processing of the interrupt handler body of No. 6, this RTOS
May execute the following system call. In such a case, the state of the system changes due to the execution of the system call, and a situation occurs in which the task being executed waits for resources or a task with a higher priority acquires the execution right. Normally, scheduling is performed immediately before the end of the system call. However, since task switching cannot be performed during interrupt processing, it is necessary to perform scheduling immediately before the end of interrupt processing. Therefore, step S81
The task restarted at 0 is not necessarily the task that was executed immediately before the interruption.

【0061】(2)シミュレーション環境におけるRT
OS 第1の実施形態と同様、シミュレーション環境における
実装例として、SunOSを搭載したワークステーショ
ン上で動作する本RTOSのシミュレータを動作させる
もので、さらに追加した割込み管理機能について説明す
る。
(2) RT in simulation environment
OS Similar to the first embodiment, as an example of implementation in a simulation environment, a description will be given of an interrupt management function that operates a simulator of the present RTOS that operates on a workstation equipped with a SunOS.

【0062】図17は、第3の実施形態によるシミュレ
ーション装置側のRTOSの構成を示す図である。図1
7では、シミュレーション側のRTOSの基本的な構成
に割込み管理機能132を加えた構成が示されている。
FIG. 17 is a diagram showing the configuration of the RTOS on the simulation device side according to the third embodiment. FIG.
FIG. 7 shows a configuration in which an interrupt management function 132 is added to the basic configuration of the RTOS on the simulation side.

【0063】割込み管理機能(スーパーシグナルスレ
ッド)132:図17に示される割込み管理機能132
は、特定のシグナルを用いて、複数のハードウェア割込
みをシミュレートするしくみである。これは、アプリケ
ーション・タスクとバインドするスレッド群とは独立し
て動く、割込み管理専用のスーパーシグナルスレッドと
して実現する。131は汎用OSからシグナルを受けた
時に呼ばれるシグナルハンドラであり、シグナルハンド
ラ131はスーパーシグナルスレッド132に事象の発
生を通知する。スーパーシグナルスレッド132は、多
重割込みをシミュレートするために独自のスタック13
3で割込みレベルの管理をする。1つの割込みハンドラ
は1つのスレッド(ハンドラスレッド)134として生
成され起動される。つまり、多重割込みが発生した場合
は、多重のネスト回数と同数のハンドラスレッド134
が生成されることになる。また、割込みレベル制御およ
びハンドラスレッド134の管理はスーパーシグナルス
レッド132が行い、多重割込みのシミュレーションを
行う。
Interrupt management function (super signal thread) 132: Interrupt management function 132 shown in FIG.
Is a mechanism that simulates multiple hardware interrupts using specific signals. This is implemented as a super-signal thread dedicated to interrupt management that runs independently of the thread group that binds to the application task. A signal handler 131 is called when a signal is received from the general-purpose OS. The signal handler 131 notifies the super signal thread 132 of the occurrence of an event. The super signal thread 132 has its own stack 13 to simulate multiple interrupts.
In step 3, the interrupt level is managed. One interrupt handler is generated and activated as one thread (handler thread) 134. That is, when multiple interrupts occur, the number of handler threads 134 equal to the number of multiple nests
Is generated. The super signal thread 132 performs interrupt level control and management of the handler thread 134, and simulates multiple interrupts.

【0064】図18は割込みシグナル等の事象が発生し
た場合の割込み管理機能132の処理の流れを示したフ
ローチャートである。ステップS1601において、シ
グナルハンドラ131が割込みの発生を検出すると、シ
グナルハンドラ131はスーパーシグナルスレッド13
2へ割込みイベントの発生を通知する。
FIG. 18 is a flowchart showing the flow of processing of the interrupt management function 132 when an event such as an interrupt signal occurs. In step S1601, when the signal handler 131 detects the occurrence of an interrupt, the signal handler 131
2 is notified of the occurrence of an interrupt event.

【0065】割込みイベントの通知を受けたスーパーシ
グナルスレッド132は、当該割込みが多重割込みか否
かを判定する。多重割込みであった場合は、ステップS
1602からステップS1604へ進み、実行中のハン
ドラスレッドを中断状態にしてスタック133にスタッ
クする。一方、多重割込みでなければ、ステップS16
02からステップS1603へ進み、タスク中断機能1
09を起動させて、実行中のタスクを中断する。次に、
ステップS1605において、対応するハンドラスレッ
ドを生成する。
The super signal thread 132 that has received the notification of the interrupt event determines whether the interrupt is a multiple interrupt. If it is a multiple interrupt, step S
The process proceeds from step 1602 to step S1604, in which the running handler thread is suspended, and is stacked on the stack 133. On the other hand, if it is not a multiple interrupt, step S16
02 to step S1603, the task suspending function 1
09 is started to interrupt the task being executed. next,
In step S1605, a corresponding handler thread is generated.

【0066】ステップS1606において、生成された
ハンドラスレッド134が起動され、割込みハンドラ本
体が実行される。次にステップS1608において、多
重割込みか否かを判定し、多重割込みであったならばス
テップS1610へ進む。ステップS1610において
は、中断中のハンドラスレッドをスタックから取り出
し、実行状態にする。なお、中断中のハンドラ用スレッ
ドを再開(実行状態にする)するのは、スーパーシグナ
ルスレッド内のステップS1610で行われるが、実際
にそのスレッドが再開するタイミングは汎用OSのスケ
ジユーリングに任される。通常、スーパーシグナルスレ
ッドは最も優先度の高いスレッドとして生成するので、
一連の割り込み処理はS1610、S1612まで流
れ、終了する。その後、S1610で実行状態にされた
スレッドが(汎用OSによって)再開される。
In step S1606, the generated handler thread 134 is activated, and the interrupt handler itself is executed. Next, in step S1608, it is determined whether or not it is a multiple interrupt. If it is a multiple interrupt, the process proceeds to step S1610. In step S1610, the suspended handler thread is fetched from the stack and put into an execution state. Note that the suspended thread for the handler is resumed (executed) in step S1610 in the super signal thread, but the actual resuming timing of the thread is left to the scheduling of the general-purpose OS. You. Normally, the super signal thread is created as the highest priority thread, so
A series of interrupt processing flows to S1610 and S1612, and ends. Thereafter, the thread put into the execution state in S1610 is restarted (by the general-purpose OS).

【0067】シミュレーション環境においては、割り込
み管理機能もシミュレーションする必要があるため、多
重割り込みのシミュレーションを行うには、割り込みハ
ンドラをも中断/再開してコントロールしなければなら
ない。そのため、汎用OSが提供するスレッドを生成し
て、そのスレッドでハンドラを実行し、中断/再開など
の操作はスーパーシグナルスレッドが管理する。図中ス
テップS1606はハンドラ用のスレッドを生成するス
テップで、ステップS1607の割り込みハンドラ本体
は、割り込みの要因に対する具体的な処理を記述した関
数(もしくはブロック)である。
In the simulation environment, it is necessary to simulate the interrupt management function. Therefore, in order to simulate multiple interrupts, the interrupt handler must be interrupted / restarted and controlled. Therefore, a thread provided by the general-purpose OS is generated, a handler is executed by the thread, and operations such as suspension / resumption are managed by a super signal thread. In the figure, step S1606 is a step for generating a thread for a handler, and the interrupt handler body in step S1607 is a function (or block) describing specific processing for the cause of the interrupt.

【0068】ステップS1608において多重割込みで
なかった場合(多重割込みで最後の割込み処理を得た場
合も含む)、ステップS1609へ進み、スケジューリ
ング機能105を読み出し、ステップS1611でタス
ク再開機能110を呼び出す。ここでシミュレーション
側の割り込みはたとえば次のようにして発行させる。シ
ミュレーション環境での割り込みをハンドリングするた
めには、独立して動くスレッドもしくはプロセスから、
スーパーシグナルスレッドへ通知しなくてはならない。
タイマ割り込みなどは、完全に独立して動くタイマ・ス
レッドを生成して、定期的にスーパーシグナルスレッド
へ通知する。プロセス外からの割り込み要因の通知は、
汎用OSが提供するシグナルハンドラを利用する。UN
IXを例に説明すると、あらかじめRTOSのプロセス
でシグナルハンドラを登録しておき、killコマンド
などで別のプロセスから当該プロセスにシグナルを送
る。そして起動されたシグナルハンドラの中からスーパ
ーシグナルスレッドヘ割り込みを通知する。
If it is not a multiple interrupt in step S1608 (including the case where the last interrupt processing was obtained in multiple interrupts), the flow advances to step S1609 to read out the scheduling function 105, and call the task restart function 110 in step S1611. Here, the interrupt on the simulation side is issued, for example, as follows. In order to handle interrupts in the simulation environment, an independent running thread or process
You have to notify the super signal thread.
For example, a timer interrupt generates a completely independent timer thread and notifies the super signal thread periodically. Notification of the interrupt factor from outside the process
A signal handler provided by a general-purpose OS is used. UN
Taking IX as an example, a signal handler is registered in advance in an RTOS process, and a signal is sent from another process to the process using a kill command or the like. Then, an interrupt is notified to the super signal thread from the activated signal handler.

【0069】以上のように第3の実施形態によれば、R
TOSを用いたアプリケーションのシミュレーションに
おいて割込み処理も扱えるようになる。
As described above, according to the third embodiment, R
Interrupt processing can be handled in the simulation of an application using TOS.

【0070】なお、上記各実施形態では、シミュレーシ
ョン環境としてSunOSを用いた場合を説明したが、
他のOS、例えば、Microsoft社のWindows9
5、WindowNTなどのWin32−APIで提供
されるマルチスレッド機能を用いて、同様なRTOSシ
ミュレータを構築可能である。すなわち、上記実施形態
で説明したRTOSは、第1乃至第3の実施形態で紹介
したSunOSのシステムコール(thr_create(),thr_
delete(),thr_suspend(),thr_resume()など)と同等
なシステムコールを提供している汎用OS上で動作する
シミュレータとして簡単に移植が可能である。
In each of the above embodiments, the case where SunOS is used as the simulation environment has been described.
Other OS, such as Microsoft's Windows 9
5. A similar RTOS simulator can be constructed using the multi-thread function provided by Win32-API such as WindowsNT. That is, the RTOS described in the above-described embodiment uses the SunOS system calls (thr_create (), thr_create) introduced in the first to third embodiments.
It can be easily ported as a simulator that runs on a general-purpose OS that provides system calls equivalent to delete (), thr_suspend (), and thr_resume ().

【0071】[第4の実施形態]図19は、第4の実施
形態によるRTOSの構造を示す図である。図19で
は、図1に示したRTOS(シミュレーション機側)に
デバッグ情報を取得する機能が付加されている。
[Fourth Embodiment] FIG. 19 is a diagram showing the structure of an RTOS according to a fourth embodiment. In FIG. 19, a function of acquiring debug information is added to the RTOS (simulation machine side) shown in FIG.

【0072】RTOSのシステムコールの実体は共通部
分103にあり、各システムコールはすべて共通のシス
テムコール・エントリポイント1801を経由する構造
になっている。そして、このシステムコール・エントリ
ポイント1801は、トレース情報記録機能1802を
有する。トレース情報記録機能1802は、システムコ
ールが発行される毎に図20に示すような実行トレース
情報901を生成する。すなわち、トレース情報記録機
能1802は、発行されたシステムコールを取り出し、
呼び出しタスクID902、システムコール実行情報9
03、タイムスタンプ904などの情報を取り出し、実
行トレース情報901として一時的に保存する。ここ
で、呼び出しタスクID902は、タスクID又は、O
S、割込みの識別子を特定する情報である。システムコ
ール実行情報903は、システムコール名(ID)およ
びパラメータ群を含む。更にタイムスタンプ904は、
当該システムコール発行時のタイマカウンタの値を示
す。
The substance of the system call of the RTOS is in the common part 103, and each system call is structured to pass through a common system call entry point 1801. The system call entry point 1801 has a trace information recording function 1802. The trace information recording function 1802 generates execution trace information 901 as shown in FIG. 20 every time a system call is issued. That is, the trace information recording function 1802 takes out the issued system call,
Call task ID 902, system call execution information 9
03, information such as a time stamp 904 is extracted and temporarily stored as execution trace information 901. Here, the calling task ID 902 is the task ID or O
S is information for identifying an interrupt identifier. The system call execution information 903 includes a system call name (ID) and a parameter group. Further, the time stamp 904 is
Indicates the value of the timer counter when the system call is issued.

【0073】また、デバッグ情報転送機能1803は、
保存した実行トレース情報901をグラフィカルに表示
する可視化ツール(タスクスイッチ・ビューア)180
6などの外部モジュールに転送する。
Further, the debug information transfer function 1803
Visualization tool (task switch viewer) 180 for graphically displaying the stored execution trace information 901
6 and the like.

【0074】トレース情報記録機能1802は1回のシ
ステムコールで図20に示す構造を持つ実行トレース情
報を1つ記録するので、アプリケーションの一連の動作
の履歴は大きな記憶容量を必要とする場合がある。加え
て、一般的に実機環境ではメモリ領域などの資源が限ら
れているため、データの記録方法になんらかの工夫が必
要となる。このような問題に対処する方法として、例え
ば、リングバッファを用いた記録方法などが考えられ
る。リングバッファは、連続して生成される膨大なデー
タの中で最近のデータだけを効率良く記録する仕組み
で、記録するデータ数がバッファサイズを超える場合
に、最も古いデータから上書きしていく手法である。図
19では、トレース情報記録機能1802で生成された
実行トレース情報901をリングバッファ1807に保
存していく例が示されている。リングバッファ1807
はメモリ上に配置され、記録開始位置を指し示すSta
rtポインタ1808と、記録終了位置を指し示すEn
dポインタ1809を用いてデータの記録、取り出し作
業を行う。
Since the trace information recording function 1802 records one piece of execution trace information having the structure shown in FIG. 20 by one system call, the history of a series of operations of the application may require a large storage capacity. . In addition, since resources such as a memory area are generally limited in a real machine environment, it is necessary to devise some method for recording data. As a method for dealing with such a problem, for example, a recording method using a ring buffer can be considered. The ring buffer is a mechanism that efficiently records only the most recent data among a huge amount of data generated continuously.When the number of data to be recorded exceeds the buffer size, the oldest data is overwritten. is there. FIG. 19 shows an example in which the execution trace information 901 generated by the trace information recording function 1802 is stored in the ring buffer 1807. Ring buffer 1807
Is located on the memory and indicates the recording start position.
rt pointer 1808 and En indicating the recording end position
Data recording and retrieval operations are performed using the d pointer 1809.

【0075】図21は、トレース情報記録機能1802
の処理の流れを示したフローチャートである。まず、シ
ステムコールの発行等により、ステップS1901にお
いて実行トレース情報が生成されると、ステップS19
02において、リングバッファ1807のEndポイン
タ1809が示す位置に当該実行トレース情報を書き込
む。次にステップS1903において、有効データ数が
バッファサイズ以上になっているかを判定する。有効デ
ータ数がバッファサイズより小さければステップS19
05へ進み、有効データ数を1つインクリメントする。
一方、有効データ数がバッファサイズ以上となっている
場合は、Startポインタ1808をインクリメント
する。このときStartポインタ1808の位置がオ
ーバーランした場合は先頭に戻す。そして、ステップS
1906において、Endポインタ1809の位置をイ
ンクリメントし、オーバーランした場合は先頭に戻す。
なお、リングバッファは通常の物理的に線形なバッファ
を用いて、論理的にリング状に見えるような仕組みを持
つものである。Start位置やEnd位置を指し示すポインタ
は、操作の度にインクリメントされるが、いづれ物理バ
ッファの最後尾に到達する。さらにインクリメントする
とバッファをオーバーランしてしまうので、その時点で
ポインタをバッファの先頭にリセットする。この仕組み
により、論理的にリング状に見せかけることができる。
FIG. 21 shows a trace information recording function 1802.
3 is a flowchart showing the flow of the processing of FIG. First, when execution trace information is generated in step S1901 by issuing a system call or the like, step S19
In 02, the execution trace information is written into the ring buffer 1807 at the position indicated by the End pointer 1809. Next, in step S1903, it is determined whether the number of valid data is equal to or larger than the buffer size. If the number of valid data is smaller than the buffer size, step S19
In step 05, the number of valid data is incremented by one.
On the other hand, when the number of valid data is equal to or larger than the buffer size, the start pointer 1808 is incremented. At this time, if the position of the start pointer 1808 is overrun, it is returned to the beginning. And step S
In 1906, the position of the end pointer 1809 is incremented, and if overrun occurs, the position is returned to the beginning.
The ring buffer uses a normal physically linear buffer and has a mechanism that makes it look like a logical ring. The pointer indicating the Start position or the End position is incremented each time the operation is performed, but reaches the end of the physical buffer. If the value is further incremented, the buffer is overrun. At that point, the pointer is reset to the beginning of the buffer. With this mechanism, it is possible to make it look like a logical ring.

【0076】また、デバッグ情報転送機能1803は、
図1における共通部分103の内部に実装されるが、物
理的な通信経路はターゲットシステムに依存する。その
ため、ターゲットシステムが備えている通信手段を利用
するために、ハードウエア依存部分106にデバッグ通
信モジュール1805を具備する。デバッグ通信モジュ
ール1805は、バッファのread/writeを行
うI/Fを提供する。最下層のレイヤとしては具体的に
は、シリアル、ソケット、共有メモリ、ICE、ROM
エミュレータなどが考えられる。
The debug information transfer function 1803
Although implemented inside the common part 103 in FIG. 1, the physical communication path depends on the target system. Therefore, a debug communication module 1805 is provided in the hardware-dependent portion 106 in order to use the communication means provided in the target system. The debug communication module 1805 provides an I / F for performing read / write of a buffer. Specifically, serial, socket, shared memory, ICE, ROM
An emulator or the like is conceivable.

【0077】図22はデバッグ情報転送機能1803に
おいて、先の例で示したリングバッファを用いた場合の
処理の手順を示したフローチャートである。まず、デバ
ッグ情報転送機能1803は、ステップS2002にお
いて有効データ数が1以上であるか否かを判断する。有
効データ数が1以上であれば、転送すべき実行トレース
情報が存在すると判断し、ステップS2003へ進む。
ステップS2003では、リングバッファからデータを
1つ取り出す。そして、ステップS2004において、
取り出した実行トレース情報をデバッグ通信モジュール
1805を介して外部モジュール(例えば可視化ツール
1806)へ転送する。そして、ステップS2005に
おいて有効データ数を1つ減少させて、ステップS20
02へ戻る。
FIG. 22 is a flowchart showing a procedure of processing when the ring buffer shown in the above example is used in the debug information transfer function 1803. First, in step S2002, the debug information transfer function 1803 determines whether the number of valid data is one or more. If the number of valid data is one or more, it is determined that there is execution trace information to be transferred, and the process proceeds to step S2003.
In step S2003, one piece of data is extracted from the ring buffer. Then, in step S2004,
The extracted execution trace information is transferred to an external module (for example, a visualization tool 1806) via the debug communication module 1805. Then, in step S2005, the number of valid data is reduced by one, and in step S20
Return to 02.

【0078】この様にして転送したトレース情報をグラ
フィカルに表示する表示装置として、図23にタスクス
イッチ・ビューア1806の概観の一例を示す。
FIG. 23 shows an example of an overview of a task switch viewer 1806 as a display device for graphically displaying the trace information thus transferred.

【0079】この様に、RTOSのデバッグ情報として
有効なシステムコールやタスクスイッチの履歴、システ
ム管理情報などを取得する手段を共通部分で実装するこ
とにより、異なるプラットフォーム間でも統一された思
想でデバッグを行うことができる。
As described above, by implementing means for acquiring a system call, task switch history, system management information, and the like effective as debug information of the RTOS in a common part, debugging can be performed with a unified concept even on different platforms. It can be carried out.

【0080】以上のように、第4の実施形態のRTOS
は、ハードウェアに依存する部分を必要最小限となるよ
うに切り出し、それ以外の部分はさまざまなプラットフ
ォームで共通に利用できるようにC言語で書かれてお
り、ハードウェアの違いによる影響が少なくなるような
構造を持つものであり、システムコールはすべて共通の
エントリポイントを経由してコールされ、システムコー
ル実行後にスケジューリング機能が呼び出される構造を
持つ。そして、この共通エントリポイントにおいて
(1)呼びだしタスクIDと(2)システムコール実行
情報と(3)タイムスタンプなどの情報を保存するトレ
ース情報記録機能と、保存したトレース情報をタスクス
イッチ・ビューアなどの外部モジュールに転送する手段
とを設けたことにより、プラットフォームに依存しない
デバッグ情報を提供することが可能である。
As described above, the RTOS of the fourth embodiment
Is written in C language so that the parts that depend on the hardware are cut to the minimum necessary, and the other parts are written in C language so that they can be commonly used on various platforms, and the effects of hardware differences are reduced It has a structure such that all system calls are called via a common entry point, and the scheduling function is called after the execution of the system call. At this common entry point, (1) a calling task ID, (2) a trace information recording function for storing information such as system call execution information, and (3) a time stamp, and the saved trace information is stored in a task switch viewer or the like. By providing the means for transferring to an external module, it is possible to provide platform-independent debug information.

【0081】以上説明したように、上記各実施形態によ
れば,次のような効果が期待できる。すなわち、 (1)プラットフォーム非依存性 アプリケーション・タスクをまったく修正せずに、実機
と汎用開発マシンなど異なるプラットフォーム上で同一
の振る舞いをさせることができる。 (2)移植の容易性 機種依存部分が最小限に切り出されているので、他のプ
ラットフォームへの移植が容易に実現できる。 (3)プラットフォーム非依存なデバッガ ハードウェアに依存する物理的通信を行うモジュールだ
け実装すれば、様々なプラットフォームで、同一のデバ
ッガが利用できる。 (4)デバッグ情報の統一化 取得するデバッグ情報はプラットフォームに依存しない
情報なので、異なるプラットフォーム間でも統一思想で
デバッグを行うことができる。
As described above, according to the above embodiments, the following effects can be expected. (1) Platform Independence The same behavior can be performed on different platforms such as a real machine and a general-purpose development machine without any modification of the application task. (2) Ease of porting Since the machine-dependent part is cut out to a minimum, porting to another platform can be easily realized. (3) Platform-independent debugger If only a module that performs hardware-dependent physical communication is implemented, the same debugger can be used on various platforms. (4) Unification of Debug Information Since the acquired debug information is information independent of the platform, it is possible to debug with a unified concept even between different platforms.

【0082】なお、本発明の目的は、前述した実施形態
の機能を実現するソフトウェアのプログラムコードを記
録した記憶媒体を、システムあるいは装置に供給し、そ
のシステムあるいは装置のコンピュータ(またはCPU
やMPU)が記憶媒体に格納されたプログラムコードを
読出し実行することによっても、達成されることは言う
までもない。
An object of the present invention is to supply a storage medium storing a program code of software for realizing the functions of the above-described embodiments to a system or an apparatus, and to provide a computer (or CPU) of the system or the apparatus.
And MPU) read and execute the program code stored in the storage medium.

【0083】この場合、記憶媒体から読出されたプログ
ラムコード自体が前述した実施形態の機能を実現するこ
とになり、そのプログラムコードを記憶した記憶媒体は
本発明を構成することになる。
In this case, the program code itself read from the storage medium implements the functions of the above-described embodiment, and the storage medium storing the program code constitutes the present invention.

【0084】プログラムコードを供給するための記憶媒
体としては、例えば、フロッピディスク,ハードディス
ク,光ディスク,光磁気ディスク,CD−ROM,CD
−R,DVD,磁気テープ,不揮発性のメモリカード,
ROMなどを用いることができる。
Examples of the storage medium for supplying the program code include a floppy disk, hard disk, optical disk, magneto-optical disk, CD-ROM, and CD.
-R, DVD, magnetic tape, nonvolatile memory card,
A ROM or the like can be used.

【0085】また、コンピュータが読出したプログラム
コードを実行することにより、前述した実施形態の機能
が実現されるだけでなく、そのプログラムコードの指示
に基づき、コンピュータ上で稼働しているOS(オペレ
ーティングシステム)などが実際の処理の一部または全
部を行い、その処理によって前述した実施形態の機能が
実現される場合も含まれることは言うまでもない。
When the computer executes the readout program code, not only the functions of the above-described embodiment are realized, but also the OS (Operating System) running on the computer based on the instruction of the program code. ) May perform some or all of the actual processing, and the processing may realize the functions of the above-described embodiments.

【0086】さらに、記憶媒体から読出されたプログラ
ムコードが、コンピュータに挿入された機能拡張ボード
やコンピュータに接続された機能拡張ユニットに備わる
メモリに書込まれた後、そのプログラムコードの指示に
基づき、その機能拡張ボードや機能拡張ユニットに備わ
るCPUなどが実際の処理の一部または全部を行い、そ
の処理によって前述した実施形態の機能が実現される場
合も含まれることは言うまでもない。
Further, after the program code read from the storage medium is written into a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, based on the instructions of the program code, It goes without saying that the CPU included in the function expansion board or the function expansion unit performs part or all of the actual processing, and the processing realizes the functions of the above-described embodiments.

【0087】[0087]

【発明の効果】以上説明したように、本発明のマルチタ
スク制御方法によれば、あらゆるプラットフォーム上で
同一のインターフェース仕様を持ち、アプリケーション
が同一の動作を行うことが可能となる。
As described above, according to the multitask control method of the present invention, it is possible to have the same interface specifications on all platforms and perform the same operation by applications.

【0088】また、本発明によれば、あらゆるプラット
フォーム上で同一のインターフェース仕様を持ち、アプ
リケーションが同一の動作を行うことを可能とするRT
OS上のデバッグ環境(タスクスイッチ・ビューア等)
において、あらゆるプラットフォーム上で統一的なデバ
ッグ情報を収集することが可能となる。
Also, according to the present invention, an RT that has the same interface specifications on all platforms and enables an application to perform the same operation
OS debugging environment (task switch / viewer, etc.)
, It is possible to collect unified debug information on any platform.

【0089】[0089]

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

【図1】第1の実施形態におけるRTOSの基本的な構
成図である。
FIG. 1 is a basic configuration diagram of an RTOS according to a first embodiment.

【図2】システムコール発行からタスクスイッチまで
の、共通部分による処理の手順を表したフローチャート
である。
FIG. 2 is a flowchart showing a procedure of processing by a common part from a system call issuance to a task switch.

【図3】プライオリティ順のスケジューリングアルゴリ
ズムを実現した一例を説明する図である。
FIG. 3 is a diagram illustrating an example of realizing a scheduling algorithm in priority order.

【図4】タイムシェアリングによるスケジューリングを
実現した一例を示す図である。
FIG. 4 is a diagram showing an example in which scheduling by time sharing is realized.

【図5】実機側におけるタスク中断機能の処理の流れを
表すフローチャートである。
FIG. 5 is a flowchart illustrating a flow of processing of a task suspending function on the actual device side.

【図6】実機側におけるタスク再開機能109の処理の
流れを表すフローチャートである。
FIG. 6 is a flowchart illustrating a flow of a process of a task restart function 109 on the actual device side.

【図7】シミュレーション機側におけるタスク中断機能
の処理の流れを表すフローチャートである。
FIG. 7 is a flowchart illustrating a flow of a process of a task suspending function on the simulation machine side.

【図8】シミュレーション機側のタスク再開機能の処理
の流れを表すフローチャートである。
FIG. 8 is a flowchart showing a processing flow of a task resuming function on the simulation machine side.

【図9】第2の実施形態による実機側のRTOSの構成
を示すブロック図である。
FIG. 9 is a block diagram illustrating a configuration of a real-time RTOS according to a second embodiment;

【図10】実機側のタスク生成機能の処理を説明するフ
ローチャートである。
FIG. 10 is a flowchart illustrating processing of a task generation function on the real machine side.

【図11】実機側のタスク削除機能の処理を表すフロー
チャートである。
FIG. 11 is a flowchart illustrating a process of a task deletion function on the real device side.

【図12】第2の実施形態によるシミュレーション側の
RTOSの構成を示すブロック図である。
FIG. 12 is a block diagram illustrating a configuration of an RTOS on a simulation side according to a second embodiment.

【図13】シミュレーション側のタスク生成機能の処理
手順を表すフローチャートである。
FIG. 13 is a flowchart illustrating a processing procedure of a task generation function on the simulation side.

【図14】シミュレーション側のタスク削除機能の処理
を示すフローチャートである。
FIG. 14 is a flowchart showing processing of a task deletion function on the simulation side.

【図15】第3の実施形態による実機側のRTOSの構
成を示すブロック図である。
FIG. 15 is a block diagram illustrating a configuration of an RTOS on an actual device according to a third embodiment.

【図16】実機側の割込み処理を説明するフローチャー
トである。
FIG. 16 is a flowchart illustrating an actual machine-side interrupt process;

【図17】第3の実施形態によるシミュレーション装置
側のRTOSの構成を示す図である。
FIG. 17 is a diagram illustrating a configuration of an RTOS on a simulation device side according to a third embodiment.

【図18】シグナル等の事象が発生した場合の割込み管
理機能132の処理の流れを示したフローチャートであ
る。
FIG. 18 is a flowchart showing a flow of processing of the interrupt management function 132 when an event such as a signal occurs.

【図19】第4の実施形態によるRTOSの構造を示す
図である。
FIG. 19 is a diagram showing a structure of an RTOS according to a fourth embodiment.

【図20】実行トレース情報のデータ構成例を示す図で
ある。
FIG. 20 is a diagram illustrating a data configuration example of execution trace information.

【図21】トレース情報記録機能1802の処理の流れ
を示したフローチャートである。
FIG. 21 is a flowchart showing a processing flow of a trace information recording function 1802.

【図22】デバッグ情報転送機能1803において、先
の例で示したリングバッファを用いた場合の処理の手順
を示したフローチャートである。
FIG. 22 is a flowchart showing a procedure of processing when the ring buffer shown in the previous example is used in the debug information transfer function 1803.

【図23】タスクスイッチ・ビューア1806の概観の
一例を示す図である。
FIG. 23 is a diagram illustrating an example of an overview of a task switch viewer 1806.

【図24】第1の実施形態における実機とシミュレーシ
ョン環境を提供するコンピュータ装置を示す図である。
FIG. 24 is a diagram illustrating a real device and a computer device that provides a simulation environment according to the first embodiment.

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

101 アプリケーション 102 アプリケーション・タスク 103 RTOSの共通部分 104 RTOSシステムコールの実体の集合 105 スケジューリング機能 106 RTOSの機種依存部分 108 タスクスイッチ制御機能 109 タスク中断機能 110 タスク再開機能 Reference Signs List 101 application 102 application / task 103 common part of RTOS 104 set of entities of RTOS system call 105 scheduling function 106 model-dependent part of RTOS 108 task switch control function 109 task interruption function 110 task restart function

───────────────────────────────────────────────────── フロントページの続き (72)発明者 岩渕 洋一 東京都大田区下丸子3丁目30番2号 キヤ ノン株式会社内 (72)発明者 山田 潤二 東京都大田区下丸子3丁目30番2号 キヤ ノン株式会社内 Fターム(参考) 5B098 GA02 GA04 GA08 GB02 GB09 GB11 GB13 GC03 GC14 JJ07 ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Yoichi Iwabuchi 3-30-2 Shimomaruko, Ota-ku, Tokyo Canon Inc. (72) Inventor Junji Yamada 3-30-2 Shimomaruko, Ota-ku, Tokyo Canon F term (reference) in corporation 5B098 GA02 GA04 GA08 GB02 GB09 GB11 GB13 GC03 GC14 JJ07

Claims (11)

【特許請求の範囲】[Claims] 【請求項1】 複数のタスクを含むアプリケーションプ
ログラムを制御するためのマルチタスク制御方法であっ
て、 前記複数のタスクの実行に関わるスケジューリングを行
い、タスク制御指示を発行するスケジューリング工程
と、 前記スケジューリング工程で発行されたタスク制御指示
に基づいて、当該アプリケーションプログラムの動作環
境に応じてタスクの実行を制御する実行工程とを備える
ことを特徴とするマルチタスク制御方法。
1. A multi-task control method for controlling an application program including a plurality of tasks, comprising: a scheduling step of performing scheduling related to execution of the plurality of tasks and issuing a task control instruction; An execution step of controlling execution of a task in accordance with the operation environment of the application program based on the task control instruction issued in the step (a).
【請求項2】 前記タスク制御指示はタスクの中断指示
及び再開指示を含み、 前記実行工程は、前記スケジューリング工程で発行され
た中断指示及び再開指示に基づいて、当該アプリケーシ
ョンプログラムの動作環境に応じてタスクの中断処理及
び再開処理を実行することを特徴とする請求項1に記載
のマルチタスク制御方法。
2. The task control instruction includes a task suspension instruction and a resume instruction, and the execution step is performed according to an operation environment of the application program based on the suspension instruction and the resume instruction issued in the scheduling step. 2. The multitask control method according to claim 1, wherein a task suspending process and a task resuming process are executed.
【請求項3】 前記実行工程は、前記タスク制御指示に
基づいてタスクを制御するためのタスクコントロールブ
ロックのデータを書き換えることによりタスクを制御す
ることを特徴とする請求項1に記載のマルチタスク制御
方法。
3. The multi-task control according to claim 1, wherein the execution step controls the task by rewriting data of a task control block for controlling the task based on the task control instruction. Method.
【請求項4】 前記実行工程は、前記タスク制御指示に
基づいて汎用OSのシステムコールを発行することによ
りタスクを制御することを特徴とする請求項1に記載の
マルチタスク制御方法。
4. The multitask control method according to claim 1, wherein the execution step controls the task by issuing a general-purpose OS system call based on the task control instruction.
【請求項5】 前記スケジューリング工程におけるタス
ク制御指示がタスクの生成指示及び削除指示を含むこと
を特徴とする請求項1に記載のマルチタスク制御方法。
5. The multitask control method according to claim 1, wherein the task control instruction in the scheduling step includes a task generation instruction and a task deletion instruction.
【請求項6】 前記実行工程は、更に、前記アプリケー
ションプログラムの動作環境に応じた割込み処理が可能
であることを特徴とする請求項1に記載のマルチタスク
制御方法。
6. The multitask control method according to claim 1, wherein said execution step further includes an interrupt process according to an operation environment of said application program.
【請求項7】 前記実行工程は、汎用OSからの割込み
信号に応じて割込み処理を実行するためのスレッドを生
成し、割込み処理を実行することを特徴とする請求項6
に記載のマルチタスク制御方法。
7. The execution process according to claim 6, wherein a thread for executing an interrupt process is generated in response to an interrupt signal from a general-purpose OS, and the interrupt process is executed.
2. The multitask control method according to item 1.
【請求項8】 前記スケジューリング工程で発行したタ
スク制御指示について履歴情報を保持する保持工程と、 前記保持工程で保持された履歴情報を前記アプリケーシ
ョンプログラムの動作環境に応じた形態で出力する出力
工程とを更に備えることを特徴とする請求項1に記載の
マルチタスク制御方法。
8. A holding step of holding history information on the task control instruction issued in the scheduling step, and an output step of outputting the history information held in the holding step in a form according to the operating environment of the application program. The multitask control method according to claim 1, further comprising:
【請求項9】 コンピュータに、複数のタスクを含むア
プリケーションプログラムを制御させるためのマルチタ
スク制御プログラムを格納する記憶媒体であって、該マ
ルチタスク制御プログラムが、 前記複数のタスクの実行に関わるスケジューリングを行
い、タスク制御指示を発行するスケジューリング工程の
コードと、 前記スケジューリング工程で発行されたタスク制御指示
に基づいて、当該アプリケーションプログラムの動作環
境に応じてタスクの実行を制御する実行工程のコードと
を備えることを特徴とする記憶媒体。
9. A storage medium for storing a multitask control program for causing a computer to control an application program including a plurality of tasks, wherein the multitask control program performs scheduling related to execution of the plurality of tasks. And a code for an execution step for controlling task execution according to the operating environment of the application program based on the task control instruction issued in the scheduling step. A storage medium characterized by the above-mentioned.
【請求項10】 前記マルチタスク制御プログラムが、 前記スケジューリング工程で発行したタスク制御指示に
ついて履歴情報を保持する保持工程のコードと、 前記保持工程で保持された履歴情報を前記アプリケーシ
ョンプログラムの動作環境に応じた形態で出力する出力
工程のコードとを更に備えることを特徴とする請求項9
に記載の記憶媒体。
10. The code of a holding step for holding history information on the task control instruction issued in the scheduling step, wherein the multitask control program stores the history information held in the holding step in an operating environment of the application program. 10. A code for an output step of outputting in a corresponding form.
A storage medium according to claim 1.
【請求項11】 前記スケジューリング工程のコードが
C言語プログラムのテキストで記述されていることを特
徴とする請求項9に記載の記憶媒体。
11. The storage medium according to claim 9, wherein the code of the scheduling step is described in the text of a C language program.
JP10236031A 1998-08-21 1998-08-21 Multitask control method and storage medium Pending JP2000066904A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10236031A JP2000066904A (en) 1998-08-21 1998-08-21 Multitask control method and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10236031A JP2000066904A (en) 1998-08-21 1998-08-21 Multitask control method and storage medium

Publications (1)

Publication Number Publication Date
JP2000066904A true JP2000066904A (en) 2000-03-03

Family

ID=16994744

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10236031A Pending JP2000066904A (en) 1998-08-21 1998-08-21 Multitask control method and storage medium

Country Status (1)

Country Link
JP (1) JP2000066904A (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002312156A (en) * 2001-04-12 2002-10-25 Yokogawa Electric Corp Multi-monitor system
JP2007518169A (en) * 2004-01-14 2007-07-05 インターナショナル・ビジネス・マシーンズ・コーポレーション Maintaining application behavior within a sub-optimal grid environment
JP2008108089A (en) * 2006-10-26 2008-05-08 Fujitsu Ltd Data processing system, task control method and program thereof
US7386707B2 (en) 2002-01-09 2008-06-10 Matsushita Electric Industrial Co., Ltd. Processor and program execution method capable of efficient program execution
JP2009157684A (en) * 2007-12-27 2009-07-16 Toshiba Solutions Corp Virtualization program, simulation device, and virtualization method
US7735082B2 (en) 2004-07-02 2010-06-08 Ntt Docomo, Inc. Task management system
US7735087B2 (en) 2003-03-13 2010-06-08 Panasonic Corporation Task switching apparatus, method and program
JP2011141703A (en) * 2010-01-06 2011-07-21 Renesas Electronics Corp System, method and program for arranging resource
US8275881B2 (en) 2004-01-13 2012-09-25 International Business Machines Corporation Managing escalating resource needs within a grid environment
US8346591B2 (en) 2005-01-12 2013-01-01 International Business Machines Corporation Automating responses by grid providers to bid requests indicating criteria for a grid job
US8387058B2 (en) 2004-01-13 2013-02-26 International Business Machines Corporation Minimizing complex decisions to allocate additional resources to a job submitted to a grid environment
US8396757B2 (en) 2005-01-12 2013-03-12 International Business Machines Corporation Estimating future grid job costs by classifying grid jobs and storing results of processing grid job microcosms
DE112011103536T5 (en) 2010-10-20 2013-08-01 International Business Machines Corp. A method of detecting access to an object and computer and computer program product therefor
US8583650B2 (en) 2005-01-06 2013-11-12 International Business Machines Corporation Automated management of software images for efficient resource node building within a grid environment
JP2015114895A (en) * 2013-12-12 2015-06-22 キヤノン株式会社 Management device, method and program
CN112925457A (en) * 2021-02-19 2021-06-08 深圳市云基航空科技有限责任公司 Application program control method and device, storage medium and terminal

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002312156A (en) * 2001-04-12 2002-10-25 Yokogawa Electric Corp Multi-monitor system
US9823946B2 (en) 2002-01-09 2017-11-21 Socionext Inc. Processor and program execution method capable of efficient program execution
US8719827B2 (en) 2002-01-09 2014-05-06 Panasonic Corporation Processor and program execution method capable of efficient program execution
US7386707B2 (en) 2002-01-09 2008-06-10 Matsushita Electric Industrial Co., Ltd. Processor and program execution method capable of efficient program execution
US7921281B2 (en) 2002-01-09 2011-04-05 Panasonic Corporation Processor and program execution method capable of efficient program execution
US7930520B2 (en) 2002-01-09 2011-04-19 Panasonic Corporation Processor and program execution method capable of efficient program execution
US8006076B2 (en) 2002-01-09 2011-08-23 Panasonic Corporation Processor and program execution method capable of efficient program execution
US7735087B2 (en) 2003-03-13 2010-06-08 Panasonic Corporation Task switching apparatus, method and program
US7950016B2 (en) 2003-03-13 2011-05-24 Panasonic Corporation Apparatus for switching the task to be completed in a processor by switching to the task assigned time slot
US8276156B2 (en) 2003-03-13 2012-09-25 Panasonic Corporation Task switching based on assigned time slot
US8387058B2 (en) 2004-01-13 2013-02-26 International Business Machines Corporation Minimizing complex decisions to allocate additional resources to a job submitted to a grid environment
US8275881B2 (en) 2004-01-13 2012-09-25 International Business Machines Corporation Managing escalating resource needs within a grid environment
US8136118B2 (en) 2004-01-14 2012-03-13 International Business Machines Corporation Maintaining application operations within a suboptimal grid environment
JP2007518169A (en) * 2004-01-14 2007-07-05 インターナショナル・ビジネス・マシーンズ・コーポレーション Maintaining application behavior within a sub-optimal grid environment
US7735082B2 (en) 2004-07-02 2010-06-08 Ntt Docomo, Inc. Task management system
US8583650B2 (en) 2005-01-06 2013-11-12 International Business Machines Corporation Automated management of software images for efficient resource node building within a grid environment
US8346591B2 (en) 2005-01-12 2013-01-01 International Business Machines Corporation Automating responses by grid providers to bid requests indicating criteria for a grid job
US8396757B2 (en) 2005-01-12 2013-03-12 International Business Machines Corporation Estimating future grid job costs by classifying grid jobs and storing results of processing grid job microcosms
JP2008108089A (en) * 2006-10-26 2008-05-08 Fujitsu Ltd Data processing system, task control method and program thereof
US8290764B2 (en) 2007-12-27 2012-10-16 Toshiba Solutions Corporation Virtualization program, simulation apparatus and virtualization method
JP2009157684A (en) * 2007-12-27 2009-07-16 Toshiba Solutions Corp Virtualization program, simulation device, and virtualization method
JP2011141703A (en) * 2010-01-06 2011-07-21 Renesas Electronics Corp System, method and program for arranging resource
DE112011103536T5 (en) 2010-10-20 2013-08-01 International Business Machines Corp. A method of detecting access to an object and computer and computer program product therefor
JP2015114895A (en) * 2013-12-12 2015-06-22 キヤノン株式会社 Management device, method and program
CN112925457A (en) * 2021-02-19 2021-06-08 深圳市云基航空科技有限责任公司 Application program control method and device, storage medium and terminal

Similar Documents

Publication Publication Date Title
US5632032A (en) Cross address space thread control in a multithreaded environment
JP3339482B2 (en) Distributed debugging apparatus, debugging method, and recording medium recording control program
US5630049A (en) Method and apparatus for testing software on a computer network
JP5258019B2 (en) A predictive method for managing, logging, or replaying non-deterministic operations within the scope of application process execution
US6832367B1 (en) Method and system for recording and replaying the execution of distributed java programs
JP3571976B2 (en) Debugging apparatus and method, and program recording medium
JP2000066904A (en) Multitask control method and storage medium
US8793115B2 (en) Interface converter for unified view of multiple computer system simulations
JP2692609B2 (en) Multitask program debugging method and apparatus
EP1508858A2 (en) A method and system for executing software on non-native platforms
JPH06236297A (en) Console simulator, multiplex console management system and console management dispersion system
JPH05216692A (en) Method and system for controlling program execution
Pointon et al. The design and implementation of Glasgow Distributed Haskell
US20010027387A1 (en) Debugging supporting apparatus, debugging supporting method and recording medium readable by computer with its programs recorded thereon
JP5519909B2 (en) Non-intrusive method for replaying internal events in an application process and system implementing this method
CN100530123C (en) Method for optimising the logging and replay of multi-task applications in a mono-processor or multi-processor computer system
WO1999017195A1 (en) Simulating shared code thread modules with shared code fibers
JPH09282196A (en) Program run control method for complex logic processor system.
JP2000250777A (en) Information processing apparatus, information processing method, and storage medium
SE524799C2 (en) Debugging method for single or multi process real time systems, identifies significant event break off point with unique marker comprising check sum
Buhr et al. µSystem annotated reference manual
JP3075359B2 (en) Program debugging start processing method
Yuen et al. Use of active objects in BaLinda K for system programming
Bac et al. Experience with chorus
CN118467256A (en) A cluster service failure recovery method, device, medium and product

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20031210

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060309

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060317

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060516

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20060825