JP2008310460A - Control circuit, storage medium, processor, integrated system, and area management method - Google Patents

Control circuit, storage medium, processor, integrated system, and area management method Download PDF

Info

Publication number
JP2008310460A
JP2008310460A JP2007155932A JP2007155932A JP2008310460A JP 2008310460 A JP2008310460 A JP 2008310460A JP 2007155932 A JP2007155932 A JP 2007155932A JP 2007155932 A JP2007155932 A JP 2007155932A JP 2008310460 A JP2008310460 A JP 2008310460A
Authority
JP
Japan
Prior art keywords
domain
address
storage medium
program
control circuit
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
JP2007155932A
Other languages
Japanese (ja)
Other versions
JP4892414B2 (en
Inventor
Masatomo Ukeda
賢知 受田
Yoshinori Mochizuki
義則 望月
Shigemasa Shioda
茂雅 塩田
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.)
Renesas Technology Corp
Original Assignee
Renesas Technology Corp
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 Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP2007155932A priority Critical patent/JP4892414B2/en
Priority to PCT/JP2008/055940 priority patent/WO2008152846A1/en
Publication of JP2008310460A publication Critical patent/JP2008310460A/en
Application granted granted Critical
Publication of JP4892414B2 publication Critical patent/JP4892414B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • G06F21/77Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information in smart cards

Abstract

<P>PROBLEM TO BE SOLVED: To provide a control circuit for performing area management, such as exclusive control and sharing of an area in use among a plurality of applications to a storage medium, such as a flash memory, in addition to measurement against the cutoff of a power supply, and to provide an area management method. <P>SOLUTION: An address control circuit 130 sets a prescribed area of an EEPROM 140 as a domain and manages the domain and access requirements in the processor 120. The address control circuit 130 includes in the EEPROM 140: a domain setting register 133 for setting control information 151 for managing a domain; and a domain control register 131 for holding information on the domain to be processed now. Control information 151 is set in an address on the EEPROM 140 by using information in the domain setting register 133. Whether or not access by programs is permitted or rejected is determined based on the control information 151 set in the address and the information in a domain control register 131. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、消去および書き換え可能な記憶領域を持つ記憶媒体、特にフラッシュメモリなどの不揮発性記憶媒体の領域管理を行う制御回路、および前記制御回路を有する汎用または組込みシステム向け処理装置、および前記処理装置を有する組込みシステム、ならびに前記記憶媒体の領域管理方法に適用して有効な技術に関するものである。   The present invention relates to a control circuit that performs area management of a storage medium having an erasable and rewritable storage area, in particular, a nonvolatile storage medium such as a flash memory, a processing device for a general purpose or embedded system having the control circuit, and the processing The present invention relates to an embedded system having a device and a technique effective when applied to the storage medium area management method.

PCや組込みシステムで広く利用されているフラッシュメモリは、半導体メモリの一種で、通常、データがブロック単位で管理されている。従って、データの読み出し、書き込み、消去を行う際には、このデータブロック毎に処理が行われることになる。   A flash memory widely used in PCs and embedded systems is a kind of semiconductor memory, and data is usually managed in units of blocks. Therefore, when data is read, written, or erased, processing is performed for each data block.

また、フラッシュメモリは、データを書き込む際には、通常、消去状態から書き込みが行われ、仮に元のデータに上書きを行うと、元のデータと書き込むデータとのANDまたはORをとった結果がフラッシュメモリ上に書き込まれる。従って、データブロックの更新を行いたい場合には、そのブロックをいったん消去してから更新データを書き戻す処理や、別のデータブロックに新たに書き込み、その後元のデータブロックを消去する等の処理が必要になる。   In addition, when writing data, the flash memory is normally written from the erased state. If the original data is overwritten, the result of AND or OR between the original data and the written data is flashed. Written on memory. Therefore, if you want to update a data block, you need to erase the block and then write the update data back, or write to another data block and then erase the original data block. I need it.

しかし、データを消去している最中に電源遮断等が発生した場合に、書き戻すべきデータやそのアドレスに関する情報が失われ、正しく更新することができなくなるという問題がある。これはフラッシュメモリを利用したシステムを構築する上での課題の一つとなっており、特開2006−323499号公報(特許文献1)、特開2006−39983号公報(特許文献2)、特開2005−258851号公報(特許文献3)、特開2004−310477号公報(特許文献4)、特開2004−265162号公報(特許文献5)等に見られるように様々な解決手段が提案されている。   However, there is a problem in that when power is interrupted while data is being erased, the data to be written back and information on its address are lost and cannot be updated correctly. This is one of the problems in constructing a system using a flash memory. JP 2006-323499 A (Patent Document 1), JP 2006-39983 A (Patent Document 2), Various solution means have been proposed as seen in JP 2005-258851 A (Patent Document 3), JP 2004-310477 A (Patent Document 4), JP 2004-265162 A (Patent Document 5), and the like. Yes.

しかしこれら解決手段は、主にメモリカードやUSBメモリ等の、フラッシュメモリをデータストレージとして利用する場合に有効な技術であるが、近年のようにフラッシュメモリを組込みシステム向けCPUやICカードチップなどに組み込んで利用する現状においては、必ずしも適しているとはいえない。   However, these solutions are effective techniques mainly when using flash memory as data storage, such as a memory card or USB memory. However, in recent years, flash memory has been incorporated into CPUs and IC card chips for embedded systems. In the current situation of incorporating and using, it is not necessarily suitable.

組込みシステム向けCPUやICカードチップで、フラッシュメモリのようなデータをブロック単位で管理する消去および書き換え可能な不揮発性メモリが利用される場合には、大規模化する組込みシステム向けソフトウェアのために、従来のEEPROMよりも大容量かつ安価なデバイスとして利用されることになる。その際には、フラッシュメモリは単にデータを格納するためだけのデバイスとしてではなく、ROMやRAMの置き換えとしてプログラムの実行に使用するデバイスとして期待されることになる。
特開2006−323499号公報 特開2006−39983号公報 特開2005−258851号公報 特開2004−310477号公報 特開2004−265162号公報
When the erasable and rewritable non-volatile memory that manages data such as flash memory is used for embedded system CPUs and IC card chips, the software for embedded systems is becoming larger. It will be used as a device having a larger capacity and lower cost than the conventional EEPROM. In that case, the flash memory is expected not as a device for merely storing data, but as a device used to execute a program as a replacement of ROM or RAM.
JP 2006-323499 A JP 2006-39983 A Japanese Patent Laying-Open No. 2005-258851 JP 2004-310477 A JP 2004-265162 A

上記のような状況の中、組込みシステム向けCPUやICカードチップでフラッシュメモリを利用する場合は、上記のような電源遮断対策や、エラー訂正機能、書き換え回数の分散化など様々な技術が要求されることになっており、制御のためのソフトウェア、ハードウェアが肥大化する傾向にある。   Under these circumstances, when using a flash memory with an embedded system CPU or IC card chip, various technologies are required, such as measures for shutting down the power supply, error correction function, and distribution of the number of rewrites. Therefore, software and hardware for control tend to be enlarged.

また、このような記憶媒体としての可用性の確保という課題の他に、セキュリティ的にも考慮すべき課題が存在する。従来の組込みシステム向けCPUやICカードチップは、主に特定の用途で利用されることが主であったため、最低限のハードウェアリソース上で単一のアプリケーションが実行されるような場合がほとんどだった。しかしながら組込みシステムの複雑化や、ICカードの多目的用途への利用など、システムに対する要求は高まっており、組込みシステム向けCPUやICカードチップは、複数のアプリケーションが同時に動作するような場合についても考慮する必要が生じてきた。   In addition to the problem of ensuring availability as such a storage medium, there is a problem to be considered in terms of security. Conventional CPUs and IC card chips for embedded systems are mainly used for specific purposes, and in most cases, a single application is executed on the minimum hardware resources. It was. However, there are increasing demands on systems such as the complexity of embedded systems and the use of IC cards for multipurpose purposes, and the CPU and IC card chip for embedded systems also take into consideration the case where multiple applications operate simultaneously. The need has arisen.

通常、これらのアプリケーションは組込みシステム向けCPUやICカードチップ上で動作するOSにより排他的または協調的にシステムリソースを共有できるように制御することが期待されているが、消費電力や価格における性能的リソースに対する制限が厳しい組込みシステム向けCPUやICカードチップにおいては、複雑なソフトウェア処理を導入することができない場合が多い。しかしながら組込みシステム向けCPUやICカードチップにおけるセキュリティを考える上で、より低コストにハードウェアリソースの排他制御を可能にする仕組みは、システムの安全性を考慮する上で重要な課題である。   Normally, these applications are expected to be controlled so that system resources can be shared exclusively or cooperatively by an OS running on a CPU or IC card chip for an embedded system. In many cases, CPUs and IC card chips for embedded systems, which have severe resource restrictions, cannot introduce complex software processing. However, considering the security of CPUs and IC card chips for embedded systems, a mechanism that enables exclusive control of hardware resources at a lower cost is an important issue when considering system safety.

そこで、本発明の目的は、組込みシステム向けCPUやICカードチップにおいて用いられるフラッシュメモリなどの記憶媒体に対して、可用性を確保するための電源遮断対策などに加えて、複数のアプリケーション間で使用領域の排他制御や共用などの領域管理を行う制御回路、および前記制御回路を有する汎用または組込みシステム向け処理装置、および前記処理装置を有する組込みシステム、ならびに前記記憶媒体の領域管理方法を提供することにある。   Therefore, an object of the present invention is to provide a use area between a plurality of applications in addition to a power shutdown measure for ensuring availability of a storage medium such as a flash memory used in a CPU or IC card chip for an embedded system. To provide a control circuit that performs area management such as exclusive control and sharing, a processing device for a general-purpose or embedded system having the control circuit, an embedded system having the processing apparatus, and an area management method for the storage medium is there.

本発明の前記ならびにその他の目的と新規な特徴は、本明細書の記述および添付図面から明らかになるであろう。   The above and other objects and novel features of the present invention will be apparent from the description of this specification and the accompanying drawings.

本願において開示される発明のうち、代表的なものの概要を簡単に説明すれば、次のとおりである。   Of the inventions disclosed in the present application, the outline of typical ones will be briefly described as follows.

本発明は、CPUと、消去および書き換え可能な記憶媒体とを有する処理装置において、該記憶媒体の所定の領域をドメインとして設定し、前記ドメインの管理およびプログラムが前記ドメインを利用する際のアクセス要件の管理を行う制御回路および領域管理方法であって、前記制御回路は、前記記憶媒体に前記ドメインの管理のための制御情報を設定するための第1のレジスタと、現在の処理対象である前記ドメインについての情報を保持する第2のレジスタとを有し、前記第1のレジスタの情報を用いて、前記記憶媒体上のアドレスに対して、該アドレスに割り当てられたデータ領域が属する前記ドメインについての前記制御情報を設定し、プログラムによる前記記憶媒体上のアドレスに割り当てられたデータ領域へのアクセスの際に、該アドレスに設定されている前記制御情報と、前記第2のレジスタの情報とに基づいて、該アクセスの可否を判断することを特徴とするものである。   The present invention provides a processing apparatus having a CPU and a erasable and rewritable storage medium, setting a predetermined area of the storage medium as a domain, and managing the domain and access requirements when the program uses the domain A control circuit and a region management method for managing a first register for setting control information for managing the domain in the storage medium, and the current processing target A second register for holding information about the domain, and using the information in the first register, the domain to which the data area assigned to the address belongs to the address on the storage medium The control information is set and the program accesses the data area assigned to the address on the storage medium. And the control information set to the address, based on the information of the second register, and is characterized in that to determine whether the said access.

本願において開示される発明のうち、代表的なものによって得られる効果を簡単に説明すれば以下のとおりである。   Among the inventions disclosed in the present application, effects obtained by typical ones will be briefly described as follows.

本発明によれば、組込みシステム向けCPUやICカードチップなどにおいて、フラッシュメモリなどの記憶媒体をアプリケーションの実行に使用する場合、アプリケーションが、自身では設定変更等ができない個別の領域であるドメイン上でのみ動作することが可能となるため、あるアプリケーションの不正動作により、他のドメイン上のデータが破壊されたり、不正にアクセスされたりするおそれなく稼動することが可能となる。   According to the present invention, when a storage medium such as a flash memory is used for execution of an application in a CPU or IC card chip for an embedded system, the application is on a domain that is an individual area where the setting cannot be changed by itself. Therefore, it is possible to operate without fear that data on another domain is destroyed or illegally accessed due to an unauthorized operation of an application.

また、仮想アドレスやデータ領域の多重化の仕組みを組み合わせることにより、電源遮断などの障害に対する可用性の確保も可能となる。   In addition, by combining a mechanism for multiplexing virtual addresses and data areas, it is possible to ensure availability against failures such as power interruption.

以下、本発明の実施の形態を図面に基づいて詳細に説明する。なお、実施の形態を説明するための全図において、同一部には原則として同一の符号を付し、その繰り返しの説明は省略する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. Note that components having the same function are denoted by the same reference symbols throughout the drawings for describing the embodiment, and the repetitive description thereof will be omitted.

図1は、本発明の一実施の形態である処理装置、および当該処理装置に接続された記憶媒体の構成を表す図である。ICカード100は、入出力IF110と処理装置120とを有する構成となっている。ここでICカード100は、本発明の対象となる組込みシステムの代表的な一例であり、その形状、外部装置とのインタフェースの仕様、処理装置120の種類や、他の装置の有無などにより種々の組込みシステムに適用することができる。   FIG. 1 is a diagram illustrating a configuration of a processing apparatus according to an embodiment of the present invention and a storage medium connected to the processing apparatus. The IC card 100 has an input / output IF 110 and a processing device 120. Here, the IC card 100 is a typical example of an embedded system that is a subject of the present invention, and there are various types depending on its shape, specifications of an interface with an external device, the type of the processing device 120, the presence or absence of other devices, and the like. It can be applied to embedded systems.

入出力IF110は、ISO7816で規格化された物理的、電気的特性を有し、また同規格で定められたメッセージフォーマットでコマンドおよびデータの送受信を行うインタフェースである。組込みシステムにおける入出力IF110に相当するインタフェースはこれに限定される必要はなく、USB(Universal Serial Bus)やMMC(MultiMedia Card)、ATA(AT Attachment)等の規格に準拠したものや、PCI等の装置内のバスや、ISO14443で規格化されている非接触ICカードインタフェースやBluetooth、無線LAN等の物理的な端子を持たないインタフェースであってもよい。   The input / output IF 110 has physical and electrical characteristics standardized by ISO7816, and is an interface that transmits and receives commands and data in a message format defined by the standard. The interface corresponding to the input / output IF 110 in the embedded system does not need to be limited to this, and is compliant with standards such as USB (Universal Serial Bus), MMC (MultiMedia Card), ATA (AT Attachment), PCI, etc. An interface having no physical terminal such as a bus in the apparatus, a non-contact IC card interface standardized by ISO 14443, Bluetooth, or wireless LAN may be used.

入出力IF110は、VCC線111、リセット信号線(図中ではRSTと表記)112、クロック信号線(図中ではCLKと表記)113、GND線114、入出力線(図中ではI/Oと表記)115により処理装置120と接続されている。   The input / output IF 110 includes a VCC line 111, a reset signal line (denoted as RST in the figure) 112, a clock signal line (denoted as CLK in the figure) 113, a GND line 114, an input / output line (denoted as I / O in the figure). (Notation) 115 is connected to the processing device 120.

処理装置120は、入出力IF110の制御回路であるUART制御回路121と、CPU122、RAM123、ROM124、コプロセッサ125、アドレス制御回路130を有し、これらは内部バス126により接続されている。またこの他にEEPROM140を有し、EEPROM140はアドレス制御回路130に接続される構成をとる。   The processing device 120 includes a UART control circuit 121 that is a control circuit for the input / output IF 110, a CPU 122, a RAM 123, a ROM 124, a coprocessor 125, and an address control circuit 130, which are connected by an internal bus 126. In addition, an EEPROM 140 is provided, and the EEPROM 140 is connected to the address control circuit 130.

処理装置120は、組込みシステムにおける処理装置群の代表例であり、これらの装置が1チップにモジュール化されていても、一つまたは複数のモジュールが別チップとして構成されていても、またそのような構成をとることにより各チップが複数のバスで接続されていてもよい。またEEPROM140は、フラッシュメモリに限らず、FeRAM、MRAM等の他の素子から構成されるデバイスであっても良く、またHDDのような磁気媒体であってもよい。またフラッシュメモリについても、NAND型、AND型、NOR型などの違いに依存しない。   The processing device 120 is a representative example of a processing device group in an embedded system. Even if these devices are modularized on one chip, one or a plurality of modules are configured as separate chips, and so on. By adopting a simple configuration, each chip may be connected by a plurality of buses. The EEPROM 140 is not limited to a flash memory, and may be a device composed of other elements such as FeRAM and MRAM, or may be a magnetic medium such as an HDD. Further, the flash memory does not depend on the difference between the NAND type, the AND type, the NOR type, and the like.

ここでEEPROM140が、ある物理アドレスに対応したデータブロックの単位で読み出し、書き込み、消去を行うような、消去および書き換え可能な不揮発性記憶媒体である場合、EEPROM140上のデータブロック141は、当該データブロック141に割り当てられた制御情報151とデータ領域152とを有する。   Here, when the EEPROM 140 is an erasable and rewritable nonvolatile storage medium that performs reading, writing, and erasing in units of data blocks corresponding to a certain physical address, the data block 141 on the EEPROM 140 is the data block. 141 includes control information 151 and a data area 152 assigned to 141.

制御情報151は、データブロック141の消去が指定された場合には消去操作の対象になってもよいが、アプリケーション等からデータブロック141にアクセスする際の読み出しと書き込みの対象にはならず、制御情報151の読み出しおよび書き込みは、後述するアドレス制御回路130が管理するレジスタを用いて行うことになる。制御情報151は、アドレスで参照される1バイトのデータ毎に割り当てられてもよいが、数KBからなるデータブロックや、数十KBからなるデータブロックを纏めたページブロック毎に割り当てられていてもよい。   The control information 151 may be an object of an erase operation when the data block 141 is designated to be erased, but is not an object of reading and writing when the data block 141 is accessed from an application or the like. Information 151 is read and written using a register managed by an address control circuit 130 described later. The control information 151 may be assigned for each 1-byte data referred to by an address, or may be assigned for each page block in which a data block consisting of several KB or a data block consisting of several tens of KB is collected. Good.

アドレス制御回路130は、EEPROM140のドメイン管理を行うためのモジュールであり、ドメイン制御レジスタ131、仮想アドレス空間レジスタ132、ドメイン設定レジスタ133を有する。ここで、ドメインとは、アプリケーションが利用するEEPROM140上の個別の領域であり、原則として当該アプリケーション以外はアクセス等することができず、また、当該アプリケーション自身によっては設定変更等ができない領域のことを指す。ドメインの詳細については後述する。   The address control circuit 130 is a module for performing domain management of the EEPROM 140, and includes a domain control register 131, a virtual address space register 132, and a domain setting register 133. Here, the domain is an individual area on the EEPROM 140 used by the application, and as a general rule, an area other than the application cannot be accessed, and a setting cannot be changed by the application itself. Point to. Details of the domain will be described later.

アドレス制御回路130は、EEPROM140からの読み出し、書き込み、消去、プロテクト状態の管理、処理中の割り込み制御、アドレススクランブル、暗復号処理、エラー検知等の制御を行うためのモジュールを拡張したものであり、これらのモジュールの代りに実装されるものではなく、またこれらのモジュールの働きを制限するものでもない。また、アドレス制御回路130は、論理回路であってもよいが、CPUを含む構成や、処理により内部構成が変更可能なリコンフィギュアラブルな論理回路であってもよい。   The address control circuit 130 is an extension of a module for performing control such as reading from, writing to, deleting from the EEPROM 140, management of the protection state, interrupt control during processing, address scrambling, encryption / decryption processing, error detection, It is not implemented in place of these modules, nor does it limit the operation of these modules. The address control circuit 130 may be a logic circuit, but may be a configuration including a CPU or a reconfigurable logic circuit whose internal configuration can be changed by processing.

ドメイン制御レジスタ131は、EEPROM140上のドメインへのアクセスを行う前に設定されるレジスタであり、現在処理中のドメインのドメイン番号134、アクセス種別135等が格納される。アクセス種別135は、CPU122がEEPROM140上のドメインに対して行う、読み出し、書き込み、消去といった操作に関する情報であり、プログラムカウンタの値、ドメイン番号134、後述するドメイン番号153に基づく判断により可能な場合には、現在実行中のアプリケーションから設定することができるレジスタである。   The domain control register 131 is a register that is set before accessing the domain on the EEPROM 140, and stores the domain number 134, the access type 135, and the like of the domain currently being processed. The access type 135 is information relating to operations such as reading, writing, and erasing performed by the CPU 122 on the domain on the EEPROM 140, and can be determined by judgment based on the value of the program counter, the domain number 134, and the domain number 153 described later. Is a register that can be set from the currently executing application.

アドレス制御回路130は、EEPROM140上のドメインへのアクセスが発生した場合に、アクセス種別135と後述のドメイン種別フラグ156とに基づいて、指定されたアクセス種別135の内容が、対象のドメインのドメイン種別フラグ156に設定されているアクセスの要件を満たしているかどうかを判断する。この判断を、汎用的な処理を実行するCPU122に行わせないことにより、EEPROM140への不正アクセスを防止できるという効果を持つ。   When an access to a domain on the EEPROM 140 occurs, the address control circuit 130 determines that the content of the specified access type 135 is based on the access type 135 and a domain type flag 156 (to be described later). It is determined whether the access requirement set in the flag 156 is satisfied. By not making this determination to the CPU 122 that executes general-purpose processing, it is possible to prevent unauthorized access to the EEPROM 140.

ドメイン番号134は、あるドメインへ制御が受け渡される際に設定される値であり、現在処理中のドメイン自身と、当該ドメインの子ドメインの番号のみを設定することができる。アプリケーションがドメイン制御レジスタ131のドメイン番号134を変更する際に、現在のプログラムカウンタが参照しているEEPROM140上のアドレスに対応する制御情報151を読み出し、その中のドメイン番号153を参照する。ドメインおよびドメイン番号153の番号体系は、後述するように階層化されており、参照したドメイン番号153の値は、設定を変更しようとしているアプリケーションが格納されているドメインのドメイン番号であることから、ドメイン制御レジスタ131のドメイン番号134に設定された値と比較することでその関係を調べることができる。   The domain number 134 is a value set when control is transferred to a certain domain, and only the number of the domain currently being processed and the child domain of the domain can be set. When the application changes the domain number 134 of the domain control register 131, the control information 151 corresponding to the address on the EEPROM 140 referred to by the current program counter is read, and the domain number 153 therein is referred to. The numbering system of the domain and the domain number 153 is hierarchized as described later, and the value of the referenced domain number 153 is the domain number of the domain in which the application whose setting is to be changed is stored. The relationship can be examined by comparing with the value set in the domain number 134 of the domain control register 131.

例えばドメイン番号153が12bitの値を持ち、4bit毎に上位階層から順に1番目の階層のドメイン、2番目の階層のドメイン、3番目の階層のドメインを表す値として割り当てられている場合、ドメイン番号153が110hであれば、ドメイン番号134として設定可能な値は110hと、111h〜11Fhまでとなり、これ以外の値が設定された場合はエラーとなる。なお、ドメインの関係を判断する方式としてはこれに限定される必要はなく、アドレス制御回路130がドメインの関係を格納するテーブルを持ち、このテーブルの対応関係を元に判断する仕組みであってもよい。   For example, if the domain number 153 has a value of 12 bits and is assigned as a value representing the domain of the first layer, the domain of the second layer, the domain of the third layer in order from the upper layer every 4 bits, the domain number If 153 is 110h, the values that can be set as the domain number 134 are 110h and 111h to 11Fh. If any other value is set, an error occurs. Note that the method for determining the domain relationship is not limited to this, and the address control circuit 130 may have a table for storing the domain relationship and determine based on the correspondence relationship of this table. Good.

仮想アドレス空間レジスタ132は、EEPROM140上のドメインによるアドレス空間を、別のEEPROM140のように見せかけるための仮想アドレス空間を実現するためのレジスタであり、開始アドレスと終端アドレスが格納される。   The virtual address space register 132 is a register for realizing a virtual address space for making an address space by a domain on the EEPROM 140 look like another EEPROM 140, and stores a start address and an end address.

Java(登録商標)のような仮想アドレス上でプログラムを実行するOSにより組込みシステムが制御されている場合、JavaVMによるEEPROM140上のアドレスの動的な変換は、大きなオーバーヘッドになる。従って、EEPROM140上に形成されたアプリケーション毎に独立なドメインを別のEEPROM140のように見せかけ、個別のアドレス空間を持たせることができれば、物理アドレスが複雑に分散していても、そのことをOSが考慮する必要がなくなり、性能向上が見込めるという利点がある。特にEEPROM140の電源遮断対策やエラーブロックの代替処理を考慮する場合、論理アドレスと物理アドレスを一致させて管理することが難しくなるため、その効果はより大きくなる。   When the embedded system is controlled by an OS that executes a program on a virtual address such as Java (registered trademark), the dynamic conversion of the address on the EEPROM 140 by Java VM becomes a large overhead. Therefore, if an independent domain for each application formed on the EEPROM 140 looks like another EEPROM 140 and has an individual address space, even if the physical addresses are complicatedly distributed, the OS can There is no need to consider, and there is an advantage that performance improvement can be expected. In particular, when taking measures against power shutdown of the EEPROM 140 and error block substitution processing, it is difficult to manage the logical address and the physical address in a consistent manner, so that the effect becomes greater.

仮想アドレス空間レジスタ132は、制御情報151に格納されている後述するドメイン内アドレス155を読み出し、物理アドレスと仮想アドレスとのアドレス変換をハードウェア的に行う際に用いる仕組みである。仮想アドレス空間を使用しないためアドレス変換を行わない場合や、RAM123上にテーブルを持ち、CPU122がアドレス変換を行うような場合は有しなくてもよい。   The virtual address space register 132 is a mechanism used when reading an intra-domain address 155 (to be described later) stored in the control information 151 and performing address conversion between a physical address and a virtual address in hardware. If the address translation is not performed because the virtual address space is not used, or if a table is provided on the RAM 123 and the CPU 122 performs the address translation, it may not be necessary.

ドメイン設定レジスタ133は、EEPROM140にデータを書き込む際に制御情報151として設定される値を保持する。通常、ドメイン設定レジスタ133は、EEPROM140の読み出しを行った際に、読み出したデータブロック141の制御情報151の内容によって自動的に更新されるため、あるデータブロック141に対して同じ制御情報151を書き込む場合は、一度読み出しを行った後に書き込みを行えばよい。   The domain setting register 133 holds a value set as the control information 151 when writing data to the EEPROM 140. Normally, when the EEPROM 140 is read, the domain setting register 133 is automatically updated according to the contents of the control information 151 of the read data block 141, so the same control information 151 is written to a certain data block 141. In such a case, the data may be written after reading once.

新しいドメインの生成などを行う際は、ドメイン設定レジスタ133に適切な情報を設定する必要があるが、その際には自分自身のドメインか、自分の子ドメインの情報のみ指定することができる。なお、後述する仮想アドレスによる運用を行っている場合には、自分自身のドメインについての制御情報151の変更を制限してもよい。これは仮想アドレスによるアドレス空間の制御を行っている場合には、親ドメインから割り当てられた仮想アドレスを子ドメインが変更すると障害の原因になるためである。   When generating a new domain or the like, it is necessary to set appropriate information in the domain setting register 133. In this case, only the information of its own domain or its own child domain can be specified. In addition, when the operation | movement by the virtual address mentioned later is performed, you may restrict | limit the change of the control information 151 about own domain. This is because when the address space is controlled by the virtual address, if the child domain changes the virtual address assigned from the parent domain, it causes a failure.

また、制御情報151として、自分自身のドメインの仮想アドレスと、自分の子ドメインのための仮想アドレスのように2つ以上の仮想アドレスを有するような構成をとることも可能であり、この場合は子ドメイン用の仮想アドレスを変更できるようにしてもよい。そうでない場合は、親ドメインから仮想アドレス空間で制御された子ドメインは、個別の仮想アドレス空間を持つ子ドメインを生成できない。アドレス制御回路130はこれらの情報を用いてEEPROM140へのアクセスが適切であるかどうかを判断する。   In addition, the control information 151 can be configured to have two or more virtual addresses such as a virtual address of its own domain and a virtual address for its child domain. The virtual address for the child domain may be changed. Otherwise, the child domain controlled by the virtual address space from the parent domain cannot generate a child domain having an individual virtual address space. The address control circuit 130 uses these pieces of information to determine whether access to the EEPROM 140 is appropriate.

制御情報151は、ドメイン番号153、制御条件フラグ154、ドメイン内アドレス155から構成される。ここで、ドメイン番号153は、EEPROM140上の対象となるアドレスに割り当てられたデータ領域152が属するドメイン番号が格納される。また、制御条件フラグ154は、対象となるアドレスに対して指定されたドメインの制御条件を記載したフラグであり、ドメイン種別フラグ156、仮想アドレス運用フラグ157、裏アドレスフラグ158を有する。   The control information 151 includes a domain number 153, a control condition flag 154, and an intra-domain address 155. Here, the domain number 153 stores the domain number to which the data area 152 assigned to the target address on the EEPROM 140 belongs. The control condition flag 154 is a flag that describes the control conditions of the domain designated for the target address, and includes a domain type flag 156, a virtual address operation flag 157, and a back address flag 158.

ドメイン種別フラグ156は、ドメインへのアクセスの種類が格納され、例えば、読み出し可、読み出し・書き換え可、アクセス禁止の3つの状態が設定される。これらは、主に子ドメインからのアクセスに対するアクセスの可否を表すものであるが、フラグに割り当てるビット数を増やし、下位の全ドメインからのアクセスを許可したり、直下の子ドメインからのアクセスのみ許可したり、同じ親ドメインに属するドメインからのアクセスを許可したりなど、条件に応じて種々のアクセスの可否を設定することもできる。   The domain type flag 156 stores the type of access to the domain, and for example, three states of read enable, read / rewrite enable, and access prohibition are set. These mainly indicate whether access from the child domain is possible, but increase the number of bits assigned to the flag, permit access from all lower domains, or allow access from the immediate child domain. It is also possible to set whether to allow various accesses according to conditions such as permitting access from domains belonging to the same parent domain.

ドメイン種別フラグ156に読み出し可が設定された領域は、設定された条件に基づき、アクセスが可能となる。これは親ドメインに存在する共有ライブラリにアクセスする際などに利用することができる。同様に、読み出し・書き換え可が設定された領域は、読み出しおよび書き換えが可能になる。これは各アプリケーション間でデータを共有したい場合などに用いることができる。アクセス禁止が設定された領域は、上述のような親ドメインではないドメインからのアクセスが禁止される。   An area in which read permission is set in the domain type flag 156 can be accessed based on the set condition. This can be used to access a shared library that exists in the parent domain. Similarly, an area for which read / rewrite is set can be read and rewritten. This can be used when it is desired to share data between applications. In an area where access prohibition is set, access from a domain other than the parent domain as described above is prohibited.

仮想アドレス運用フラグ157は、ドメイン内でアプリケーション用にアドレス空間を割り当てるためのもので、このフラグが設定されている場合、対象のデータブロック141は、アプリケーションが各論理アドレスに対してアクセスする際に、ドメイン内アドレス155に記載されたアドレスであるかのように振る舞う。裏アドレスフラグ158は、前述の仮想アドレスによる運用が行われている場合で、データ領域152の多重化のために物理アドレスを重複して管理する場合において、どのアドレスに最新のデータが格納されているかを指し示すフラグである。   The virtual address operation flag 157 is for allocating an address space for an application in the domain. When this flag is set, the target data block 141 is used when the application accesses each logical address. It behaves as if it is an address described in the intra-domain address 155. The back address flag 158 indicates the address at which the latest data is stored in the case where the above-described virtual address is used and the physical address is duplicated for the purpose of multiplexing the data area 152. It is a flag indicating whether or not.

ドメイン内アドレス155は、仮想アドレス運用フラグ157を有効に設定することにより、仮想アドレスと物理アドレスとの間のアドレス変換が行われる場合に、対象の物理アドレスが論理的に指し示す仮想アドレスを格納するものである。仮想アドレスによる運用を必要としない場合は、制御条件フラグ154の中の仮想アドレス運用フラグ157、裏アドレスフラグ158、並びにドメイン内アドレス155のための領域は割り当てられなくてもよい。   The intra-domain address 155 stores the virtual address logically pointed to by the target physical address when address conversion between the virtual address and the physical address is performed by setting the virtual address operation flag 157 to be valid. Is. When the operation using the virtual address is not required, the virtual address operation flag 157, the back address flag 158, and the area for the intra-domain address 155 in the control condition flag 154 may not be allocated.

以上に述べた構成により、アドレス制御回路130は、アドレス制御回路130内の上記各レジスタの情報と、各データ領域152に割り当てられた制御情報151とを用いることで、電源遮断や不正なコードが実行された場合でも、ドメイン毎に相互干渉することなくEEPROM140の制御を行うことを可能にし、かつ、OSからは柔軟に各ドメインの設定の変更を可能にする。   With the configuration described above, the address control circuit 130 uses the information of each register in the address control circuit 130 and the control information 151 assigned to each data area 152, so that the power shutdown or illegal code can be detected. Even when executed, the EEPROM 140 can be controlled without interfering with each other for each domain, and the setting of each domain can be flexibly changed from the OS.

なお、制御情報151の格納位置は、データ領域152の先頭ではなく、末尾、他のデータブロック、別のメモリ上などに格納されていても構わない。また、制御情報151中のデータの並び順や、個々のデータサイズについても、図1に示した順序等に限られるものではない。   The storage location of the control information 151 may be stored not at the beginning of the data area 152 but at the end, another data block, another memory, or the like. Further, the arrangement order of data in the control information 151 and the individual data sizes are not limited to the order shown in FIG.

最近の組込みシステムでは、様々なソフトウェアモジュールが組み込まれ、それらを組込みシステム向けCPUのためのリアルタイムOSが制御するような構成をとるものが多い。携帯電話、車、HDDレコーダなどの装置がこれに該当する。また複数のアプリケーションが搭載されたICカードやSIMカード等も同様である。これらの各ソフトウェアモジュールは、別の工程で作成された後にシステムに組み込まれて動作するが、あるソフトウェアモジュールのバグや、ソフトウェアモジュールとOSとの間の設定の問題により、他のソフトウェアモジュールやOSに影響がおよび、システムが停止したり重要な情報が漏洩するなどの問題が起こり得る。   In recent embedded systems, various software modules are incorporated, and many of them are configured to be controlled by a real-time OS for an embedded system CPU. This includes devices such as mobile phones, cars, HDD recorders, and the like. The same applies to IC cards, SIM cards, and the like on which a plurality of applications are mounted. Each of these software modules is created and operated in a system after being created in a separate process. However, due to a bug in a certain software module or a problem in setting between the software module and the OS, another software module or OS May cause problems such as system shutdown or leakage of important information.

しかしながらソフトウェアモジュールやOSが独立に動作しながらも連携することを考慮すると、単純なアクセス制限だけのファイアーウォールでは十分ではない。特に、将来的にEEPROM140が非常に高速かつ長寿命化した場合、ROM124やRAM123の代りにEEPROM140だけでシステムが設計されることが考えられる。その場合に、EEPROM140のドメイン管理が求められることになる。   However, considering that software modules and OSs operate independently but cooperate, a firewall with only simple access restrictions is not sufficient. In particular, when the EEPROM 140 becomes very fast and has a long life in the future, it is conceivable that the system is designed only with the EEPROM 140 instead of the ROM 124 and the RAM 123. In that case, domain management of the EEPROM 140 is required.

以下に、アドレス制御回路130が、アドレス制御回路130内の各レジスタの情報と制御情報151とを用いて、EEPROM140のドメイン管理を行う際の概要について説明する。   The outline when the address control circuit 130 performs domain management of the EEPROM 140 using the information of each register in the address control circuit 130 and the control information 151 will be described below.

EEPROM140はドメインにより階層構造で管理され、対象のデータブロック141がどのドメインに属しているかの情報はドメイン番号153に格納される。OSの動作まで含めた組込みシステムでのEEPROM140の利用を想定する場合、通常、一つのアプリケーションが利用できるEEPROM140のアドレス空間は、OSによって割り当てられる。   The EEPROM 140 is managed in a hierarchical structure by domain, and information on which domain the target data block 141 belongs to is stored in the domain number 153. When the use of the EEPROM 140 in an embedded system including the operation of the OS is assumed, the address space of the EEPROM 140 that can be used by one application is usually allocated by the OS.

OSは、ROM124またはEEPROM140に予め格納されており、通常は、ICカード100の発行後に、OSに対して動的にドメインが割り当てられることがないことから、OSに対して割り当てられるドメイン番号には0が割り当てられる。このように、ドメイン番号が0であるドメインはルートドメインとして動作し、唯一自分自身以外のドメインからは設定の変更ができないドメインになる。   The OS is stored in advance in the ROM 124 or the EEPROM 140, and normally, after the IC card 100 is issued, the domain is not dynamically assigned to the OS. 0 is assigned. As described above, the domain whose domain number is 0 operates as a root domain, and is the only domain in which settings cannot be changed from a domain other than itself.

図2は、本実施の形態におけるドメインの階層構造およびEEPROM140の領域との関係の例を表した図である。図2におけるドメイン#0(200)は、ルートドメインであり、通常はOSが管理するドメインとなる。このドメイン番号の情報は、対象となるEEPROM140内のアドレス空間#0(250)のドメイン番号153に格納される。図2の例では、EEPROM140全体がルートドメインに属している場合を表しているが、このアドレス空間は必ずしも一塊である必要はなく、EEPROM140内に偏在していても構わない。   FIG. 2 is a diagram showing an example of the relationship between the domain hierarchical structure and the area of EEPROM 140 in the present embodiment. Domain # 0 (200) in FIG. 2 is a root domain and is usually a domain managed by the OS. This domain number information is stored in the domain number 153 of the address space # 0 (250) in the target EEPROM 140. In the example of FIG. 2, the entire EEPROM 140 belongs to the root domain. However, this address space does not necessarily have to be a single block, and may be unevenly distributed in the EEPROM 140.

このような構成のICカード100に対して新しいアプリケーションの追加を行うとき、OSは当該アプリケーションのために新規ドメインの作成を行う。ドメイン#0(200)を親として生成される新ドメインには、自ドメイン番号として使われていないドメイン番号が割り当てられる。ドメイン#1(210)、ドメイン#2(220)、ドメイン#3(230)はこのようにして作成されたドメインである。   When a new application is added to the IC card 100 having such a configuration, the OS creates a new domain for the application. A domain number that is not used as its own domain number is assigned to a new domain generated with domain # 0 (200) as a parent. Domain # 1 (210), domain # 2 (220), and domain # 3 (230) are domains created in this way.

ここで、アドレス空間#2(270)に割り当てられたドメイン#2(220)を例にとれば、このアドレス空間#2(270)に格納されたアプリケーションは、アドレス空間#2(270)内で実行されるが、他のアドレス空間へのアクセスは、当該アドレス空間に割り当てられたドメインのドメイン種別フラグ156により許可されていない限り行うことはできない。またドメイン#2(220)は、自分のドメインに子ドメインを作成することが可能である。ドメイン#2(220)のアドレス空間が、子ドメインを作るには十分な大きさの領域でない場合は、親ドメインであるドメイン#0(210)が、ドメイン#2(220)に追加の領域を割り当てることができる。   Here, taking the domain # 2 (220) assigned to the address space # 2 (270) as an example, an application stored in the address space # 2 (270) is stored in the address space # 2 (270). Although executed, access to another address space cannot be performed unless permitted by the domain type flag 156 of the domain assigned to the address space. Domain # 2 (220) can create a child domain in its own domain. If the address space of domain # 2 (220) is not an area large enough to create a child domain, domain # 0 (210), the parent domain, adds an additional area to domain # 2 (220). Can be assigned.

ドメイン#21(221)およびドメイン#22(222)は、ドメイン#2(220)を親とする、当該操作により生成されたドメインである。アドレス空間#21(271)およびアドレス空間#22(272)は、アドレス空間#2(270)と領域を共有しているが、これは、親ドメインからは子ドメインの領域を子ドメインの割り当て前と同じように操作できるが、子ドメイン#21(221)または子ドメイン#22(222)からは、親ドメイン#2(220)のドメイン種別フラグ156で許可されていない限り、自分自身のドメインのアドレス空間の範囲しか操作できないことを意味している。   Domain # 21 (221) and domain # 22 (222) are domains generated by this operation with domain # 2 (220) as a parent. Address space # 21 (271) and address space # 22 (272) share an area with address space # 2 (270). This is because the parent domain assigns the child domain area to the child domain before assignment. The child domain # 21 (221) or the child domain # 22 (222) can operate in the same manner as the domain type flag 156 of the parent domain # 2 (220), unless it is permitted. This means that only the address space range can be manipulated.

上述したようなドメイン管理は、プログラムやデータを格納するために用いるEEPROM140や、フラッシュメモリのような書き換え可能な不揮発性のデバイスにおいて効果が大きいが、ROM124やRAM123の制御のために用いることも可能である。ROM124に上記のような仕組みを取り入れることの利点は、ROM124上にアプリケーション毎に個別のミドルウェアを搭載する場合、ROM124上のプログラムであっても、互いに影響を及ぼす可能性のある範囲を制限することができる点である。この点は、大規模化する組込みシステムの品質管理において意義があり、例えば認定が必要となるようなモジュールを組み込む場合において、その影響範囲を効果的に限定することができる。   Domain management as described above is effective in the EEPROM 140 used for storing programs and data, and a rewritable nonvolatile device such as a flash memory, but can also be used for controlling the ROM 124 and RAM 123. It is. The advantage of incorporating the above-described mechanism in the ROM 124 is that, when individual middleware is installed for each application on the ROM 124, even a program on the ROM 124 limits the range that may affect each other. It is a point that can be. This point is significant in quality control of an embedded system that is becoming large-scaled. For example, when a module that requires certification is incorporated, the range of influence can be effectively limited.

RAM123に上記のような仕組みを取り入れることの利点は、アプリケーションのバグによるICカード100の障害をハードウェア的に防止できる点にある。例えば、ルートドメインから読み出し・書き込み可で作成されたスタックのためのドメインは、当該ドメイン管理により予め設定された領域を超えて操作することができなくできるため、スタックオーバーフローによる障害や不正な動作を回避できるという効果がある。   The advantage of incorporating the above-described mechanism into the RAM 123 is that the failure of the IC card 100 due to an application bug can be prevented by hardware. For example, a domain created for a stack that is readable and writable from the root domain cannot be operated beyond the area preset by the domain management. There is an effect that it can be avoided.

以下では、アドレス制御回路130と、アドレス制御回路130のための制御情報151を持つEEPROM140に関する動作の詳細な内容として、ルートドメインの設定、ドメインの追加、ドメインへのアクセス、ドメインの削除の各処理について、図3〜図6を用いて説明する。   Hereinafter, as detailed contents of the operation related to the address control circuit 130 and the EEPROM 140 having the control information 151 for the address control circuit 130, each process of setting a root domain, adding a domain, accessing a domain, and deleting a domain Will be described with reference to FIGS.

まず、ルートドメインの設定処理の流れについて図3を用いて説明する。EEPROM140の初期状態においては、制御情報151の値は、EEPROM140の各データの初期値と同じく、全て00hまたはFFhとなっている。値が00hであるかFFhであるかは、EEPROM140の構造によって決定されるが、ルートドメインを表すドメイン番号の値は、障害時などの場合でも確実にルートドメインが認識されるようにすることを考慮した場合、EEPROM140の各データの初期値または消去後の値となっていることが望ましい。   First, the flow of the route domain setting process will be described with reference to FIG. In the initial state of the EEPROM 140, the values of the control information 151 are all 00h or FFh, as are the initial values of each data in the EEPROM 140. Whether the value is 00h or FFh is determined by the structure of the EEPROM 140, but the value of the domain number indicating the root domain ensures that the root domain is recognized even in the event of a failure. In consideration of this, it is desirable that the initial value of each data in the EEPROM 140 or a value after erasure is set.

EEPROM140にルートドメインを設定するソフトウェアは、まず、ルートドメインの設定処理が開始されると(ステップ301)、ドメイン制御レジスタ131にルートドメインの設定を行う(ステップ302)。ドメイン制御レジスタ131にルートドメインが設定されると、EEPROM140の全領域がアクセス可能となる。ただし、ドメイン制御レジスタ131の設定が行えるのは、ルートドメインにあるプログラムか、ROM124上にあるプログラムだけであり、ユーザプログラムが自分で変更できないことが望ましい。ROM124にあるプログラムに対しても制限を設けたい場合は、先に述べたROM124に対するドメイン管理を別途行えばよい。   When the root domain setting process is started (step 301), the software for setting the root domain in the EEPROM 140 first sets the root domain in the domain control register 131 (step 302). When the root domain is set in the domain control register 131, the entire area of the EEPROM 140 becomes accessible. However, the domain control register 131 can be set only for a program in the root domain or a program on the ROM 124, and it is desirable that the user program cannot be changed by itself. If it is desired to limit the program in the ROM 124, domain management for the ROM 124 described above may be performed separately.

次に、ルートドメインに設定したいアドレスからデータを読み込む(ステップ303)。この時、同時に対象アドレスの制御情報151の内容がドメイン設定レジスタ133に読み込まれる。次に、アドレス制御回路130は、現在のプログラムカウンタがROM124かルートドメインに属する領域を参照しているかどうかを確認する(ステップ304)。もしそうでなければ、エラー処理を実行する(ステップ309)。当該エラー処理の内容をソフトウェアで行う場合は、別途エラー状態設定のためのレジスタを用意し、NMI(Non−Maskable Interrupt)を発生させて処理してもよい。   Next, data is read from an address desired to be set in the root domain (step 303). At this time, the contents of the control information 151 of the target address are read into the domain setting register 133 at the same time. Next, the address control circuit 130 checks whether the current program counter refers to the ROM 124 or an area belonging to the root domain (step 304). If not, error processing is executed (step 309). When the error processing is performed by software, a register for setting an error state may be separately prepared and an NMI (Non-Maskable Interrupt) may be generated and processed.

プログラムカウンタが参照するアドレスが上記領域内にある場合、ルートドメインとして登録するドメイン番号153、および制御条件フラグ154とドメイン内アドレス155の値をドメイン設定レジスタ133に書き込み(ステップ305)、更新後のデータの書き込みを行う(ステップ306)。図3では、ステップ305においてドメイン番号153として0を指定しているが、これは一例としての設定であり、実際の設定はルートドメインの設定方法に依存する。このとき、併せて制御情報151も書き込まれ、当該アドレスが参照するデータブロック141のルートドメインとしての設定が完了する。なお、OSが一つだけのシステムでは、ルートドメインとなりうるアドレスを00hやFFh等の固定の値に制限した方が、安全性は向上する。   When the address referred to by the program counter is in the above area, the domain number 153 registered as the root domain, the control condition flag 154 and the value of the intra-domain address 155 are written in the domain setting register 133 (step 305) Data is written (step 306). In FIG. 3, 0 is specified as the domain number 153 in step 305, but this is an example setting, and the actual setting depends on the setting method of the root domain. At this time, the control information 151 is also written, and the setting of the data block 141 referred to by the address as the root domain is completed. In a system with only one OS, safety is improved by limiting addresses that can be a root domain to fixed values such as 00h and FFh.

次に、他にルートドメインに設定したいアドレスがあるかどうかを確認する(ステップ307)。ある場合は、ステップ303からステップ306までの処理を繰り返し行う。他に設定するアドレスがない場合は処理を終了する(ステップ308)。なお、図3の処理の流れでは、簡単のために仮想アドレス運用フラグ157および裏アドレスフラグ158を無効に設定し、ドメイン内アドレス155は未設定の状態としている。仮想アドレス運用フラグ157および裏アドレスフラグ158を設定した場合の動作については、ドメインの追加処理において説明する。   Next, it is confirmed whether there is another address to be set in the root domain (step 307). If there is, the process from step 303 to step 306 is repeated. If there is no other address to set, the process ends (step 308). In the processing flow of FIG. 3, for the sake of simplicity, the virtual address operation flag 157 and the back address flag 158 are set to invalid, and the intra-domain address 155 is not set. The operation when the virtual address operation flag 157 and the back address flag 158 are set will be described in the domain addition process.

上記のようなルートドメインの設定処理をEEPROM140の初期化処理の一部として行う場合、ステップ302からステップ307の一連の処理をハードウェアにより自動的に行ってもよい。この場合、対象のアドレスは読み出し単位毎にインクリメントまたはデクリメントされ、対象となる全ての領域へのルートドメインの設定が終わったことを、専用のレジスタへの設定又は割込みによりCPUに通知する構成とすることも可能である。   When the root domain setting process as described above is performed as part of the initialization process of the EEPROM 140, a series of processes from step 302 to step 307 may be automatically performed by hardware. In this case, the target address is incremented or decremented for each read unit, and the CPU is notified that the setting of the root domain for all target areas has been completed by setting or interrupting a dedicated register. It is also possible.

なお、ルートドメインの設定処理は、アドレス制御回路130だけではなく、ルートドメイン上で動作するOSとライブラリによる処理の連携により実現される。ここでアドレス制御回路130により実行されるべき処理はステップ304であり、その他の処理はOS等により実行する構成とすることも可能である。   Note that the setting process of the root domain is realized not only by the address control circuit 130 but also by the cooperation of the OS and the library operating on the root domain. Here, the process to be executed by the address control circuit 130 is step 304, and other processes may be executed by the OS or the like.

次に、ドメインの追加処理の流れについて図4を用いて説明する。まず、アドレス制御回路130は、ドメインの追加処理が開始されると(ステップ401)、ドメイン制御レジスタ131に、親となるドメインを設定する(ステップ402)。ドメインの追加の際には、通常は、自分自身のドメインの下に子ドメインを作るので、ここでは自分自身のドメインを設定することになるが、当該処理がOSによりライブラリ化されている場合には、OSのあるルートドメインを設定することになる。   Next, the flow of domain addition processing will be described with reference to FIG. First, when the domain addition process is started (step 401), the address control circuit 130 sets a parent domain in the domain control register 131 (step 402). When adding a domain, a child domain is usually created under the domain of its own, so that the domain of its own is set here, but this processing is performed when it is libraryed by the OS. Will set the root domain with the OS.

通常の実装では、当該処理はOSの機能として用意され、要求元のプログラムから呼び出されて実行することになる。このとき、システムの安全のために、当該処理を行うソフトウェアまたはハードウェアは、まず最初に呼び出し元のプログラムがルートドメインまたはその子ドメイン群に属するかどうかを判断する。要求元のプログラムが子ドメイン群に属する場合には、ドメイン制御レジスタ131の変更が許可されることになる。ここで、子ドメイン群とは、そのドメインの直接の全ての子ドメインと、当該各子ドメイン以下の全ての子ドメインの総称である。   In a normal implementation, the processing is prepared as an OS function, and is called from a request source program and executed. At this time, for the safety of the system, the software or hardware that performs the processing first determines whether the calling program belongs to the root domain or its child domain group. When the request source program belongs to the child domain group, the change of the domain control register 131 is permitted. Here, the child domain group is a general term for all the child domains directly in the domain and all child domains below the child domains.

子ドメイン群に属するかどうかの確認方法としては、現在のドメイン制御レジスタ131の内容を元に判断する方法や、呼び出し元のプログラムの完全性を確認する方法等がある。ここでのプログラムの完全性の確認は、対象となる子ドメインのプログラムのハッシュ値などをルートドメイン内で管理しておき、実行時に呼び出し元のプログラムから計算したハッシュ値とルートドメイン内で管理しているハッシュ値とを比較する方法等が考えられる。   As a method for confirming whether or not it belongs to a child domain group, there are a method for determining based on the contents of the current domain control register 131, a method for confirming the integrity of a calling program, and the like. To check the integrity of the program here, the hash value of the target child domain program is managed in the root domain, and the hash value calculated from the calling program at the time of execution is managed in the root domain. For example, a method of comparing the stored hash value may be considered.

これらの処理は、EEPROM140上に不正に格納されたプログラムに、ルートドメインに属するドメイン切り替えのためのソフトウェアまたはハードウェアを利用して不正にドメインの追加を行わせないために行う。組込みシステムの大規模化の中で、OSが逐次全てのストレージ領域の完全性を確認することは困難である。よって、当該ドメイン追加の仕組みと、ルートドメインによるドメイン内のプログラムおよびデータの完全性の確認を行う仕組みとを用いることで、検査するストレージ領域のサイズを小さくできるという効果がある。   These processes are performed in order to prevent a program illegally stored on the EEPROM 140 from adding a domain illegally using software or hardware for switching domains belonging to the root domain. As the scale of embedded systems increases, it is difficult for the OS to sequentially check the integrity of all storage areas. Therefore, by using the mechanism for adding the domain and the mechanism for confirming the integrity of programs and data in the domain by the root domain, there is an effect that the size of the storage area to be inspected can be reduced.

次に、新規にドメインとして追加したいアドレスの範囲が、要求元のドメインに属しているかどうかを判断する(ステップ403)。なお、ここではドメインのサイズだけを指定し、実際のアドレス空間の範囲をOSが決定してもよい。この場合、OSはEEPROM140の消去状態を確認して、指定されたサイズのドメインの追加が可能かどうかを判断する。この場合、次のステップ404は省略してもよい。   Next, it is determined whether the address range to be newly added as a domain belongs to the requesting domain (step 403). Here, only the domain size may be specified, and the OS may determine the actual address space range. In this case, the OS confirms the erased state of the EEPROM 140 and determines whether or not a domain having a specified size can be added. In this case, the next step 404 may be omitted.

次に、新規にドメインとして追加したいアドレスの範囲が、要求元のドメイン内で確保可能かを判断する(ステップ404)。ドメイン間の独立性の観点から、要求元のドメインに属する領域を除く他のドメインに属するアドレスの範囲から、新規のドメインのためのアドレスの範囲が割り当てられないことが望ましい。なお、アドレスの範囲が指定されている場合は、当該アドレスの範囲が空き領域であると見なして確保してもよいし、そのデータブロック141が消去状態でない場合にはエラーとしてもよい。空き領域のサイズなどの問題で領域を確保することができない場合はエラー処理(ステップ411)を行う。   Next, it is determined whether a range of addresses to be newly added as a domain can be secured in the request source domain (step 404). From the viewpoint of independence between domains, it is desirable that an address range for a new domain is not assigned from a range of addresses belonging to other domains excluding an area belonging to a requesting domain. If an address range is specified, the address range may be regarded as a free area and secured, or an error may occur if the data block 141 is not in an erased state. If the area cannot be secured due to a problem such as the size of the free area, error processing (step 411) is performed.

ルートドメインと要求元のプログラムのドメイン内とに新規のドメインの追加のための十分な空き領域が確保できる場合は、そのアドレスを読み込む(ステップ405)。ここでプログラムカウンタがROM124かルートドメインに属す領域を参照しているかどうかを判断し(ステップ406)、そうでない場合はエラー処理を行う(ステップ411)。なお、要求元のプログラムによるドメイン追加処理の実行を許可する場合は、プログラムカウンタの参照先に要求元のプログラムのドメインを加えてもよい。   If a sufficient free area for adding a new domain can be secured in the root domain and the domain of the request source program, the address is read (step 405). Here, it is determined whether or not the program counter refers to the ROM 124 or an area belonging to the root domain (step 406). If not, error processing is performed (step 411). When the execution of the domain addition process by the request source program is permitted, the domain of the request source program may be added to the reference destination of the program counter.

プログラムカウンタが上記領域を参照している場合は、ドメイン設定レジスタ133に、新規に追加するドメイン番号153、制御条件フラグ154、ドメイン内アドレス155の値を書き込み(ステップ407)、データの書き込みを行う(ステップ408)。このとき併せて制御情報151も書き込まれ、そのアドレスが参照するブロックのドメイン追加が完了する。   When the program counter refers to the above area, the newly added domain number 153, control condition flag 154, and intra-domain address 155 are written to the domain setting register 133 (step 407), and data is written. (Step 408). At this time, the control information 151 is also written, and the domain addition of the block referred to by the address is completed.

なお、図4では、ステップ407においてドメイン番号1が指定されているが、これは一例である。また、ドメイン番号を階層化しておき、その中で用いるべき番号が決定される仕組みであってもよい。例えば、ルートドメイン(ドメイン番号0)の子ドメインとなるのは、ドメイン番号1、11、21…のみとし、ドメイン番号2〜10、12〜20、22〜30、…は、その子ドメインの下にさらに子ドメインを作る場合に使用するというような仕組みにしてもよい。この場合、ドメインの階層を番号から判断できることから、ドメイン番号制御のためのテーブルを簡略化できるという効果があり、その整合性をハードウェアで制御することができるという効果がある。   In FIG. 4, domain number 1 is specified in step 407, but this is an example. Alternatively, a domain number may be hierarchized and a number to be used in the domain number may be determined. For example, only the domain numbers 1, 11, 21... Are the child domains of the root domain (domain number 0), and the domain numbers 2-10, 12-20, 22-30,. Furthermore, it may be configured to be used when creating a child domain. In this case, since the domain hierarchy can be determined from the number, there is an effect that the table for domain number control can be simplified, and the consistency can be controlled by hardware.

以上の処理の後、他にドメインに設定したいアドレスがあるかどうかを確認する(ステップ409)。ある場合には、ステップ405からステップ408までの処理を繰り返し行う。他に設定するアドレスがない場合は処理を終了する(ステップ410)。終了時に行う処理として、サイズによって割り当てを行った場合は、要求元のプログラムにどのアドレスをドメインとして追加したかを報告するようにしてもよい。また、このようなEEPROM140へのドメインの追加処理を、ルートドメインが一括して管理するようにしてもよい。   After the above processing, it is confirmed whether there is another address to be set in the domain (step 409). If there is, the process from step 405 to step 408 is repeated. If there is no other address to set, the process ends (step 410). If the allocation is performed according to the size as the process performed at the end, it may be reported which address is added as a domain to the request source program. The root domain may collectively manage the process of adding a domain to the EEPROM 140.

なお、ドメインの追加処理は、アドレス制御回路130だけではなく、ルートドメイン上で動作するOSとライブラリによる処理の連携により実現される。ここでアドレス制御回路130により実行されるべき処理はステップ406であり、その他の処理はOS等により実行する構成とすることも可能である。   The domain addition process is realized not only by the address control circuit 130 but also by the cooperation of the OS and the library operating on the root domain. Here, the process to be executed by the address control circuit 130 is step 406, and other processes may be executed by the OS or the like.

また、ステップ403とステップ404とに関しては、ドメインの構造が簡単な場合には、ハードウェアにより実現することも可能である。この場合、ステップ401を行う際に、ドメイン制御レジスタ131に、要求元のプログラムが属するドメインのドメイン番号を設定しておくことで実現できる。この際、例えば、ドメイン番号の体系を、前述のように最上位の数字が第1世代のドメイン番号、次の桁の数字が第2世代のドメイン番号というように階層管理しておけば、対象となるアドレスが要求元のプログラムが属するドメインの子ドメイン群に属するかどうかを、ドメイン番号の情報からOSが判断することができ、OSによるドメインの管理負荷が低減され、システムの安全性が向上するという効果がある。このような仕組みは後述するドメインの削除処理の際にも有効である。   Steps 403 and 404 can be realized by hardware if the domain structure is simple. In this case, it can be realized by setting the domain number of the domain to which the request source program belongs in the domain control register 131 when performing step 401. In this case, for example, if the hierarchy of the domain number system is managed so that the highest digit is the first generation domain number and the next digit is the second generation domain number as described above, the target The OS can determine from the domain number information whether the address to be included belongs to the child domain group of the domain to which the requesting program belongs, the domain management load by the OS is reduced, and the system safety is improved. There is an effect of doing. Such a mechanism is also effective in the domain deletion process described later.

次に、ドメイン追加処理において、仮想アドレス運用フラグ157を用いて仮想アドレスを割り当てる場合と、裏アドレスフラグ158を用いてデータの多重化を行う場合の処理について説明する。   Next, in the domain addition process, a process for assigning a virtual address using the virtual address operation flag 157 and a process for multiplexing data using the back address flag 158 will be described.

仮想アドレスによるアドレス制御を行う場合は、仮想アドレス運用フラグ157の値を有効に設定する。この場合、OSはドメインの追加要求時に指定されたサイズを元に、割り当てるべき仮想アドレスをドメイン内アドレス155に設定する。このときの仮想アドレスは、OSにより制御しやすいようにEEPROM140の先頭アドレスから割り当ててもよい。   When performing address control using a virtual address, the value of the virtual address operation flag 157 is set to be valid. In this case, the OS sets the virtual address to be assigned to the intra-domain address 155 based on the size specified when the domain addition request is made. The virtual address at this time may be assigned from the top address of the EEPROM 140 so that it can be easily controlled by the OS.

例えば、OSが、個々のプログラムがあたかもEEPROM140の全ての領域にアクセス可能であるかのように振る舞わせたい場合は、仮想アドレス空間の先頭アドレスは、EEPROM140の先頭物理アドレスと同じ値とすればよい。また、OSがプログラム毎に仮想アドレス空間を用意し、その中のあるアドレス空間がシステム上EEPROM140用として規定されているような場合は、その仮想アドレス空間のアドレスをそのままEEPROM140の仮想アドレスとして用いることができる。   For example, if the OS wants an individual program to behave as if it can access all areas of the EEPROM 140, the start address of the virtual address space may be the same value as the start physical address of the EEPROM 140. . Further, when the OS prepares a virtual address space for each program and a certain address space is defined for the EEPROM 140 on the system, the address of the virtual address space is used as it is as the virtual address of the EEPROM 140. Can do.

また、フラッシュメモリの制御においては、同じ物理アドレスブロックへのアクセスが連続した場合に、そのアドレスブロックの消去回数が増大し、不良が発生しやすくなる場合がある。そこで、一定回数の書き換えが発生した場合に、対象の物理アドレスを入れ替えることで書き換え回数の分散を行うことができる。このような場合に、仮想アドレスによる運用を用いてもよい。この場合の仮想アドレスに対する物理アドレスは、シーケンシャルに割り当ててもよいし、ドメインのサイズに基づいて一様分布するアルゴリズム等を用いてもよい。   In the control of the flash memory, when accesses to the same physical address block are continued, the number of erasures of the address block increases, and a defect is likely to occur. Thus, when a certain number of rewrites occur, the number of rewrites can be distributed by replacing the target physical address. In such a case, operation using a virtual address may be used. In this case, the physical address for the virtual address may be assigned sequentially, or an algorithm that is uniformly distributed based on the size of the domain may be used.

また、アドレス制御回路130とOSは、ドメインのサイズを要求されたサイズよりも大きい値にしておき、かつ初期状態では仮想アドレスを割り振らない領域を用意しておくことで、データ書き換えの際に当該領域へデータを書き込み、書き込み完了後に以前のデータを消すようにすることで、書き換え時に電源遮断が起きた場合に以前のデータや書き換え対象データが消失するというような障害に対する対策を行う仕組みであってもよい。   In addition, the address control circuit 130 and the OS make the domain size larger than the requested size and prepare an area to which no virtual address is allocated in the initial state. By writing data to the area and erasing the previous data after the write is completed, the system is designed to take measures against failures such as loss of previous data and data to be rewritten when the power is interrupted during rewriting. May be.

EEPROM140のサイズが大きくなるにつれて、EEPROM140のアドレス空間を管理することは困難になる。しかし、ドメイン管理により、書き換えが頻繁に起こる領域と、ほぼ読み出ししか発生しない領域とを別のドメインとして管理し、そのドメイン内でのみ有効となる仮想アドレスを割り当てることで、そのアドレス空間の管理負荷を大きく低減できるという効果がある。これは上記で例示した方法だけに限らず、仮想アドレスを用いる仕組み全般に対して有効である。   As the size of the EEPROM 140 increases, it becomes difficult to manage the address space of the EEPROM 140. However, with domain management, the area where rewriting occurs frequently and the area where only read-out occurs are managed as separate domains, and a virtual address that is valid only within that domain is assigned to manage the load on that address space. Can be greatly reduced. This is effective not only for the method exemplified above but also for the whole mechanism using virtual addresses.

裏アドレスを用いてデータブロック141を多重化する場合は、裏アドレスフラグ158に有効な値を設定する。この場合、複数の物理アドレスに対して同一の仮想アドレスをドメイン内アドレス155に割り当て、同一の仮想アドレスを割り当てたデータブロック141に対しては、裏アドレスフラグ158により、書き換えを行う順番を設定する。   When multiplexing the data block 141 using the back address, a valid value is set in the back address flag 158. In this case, the same virtual address is assigned to the intra-domain address 155 for a plurality of physical addresses, and the rewrite order is set by the back address flag 158 for the data block 141 to which the same virtual address is assigned. .

例えば、対象の仮想アドレスを2重化する場合、裏アドレスフラグ158は最低2bitの情報が必要である。この場合、同一の仮想アドレスに対応する複数のデータブロック141について、それぞれの裏アドレスフラグ158の値により01B(1)→10B(2)→11B(3)→01B(1)→…という順で、どちらのデータブロック141が最新のデータであるかを表すことになる。   For example, when the target virtual address is duplicated, the back address flag 158 needs at least 2 bits of information. In this case, for a plurality of data blocks 141 corresponding to the same virtual address, 01B (1) → 10B (2) → 11B (3) → 01B (1) →... According to the value of each back address flag 158. , Which data block 141 is the latest data.

この場合、初期状態で裏アドレスフラグ158に01Bと設定したデータブロック141と、10Bと設定したデータブロック141の2つを用意しておく。ここで、裏アドレスフラグ158が01Bと10Bの状態で書き換えが発生した場合は、古い方である01Bのデータブロック141へ書き換えを行い、書き換え後は対象のデータブロック141の裏アドレスフラグ158の値を11Bに更新する。また、裏アドレスフラグ158が01Bと10Bの状態で読み出しが発生した場合は、新しい方である10Bのデータブロック141を読み出す。   In this case, two data blocks 141, which are set to 01B in the back address flag 158 in the initial state, and a data block 141 which is set to 10B are prepared. Here, when rewriting occurs in the state where the back address flag 158 is 01B and 10B, the data is rewritten to the data block 141 of the older 01B, and after rewriting, the value of the back address flag 158 of the target data block 141 is rewritten. Is updated to 11B. In addition, when reading occurs in the state where the back address flag 158 is 01B and 10B, the newer 10B data block 141 is read.

また、裏アドレスフラグ158が10Bと11Bの状態で書き換えが発生した場合は、古い方である10Bのデータブロック141へ書き換えを行い、書き換え後は対象のデータブロック141の裏アドレスフラグ158の値を01Bにラップさせて更新する。また、裏アドレスフラグ158が10Bと11Bの状態で読み出しが発生した場合は、新しい方である11Bのデータブロック141を読み出す。また、裏アドレスフラグ158が01Bと11Bの状態で書き換えが発生した場合は、古い方である11Bのデータブロック141へ書き換えを行い、書き換え後は対象のデータブロック141の裏アドレスフラグ158の値を10Bに更新する。また、裏アドレスフラグ158が01Bと11Bの状態で読み出しが発生した場合は、新しい方である01Bのデータブロック141を読み出す。   When rewriting occurs in the state where the back address flag 158 is 10B and 11B, rewriting to the data block 141 of the older 10B is performed, and after rewriting, the value of the back address flag 158 of the target data block 141 is changed. Update by wrapping in 01B. Further, when reading occurs in the state where the back address flag 158 is 10B and 11B, the data block 141 of the newer 11B is read. If rewriting occurs with the back address flag 158 being 01B and 11B, rewriting is performed to the data block 141 of the older 11B, and after rewriting, the value of the back address flag 158 of the target data block 141 is set. Update to 10B. In addition, when reading occurs in the state where the back address flag 158 is 01B and 11B, the newer data block 141 of 01B is read.

ここで、裏アドレスフラグ158の値が00B(0)の場合は、裏アドレスフラグ158が未設定であることを意味する。なお、これは初期状態または消去された状態のEEPROM140のデータの値が00Bである場合の例である。逆に、EEPROM140の消去状態の値が11Bである場合は、上記の説明において、裏アドレスフラグ158の値により、00B(0)→01B(1)→10B(2)→00B(0)→…という順で、どちらが最新のデータであるかを表すことになり、裏アドレスフラグ158が未設定である状態は11B(3)となる。   Here, if the value of the back address flag 158 is 00B (0), it means that the back address flag 158 is not set. This is an example when the data value of the EEPROM 140 in the initial state or the erased state is 00B. Conversely, if the erase state value of the EEPROM 140 is 11B, 00B (0) → 01B (1) → 10B (2) → 00B (0) →... According to the value of the back address flag 158 in the above description. In this order, it indicates which is the latest data, and the state where the back address flag 158 is not set is 11B (3).

裏アドレスフラグ158が未設定である状態を上記のように判断するのは、データが消去された状態で電源遮断が発生した場合に、裏アドレスフラグ158の状態が有効であるのか無効であるのかを判別するためである。データ消去中の電源遮断等により、裏アドレスフラグ158の状態がクリアされてしまった場合、再起動後のチェックで、裏アドレスフラグ158が登録されているドメインであるにもかかわらず値が未設定状態であることによりエラーを検出することができる。また、ドメイン内のデータブロック141のドメイン内アドレス155を調べ、ドメイン内アドレスが重複していないデータブロック141を発見することで、裏アドレスフラグ158が未設定となっているデータブロック141が元々どの仮想アドレスに割り当てられていたかも把握することができ、当該データブロック141を再登録することも可能となる。   The reason for determining the state where the back address flag 158 is not set as described above is whether the state of the back address flag 158 is valid or invalid when the power is cut off while the data is erased. This is for determining. If the status of the back address flag 158 is cleared due to power interruption during data erasure, etc., the value is not set in the check after restart even though the back address flag 158 is a registered domain An error can be detected by being in a state. Further, by examining the intra-domain address 155 of the data block 141 in the domain and finding the data block 141 in which the intra-domain address is not duplicated, which data block 141 in which the back address flag 158 is not set is originally set. It is also possible to grasp whether the virtual address has been assigned, and the data block 141 can be re-registered.

次に、ドメインへのアクセスの処理の流れについて図5を用いて説明する。ドメインへのアクセスとしては、読み出し、書き込み、削除などが考えられ、ドメインへのアクセスの管理としては、あるプログラムが別のドメイン上のプログラムおよびデータを自由に変更できないようにする仕組みと、データの共有や受け渡しのために制限付きで変更できるようにする仕組みとが必要になる。   Next, the flow of processing for accessing a domain will be described with reference to FIG. Access to a domain can be read, write, delete, etc., and access to a domain can be managed by preventing a program from freely changing programs and data on another domain, A mechanism to allow limited changes for sharing and delivery is required.

アドレス制御回路130は、ドメインへのアクセスが発生すると(ステップ501)、まずアクセスしたいアドレスのデータブロック141を読み込み(ステップ502)、ドメイン種別フラグ156が設定されている場合は、アクセス要件(読み出し、書き込み等)を満たしているかどうかを判断する(ステップ503)。   When access to the domain occurs (step 501), the address control circuit 130 first reads the data block 141 of the address to be accessed (step 502), and when the domain type flag 156 is set, the access requirement (read, It is determined whether or not (write etc.) is satisfied (step 503).

アドレス制御回路130は、自分自身のドメイン以外のドメインへのアクセスが発生すると、アクセス先が親ドメインおよび同じ親ドメインを有するドメインである場合は、ドメイン種別フラグ156の設定に従い動作する。それ以外の場合は、ドメイン番号を、最上位の数字が第1世代のドメイン番号、次の桁の数字が第2世代のドメイン番号となるような体系により管理することで、アクセス先が同じルートドメインに属するか否かを判断することができる。なお、実際の運用では、データの書き換えは親ドメインからに限定することが望ましい。仮に同じ親ドメインを有する子ドメイン間でデータの共有やデータの受け渡しを行いたい場合は、親ドメインを経由して行うことが望ましい。   When an access to a domain other than its own domain occurs, the address control circuit 130 operates according to the setting of the domain type flag 156 if the access destination is a parent domain and a domain having the same parent domain. In other cases, the domain number is managed by a system in which the highest digit is the first generation domain number and the next digit is the second generation domain number, so that the access destination is the same route. Whether it belongs to a domain can be determined. In actual operation, it is desirable to rewrite data from the parent domain. If it is desired to share data and exchange data between child domains having the same parent domain, it is desirable to do so via the parent domain.

ドメインへのアクセスに際して、仮想アドレス運用フラグ157が有効に設定されているドメインへのアクセスの場合には、ドメイン内を検索し、対象のアドレスと一致するドメイン内アドレス155を持つデータブロック141を読み出す。また、裏アドレスフラグ158が有効に設定されているドメインへのアクセスの場合には、同じドメイン内アドレス155を持つデータブロック141を読み出し、前述した手順に従って最新のデータブロック141を判別し、当該データブロック141を読み出す。   When accessing a domain, in the case of access to a domain in which the virtual address operation flag 157 is set to be valid, the domain is searched, and the data block 141 having the in-domain address 155 that matches the target address is read out. . In the case of access to a domain for which the back address flag 158 is set to be valid, the data block 141 having the same intra-domain address 155 is read, the latest data block 141 is determined according to the above-described procedure, and the data Read block 141.

アクセスの種類については、ドメイン制御レジスタ131内のアクセス種別135に設定され、アクセス種別135が読み出しである場合は、ドメイン種別フラグ156に”読み出し可”が設定されている必要があり、また、書き込みおよび消去である場合は、”読み出し・書き換え可”が設定されている必要がある。なお、アクセス元のドメインが、親ドメインまたはルートドメイン等の直系の上位ドメインである場合はこの限りではない。   The access type is set to the access type 135 in the domain control register 131. When the access type 135 is read, the domain type flag 156 needs to be set to “Readable”, and the write type In the case of erasing, it is necessary to set “reading / rewritable”. This is not the case when the access source domain is a direct higher domain such as a parent domain or a root domain.

この条件を満たしていない場合はエラー処理を行う(ステップ509)。条件を満たしている場合は、処理の種別により(ステップ504)、読み出しの場合は、要求元に読み出したデータを転送し(ステップ505)、処理を終了する(ステップ508)。また、書き換えの場合は、書き換えたいデータと読み出したデータの内容とをマージして書き込みを行い(ステップ506)、処理を終了する(ステップ508)。消去の場合は、データの消去処理を実行し(ステップ507)、処理を終了する(ステップ508)。   If this condition is not satisfied, error processing is performed (step 509). If the condition is satisfied, the process type is determined (step 504). If read, the read data is transferred to the request source (step 505), and the process ends (step 508). In the case of rewriting, the data to be rewritten and the contents of the read data are merged and written (step 506), and the process is terminated (step 508). In the case of erasure, data erasure processing is executed (step 507), and the processing is terminated (step 508).

なお、ドメインへのアクセスの処理は、アドレス制御回路130だけではなく、ルートドメイン上で動作するOSとライブラリによる処理の連携により実現される。ここでアドレス制御回路130により実行されるべき処理はステップ503であり、その他の処理はOS等により実行する構成とすることも可能である。   Note that the domain access processing is realized not only by the address control circuit 130 but also by the cooperation of the OS and the library operating on the root domain. Here, the processing to be executed by the address control circuit 130 is step 503, and the other processing may be executed by the OS or the like.

次に、ドメインの削除処理の流れについて図6を用いて説明する。ドメインの追加によりEEPROM140に空き領域がなくなった場合や、ドメインが不要になった際に、ドメインを削除する処理が必要になる。ドメインを削除する場合(ステップ601)、まずOSは、ドメイン制御レジスタ131にルートドメインを設定する(ステップ602)。次に、削除の対象となるアドレスが、要求元のドメインの子ドメインに属するかどうかを判断する(ステップ603)。ドメインを削除する場合、ドメイン間の独立性を保つため、自分自身と、自分自身より上位のドメインを削除することができないようにするのが望ましい。要求元のドメインの子ドメインに属しない場合は、エラー処理を行う(ステップ610)。   Next, the flow of domain deletion processing will be described with reference to FIG. When there is no free space in the EEPROM 140 due to the addition of a domain, or when the domain becomes unnecessary, a process for deleting the domain is required. When deleting a domain (step 601), the OS first sets a root domain in the domain control register 131 (step 602). Next, it is determined whether the address to be deleted belongs to a child domain of the requesting domain (step 603). When deleting a domain, in order to maintain independence between the domains, it is desirable not to delete itself and a domain higher than itself. If it does not belong to the child domain of the requesting domain, error processing is performed (step 610).

要求元の子ドメインに属する場合は、現在のプログラムカウンタがROM124かルートドメインに属する領域を参照しているかどうかを確認する(ステップ604)。そうでない場合はエラー処理を行う(ステップ610)。なお、要求元のドメイン内の削除プログラムの実行を許可する場合は、プログラムカウンタの参照先に要求元のドメインを加えてもよい。現在のプログラムカウンタがROM124かルートドメインに属する領域を参照している場合は、対象のアドレスのデータを削除する(ステップ605)。   If it belongs to the child domain of the request source, it is checked whether or not the current program counter refers to the ROM 124 or an area belonging to the root domain (step 604). Otherwise, error processing is performed (step 610). When the execution of the deletion program in the request source domain is permitted, the request source domain may be added to the reference destination of the program counter. If the current program counter refers to the ROM 124 or an area belonging to the root domain, the data at the target address is deleted (step 605).

その後、ドメイン番号153として要求元のドメイン番号を指定し、さらに要求元のドメインの基準に従った制御条件フラグ154の内容を指定した情報をドメイン設定レジスタ133に書き込み(ステップ606)、内容を消去したデータを書き込む(ステップ607)。削除したドメインの領域は、通常親ドメインに戻ることになる。ここで、図6のステップ606に記載している設定内容は一例であり、これら設定は、削除したアドレスが属することになるドメインの設定に依存する。   Thereafter, the domain number of the request source is designated as the domain number 153, and information designating the contents of the control condition flag 154 in accordance with the criteria of the request source domain is written to the domain setting register 133 (step 606), and the contents are erased. The written data is written (step 607). The deleted domain area usually returns to the parent domain. Here, the setting contents described in step 606 of FIG. 6 are an example, and these settings depend on the setting of the domain to which the deleted address belongs.

ステップ607の処理後、他にも削除したいアドレスが存在するどうかを判断し(ステップ608)、存在する場合には、ステップ603〜ステップ607の処理を繰り返す。他に削除したいアドレスが存在しない場合には処理を終了する(ステップ609)。ドメインを削除する場合に削除対象となるのは、指定されたドメインだけではなく、指定されたドメインに属する子ドメインも含まれる。   After the processing in step 607, it is determined whether there are other addresses to be deleted (step 608). If there are, addresses 603 to 607 are repeated. If there is no other address to be deleted, the process ends (step 609). When deleting a domain, not only the specified domain but also child domains belonging to the specified domain are included in the deletion target.

なお、ドメインの削除処理は、アドレス制御回路130だけではなく、ルートドメイン上で動作するOSとライブラリによる処理の連携により実現される。ここでアドレス制御回路130により実行されるべき処理はステップ604であり、その他の処理はOS等により実行する構成とすることも可能である。   Note that the domain deletion process is realized not only by the address control circuit 130 but also by the cooperation of the OS and the library operating on the root domain. Here, the process to be executed by the address control circuit 130 is step 604, and other processes can be executed by the OS or the like.

また、前述したように、ステップ603に関しては、ドメインの構造が簡単な場合には、ハードウェアにより実現することも可能である。この場合、ステップ601を行う際に、ドメイン制御レジスタ131に、要求元のプログラムが属するドメインのドメイン番号を設定しておくことで実現できる。この際、例えば、ドメイン番号の体系を、最上位の数字が第1世代のドメイン番号、次の桁の数字が第2世代のドメイン番号というように階層管理しておけば、対象となるアドレスが要求元のプログラムが属するドメインの子ドメイン群に属するかどうかを、ドメイン番号の情報からOSが判断することができ、OSによるドメインの管理負荷が低減され、システムの安全性が向上するという効果がある。   As described above, step 603 can be realized by hardware when the domain structure is simple. In this case, this can be realized by setting the domain number of the domain to which the request source program belongs in the domain control register 131 when performing step 601. In this case, for example, if the domain number system is hierarchically managed such that the highest digit is the first generation domain number and the next digit is the second generation domain number, the target address is Whether the OS belongs to the child domain group of the domain to which the request source program belongs can be determined by the OS from the domain number information, and the domain management load by the OS is reduced, and the system safety is improved. is there.

以上のように、組込みシステム向けCPUやICカードチップなどにおいて、フラッシュメモリなどの記憶媒体をアプリケーションの実行に使用する場合、記憶媒体の領域にドメインを定義して管理することにより、ドメイン上で稼動する各アプリケーションは、ドメインの設定によって許可されている範囲でしか記憶媒体の領域にアクセスできないようにすることが可能となる。さらに、ドメインを階層管理し、ドメインの設定は自分自身では変更できず、ルートドメインもしくは親ドメインによってしか変更できないため、ドメイン内のアプリケーションの不正動作により、他の領域上のデータが破壊されたり、不正にアクセスされたりするおそれがなく稼動することができる。   As described above, when a storage medium such as a flash memory is used to execute an application in a CPU or IC card chip for an embedded system, it operates on the domain by defining and managing the domain in the storage medium area. Each application can access the area of the storage medium only within the range permitted by the domain setting. In addition, the domain is managed hierarchically, and the domain settings cannot be changed by themselves, but can only be changed by the root domain or the parent domain. It can operate without fear of unauthorized access.

また、ドメイン管理の設定は、上述のように柔軟に行うことが可能なため、アプリケーション間でのデータの受け渡しや、ライブラリの共用など、アプリケーション間での領域の共用についての管理も行うことができる。さらに、上記のドメイン管理にさらに仮想アドレスによる運用や、データの二重化を行うことにより、データ書き換え時の電源遮断などの障害に対するデータの整合性の維持も可能となり、可用性の確保が図られる。   In addition, since domain management settings can be made flexibly as described above, it is possible to manage the sharing of areas between applications, such as data exchange between applications and library sharing. . Furthermore, by using a virtual address in addition to the above domain management and duplicating data, it is possible to maintain data consistency against a failure such as a power shutdown during data rewriting, thereby ensuring availability.

以上、本発明者によってなされた発明を実施の形態に基づき具体的に説明したが、本発明は前記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。   As mentioned above, the invention made by the present inventor has been specifically described based on the embodiment. However, the present invention is not limited to the embodiment, and various modifications can be made without departing from the scope of the invention. Needless to say.

本発明は、消去および書き換え可能な記憶領域を持つ記憶媒体、特にフラッシュメモリなどの不揮発性記憶媒体の領域管理を行う制御回路、および前記制御回路を有する汎用または組込みシステム向け処理装置、および前記処理装置を有する組込みシステム、ならびに前記記憶媒体の領域管理方法に利用可能である。   The present invention relates to a control circuit that performs area management of a storage medium having an erasable and rewritable storage area, in particular, a nonvolatile storage medium such as a flash memory, a processing device for a general purpose or embedded system having the control circuit, and the processing The present invention can be used for an embedded system having a device and an area management method for the storage medium.

本発明の一実施の形態である処理装置、および当該処理装置に接続された記憶媒体の構成を表す図である。It is a figure showing the structure of the processing apparatus which is one embodiment of this invention, and the storage medium connected to the said processing apparatus. 本発明の一実施の形態におけるドメインの階層構造およびEEPROMの領域との関係の例を表した図である。It is a figure showing the example of the hierarchical structure of the domain in one embodiment of this invention, and the relationship with the area | region of EEPROM. 本発明の一実施の形態におけるルートドメインの設定処理の流れを表した図である。It is a figure showing the flow of the setting process of the root domain in one embodiment of this invention. 本発明の一実施の形態におけるドメインの追加処理の流れを表した図である。It is a figure showing the flow of the addition process of the domain in one embodiment of this invention. 本発明の一実施の形態におけるドメインへのアクセスの際の処理の流れを表した図である。It is a figure showing the flow of the process at the time of access to the domain in one embodiment of this invention. 本発明の一実施の形態におけるドメインの削除処理の流れを表した図である。It is a figure showing the flow of the deletion process of the domain in one embodiment of this invention.

符号の説明Explanation of symbols

100…ICカード、110…入出力IF、111…VCC線、112…RST(リセット信号線)、113…CLK(クロック信号線)、114…GND線、115…I/O(入出力線)、120…処理装置、121…UART制御回路、122…CPU、123…RAM、124…ROM、125…コプロセッサ、126…内部バス、130…アドレス制御回路、131…ドメイン制御レジスタ、132…仮想アドレス空間レジスタ、133…ドメイン設定レジスタ、134…ドメイン番号、135…アクセス種別、140…EEPROM、141…データブロック、151…制御情報、152…データ領域、153…ドメイン番号、154…制御条件フラグ、155…ドメイン内アドレス、156…ドメイン種別フラグ、157…仮想アドレス運用フラグ、158…裏アドレスフラグ、
200…ドメイン#0、210…ドメイン#1、220…ドメイン#2、221…ドメイン#21、222…ドメイン#22、230…ドメイン#3、250…アドレス空間#0、270…アドレス空間#2、271…アドレス空間#21、272…アドレス空間#22。
DESCRIPTION OF SYMBOLS 100 ... IC card, 110 ... Input / output IF, 111 ... VCC line, 112 ... RST (reset signal line), 113 ... CLK (clock signal line), 114 ... GND line, 115 ... I / O (input / output line), DESCRIPTION OF SYMBOLS 120 ... Processor, 121 ... UART control circuit, 122 ... CPU, 123 ... RAM, 124 ... ROM, 125 ... Coprocessor, 126 ... Internal bus, 130 ... Address control circuit, 131 ... Domain control register, 132 ... Virtual address space Register, 133 ... Domain setting register, 134 ... Domain number, 135 ... Access type, 140 ... EEPROM, 141 ... Data block, 151 ... Control information, 152 ... Data area, 153 ... Domain number, 154 ... Control condition flag, 155 ... Intra-domain address, 156 ... domain type flag, 157 ... virtual Dress operation flag, 158 ... back address flag,
200 ... Domain # 0, 210 ... Domain # 1, 220 ... Domain # 2, 221 ... Domain # 21, 222 ... Domain # 22, 230 ... Domain # 3, 250 ... Address space # 0, 270 ... Address space # 2, 271: Address space # 21, 272: Address space # 22.

Claims (20)

CPUと、消去および書き換え可能な記憶媒体とを有する処理装置において、該記憶媒体の所定の領域をドメインとして設定し、前記ドメインの管理およびプログラムが前記ドメインを利用する際のアクセス要件の管理を行う制御回路であって、
前記記憶媒体に前記ドメインの管理のための制御情報を設定するための第1のレジスタと、現在の処理対象である前記ドメインについての情報を保持する第2のレジスタとを有し、
前記第1のレジスタの情報を用いて、前記記憶媒体上のアドレスに対して、該アドレスに割り当てられたデータ領域が属する前記ドメインについての前記制御情報を設定し、
プログラムによる前記記憶媒体上のアドレスに割り当てられたデータ領域へのアクセスの際に、該アドレスに設定されている前記制御情報と、前記第2のレジスタの情報とに基づいて、該アクセスの可否を判断することを特徴とする制御回路。
In a processing apparatus having a CPU and a erasable and rewritable storage medium, a predetermined area of the storage medium is set as a domain, and management of the domain and management of access requirements when the program uses the domain A control circuit,
A first register for setting control information for management of the domain in the storage medium, and a second register for holding information about the domain that is the current processing target;
Using the information in the first register, for the address on the storage medium, set the control information for the domain to which the data area assigned to the address belongs,
When accessing a data area assigned to an address on the storage medium by a program, whether or not the access is possible is determined based on the control information set in the address and the information in the second register. A control circuit characterized by judging.
CPUと、消去および書き換え可能な記憶媒体とを有する処理装置において、該記憶媒体の所定の領域をドメインとして設定し、前記ドメインの管理およびプログラムが前記ドメインを利用する際のアクセス要件の管理を行う制御回路であって、
前記記憶媒体に前記ドメインの管理のための制御情報を設定するための第1のレジスタと、現在の処理対象である前記ドメインについての情報を保持する第2のレジスタとを有し、
前記第1のレジスタの情報を用いて、前記記憶媒体上のアドレスに対して、該アドレスに割り当てられたデータ領域が属する前記ドメインについての前記制御情報を設定し、
プログラムによる前記記憶媒体上のアドレスに対する新たな前記ドメインの追加もしくは前記記憶媒体上のアドレスからの他の前記ドメインの削除の処理の際に、該アドレスに設定されている前記制御情報と、前記第2のレジスタの情報と、該プログラムの格納位置の情報とに基づいて、該処理の可否を判断することを特徴とする制御回路。
In a processing apparatus having a CPU and a erasable and rewritable storage medium, a predetermined area of the storage medium is set as a domain, and management of the domain and management of access requirements when the program uses the domain A control circuit,
A first register for setting control information for management of the domain in the storage medium, and a second register for holding information about the domain that is the current processing target;
Using the information in the first register, for the address on the storage medium, set the control information for the domain to which the data area assigned to the address belongs,
When the program adds a new domain to the address on the storage medium or deletes the other domain from the address on the storage medium, the control information set in the address, and the first 2. A control circuit for determining whether or not the processing can be performed based on the information in the register 2 and the information on the storage location of the program.
請求項1または2記載の制御回路において、
プログラムが前記第1のレジスタおよび前記第2のレジスタの値を変更しようとする際に、該プログラムの格納位置の情報に基づいてその可否を判断することを特徴とする制御回路。
The control circuit according to claim 1 or 2,
A control circuit, wherein when a program attempts to change the values of the first register and the second register, whether or not the program is possible is determined based on information on a storage location of the program.
請求項1または3記載の制御回路において、
前記ドメインを階層化して管理し、プログラムによる前記記憶媒体上のアドレスに割り当てられたデータ領域へのアクセスの際に、該プログラムが利用する前記ドメインと、該データ領域が属する前記ドメインとの親子関係に基づいて、該アクセスの可否を判断することを特徴とする制御回路。
The control circuit according to claim 1 or 3,
The domain is managed hierarchically, and the parent-child relationship between the domain used by the program and the domain to which the data area belongs when the program accesses the data area assigned to the address on the storage medium And determining whether or not the access is possible.
請求項2または3記載の制御回路において、
前記ドメインを階層化して管理し、プログラムによる前記記憶媒体上のアドレスに対する新たな前記ドメインの追加もしくは前記記憶媒体上のアドレスからの他の前記ドメインの削除の処理の際に、該プログラムが利用する前記ドメインと、該アドレスに割り当てられたデータ領域が属する前記ドメインとの親子関係に基づいて、該処理の可否を判断することを特徴とする制御回路。
The control circuit according to claim 2 or 3,
The domain is managed in a hierarchical manner, and is used by the program when the program adds a new domain to the address on the storage medium or deletes the other domain from the address on the storage medium. A control circuit, comprising: determining whether or not the processing is possible based on a parent-child relationship between the domain and the domain to which a data area assigned to the address belongs.
請求項4記載の制御回路において、
プログラムによる前記記憶媒体上のアドレスに割り当てられたデータ領域へのアクセスの際に、該プログラムが利用する前記ドメインの下位の前記ドメインに属するデータ領域へのアクセスは許可し、それ以外の前記ドメインに属するデータ領域へのアクセスについては、該データ領域に対応するアドレスに設定されている前記制御情報と、前記第2のレジスタの情報とに基づいて、該アクセスの可否を判断することを特徴とする制御回路。
The control circuit according to claim 4, wherein
When a program accesses a data area assigned to an address on the storage medium, access to a data area belonging to the domain below the domain used by the program is permitted, and other domains are allowed to access the data area. The access to the data area to which the data belongs belongs to determine whether or not the access is possible based on the control information set in the address corresponding to the data area and the information in the second register. Control circuit.
請求項5記載の制御回路において、
前記ドメインを階層化して管理し、プログラムによる前記記憶媒体上のアドレスに対する新たな前記ドメインの追加もしくは前記記憶媒体上のアドレスからの他の前記ドメインの削除の処理の際に、該プログラムが利用する前記ドメインの下位の新たな前記ドメインの追加もしくは下位の他の前記ドメインの削除は許可し、それ以外の新たな前記ドメインの追加もしくは他の前記ドメインの削除は許可しないことを特徴とする制御回路。
The control circuit according to claim 5, wherein
The domain is managed in a hierarchical manner, and is used by the program when the program adds a new domain to the address on the storage medium or deletes the other domain from the address on the storage medium. Addition of a new domain under the domain or deletion of another domain under the domain is permitted, and addition of a new domain other than that or deletion of the other domain is not permitted. .
請求項4〜7のいずれか1項記載の制御回路において、
各前記ドメインに付与する番号の体系により、各前記ドメイン間の親子関係を判別することを特徴とする制御回路。
The control circuit according to any one of claims 4 to 7,
A control circuit for discriminating a parent-child relationship between the domains based on a system of numbers assigned to the domains.
請求項1〜8のいずれか1項記載の制御回路において、
前記記憶媒体上のアドレスに対して仮想アドレスを割り当てることにより、プログラムからは、該仮想アドレスによって該アドレスに割り当てられたデータ領域にアクセスさせることを特徴とする制御回路。
The control circuit according to any one of claims 1 to 8,
A control circuit characterized in that a virtual address is assigned to an address on the storage medium so that a program accesses a data area assigned to the address by the virtual address.
請求項9記載の制御回路において、
前記記憶媒体上の複数のアドレスに対して同一の仮想アドレスを割り当てることにより、該仮想アドレスによって特定されるデータ領域を多重化することを特徴とする制御回路。
The control circuit according to claim 9, wherein
A control circuit that multiplexes a data area specified by a virtual address by assigning the same virtual address to a plurality of addresses on the storage medium.
請求項1〜10のいずれか1項記載の制御回路により設定された前記制御情報を格納していることを特徴とする消去および書き換え可能な記憶媒体。   11. An erasable and rewritable storage medium storing the control information set by the control circuit according to claim 1. 請求項1〜10のいずれか1項記載の制御回路と、請求項11記載の消去および書き換え可能な記憶媒体とを有することを特徴とする処理装置。   A processing apparatus comprising: the control circuit according to claim 1; and the erasable and rewritable storage medium according to claim 11. 請求項12記載の処理装置を有することを特徴とする組込みシステム。   An embedded system comprising the processing device according to claim 12. CPUと、消去および書き換え可能な記憶媒体とを有する処理装置が、該記憶媒体の所定の領域をドメインとして設定し、前記ドメインの管理およびプログラムが前記ドメインを利用する際のアクセス要件の管理を行う領域管理方法であって、
前記処理装置は、前記記憶媒体上のアドレスに対して、該アドレスに割り当てられたデータ領域が属する前記ドメインについての制御情報を設定し、
プログラムによる前記記憶媒体上のアドレスに割り当てられたデータ領域へのアクセスの際に、該アドレスに設定されている前記制御情報と、現在の処理対象である前記ドメインについての情報とに基づいて、該アクセスの可否を判断することを特徴とする領域管理方法。
A processing device having a CPU and a erasable / rewritable storage medium sets a predetermined area of the storage medium as a domain, and manages the domain and management of access requirements when the program uses the domain An area management method,
The processing device sets, for an address on the storage medium, control information for the domain to which a data area assigned to the address belongs,
When accessing a data area assigned to an address on the storage medium by a program, based on the control information set to the address and information about the domain that is the current processing target, An area management method characterized by determining whether or not access is possible.
CPUと、消去および書き換え可能な記憶媒体とを有する処理装置が、該記憶媒体の所定の領域をドメインとして設定し、前記ドメインの管理およびプログラムが前記ドメインを利用する際のアクセス要件の管理を行う領域管理方法であって、
前記処理装置は、前記記憶媒体上のアドレスに対して、該アドレスに割り当てられたデータ領域が属する前記ドメインについての制御情報を設定し、
プログラムによる前記記憶媒体上のアドレスに対する新たな前記ドメインの追加もしくは前記記憶媒体上のアドレスからの他の前記ドメインの削除の処理の際に、該アドレスに設定されている前記制御情報と、現在の処理対象である前記ドメインについての情報と、該プログラムの格納位置の情報とに基づいて、該各処理の可否を判断することを特徴とする領域管理方法。
A processing device having a CPU and a erasable / rewritable storage medium sets a predetermined area of the storage medium as a domain, and manages the domain and management of access requirements when the program uses the domain An area management method,
The processing device sets, for an address on the storage medium, control information for the domain to which a data area assigned to the address belongs,
When the program adds a new domain to an address on the storage medium or deletes another domain from the address on the storage medium, the control information set in the address and the current An area management method comprising: determining whether each process is possible based on information about the domain to be processed and information on a storage location of the program.
請求項14または15記載の領域管理方法において、
前記処理装置は、プログラムが前記制御情報および現在の処理対象である前記ドメインについての情報を変更しようとする際に、該プログラムの格納位置の情報に基づいてその可否を判断することを特徴とする領域管理方法。
The area management method according to claim 14 or 15,
The processing device, when the program tries to change the control information and the information about the domain that is the current processing target, determines whether or not the program is possible based on the storage location information of the program. Space management method.
請求項14記載の領域管理方法において、
前記処理装置は、前記ドメインを階層化して管理し、プログラムによる前記記憶媒体上のアドレスに割り当てられたデータ領域へのアクセスの際に、該プログラムが利用する前記ドメインと、該データ領域が属する前記ドメインとの親子関係に基づいて、該アクセスの可否を判断することを特徴とする領域管理方法。
The area management method according to claim 14, wherein
The processing device manages the domain in a hierarchical manner, and when the program accesses a data area assigned to an address on the storage medium, the domain used by the program and the data area to which the data area belongs An area management method comprising: determining whether access is possible based on a parent-child relationship with a domain.
請求項15記載の領域管理方法において、
前記処理装置は、前記ドメインを階層化して管理し、プログラムによる前記記憶媒体上のアドレスに対する新たな前記ドメインの追加もしくは前記記憶媒体上のアドレスからの他の前記ドメインの削除の処理の際に、該プログラムが利用する前記ドメインと、該アドレスに割り当てられたデータ領域が属する前記ドメインとの親子関係に基づいて、該処理の可否を判断することを特徴とする領域管理方法。
The area management method according to claim 15, wherein
The processing device manages the domain in a hierarchical manner, and in the process of adding a new domain to an address on the storage medium by a program or deleting another domain from the address on the storage medium, An area management method comprising: determining whether or not the process is possible based on a parent-child relationship between the domain used by the program and the domain to which the data area assigned to the address belongs.
請求項17記載の領域管理方法において、
前記処理装置は、プログラムによる前記記憶媒体上のアドレスに割り当てられたデータ領域へのアクセスの際に、該プログラムが利用する前記ドメインの下位の前記ドメインに属するデータ領域へのアクセスは許可し、それ以外の前記ドメインに属するデータ領域へのアクセスについては、該データ領域に対応するアドレスに設定されている前記制御情報と、現在の処理対象である前記ドメインについての情報とに基づいて、該アクセスの可否を判断することを特徴とする領域管理方法。
The area management method according to claim 17, wherein
When the program accesses the data area assigned to the address on the storage medium by the program, the processor permits the access to the data area belonging to the domain below the domain used by the program, For the access to the data area belonging to the domain other than, based on the control information set in the address corresponding to the data area and the information about the domain that is the current processing target, A region management method characterized by determining whether or not it is possible.
請求項18記載の領域管理方法において、
前記処理装置は、前記ドメインを階層化して管理し、プログラムによる前記記憶媒体上のアドレスに対する新たな前記ドメインの追加もしくは前記記憶媒体上のアドレスからの他の前記ドメインの削除の処理の際に、該プログラムが利用する前記ドメインの下位の新たな前記ドメインの追加もしくは下位の他の前記ドメインの削除は許可し、それ以外の新たな前記ドメインの追加もしくは他の前記ドメインの削除は許可しないことを特徴とする領域管理方法。
The area management method according to claim 18, wherein
The processing device manages the domain in a hierarchical manner, and in the process of adding a new domain to an address on the storage medium by a program or deleting another domain from the address on the storage medium, The addition of a new domain under the domain used by the program or the deletion of another domain under the domain is permitted, and the addition of another new domain or the deletion of another domain is not permitted. Characteristic area management method.
JP2007155932A 2007-06-13 2007-06-13 Control circuit, storage medium, processing device, embedded system, and area management method Expired - Fee Related JP4892414B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2007155932A JP4892414B2 (en) 2007-06-13 2007-06-13 Control circuit, storage medium, processing device, embedded system, and area management method
PCT/JP2008/055940 WO2008152846A1 (en) 2007-06-13 2008-03-27 Control circuit, and processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007155932A JP4892414B2 (en) 2007-06-13 2007-06-13 Control circuit, storage medium, processing device, embedded system, and area management method

Publications (2)

Publication Number Publication Date
JP2008310460A true JP2008310460A (en) 2008-12-25
JP4892414B2 JP4892414B2 (en) 2012-03-07

Family

ID=40129459

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007155932A Expired - Fee Related JP4892414B2 (en) 2007-06-13 2007-06-13 Control circuit, storage medium, processing device, embedded system, and area management method

Country Status (2)

Country Link
JP (1) JP4892414B2 (en)
WO (1) WO2008152846A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014164412A (en) * 2013-02-22 2014-09-08 Toshiba Corp Micro processor
JP2015103005A (en) * 2013-11-25 2015-06-04 凸版印刷株式会社 Portable type electronic medium and input/output function control method
JP2019128905A (en) * 2018-01-26 2019-08-01 大日本印刷株式会社 Electronic information storage medium, ic card, method for processing information with electronic information storage medium, and os

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05233458A (en) * 1991-09-30 1993-09-10 Apple Computer Inc Memory managing unit for computer system
JP2001056783A (en) * 1999-08-18 2001-02-27 Nec Software Kobe Ltd Program unit memory attribute managing system
JP2003242030A (en) * 2001-12-14 2003-08-29 Matsushita Electric Ind Co Ltd Memory control device and memory control method
JP2006293516A (en) * 2005-04-07 2006-10-26 Matsushita Electric Ind Co Ltd Bus access control unit

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05233458A (en) * 1991-09-30 1993-09-10 Apple Computer Inc Memory managing unit for computer system
JP2001056783A (en) * 1999-08-18 2001-02-27 Nec Software Kobe Ltd Program unit memory attribute managing system
JP2003242030A (en) * 2001-12-14 2003-08-29 Matsushita Electric Ind Co Ltd Memory control device and memory control method
JP2006293516A (en) * 2005-04-07 2006-10-26 Matsushita Electric Ind Co Ltd Bus access control unit

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014164412A (en) * 2013-02-22 2014-09-08 Toshiba Corp Micro processor
JP2015103005A (en) * 2013-11-25 2015-06-04 凸版印刷株式会社 Portable type electronic medium and input/output function control method
JP2019128905A (en) * 2018-01-26 2019-08-01 大日本印刷株式会社 Electronic information storage medium, ic card, method for processing information with electronic information storage medium, and os
JP7040053B2 (en) 2018-01-26 2022-03-23 大日本印刷株式会社 Information processing method and OS using electronic information storage medium, IC card, electronic information storage medium

Also Published As

Publication number Publication date
JP4892414B2 (en) 2012-03-07
WO2008152846A1 (en) 2008-12-18

Similar Documents

Publication Publication Date Title
US9467288B2 (en) Encryption key destruction for secure data erasure
JP6306578B2 (en) Memory protection device and protection method
CN109634517B (en) Method for performing access management, memory device, electronic device and controller thereof
CN109002706B (en) In-process data isolation protection method and system based on user-level page table
JP5336060B2 (en) Nonvolatile memory device and method of operating the same
KR100876084B1 (en) Computing system capable of delivering deletion information to flash storage
EP2221830A1 (en) Memory device and wear leveling method thereof
US20090024820A1 (en) Memory Allocation For Crash Dump
TWI447580B (en) Memory space managing method, and memory controller and memory storage device using the same
CN110908932B (en) Data processing apparatus and data protection method thereof
JP2005158040A (en) Lazy flushing of translation lookaside buffer
KR20040014971A (en) Non-volatile memory control method
TWI489272B (en) Data protecting method, and memory controller and memory storage device using the same
JP4892414B2 (en) Control circuit, storage medium, processing device, embedded system, and area management method
JP5464226B2 (en) Information processing apparatus, information processing apparatus control method, and information processing apparatus control program
US20140281581A1 (en) Storage Device
CN116225332A (en) Storage management method, storage device and embedded chip
CN108108118B (en) Data writing method and storage controller
US7814288B2 (en) Protecting memory operations involving zero byte allocations
US11113399B2 (en) Electronic apparatus and control method of electronic apparatus
JP2010092113A (en) Storage device, electronic device and data management method
JP4972410B2 (en) Method for controlling access in flash memory and system for implementation of such method
TWI486966B (en) Flash memory storage device, controller thereof, and programming management method thereof
KR100811559B1 (en) Method and apparatus managing data storage partitions for non-volatile memory
CN109669883B (en) Logical memory cell for flash memory

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090819

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20100528

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: 20111122

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: 20111219

R150 Certificate of patent or registration of utility model

Ref document number: 4892414

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20141222

Year of fee payment: 3

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees