JP2008135051A - Electronic device, data processing method, and computer program - Google Patents
Electronic device, data processing method, and computer program Download PDFInfo
- Publication number
- JP2008135051A JP2008135051A JP2007337935A JP2007337935A JP2008135051A JP 2008135051 A JP2008135051 A JP 2008135051A JP 2007337935 A JP2007337935 A JP 2007337935A JP 2007337935 A JP2007337935 A JP 2007337935A JP 2008135051 A JP2008135051 A JP 2008135051A
- Authority
- JP
- Japan
- Prior art keywords
- program
- area
- recording medium
- address
- variable
- 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.)
- Granted
Links
Images
Abstract
Description
本発明は、電子機器、データ処理方法、及びコンピュータプログラムに関し、特に、電子機器をスタートアップさせるために用いて好適なものである。 The present invention relates to an electronic device, a data processing method, and a computer program, and is particularly suitable for use in starting up an electronic device.
近年、デジタルカメラなどの分野では、ウインドウシステムを使ったGUI(Graphical User Interface;グラフィカルユーザーインターフェース)などを含む大規模なソフトウェアをROM(Read Only Memory)に組み込んで実行させる事が行われるようになった。このようなシステムでは32ビットのRISC(Reduced Instruction Set Computer)プロセッサや大容量のDRAM(Dynamic Random Access Memory)を小型の電池によって駆動しなければならない。 In recent years, in the field of digital cameras and the like, large-scale software including a GUI (Graphical User Interface) using a window system is incorporated into a ROM (Read Only Memory) and executed. It was. In such a system, a 32-bit RISC (Reduced Instruction Set Computer) processor and a large-capacity DRAM (Dynamic Random Access Memory) must be driven by a small battery.
このため、使用しないときは電源を完全にOFFにしておき、使用する直前に電源を入れるのが普通である。デジタルカメラの場合、撮影したいタイミングを逃さないためには、電源投入から使用可能になるまでの時間ができるだけ短いほうがよい。したがって、システムのスタートアップ時間が短くなるようなコンピュータシステムが望まれている。システムのスタートアップ時間の中には、OS(Operating System)やドライバーの初期化に加えて、C言語のような高級言語のデータセグメントの初期値を転送する部分も含まれる。これらは、デジタルカメラとしての動作上、初期化以前に必要なものであり、オーバーヘッドと呼ばれるものである。また、ROMからの高級言語の起動に関する従来技術として特許文献1がある。
For this reason, it is normal to turn off the power completely when not in use and turn on the power just before use. In the case of a digital camera, in order not to miss the timing at which it is desired to shoot, it is better that the time from when the power is turned on until it becomes usable is as short as possible. Therefore, a computer system that shortens the startup time of the system is desired. The system startup time includes not only the initialization of the OS (Operating System) and driver, but also the part of transferring the initial value of the data segment of a high-level language such as C language. These are necessary before the initialization for operation as a digital camera, and are called overhead. Further, there is
このように、C言語をはじめとする高級言語を使ったROM化プログラムを構成する場合、高級言語として動作を可能とするための初期化が必要となる。中でも変数領域に初期値を設定する時間は、プログラムの規模に応じて長くなる傾向にある。C言語では初期化付き静的変数と呼ばれるものがそれ相当する。変数領域は、データセグメントと呼ばれるエリアで、プログラマによってRAMの所定の番地にアサインされる(割り当てられる)。 As described above, when a ROMized program using a high-level language such as C language is configured, initialization is required to enable operation as a high-level language. In particular, the time for setting the initial value in the variable area tends to become longer depending on the scale of the program. In C language, what is called a static variable with initialization corresponds to it. The variable area is an area called a data segment, and is assigned (assigned) to a predetermined address in the RAM by the programmer.
初期値はROMの所定の番地に書き込まれており、C言語のスタートアップルーチンによってROMからRAMのデータセグメントへコピーされる。またC言語の場合、初期値がアサインされていない静的変数は0に初期化されるという仕様になっており、それらの変数はBSS領域と呼ばれるRAM上のエリアに配置される。ROMからRAMへの初期値の転送に加えて、BSS領域に配置されている変数をゼロ(0)にすること(0クリア)もスタートアップの際に時間のかかる処理である。 The initial value is written in a predetermined address of the ROM, and is copied from the ROM to the data segment of the RAM by a C language startup routine. In the case of the C language, the specification is that static variables to which no initial value is assigned are initialized to 0, and these variables are arranged in an area on the RAM called a BSS area. In addition to transferring the initial value from the ROM to the RAM, setting a variable arranged in the BSS area to zero (0) (clearing to zero) is a time-consuming process at startup.
この他に、アニメーションを多用したGUIの表現や、ソフトウェアによるファイルの圧縮やプリンティングのための画像処理など、CPUによる高速な処理が要求される部分も多い。 In addition to this, there are many parts that require high-speed processing by the CPU, such as GUI representation that uses a lot of animation and image processing for file compression and printing by software.
<ROM・RAMの速度格差>
RISCプロセッサのクロックは、年々高速化する傾向にあり、100Mhzや200Mhzといった高速な動作を行うことも珍しくない。しかし、ROMのアクセススピードは120ナノ秒程度とプロセッサスピードに対して非常に遅い。また、カメラを小型化するために32ビットBUSで接続するのではなく16ビットBUSを使って接続する場合もあり、1つのマシン命令をフェッチするために300ナノ秒程度も必要となる事も珍しくない。
<Speed difference between ROM and RAM>
RISC processor clocks tend to increase in speed year by year, and it is not uncommon to perform high-speed operations such as 100 Mhz and 200 Mhz. However, the ROM access speed is about 120 nanoseconds, which is very slow relative to the processor speed. In addition, in order to reduce the size of the camera, there is a case where connection is made using a 16-bit BUS instead of a connection using a 32-bit BUS, and it is rare that about 300 nanoseconds are required to fetch one machine instruction. Absent.
一方、SDRAMなどのRAMからの読み出しスピードは、バースト読み出しが可能なため、ROMからの命令フェッチに対して非常に高速である。このようなシステムではCPUとメモリーとの間にキャッシュメモリーが存在する。このため、DRAMとキャッシュとの間は常にバーストモードでの読み書きとなり、平均的に内部スピードの倍から数倍程度(10〜数十ナノ秒程度)のスピードでフェッチできる事になる。つまり、キャッシュがミスヒットしたときにRAMから読み出す場合、ROMから読み出す場合に比較して10倍程度高速に読み出す事が出来る事になる。 On the other hand, the reading speed from the RAM such as SDRAM is very high for instruction fetch from the ROM because burst reading is possible. In such a system, a cache memory exists between the CPU and the memory. For this reason, reading and writing are always performed between the DRAM and the cache in the burst mode, and fetching can be performed at an average speed of about twice to several times (about 10 to several tens of nanoseconds) of the internal speed. In other words, when reading from the RAM when the cache misses, it can be read about 10 times faster than when reading from the ROM.
このような事情からROMのプログラムを一旦すべてRAMへコピーするという手法が用いられる事が多い。しかし、起動時にROMのプログラムをすべてRAMへコピーしなければならないため、起動時間が数百ミリ秒から十数秒と非常に長くなってしまうという欠点がある。そのため、デジタルカメラのように起動時間を短くしなければならない装置には向いていなかった。 For this reason, a method of copying all ROM programs to the RAM once is often used. However, since all ROM programs must be copied to the RAM at the time of startup, there is a disadvantage that the startup time becomes very long from several hundred milliseconds to several tens of seconds. For this reason, it is not suitable for a device such as a digital camera that requires a short startup time.
また、変数の初期値をROMからRAMへコピーする時間は短縮する事が難しく、スタートアップ時間の非常に大きな要素となっている。概略その時間は数百ミリ秒にも及ぶ。その間、コンピュータシステムは有効なユーザープログラムどころかOSの初期化すら実行できなかった。 Also, it is difficult to shorten the time for copying the initial values of variables from the ROM to the RAM, which is a very large factor in the startup time. The time is roughly several hundred milliseconds. In the meantime, the computer system could not execute the initialization of the OS as well as the effective user program.
また、パーソナルコンピュータのBIOS(Basic Input/Output System)も同様な理
由でRAMへコピーして実行するという手法が行われている。例えば、特許文献2に記載されているようなBIOSのシステムが考案されている。かかるシステムは、一般に、シャドウBIOSとよばれている手法で、BIOSに含まれる描画ルーチンなどをRAMに転送して実行する事で実現される。シャドウBIOSは、MMU(Memory Management Unit;メモリーマネージメントユニット)の機能を使って元のROMのアドレスにRAMを配置して動作させている。しかしながら、このシャドウBIOSの技術も前述した技術と同様に、スタートアップ時にRAMへの転送を明示的に行う事から、デジタルカメラに向いた技術ではなかった。
For the same reason, a personal computer BIOS (Basic Input / Output System) is also copied to the RAM and executed. For example, a BIOS system as described in Patent Document 2 has been devised. Such a system is generally realized by transferring a drawing routine or the like included in the BIOS to the RAM and executing it by a technique called shadow BIOS. The shadow BIOS is operated by arranging the RAM at the address of the original ROM using the function of an MMU (Memory Management Unit). However, the shadow BIOS technique is not suitable for a digital camera because the transfer to the RAM is explicitly performed at the start-up as in the technique described above.
以上のように従来の技術では、ROMに組み込まれた大規模なソフトウェアを実行するデジタルカメラなどの電子機器のスタートアップ時間を適切に短くすることが困難であるという問題点があった。
本発明は、このような問題点に鑑みてなされたものであり、電子機器のスタートアップ時間を飛躍的に短縮させるようにすることを目的とする。
As described above, the conventional technique has a problem that it is difficult to appropriately shorten the startup time of an electronic device such as a digital camera that executes large-scale software embedded in a ROM.
The present invention has been made in view of such a problem, and an object thereof is to drastically shorten the startup time of an electronic device.
本発明の電子機器は、プログラムの仮想アドレスと物理アドレスとをページ単位で管理するページテーブルを用いて、前記プログラムを実行する電子機器であって、前記プログラムに記述されている変数のエリアにおける物理アドレスが割り当てられない状態となるように前記ページテーブルを設定して前記ページテーブルを初期化する初期化手段と、前記初期化手段によりページテーブルが初期化された後にプログラムを実行するプログラム実行手段と、前記プログラム実行手段によりプログラムが実行されることによって、前記物理アドレスが割り当てられていないエリアにアクセスされると、そのエリアにおける変数の初期値を設定する変数設定手段とを有することを特徴とする。
また、本発明のその他の特徴とするところは、第1の記録媒体に記録されたプログラムのデータを第2の記録媒体に複写して実行する電子機器であって、前記第2の記録媒体のエリアであって、前記第1の記録媒体からの複写が行われていない未複写エリアに対するアクセスを検出する検出手段と、前記検出手段により未複写エリアへのアクセスが検出されると、前記プログラムの実行を中断し、前記第1の記録媒体から前記第2の記憶手段の未複写エリアへ、その未複写エリアに対応する部分のプログラムを複写する複写手段と、前記複写手段により複写されたプログラムのデータの複写先である前記第2の記録媒体のエリアを管理する管理手段と、前記管理手段により、前記第2の記録媒体のエリアが管理された後に、前記中断されたプログラムの実行を再開するプログラム実行再開手段とを有することを特徴とする。
An electronic apparatus according to the present invention is an electronic apparatus that executes the program using a page table that manages a virtual address and a physical address of the program in units of pages, and includes a physical area in a variable area described in the program. An initialization unit that sets the page table so that an address is not assigned and initializes the page table; and a program execution unit that executes a program after the page table is initialized by the initialization unit; When the program is executed by the program execution means and an area to which the physical address is not allocated is accessed, variable setting means for setting an initial value of a variable in the area is provided. .
Another feature of the present invention is an electronic device that copies and executes program data recorded on a first recording medium on a second recording medium. A detecting unit that detects an access to an uncopied area that is not copied from the first recording medium, and an access to the non-copied area is detected by the detecting unit; Copying means for interrupting execution and copying a program corresponding to the non-copied area from the first recording medium to an uncopied area of the second storage means; and a program copied by the copying means A management unit that manages an area of the second recording medium that is a data copy destination; and after the area of the second recording medium is managed by the management unit, the suspended program is And having a resuming program execution resuming means execution of grams.
本発明のデータ処理方法は、プログラムの仮想アドレスと物理アドレスとをページ単位で管理するページテーブルを用いて、前記プログラムを実行するデータ処理方法であって、前記プログラムに記述されている変数のエリアにおける物理アドレスが割り当てられない状態となるように前記ページテーブルを設定して前記ページテーブルを初期化する初期化ステップと、前記初期化ステップによりページテーブルが初期化された後にプログラムを実行するプログラム実行ステップと、前記プログラム実行ステップによりプログラムが実行されることによって、前記物理アドレスが割り当てられていないエリアにアクセスされると、そのエリアにおける変数の初期値を設定する変数設定ステップとを有することを特徴とする。
また、本発明のその他の特徴とするところは、第1の記録媒体に記録されたプログラムのデータを第2の記録媒体に複写して実行するデータ処理方法であって、前記第2の記録媒体のエリアであって、前記第1の記録媒体からの複写が行われていない未複写エリアに対するアクセスを検出する検出ステップと、前記検出ステップにより未複写エリアへのアクセスが検出されると、前記プログラムの実行を中断し、前記第1の記録媒体から前記第2の記憶ステップの未複写エリアへ、その未複写エリアに対応する部分のプログラムを複写する複写ステップと、前記複写ステップにより複写されたプログラムのデータの複写先である前記第2の記録媒体のエリアを管理する管理ステップと、前記管理ステップにより、前記第2の記録媒体のエリアが管理された後に、前記中断されたプログラムの実行を再開するプログラム実行再開ステップとを有することを特徴とする。
A data processing method according to the present invention is a data processing method for executing a program by using a page table for managing a virtual address and a physical address of the program in units of pages, and includes a variable area described in the program. An initialization step for initializing the page table by setting the page table so that a physical address is not allocated in the program, and a program execution for executing the program after the page table is initialized by the initialization step And a variable setting step for setting an initial value of a variable in the area when an area to which the physical address is not assigned is accessed by executing the program in the program execution step. And
According to another aspect of the present invention, there is provided a data processing method for copying and executing program data recorded on a first recording medium on a second recording medium. A step of detecting an access to an uncopied area that is not copied from the first recording medium, and an access to the non-copied area is detected by the detecting step; And copying the program corresponding to the uncopied area from the first recording medium to the uncopied area of the second storage step, and the program copied by the copy step A management step for managing an area of the second recording medium that is a copy destination of the data, and an area of the second recording medium by the management step After being managed, and having a resume program execution resumes step execution of the interrupted program.
本発明のコンピュータプログラムは、プログラムの仮想アドレスと物理アドレスとをページ単位で管理するページテーブルを用いて、前記プログラムを実行するに際し、前記プログラムに記述されている変数のエリアにおける物理アドレスが割り当てられない状態となるように前記ページテーブルを設定して前記ページテーブルを初期化する初期化ステップと、前記初期化ステップによりページテーブルが初期化された後にプログラムを実行するプログラム実行ステップと、前記プログラム実行ステップによりプログラムが実行されることによって、前記物理アドレスが割り当てられていないエリアにアクセスされると、そのエリアにおける変数の初期値を設定する変数設定ステップとをコンピュータに実行させることを特徴とする。
また、本発明のその他の特徴とするところは、第1の記録媒体に記録されたプログラムのデータを第2の記録媒体に複写して実行するに際し、前記第2の記録媒体のエリアであって、前記第1の記録媒体からの複写が行われていない未複写エリアに対するアクセスを検出する検出ステップと、前記検出ステップにより未複写エリアへのアクセスが検出されると、前記プログラムの実行を中断し、前記第1の記録媒体から前記第2の記憶ステップの未複写エリアへ、その未複写エリアに対応する部分のプログラムを複写する複写ステップと、前記複写ステップにより複写されたプログラムのデータの複写先である前記第2の記録媒体のエリアを管理する管理ステップと、前記管理ステップにより、前記第2の記録媒体のエリアが管理された後に、前記中断されたプログラムの実行を再開するプログラム実行再開ステップとをコンピュータに実行させることを特徴とする。
The computer program of the present invention is assigned a physical address in a variable area described in the program when the program is executed using a page table that manages the virtual address and physical address of the program in units of pages. An initialization step for initializing the page table by setting the page table so that there is no state, a program execution step for executing a program after the page table is initialized by the initialization step, and the program execution When an area to which the physical address is not assigned is accessed by executing the program in steps, the computer is caused to execute a variable setting step for setting initial values of variables in the area.
Another feature of the present invention is an area of the second recording medium when the program data recorded on the first recording medium is copied and executed on the second recording medium. A detection step for detecting an access to an uncopied area that has not been copied from the first recording medium; and if the access to the uncopied area is detected by the detection step, the execution of the program is interrupted. A copying step for copying a program corresponding to the uncopied area from the first recording medium to an uncopied area of the second storage step, and a copy destination of data of the program copied by the copying step A management step for managing the area of the second recording medium, and after the management step, the area of the second recording medium is managed Characterized in that to execute the resume program execution resumes step execution of the interrupted program in the computer.
本発明によれば、電子機器の動作開始までの時間を大幅に短縮する事が可能となる。 According to the present invention, it is possible to greatly reduce the time until the operation of the electronic device starts.
次に、図面を参照しながら、本発明の実施形態について説明する。
(第1の実施形態)
まず、本発明の第1の実施形態について説明する。
<MMU>
近年、LSI(Large Scale Integration)の集積度が上がり、MMU(Memory Management Unit;メモリーマネージメントユニット)またはページングハードウェアを内蔵し
たSOC(System On Chip;システムオンチップ)を搭載することが可能となった。後述するように、本実施形態は、ページングハードウェアを応用した技術を用いるようにしている。そこで、まずページングハードウェアについて説明する。
Next, embodiments of the present invention will be described with reference to the drawings.
(First embodiment)
First, a first embodiment of the present invention will be described.
<MMU>
In recent years, integration of LSI (Large Scale Integration) has increased, and it has become possible to mount SOC (System On Chip) with built-in MMU (Memory Management Unit) or paging hardware. . As will be described later, in the present embodiment, a technique using paging hardware is used. First, paging hardware will be described.
<仮想記憶>
本来のページングハードウェアの目的は、外部記憶装置を使って主記憶を拡張する仮想記憶ができるようにすることである。ページングハードウェアは、プロセッサとメモリーとの間に介在して動作し、プログラムのアドレス空間を固定サイズ(例えば4Kバイトとか8Kバイト)のページに分割し、コンピュータの物理アドレスを同じサイズのページフレームに分割する。
<Virtual memory>
The purpose of the original paging hardware is to enable virtual storage that expands main memory using an external storage device. The paging hardware operates between the processor and the memory, divides the program address space into fixed-size pages (for example, 4 Kbytes or 8 Kbytes), and divides the physical address of the computer into page frames of the same size. To divide.
ページングハードウェアには、図1のようなアドレス空間のページごとに1つのエントリを持つページテーブルがある。このページテーブルエントリには、そのページに対応した実際のページフレームの物理アドレスか、ページが存在しない(ページフレームが割り当てられていない)事を示すフラグが格納されている。 The paging hardware has a page table having one entry for each page in the address space as shown in FIG. This page table entry stores a physical address of an actual page frame corresponding to the page or a flag indicating that no page exists (no page frame is allocated).
存在しないページ(割り当てられていないページフレーム)をプロセッサがアドレッシングしようとすると、ページフォルト割り込みが発生する。ページフォルトの割り込みを処理するプログラムは、対応する外部記憶装置の内容を主記憶に読み出し、フレームとして割り当てた後、制御を戻し、元のプログラムを再開させる。LRU(最長不使用)のアルゴリズムを用いて外部記憶装置の使用頻度の高い部分を主記憶に割り付ける事によって、アプリケーションから見れば実際に存在する主記憶よりも大きなメモリーが存在しているかのように動作する事が可能となる。詳細は「OSの基礎と応用」A.S.タネンバウム=著/引地信之、引地美恵子=訳、トッパンなどで解説されている。 If the processor attempts to address a nonexistent page (an unallocated page frame), a page fault interrupt occurs. The program that handles the page fault interrupt reads the contents of the corresponding external storage device into the main memory, assigns them as frames, returns control, and resumes the original program. By allocating frequently used parts of the external storage device to the main memory using the LRU (longest unused) algorithm, it seems as if there is a memory larger than the main memory that actually exists from the viewpoint of the application. It becomes possible to operate. The details are explained in "Basics and Applications of OS" A.S.Tannenbaum = Author / Nobuyuki Hikiji, Mieko Hikiji = Translation, Toppan, etc.
<ポジションディペンデット>
マシン語にコンパイルされたプログラムは、一般にポジションディペンデットという特徴を備えている。プログラムの置かれている番地を移動してしまうと、プログラムは正しく動作しない事を意味する。これによって、ROMに搭載されているプログラムの一部をそのままRAMへ転送して実行するという事は出来ない。ポジションに依存しないがそのまま実行不能な状態のプログラムをリロケータブルなオブジェクトと呼ぶ。
<Position dependent>
Programs compiled into machine language generally have the feature of position dependent. If you move the address where the program is located, it means that the program does not work correctly. As a result, it is impossible to transfer a part of the program installed in the ROM to the RAM as it is and execute it. A program that does not depend on the position but cannot be executed is called a relocatable object.
リロケータブルなオブジェクトは、ポジションが決定した時にポジションにあわせてプログラムを実行可能な形態に変更するための冗長な情報を含んでいる。また、リロケータブルなオブジェクトを実行可能な状態にするためにローダー、またはリロケータというプログラムを用いるが、そのようなプログラムによるRAMへのプログラム配置は、非常に時間のかかる処理であるため、デジタルカメラのスタートアップで行うには負荷が重い処理である。 The relocatable object includes redundant information for changing the program to an executable form according to the position when the position is determined. In addition, a program called a loader or a relocator is used to make a relocatable object executable. However, program placement in the RAM by such a program is a very time-consuming process. This is a heavy processing.
<MMUの応用>
本実施形態では、MMUの仮想アドレスという特徴に着目し、CPUからソフトウェア的に見れば同一のポジションでありながら、物理的にはRAMをアサインする事で、ROMのプログラムの一部だけを、RAMに配置して、高速なプログラムの実行を実現する。
<Application of MMU>
In the present embodiment, paying attention to the feature of the virtual address of the MMU, it is the same position as viewed from the CPU as a software, but by physically assigning the RAM, only a part of the program of the ROM is transferred to the RAM. To achieve high-speed program execution.
<要求時シャドウアサイン>
本実施形態では、スタートアップ時にROMからRAMへプログラムの転送を行う替わりに、アプリケーションの実行中に必要となった部分、すなわち実際に実行された部分だけをRAMへ転送して実行することで、高速なプログラムの実行を実現するようにしている。
<Shadow assignment on request>
In this embodiment, instead of transferring the program from the ROM to the RAM at the start-up, only the part that is necessary during the execution of the application, that is, the part actually executed is transferred to the RAM and executed. To implement a simple program.
<デジタルカメラ>
図2は、本発明の第1の実施形態を示し、デジタルカメラのハードウェア構成の一例を示した図である。
図2において、1001は、プログラムを読み込み実行するプロセッサである。1002は、仮想アドレスと物理アドレスとを管理するページングハードウェアである。1003は、デジタルカメラのプログラムを格納しているROMである。1004は、画像や変数を格納するRAMである。1005は、撮像された画像を取り込むためのA/D変換機である。1006は、レンズ1007から入った光を受けて電気信号に変換するCCD(Charge-Coupled Device)である。1007は、CCD1006に画像を決像させるレン
ズである。1008は、メモリーカード1009を接続するためのインターフェースである。1009は、画像を格納するメモリーカードである。1011は、周辺回路を駆動するためのI/Oインターフェースである。1010は、レンズ1007を駆動するためのレンズ駆動メカである。
<Digital camera>
FIG. 2 is a diagram illustrating an example of a hardware configuration of a digital camera according to the first embodiment of this invention.
In FIG. 2,
電源が投入されると、プロセッサ1001は、ページングハードウェア1002を通してROM1003に格納されたプログラムのリセットベクターと呼ばれる番地の命令を読み出し、実行を開始する。ページングハードウェア1002は、リセット直後の初期状態となっており、物理アドレスと仮想アドレスとが一致した状態となっている。なお、画像を撮影して、メモリーカード1009へ記録する過程は本実施形態の本質と関係がないため、説明を省略することとする。
When the power is turned on, the
<初期状態>
図3は、本実施形態のデジタルカメラにおけるシステムが起動した直後のページングハードウェア1002と、ROM1003と、RAM1004の状態の一例を示した図である。図3に示すように、システムの起動直後は、すべての仮想アドレスに物理アドレスがアサインされている(割り当てられている)状態である。
<Initial state>
FIG. 3 is a diagram illustrating an example of states of the
<アプリケーションプログラム>
図4は、アプリケーションプログラムの一例である(C言語の)ソースコードを示した図である。図4のプログラム301において、100行目はこのプログラム301を呼び出す最初の関数である。プログラム301は、システムが起動するときに呼ばれるというものではなく、モジュールが使用される時に呼ばれるものでも良い。例えばプリンティング関連のモジュールであれば、プリンタを接続して初めて呼ばれるようにしてもよい。
<Application program>
FIG. 4 is a diagram showing a source code (in C language) which is an example of an application program. In the
そして、102行目は、本実施形態の特徴的なプログラムの1つであるシャドウを作成する関数CreateShadowを呼び出している。この関数CreateShadowのパラメータは開始番地とサイズである。開始番地として、105行目の関数のアドレスを指定している。そして、サイズとして、113行目の関数EndModuleと105行目の関数MyFirstFuncとのアドレス差を計算して与えている。 The 102nd line calls a function CreateShadow that creates a shadow, which is one of the characteristic programs of this embodiment. The parameters of this function CreateShadow are the start address and size. The address of the function on the 105th line is specified as the start address. Then, as the size, an address difference between the function EndModule on the 113th line and the function MyFirstFunc on the 105th line is calculated and given.
図5は、図4のプログラム301の102行目で呼び出している関数CreateShadowの動作の一例を説明するフローチャートである。
図5において、まず、ステップS801で処理を開始し、ステップS802で割り込みを禁止する。そして、ステップS803で、関数CreateShadowのパラメータで指定されたアドレスを含むページであって、物理アドレスと一致しているページがすべて未アサインの状態になるようにページメモリを設定する。そして、ステップS804で、割り込み禁止を解除し、ステップS805で処理を終了する。
FIG. 5 is a flowchart for explaining an example of the operation of the function CreateShadow called on the 102nd line of the
In FIG. 5, first, processing is started in step S801, and interrupts are prohibited in step S802. In step S803, the page memory is set so that all pages that include the address specified by the parameter of the function CreateShadow and that match the physical address are unassigned. In step S804, the interrupt inhibition is canceled, and the process ends in step S805.
図5のステップS805の処理を終えた時点、すなわち図3のプログラム301の102行目の実行を終えた時点において、ページングハードウェア1002と、ROM1003と、RAM1004の状態は、図6のような状態となっている。関数MyFirstFuncから
関数EndModuleまでの関数を含むページはすべて未アサインの状態となっている。図6で
は、関数MyFuncの物理アドレスはアサインされていない状態となっている事が分かる。
The state of the
次に、図4のプログラム301の109行目の関数MyFuncが呼び出されると、ページフォルト割り込みが発生する。ここで、図7のフローチャートを参照しながら、ページフォルト割り込み処理の一例を説明する。
図7のステップS901で割り込み処理を開始し、ステップS902で空きフレームを確保する。そして、ステップS903でROM1003の該当ページの内容を、ステップS902で確保した空きフレームにコピーする。
図8は、ROM1003の該当ページの内容を、空きフレームにコピーした時点における、ページングハードウェア1002と、ROM1003と、RAM1004の状態の一例を示した図である。図8では、関数MyFuncのコピーがRAM1004上のフレームに作成されている事が分かる。
Next, when the function MyFunc on the 109th line of the
Interrupt processing is started in step S901 in FIG. 7, and an empty frame is secured in step S902. In step S903, the contents of the corresponding page in the
FIG. 8 is a diagram showing an example of the states of the
このようにして、ROM1003の該当ページの内容を空きフレームにコピーしたら、図7のステップS904で、ページテーブルにフレームを設定する。図9は、ステップS904でページテーブルにフレームをアサインした時点における、ページングハードウェア1002と、ROM1003と、RAM1004の状態の一例を示した図である。なお、RAM1004にコピーされたプログラムは元のアドレスと同じ仮想アドレスから読み出されるため、ポジションディペンドなプログラムでも実行可能である。
そして、ステップS905でページフォルト割り込みを終了する。
After the content of the corresponding page in the
In step S905, the page fault interrupt is terminated.
以上のようなページフォルト割り込みから復帰して、プログラム301を再開し図3の109行目が実行される時には、プログラム301そのものはRAM1004からフェッチするため、高速な読み出しが可能な状態となっている。図4のプログラム301の109行目が再び実行される時には、すでにフレームがアサイン済みのためページフォルト割り込みは発生しない。
When the
図10は、関数EndModuleを含むページについても前述した処理を実行してフレームを
アサインした時点における、ページングハードウェア1002と、ROM1003と、RAM1004の状態の一例を示した図である。
FIG. 10 is a diagram illustrating an example of states of the
以上のように構成する事によって、システム起動時にROM1003からRAM1004へプログラムを転送する待ち時間のロスがなく、且つ、ポジションディペンドなプログラムの一部をRAM1004へ展開する事が可能となり、大規模なROMプログラムの一部を、高速に実行することが可能なRAM1004で実行する事を容易に実現するコンピュータシステムを構成する事が出来る。
By configuring as described above, there is no loss of waiting time for transferring a program from the
特に、デジタルカメラの起動時間を構成する要素には、レンズ1007の初期位置への移動や、メモリーカード1009からのデータ読み出しなど、プロセッサ(CPU)1001の待ち時間が多い。一方、ウインドウシステムを使用したGUI(グラフィカルユーザーインターフェース)などは、プロセッサ(CPU)1001の処理時間を多く消費し、起動時にはまったく動作しないプログラムである。
したがって、アプリケーションプログラムの要求時、すなわち実行時にROM1003からRAM1004へアプリケーションプログラムの転送を行う事は効率的といえる。そのように構成する事で、スタートアップ時に必要なROM1003からRAM1004に転送する時間を節約する事が出来、且つ高速動作が要求されるプログラムをRAM10004に配置して動作させる事ができる。
In particular, the elements constituting the start-up time of the digital camera include a long wait time of the processor (CPU) 1001 such as movement of the
Therefore, it can be said that it is efficient to transfer the application program from the
(第2の実施形態)
次に、本発明の第2の実施形態について説明する。なお本実施形態の説明において、前述した第1の実施形態と同一の部分については、図1〜図10に付した符号と同一の符号を付す等して詳細な説明を省略する。
(Second Embodiment)
Next, a second embodiment of the present invention will be described. In the description of the present embodiment, the same parts as those in the first embodiment described above are denoted by the same reference numerals as those in FIGS.
<要求時データセグメントコピー>
本実施形態においても、前述した第1の実施形態と同様に、ページングハードウェアを応用している。そして、コンピュータ言語のスタートアップ時の変数初期化に必要な時間を短縮する事で、高速に起動可能な組み込みソフトウェアのフレームワークを提供するようにしている。
<Data segment copy upon request>
Also in this embodiment, paging hardware is applied as in the first embodiment described above. By shortening the time required for variable initialization at computer language startup, an embedded software framework that can be started at high speed is provided.
パワーオンリセットが解除され、コールドスタートをする最初のプログラムとして、初期化プログラムが動作し、ページングハードウェアのページテーブルを初期化する。その際、データセグメント及びBSSのアドレスとなるエリアに対して、ページフレームをアサインしていない状態として設定を行う。 The power-on reset is canceled, and the initialization program operates as the first program that performs a cold start, and initializes the page table of the paging hardware. At this time, the setting is performed so that the page frame is not assigned to the area serving as the address of the data segment and the BSS.
そして、コンピュータ言語の変数初期化ルーチンをスキップし、変数の初期化を行わない状態のまま、コンピュータ言語の最初のプログラムへのエントリーポイントへジャンプする。コンピュータ言語で書かれたプログラムが、静的変数へアクセスすると、ページフォルトが発生し、ページフォルト割り込みプログラムが呼び出され、そのプログラムが起動する。ページフォルトが発生したページに対してページフレームをアサインする。ページフォルトが発生したページがBSS領域であればページフレーム内のメモリーの内容をゼロ(0)に初期化し、元のプログラムへ制御を戻す。ページフォルトが発生したページがデータセグメント領域であればページフレーム内のメモリーに対応するROMから初期値をコピーし、元のプログラムへ制御を戻す。本実施形態は、このようなプログラムを用いて実現される。以下に、本実施形態の詳細を図面と共に説明する。 Then, the computer language variable initialization routine is skipped, and a jump is made to the entry point to the first computer language program while the variables are not initialized. When a program written in a computer language accesses a static variable, a page fault occurs, a page fault interrupt program is called, and the program starts. Assign a page frame to the page where the page fault occurred. If the page where the page fault has occurred is a BSS area, the memory contents in the page frame are initialized to zero (0), and control is returned to the original program. If the page where the page fault has occurred is a data segment area, the initial value is copied from the ROM corresponding to the memory in the page frame, and control is returned to the original program. The present embodiment is realized using such a program. Details of this embodiment will be described below with reference to the drawings.
デジタルカメラのハードウェア構成は、例えば、前述した第1の実施形態と同じである。また、電源が投入されると、プロセッサ1001が、ROM1003に格納されたプログラムのリセットベクターと呼ばれる番地の命令を読み出して実行を開始することや、ページングハードウェア1302が、リセット直後の初期状態となっており、物理アドレスと仮想アドレスとが一致した状態となっていることも前述した第1の実施形態と同じである。なお、画像を撮影して、メモリーカード1009へ記録する過程は本実施形態の本質と関係がないため、説明を省略することとする。
The hardware configuration of the digital camera is the same as that of the first embodiment described above, for example. When the power is turned on, the
<変数>
図11は、C言語で書かれたプログラムの一例を示した図である。また図12は、図11のプログラム1101をコンパイルした結果のアッセンブラリストの一例を示した図である。図11のプログラム1101において、100行目は初期化つき変数というもので、プログラム1101がスタートするときにはすでに「fFirstAccess」という変数に「TRUE」という値が代入されているという意味である。
<Variable>
FIG. 11 is a diagram showing an example of a program written in C language. FIG. 12 is a diagram showing an example of an assembler list as a result of compiling the
「fFirstAccess」という変数は、図12のアッセンブラリスト1201では、0002行目に記述されている。0001行目から0003行目の間がデータセグメントのエリアである。コンパイルの結果、このプログラム301のデータセグメントは「fFirstAccess」だけである。ところが、その後リンカーによって全プログラムのデータセグメントが一つのエリアに集められるため、データセグメントには複数のソースによって記述された、モジュールの異なる変数が隣接して存在する事となる。
The variable “fFirstAccess” is described in the 0002th line in the
図11のプログラム1101の101行目には、「Count」という変数が宣言されているが、初期値は代入されていない。C言語の仕様で、初期値が宣言されていない変数は0で初期化される事になっているので、「Count」の初期値は0となるべきである。図12のアッセンブラリスト1201における0007行目が「Count」のコンパイル結果である。図12のアッセンブラリスト1201における0006行目から0008行目は、BSS領域であるため、「Count」がBSS領域の変数としてコンパイルされた事が分かる。BSS領域もデータセグメントと同様にリンカーによってまとめられ、複数のモジュールの変数が隣接して存在する事になる。
In the 101st line of the
<従来のスタートアップ>
本実施形態のスタートアップを説明する前に従来のスタートアップをもう一度説明する事とする。図13は、従来の技術を示し、スタートアップする際の動作を説明するフローチャートである。
ステップS1101でリセットが解除されると、ステップS1102でBSSエリアに0(ゼロ)を書き込み、ROMからデータセグメントに対して初期値を転送する。そして、ステップS1103でC言語のプログラムを実行しはじめる。
ステップS1104でC言語のプログラムとしてOSをスタートする。そして、OSが立ち上がると、ステップS1105でアプリケーションプログラムがスタートする。デジタルカメラとしての動作を開始できるのは、ステップS1105からである。ステップS1101からステップS1105にくるまでに、数百ミリ秒の時間のロスがある。
<Conventional startup>
Prior to describing the startup of this embodiment, the conventional startup will be described again. FIG. 13 is a flowchart illustrating a conventional technique and explaining an operation at the time of start-up.
When the reset is released in step S1101, 0 (zero) is written in the BSS area in step S1102, and an initial value is transferred from the ROM to the data segment. In step S1103, the C language program starts to be executed.
In step S1104, the OS is started as a C language program. When the OS starts up, the application program starts in step S1105. The operation as a digital camera can be started from step S1105. There is a loss of several hundred milliseconds from step S1101 to step S1105.
<本実施形態のスタートアップ>
本実施形態におけるスタートアップする際の動作の一例を図14のフローチャートを使って説明する。
ステップS1001でリセットが解除されたら、ステップS1002で図2に示したページングハードウェア1002内のページテーブルの設定を行う。このとき、データセグメントとBSSの両方のエリアに対して物理アドレスを割り当てない状態に設定する。そして、ステップS1003でC言語をスタートさせ、ステップS1004でOSをスタートさせ、ステップS1005でアプリケーションプログラムをスタートさせる。
<Startup of this embodiment>
An example of the operation at the time of start-up in the present embodiment will be described using the flowchart of FIG.
When the reset is released in step S1001, the page table in the
<実行時の動作説明>
図14のフローチャートのステップS1005において、アプリケーションプログラムが実行されていく様子を、図11に示したプログラム1101を例に挙げて説明する。
図11のプログラム1101の103行目からアプリケーションプログラムを実行していく。最初に実行される有効な行は105行目である。105行目は、変数「fFirstAccess」が真なら106行目を実行し、偽なら108行目を実行するという分岐のルーチンである。この行を実行する事によって100行目で宣言している「fFirstAccess」という変数の値を読む事になる。図15は、プロセッサ1001によって変数「fFirstAccess」がアドレッシングされている様子を示した図である。図14のステップS1002によってページテーブルのデータセグメントエリアの物理空間とBSSエリアの物理空間とがアサインされていない状態となっている。物理空間がアサインされていないアドレスをアドレッシングすると、ページフォルト割り込みが発生する。ページフォルト割り込みが発生すると、プログラムが起動する。
<Description of operation during execution>
The manner in which the application program is executed in step S1005 of the flowchart of FIG. 14 will be described using the
The application program is executed from the 103rd line of the
<ページフォルト処理>
ページフォルト割り込みによって動作するプログラムによる処理動作の一例を、図16のフローチャートを使って説明する事とする。
まず、ステップS1201でページフォルト割り込みが発生し、プログラムが起動される。ステップS1202で、まだアサインされていない物理メモリーを確保する。
ステップS1203で、ページフォルトが発生したページがデータセグメントなのかBSSなのかデータセグメントとBBSとが混在しているのかを判定する。図11に示したプログラム1101では、105行目を実行中なので、変数「fFirstAccess」はデータセグメントであり、ステップS1204へ分岐する。ステップS1204では、ROM1303の対応アドレスから初期値を転送する。
<Page fault processing>
An example of the processing operation by the program that operates by the page fault interrupt will be described with reference to the flowchart of FIG.
First, in step S1201, a page fault interrupt is generated and the program is started. In step S1202, a physical memory not yet assigned is secured.
In step S1203, it is determined whether the page in which the page fault has occurred is a data segment or a BSS, and whether a data segment and a BBS are mixed. In the
図17は、ROM1003に格納された変数「fFirstAccess」の初期値である1という値がRAM1004の物理アドレスへ転送された様子の一例を示した図である。変数「fFirstAcces」以外にも同一ページ内の4Kバイトの初期値はすべて転送される。そして、
ステップS1207でページテーブルに対して物理アドレスを設定する。
図18は、ページテーブルに物理アドレスが設定された様子の一例を示した図である。そして、ステップS1208で、元のプログラムへ制御が戻る。図18に示すように、変数「fFirstAccess」は物理メモリーにアサインされており、値として初期値である1が代入されている状態で、図11に示したプログラム1101の105行目に制御が戻る。
FIG. 17 is a diagram illustrating an example of a state in which the value “1” that is the initial value of the variable “fFirstAccess” stored in the
In step S1207, a physical address is set for the page table.
FIG. 18 is a diagram illustrating an example of a state in which a physical address is set in the page table. In step S1208, control returns to the original program. As shown in FIG. 18, the variable “fFirstAccess” is assigned to the physical memory, and control is returned to the 105th line of the
変数「fFirstAccess」は真なので、図11に示したプログラム1101の106行目を実行し、107行目で変数「fFirstAccess」に対して値「FALSE」が代入される。107行目の代入が行われるときには、変数「fFirstAccess」は物理メモリーへアサインされているため、再びページフォルトが発生することはない。
そして、109行目が実行されると、101行目で宣言した変数「Count」がアクセスされる。変数「Count」はBSSエリアにあり、はじめてアクセスされるページのために、再びページフォルト割り込みが発生する。図19は、ページフォルトが発生した時点の様子の一例を示した図である。以後の動作を再び図16のフローチャートを用いて説明する。
Since the variable “fFirstAccess” is true, the 106th line of the
When the 109th line is executed, the variable “Count” declared in the 101st line is accessed. The variable “Count” is in the BSS area, and a page fault interrupt occurs again for the first accessed page. FIG. 19 is a diagram illustrating an example of a state when a page fault occurs. The subsequent operation will be described again using the flowchart of FIG.
図16のステップS1201でページフォルト割り込みが発生し、ステップS1202で空きメモリーを確保する。ステップS1203でページアドレスを判断するが、変数「Count」はBSSエリアの変数のため、ステップS1206へ分岐する。ステップS1206では、ステップS1202で確保した物理メモリーをゼロ(0)で埋める。
図20は、確保した物理メモリーをゼロ(0)に埋めた直後の様子の一例を示した図である。そして、ステップS1207で、ページテーブルへ物理アドレスをセットする。図21は、ステップS1207でページテーブルを更新した直後の様子の一例を示した図である。
In step S1201 of FIG. 16, a page fault interrupt occurs, and free memory is secured in step S1202. In step S1203, the page address is determined. Since the variable “Count” is a BSS area variable, the process branches to step S1206. In step S1206, the physical memory secured in step S1202 is filled with zero (0).
FIG. 20 is a diagram illustrating an example of a state immediately after the reserved physical memory is filled with zero (0). In step S1207, a physical address is set in the page table. FIG. 21 is a diagram illustrating an example of a state immediately after the page table is updated in step S1207.
プロセッサ1301は、物理メモリーの「Count」というゼロ(0)に初期化された変数をアクセスする事が出来る。ステップS1208で元のプログラムに制御が戻ると、図3のプログラム301の109行目に戻ってくる。この行では、変数「Count」の初期値であるゼロ(0)が読まれ、その値がインクリメントされ代入される。代入されるときには物理メモリーがアサインされているので、再びページフォルト割り込みが発生する事はない。
The processor 1301 can access a variable initialized to zero (0) called “Count” in the physical memory. When the control returns to the original program in step S1208, the process returns to the 109th line of the
<バックグラウンド転送>
上記のように構成する事で、データセグメント転送とBSSの0クリアの待ち時間を省いてC言語をスタートすることができる。そして、ユーザーアプリケーションを高速にスタートする事ができる。しかし、デジタルカメラとしてのスタートアップはユーザーアプリケーションが始まってからスタートする。
<Background transfer>
With the configuration described above, the C language can be started without waiting for the data segment transfer and the BSS zero clearing. And user applications can be started at high speed. However, the start-up as a digital camera starts after the user application starts.
デジタルカメラとしては、撮像素子への電源投入や、レンズ1007の初期位置への駆動、メモリーカード1009からのファイル情報の読み出しなど、デバイスが反応する待ち時間を含む処理が多い。それらの待ち時間を利用して、未転送のデータセグメントへの初期値の転送や初期化されていないBSSの初期化を行う事で、要求時転送のオーバーヘッドを極力減らす事が可能となる。
As a digital camera, there are many processes including a waiting time for the device to react, such as turning on the power to the image sensor, driving the
バックグラウンドで初期化を行うプログラムの動作の一例を図22のフローチャートを使って説明する。
ステップS1401でタスクをスタートする。このタスクは最もプライオリティ(優先順位)の低いタスクで動作するように起動させる。ステップS1402でページテーブルを検索し、物理アドレスがアサインされていないアドレスを探す。そして、ステップS1403で物理アドレスがアサインされていないアドレスが存在するか否かを判断する。
An example of the operation of a program that performs initialization in the background will be described with reference to the flowchart of FIG.
In step S1401, the task is started. This task is activated so as to operate with a task having the lowest priority (priority order). In step S1402, the page table is searched for an address to which no physical address is assigned. In step S1403, it is determined whether there is an address to which no physical address is assigned.
実行を開始したときに全てのアドレスがアサイン済みという事はないはずなので、このステップS1403の判断の結果、ステップS1404へ進む。ステップS1404では空き物理メモリーを確保する。そして、ステップS1414でページアドレスを調べ、そのページアドレスがBSSアドレスならステップS1407に進み、確保した物理メモリーをゼロ(0)で埋める。 Since all addresses should not be assigned when execution is started, the process proceeds to step S1404 as a result of the determination in step S1403. In step S1404, an empty physical memory is secured. In step S1414, the page address is checked. If the page address is a BSS address, the process proceeds to step S1407, and the reserved physical memory is filled with zero (0).
また、ステップS1414でページアドレスを調べた結果、そのページアドレスがデータセグメントならステップS1406へ分岐し、データセグメントの初期値を、ROM1003から確保した物理メモリーへ転送する。
さらに、ステップS1414でページアドレスを調べた結果、そのページアドレスがBSSとデータセグメントとが混在したものなら、ステップS1408へ分岐し、BSSについては、確保した物理メモリーをゼロ(0)で埋め、データセグメントについては、ROM1003から初期値を転送する。
If the page address is a data segment as a result of examining the page address in step S1414, the process branches to step S1406, and the initial value of the data segment is transferred from the
Further, as a result of checking the page address in step S1414, if the page address is a mixture of BSS and data segment, the process branches to step S1408, and for the BSS, the reserved physical memory is filled with zero (0) and the data For the segment, the initial value is transferred from the
ステップS1406またはS1407またはS1408を実行し終えた状態では確保した物理メモリーに対して有効な初期データが格納されている。そして、ステップS1409で割り込みを禁止し、ステップS1410で、該当ページに物理アドレスがまだアサインされていない事を再び確認する。なぜなら、このプログラムは最もプライオリティの低いタスクとして実行しているため、ステップS1402からS1409までを実行する間に他のプライオリティの高いプログラムが動作する事でアクセスが発生したページに関してはすでに物理メモリーがアサインされている可能性があるからである。 When step S1406 or S1407 or S1408 has been executed, valid initial data is stored for the reserved physical memory. In step S1409, interrupts are prohibited, and in step S1410, it is confirmed again that a physical address has not been assigned to the page. Because this program is executed as the task with the lowest priority, the physical memory is already assigned to the page that has been accessed by the operation of another high priority program during the execution of steps S1402 to S1409. Because there is a possibility that has been.
もし、該当ページに物理アドレスがすでにアサインされていた場合には、ステップS1411で物理アドレスを空きエリアとして開放し、ステップS1413で割り込み禁止を解除してステップS1402へ戻る。
一方、ステップS1410で該当ページに物理アドレスがまだアサインされていない場合には、ステップS1412でページテーブルに物理アドレスをアサインする。そして、ステップS1413で割り込み禁止を解除し、ステップS1402へ戻る。ステップS1409からS1413までの間は割り込み禁止状態にしてページテーブルへのアクセスを排他的に行う必要がある。ステップS1402からステップS1413までを繰り返し実行する事で、すべてのページに物理アドレスがアサインされる事になるため、いずれステップS1403からステップS1405へ分岐し、タスクは終了することになる。
If the physical address has already been assigned to the corresponding page, the physical address is released as a free area in step S1411, the interrupt prohibition is canceled in step S1413, and the process returns to step S1402.
On the other hand, if the physical address has not yet been assigned to the page in step S1410, the physical address is assigned to the page table in step S1412. In step S1413, the interrupt prohibition is canceled, and the process returns to step S1402. During steps S1409 to S1413, it is necessary to disable the interrupt and access the page table exclusively. By repeatedly executing steps S1402 to S1413, physical addresses are assigned to all pages, so that the process branches from step S1403 to step S1405, and the task ends.
以上のように本実施形態では、データセグメントとBSSの両方のエリアに対し物理アドレスを割り当てない状態にして、ページングハードウェア1002内のページテーブルの設定を行ってアプリケーションプログラムをスタートさせる。その後、物理アドレスが割り当てられていないアドレスをアドレッシングすると、ページフォルト割り込みが発生し、まだ物理アドレスが割り当てられていない物理メモリーを確保する。ページフォルトが発生したページがデータセグメントであれば、ROM1003の対応アドレスから前記確保した物理メモリーに初期値を転送する。一方、ページフォルトが発生したページがBSSであれば、前記確保した物理メモリーをゼロ(0)で埋める。これにより、データセグメントの変数の転送や、BSSの0クリアのための待ち時間を省くことができ、プログラミング言語の変数領域の初期化を待たずに、アプリケーションプログラムの実行を開始することができる。したがって、例えば、デジタルカメラの電源投入から撮影可能になるまでの時間を大幅に短縮する事が可能となる。
As described above, in this embodiment, a physical address is not assigned to both the data segment and BSS areas, the page table in the
なお、本実施形態では仮想アドレスを持ったページングハードウェア1002を使用したが、仮想アドレスと物理アドレスとの変換機能をもたない、プロテクションのみを目的としたMMUを使って類似したシステムを構成できる。その場合、データセグメントとBSSとをプロテクション対象として登録した状態で、C言語をスタートさせ、プロテクションフォルトの割り込みによってデータセグメントへのROMからの初期値の転送やBSSの初期化を行うように構成すればよい。その他の構成については、上述した第2の実施形態と同じであるので説明を省略する。
In this embodiment, the
(第3の実施形態)
次に、本発明の第3の実施形態について説明する。なお本実施形態の説明において、前述した第1及び第2の実施形態と同一の部分については、図1〜図22に付した符号と同一の符号を付す等して詳細な説明を省略する。
<要求時データセグメントコピー>
本実施形態においても、前述した第2の実施形態と同様に、コンピュータ言語のスタートアップ時の変数初期化に必要な時間を短縮する事で、高速に起動可能な組み込みソフトウェアのフレームワークを提供するようにしている。ただし、前述した第2の実施形態では、ページングハードウェア1302を用いたが、本実施形態では、後述するデータセグメント管理ユニットを用いるようにしている。
(Third embodiment)
Next, a third embodiment of the present invention will be described. In the description of the present embodiment, the same parts as those in the first and second embodiments described above are denoted by the same reference numerals as those in FIGS.
<Data segment copy upon request>
Also in this embodiment, as in the second embodiment described above, an embedded software framework that can be started at high speed is provided by reducing the time required for variable initialization at the time of computer language startup. I have to. However, in the second embodiment described above, the paging hardware 1302 is used, but in this embodiment, a data segment management unit described later is used.
パワーオンリセットが解除され、コールドスタートをする最初のプログラムとして、初期化プログラムが動作し、データセグメント管理ユニットの設定を行う。その際、複写済みエリア記憶レジスタ及び未複写エリアアクセス検出部のカバーするアドレスとして、コンピュータ言語のデータセグメント及びBSSのアドレスとなるエリアを設定し、未複写エリアアクセス検出部を有効化する。そして、本来であればROM1003に存在するデータセグメントの初期値をRAM1004へコピーする工程と、BSSエリアを0で埋める工程とを行わずに、いきなり高級言語で書かれたアプリケーションプログラムに制御を移す。
When the power-on reset is canceled, the initialization program operates as the first program to perform a cold start, and the data segment management unit is set. At this time, as the addresses covered by the copied area storage register and the non-copied area access detection unit, an area serving as a computer language data segment and BSS address is set, and the non-copied area access detection unit is validated. Then, control is transferred to an application program written in a high-level language suddenly without performing the process of copying the initial value of the data segment existing in the
アプリケーションプログラムの実行に従ってプロセッサ(CPU)1001がデータセグメントをアクセスしようとすると、未複写エリアアクセス検出部によってプログラムが停止させられる。そして、データセグメントにおける部分であって、プロセッサ1001がアクセスした部分の初期値を、初期データ複写部によって、ROM1003からコピーし、複写済みエリア管理テーブルの管理情報を更新してプログラムに制御を戻す。プロセッサ1001が再びデータセグメントの同じエリアにアクセスすると、複写済みエリア管理テーブルに複写が既に済んでいる事が記録されているため、未複写エリアアクセス検出部によってプログラムが中断させられる事は無い。本実施形態は、このようなプログラムを用いて実現される。以下、本実施形態の詳細を図面と共に説明する。
When the processor (CPU) 1001 tries to access the data segment according to the execution of the application program, the program is stopped by the uncopied area access detection unit. Then, the initial value of the portion in the data segment accessed by the
<デジタルカメラ>
図23は、本発明の第3の実施形態を示し、デジタルカメラのハードウェア構成の一例を示した図である。
<Digital camera>
FIG. 23 is a diagram illustrating an example of a hardware configuration of a digital camera according to the third embodiment of this invention.
図23において、2302は、ハードウェア処理部分であるデータセグメント管理ユニットである。データセグメント管理ユニット2302は、データセグメントとBSSの両方を固定長のページに分割して管理するものであり、バスに接続するタイプの取り外し可能なコンピュータ周辺装置として設計されているものである。その他の部分は、図2に示したものと同じである。また、第1及び第2の実施形態と同様に、電源が投入されると、プロセッサ1001は、ROM1003に格納されたプログラムのリセットベクターと呼ばれる番地の命令を読み出して実行を開始する。また、データセグメント管理ユニット2302は、リセット直後の初期状態となっており、未複写エリアアクセス検出機能停止状態となっている。なお、画像を撮影して、メモリーカード1009へ記録する過程は本実施形態の本質と関係がないため、説明を省略することとする。
In FIG. 23,
<データセグメント管理ユニット>
図24は、本発明の第3の実施形態を示し、データセグメント管理ユニット2302の構成を詳細に示したブロック図である。
図24において、101はデータバス(Data Bus)であり、102はアドレスバス(Address Bus)である。これらデータバス101とアドレスバス102とが、データセグメ
ント管理ユニット2302に接続されている。
<Data segment management unit>
FIG. 24 is a block diagram showing the configuration of the data
In FIG. 24, 101 is a data bus, and 102 is an address bus. The
103は、未初期化エリアを検出した場合にそのアドレスを取り込むアドレスラッチ(Address Latch)である。104は、データセグメント及びBSSの始まる番地を設定す
ることが可能なプログラマブルアドレスデコーダー(Programmable Address Decoder)である。105は、複写済みエリア管理テーブル107の記憶済みエリア記憶ビット108に対応したアドレスがアクセスされた事を検出するためのAND(アンド)回路を複数有するAND回路群である。106は、アンド回路群105のAND回路のうち1つからでも信号が出力されたら出力するOR(オア)回路である。107は、未複写エリアかどうかを保持するビット群である、複写済みエリア管理テーブルである。なお、本実施形態の複写済みエリア管理テーブル107は、例えばプロセッサ101により、書き込み及び読み出しがなされるレジスタである。
108は、複写済みエリア管理テーブル107の1つのエリアに対応した記憶済みエリア記憶ビットである。109は、特別なビットでありデータセグメント管理ユニット2302の機能を許可、又は不許可にするためのデータセグメント管理ユニットイネーブルビットである。110は、OR回路106から信号が出力されるとともに、データセグメント管理ユニットイネーブルビット109から、データセグメント管理ユニット2302の機能を許可するビットが出力されたときに出力するAND回路である。111は、データセグメント管理ユニットイネーブルビット109から出力されたビットを反転するNOT回路である。
<ページ単位>
図25は、複写済みエリア管理テーブル107の構成の一例を概念的に示した図である。
図25において、複写済みエリア管理テーブル107の各ビットは、RAM1004のエリアに対応している。RAM1004を4Kバイト単位のページに分割し、複写済みエリア管理テーブル107の各複写済みエリア記憶ビット108が、分割されたページに対応する。この事から、例えば800Kバイトのエリアを管理するためには200ビットのラッチがあれば良い事になる。
<Page unit>
FIG. 25 is a diagram conceptually illustrating an example of the configuration of the copied area management table 107.
In FIG. 25, each bit of the copied area management table 107 corresponds to an area of the
<複写済みエリア管理テーブル>
図26は、複写済みエリア管理テーブル107の構成の一例を詳細に示した図である。
図26において、201は、プロセッサ(CPU)101から、ビットを読み書きするためのアドレスをデコードするアドレスデコーダ(Address Decoder)である。204は
、図24に示した複写済みエリア記憶ビット108に対応するラッチである。207はリセット信号(/RESET)、208はリードストローブ信号(RD)、209はライトストローブ信号(WR)である。202は、ライトストローブ信号209と、アドレスデコーダ201との両方が真になった時にライト信号を出力し、特定のアドレスに対応したラッチ204が、データバス101からデータD0〜D3を取り込むようにするためのアンド回路である。203は、リードストローブ信号208と、アドレスデコーダ201との両方が真になった時にリード信号を出力し、特定のアドレスに対応したラッチ204のデータQ0〜Q3をデータバス101に出力させるアンド回路である。205は、ラッチ204の出力を反転するNOT回路である。
<Copyed area management table>
FIG. 26 shows an example of the configuration of the copied area management table 107 in detail.
In FIG. 26,
プロセッサ101が、32ビットのCPUの場合、データバス101は32ビットのため、一度に読み書き出来るビットは32個となる。この場合、アドレスデコーダ201の出力1つに対してアンド回路202、203と、32個のラッチ204が接続されることになる。それぞれのラッチ204の反転出力は、図24に示したアンド回路105に入力される。また、リセット時のラッチ204の値は0であり反転出力はハイになっている。
When the
なお、本実施形態で処理されるプログラムの一例と、そのプログラムをコンパイルした結果のアッセンブラリストの一例は、それぞれ図11及び図12に示したものと同じである。 Note that an example of a program processed in this embodiment and an example of an assembler list obtained by compiling the program are the same as those shown in FIGS. 11 and 12, respectively.
<本実施形態のスタートアップ>
本実施形態におけるスタートアップする際の動作の一例を図27のフローチャートを使って説明する。
ステップS2701でリセットが解除されたら、ステップS2702で図23に示したデータセグメント管理ユニット2302の設定を行う。このとき、データセグメントとBSSの両方のエリアに対してデータセグメント管理ユニット2302が有効となるように管理開始アドレスを設定し、未複写エリアアクセス検出機能を有効な状態にする。そして、ステップS2703でC言語をスタートさせ、ステップS2704でOSをスタートさせ、ステップS2705でアプリケーションプログラムをスタートさせる。
<Startup of this embodiment>
An example of the operation at the time of start-up in this embodiment will be described with reference to the flowchart of FIG.
When the reset is canceled in step S2701, the data
<データセグメントのアクセス>
図27のフローチャートのステップS2705のアプリケーションプログラムが実行されていく様子を、図11に示したプログラム1101を例に挙げて説明する。図11のプログラム1101の103行目からアプリケーションプログラムを実行していく。最初に実行される有効な行は105行目である。105行目は、変数「fFirstAccess」が真なら106行目を実行し、偽なら108行目を実行するという分岐のルーチンである。この行を実行する事によって100行目で宣言している「fFirstAccess」という変数の値を読む事になる。図28は、プロセッサ1001によって変数「fFirstAccess」がアドレッシングされている様子の一例を示した図である。変数「fFirstAccess」に対応する複写済みエリア管理テーブル107のビットが未複写状態となっているため、図24のAND回路110の出力がアクティブとなり、アドレスラッチ103に変数「fFirstAccess」のアドレスが記録される。そして、図23に示したプロセッサ1001にNMI(ノンマスカバブルインタラプト)信号2801が出力され、NMI割り込みハンドラが起動する。
<Data segment access>
The manner in which the application program in step S2705 of the flowchart of FIG. 27 is executed will be described by taking the
<NMI割り込みハンドラの処理(初期データ複写手段)>
図29は、NMI割り込みハンドラの処理の一例を説明するフローチャートである。
ステップS2901でNMI割り込みの処理がスタートすると、ステップS2902で図23に示したアドレスラッチ103にラッチされたアドレスを調べる。前述した変数「fFirstAccess」はデータセグメント中の変数のため、ステップS2903に分岐する。ステップS2903では、変数「fFirstAccess」を含むページの4Kバイト分の初期値を、対応するROM1003のアドレスから転送する。図30は、変数「fFirstAccess」に初期値である「TRUE」がROM1003からRAM1004に転送された様子の一例を示した図である。
<NMI interrupt handler processing (initial data copying means)>
FIG. 29 is a flowchart for explaining an example of processing of the NMI interrupt handler.
When NMI interrupt processing starts in step S2901, the address latched in the
そして、ステップS2904で複写済みエリア管理テーブル107の情報を更新する。図31は、複写済みエリア管理テーブル107の情報が更新された状態の様子の一例を示した図である。
そして、ステップS2905で元のプログラムへ制御を戻すが、NMI割り込みの原因となった命令からやり直すようにプログラムカウンタを設定してから元のプログラムへ制御を戻す。
In step S2904, the information in the copied area management table 107 is updated. FIG. 31 is a diagram showing an example of a state where the information in the copied area management table 107 is updated.
In step S2905, control is returned to the original program, but the program counter is set so as to start over from the instruction that caused the NMI interrupt, and then control is returned to the original program.
前記ステップS2902において、アドレスラッチ103にラッチされたアドレスが、変数「fFirstAccess」を含むページの4KバイトがデータセグメントとBSSの両方を含むページだった場合には、ステップS2906へ進み、データセグメントの初期値をROM1003からRAM1004に転送するとともに、BSS領域のデータを0に初期化する。
図11に示したプログラム1101が107行目まで進むと、変数「fFirstAccess」を再びアクセスする事となるが、図24に示した複写済みエリア記憶レジスタの情報が複写済みとなっているため、NMI割り込みハンドラが再び発生する事はない。
In step S2902, if the address latched in the
When the
<BSSのアクセス>
そして、図11に示したプログラム1101が109行目まで進み、変数「Count」へ
アクセスすると、NMI割り込みハンドラが再び起動し、図29のNMI割り込みハンドらの処理を実行する事となる。この場合、アドレスラッチ103にラッチされたアドレスは、BBSエリアである。このため、ステップS2902からステップS2907へ進む。ステップS2907では、変数「Count」を含むページの4Kバイトを全て0で初期化
する。そして、ステップS2904へ進み、複写済みエリア管理テーブル107の情報を更新し、ステップS2905で元のプログラムへ制御を戻す。
<Access to BSS>
Then, when the
<バックグラウンド転送>
以上のように構成する事で、データセグメント転送とBSSの0クリアの待ち時間を省いてC言語のプログラム1101をスタートすることができる。そして、ユーザーアプリケーションを高速にスタートする事ができる。しかし、デジタルカメラとしてのスタートアップはユーザーアプリケーションが始まってからスタートする。
<Background transfer>
With the configuration described above, the
デジタルカメラとしては、撮像素子への電源投入や、レンズ1007の初期位置への駆動や、メモリーカード1009からのファイル情報の読み出しなど、デバイスが反応する待ち時間を含む処理が多い。そこで、それらの待ち時間を利用して、未転送のデータセグメントへの初期値の転送や初期化されていないBSSの初期化を行う事で、要求時の転送のオーバーヘッドを極力減らす事が可能となる。
For a digital camera, there are many processes including a waiting time for the device to react, such as turning on the power to the image sensor, driving the
図32は、本実施形態におけるバックグラウンド処理の一例を説明するフローチャートである。バックグラウンド処理を起動するプログラムは最もプライオリティの低いタスクとして実行する。このプログラムは、他に処理するべきプログラムが存在しない場合のみ動作するため、デジタルカメラとしての動作に影響する事がない。 FIG. 32 is a flowchart for explaining an example of background processing in the present embodiment. The program that starts the background processing is executed as a task with the lowest priority. Since this program operates only when there is no other program to be processed, the operation as a digital camera is not affected.
ステップS3201でタスクが開始すると、ステップS3202でポインタにデータセグメントの開始番地をセットする。次に、ステップS3203でポインタの値を読む。それにより、図11に示したプログラム1101の105行目で、変数「fFirstAccess」をアクセスした場合と同様の事が発生し、複写済みエリア管理テーブル107の複写済みエリア記憶ビット108が未複写状態であれば、図31に示したNMI割り込みハンドラの処理が起動され、初期値がROM1003からRAM1004に転送される。
When the task starts in step S3201, the start address of the data segment is set in the pointer in step S3202. In step S3203, the pointer value is read. As a result, the same thing occurs when the variable “fFirstAccess” is accessed in the 105th line of the
次に、ステップS3204で、ポインタをページサイズである4Kバイト分進める。
次に、ステップS3205で、ポインタがBSSの最後のアドレスを超えたか否かを判定し、超えている場合にはステップS3203に戻る。ステップS3203からステップS3205の処理を繰り返す事で、データセグメントとBSSの全領域の初期化が完了すると、ステップS3205からステップS3206へ進み、バックグラウンドタスクそのものを終了させる。
In step S3204, the pointer is advanced by 4 Kbytes which is the page size.
Next, in step S3205, it is determined whether or not the pointer has exceeded the last address of the BSS. If so, the process returns to step S3203. When the initialization of all areas of the data segment and BSS is completed by repeating the processing from step S3203 to step S3205, the process proceeds from step S3205 to step S3206, and the background task itself is terminated.
以上のように本実施形態では、ROM1003のデータセグメントの初期値が格納されたエリアから、データセグメントの対応するエリア(RAM1004)へデータコピーが行われたかどうかを記憶する複写済みエリア管理テーブル107を有し、RAM1004のデータセグメント内にあるROM103からのデータコピーが未だ行われていないエリアに対するアクセスを検出すると、実行中のプログラムを中断して、NMI割り込みハンドラの処理の中でROM1003からRAM1004へのデータコピーを行った後、複写済みエリア管理テーブル107の情報を更新して、前記プログラムの実行を再開することにより、データセグメントの初期値をROM1003からRAM1004へコピーする動作を、オンデマンド(要求時)に分散して行うようにした。
As described above, in the present embodiment, the copied area management table 107 that stores whether data is copied from the area in the
これにより、従来はプログラムの実行前に必要だった全てのデータセグメントの初期化を、プログラムの実行の進行に従って必要な部分のみを分散して行う事が可能となり、起動からプログラム実行までのタイムラグを大幅に短縮する事が可能となる。 This makes it possible to initialize all data segments that were previously required before program execution by distributing only the necessary parts as the program progresses, reducing the time lag from startup to program execution. It can be greatly shortened.
本実施形態の複写済みエリア管理テーブル107は、CPUであるプロセッサ1001からの書き込み、読み出しが可能なレジスタであり、各複写済みエリア記憶ビット108が、RAM1004の特定のアドレスから始まる一定サイズのブロックに対応している。複写済みエリア管理テーブル107の出力とアドレスバス102とを監視し、アドレスが複写済みエリア管理テーブル107の管理情報における未複写エリアと一致したことを検出すると、NMI(ノンマスカバブルインタラプト)などの例外処理を発生させ、検出したアドレスをCPUであるプロセッサ1001から読み書き可能なレジスタに自動的に保存するようにする。このNMIの例外発生によって実行中のプログラムを中断して、ROM1003からRAM1004へのデータコピーを行った後に、複写済みエリア管理テーブル107の情報を更新してプログラムの実行を再開することをソフトウェアの例外処理ハンドラで実現するようにしたので、少ない回路規模でシステムを構築する事ができる。
The copied area management table 107 of this embodiment is a register that can be written to and read from the
複写済みエリア管理テーブル107及び未複写にエリア対するアクセスを検出する未複写エリア部のカバーするアドレスの開始番地を動的に設定可能にするようにしたので、複写済みエリア管理テーブル107及び未複写エリアアクセス検出部のカバーするエリアを最適なサイズで構成できる。 Since the start address of the address covered by the copied area management table 107 and the non-copied area section for detecting access to the uncopied area can be dynamically set, the copied area management table 107 and the non-copied area are set. The area covered by the access detector can be configured with an optimal size.
前記未複写エリアアクセス検出部は、検出機能を停止させる未複写エリアアクセス検出禁止機能を備え、パワーオンリセット時(コールドスタート時)に自動的に未複写エリアアクセス検出禁止状態となるようにしている。また、複写済みエリア記憶レジスタは、パワーオンリセット時(コールドスタート時)に自動的にすべてのエリアが未複写エリアに設定されるようにしている。このようにする事によって、ソフトウェアによる初期設定にかかる時間を短縮する事が可能となり、より短い時間でコンピュータをスタートアップさせる事が可能となる。 The uncopied area access detection unit is provided with an uncopied area access detection prohibition function for stopping the detection function, and automatically enters an uncopied area access detection prohibition state at power-on reset (cold start). . The copied area storage register automatically sets all areas as uncopied areas at power-on reset (cold start). By doing so, it is possible to reduce the time required for the initial setting by software, and it is possible to start up the computer in a shorter time.
デジタルカメラのスタートアップ時には、レンズ1007の駆動や、ファイルの読み出しなどの、CPUであるプロセッサ1001が待ち状態となる時間が細切れに存在する。そこで、本実施形態では、実行すべき有効なプログラムが存在しないアイドル状態になった場合に、ROM1003からRAM1004へのデータコピー及び複写済みエリア管理テーブル107の情報更新を行うようにした。これにより、プログラムがデータセグメントをアクセスしたときに、ROM1003からRAM1004へのコピーがすでに完了している可能性が向上し、より高速に処理を進める事が可能となる。
At the time of start-up of the digital camera, there is a short period of time during which the
(本発明の他の実施形態)
上述した実施形態の機能を実現するべく各種のデバイスを動作させるように、該各種デバイスと接続された装置あるいはシステム内のコンピュータに対し、前記実施形態の機能を実現するためのソフトウェアのプログラムコードを供給し、そのシステムあるいは装置のコンピュータ(CPUあるいはMPU)に格納されたプログラムに従って前記各種デバイスを動作させることによって実施したものも、本発明の範疇に含まれる。
(Other embodiments of the present invention)
In order to operate various devices to realize the functions of the above-described embodiments, program codes of software for realizing the functions of the above-described embodiments are provided to an apparatus or a computer in the system connected to the various devices. What is implemented by operating the various devices according to a program supplied and stored in a computer (CPU or MPU) of the system or apparatus is also included in the scope of the present invention.
また、この場合、前記ソフトウェアのプログラムコード自体が上述した実施形態の機能を実現することになり、そのプログラムコード自体、及びそのプログラムコードをコンピュータに供給するための手段、例えば、かかるプログラムコードを格納した記録媒体は本発明を構成する。かかるプログラムコードを記憶する記録媒体としては、例えばフレキシブルディスク、ハードディスク、光ディスク、光磁気ディスク、CD−ROM、磁気テープ、不揮発性のメモリーカード、ROM等を用いることができる。 In this case, the program code of the software itself realizes the functions of the above-described embodiments, and the program code itself and means for supplying the program code to the computer, for example, the program code are stored. The recorded medium constitutes the present invention. As a recording medium for storing the program code, for example, a flexible disk, a hard disk, an optical disk, a magneto-optical disk, a CD-ROM, a magnetic tape, a nonvolatile memory card, a ROM, or the like can be used.
また、コンピュータが供給されたプログラムコードを実行することにより、上述の実施形態の機能が実現されるだけでなく、そのプログラムコードがコンピュータにおいて稼働しているOS(オペレーティングシステム)あるいは他のアプリケーションソフト等と共同して上述の実施形態の機能が実現される場合にもかかるプログラムコードは本発明の実施形態に含まれることは言うまでもない。 Further, by executing the program code supplied by the computer, not only the functions of the above-described embodiments are realized, but also the OS (operating system) or other application software in which the program code is running on the computer, etc. It goes without saying that the program code is also included in the embodiment of the present invention even when the functions of the above-described embodiment are realized in cooperation with the embodiment.
さらに、供給されたプログラムコードがコンピュータの機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリーに格納された後、そのプログラムコードの指示に基づいてその機能拡張ボードや機能拡張ユニットに備わるCPU等が実際の処理の一部または全部を行い、その処理によって上述した実施形態の機能が実現される場合にも本発明に含まれることは言うまでもない。 Further, after the supplied program code is stored in the memory provided in the function expansion board of the computer or the function expansion unit connected to the computer, the CPU provided in the function expansion board or function expansion unit based on the instruction of the program code Needless to say, the present invention includes a case where the functions of the above-described embodiment are realized by performing part or all of the actual processing.
101 データバス
102 アドレスバス
103 アドレスラッチ
104 プログラマブルアドレスデコーダー
105 アンド回路
106 オア回路
107 複写済みエリア管理テーブル
108 記憶済みエリア記憶ビット
109 データセグメント管理ユニットイネーブルビット
110 アンド回路
201 アドレスデコーダ
202、203 アンド回路
204 ラッチ
207 リセット信号
208 リードストローブ信号
209 ライトストローブ信号
1001 プロセッサ
1002 ページングハードウェア
1003 ROM
1004 RAM
1005 A/D変換機
1006 CCD
1007 レンズ
1008 インターフェース
1009 メモリーカード
1011 I/Oインターフェース
1010 レンズ駆動メカ
2302 データセグメント管理ユニット
101
1004 RAM
1005 A /
1007
Claims (17)
前記プログラムに記述されている変数のエリアにおける物理アドレスが割り当てられない状態となるように前記ページテーブルを設定して前記ページテーブルを初期化する初期化手段と、
前記初期化手段によりページテーブルが初期化された後にプログラムを実行するプログラム実行手段と、
前記プログラム実行手段によりプログラムが実行されることによって、前記物理アドレスが割り当てられていないエリアにアクセスされると、そのエリアにおける変数の初期値を設定する変数設定手段とを有することを特徴とする電子機器。 An electronic device that executes the program using a page table that manages a virtual address and a physical address of the program in units of pages,
Initialization means for setting the page table and initializing the page table so that a physical address in an area of a variable described in the program is not assigned;
Program execution means for executing a program after the page table is initialized by the initialization means;
When the program is executed by the program execution means, when an area to which the physical address is not allocated is accessed, variable setting means for setting an initial value of a variable in the area is provided. machine.
前記ページフォルト割り込み処理の中で、前記物理アドレスが割り当てられていないエリアにおける変数の初期値を設定することを特徴とする請求項1に記載の電子機器。 The variable setting means includes an interrupt process execution means for executing a page fault interrupt process when a page fault occurs when an area to which the physical address is not allocated is accessed by executing the program by the program execution means. Have
The electronic device according to claim 1, wherein an initial value of a variable in an area to which the physical address is not assigned is set in the page fault interrupt process.
前記第2の記録媒体のエリアであって、前記第1の記録媒体からの複写が行われていない未複写エリアに対するアクセスを検出する検出手段と、
前記検出手段により未複写エリアへのアクセスが検出されると、前記プログラムの実行を中断し、前記第1の記録媒体から前記第2の記録媒体の未複写エリアへ、その未複写エリアに対応する部分のプログラムを複写する複写手段と、
前記複写手段により複写されたプログラムのデータの複写先である前記第2の記録媒体のエリアを管理する管理手段と、
前記管理手段により、前記第2の記録媒体のエリアが管理された後に、前記中断されたプログラムの実行を再開するプログラム実行再開手段とを有することを特徴とする電子機器。 An electronic device that copies and executes program data recorded on a first recording medium on a second recording medium,
Detecting means for detecting access to an area of the second recording medium that is not copied from the first recording medium;
When the detection means detects an access to an uncopied area, the execution of the program is interrupted, and the uncopied area from the first recording medium to the uncopied area of the second recording medium is handled. A copying means for copying the program of the part;
Management means for managing an area of the second recording medium that is a copy destination of program data copied by the copying means;
An electronic apparatus comprising: program execution restarting means for restarting execution of the suspended program after the management unit manages the area of the second recording medium.
前記検出手段は、前記管理手段で管理されている前記第2の記録媒体のエリアのアドレスであって、前記プログラムのデータが複写されていない未複写エリアのアドレスと、アクセス中のアドレスとが一致したことを、前記レジスタのビットの値を用いて検出し、
前記管理手段は、前記検出手段により一致したことが検出されたアドレスを保存することを特徴とする請求項7に記載の電子機器。 The management means includes a register, and each bit of the register corresponds to a block of a certain size starting from a specific address of the second recording medium,
The detecting means is the address of the area of the second recording medium managed by the managing means, and the address of the uncopied area where the program data is not copied matches the address being accessed. Is detected using the value of the bit of the register,
The electronic device according to claim 7, wherein the management unit stores an address detected by the detection unit as a match.
前記検出停止手段は、電源が切れている状態から電子機器が起動すると、前記検出を停止させることを特徴とする請求項9に記載の電子機器。 The detection means includes detection stop means for stopping the detection,
The electronic device according to claim 9, wherein the detection stop unit stops the detection when the electronic device is activated from a power-off state.
前記複写手段は、前記状態検出手段によりアイドル状態が検出されると、前記第1の記録媒体から前記第2の記録媒体の未複写エリアへ、その未複写エリアに対応する部分のプログラムのデータを複写することを特徴とする請求項7〜11の何れか1項に記載の電子機器。 Among the programs, there is a state detection means for detecting an idle state where there is no effective program to be executed,
When the idle state is detected by the state detecting unit, the copying unit transfers program data corresponding to the non-copied area from the first recording medium to the non-copied area of the second recording medium. The electronic device according to claim 7, wherein the electronic device is copied.
前記プログラムに記述されている変数のエリアにおける物理アドレスが割り当てられない状態となるように前記ページテーブルを設定して前記ページテーブルを初期化する初期化ステップと、
前記初期化ステップによりページテーブルが初期化された後にプログラムを実行するプログラム実行ステップと、
前記プログラム実行ステップによりプログラムが実行されることによって、前記物理アドレスが割り当てられていないエリアにアクセスされると、そのエリアにおける変数の初期値を設定する変数設定ステップとを有することを特徴とするデータ処理方法。 A data processing method for executing the program using a page table for managing the virtual address and physical address of the program in units of pages,
An initialization step of initializing the page table by setting the page table so that a physical address in the variable area described in the program is not assigned;
A program execution step for executing the program after the page table is initialized by the initialization step;
A variable setting step for setting an initial value of a variable in the area when an area to which the physical address is not allocated is accessed by executing the program in the program execution step. Processing method.
前記第2の記録媒体のエリアであって、前記第1の記録媒体からの複写が行われていない未複写エリアに対するアクセスを検出する検出ステップと、
前記検出ステップにより未複写エリアへのアクセスが検出されると、前記プログラムの実行を中断し、前記第1の記録媒体から前記第2の記録媒体の未複写エリアへ、その未複写エリアに対応する部分のプログラムを複写する複写ステップと、
前記複写ステップにより複写されたプログラムのデータの複写先である前記第2の記録媒体のエリアを管理する管理ステップと、
前記管理ステップにより、前記第2の記録媒体のエリアが管理された後に、前記中断されたプログラムの実行を再開するプログラム実行再開ステップとを有することを特徴とするデータ処理方法。 A data processing method for copying and executing program data recorded in a first recording medium on a second recording medium,
A detection step of detecting access to an area of the second recording medium that is not copied from the first recording medium;
When an access to an uncopied area is detected by the detecting step, execution of the program is interrupted, and the uncopied area from the first recording medium to the uncopied area of the second recording medium is handled. A copying step for copying the program of the part;
A management step of managing an area of the second recording medium which is a copy destination of the program data copied in the copying step;
A data processing method comprising: a program execution restarting step for restarting execution of the interrupted program after the management step manages the area of the second recording medium.
前記プログラムに記述されている変数のエリアにおける物理アドレスが割り当てられない状態となるように前記ページテーブルを設定して前記ページテーブルを初期化する初期化ステップと、
前記初期化ステップによりページテーブルが初期化された後にプログラムを実行するプログラム実行ステップと、
前記プログラム実行ステップによりプログラムが実行されることによって、前記物理アドレスが割り当てられていないエリアにアクセスされると、そのエリアにおける変数の初期値を設定する変数設定ステップとをコンピュータに実行させることを特徴とするコンピュータプログラム。 When executing the program using a page table that manages the virtual address and physical address of the program in units of pages,
An initialization step of initializing the page table by setting the page table so that a physical address in the variable area described in the program is not assigned;
A program execution step for executing the program after the page table is initialized by the initialization step;
When an area to which the physical address is not assigned is accessed by executing the program in the program execution step, the computer is caused to execute a variable setting step for setting an initial value of a variable in the area. Computer program.
前記第2の記録媒体のエリアであって、前記第1の記録媒体からの複写が行われていない未複写エリアに対するアクセスを検出する検出ステップと、
前記検出ステップにより未複写エリアへのアクセスが検出されると、前記プログラムの実行を中断し、前記第1の記録媒体から前記第2の記録媒体の未複写エリアへ、その未複写エリアに対応する部分のプログラムを複写する複写ステップと、
前記複写ステップにより複写されたプログラムのデータの複写先である前記第2の記録媒体のエリアを管理する管理ステップと、
前記管理ステップにより、前記第2の記録媒体のエリアが管理された後に、前記中断されたプログラムの実行を再開するプログラム実行再開ステップとをコンピュータに実行させることを特徴とするコンピュータプログラム。 When copying and executing the program data recorded on the first recording medium to the second recording medium,
A detection step of detecting access to an area of the second recording medium that is not copied from the first recording medium;
When an access to an uncopied area is detected by the detecting step, execution of the program is interrupted, and the uncopied area from the first recording medium to the uncopied area of the second recording medium is handled. A copying step for copying the program of the part;
A management step of managing an area of the second recording medium which is a copy destination of the program data copied in the copying step;
A computer program causing a computer to execute a program execution resuming step of resuming execution of the interrupted program after the management step manages the area of the second recording medium.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007337935A JP4732432B2 (en) | 2004-12-24 | 2007-12-27 | Digital camera, digital camera data processing method, and computer program |
Applications Claiming Priority (5)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004374765 | 2004-12-24 | ||
JP2004374386 | 2004-12-24 | ||
JP2004374765 | 2004-12-24 | ||
JP2004374386 | 2004-12-24 | ||
JP2007337935A JP4732432B2 (en) | 2004-12-24 | 2007-12-27 | Digital camera, digital camera data processing method, and computer program |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005126957A Division JP4078360B2 (en) | 2004-12-24 | 2005-04-25 | Electronic device, data processing method, and computer program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2008135051A true JP2008135051A (en) | 2008-06-12 |
JP4732432B2 JP4732432B2 (en) | 2011-07-27 |
Family
ID=39559819
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007337935A Expired - Fee Related JP4732432B2 (en) | 2004-12-24 | 2007-12-27 | Digital camera, digital camera data processing method, and computer program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4732432B2 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9301178B2 (en) | 2013-04-25 | 2016-03-29 | Fujitsu Limited | Data extraction method and data extraction device |
US9442724B2 (en) | 2011-01-31 | 2016-09-13 | Socionext Inc. | Start control apparatus for controlling a start of an information device by using an interrupt generation code, information device, and start control method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS63109557A (en) * | 1986-10-28 | 1988-05-14 | Nec Corp | Program load system |
JPH02270032A (en) * | 1989-04-12 | 1990-11-05 | Nec Corp | Loading system |
JPH03154140A (en) * | 1989-11-10 | 1991-07-02 | Hitachi Ltd | Virtual storage control system and information processor |
JPH04156615A (en) * | 1990-10-20 | 1992-05-29 | Fujitsu Ltd | System rising system |
JPH09114673A (en) * | 1995-10-20 | 1997-05-02 | Fujitsu Ltd | Device and method for program loading |
-
2007
- 2007-12-27 JP JP2007337935A patent/JP4732432B2/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS63109557A (en) * | 1986-10-28 | 1988-05-14 | Nec Corp | Program load system |
JPH02270032A (en) * | 1989-04-12 | 1990-11-05 | Nec Corp | Loading system |
JPH03154140A (en) * | 1989-11-10 | 1991-07-02 | Hitachi Ltd | Virtual storage control system and information processor |
JPH04156615A (en) * | 1990-10-20 | 1992-05-29 | Fujitsu Ltd | System rising system |
JPH09114673A (en) * | 1995-10-20 | 1997-05-02 | Fujitsu Ltd | Device and method for program loading |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9442724B2 (en) | 2011-01-31 | 2016-09-13 | Socionext Inc. | Start control apparatus for controlling a start of an information device by using an interrupt generation code, information device, and start control method |
US9301178B2 (en) | 2013-04-25 | 2016-03-29 | Fujitsu Limited | Data extraction method and data extraction device |
Also Published As
Publication number | Publication date |
---|---|
JP4732432B2 (en) | 2011-07-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4078360B2 (en) | Electronic device, data processing method, and computer program | |
US10191852B2 (en) | Methods and apparatus for locking at least a portion of a shared memory resource | |
JP5255348B2 (en) | Memory allocation for crash dump | |
EP0859978B1 (en) | A system and method for fast context switching between tasks | |
JP5071798B2 (en) | Computer system, memory management method, and program thereof | |
JP5783809B2 (en) | Information processing apparatus, activation method, and program | |
WO2015169145A1 (en) | Memory management method and device | |
JP2010039895A (en) | Virtual computer system, error recovery method for virtual computer system, and virtual computer control program | |
JP2007219581A (en) | Memory controller, and electronic equipment mounted therewith | |
JPH1185618A (en) | Method for controlling virtual memory conversion | |
US20130007367A1 (en) | Information processing apparatus and method of controlling same | |
JP2004127291A (en) | Method, system, and computer software for offering successive memory address | |
JP2005346168A (en) | Cache memory, system, and data storage method | |
WO2011137769A1 (en) | Multi-core online patching method and apparatus | |
CN107003882B (en) | Method, system, and apparatus for transforming cache closures and persistent snapshots | |
JP4732432B2 (en) | Digital camera, digital camera data processing method, and computer program | |
CN113127263B (en) | Kernel crash recovery method, device, equipment and storage medium | |
US8312216B2 (en) | Data processing apparatus and data processing method | |
US6862675B1 (en) | Microprocessor and device including memory units with different physical addresses | |
JPH1173365A (en) | Method for optimizing data moving operation | |
CN112486410A (en) | Method, system, device and storage medium for reading and writing persistent memory file | |
JP4965974B2 (en) | Semiconductor integrated circuit device | |
RU2294010C1 (en) | Digital data processing method | |
JP2005346582A (en) | System lsi and image processor | |
JP4164452B2 (en) | Information processing method and apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20110120 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110125 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110323 |
|
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: 20110412 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20110420 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140428 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4732432 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |