JP2008040964A - Operating system - Google Patents

Operating system Download PDF

Info

Publication number
JP2008040964A
JP2008040964A JP2006217012A JP2006217012A JP2008040964A JP 2008040964 A JP2008040964 A JP 2008040964A JP 2006217012 A JP2006217012 A JP 2006217012A JP 2006217012 A JP2006217012 A JP 2006217012A JP 2008040964 A JP2008040964 A JP 2008040964A
Authority
JP
Japan
Prior art keywords
access
operating system
thread
specific area
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2006217012A
Other languages
Japanese (ja)
Inventor
Kazuhiro Kurisu
一洋 栗栖
Hiroyuki Saito
博之 斎藤
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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2006217012A priority Critical patent/JP2008040964A/en
Publication of JP2008040964A publication Critical patent/JP2008040964A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Regulating Braking Force (AREA)
  • Storage Device Security (AREA)
  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To solve the problem that it is difficult to protect a memory from an application thread because many small-scale microcomputers do not have hardware for achieving memory protection called a memory management unit. <P>SOLUTION: When this operating system transfers execution authority to an operation thread by using a specific area access break function mounted as a debug function of a microcomputer, the execution authority is transferred to the application thread after a memory area desired to be protected is previously set from the application thread. Consequently, when accessing the protected area by the application thread, an interrupt generated by the specific area access break function brings the execution authority back to the operating system to process a thread subjected to unauthorized memory access. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、オペレーティングシステムに関わり、詳しくはアプリケーションによる不正メモリアクセスの検出と検出後の動作に関する。   The present invention relates to an operating system, and more particularly to detection of illegal memory access by an application and operation after detection.

近年、マイクロコンピュータに搭載される組み込みソフトウェアは、サイズの増大や処理の多様化によりますます複雑化している。このような中で、比較的小規模な組み込みシステムにおいても、オペレーティングシステムが搭載されるケースが増えている。オペレーティングシステムを搭載する理由は、ソフトウェアの移植性の向上や、マイクロコンピュータの処理能力に対する利用率の向上など、多くのメリットを期待できるからである。一部のオペレーティングシステムは、アプリケーションプログラムからアクセス可能なメモリ領域以外を保護するためのメモリ保護機能を備えることにより、高い堅牢性を実現している。   In recent years, embedded software installed in microcomputers has become increasingly complex due to the increase in size and the diversification of processing. Under such circumstances, an operating system is increasingly installed even in a relatively small embedded system. The reason for installing an operating system is that many benefits can be expected, such as improved software portability and improved utilization for the processing power of microcomputers. Some operating systems achieve high robustness by providing a memory protection function for protecting areas other than memory areas accessible from application programs.

メモリ保護機能は、マイクロコンピュータに搭載されるメモリ管理ユニットと呼ばれるハードウェアによって実現される。メモリ保護機能は、プロセスと呼ばれる実行単位に分割されたプログラムの間で機能する。そして、オペレーティングシステムは各プロセスに仮想アドレス空間を割り当て、各プロセスは仮想アドレス空間を自由に読み書きすることができる。仮想アドレス空間へのアクセスは、メモリ管理ユニットによって、他のプロセスが占有している実アドレス空間とは重複しない実アドレス空間へのアクセスに変換される。これによって、仮想アドレス空間上では同一のアドレスであっても実アドレス空間上では全く別のメモリエリアへのアクセスへと変換され、互いのプロセスが干渉することなく動作可能となる。   The memory protection function is realized by hardware called a memory management unit mounted on the microcomputer. The memory protection function functions between programs divided into execution units called processes. The operating system allocates a virtual address space to each process, and each process can freely read and write the virtual address space. The access to the virtual address space is converted by the memory management unit into access to the real address space that does not overlap with the real address space occupied by other processes. As a result, even in the virtual address space, the same address is converted into access to a completely different memory area in the real address space, and the processes can operate without interfering with each other.

しかしながら、パーソナルコンピュータ用マイクロプロセッサや大規模な組み込み機器用マイクロコンピュータと異なり、小規模なマイクロコンピュータは、メモリ管理ユニットを持たない。このような小規模なマイクロコンピュータのシステムでは、アプリケーションプログラムとオペレーティングシステムを別々のプロセスに分割できず、オペレーティングシステムとアプリケーションプログラムを同一のアドレス空間を共有するスレッド(プロセスを構成する更に小さな実行単位)として動作させるしかなく、アプリケーションプログラムからオペレーティングシステムのメモリ空間を保護することができない。   However, unlike a microcomputer for a personal computer or a microcomputer for a large-scale embedded device, a small-scale microcomputer does not have a memory management unit. In such a small microcomputer system, the application program and the operating system cannot be divided into separate processes, and threads that share the same address space between the operating system and the application program (smaller execution units constituting the process) The memory space of the operating system cannot be protected from the application program.

一方、メモリ空間の保護はできなくとも、不正メモリアクセスが発生したことを早期に検出できれば、突然の例外を防ぐことができ、安定性の向上に寄与する。特許文献1が開示する方法では、スレッドのスイッチングに際して、スレッドに割り当てられたメモリエリアの検査コード(チェックサム)を比較することにより不正アクセスの検出を可能としている。すなわち、実行権があるスレッドから別のスレッドに移る直前に実行権を失う側のスレッドの検査コードを記録しておいて、再び元のスレッドに実行権が戻ってきたときにもう一度検査コードを計算し、記録された検査コードと比較する。こうして、不正なメモリアクセスを事前に検知するのである。
特開2004−326331号公報
On the other hand, even if the memory space cannot be protected, if the occurrence of illegal memory access can be detected at an early stage, a sudden exception can be prevented, which contributes to the improvement of stability. In the method disclosed in Patent Document 1, unauthorized switching can be detected by comparing inspection codes (check sums) of memory areas allocated to threads when switching threads. That is, record the inspection code of the thread that loses execution right just before moving from the thread with execution right to another thread, and calculate the inspection code again when the execution right returns to the original thread again And compare with the recorded inspection code. In this way, illegal memory access is detected in advance.
JP 2004-326331 A

しかしながら、特許文献1が開示する従来の技術の不正メモリアクセスの検知方法は、スレッドの切り替えに際し、毎回検査コードの算出が必要になるためオーバーヘッドが増大し、応答性が損なわれてしまう。特に、組み込み機器のようなリアルタイム性を要求されるシステムにおいては、軽量な方法で不正メモリアクセスを検出したいという要求がある。   However, the conventional technique for detecting illegal memory access disclosed in Patent Document 1 requires an inspection code to be calculated every time a thread is switched, which increases overhead and impairs responsiveness. In particular, in a system that requires real-time performance such as an embedded device, there is a demand for detecting an illegal memory access by a lightweight method.

上記課題を解決するために、本発明のオペレーティングシステムは、メモリに予め指定した特定のアドレスエリアに、リード又はライトアクセスを行った際に割り込みを発生する特定エリアアクセスブレーク機能を備えたマイクロコンピュータ上で動作するオペレーティングシステムであって、該マイクロコンピュータ上で動作するものであって該オペレーティングシステムが実行権を管理する複数のアプリケーションスレッドのうちのいずれか一つに該オペレーティングシステムが実行権を与える際に、該特定エリアにアクセスしたときに該特定エリアアクセスブレーク機能の割り込みを発生するように設定し、該アプリケーションスレッドが該特定エリアにアクセスした際には、このアクセスをアクセス違反とみなし、該特定エリアアクセスブレーク機能の割り込みにより、該オペレーティングシステムに実行権を取り戻し、アクセス違反を行ったアプリケーションスレッドに関して、所定のルールに基づいたスケジューリングを行うという不正アクセス検出機能を備えることを特徴としている。   In order to solve the above problem, an operating system according to the present invention is provided on a microcomputer having a specific area access break function that generates an interrupt when a read or write access is performed to a specific address area designated in advance in a memory. An operating system that operates on the microcomputer, and the operating system grants the execution right to any one of a plurality of application threads that manage the execution right by the operating system. When the specified area is accessed, the specified area access break function is interrupted. When the application thread accesses the specified area, this access is regarded as an access violation, and the specified area is Area Aqua The interrupt Subureku function regained execution right to the operating system, with respect to an application thread that performs access violation, it is characterized in that it comprises the illegal access detecting function of performing scheduling based on a predetermined rule.

また、本発明の制御装置は、メモリに予め指定した特定のアドレスエリアに、リード又はライトアクセスを行った際に割り込みを発生する特定エリアアクセスブレーク機能を備えたマイクロコンピュータ上で動作するオペレーティングシステムであって、該マイクロコンピュータ上で動作するものであって該オペレーティングシステムが実行権を管理する複数のアプリケーションスレッドのうちのいずれか一つに該オペレーティングシステムが実行権を与える際に、該特定エリアにアクセスしたときに該特定エリアアクセスブレーク機能の割り込みを発生するように設定し、該アプリケーションスレッドが該特定エリアにアクセスした際には、このアクセスをアクセス違反とみなし、該特定エリアアクセスブレーク機能の割り込みにより、該オペレーティングシステムに実行権を取り戻し、アクセス違反を行ったアプリケーションスレッドに関して、所定のルールに基づいたスケジューリングを行うという不正アクセス検出機能を備えることを特徴とするオペレーティングシステムが搭載された制御装置であって、アクセス違反を行ったアプリケーションスレッドを停止させても該制御装置の実行に支障がない場合、該アプリケーションスレッドを強制終了させることを特徴としている。   The control device of the present invention is an operating system that operates on a microcomputer having a specific area access break function that generates an interrupt when a read or write access is made to a specific address area designated in advance in a memory. And when the operating system gives the execution right to any one of a plurality of application threads that operate on the microcomputer and the operating system manages the execution right, the specific area Set to generate an interrupt for the specific area access break function when accessed, and when the application thread accesses the specific area, this access is regarded as an access violation, and the interrupt for the specific area access break function is By A control device equipped with an operating system having an unauthorized access detection function for performing scheduling based on a predetermined rule with respect to an application thread that has regained an execution right to the operating system and has made an access violation. If the execution of the control device is not hindered even if the application thread that has made an access violation is stopped, the application thread is forcibly terminated.

さらに、本発明の電動ブレーキコントローラは、上記の制御装置が、車両用の電動ブレーキの制御装置であることを特徴としている。   Furthermore, the electric brake controller of the present invention is characterized in that the control device is a control device for an electric brake for a vehicle.

また、本発明の電動ブレーキコントローラは、不正アクセスがあったことを検出した場合、ドライバーに対し通知する手段を備えたことを特徴としている。
(なお、「アプリケーションスレッド」とは、アプリケーションプログラムのことである。)
In addition, the electric brake controller of the present invention is characterized by comprising means for notifying the driver when it is detected that there has been unauthorized access.
(Note that “application thread” refers to an application program.)

本発明のオペレーティングシステムは、アプリケーションスレッドからの不正なメモリアクセスを検出し、それに応じた再スケジューリング等の処理を可能とするものであるから、このオペレーティングシステムを搭載する制御システムの安定性を向上させるという効果を奏する。   Since the operating system of the present invention detects illegal memory access from an application thread and enables processing such as rescheduling according to the detected memory access, the stability of the control system equipped with this operating system is improved. There is an effect.

また、本発明の制御装置は、不正なアクセスを行ったスレッドの重要度に応じてスレッドのスケジューリングをコントロールできるため、重要度の低いスレッドからの不正なアクセスであればそのスレッドの再スケジューリングを取りやめることによって、不正なメモリアクセスの要因を排除することが可能になる。本発明は、特に動的にソフトウェアを追加できる組み込みシステムに有用であるが、動的にソフトウェアを追加できない組み込みシステムにおいても、アプリケーションスレッドの不正アクセスを発見しやすくなるため、開発時にそのようなソフトウェアを排除することが容易となり、組み込みシステムの品質向上に貢献できる。   In addition, since the control device according to the present invention can control the scheduling of a thread according to the importance of a thread that has performed unauthorized access, the rescheduling of the thread is canceled if it is an unauthorized access from a thread of low importance. As a result, it becomes possible to eliminate the cause of unauthorized memory access. The present invention is particularly useful for an embedded system to which software can be dynamically added. However, even in an embedded system to which software cannot be dynamically added, it is easy to detect unauthorized access to application threads. Can be easily eliminated, and can contribute to improving the quality of embedded systems.

図1は、本発明の一実施例を搭載した電動ブレーキコントローラを装備した車両の概略図を示す。車両1201において、統合制御装置1202は、電動ブレーキアクチュエータ1203,1204,1205,1206のそれぞれに対して制動力を適切に指示するための制御装置である。統合制御装置1202は、電線1211を介して接続されたブレーキ操作子1209に取り付けられたブレーキ操作量センサ1210によって、運転者の操作量や操作力を電気信号として取得する。統合制御装置1202は、それらの検出値に基づいて4輪分の目標押しつけ力を算出し、電気信号に変換し、通信路を介して電動ブレーキアクチュエータ1203,1204,1205,1206に伝達する。   FIG. 1 shows a schematic view of a vehicle equipped with an electric brake controller equipped with an embodiment of the present invention. In the vehicle 1201, the integrated control device 1202 is a control device for appropriately instructing the braking force to each of the electric brake actuators 1203, 1204, 1205, and 1206. The integrated control device 1202 acquires the operation amount and operation force of the driver as an electrical signal by the brake operation amount sensor 1210 attached to the brake operation element 1209 connected via the electric wire 1211. The integrated control device 1202 calculates the target pressing force for the four wheels based on the detected values, converts the target pressing force into an electric signal, and transmits the electric signal to the electric brake actuators 1203, 1204, 1205, and 1206 via the communication path.

電動ブレーキアクチュエータ1203,1204,1205,1206は、従来の油圧式ディスクブレーキと同様に、図2に図示されたブレーキパッド1301をピストン1303によって押し出し、ブレーキロータ1302に押しつけることによって制動力を発生させる構成で、図示しない制御回路、図示しない電動モータ及び図示しないピストン機構を内蔵した機電一体構造を有する。さらに、該電動ブレーキアクチュエータ1203,1204,1205,1206には、図示しないラッチ機構を制御することによってピストン1303を機械的に保持することができる電動パーキングブレーキ機能が搭載されており、図示しない電動モータが作動しない状況でも制動力を維持することができる構成となっている。この電動パーキングブレーキ機能は、通信路を介して前記統合制御装置1202から電気信号によってその適用と解除を可能としている。   The electric brake actuators 1203, 1204, 1205, and 1206 are configured to generate a braking force by pushing out the brake pad 1301 shown in FIG. 2 by the piston 1303 and pressing the brake pad 1302 as in the conventional hydraulic disc brake. Thus, it has an electromechanical integrated structure incorporating a control circuit (not shown), an electric motor (not shown), and a piston mechanism (not shown). Further, the electric brake actuators 1203, 1204, 1205, and 1206 are equipped with an electric parking brake function that can mechanically hold the piston 1303 by controlling a latch mechanism (not shown). The braking force can be maintained even in a situation where the motor does not operate. This electric parking brake function can be applied and released by an electrical signal from the integrated control device 1202 via a communication path.

該電動ブレーキアクチュエータ1203,1204,1205,1206は、統合制御装置1202からの電気信号によって与えられた目標押しつけ力を発生するように該ピストン1303の操作を制御することによって、該ブレーキロータ1302の回転を制動し、その力が同一軸に取り付けられたタイヤ1212,1213,1214,1215に伝わり、車両を減速させる。   The electric brake actuators 1203, 1204, 1205, 1206 rotate the brake rotor 1302 by controlling the operation of the piston 1303 so as to generate a target pressing force given by an electric signal from the integrated controller 1202. And the force is transmitted to tires 1212, 1213, 1214, and 1215 attached to the same shaft, and the vehicle is decelerated.

該電動ブレーキコントローラに搭載されるマイクロコンピュータは、電気的にプログラミング可能なフラッシュROM(図3のA番地からB番地)とRAM(図3のD番地からE番地)を内蔵し、外部メモリを接続しない、いわゆるシングルチップモードで動作している。また、該マイクロコンピュータにはシリアル通信インターフェース、ADコンバータ、PWMなどの周辺ハードウェアが内蔵されており、それらの設定に関わるレジスタ群へのアクセス方式は、該ROM、該RAMなどと同一のアドレス空間(図3のC番地からD番地)でアクセス可能なメモリマップドI/O方式である。   The microcomputer installed in the electric brake controller incorporates an electrically programmable flash ROM (address A to B in FIG. 3) and RAM (address D to E in FIG. 3), and is connected to an external memory. Not working in so-called single-chip mode. The microcomputer has built-in peripheral hardware such as a serial communication interface, an AD converter, and PWM, and the access method to the register group related to the setting is the same address space as the ROM, the RAM, etc. This is a memory mapped I / O method that can be accessed at (address C to address D in FIG. 3).

本実施例を使用したマイクロコンピュータ上で動作するソフトウェアは、図4が示すように、マイクロコンピュータ周辺ハードウェアのレジスタ群を表す「ハードウェア」、電動ブレーキの制御ソフトウェアの処理群を表す「アプリケーション」、ハードウェアとアプリケーションを仲介する「オペレーティングシステム」という3階層から構成される。   As shown in FIG. 4, the software operating on the microcomputer using this embodiment is “hardware” representing a register group of microcomputer peripheral hardware, and “application” representing a processing group of electric brake control software. It is composed of three layers called “operating system” that mediates hardware and applications.

本実施例のオペレーティングシステムは、「システムコール」と呼ばれる特殊な処理を備えており、少なくとも図5に示されたシステムコールが用意される。システムコールは、アプリケーションがオペレーティングシステムの機能を利用するためのインターフェースとなる。   The operating system of this embodiment includes a special process called “system call”, and at least the system call shown in FIG. 5 is prepared. The system call is an interface for an application to use the function of the operating system.

オペレーティングシステムには、デバイスマネージャとスレッドマネージャという2つの機能が備わっている。デバイスマネージャは、周辺ハードウェアの設定を行うためのデバイスドライバと呼ばれるソフトウェアを管理している。スレッドマネージャは、アプリケーションを構成する複数の小さな処理に対して、実行権の割り当てを管理している。これらの小さな処理は、図5のうちの「生成」システムコールによって、図6に示すスレッド管理ブロックと呼ばれる管理情報が対応づけられ、アプリケーションスレッドと呼ばれるオブジェクトとなる。スレッド管理ブロックをアプリケーションスレッドに新たに割り当てる際には、動的に確保したスレッド管理ブロックを割り当てたり、予め決まった数のスレッド管理ブロックを確保しているうちの空いているスレッド管理ブロックを割り当てたりする。こうして生成されたアプリケーションスレッドは、スレッドマネージャが保持するアプリケーションスレッド待ち行列に登録され、マイクロコンピュータの実行権が割り当てられるのを待つことになる。一般的な組み込み機器用オペレーティングシステムは、「待ち」状態にあるアプリケーションスレッドに対して、少なくとも時分割でマイクロコンピュータの実行権を割り当てる機能を持っており、それぞれのアプリケーションスレッドは見かけ上並行して実行することが可能となる。   The operating system has two functions, a device manager and a thread manager. The device manager manages software called a device driver for setting peripheral hardware. The thread manager manages the allocation of execution rights for a plurality of small processes constituting the application. These small processes are associated with management information called a thread management block shown in FIG. 6 by an “generation” system call in FIG. 5 to become an object called an application thread. When a thread management block is newly allocated to an application thread, a dynamically allocated thread management block is allocated, or a free thread management block having a predetermined number of thread management blocks allocated is allocated. To do. The application thread generated in this way is registered in the application thread queue held by the thread manager, and waits for the execution right of the microcomputer to be assigned. A general embedded operating system has a function of assigning the execution right of a microcomputer at least in a time-sharing manner to application threads in a “waiting” state, and each application thread is apparently executed in parallel. It becomes possible to do.

図6に示すスレッド管理ブロックには、アプリケーションスレッドに割り当てられたスタック領域のアドレス、マイクロコンピュータの汎用レジスタ、プログラムカウンタ、アプリケーションスレッドの状態などが保持されている。アプリケーションスレッドの状態には、少なくとも図7が示す「状態」のうちのいずれかが設定される。汎用レジスタやプログラムカウンタは、スレッド管理ブロックではなくスタックに格納してもよい。これらの情報に加えて、本実施例のオペレーティングシステムのスレッド管理ブロックは、このスレッドが不正メモリアクセスを行った際の例外処理ルーチンのアドレスを保持している。   The thread management block shown in FIG. 6 holds the address of the stack area assigned to the application thread, the microcomputer general-purpose register, the program counter, the state of the application thread, and the like. As the state of the application thread, at least one of the “states” illustrated in FIG. 7 is set. General-purpose registers and program counters may be stored in the stack instead of the thread management block. In addition to these pieces of information, the thread management block of the operating system of this embodiment holds the address of the exception handling routine when this thread makes an illegal memory access.

該ブレーキコントローラでは、まず、電動ブレーキコントローラが起動されると、パワーオンリセット割り込みによってオペレーティングシステムを起動するためのブートローダーが実行される。ブートローダーは、図8に示すように、S101にてマイクロコンピュータの初期化を行い、S102にてオペレーティングシステムの初期状態をROMからRAMに読み込み、S103にてオペレーティングシステムの初期化処理をコールする。なお、S103にてオペレーティングシステムに処理が移ってから再びブートローダーに処理が戻ることはない。   In the brake controller, first, when the electric brake controller is activated, a boot loader for activating the operating system is executed by a power-on reset interrupt. As shown in FIG. 8, the boot loader initializes the microcomputer in S101, reads the initial state of the operating system from the ROM into the RAM in S102, and calls the operating system initialization process in S103. Note that the processing does not return to the boot loader again after the processing moves to the operating system in S103.

図9は、オペレーティングシステムの初期化処理の手順を示す。S200にてオペレーティングシステムの初期化が開始すると、S201にて周辺ハードウェアとデータをやりとりするためのプログラムであるデバイスドライバの初期化を行い、S202にてアプリケーションスレッドのスケジューリングを管理するスレッドマネージャを初期化し、それからS203で、オペレーティングシステムのスレッドマネージャによるアプリケーションスレッドのスケジューリングに処理が移る。   FIG. 9 shows the procedure of the initialization process of the operating system. When the initialization of the operating system starts in S200, the device driver, which is a program for exchanging data with peripheral hardware, is initialized in S201, and the thread manager that manages the scheduling of application threads is initialized in S202. Then, in S203, the process moves to scheduling of application threads by the thread manager of the operating system.

オペレーティングシステムの初期化が完了すると、該スレッドマネージャが所定のスケジューリングアルゴリズムに従って実行するアプリケーションスレッドを選定し、そのアプリケーションスレッドに実行権を与える。なお、一度スレッドマネージャのスケジューリングに処理が移ったら、ブレーキコントローラの電源を切らない限り処理が終わることはない。   When the initialization of the operating system is completed, the thread manager selects an application thread to be executed according to a predetermined scheduling algorithm, and grants execution rights to the application thread. Note that once the processing shifts to the scheduling of the thread manager, the processing does not end unless the brake controller is turned off.

本実施例を使用したマイクロコンピュータは、メモリに予め設定した特定のアドレスエリアに対するアクセスが行われた際には、そのアクセスが完了した後に割り込みを発生させる特定エリアアクセスブレーク機能を有している。本実施例のオペレーティングシステムは、この機能を利用して不正なメモリアクセスを検出する。以下、その機能について説明する。   The microcomputer using this embodiment has a specific area access break function that generates an interrupt after the access is completed when a specific address area preset in the memory is accessed. The operating system of this embodiment uses this function to detect unauthorized memory access. The function will be described below.

図4において、アプリケーションは、本来、周辺ハードウェアとデータをやりとりする際には、システムコール経由でデバイスドライバを介して行う。しかし、本発明の一実施例を使用した電動ブレーキコントローラのマイクロコンピュータは、仮想的なアドレス空間を提供する周辺ハードウェアであるメモリ管理ユニットを搭載しておらず、オペレーティングシステムとアプリケーションが同一のメモリ空間を共有しているものである。そのため、本来はアプリケーションからはアクセスできないようにすべき周辺ハードウェアの設定を行うレジスタ群へのアクセスを禁止することができないこととなり、電動ブレーキコントローラとしての安定性を損なうおそれがある。例えば、あるスレッドAというアプリケーションスレッドがシステムコール経由でハードウェアにアクセスしている最中に、スレッドマネージャによって別のスレッドBというアプリケーションスレッドに実行権が移った場合を考える。スレッドBがその処理の中で、スレッドAで使用している周辺ハードウェアの設定を行うレジスタ群にアクセスし、レジスタの値を書き換えた場合、その後再びスレッドAに実行権が移った場合に、そのハードウェアはスレッドAが期待したとおりに動作しないことが起こり得る。   In FIG. 4, an application originally performs data exchange with peripheral hardware via a device driver via a system call. However, the microcomputer of the electric brake controller using one embodiment of the present invention does not have a memory management unit, which is peripheral hardware providing a virtual address space, and has the same operating system and application. It is something that shares space. Therefore, access to a register group for setting peripheral hardware that should not be accessed from an application cannot be prohibited, which may impair stability as an electric brake controller. For example, consider a case where the execution right is transferred to an application thread called another thread B by a thread manager while an application thread called a thread A is accessing the hardware via a system call. When thread B accesses the register group for setting the peripheral hardware used by thread A and rewrites the value of the register in the process, then when the execution right is transferred to thread A again, It may happen that the hardware does not operate as expected by thread A.

本実施例のオペレーティングシステムは、図10に示されたシステムコールの手順と、図11に示されたスレッドマネージャにおけるスケジューリング処理の手順により、アプリケーションスレッドの不正なメモリアクセスを検出する。   The operating system of the present embodiment detects an illegal memory access of an application thread by the procedure of the system call shown in FIG. 10 and the procedure of the scheduling process in the thread manager shown in FIG.

図10において、システムコールが呼び出されると、まず、S801で特定エリアアクセスブレーク機能を無効にする。次に、S802でシステムコールに応じた独自の処理を行い、S803で特定エリアアクセスブレーク機能を再び有効にし、S804でシステムコールを終了し呼び出し元に戻る。例えば、システムコール経由のデバイスドライバを介するハードウェア設定レジスタへのアクセスは不正なアクセスと見なされない。   In FIG. 10, when a system call is invoked, first, the specific area access break function is invalidated in S801. Next, original processing corresponding to the system call is performed in S802, the specific area access break function is re-enabled in S803, the system call is terminated in S804, and the process returns to the caller. For example, access to a hardware setting register via a device driver via a system call is not regarded as unauthorized access.

次に、スレッドマネージャにおけるスケジューリング処理を説明する。図11において、まず、S900が呼び出され、S901で図3に示された周辺ハードウェア領域へのアクセスに対して割り込みが発生するように特定エリアアクセスブレーク機能を初期化する。次に、S902で該特定エリアアクセスブレーク機能を無効にする。そして、S903でアプリケーションスレッド待ち行列から次のスレッド管理ブロックを読み込む。S904では、S903で読み込んだアプリケーションスレッドが「待ち」であるかどうかを判定し、「待ち」状態であればS905に移動し、「待ち」状態でなければS903に戻り、再度待ち行列からスレッド管理ブロックを読み込む。そして、S905で特定エリアアクセスブレーク機能を有効にし、S906に移動し、アプリケーションスレッドに実行権を渡す。こうして、アプリケーションスレッドで不正なハードウェア設定レジスタへのアクセスを行った時だけ、特定エリアアクセスブレーク機能による割り込みが発生する。   Next, scheduling processing in the thread manager will be described. In FIG. 11, first, S900 is called, and a specific area access break function is initialized so that an interrupt is generated for access to the peripheral hardware area shown in FIG. 3 in S901. Next, in S902, the specific area access break function is disabled. In step S903, the next thread management block is read from the application thread queue. In S904, it is determined whether or not the application thread read in S903 is “waiting”. If it is in the “waiting” state, the process moves to S905. If it is not in the “waiting” state, the process returns to S903, and the thread is managed again from the queue. Read the block. In step S905, the specific area access break function is enabled, the process moves to step S906, and the execution right is passed to the application thread. In this way, an interrupt by the specific area access break function occurs only when an illegal access to the hardware setting register is performed by the application thread.

特定エリアアクセスブレーク機能による割り込みでは、図12が示すように、S1001で特定エリアアクセスブレーク機能を無効にし、S1002でアプリケーションスレッドの生成時にスレッド管理ブロックに格納された「不正メモリアクセス発生時の例外処理」を実行し、S1003でスレッド管理ブロックの状態を「違反」に設定する。その後、S1004の「譲渡」システムコールでスケジューリング処理が行われる。なお、上記S1002の不正メモリアクセス発生時の例外処理と、その後のS1003の「違反」の設定は、逆の順序でもよい。   In the interrupt by the specific area access break function, as shown in FIG. 12, the specific area access break function is disabled in S1001, and the exception processing when an illegal memory access occurs is stored in the thread management block when the application thread is generated in S1002. ”Is executed, and the state of the thread management block is set to“ violate ”in S1003. After that, scheduling processing is performed by the “transfer” system call in S1004. Note that the exception processing at the time of illegal memory access in S1002 and the subsequent “violation” setting in S1003 may be in the reverse order.

図13は、ドライバーが最初基本ブレーキ操作を行い、時刻t1500から電動パーキングブレーキに動作を変えたときの様子を示している。ここで基本ブレーキスレッドはドライバーのブレーキペダル操作に応じてブレーキ力を発生させるためのスレッド、イベントロガースレッドはシステムに発生したイベントを監視し、記録するためのスレッド、電動パーキングブレーキスレッドはドライバーの電動パーキングブレーキ操作子の操作に応じてパーキングブレーキを作動させるスレッドである。各アプリケーションスレッドが所定の処理を終えると、スケジューリング処理が行われて実行待ちになっているスレッドに実行権が移る。休止状態になっているスレッドには実行権が移らず、待ち状態のスレッドにだけ実行権が移るようスケジューリングが行われる。   FIG. 13 shows a state in which the driver first performs the basic brake operation and changes the operation to the electric parking brake from time t1500. Here, the basic brake thread is a thread for generating braking force according to the driver's brake pedal operation, the event logger thread is a thread for monitoring and recording events generated in the system, and the electric parking brake thread is the driver's electric This thread activates the parking brake in accordance with the operation of the parking brake operator. When each application thread finishes the predetermined process, the execution right is transferred to the thread waiting for execution after the scheduling process. Scheduling is performed so that the execution right is not transferred to the thread in the dormant state, but the execution right is transferred only to the waiting thread.

本発明に関わる電動ブレーキシステムでは、電動ブレーキを実現するアプリケーションスレッドを図14のごとく重要度をランク付けし、そのランクに応じて、図15に記載された「不正メモリアクセス発生時の例外処理」から選択する。例えば、非重要ランクに分類された「イベントロガー」というアプリケーションスレッドが不正メモリアクセスを行った際には、「イベントロガー」スレッドが強制終了され、上位システムに対して異常が発生したことを通知する。非重要に分類される「イベントロガー」スレッドに対するその後のスケジューリングは行われなくなるが、それ以外のスレッドは通常通りにスケジューリングされるため、基本ブレーキ等のその他の機能は正常に機能する。   In the electric brake system according to the present invention, the application threads for realizing the electric brake are ranked in importance as shown in FIG. 14, and “exception processing when illegal memory access occurs” described in FIG. Select from. For example, when an application thread called “event logger” classified as an unimportant rank makes an illegal memory access, the “event logger” thread is forcibly terminated, and an upper system is notified of an abnormality. . Subsequent scheduling for “event logger” threads classified as unimportant will no longer be performed, but other threads will be scheduled as usual, so other functions such as basic braking will function normally.

一方、重要ランクに分類された電動パーキングブレーキの動作を制御する「電動パーキングブレーキ」というアプリケーションスレッドが不正メモリアクセスを行った際には、強制終了されることはない。上位システムに対して「電動パーキングブレーキ」スレッドが不正メモリアクセスを行ったことは通知されるが、その後のスケジューリングは通常通り行われる。ドライバーに対しては、上位システムから警告灯などを通じて適宜ドライバーに通知される。   On the other hand, when an application thread called “electric parking brake” that controls the operation of the electric parking brake classified into the important rank makes an illegal memory access, it is not forcibly terminated. The host system is notified that the “electric parking brake” thread has made an illegal memory access, but the subsequent scheduling is performed as usual. The driver is appropriately notified to the driver through a warning light or the like from the host system.

このようにすることで、重要な処理の不正なメモリアクセスについては電動ブレーキシステムの稼働を可能な限り引き延ばし、そうではない軽微な処理の不正なメモリアクセスについてはそのアプリケーションスレッドを終了させることで、それによる副作用を防ぎ、電動ブレーキシステムの安定的な稼働を行うことが可能になる。   By doing this, it is possible to extend the operation of the electric brake system as much as possible for unauthorized memory access of important processing, and to terminate the application thread for unauthorized memory access of minor processing that is not so, As a result, side effects can be prevented and the electric brake system can be operated stably.

マイクロコンピュータを搭載する組み込み機器に利用可能である。   It can be used for embedded devices equipped with microcomputers.

本発明の一実施例を搭載した電動ブレーキコントローラを装備した車両の概略図である。It is the schematic of the vehicle equipped with the electric brake controller carrying one Example of this invention. 本実施例に係る電動ブレーキコントローラを備えた車両の電動ブレーキの制動力を発生させる部分の概略図である。It is the schematic of the part which generate | occur | produces the braking force of the electric brake of the vehicle provided with the electric brake controller which concerns on a present Example. 本実施例に係るマイクロコンピュータのメモリ上のアドレス配置図である。It is an address arrangement diagram on the memory of the microcomputer according to the present embodiment. 本実施例に係る電動ブレーキコントローラに搭載されるソフトウェアの構造を説明する図である。It is a figure explaining the structure of the software mounted in the electric brake controller which concerns on a present Example. 本実施例に係る「システムコール」の種類と機能を説明する図表である。It is a chart explaining the kind and function of "system call" concerning a present Example. 本実施例に係る「スレッド管理ブロック」の構造を説明する図である。It is a figure explaining the structure of the "thread management block" concerning a present Example. 本実施例に係るアプリケーションスレッドの「状態」の「説明」を示す図表である。It is a table | surface which shows "Description" of "State" of the application thread concerning a present Example. 本実施例に係る「ブートローダー」の手順を示す図である。It is a figure which shows the procedure of the "boot loader" concerning a present Example. 本実施例に係るオペレーティングシステムの初期化処理の手順を示す図である。It is a figure which shows the procedure of the initialization process of the operating system which concerns on a present Example. 本実施例に係る「システムコール」の手順を示す図である。It is a figure which shows the procedure of the "system call" concerning a present Example. 本実施例に係る「スケジューリング処理」の手順を示す図である。It is a figure which shows the procedure of the "scheduling process" concerning a present Example. 本実施例に係る「特定エリアアクセスブレーク割り込みハンドラ」の手順を示す図である。It is a figure which shows the procedure of the "specific area access break interruption handler" concerning a present Example. 本実施例に係る基本ブレーキスレッド、パーキングブレーキスレッド、イベントロガースレッドとスケジューリング処理のタイムフローを示す図である。It is a figure which shows the time flow of a basic brake thread | sled, a parking brake thread | sled, an event logger thread | sled, and a scheduling process concerning a present Example. 本実施例に係る「アプリケーションスレッド」、「ランク」、「上位システムへの通知」、「不正アクセス後の再スケジュール」の関係を示す図表である。It is a chart which shows the relationship of "application thread", "rank", "notification to a high-order system", and "reschedule after unauthorized access" concerning a present Example. 本実施例に係る「ランク」と「不正メモリアクセス発生時の例外処理」の内容を説明する図表である。It is a table explaining the contents of “rank” and “exception processing when illegal memory access occurs” according to the present embodiment.

符号の説明Explanation of symbols

1201:車両、
1202:統合制御装置、
1203,1204,1205,1206:電動ブレーキアクチュエータ、
1209:ブレーキ操作子、
1210:ブレーキ操作量センサ、
1211:電線、
1212,1213,1214,1215:タイヤ、
1301:ブレーキパッド、
1302:ブレーキロータ、
1303:ピストン
1201: vehicle,
1202: Integrated controller,
1203, 1204, 1205, 1206: Electric brake actuator,
1209: Brake operator
1210: Brake operation amount sensor,
1211: Electric wire,
1212,1213,1214,1215: tires,
1301: Brake pad,
1302: Brake rotor,
1303: Piston

Claims (4)

メモリに予め指定した特定のアドレスエリアに、リード又はライトアクセスを行った際に割り込みを発生する特定エリアアクセスブレーク機能を備えたマイクロコンピュータ上で動作するオペレーティングシステムであって、
該マイクロコンピュータ上で動作するものであって該オペレーティングシステムが実行権を管理する複数のアプリケーションスレッドのうちのいずれか一つに該オペレーティングシステムが実行権を与える際に、該特定エリアにアクセスしたときに該特定エリアアクセスブレーク機能の割り込みを発生するように設定し、
該アプリケーションスレッドが該特定エリアにアクセスした際には、このアクセスをアクセス違反とみなし、該特定エリアアクセスブレーク機能の割り込みにより、該オペレーティングシステムに実行権を取り戻し、アクセス違反を行ったアプリケーションスレッドに関して、所定のルールに基づいたスケジューリングを行うという不正アクセス検出機能を備えることを特徴とするオペレーティングシステム。
An operating system that operates on a microcomputer having a specific area access break function that generates an interrupt when a read or write access is performed to a specific address area designated in advance in a memory,
When the operating system accesses the specific area when the operating system gives an execution right to any one of a plurality of application threads that operate on the microcomputer and the execution system manages the execution right To generate an interrupt for the specific area access break function,
When the application thread accesses the specific area, this access is regarded as an access violation, and the execution right is regained to the operating system by interruption of the specific area access break function. An operating system having an unauthorized access detection function of performing scheduling based on a predetermined rule.
メモリに予め指定した特定のアドレスエリアに、リード又はライトアクセスを行った際に割り込みを発生する特定エリアアクセスブレーク機能を備えたマイクロコンピュータ上で動作するオペレーティングシステムであって、
該マイクロコンピュータ上で動作するものであって該オペレーティングシステムが実行権を管理する複数のアプリケーションスレッドのうちのいずれか一つに該オペレーティングシステムが実行権を与える際に、該特定エリアにアクセスしたときに該特定エリアアクセスブレーク機能の割り込みを発生するように設定し、
該アプリケーションスレッドが該特定エリアにアクセスした際には、このアクセスをアクセス違反とみなし、該特定エリアアクセスブレーク機能の割り込みにより、該オペレーティングシステムに実行権を取り戻し、アクセス違反を行ったアプリケーションスレッドに関して、所定のルールに基づいたスケジューリングを行うという不正アクセス検出機能を備えることを特徴とするオペレーティングシステムが搭載された制御装置であって、
アクセス違反を行ったアプリケーションスレッドを停止させても該制御装置の実行に支障がない場合、該アプリケーションスレッドを強制終了させることを特徴とする制御装置。
An operating system that operates on a microcomputer having a specific area access break function that generates an interrupt when a read or write access is performed to a specific address area designated in advance in a memory,
When the operating system accesses the specific area when the operating system gives an execution right to any one of a plurality of application threads that operate on the microcomputer and the execution system manages the execution right To generate an interrupt for the specific area access break function,
When the application thread accesses the specific area, this access is regarded as an access violation, and the execution right is regained to the operating system by interruption of the specific area access break function. A control device equipped with an operating system characterized by having an unauthorized access detection function of performing scheduling based on a predetermined rule,
A control apparatus characterized by forcibly terminating an application thread when the execution of the control apparatus is not hindered even when the application thread that has made an access violation is stopped.
請求項2に記載された制御装置が、車両用の電動ブレーキの制御装置であることを特徴とする電動ブレーキコントローラ。   An electric brake controller, wherein the control device according to claim 2 is a control device for an electric brake for a vehicle. 請求項3に記載されたコントローラが、不正アクセスがあったことを検出した場合、ドライバーに対し通知する手段を備えたことを特徴とする電動ブレーキコントローラ。   An electric brake controller, comprising: means for notifying a driver when the controller according to claim 3 detects that there has been unauthorized access.
JP2006217012A 2006-08-09 2006-08-09 Operating system Pending JP2008040964A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006217012A JP2008040964A (en) 2006-08-09 2006-08-09 Operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006217012A JP2008040964A (en) 2006-08-09 2006-08-09 Operating system

Publications (1)

Publication Number Publication Date
JP2008040964A true JP2008040964A (en) 2008-02-21

Family

ID=39175863

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006217012A Pending JP2008040964A (en) 2006-08-09 2006-08-09 Operating system

Country Status (1)

Country Link
JP (1) JP2008040964A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011258245A (en) * 2011-09-27 2011-12-22 Toshiba Corp Server device, start control method, and information processor
US8234487B2 (en) 2010-04-30 2012-07-31 Kabushiki Kaisha Toshiba Server apparatus and startup control method
JP2012226447A (en) * 2011-04-15 2012-11-15 Toyota Motor Corp Information processor
JP2013097436A (en) * 2011-10-28 2013-05-20 Ricoh Co Ltd Error detection method, information processing circuit and program for error detection
JP2014186453A (en) * 2013-03-22 2014-10-02 Hitachi Automotive Systems Ltd Vehicle control apparatus

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8234487B2 (en) 2010-04-30 2012-07-31 Kabushiki Kaisha Toshiba Server apparatus and startup control method
JP2012226447A (en) * 2011-04-15 2012-11-15 Toyota Motor Corp Information processor
JP2011258245A (en) * 2011-09-27 2011-12-22 Toshiba Corp Server device, start control method, and information processor
JP2013097436A (en) * 2011-10-28 2013-05-20 Ricoh Co Ltd Error detection method, information processing circuit and program for error detection
JP2014186453A (en) * 2013-03-22 2014-10-02 Hitachi Automotive Systems Ltd Vehicle control apparatus

Similar Documents

Publication Publication Date Title
KR101862348B1 (en) Method and execution environment for secure execution of program instructions
US7937615B2 (en) Method for improving reliability of multi-core processor computer
JP5318964B2 (en) Extending the processor for secure embedded container execution
CN102289386B (en) Uniform storage device by partial virtualization machine
CN102207886B (en) Virtual machine high-speed simulation is assisted
US7523229B2 (en) Memory protection during direct memory access
US20120331465A1 (en) Virtual machine system, virtual machine control method, virtual machine control application, and semiconductor integrated circuit
JP2007220086A (en) Input/output controller, input/output control system, and input/output control method
JP2004533054A5 (en)
KR20140111998A (en) Creating an isolated execution environment in a co-designed processor
CN103189844A (en) Dynamic balancing of io resources on numa platforms
JP2008040964A (en) Operating system
US20100082929A1 (en) Memory protection method, information processing apparatus, and computer-readable storage medium that stores memory protection program
JP2013161299A (en) Information processing apparatus and interface access method
CN111880891A (en) Micro-kernel-based extensible virtual machine monitor and embedded system
US20080104602A1 (en) Task switching control method and computer system
TW202029045A (en) Verifying stack pointer
WO2014143671A1 (en) Method, apparatus, system, and computer readable medium to provide secure operation
CN102428471A (en) Systems and methods of determining a trust level from system management mode
CN105474174B (en) Controlling time-intensive instructions
JP6679419B2 (en) Memory protection unit, memory management unit, and microcontroller
Im et al. On-demand virtualization for live migration in bare metal cloud
JP4340669B2 (en) INPUT / OUTPUT CONTROL DEVICE, INPUT / OUTPUT CONTROL METHOD, PROCESS CONTROL DEVICE, AND PROCESS CONTROL METHOD
US20120284711A1 (en) Method and Arrangement for Configuring a Resource for a Virtual Runtime Environment
US20060053413A1 (en) Debug system for debugging multi-task system