JP3797274B2 - Firmware dispatch method, method, and program - Google Patents
Firmware dispatch method, method, and program Download PDFInfo
- Publication number
- JP3797274B2 JP3797274B2 JP2002149747A JP2002149747A JP3797274B2 JP 3797274 B2 JP3797274 B2 JP 3797274B2 JP 2002149747 A JP2002149747 A JP 2002149747A JP 2002149747 A JP2002149747 A JP 2002149747A JP 3797274 B2 JP3797274 B2 JP 3797274B2
- Authority
- JP
- Japan
- Prior art keywords
- task
- flash memory
- erased
- erasing
- program
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Description
【0001】
【発明の属する技術分野】
本発明はファームウェアディスパッチ方式,方法,およびプログラムに関し、特にフラッシュメモリを備えたコンピュータシステムにおけるファームウェアディスパッチ方式,方法,およびプログラムに関する。
【0002】
【従来の技術】
図3はフラッシュメモリの一例を示す構成図である。同図において、フラッシュメモリ11は複数のブロック111(ブロック1)〜115(ブロック5)に分けられている。そして、フラッシュメモリにはこれらのブロックとは関係なく、プログラムコードおよびデータを配置することができる。すなわち、同図の例によれば、タスク1プログラムコード,タスク2プログラムコード,タスク3プログラムコード,データ1,およびデータ2がそれぞれ配置されている。
【0003】
フラッシュメモリはブロック単位での消去が可能であるが、あるブロックの消去中には他のブロックに対しての読み込み,書き込みができない。他のブロックに対して読み込み,書き込みを行う場合は、ブロックの消去が終わるまで待つか,ブロックの消去を一時停止する必要がある。
【0004】
たとえば、データ1の消去を行うためにブロック4の消去を行っている間は、ブロック1,ブロック2,ブロック3,およびブロック5の読み込みや書き込みを行うことができない。また、ブロック1,ブロック2,およびブロック3の読み込みが行えないので、これらに配置されているタスク1プログラムコード,タスク2プログラムコード,およびタスク3プログラムコードの各プログラムコードのフェッチができず、プログラムの実行ができない。これらの読み込み,書き込みを行うには、ブロック4の消去が終わるのを待つか,ブロック4の消去を一時中断する必要がある。
【0005】
【発明が解決しようとする課題】
上記のように、フラッシュメモリ上にプログラムコードおよびデータが配置されている場合、あるひとつのデータが存在するブロックだけを消去するときであっても、消去中はプログラムコードのあるブロックやその他のデータがあるブロックの読み書きができない。したがって、このようなプログラムコードを記述する場合は、それぞれのタスクでフラッシュメモリの動作を意識する必要がある。
【0006】
すなわち、第一の問題点は、それぞれのタスクでフラッシュメモリの消去を意識した記述が必要なことである。その理由は、フラッシュメモリ消去中にはフラッシュメモリへの読み書きができなくなるためである。
【0007】
第二の問題点は、フラッシュメモリ消去中であっても動作必要なタスクが出てきた場合、そのタスクに迅速に実行を移せないことである。その理由は、フラッシュメモリの制御とタスクの制御が切り離されているためである。
【0008】
本発明の目的は、上記のような欠点を改善するために、ファームウェアのディスパッチャにおいて、タスク制御とフラッシュメモリ制御とを関連させて動作させることを可能とするファームウェアディスパッチ方式,方法,およびプログラムを提供することにある。
【0009】
【課題を解決するための手段】
本発明のファームウェアディスパッチ方式は、複数のブロックを含み複数のタスクプログラムおよびデータを記憶するフラッシュメモリと、IOモジュールからの入出力要求およびタイマからの割り込み要求を処理する割り込み制御プログラムと,前記フラッシュメモリを消去中に動作が可能であるか否かを示す情報を各タスクごとに保持し前記フラッシュメモリの消去動作および前記各タスクの実行動作を制御するディスパッチャとを記憶するRAMとを具備し、CPUが任意のイベントに基づきタスクを実行する際に、前記フラッシュメモリの動作の状態をチェックし、前記タスクの実行条件に従って前記フラッシュメモリの動作を決定することを特徴とする。
【0010】
さらに、本発明のファームウェアディスパッチ方式において、前記ディスパッチャは、前記フラッシュメモリの消去および書き込みを行うフラッシュメモリ制御コードと、前記フラッシュメモリに配置されたタスクプログラムに関連する各タスクのコンテキストを保持するタスク管理表と、前記タスク管理表によって各タスクの状態を監視しイベントに応じて該当のタスクの実行を制御するタスク制御コードとを備えることを特徴とする。
【0011】
また、本発明のファームウェアディスパッチ方法は、複数のブロックを含み複数のタスクプログラムおよびデータを記憶するフラッシュメモリと、IOモジュールからの入出力要求およびタイマからの割り込み要求を処理する割り込み制御プログラムと,前記フラッシュメモリを消去中に動作が可能であるか否かを示す情報を各タスクごとに保持し前記フラッシュメモリの消去動作および前記各タスクの実行動作を制御するディスパッチャとを記憶するRAMとを具備したシステムの制御方法であって、任意のイベントに基づきタスクを実行する際に、前記フラッシュメモリの動作の状態をチェックし、前記タスクの実行条件に従って前記フラッシュメモリの動作を決定することを特徴とする。
【0012】
さらに、本発明のファームウェアディスパッチ方法は、複数のブロックを含み複数のタスクプログラムおよびデータを記憶するフラッシュメモリと、IOモジュールからの入出力要求およびタイマからの割り込み要求を処理する割り込み制御プログラムと,前記フラッシュメモリを消去中に動作が可能であるか否かを示す情報を各タスクごとに保持し前記フラッシュメモリの消去動作および前記各タスクの実行動作を制御するディスパッチャとを記憶するRAMとを具備したシステムの制御方法であって、任意のタスクが実行可能の状態にある場合、前記フラッシュメモリの消去中,消去一時停止中,および消去要求中のいずれでもないとき、前記フラッシュメモリに配置されたタスクプログラムに関連する各タスクのコンテキストを保持するタスク管理表を検索して動作可能なタスクがあればそれを実行し、任意のタスクが実行可能の状態にある場合、前記フラッシュメモリの消去中,消去一時停止中,および消去要求中のいずれかであるとき、前記タスク管理表を検索して前記フラッシュメモリ消去中に動作必要なタスクのうち動作可能なタスクがあれば、前記フラッシュメモリの消去を一時停止してそのタスクを実行し、任意のタスクが実行可能の状態にある場合、前記フラッシュメモリの消去中,消去一時停止中,および消去要求中のいずれかであるとき、前記タスク管理表を検索して前記フラッシュメモリ消去中に動作必要なタスクのうち動作可能なタスクがなければ、前記フラッシュメモリの消去を実行することを特徴とする。
【0013】
また、本発明のファームウェアディスパッチプログラムは、複数のブロックを含み複数のタスクプログラムおよびデータを記憶するフラッシュメモリと、IOモジュールからの入出力要求およびタイマからの割り込み要求を処理する割り込み制御プログラムと,前記フラッシュメモリを消去中に動作が可能であるか否かを示す情報を各タスクごとに保持し前記フラッシュメモリの消去動作および前記各タスクの実行動作を制御するディスパッチャとを記憶するRAMとを具備したシステムの制御プログラムであって、任意のイベントに基づきタスクを実行する際に、前記フラッシュメモリの動作の状態をチェックし、前記タスクの実行条件に従って前記フラッシュメモリの動作を決定することを特徴とする。
【0014】
さらに、本発明のファームウェアディスパッチプログラムは、複数のブロックを含み複数のタスクプログラムおよびデータを記憶するフラッシュメモリと、IOモジュールからの入出力要求およびタイマからの割り込み要求を処理する割り込み制御プログラムと,前記フラッシュメモリを消去中に動作が可能であるか否かを示す情報を各タスクごとに保持し前記フラッシュメモリの消去動作および前記各タスクの実行動作を制御するディスパッチャとを記憶するRAMとを具備したシステムの制御プログラムであって、任意のタスクが実行可能の状態にある場合、前記フラッシュメモリの消去中,消去一時停止中,および消去要求中のいずれでもないとき、前記フラッシュメモリに配置されたタスクプログラムに関連する各タスクのコンテキストを保持するタスク管理表を検索して動作可能なタスクがあればそれを実行し、任意のタスクが実行可能の状態にある場合、前記フラッシュメモリの消去中,消去一時停止中,および消去要求中のいずれかであるとき、前記タスク管理表を検索して前記フラッシュメモリ消去中に動作必要なタスクのうち動作可能なタスクがあれば、前記フラッシュメモリの消去を一時停止してそのタスクを実行し、任意のタスクが実行可能の状態にある場合、前記フラッシュメモリの消去中,消去一時停止中,および消去要求中のいずれかであるとき、前記タスク管理表を検索して前記フラッシュメモリ消去中に動作必要なタスクのうち動作可能なタスクがなければ、前記フラッシュメモリの消去を実行することを特徴とする。
【0015】
【発明の実施の形態】
以下、本発明について図面を参照しながら説明する。
【0016】
図1は本発明の実施の一形態を示す構成図である。同図において、本発明によるファームウェアディスパッチ方式は、複数のブロック211および212を含み複数のタスクプログラムコード214およびデータ213を記憶するフラッシュメモリ21と、IOモジュール24からの入出力要求およびタイマ25からの割り込み要求を処理する割り込み制御コード222と,前記フラッシュメモリを消去中に動作が可能であるか否かを示す情報を各タスクごとに保持し前記フラッシュメモリの消去動作および前記各タスクの実行動作を制御するディスパッチャ221とを記憶するRAM22とを具備し、CPU23が任意のイベントに基づきタスクを実行する際に、前記フラッシュメモリの動作の状態をチェックし、前記タスクの実行条件に従って前記フラッシュメモリの動作を決定する。
【0017】
なお、上記のディスパッチャ221は、前記フラッシュメモリの消去および書き込みを行うフラッシュメモリ制御コード2211と、前記フラッシュメモリに配置されたタスクプログラムに関連する各タスクのコンテキストを保持するタスク管理表2213と、前記タスク管理表によって各タスクの状態を監視しイベントに応じて該当のタスクの実行を制御するタスク制御コード2212とを備えている。
【0018】
フラッシュメモリ21はブロック211およびブロック212を含む。ブロック211にはデータ213が配置され、ブロック212にはタスクプログラムコード214が配置される。タスクプログラムコード214はサービスを提供するための複数のタスクのプログラムを記憶する。データ213はタスクプログラムコード214が実行される時に使用するパラメータなどのデータを記憶する。
【0019】
RAM22はディスパッチャ221と割り込み制御コード222とを含む。
【0020】
ディスパッチャ221はフラッシュメモリ制御コード2211とタスク制御コード2212とタスク管理表2213とを含む。フラッシュメモリ制御コード2211はフラッシュメモリの消去や書き込みなどの制御を行うプログラムコードを記憶する。タスク制御コード2212はタスク管理表2213で管理される各タスクの状態を監視し、起こったイベントなどに応じてタスクの実行を制御するプログラムコードを記憶する。
【0021】
タスク管理表2213はフラッシュメモリ21上に配置されるタスクプログラムコード214に関連する各タスクのコンテキストを管理する。このコンテキストには各タスクがフラッシュメモリ消去中においても、実行が必要なタスクであるか否かの情報を含んでいる。
【0022】
割り込み制御コード222は入出力要求やタイマ割り込みなどのイベントが起こった際に呼び出されて、そのイベントを処理するプログラムコードを記憶する。
【0023】
CPU23はタスクプログラムコード214とフラッシュメモリ制御コード2211とタスク制御コード2212と割り込み制御コード222のプログラムコードをフェッチして実行を行う。また、IOモジュール24から入出力の要求を受けた場合やタイマ25からのタイマ割り込みを受けた場合、対応する割り込み制御コード222を読み込んで実行する。
【0024】
IOモジュール24は外部からの入力要求や出力要求を受けてCPU23に通知し、外部とのデータのやり取りを行う。
【0025】
タイマ25は定期的に割り込みを発生し、CPU23に通知する。
【0026】
IOモジュール24からの入出力要求やタイマ25からの定期割り込みが発生すると、それらはCPU23へ通知される。CPU23はこれらを受け取ると、それまでの処理を中断し、割り込み制御コード222を読み込んで実行し、それぞれの要求の処理を行う。
【0027】
割り込み制御コード222で処理しきれないイベントは、各タスクへ処理を要求するが、この要求はタスク管理表2213のなかで管理される各タスクのコンテキスト中のタスクの実行可能状態に反映することで行われる。
【0028】
割り込み制御コード222の実行が終わり、CPU23においてほかのプログラムの実行が可能になると、タスク制御コード2212はCPU23に読み込まれ、タスクの制御を行う。タスクの制御コード2212は各タスクのコンテキストが記述されているタスク管理表2213を参照しながら、どのようにタスクの実行制御を行うか決定する。
【0029】
タスク管理表2213で管理される各タスクのコンテキストには、プログラムカウンタの値,スタックポインタの値,タスクの実行可能状態などのほかに、そのタスクがフラッシュメモリ消去中であっても動作すべきか否かを表すフラグを備える。タスク制御コード2212は、タスクの状態,フラッシュメモリ消去中であっても動作すべきか否かを表すフラグ,フラッシュメモリ21の状態は消去中であるか否かなどを考慮して、どのタスクに実行権を渡すか決定する。
【0030】
フラッシュメモリ21が消去中でないときに、タスク制御コード2212があるタスクに実行権を渡すことを決定すると、タスクプログラムコード214から対象となるタスクのプログラムをCPU23に読み込ませ、実行を開始する。
【0031】
フラッシュメモリ21が消去中のときに、タスク制御コード2212があるタスクに制御が渡すことを決定すると、フラッシュメモリ制御コード2211をCPU23に読み込ませ、フラッシュメモリ21の消去の一時停止を行う。その後、タスクプログラムコード214から対象となるタスクのプログラムをCPU23に読み込み、実行を開始する。
【0032】
タスクの処理が終了し、再びタスク制御コード2212がCPU23に読み込まれて実行されたとき、フラッシュメモリ21の消去が一時停止している場合、タスク制御コード2212は、フラッシュメモリ21の消去中であっても実行すべきタスクがあるか否かをタスク管理表2213を参照して確認する。この結果、実行すべきタスクがないならば、フラッシュメモリ制御コード2211をCPU23へ読み込み、フラッシュメモリ21の消去を再開させる。
【0033】
タスクプログラムコード214はCPU23に読み込まれて、タスクプログラムが実行されるが、このとき必要に応じてデータ213の読み込み,書き込み,消去を行う。タスクプログラムがデータ213を消去することを決定した場合、データ213を含んでいるブロック211の消去要求をタスク制御コード2212へ通知する。
【0034】
その後、タスク制御コード2212がCPU23に読み込まれて実行されたとき、ブロックの消去要求の有無を確認する。このとき、ブロック211の消去要求を発見すると、フラッシュメモリ制御コード2211をCPU23に読み込んで実行する。フラッシュメモリ制御コード2211は、指示に従い、フラッシュメモリ21のブロック211の消去を開始する。
【0035】
図2は本発明の動作を示す流れ図である。
【0036】
同図において、上記のファームウェアディスパッチ方式は、タスク制御コード2212がCPU23に読み込まれて実行を開始すると、タスク管理表2213で管理されるタスクの状態変化を待つ(ステップA1)。
【0037】
このとき、IOモジュール24やタイマ25から割り込み要因が発生すると、それらはCPU23に通知される。CPU23はこれらの割り込み要因を処置するため、割り込み制御コード222をCPU23に読み込んで割り込み要因の処置を行う。割り込み制御コード222だけでは処理し切れない場合、タスク管理表2213のタスクの状態を変更させ、タスクの処理を促す。
【0038】
割り込み制御コード222の動作が終了すると、再びタスク制御コード2212がCPU23に読み込まれて動作を行う。タスクの状態変化を検出したタスク制御コード2212は、現在動作中を示すタスクがないかタスク管理表2213を調べ、動作中のタスクがあれば実行可能状態に変更する(ステップA2)。
【0039】
次に、フラッシュメモリ21が消去中であるか,消去一時停止中であるか,消去要求があるかを調べる(ステップA3)。
【0040】
もしこれらの要求のいずれも満たされない場合、タスク管理表2213を検索し(ステップA4)、動作可能なタスクがあるか否か調べて(ステップA5)、動作可能なタスクがあればそれにディスパッチして処理をさせる(ステップA6)。
【0041】
ステップA3において、いずれかの条件を満たした場合、タスク管理表2213を検索し(ステップA7)、フラッシュメモリ消去中にも動作することが必要で、かつ現在動作可能状態にあるタスクが存在するか調べる(ステップA8)。
【0042】
条件を満たすタスクが存在すれば、さらにフラッシュメモリ21が消去中であるか調べ(ステップA9)、消去中の場合はフラッシュメモリ制御コード2211をCPU23に読み込ませて実行し、消去を一時停止させてから(ステップA10)、そうでない場合はそのままそのタスクにディスパッチして実行させる(ステップA11)。
【0043】
ステップA8において、条件を満たすタスクがなかった場合、フラッシュメモリ21が現在消去中であるか否か調べて(ステップA12)、消去中であればそのままの状態にして消去をの処理を続行させる。
【0044】
消去中でなければ、フラッシュメモリ21が消去一時停止中であるか調べ(ステップA13)、一時停止中であるならばフラッシュメモリ制御コード2211をCPU23に読み込ませて実行し、フラッシュメモリ21の消去を再開させる(ステップA14)。
【0045】
一方、消去一時停止中でないならば、フラッシュメモリ21のブロックの消去要求があるかどうか調べて(ステップA15)、あるならばフラッシュメモリ制御コード2211をCPU23に読み込ませて実行し、フラッシュメモリ21の消去を開始させる(ステップA16)。
【0046】
上記の処理を繰り返し行うことにより、タスクの制御とフラッシュメモリの制御を行う。
【0047】
上記のように、タスク管理表2213はタスクのコンテキストを管理するが、これにはタスクがフラッシュメモリ消去中に動作必要か否かを示す情報を含む。タスク制御コード2212がCPU23に読み込まれて動作し、どのタスクにディスパッチするか決定する際に、タスク管理表2213の情報とフラッシュメモリ21の消去動作の状態とを考慮する。
【0048】
すなわち、フラッシュメモリ21が消去中に動作する必要のないタスクについては、フラッシュメモリ消去中にはディスパッチしないようにする。フラッシュメモリ21が消去中であっても動作する必要のあるタスクの場合には、フラッシュメモリ制御コード2211をCPU23に読み込み、フラッシュメモリ制御プログラムを実行する。
【0049】
フラッシュメモリ制御プログラムはフラッシュメモリ21の消去動作を一時停止させ、その後、タスク制御コード2212がCPU23に読み込まれて実行され、動作する必要のあるタスクにディスパッチする。フラッシュメモリ消去中に動作する必要のあるタスクが待ち状態になれば、CPU23に読み込まれて実行されるフラッシュメモリ制御コード2211が、一時消去停止中のフラッシュメモリ21の消去動作を再開させる。
【0050】
上記の通り、ディスパッチャにおいてタスク制御とフラッシュメモリ制御とを関連させて動作させることができる。
【0051】
【発明の効果】
以上、詳細に説明したように、本発明によれば、タスク制御およびフラッシュメモリ制御を相互に関連させてディスパッチング処理を実行しているので、次の効果が得られる。
【0052】
第一の効果は、フラッシュメモリの消去動作を意識せずに動作可能なタスクを作成できることである。
【0053】
第二の効果は、フラッシュメモリの消去中にあるタスクが動作する必要が出てきても、迅速にそのタスクにディスパッチできることである。
【図面の簡単な説明】
【図1】本発明の実施の一形態を示す構成図。
【図2】本発明の動作を示す流れ図。
【図3】フラッシュメモリの構成を示す説明図。
【符号の説明】
21 フラッシュメモリ
22 RAM
23 CPU
24 IOモジュール
25 タイマ
211,212 ブロック
213 データ
214 タスクプログラムコード
221 ディスパッチャ
222 割り込み制御コード
2211 フラッシュメモリ制御コード
2212 タスク制御コード
2213 タスク管理表[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a firmware dispatch method, method, and program, and more particularly, to a firmware dispatch method, method, and program in a computer system having a flash memory.
[0002]
[Prior art]
FIG. 3 is a block diagram showing an example of a flash memory. In the figure, the
[0003]
The flash memory can be erased in units of blocks, but cannot be read or written to other blocks while a certain block is being erased. When reading or writing to another block, it is necessary to wait until the block erase is completed or to temporarily erase the block.
[0004]
For example, while erasing block 4 to erase data 1, block 1, block 2, block 3, and block 5 cannot be read or written. Further, since reading of block 1, block 2, and block 3 cannot be performed, the program codes of task 1 program code, task 2 program code, and task 3 program code arranged in these cannot be fetched, and the program Cannot be executed. In order to perform these reading and writing operations, it is necessary to wait for the erasure of the block 4 to end or to temporarily suspend the erasure of the block 4.
[0005]
[Problems to be solved by the invention]
As described above, when program code and data are arranged in the flash memory, even if only a block in which a certain data exists is erased, a block with program code or other data is being erased. I can't read or write a block. Therefore, when writing such program code, it is necessary to be aware of the operation of the flash memory in each task.
[0006]
That is, the first problem is that each task requires a description that is conscious of erasing the flash memory. This is because reading / writing to the flash memory becomes impossible during erasing the flash memory.
[0007]
The second problem is that even when a flash memory is being erased, if a task requiring operation comes out, execution cannot be quickly transferred to that task. This is because the control of the flash memory and the control of the task are separated.
[0008]
SUMMARY OF THE INVENTION An object of the present invention is to provide a firmware dispatch method, method, and program capable of operating task control and flash memory control in association with each other in a firmware dispatcher in order to improve the above drawbacks. There is to do.
[0009]
[Means for Solving the Problems]
The firmware dispatch system of the present invention includes a flash memory including a plurality of blocks and storing a plurality of task programs and data, an interrupt control program for processing an input / output request from an IO module and an interrupt request from a timer, and the flash memory A RAM for storing information indicating whether or not the operation is possible during erasing for each task and storing a dispatcher for controlling the erasing operation of the flash memory and the execution operation of each task, and a CPU. When executing a task based on an arbitrary event, the operation state of the flash memory is checked, and the operation of the flash memory is determined according to the execution condition of the task.
[0010]
Furthermore, in the firmware dispatch system of the present invention, the dispatcher holds a flash memory control code for erasing and writing the flash memory, and a task management for holding a context of each task related to the task program arranged in the flash memory And a task control code that monitors the state of each task by the task management table and controls the execution of the corresponding task in accordance with an event.
[0011]
The firmware dispatch method of the present invention includes a flash memory including a plurality of blocks and storing a plurality of task programs and data, an interrupt control program for processing an input / output request from an IO module and an interrupt request from a timer, A RAM for storing information indicating whether or not the operation can be performed while erasing the flash memory for each task, and storing a dispatcher for controlling the erasing operation of the flash memory and the execution operation of each task. A method of controlling a system, wherein when a task is executed based on an arbitrary event, the operation state of the flash memory is checked, and the operation of the flash memory is determined according to an execution condition of the task. .
[0012]
Further, the firmware dispatch method of the present invention includes a flash memory including a plurality of blocks and storing a plurality of task programs and data, an interrupt control program for processing an input / output request from an IO module and an interrupt request from a timer, A RAM for storing information indicating whether or not the operation can be performed while erasing the flash memory for each task, and storing a dispatcher for controlling the erasing operation of the flash memory and the execution operation of each task. A system control method in which an arbitrary task is in an executable state, and when the flash memory is not being erased, suspended, or requested to be erased, the task arranged in the flash memory Maintains the context of each task associated with the program If a task management table is searched and an operable task is found, it is executed. If any task is in an executable state, the flash memory is being erased, suspended for erasure, or requested to be erased. When there is an operable task among the tasks necessary to operate during the flash memory erasing by searching the task management table, the erasing of the flash memory is paused and the task is executed. When the task is in an executable state, the task management table is searched and operation is required during the flash memory erasure when the flash memory is being erased, suspended temporarily, or requested to be erased. If there is no operable task among the tasks, the flash memory is erased.
[0013]
The firmware dispatch program of the present invention includes a flash memory including a plurality of blocks and storing a plurality of task programs and data, an interrupt control program for processing an input / output request from an IO module and an interrupt request from a timer, A RAM for storing information indicating whether or not the operation can be performed while erasing the flash memory for each task, and storing a dispatcher for controlling the erasing operation of the flash memory and the execution operation of each task. A control program for a system, wherein when a task is executed based on an arbitrary event, the operation state of the flash memory is checked, and the operation of the flash memory is determined according to an execution condition of the task. .
[0014]
Furthermore, a firmware dispatch program of the present invention includes a flash memory including a plurality of blocks and storing a plurality of task programs and data, an interrupt control program for processing an input / output request from an IO module and an interrupt request from a timer, A RAM for storing information indicating whether or not the operation can be performed while erasing the flash memory for each task, and storing a dispatcher for controlling the erasing operation of the flash memory and the execution operation of each task. When the system control program is in an executable state, the task allocated in the flash memory when the flash memory is not being erased, suspended, or requested to be erased The context of each task related to the program If there is an operable task by searching the task management table that holds the task, it is executed, and if any task is in an executable state, the flash memory is being erased, erase erase suspended, and an erase request If there is an operable task among the tasks required to operate during the flash memory erasure by searching the task management table, the erasure of the flash memory is suspended and the task is executed. However, if any task is in an executable state, the task management table is searched and the flash memory is being erased when the flash memory is being erased, suspended temporarily, or requested to be erased. If there is no operable task among the necessary tasks, the flash memory is erased.
[0015]
DETAILED DESCRIPTION OF THE INVENTION
The present invention will be described below with reference to the drawings.
[0016]
FIG. 1 is a block diagram showing an embodiment of the present invention. In the figure, the firmware dispatch method according to the present invention includes a plurality of
[0017]
The dispatcher 221 includes a flash
[0018]
The
[0019]
The
[0020]
The dispatcher 221 includes a flash
[0021]
The task management table 2213 manages the context of each task related to the
[0022]
The interrupt
[0023]
The
[0024]
The
[0025]
The
[0026]
When an I / O request from the
[0027]
Events that cannot be processed by the interrupt
[0028]
When the execution of the interrupt
[0029]
In addition to the program counter value, stack pointer value, task executable state, etc., the context of each task managed by the task management table 2213 should be operated even if the task is being erased from the flash memory. The flag which expresses is provided. The task control code 2212 is executed for any task in consideration of the state of the task, a flag indicating whether or not the
[0030]
When the
[0031]
When the
[0032]
When the processing of the task is finished and the task control code 2212 is read and executed again by the
[0033]
The
[0034]
Thereafter, when the task control code 2212 is read and executed by the
[0035]
FIG. 2 is a flowchart showing the operation of the present invention.
[0036]
In the figure, in the firmware dispatch method described above, when the task control code 2212 is read by the
[0037]
At this time, if interrupt factors occur from the
[0038]
When the operation of the interrupt
[0039]
Next, it is checked whether the
[0040]
If none of these requests is satisfied, the task management table 2213 is searched (step A4) to check whether there is an operable task (step A5), and if there is an operable task, dispatch it to it. Processing is performed (step A6).
[0041]
If any of the conditions is satisfied in step A3, the task management table 2213 is searched (step A7), and it is necessary to operate even during flash memory erasing, and there is a task that is currently operable. Check (step A8).
[0042]
If there is a task that satisfies the conditions, it is further checked whether the
[0043]
If there is no task that satisfies the condition in step A8, it is checked whether or not the
[0044]
If not erased, it is checked whether or not the
[0045]
On the other hand, if the erasure is not suspended, it is checked whether there is an erasure request for the block of the flash memory 21 (step A15). If there is, the
[0046]
By repeating the above processing, task control and flash memory control are performed.
[0047]
As described above, the task management table 2213 manages the context of a task, which includes information indicating whether the task needs to operate during flash memory erasure. When the task control code 2212 is read and operated by the
[0048]
That is, a task that does not need to operate during the erasure of the
[0049]
The flash memory control program temporarily stops the erase operation of the
[0050]
As described above, the dispatcher can operate the task control and the flash memory control in association with each other.
[0051]
【The invention's effect】
As described above in detail, according to the present invention, the task control and the flash memory control are associated with each other and the dispatching process is executed. Therefore, the following effects can be obtained.
[0052]
The first effect is that a task that can operate without being aware of the erase operation of the flash memory can be created.
[0053]
The second effect is that even if a task needs to be operated while the flash memory is being erased, the task can be dispatched quickly.
[Brief description of the drawings]
FIG. 1 is a configuration diagram showing an embodiment of the present invention.
FIG. 2 is a flowchart showing the operation of the present invention.
FIG. 3 is an explanatory diagram showing a configuration of a flash memory.
[Explanation of symbols]
21
23 CPU
24
Claims (6)
CPUが任意のイベントに基づきタスクを実行する際に、前記フラッシュメモリの動作の状態をチェックし、前記タスクの実行条件に従って前記フラッシュメモリの動作を決定することを特徴とするファームウェアディスパッチ方式。Flash memory that contains multiple blocks and stores multiple task programs and data, an interrupt control program that processes I / O requests from IO modules and interrupt requests from timers, and can operate while erasing the flash memory A RAM that stores information indicating whether or not there is for each task and stores a dispatcher that controls the erase operation of the flash memory and the execution operation of each task;
A firmware dispatching system, wherein when a CPU executes a task based on an arbitrary event, the operation state of the flash memory is checked and the operation of the flash memory is determined according to an execution condition of the task.
任意のイベントに基づきタスクを実行する際に、前記フラッシュメモリの動作の状態をチェックし、前記タスクの実行条件に従って前記フラッシュメモリの動作を決定することを特徴とするファームウェアディスパッチ方法。Flash memory that contains multiple blocks and stores multiple task programs and data, an interrupt control program that processes I / O requests from IO modules and interrupt requests from timers, and can operate while erasing the flash memory A control method for a system comprising a RAM that stores information indicating whether or not there is and stores a dispatcher that controls the erase operation of the flash memory and the execution operation of each task,
A firmware dispatch method comprising: checking a state of operation of the flash memory when executing a task based on an arbitrary event, and determining the operation of the flash memory according to an execution condition of the task.
任意のタスクが実行可能の状態にある場合、前記フラッシュメモリの消去中,消去一時停止中,および消去要求中のいずれでもないとき、前記フラッシュメモリに配置されたタスクプログラムに関連する各タスクのコンテキストを保持するタスク管理表を検索して動作可能なタスクがあればそれを実行し、
任意のタスクが実行可能の状態にある場合、前記フラッシュメモリの消去中,消去一時停止中,および消去要求中のいずれかであるとき、前記タスク管理表を検索して前記フラッシュメモリ消去中に動作必要なタスクのうち動作可能なタスクがあれば、前記フラッシュメモリの消去を一時停止してそのタスクを実行し、
任意のタスクが実行可能の状態にある場合、前記フラッシュメモリの消去中,消去一時停止中,および消去要求中のいずれかであるとき、前記タスク管理表を検索して前記フラッシュメモリ消去中に動作必要なタスクのうち動作可能なタスクがなければ、前記フラッシュメモリの消去を実行することを特徴とするファームウェアディスパッチ方法。Flash memory that includes multiple blocks and stores multiple task programs and data, an interrupt control program that processes I / O requests from IO modules and interrupt requests from timers, and can operate while erasing the flash memory A control method for a system comprising a RAM for storing information indicating whether or not there is for each task and storing a dispatcher for controlling the erase operation of the flash memory and the execution operation of each task,
When an arbitrary task is in an executable state, the context of each task related to the task program arranged in the flash memory when the flash memory is not being erased, suspended, or requested to be erased If there is an operable task, search the task management table that holds
When an arbitrary task is in an executable state, the task management table is searched and the flash memory is erased when the flash memory is being erased, erase-suspended, or requested to be erased. If there is an operable task among the necessary tasks, the erasing of the flash memory is paused and executed.
When an arbitrary task is in an executable state, the task management table is searched and the flash memory is erased when the flash memory is being erased, erase-suspended, or requested to be erased. A firmware dispatch method comprising: erasing the flash memory if there is no operable task among necessary tasks.
任意のイベントに基づきタスクを実行する際に、前記フラッシュメモリの動作の状態をチェックし、前記タスクの実行条件に従って前記フラッシュメモリの動作を決定することを特徴とするファームウェアディスパッチプログラム。Flash memory that includes multiple blocks and stores multiple task programs and data, an interrupt control program that processes I / O requests from IO modules and interrupt requests from timers, and can operate while erasing the flash memory A control program for a system comprising a RAM that stores information indicating whether or not there is for each task and stores a dispatcher that controls the erase operation of the flash memory and the execution operation of each task,
A firmware dispatch program characterized in that when a task is executed based on an arbitrary event, an operation state of the flash memory is checked and an operation of the flash memory is determined according to an execution condition of the task.
任意のタスクが実行可能の状態にある場合、前記フラッシュメモリの消去中,消去一時停止中,および消去要求中のいずれでもないとき、前記フラッシュメモリに配置されたタスクプログラムに関連する各タスクのコンテキストを保持するタスク管理表を検索して動作可能なタスクがあればそれを実行し、
任意のタスクが実行可能の状態にある場合、前記フラッシュメモリの消去中,消去一時停止中,および消去要求中のいずれかであるとき、前記タスク管理表を検索して前記フラッシュメモリ消去中に動作必要なタスクのうち動作可能なタスクがあれば、前記フラッシュメモリの消去を一時停止してそのタスクを実行し、
任意のタスクが実行可能の状態にある場合、前記フラッシュメモリの消去中,消去一時停止中,および消去要求中のいずれかであるとき、前記タスク管理表を検索して前記フラッシュメモリ消去中に動作必要なタスクのうち動作可能なタスクがなければ、前記フラッシュメモリの消去を実行することを特徴とするファームウェアディスパッチプログラム。Flash memory that includes multiple blocks and stores multiple task programs and data, an interrupt control program that processes I / O requests from IO modules and interrupt requests from timers, and can operate while erasing the flash memory A control program for a system comprising a RAM that stores information indicating whether or not there is for each task and stores a dispatcher that controls the erase operation of the flash memory and the execution operation of each task,
When an arbitrary task is in an executable state, the context of each task related to the task program arranged in the flash memory when the flash memory is not being erased, suspended, or requested to be erased If there is an operable task, search the task management table that holds
When an arbitrary task is in an executable state, the task management table is searched and the flash memory is erased when the flash memory is being erased, erase-suspended, or requested to be erased. If there is an operable task among the necessary tasks, the erasing of the flash memory is paused and executed.
When an arbitrary task is in an executable state, the task management table is searched and the flash memory is erased when the flash memory is being erased, erase-suspended, or requested to be erased. A firmware dispatch program, wherein if there is no operable task among necessary tasks, the flash memory is erased.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002149747A JP3797274B2 (en) | 2002-05-23 | 2002-05-23 | Firmware dispatch method, method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002149747A JP3797274B2 (en) | 2002-05-23 | 2002-05-23 | Firmware dispatch method, method, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2003345608A JP2003345608A (en) | 2003-12-05 |
JP3797274B2 true JP3797274B2 (en) | 2006-07-12 |
Family
ID=29767813
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2002149747A Expired - Fee Related JP3797274B2 (en) | 2002-05-23 | 2002-05-23 | Firmware dispatch method, method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3797274B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014115735A (en) * | 2012-12-06 | 2014-06-26 | Fujitsu Semiconductor Ltd | Electronic equipment and method for controlling the same |
-
2002
- 2002-05-23 JP JP2002149747A patent/JP3797274B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2003345608A (en) | 2003-12-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6665699B1 (en) | Method and data processing system providing processor affinity dispatching | |
US6021425A (en) | System and method for optimizing dispatch latency of tasks in a data processing system | |
US8959515B2 (en) | Task scheduling policy for limited memory systems | |
US9870252B2 (en) | Multi-threaded processing with reduced context switching | |
KR100977662B1 (en) | Two-level interrupt service routine | |
US6996821B1 (en) | Data processing systems and method for batching tasks of the same type in an instruction cache | |
US7853743B2 (en) | Processor and interrupt controlling method | |
US20100231959A1 (en) | Execution order determining device, execution order determining program, execution order determining circuit, and information processing device | |
US7555671B2 (en) | Systems and methods for implementing reliability, availability and serviceability in a computer system | |
KR20110048531A (en) | Interrupt Control of Virtual Processing Unit | |
CN110737453A (en) | Security chip upgrading method and device and security chip | |
US20040098722A1 (en) | System, method, and computer program product for operating-system task management | |
CN100538649C (en) | Be used to distribute the untapped processor round-robin method and system in the dispatch window | |
JPH1021094A (en) | Real-time control system | |
US20050132038A1 (en) | Resource reservation system and resource reservation method and recording medium storing program for executing the method | |
JP3797274B2 (en) | Firmware dispatch method, method, and program | |
JP5678347B2 (en) | IT system configuration method, computer program thereof, and IT system | |
US7702836B2 (en) | Parallel processing device and exclusive control method | |
US20100107169A1 (en) | Periodical task execution apparatus, periodical task execution method, and storage medium | |
JPH02161523A (en) | Resident module correcting system | |
CN111563000A (en) | File generation method, intelligent terminal and storage medium | |
JP2007122337A (en) | Arithmetic unit | |
CN101107591A (en) | Computer system and method for activating basic program therein | |
US20230236901A1 (en) | Safe critical section operations for virtual machines with virtual central processing unit overcommit | |
Hölscher et al. | Examining and Supporting Multi-Tasking in EV3OSEK |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20040420 |
|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20050307 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20060328 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20060410 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100428 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110428 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120428 Year of fee payment: 6 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120428 Year of fee payment: 6 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130428 Year of fee payment: 7 |
|
LAPS | Cancellation because of no payment of annual fees |