JP2008135051A - Electronic device, data processing method, and computer program - Google Patents

Electronic device, data processing method, and computer program Download PDF

Info

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
Application number
JP2007337935A
Other languages
Japanese (ja)
Other versions
JP4732432B2 (en
Inventor
Takeshi Ogawa
武志 小川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2007337935A priority Critical patent/JP4732432B2/en
Publication of JP2008135051A publication Critical patent/JP2008135051A/en
Application granted granted Critical
Publication of JP4732432B2 publication Critical patent/JP4732432B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To drastically shorten the startup time of an electronic device. <P>SOLUTION: The electronic device has a copied area management table 107 for storing whether data have been copied from areas storing initial values in data segments of a ROM 1003 to corresponding areas (RAM 1004) of data segments. When an access is detected to an area in the data segments of the RAM 1004 where data copy from the ROM 103 has been not performed yet, a program being performed is interrupted, data copy is performed by the processing of an NMI interrupt handler, the information in the copied area management table 107 is updated, and the performance of the program is restarted. Thus, the initial values in the data segments are distributedly copied on demand from the ROM 1003 to the RAM 1004. <P>COPYRIGHT: (C)2008,JPO&INPIT

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 Patent Document 1 as a prior art relating to the activation of a high-level language from a ROM.

このように、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.

特開2004−348677号公報JP 2004-348677 A 特開2001−51858号公報JP 2001-51858 A

以上のように従来の技術では、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, reference numeral 1001 denotes a processor that reads and executes a program. Reference numeral 1002 denotes paging hardware that manages virtual addresses and physical addresses. Reference numeral 1003 denotes a ROM that stores a digital camera program. Reference numeral 1004 denotes a RAM that stores images and variables. Reference numeral 1005 denotes an A / D converter for capturing a captured image. Reference numeral 1006 denotes a CCD (Charge-Coupled Device) that receives light from the lens 1007 and converts it into an electrical signal. Reference numeral 1007 denotes a lens that determines an image on the CCD 1006. Reference numeral 1008 denotes an interface for connecting the memory card 1009. Reference numeral 1009 denotes a memory card for storing images. Reference numeral 1011 denotes an I / O interface for driving peripheral circuits. Reference numeral 1010 denotes a lens driving mechanism for driving the lens 1007.

電源が投入されると、プロセッサ1001は、ページングハードウェア1002を通してROM1003に格納されたプログラムのリセットベクターと呼ばれる番地の命令を読み出し、実行を開始する。ページングハードウェア1002は、リセット直後の初期状態となっており、物理アドレスと仮想アドレスとが一致した状態となっている。なお、画像を撮影して、メモリーカード1009へ記録する過程は本実施形態の本質と関係がないため、説明を省略することとする。   When the power is turned on, the processor 1001 reads out an instruction at an address called a reset vector of a program stored in the ROM 1003 through the paging hardware 1002, and starts execution. The paging hardware 1002 is in an initial state immediately after reset, and a physical address and a virtual address are in agreement. Note that the process of taking an image and recording it on the memory card 1009 is not related to the essence of the present embodiment, and thus the description thereof is omitted.

<初期状態>
図3は、本実施形態のデジタルカメラにおけるシステムが起動した直後のページングハードウェア1002と、ROM1003と、RAM1004の状態の一例を示した図である。図3に示すように、システムの起動直後は、すべての仮想アドレスに物理アドレスがアサインされている(割り当てられている)状態である。
<Initial state>
FIG. 3 is a diagram illustrating an example of states of the paging hardware 1002, the ROM 1003, and the RAM 1004 immediately after the system in the digital camera of the present embodiment is activated. As shown in FIG. 3, immediately after the system is started, physical addresses are assigned (assigned) to all virtual addresses.

<アプリケーションプログラム>
図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 program 301 of FIG. 4, the 100th line is the first function that calls this program 301. The program 301 is not called when the system is started, but may be called when a module is used. For example, a module related to printing may be called only after a printer is connected.

そして、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 program 301 in FIG.
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 paging hardware 1002, the ROM 1003, and the RAM 1004 at the time when the process of step S805 of FIG. 5 is completed, that is, when the execution of the 102nd line of the program 301 of FIG. It has become. All pages containing functions from the function MyFirstFunc to the function EndModule are unassigned. In FIG. 6, it can be seen that the physical address of the function MyFunc is not assigned.

次に、図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 program 301 in FIG. 4 is called, a page fault interrupt occurs. Here, an example of the page fault interrupt process will be described with reference to the flowchart of FIG.
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 ROM 1003 are copied to the empty frame secured in step S902.
FIG. 8 is a diagram showing an example of the states of the paging hardware 1002, the ROM 1003, and the RAM 1004 when the contents of the corresponding page in the ROM 1003 are copied to an empty frame. In FIG. 8, it can be seen that a copy of the function MyFunc is created in a frame on the RAM 1004.

このようにして、ROM1003の該当ページの内容を空きフレームにコピーしたら、図7のステップS904で、ページテーブルにフレームを設定する。図9は、ステップS904でページテーブルにフレームをアサインした時点における、ページングハードウェア1002と、ROM1003と、RAM1004の状態の一例を示した図である。なお、RAM1004にコピーされたプログラムは元のアドレスと同じ仮想アドレスから読み出されるため、ポジションディペンドなプログラムでも実行可能である。
そして、ステップS905でページフォルト割り込みを終了する。
After the content of the corresponding page in the ROM 1003 is copied to the empty frame in this way, a frame is set in the page table in step S904 in FIG. FIG. 9 is a diagram illustrating an example of the states of the paging hardware 1002, the ROM 1003, and the RAM 1004 at the time when a frame is assigned to the page table in step S904. Since the program copied to the RAM 1004 is read from the same virtual address as the original address, even a position-dependent program can be executed.
In step S905, the page fault interrupt is terminated.

以上のようなページフォルト割り込みから復帰して、プログラム301を再開し図3の109行目が実行される時には、プログラム301そのものはRAM1004からフェッチするため、高速な読み出しが可能な状態となっている。図4のプログラム301の109行目が再び実行される時には、すでにフレームがアサイン済みのためページフォルト割り込みは発生しない。   When the program 301 is resumed from the page fault interrupt as described above and the 109th line in FIG. 3 is executed, the program 301 itself is fetched from the RAM 1004, so that it can be read at high speed. . When the 109th line of the program 301 in FIG. 4 is executed again, no page fault interrupt occurs because the frame has already been assigned.

図10は、関数EndModuleを含むページについても前述した処理を実行してフレームを
アサインした時点における、ページングハードウェア1002と、ROM1003と、RAM1004の状態の一例を示した図である。
FIG. 10 is a diagram illustrating an example of states of the paging hardware 1002, the ROM 1003, and the RAM 1004 at the time when the above-described processing is executed for the page including the function EndModule and a frame is assigned.

以上のように構成する事によって、システム起動時にROM1003からRAM1004へプログラムを転送する待ち時間のロスがなく、且つ、ポジションディペンドなプログラムの一部をRAM1004へ展開する事が可能となり、大規模なROMプログラムの一部を、高速に実行することが可能なRAM1004で実行する事を容易に実現するコンピュータシステムを構成する事が出来る。   By configuring as described above, there is no loss of waiting time for transferring a program from the ROM 1003 to the RAM 1004 at the time of system startup, and a part of the position-dependent program can be expanded to the RAM 1004. It is possible to configure a computer system that easily realizes part of the program being executed by the RAM 1004 that can be executed at high speed.

特に、デジタルカメラの起動時間を構成する要素には、レンズ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 lens 1007 to the initial position and data reading from the memory card 1009. On the other hand, a GUI (graphical user interface) using a window system is a program that consumes a lot of processing time of the processor (CPU) 1001 and does not operate at all when activated.
Therefore, it can be said that it is efficient to transfer the application program from the ROM 1003 to the RAM 1004 when the application program is requested, that is, at the time of execution. With such a configuration, it is possible to save the time required for transfer from the ROM 1003 to the RAM 1004 required at the start-up, and it is possible to arrange and operate a program that requires high-speed operation in the RAM 10004.

(第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 processor 1001 reads out an instruction at an address called a reset vector of a program stored in the ROM 1003 and starts execution, or the paging hardware 1302 is in an initial state immediately after reset. The physical address and the virtual address are in the same state as in the first embodiment described above. Note that the process of taking an image and recording it on the memory card 1009 is not related to the essence of the present embodiment, and thus the description thereof is omitted.

<変数>
図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 program 1101 of FIG. In the program 1101 of FIG. 11, the 100th line is a variable with initialization, which means that when the program 1101 starts, the value “TRUE” has already been assigned to the variable “fFirstAccess”.

「fFirstAccess」という変数は、図12のアッセンブラリスト1201では、0002行目に記述されている。0001行目から0003行目の間がデータセグメントのエリアである。コンパイルの結果、このプログラム301のデータセグメントは「fFirstAccess」だけである。ところが、その後リンカーによって全プログラムのデータセグメントが一つのエリアに集められるため、データセグメントには複数のソースによって記述された、モジュールの異なる変数が隣接して存在する事となる。   The variable “fFirstAccess” is described in the 0002th line in the assembler list 1201 of FIG. The area between the 0001th line and the 0003th line is a data segment area. As a result of compilation, the data segment of the program 301 is only “fFirstAccess”. However, since the data segments of all the programs are collected in one area by the linker, different variables of modules described by a plurality of sources are adjacent to each other in the data segment.

図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 program 1101 in FIG. 11, a variable “Count” is declared, but the initial value is not substituted. In the C language specification, a variable whose initial value is not declared is to be initialized with 0, so the initial value of “Count” should be 0. The 0007th line in the assembler list 1201 in FIG. 12 is the compilation result of “Count”. Since lines 0006 to 0008 in the assembler list 1201 in FIG. 12 are BSS areas, it can be seen that “Count” is compiled as a variable in the BSS area. Similarly to the data segment, the BSS area is also gathered by the linker, and a plurality of module variables exist adjacent to each other.

<従来のスタートアップ>
本実施形態のスタートアップを説明する前に従来のスタートアップをもう一度説明する事とする。図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 paging hardware 1002 shown in FIG. 2 is set in step S1002. At this time, the physical address is not assigned to both the data segment and the BSS areas. Then, the C language is started in step S1003, the OS is started in step S1004, and the application program is started in step S1005.

<実行時の動作説明>
図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 program 1101 shown in FIG. 11 as an example.
The application program is executed from the 103rd line of the program 1101 in FIG. The first valid line executed is line 105. The 105th line is a branching routine that executes the 106th line if the variable “fFirstAccess” is true, and executes the 108th line if the variable “fFirstAccess” is false. By executing this line, the value of the variable “fFirstAccess” declared in the 100th line is read. FIG. 15 is a diagram illustrating a state where the variable “fFirstAccess” is addressed by the processor 1001. In step S1002 of FIG. 14, the physical space of the data segment area and the physical space of the BSS area of the page table are not assigned. If an address to which physical space is not assigned is addressed, a page fault interrupt is generated. When a page fault interrupt occurs, the program starts.

<ページフォルト処理>
ページフォルト割り込みによって動作するプログラムによる処理動作の一例を、図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 program 1101 shown in FIG. 11, since the 105th line is being executed, the variable “fFirstAccess” is a data segment, and the process branches to step S1204. In step S1204, the initial value is transferred from the corresponding address in the ROM 1303.

図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 ROM 1003 is transferred to the physical address of the RAM 1004. Besides the variable “fFirstAcces”, all the initial values of 4 Kbytes in the same page are transferred. And
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 program 1101 shown in FIG. 11 in a state where the initial value 1 is assigned as the value. .

変数「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 program 1101 shown in FIG. 11 is executed, and the value “FALSE” is substituted for the variable “fFirstAccess” on the 107th line. When the substitution on the 107th line is performed, the variable “fFirstAccess” is assigned to the physical memory, and therefore a page fault does not occur again.
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 program 301 in FIG. In this line, zero (0) which is the initial value of the variable “Count” is read, and the value is incremented and assigned. Since physical memory is assigned when assigned, the page fault interrupt will not occur again.

<バックグラウンド転送>
上記のように構成する事で、データセグメント転送と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 lens 1007 to the initial position, and reading file information from the memory card 1009. By using these waiting times to transfer initial values to untransferred data segments and to initialize uninitialized BSSs, it is possible to reduce the overhead of on-demand transfer as much as possible.

バックグラウンドで初期化を行うプログラムの動作の一例を図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 ROM 1003 to the secured physical memory.
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 ROM 1003.

ステップ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 paging hardware 1002 is set, and the application program is started. Thereafter, when an address to which a physical address is not assigned is addressed, a page fault interrupt occurs, and a physical memory to which a physical address has not yet been assigned is secured. If the page where the page fault has occurred is a data segment, the initial value is transferred from the corresponding address of the ROM 1003 to the reserved physical memory. On the other hand, if the page in which the page fault has occurred is BSS, the reserved physical memory is filled with zero (0). As a result, the waiting time for transferring the data segment variable and clearing the BSS to 0 can be saved, and the execution of the application program can be started without waiting for the initialization of the variable area of the programming language. Therefore, for example, it is possible to significantly reduce the time from when the digital camera is turned on until it can be photographed.

なお、本実施形態では仮想アドレスを持ったページングハードウェア1002を使用したが、仮想アドレスと物理アドレスとの変換機能をもたない、プロテクションのみを目的としたMMUを使って類似したシステムを構成できる。その場合、データセグメントとBSSとをプロテクション対象として登録した状態で、C言語をスタートさせ、プロテクションフォルトの割り込みによってデータセグメントへのROMからの初期値の転送やBSSの初期化を行うように構成すればよい。その他の構成については、上述した第2の実施形態と同じであるので説明を省略する。   In this embodiment, the paging hardware 1002 having a virtual address is used. However, a similar system can be configured by using an MMU for the purpose of protection only, which does not have a virtual address / physical address conversion function. . In that case, the C language is started with the data segment and BSS registered as the protection target, and the initial value is transferred from the ROM to the data segment and the BSS is initialized by interruption of the protection fault. That's fine. Since other configurations are the same as those of the second embodiment described above, description thereof is omitted.

(第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 ROM 1003 to the RAM 1004 and the process of filling the BSS area with 0.

アプリケーションプログラムの実行に従ってプロセッサ(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 processor 1001 is copied from the ROM 1003 by the initial data copying unit, the management information in the copied area management table is updated, and control is returned to the program. When the processor 1001 accesses the same area of the data segment again, since the fact that copying has already been recorded is recorded in the copied area management table, the program is not interrupted by the uncopied area access detection unit. The present embodiment is realized using such a program. Hereinafter, details of the present embodiment will be described with reference to the drawings.

<デジタルカメラ>
図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, reference numeral 2302 denotes a data segment management unit which is a hardware processing part. The data segment management unit 2302 manages both the data segment and the BSS by dividing them into fixed-length pages, and is designed as a removable computer peripheral device of the type connected to the bus. Other parts are the same as those shown in FIG. Similarly to the first and second embodiments, when the power is turned on, the processor 1001 reads out an instruction at an address called a reset vector of a program stored in the ROM 1003 and starts execution. Further, the data segment management unit 2302 is in an initial state immediately after reset, and is in a non-copied area access detection function stop state. Note that the process of taking an image and recording it on the memory card 1009 is not related to the essence of the present embodiment, and thus the description thereof is omitted.

<データセグメント管理ユニット>
図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 segment management unit 2302 in detail according to the third embodiment of the present invention.
In FIG. 24, 101 is a data bus, and 102 is an address bus. The data bus 101 and the address bus 102 are connected to the data segment management unit 2302.

103は、未初期化エリアを検出した場合にそのアドレスを取り込むアドレスラッチ(Address Latch)である。104は、データセグメント及びBSSの始まる番地を設定す
ることが可能なプログラマブルアドレスデコーダー(Programmable Address Decoder)である。105は、複写済みエリア管理テーブル107の記憶済みエリア記憶ビット108に対応したアドレスがアクセスされた事を検出するためのAND(アンド)回路を複数有するAND回路群である。106は、アンド回路群105のAND回路のうち1つからでも信号が出力されたら出力するOR(オア)回路である。107は、未複写エリアかどうかを保持するビット群である、複写済みエリア管理テーブルである。なお、本実施形態の複写済みエリア管理テーブル107は、例えばプロセッサ101により、書き込み及び読み出しがなされるレジスタである。
Reference numeral 103 denotes an address latch that takes in an address when an uninitialized area is detected. Reference numeral 104 denotes a programmable address decoder that can set the address where the data segment and the BSS start. Reference numeral 105 denotes an AND circuit group including a plurality of AND circuits for detecting that an address corresponding to the stored area storage bit 108 of the copied area management table 107 is accessed. Reference numeral 106 denotes an OR circuit that outputs when a signal is output from one of the AND circuits of the AND circuit group 105. Reference numeral 107 denotes a copied area management table which is a bit group for holding whether or not the area is an uncopied area. Note that the copied area management table 107 of this embodiment is a register that is written and read by the processor 101, for example.

108は、複写済みエリア管理テーブル107の1つのエリアに対応した記憶済みエリア記憶ビットである。109は、特別なビットでありデータセグメント管理ユニット2302の機能を許可、又は不許可にするためのデータセグメント管理ユニットイネーブルビットである。110は、OR回路106から信号が出力されるとともに、データセグメント管理ユニットイネーブルビット109から、データセグメント管理ユニット2302の機能を許可するビットが出力されたときに出力するAND回路である。111は、データセグメント管理ユニットイネーブルビット109から出力されたビットを反転するNOT回路である。   Reference numeral 108 denotes a stored area storage bit corresponding to one area of the copied area management table 107. Reference numeral 109 denotes a special bit, which is a data segment management unit enable bit for enabling or disabling the function of the data segment management unit 2302. 110 is an AND circuit that outputs a signal when the OR circuit 106 outputs a signal and the data segment management unit enable bit 109 outputs a bit that permits the function of the data segment management unit 2302. Reference numeral 111 denotes a NOT circuit that inverts the bit output from the data segment management unit enable bit 109.

<ページ単位>
図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 RAM 1004. The RAM 1004 is divided into pages of 4K bytes, and each copied area storage bit 108 of the copied area management table 107 corresponds to the divided page. Therefore, for example, in order to manage an area of 800 Kbytes, a 200-bit latch is sufficient.

<複写済みエリア管理テーブル>
図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, reference numeral 201 denotes an address decoder (Address Decoder) that decodes an address for reading and writing bits from the processor (CPU) 101. Reference numeral 204 denotes a latch corresponding to the copied area storage bit 108 shown in FIG. 207 is a reset signal (/ RESET), 208 is a read strobe signal (RD), and 209 is a write strobe signal (WR). 202 outputs a write signal when both the write strobe signal 209 and the address decoder 201 become true so that the latch 204 corresponding to a specific address takes in the data D0 to D3 from the data bus 101. AND circuit. An AND circuit 203 outputs a read signal when both the read strobe signal 208 and the address decoder 201 become true, and outputs data Q0 to Q3 of the latch 204 corresponding to a specific address to the data bus 101. is there. Reference numeral 205 denotes a NOT circuit that inverts the output of the latch 204.

プロセッサ101が、32ビットのCPUの場合、データバス101は32ビットのため、一度に読み書き出来るビットは32個となる。この場合、アドレスデコーダ201の出力1つに対してアンド回路202、203と、32個のラッチ204が接続されることになる。それぞれのラッチ204の反転出力は、図24に示したアンド回路105に入力される。また、リセット時のラッチ204の値は0であり反転出力はハイになっている。   When the processor 101 is a 32-bit CPU, since the data bus 101 is 32 bits, 32 bits can be read and written at a time. In this case, AND circuits 202 and 203 and 32 latches 204 are connected to one output of the address decoder 201. The inverted output of each latch 204 is input to the AND circuit 105 shown in FIG. Further, the value of the latch 204 at the time of reset is 0, and the inverted output is high.

なお、本実施形態で処理されるプログラムの一例と、そのプログラムをコンパイルした結果のアッセンブラリストの一例は、それぞれ図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 segment management unit 2302 shown in FIG. 23 is set in step S2702. At this time, the management start address is set so that the data segment management unit 2302 is valid for both the data segment and BSS areas, and the uncopied area access detection function is enabled. Then, the C language is started in step S2703, the OS is started in step S2704, and the application program is started in step S2705.

<データセグメントのアクセス>
図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 program 1101 shown in FIG. 11 as an example. The application program is executed from the 103rd line of the program 1101 in FIG. The first valid line executed is line 105. The 105th line is a branching routine that executes the 106th line if the variable “fFirstAccess” is true, and executes the 108th line if the variable “fFirstAccess” is false. By executing this line, the value of the variable “fFirstAccess” declared in the 100th line is read. FIG. 28 is a diagram illustrating an example of a state where the variable “fFirstAccess” is addressed by the processor 1001. Since the bit of the copied area management table 107 corresponding to the variable “fFirstAccess” is not copied, the output of the AND circuit 110 in FIG. 24 becomes active, and the address of the variable “fFirstAccess” is recorded in the address latch 103. The Then, an NMI (non-maskable interrupt) signal 2801 is output to the processor 1001 shown in FIG. 23, and the NMI interrupt handler is activated.

<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 address latch 103 shown in FIG. 23 is checked in step S2902. Since the variable “fFirstAccess” described above is a variable in the data segment, the process branches to step S2903. In step S 2903, the initial value for 4 Kbytes of the page including the variable “fFirstAccess” is transferred from the address of the corresponding ROM 1003. FIG. 30 is a diagram illustrating an example of a state in which “TRUE”, which is an initial value, is transferred from the ROM 1003 to the RAM 1004 in the variable “fFirstAccess”.

そして、ステップ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 address latch 103 is a page in which 4K bytes of the page including the variable “fFirstAccess” includes both the data segment and the BSS, the process proceeds to step S2906, and the initial data segment is initialized. The value is transferred from the ROM 1003 to the RAM 1004, and the data in the BSS area is initialized to zero.
When the program 1101 shown in FIG. 11 advances to the 107th line, the variable “fFirstAccess” is accessed again. However, since the information in the copied area storage register shown in FIG. The interrupt handler will not occur again.

<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 program 1101 shown in FIG. 11 advances to the 109th line and accesses the variable “Count”, the NMI interrupt handler is started again, and the processing of the NMI interrupt hand and the like in FIG. 29 is executed. In this case, the address latched by the address latch 103 is a BBS area. Therefore, the process proceeds from step S2902 to step S2907. In step S2907, the 4K bytes of the page including the variable “Count” are initialized with all zeros. In step S2904, the information in the copied area management table 107 is updated, and control is returned to the original program in step S2905.

<バックグラウンド転送>
以上のように構成する事で、データセグメント転送とBSSの0クリアの待ち時間を省いてC言語のプログラム1101をスタートすることができる。そして、ユーザーアプリケーションを高速にスタートする事ができる。しかし、デジタルカメラとしてのスタートアップはユーザーアプリケーションが始まってからスタートする。
<Background transfer>
With the configuration described above, the C language program 1101 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の初期化を行う事で、要求時の転送のオーバーヘッドを極力減らす事が可能となる。   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 lens 1007 to the initial position, and reading file information from the memory card 1009. Therefore, by using these waiting times, it is possible to reduce the transfer overhead at the time of request as much as possible by transferring initial values to untransferred data segments and initializing uninitialized BSS. Become.

図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 program 1101 shown in FIG. 11, and the copied area storage bit 108 of the copied area management table 107 is not copied. If there is, the NMI interrupt handler process shown in FIG. 31 is activated, and the initial value is transferred from the ROM 1003 to the RAM 1004.

次に、ステップ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 ROM 1003 where the initial value of the data segment is stored to the area (RAM 1004) corresponding to the data segment is stored. If an access to an area in the data segment of the RAM 1004 that has not yet been copied from the ROM 103 is detected, the program being executed is interrupted, and the ROM 1003 to the RAM 1004 is interrupted in the processing of the NMI interrupt handler. After the data copy, the operation of copying the initial value of the data segment from the ROM 1003 to the RAM 1004 by updating the information in the copied area management table 107 and restarting the execution of the program is performed on demand (when requested). ) It was to perform a distributed manner.

これにより、従来はプログラムの実行前に必要だった全てのデータセグメントの初期化を、プログラムの実行の進行に従って必要な部分のみを分散して行う事が可能となり、起動からプログラム実行までのタイムラグを大幅に短縮する事が可能となる。   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 processor 1001 that is a CPU, and each copied area storage bit 108 is a block of a certain size starting from a specific address in the RAM 1004. It corresponds. When the output of the copied area management table 107 and the address bus 102 are monitored and it is detected that the address matches an uncopied area in the management information of the copied area management table 107, an exception such as NMI (non-maskable interrupt) is detected. A process is generated, and the detected address is automatically stored in a register that can be read and written by the processor 1001, which is a CPU. A software exception is that the program being executed is interrupted by the occurrence of this NMI exception, and after copying data from the ROM 1003 to the RAM 1004, the information in the copied area management table 107 is updated to resume the execution of the program. Since it is realized with a processing handler, a system can be constructed with a small circuit scale.

複写済みエリア管理テーブル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 processor 1001, which is a CPU, is in a waiting state, such as driving the lens 1007 and reading a file. Therefore, in this embodiment, when an idle state in which there is no valid program to be executed, data copy from the ROM 1003 to the RAM 1004 and information update in the copied area management table 107 are performed. Thereby, when the program accesses the data segment, the possibility that the copying from the ROM 1003 to the RAM 1004 has already been completed is improved, and the processing can be performed at a higher speed.

(本発明の他の実施形態)
上述した実施形態の機能を実現するべく各種のデバイスを動作させるように、該各種デバイスと接続された装置あるいはシステム内のコンピュータに対し、前記実施形態の機能を実現するためのソフトウェアのプログラムコードを供給し、そのシステムあるいは装置のコンピュータ(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.

本発明の第1の実施形態を示し、ページテーブルの概念の一例を示した図である。It is the figure which showed the 1st Embodiment of this invention and showed an example of the concept of a page table. 本発明の第1の実施形態を示し、デジタルカメラのハードウェア構成の一例を示した図である。It is the figure which showed the 1st Embodiment of this invention and showed an example of the hardware constitutions of a digital camera. 本発明の第1の実施形態を示し、デジタルカメラにおけるシステムが起動した直後のページングハードウェアと、ROMと、RAMの状態の一例を示した図である。FIG. 2 is a diagram illustrating an example of states of paging hardware, a ROM, and a RAM immediately after the system in the digital camera is activated according to the first embodiment of this invention. 本発明の第1の実施形態を示し、アプリケーションプログラムの一例であるソースコードを示した図である。It is the figure which showed the 1st Embodiment of this invention and showed the source code which is an example of an application program. 本発明の第1の実施形態を示し、関数CreateShadowの動作の一例を説明するフローチャートである。It is a flowchart which shows the 1st Embodiment of this invention and demonstrates an example of operation | movement of the function CreateShadow. 本発明の第1の実施形態を示し、関数CreateShadowの動作が終了した時点のページングハードウェアと、ROMと、RAMの状態の一例を示した図である。It is the figure which showed the 1st Embodiment of this invention and showed an example of the state of the paging hardware, ROM, and RAM when the operation | movement of the function CreateShadow was complete | finished. 本発明の第1の実施形態を示し、ページフォルト割り込み処理の一例を説明するフローチャートである。5 is a flowchart illustrating an example of a page fault interrupt process according to the first embodiment of this invention. 本発明の第1の実施形態を示し、ROMの該当ページの内容を、空きフレームにコピーした時点のページングハードウェアと、ROMと、RAMの状態の一例を示した図である。It is a figure showing a 1st embodiment of the present invention and showing an example of a state of paging hardware, ROM, and RAM at the time of copying contents of a corresponding page of a ROM to an empty frame. 本発明の第1の実施形態を示し、ページテーブルにフレームをアサインした時点のページングハードウェアと、ROMと、RAMの状態の一例を示した図である。It is the figure which showed the 1st Embodiment of this invention and showed an example of the state of the paging hardware at the time of assigning a frame to a page table, ROM, and RAM. 本発明の第1の実施形態を示し、ページメモリにフレームをアサインした時点のページングハードウェアと、ROMと、RAMの状態の一例を示した図である。It is a figure showing a 1st embodiment of the present invention and showing an example of a state of paging hardware, ROM, and RAM at the time of assigning a frame to page memory. 本発明の第2の実施形態を示し、C言語で書かれたプログラムの一例を示した図である。It is the figure which showed the 2nd Embodiment of this invention and showed an example of the program written in C language. 本発明の第2の実施形態を示し、アッセンブラリストの一例を示した図である。It is the figure which showed the 2nd Embodiment of this invention and showed an example of the assembler list. 本発明の第2の実施形態を示し、スタートアップする際の従来の動作を説明するフローチャートである。It is a flowchart which shows the 2nd Embodiment of this invention and demonstrates the conventional operation | movement at the time of start-up. 本発明の第2の実施形態を示し、スタートアップする際の動作の一例を説明するフローチャートである。It is a flowchart which shows the 2nd Embodiment of this invention and demonstrates an example of the operation | movement at the time of startup. 本発明の第2の実施形態を示し、変数領域のページテーブルに物理アドレスがアサインされていない様子を示す図である。It is a figure which shows the 2nd Embodiment of this invention and shows a mode that the physical address is not assigned to the page table of a variable area | region. 本発明の第2の実施形態を示し、ページフォルト割り込みによって動作するプログラムによる処理動作の一例を説明するフローチャートである。It is a flowchart which shows the 2nd Embodiment of this invention and demonstrates an example of the processing operation by the program which operate | moves by a page fault interruption. 本発明の第2の実施形態を示し、ROMに格納された変数の初期値がRAMの物理アドレスへ転送された様子の一例を示した図である。It is the figure which showed the 2nd Embodiment of this invention and showed an example of the mode that the initial value of the variable stored in ROM was transferred to the physical address of RAM. 本発明の第2の実施形態を示し、ページテーブルに物理空間アドレスが設定された様子の一例を示した図である。It is the figure which showed the 2nd Embodiment of this invention and showed an example of a mode that the physical space address was set to the page table. 本発明の第2の実施形態を示し、ページフォルトが発生した時点の様子の一例を示した図である。It is the figure which showed the 2nd Embodiment of this invention and showed an example of the mode when the page fault generate | occur | produced. 本発明の第2の実施形態を示し、物理メモリーをゼロ(0)に埋めた直後の様子の一例を示した図である。It is the figure which showed the 2nd Embodiment of this invention and showed an example immediately after a physical memory was filled with zero (0). 本発明の第2の実施形態を示し、ページテーブルを更新した直後の様子の一例を示した図である。It is the figure which showed the 2nd Embodiment of this invention and showed an example of the mode immediately after updating a page table. 本発明の第2の実施形態を示し、バックグラウンドで初期化を行うプログラムの動作の一例を説明するフローチャートである。It is a flowchart which shows the 2nd Embodiment of this invention and demonstrates an example of the operation | movement of the program which initializes in background. 本発明の第3の実施形態を示し、デジタルカメラのハードウェア構成の一例を示した図である。It is the figure which showed the 3rd Embodiment of this invention and showed an example of the hardware constitutions of a digital camera. 本発明の第3の実施形態を示し、データセグメント管理ユニットの構成を詳細に示したブロック図である。It is the block diagram which showed the 3rd Embodiment of this invention and showed the structure of the data segment management unit in detail. 本発明の第3の実施形態を示し、複写済みエリア記憶レジスタの構成の一例を概念的に示した図である。FIG. 10 is a diagram conceptually illustrating an example of a configuration of a copied area storage register according to the third embodiment of this invention. 本発明の第3の実施形態を示し、複写済みエリア記憶レジスタの構成の一例を詳細に示した図である。It is the figure which showed the 3rd Embodiment of this invention and showed an example of the structure of the copied area storage register in detail. 本発明の第3の実施形態を示し、スタートアップする際の動作の一例を説明するフローチャートである。It is a flowchart which shows the 3rd Embodiment of this invention and demonstrates an example of the operation | movement at the time of startup. 本発明の第3の実施形態を示し、プロセッサによって変数「fFirstAccess」がアドレッシングされている様子の一例を示した図である。It is the figure which shows the 3rd Embodiment of this invention and showed an example of a mode that the variable "fFirstAccess" is addressed by the processor. 本発明の第3の実施形態を示し、NMI割り込みハンドラの処理の一例を説明するフローチャートである。10 is a flowchart illustrating an example of processing of an NMI interrupt handler according to the third embodiment of this invention. 本発明の第3の実施形態を示し、変数「fFirstAccess」に初期値である「TRUE」がROMからRAMに転送された様子の一例を示した図である。FIG. 15 is a diagram illustrating an example in which “TRUE” that is an initial value of a variable “fFirstAccess” is transferred from the ROM to the RAM according to the third embodiment of this invention. 本発明の第3の実施形態を示し、複写済みエリア記憶レジスタの情報が更新された状態の様子の一例を示した図である。It is the figure which showed the 3rd Embodiment of this invention and showed an example of the mode of the state in which the information of the copied area storage register was updated. 本発明の第3の実施形態を示し、バックグラウンド処理の一例を説明するフローチャートである。It is a flowchart which shows the 3rd Embodiment of this invention and demonstrates an example of background processing.

符号の説明Explanation of symbols

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 data bus 102 address bus 103 address latch 104 programmable address decoder 105 AND circuit 106 OR circuit 107 copied area management table 108 stored area storage bit 109 data segment management unit enable bit 110 AND circuit 201 address decoder 202, 203 AND circuit 204 Latch 207 Reset signal 208 Read strobe signal 209 Write strobe signal 1001 Processor 1002 Paging hardware 1003 ROM
1004 RAM
1005 A / D converter 1006 CCD
1007 Lens 1008 Interface 1009 Memory card 1011 I / O interface 1010 Lens drive mechanism 2302 Data segment management unit

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.
前記変数の初期値が設定されたエリアにおける物理アドレスを、前記ページテーブルに設定する物理アドレス設定手段を有することを特徴とする請求項1又は2に記載の電子機器。   The electronic apparatus according to claim 1, further comprising a physical address setting unit that sets a physical address in an area in which the initial value of the variable is set in the page table. 前記初期化手段は、データセグメント領域及びBSS領域の物理アドレスが割り当てられない状態となるように前記ページテーブルを設定して前記ページテーブルを初期化することを特徴とする請求項1〜3の何れか1項に記載の電子機器。   The initialization section sets the page table so that physical addresses of the data segment area and the BSS area are not allocated, and initializes the page table. The electronic device of Claim 1. 前記変数設定手段は、前記物理アドレスが割り当てられていないエリアがBSS領域である場合には、そのエリアにおける変数の初期値として0を設定し、前記物理アドレスが割り当てられていないエリアがデータセグメント領域である場合には、所定の記憶媒体から変数の初期値を読み出し、読み出した初期値をそのエリアにおける変数の初期値として設定することを特徴とする請求項4に記載の電子機器。   When the area to which the physical address is not assigned is a BSS area, the variable setting means sets 0 as an initial value of a variable in the area, and the area to which the physical address is not assigned is a data segment area 5. The electronic device according to claim 4, wherein the initial value of the variable is read from a predetermined storage medium, and the read initial value is set as the initial value of the variable in the area. 前記プログラム実行手段は、プライオリティの低いタスクとして前記プログラムを実行することを特徴とする請求項1〜5の何れか1項に記載の電子機器。   The electronic apparatus according to claim 1, wherein the program execution unit executes the program as a task having a low priority. 第1の記録媒体に記録されたプログラムのデータを第2の記録媒体に複写して実行する電子機器であって、
前記第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の記録媒体の特定のアドレスから始まる一定サイズのブロックに対応し、
前記検出手段は、前記管理手段で管理されている前記第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.
前記管理手段により管理される第2の記録媒体のエリアを示すアドレスの開始番地と、前記検出手段により検出される対象となるアドレスの開始番地との少なくとも何れか一方は、可変であることを特徴とする請求項8に記載の電子機器。   At least one of the start address of the address indicating the area of the second recording medium managed by the management unit and the start address of the address to be detected by the detection unit is variable. The electronic device according to claim 8. 前記検出手段は、前記検出を停止させる検出停止手段を備え、
前記検出停止手段は、電源が切れている状態から電子機器が起動すると、前記検出を停止させることを特徴とする請求項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.
前記管理手段は、電源が切れている状態から起動すると、前記第2の記録媒体のエリアを、前記第1の記録媒体からの複写が行われていない未複写エリアに設定することを特徴とする請求項9又は10に記載の電子機器。   When the management unit is started from a power-off state, the management unit sets the area of the second recording medium to an uncopied area where copying from the first recording medium is not performed. The electronic device according to claim 9 or 10. 前記プログラムのうち、実行すべき有効なプログラムが存在しないアイドル状態を検出する状態検出手段を有し、
前記複写手段は、前記状態検出手段によりアイドル状態が検出されると、前記第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.
前記プログラムは、アプリケーションプログラムであることを特徴とする請求項1〜12の何れか1項に記載の電子機器。   The electronic device according to claim 1, wherein the program is an application program. プログラムの仮想アドレスと物理アドレスとをページ単位で管理するページテーブルを用いて、前記プログラムを実行するデータ処理方法であって、
前記プログラムに記述されている変数のエリアにおける物理アドレスが割り当てられない状態となるように前記ページテーブルを設定して前記ページテーブルを初期化する初期化ステップと、
前記初期化ステップによりページテーブルが初期化された後にプログラムを実行するプログラム実行ステップと、
前記プログラム実行ステップによりプログラムが実行されることによって、前記物理アドレスが割り当てられていないエリアにアクセスされると、そのエリアにおける変数の初期値を設定する変数設定ステップとを有することを特徴とするデータ処理方法。
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.
第1の記録媒体に記録されたプログラムのデータを第2の記録媒体に複写して実行するデータ処理方法であって、
前記第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.
第1の記録媒体に記録されたプログラムのデータを第2の記録媒体に複写して実行するに際し、
前記第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.
JP2007337935A 2004-12-24 2007-12-27 Digital camera, digital camera data processing method, and computer program Expired - Fee Related JP4732432B2 (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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