KR20040051017A - Method For Tracing Memory Alternate In Multi-Task System - Google Patents

Method For Tracing Memory Alternate In Multi-Task System Download PDF

Info

Publication number
KR20040051017A
KR20040051017A KR1020020078838A KR20020078838A KR20040051017A KR 20040051017 A KR20040051017 A KR 20040051017A KR 1020020078838 A KR1020020078838 A KR 1020020078838A KR 20020078838 A KR20020078838 A KR 20020078838A KR 20040051017 A KR20040051017 A KR 20040051017A
Authority
KR
South Korea
Prior art keywords
memory
task
memory address
data
address
Prior art date
Application number
KR1020020078838A
Other languages
Korean (ko)
Inventor
이별임
Original Assignee
엘지전자 주식회사
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 엘지전자 주식회사 filed Critical 엘지전자 주식회사
Priority to KR1020020078838A priority Critical patent/KR20040051017A/en
Publication of KR20040051017A publication Critical patent/KR20040051017A/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3037Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3471Address tracing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching

Abstract

PURPOSE: A method for tracing the memory change on a multitask system is provided to trace the abnormal memory change through a memory protecting function of an MMU(Memory Management Unit) by setting a memory change trace function with use of a memory address and a data value stored in the address when the data value of the memory address is abnormally changed in the multitask system. CONSTITUTION: In case that the data value stored in the memory address is changed by the unauthorized task execution, the memory change trace function is set by using the memory address and the data value stored in the address(S32). In the case that the task execution having the set memory address and the data value is detected from the MMU, the task information and the task work information are stored in a register(S34). The abnormal memory change trace information including the task information and the task work information stored in the register are informed to a system operator(S35).

Description

멀티태스크 시스템에서의 메모리 변경 추적 방법{Method For Tracing Memory Alternate In Multi-Task System}Method for Tracing Memory Alternate In Multi-Task System}

본 발명은 멀티태스크 시스템에서의 메모리 변경 추적 기능에 관한 것으로, 특히 각 태스크들이 분할하여 사용하는 메모리의 특정 주소에 저장된 데이터 값이 다른 태스크에 의해 비정상적으로 변경되는 경우에 이러한 메모리 변경을 추적하여 시스템 운용자에게 통보할 수 있도록 한 멀티태스크 시스템에서의 메모리 변경 추적 방법에 관한 것이다.The present invention relates to a memory change tracking function in a multitask system. In particular, when a data value stored at a specific address of a memory used by each task is abnormally changed by another task, the system can be tracked by such a memory change. The present invention relates to a memory change tracking method in a multitasking system that can notify an operator.

일반적인 시스템에서 운영체제(Operating System)가 제어하는 프로그램의 기본 단위를 태스크(Task)라 하는데, 대부분의 운영체제들은 다수의 태스크가 동시에 실행되는 멀티태스킹(Multitasking)을 지원하며, 이때 각 태스크들은 하나의 메모리를 일정 영역씩 분할하여 사용한다.In a general system, a basic unit of a program controlled by an operating system is called a task. Most operating systems support multitasking in which a plurality of tasks are executed at the same time. Use by dividing by a certain area.

그리고, 각 태스크는 첨부된 도면 도 1에 도시된 바와 같이 자신에게 할당된 고유의 메모리 영역을 자신의 프로그램 내용이 저장되는 텍스트(text) 영역과, 텍스트 영역에서 사용되는 글로벌 변수 등이 저장되는 데이터 영역을 구분하여 사용하는데, 이때 텍스트 영역에는 프로그램 내용 즉, 해당되는 태스크 어떠한 작업을 수행하는지를 정의한 코드가 저장됨에 따라 임의의 액세스에 의해 변경되지 않고 보호되어야 하므로 판독 전용(Read only)이어야 한다.Each task includes a text area in which its program contents are stored, a global variable used in the text area, and the like, as shown in FIG. 1. In the text area, the program content, that is, the code that defines what task is to be performed, is stored in the text area. Therefore, it should be read-only because it should be protected without change by random access.

하지만, 데이터 영역은 해당되는 태스크 실행에 따라 변수 값이 변경될 수 있어야 하므로 판독 및 기록(Write)이 가능해야 하지만, 각 태스크별로 사용되는 데이터 영역은 다른 태스크의 액세스에 의해서 변경되어서는 안 된다.However, the data area should be able to be read and written because the variable value should be changed according to the task execution, but the data area used for each task should not be changed by the access of other tasks.

이때, 다른 태스크의 액세스에 의해 데이터 영역이 변경되는 것을 방지하는 기능은 운영체제의 커널(Kernel)에서 지원해야 하지만, 이를 지원하지 못하는 커널의 경우에는 태스크 실행중에 자신의 데이터 영역이 아닌 다른 데이터 영역을 액세스(write access)하여 특정 메모리 주소의 값을 변경하는 경우가 발생되는데, 이 경우 어떠한 태스크가 어떻게 값을 변경하였는지에 대해 추적이 불가능한 문제점이 있었다.In this case, the function to prevent the data area from being changed by the access of another task should be supported by the kernel of the operating system. However, in the case of a kernel that does not support this, other data areas other than its own data area may be executed during the task execution. There is a case where a value of a specific memory address is changed by write access, and in this case, there is a problem that it is impossible to keep track of which task has changed the value.

즉, 종래의 멀티태스크 환경에서 비정상적인 데이터 처리나 논리적인 에러가 발생된 태스크는 자신의 데이터 영역이 아닌 다른 태스크의 데이터 영역을 액세스하는 경우가 발생할 수 있는데, 이때 다른 태스크의 데이터 영역에 기록 작업을 수행하여 특정 값이 수정된 경우 실제 그 데이터 영역에 대한 액세스 권한을 갖는 태스크 실행시 수정된 값으로 인해 정상적인 작업을 수행하지 못하게 되는 문제점이 있었다.That is, in a conventional multitasking environment, a task in which abnormal data processing or a logical error occurs may access a data area of a task other than its own data area, and at this time, a write operation may be performed in the data area of another task. If a specific value is modified by executing, there is a problem that normal operation cannot be performed due to the modified value when executing a task that actually has access to the data area.

또한, 이러한 경우 시스템 운용자는 현재 문제가 발생된 태스크의 데이터 영역을 어떠한 태스크가 변경하였는지 추적이 불가능하므로 디버깅(Debugging)이 어려운 문제점이 있었다.In addition, in this case, the system operator cannot easily track which task has changed the data area of the task in which the current problem occurs, which makes debugging difficult.

본 발명은 전술한 바와 같은 문제점을 해결하기 위한 것으로 그 목적은, 멀티태스크 시스템에서 특정 메모리 주소의 데이터 값이 비정상적으로 변경되는 경우 해당되는 메모리 주소 및 그 주소에 저장될 데이터 값을 이용하여 메모리 변경 추적 기능을 설정함으로써, 메모리 관리 유닛의 메모리 보호 기능을 이용하여 해당되는 비정상적인 메모리 변경을 추적할 수 있도록 하는데 있다.SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and an object thereof is to change a memory using a corresponding memory address and a data value to be stored at the address when a data value of a specific memory address is abnormally changed in a multitask system. By setting the tracking function, it is possible to track the corresponding abnormal memory change by using the memory protection function of the memory management unit.

본 발명의 다른 목적은, 메모리 관리 유닛의 메모리 보호 기능을 이용하여 추적된 비정상적인 메모리 변경 추적 정보를 시스템 운용자에게 통보함으로써, 시스템 운용자가 어떤 태스크의 어떤 작업 실행에 의해 메모리가 비정상적으로 변경되었음을 알 수 있도록 하고, 이를 통해 효율적인 디버깅을 수행할 수 있도록 하는데 있다.Another object of the present invention is to notify the system operator of abnormal memory change tracking information tracked using the memory protection function of the memory management unit, whereby the system operator can know that the memory has been abnormally changed by executing some task of a task. The purpose of this is to enable efficient debugging.

도 1은 일반적인 멀티태스크 시스템에서 각 태스크가 사용하게 되는 메모리 분할 상태를 도시한 도면.1 is a diagram illustrating a memory partition state used by each task in a general multitasking system.

도 2는 본 발명에 따른 멀티태스크 시스템에서 메모리 변경 추적 기능을 수행하기 위한 소프트웨어적인 시스템 구성을 도시한 도면.2 is a diagram illustrating a software system configuration for performing a memory change tracking function in a multitasking system according to the present invention.

도 3은 본 발명에 따른 멀티태스크 시스템에서의 메모리 변경 추적 동작을 도시한 순서도.3 is a flow chart illustrating a memory change tracking operation in a multitask system in accordance with the present invention.

도 4는 도 3에 있어, 메모리 변경을 추적하고자 하는 메모리 주소 및 그 주소에 저장될 데이터 값을 설정하기 위한 동작 순서도.FIG. 4 is an operational flow diagram for setting a memory address for which memory change is to be tracked and a data value to be stored at that address in FIG.

도 5는 도 4에 의해 설정되는 메모리 주소 및 그 주소에 저장될 데이터 값을 관리하기 위한 감시 구조체와 데이터 감시 구조체의 연결 구조를 도시한 도면.FIG. 5 is a diagram illustrating a connection structure of a supervisory structure and a data supervisory structure for managing a memory address set by FIG. 4 and a data value to be stored at the address; FIG.

도 6은 도 4에서 설정된 메모리 주소에 대한 데이터 값 변경을 추적하는 동작을 도시한 순서도.FIG. 6 is a flowchart illustrating an operation of tracking a data value change for a memory address set in FIG. 4. FIG.

상술한 바와 같은 목적을 달성하기 위한 본 발명의 특징은, 특정 메모리 주소에 저장된 데이터 값이 허가되지 않은 태스크 실행에 의해 변경되는 경우 상기 메모리 주소 및 그 주소에 저장될 데이터 값을 이용하여 메모리 변경 추적 기능을 설정하는 과정과; 메모리 관리 유닛에서 상기에서 설정된 메모리 주소 및 데이터 값을 갖는 태스크 실행이 감지되는 경우 해당되는 태스크 정보 및 태스크 작업 정보를 레지스터에 저장하는 과정과; 상기 레지스터에 저장된 태스크 정보 및 태스크 작업 정보를 포함하는 비정상적인 메모리 변경 추적 정보를 시스템 운용자에게 통보해 주는 과정을 포함하는 멀티태스크 시스템에서의 메모리 변경 추적 방법을 제공하는데 있다.A feature of the present invention for achieving the object described above is that memory change tracking using the memory address and the data value to be stored at that address if the data value stored at a particular memory address is changed by an unauthorized task execution. Setting a function; Storing a corresponding task information and task task information in a register when a task execution having the memory address and data value set in the memory management unit is detected; The present invention provides a memory change tracking method in a multitask system including notifying a system operator of abnormal memory change tracking information including task information and task work information stored in the register.

그리고, 상기 메모리 변경 추적 기능을 설정하는 과정은, 비정상적으로 변경된 메모리 주소 및 그 주소에 저장될 데이터 값을 이용하여 해당되는 메모리 주소에 대한 데이터 변경 추적을 요청하는 단계와; 상기 메모리 주소를 이용하여 페이지 넘버를 산출한 후에 데이터 감시 리스트에 해당되는 페이지 넘버를 갖는 감시 구조체가 존재하는지 확인하는 단계와; 해당되는 페이지 넘버를 갖는 감시 구조체가 존재하는 경우 새로운 데이터 감시 구조체에 상기 메모리 주소 및 그 주소에 저장될 데이터 값을 기록한 후에 상기 감시 구조체에 연결리스트 방식으로 연결하는 단계를 포함하는 것을 특징으로 한다.The setting of the memory change tracking function may include requesting data change tracking for a corresponding memory address using an abnormally changed memory address and a data value to be stored at the address; After calculating a page number using the memory address, checking whether a watch structure having a page number corresponding to a data watch list exists; And if there is a supervisor structure having a corresponding page number, recording the memory address and data values to be stored at the new data supervisor structure, and then connecting the supervisor structure in a linked list manner.

이때, 상기 메모리 주소를 이용하여 산출한 페이지 넘버를 갖는 감시 구조체가 존재하지 않는 경우 해당되는 메모리 주소가 포함된 페이지를 판독 전용 상태를 변경하는 단계와; 새로운 감시 구조체를 할당하여 상기 페이지 넘버를 기록한 후에 상기 데이터 감시 리스트에 연결 리스트 방식으로 연결하는 단계를 더 포함하는 것을 특징으로 한다.Changing a read-only state of a page including a corresponding memory address if a supervisor structure having a page number calculated using the memory address does not exist; And allocating a new watch structure to record the page number, and then linking the data watch list to the data watch list in a linked list manner.

또한, 상기 태스크 정보 및 태스크 작업 정보를 레지스터에 저장하는 과정은, 태스크에 의해 실행되는 명령을 분석하여 상기 태스크가 액세스하고자 하는 메모리 주소와, 그 주소에 저장할 데이터 값 및 그 크기를 추출하는 단계와; 상기에서 추출한 메모리 주소를 이용하여 페이지 넘버를 산출한 후에 해당되는 페이지 넘버를 갖는 감시 구조체에 연결된 데이터 감시 구조체 중에서 상기에서 추출한 메모리 주소 및 데이터 값을 갖는 데이터 감시 구조체가 존재하는지 확인하는 단계와; 상기에서 추출한 메모리 주소 및 데이터 값을 갖는 데이터 감시 구조체가 존재하는 경우 상기 메모리 주소를 액세스하고자 한 태스크 정보와, 그 태스크의 작업 정보를 레지스터에 저장하는 단계를 포함하는 것을 특징으로 한다.The storing of the task information and task task information in a register may include analyzing a command executed by a task to extract a memory address to be accessed by the task, a data value to be stored at the address, and a size thereof; ; Calculating a page number using the extracted memory address and checking whether a data monitoring structure having the extracted memory address and data value exists among data monitoring structures connected to the monitoring structure having a corresponding page number; Storing a task information for accessing the memory address and a task information of the task in a register when a data monitoring structure having the extracted memory address and data value exists.

이하, 본 발명에 따른 실시예를 첨부한 도면을 참조하여 상세하게 설명하면 다음과 같다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

본 발명에 따른 멀티태스크 환경을 갖는 시스템에서는 메모리의 특정 데이터 영역에 저장된 값이 다른 태스크 실행에 의해 변경되는 경우 효율적인 디버깅을 위해 메모리 관리 유닛(Memory Management Unit)의 메모리 보호(protection) 기능을 이용하여 해당되는 메모리 변경을 추적해서 시스템 운용자에게 통보해 주게 되는데, 이를 위한 소프트웨어적인 시스템 구성은 첨부한 도면 도 2에 도시한 바와 같이, 다수의 각 태스크들이 커널 및 메모리 관리 유닛을 통해 메모리의 특정 할당 영역을 액세스하면서 실행되는 연결을 갖되, 커널과 메모리 사이에 구현되는 메모리 관리 유닛은 시스템 운용자에 의해 설정된 메모리 변경 추적 요청에 따라 허가(permit)되지 않은 다른 태스크의 비정상적인 액세스에 의해 메모리의 특정 데이터 영역이 변경되는 것을 추적하는 기능을 수행하며, 해당되는 메모리 변경 추적 정보를 레지스터(register)에 저장한다.In a system having a multitask environment according to the present invention, when a value stored in a specific data area of a memory is changed by another task execution, a memory protection function of a memory management unit is used for efficient debugging. The corresponding memory change is tracked and notified to the system operator. The software system configuration for this is shown in FIG. 2, in which a plurality of tasks are assigned a specific allocation area of memory through the kernel and the memory management unit. A memory management unit implemented between the kernel and the memory may have a specific data area in memory due to abnormal access of other tasks that are not allowed according to the memory change tracking request set by the system operator. To track changes The memory change tracking information is stored in a register.

이때, 시스템 운용자는 특정 메모리 주소에 저장된 데이터 값이 비정상적으로 변경되는 경우 커널에서 제공하는 인터페이스를 통하여 해당되는 메모리의 특정 데이터 영역에 대한 주소와, 그 주소에 저장될 데이터 값을 미리 설정하여 해당되는 메모리 주소에 대한 데이터 변경 추적을 요청함으로써, 특정 메모리 주소의 데이터 값이 다른 값으로 변경되는 것을 추적할 수 있게 된다.At this time, when the data value stored in a specific memory address is abnormally changed, the system operator presets an address of a specific data area of a corresponding memory and a data value to be stored at the address through an interface provided by the kernel. By requesting data change tracking for a memory address, it is possible to track changes in the data value of a particular memory address to another value.

즉, 메모리 관리 유닛에서는 허가되지 않은 다른 태스크가 미리 설정된 특정데이터 영역의 주소를 액세스하여 다른 값을 기록하는 경우 시스템 운용자의 메모리 변경 추적 요청에 따라 어떤 태스크가 어떠한 작업을 수행하는 중에 비정상적인 메모리 액세스가 발생하였는지를 추적하여 해당되는 메모리 변경 추적 정보를 레지스터에 저장하게 되며, 커널에서는 DSI(Dynamic Skeleton Interface) 예외 처리 기능을 이용하여 레지스터에 저장된 비정상적인 메모리 변경 추적 정보를 시스템 운용자에게 통보해 주게 된다.That is, in the memory management unit, when another unauthorized task accesses an address of a predetermined data area and records a different value, abnormal memory access occurs while a task is performing a task according to a memory change tracking request from a system operator. The memory change tracking information is stored in a register by tracking whether it has occurred, and the kernel notifies the system operator of abnormal memory change tracking information stored in a register by using a dynamic skeleton interface (DSI) exception processing function.

이와 같은 구성을 갖는 멀티태스크 시스템에서의 비정상적인 메모리 변경 추적 동작을 첨부한 도면 도 3을 참조하여 설명하면, 먼저 메모리 관리 유닛에서는 특정 메모리 주소에 저장된 데이터 값이 다른 태스크 실행에 의해 변경되는 경우 해당되는 메모리 주소 및 그 주소에 저장될 데이터 값을 시스템 운용자로부터 입력받아 메모리 변경 추적 기능을 설정하게 된다(스텝 S31, S32).An abnormal memory change tracking operation in a multitask system having such a configuration will be described with reference to FIG. 3. First, in a memory management unit, when a data value stored in a specific memory address is changed by another task execution, The memory change tracking function is set by receiving a memory address and a data value to be stored at the address (steps S31 and S32).

이렇게 하여 메모리 변경 추적 기능이 설정되면, 메모리 관리 유닛은 메모리 보호 기능을 이용하여 앞에서 설정된 메모리 주소 및 데이터 값을 갖는 태스크 실행이 발생되는지 즉, 허가되지 않은 태스크가 앞에서 설정된 메모리 주소를 액세스하여 데이터 값을 변경하고자 하는지를 확인하게 되고(스텝 S33), 이때 해당되는 메모리 주소 및 데이터 값을 갖는 태스크 실행이 감지되는 경우 그 태스크 정보 및 태스크 작업 정보 즉, 어떤 태스크가 어떠한 작업을 실행하는 중에 해당되는 메모리 주소의 데이터 값을 변경하였는지에 대한 추적 정보를 레지스터에 저장하게 된다(스텝 S34).When the memory change tracking function is set in this way, the memory management unit uses the memory protection function to determine whether a task execution with the previously set memory address and data value occurs, that is, an unauthorized task accesses the previously set memory address and the data value. (Step S33), if a task execution having a corresponding memory address and data value is detected, the task information and task task information, that is, a memory address corresponding to which task is executing any task The tracking information as to whether the data value of the data has been changed is stored in the register (step S34).

이후, 커널에서는 레지스터에 저장된 태스크 정보 및 태스크 작업 정보를 포함하는 비정상적인 메모리 변경 추적 정보를 시스템 운용자에게 통보해 줌으로써 효율적인 디버깅을 수행할 수 있도록 한다(스텝 S35).Thereafter, the kernel notifies the system operator of abnormal memory change tracking information including the task information and the task task information stored in the register so that efficient debugging can be performed (step S35).

이를 보다 상세히 설명하면, 상술한 메모리 변경 추적 기능은 메모리의 전체적인 주소 영역들에 대해 수행하는 경우 많은 부하가 발생할 수 있으므로, 시스템 운용자에 의해 미리 설정된 특정 데이터 영역에 대해 한정적으로 수행하는 것이 바람직한 데, 이때 시스템 운용자는 첨부한 도면 도 4와 같은 절차를 통해 커널에서 제공하는 인터페이스를 통해 자신이 감시하고자 하는 메모리의 특정 데이터 영역에 대한 주소 및 그 주소에 저장될 데이터 값을 설정하게 된다.In more detail, the above-described memory change tracking function may generate a lot of load when performing the entire address areas of the memory. Therefore, the memory change tracking function may be limited to a specific data area preset by the system operator. In this case, the system operator sets an address of a specific data area of a memory to be monitored and a data value to be stored in the address through an interface provided by the kernel through the procedure as shown in FIG. 4.

즉, 시스템 운용자는 태스크 실행시 비정상적인 메모리 액세스로 인해 특정 메모리 주소의 데이터 값이 변경되는 경우 디버깅을 위해 태스크 실행시 비정상적으로 변경된 메모리 주소 및 그 주소에 저장될 데이터 값을 이용하여 해당되는 메모리 주소에 대한 데이터 변경 추적을 요청하게 된다(스텝 S41).In other words, if the data value of a specific memory address is changed due to abnormal memory access when the task is executed, the system operator uses the abnormally changed memory address and the data value to be stored at the address when the task is executed for debugging. The data change tracking is requested (step S41).

그러면, 커널에서는 우선 이전에 데이터 감시 기능이 설정되어 있는지, 즉 메모리 관리 유닛의 메모리 보호 기능을 이용하는 DSI 예외 처리 기능이 등록되어 있는지를 확인하게 된다(스텝 S42).Then, the kernel first checks whether the data monitoring function has been previously set, that is, whether the DSI exception processing function using the memory protection function of the memory management unit is registered (step S42).

이때, 메모리 보호 기능을 이용하는 DSI 예외 처리 기능이 등록되어 있는 경우에는 감시하고자 하는 데이터 영역에 대한 주소(즉, 특정 메모리 주소) 및 그 주소에 저장될 값을 설정하기 위해 비어있는 데이터 감시 구조체(datawatcher_t)를 가져오게 된다(스텝 S43).At this time, when the DSI exception handling function using the memory protection function is registered, an empty data watcher structure (datawatcher_t) is set to set an address (that is, a specific memory address) and a value to be stored in the data area to be monitored. ) Is imported (step S43).

하지만, 메모리 보호 기능을 이용하는 DSI 예외 처리 기능이 등록되어 있지않은 경우에는 메모리 관리 유닛의 메모리 보호 기능을 이용하여 시스템 운용자에 의해 설정된 특정 메모리 주소에 대한 데이터 변경을 추적하기 위해 새로운 DSI 예외 처리 기능을 등록한 후(스텝 S42-1)에 비어있는 데이터 감시 구조체를 가져오게 된다(스텝 S43).However, if the DSI exception handling function using the memory protection function is not registered, a new DSI exception handling function may be used to track data changes to a specific memory address set by the system operator using the memory management function of the memory management unit. After registration (step S42-1), an empty data monitoring structure is obtained (step S43).

그리고, 비어있는 데이터 감시 구조체를 가져온 후에는 시스템 운용자가 감시하고자 하는 메모리 주소를 이용하여 페이지 넘버(page number)를 산출하게 되는데(스텝 S44), 여기서 페이지란 메모리를 일정 크기 단위로 나누어 관리하는 데 있어서의 관리 단위로서, 예를 들어 메모리 크기가 10Mbyte이고, 메모리 관리 단위가 되는 한 페이지의 크기가 1Mbyte라고 가정하면, 페이지 넘버는 1 부터 10의 범위 내에서 산출된다.After the empty data monitoring structure is obtained, a page number is calculated by using a memory address that the system operator wants to monitor (step S44). For example, assuming that the memory size is 10 Mbytes and the size of one page serving as the memory management unit is 1 Mbyte, the page number is calculated within the range of 1 to 10.

이후, 커널에 구현된 감시 리스트(watcher_t list)를 검색하여 앞에서 산출한 페이지 넘버가 존재하는지 즉, 산출한 페이지 넘버를 갖는 감시 구조체가 존재하는지를 확인하게 된다(스텝 S45).Subsequently, a watch list (watcher_t list) implemented in the kernel is searched to determine whether a page number calculated above exists, that is, a watch structure having the calculated page number exists (step S45).

이때, 현재 시스템 운용자가 감시하고자 하는 메모리 주소를 이용하여 산출한 페이지 넘버가 데이터 감시 리스트에 존재하지 않는 경우에는 해당되는 페이지 넘버를 갖는 감시 구조체가 존재하지 않음을 의미하므로, 먼저 감시하고자 하는 메모리 주소가 포함된 페이지를 판독 전용 상태로 변경한 후(스텝 S46), 비어있는 감시 구조체(watcher_t)를 할당하여 해당되는 페이지 넘버를 기록한 후에 이를 연결 리스트(Linked List) 방식을 이용하여 데이터 감시 리스트 구조체에 연결하게 된다(스텝 S47).At this time, if the page number calculated using the memory address to be monitored by the current system operator does not exist in the data monitoring list, it means that there is no watch structure having the corresponding page number. Change the page containing the read-only state (step S46), allocate an empty watch structure (watcher_t), record the corresponding page number, and then use the linked list method in the data watch list structure. It connects (step S47).

그리고, 감시하고자 하는 메모리 주소가 포함된 페이지 넘버를 갖는 감시 구조체를 데이터 감시 리스트 구조체에 연결한 후에는 앞에서 가져온 데이터 감시 구조체에 현재 시스템 운용자가 감시하고자 하는 특정 메모리 주소 및 그 주소에 저장될 데이터 값과 데이터 크기를 식별자 정보와 함께 기록한 후(스텝 S48), 해당되는 데이터 감시 구조체를 연결 리스트 방식을 이용하여 앞에서 연결한 감시 구조체에 연결하게 된다(스텝 S49).After connecting the watch structure having the page number including the memory address to be monitored to the data watch list structure, the specific memory address that the current system operator wants to monitor and the data value to be stored in the data watch structure obtained earlier And the data size are recorded together with the identifier information (step S48), and the corresponding data monitoring structure is connected to the previously connected monitoring structure using the linked list method (step S49).

하지만, 스텝 S45에서 현재 시스템 운용자가 감시하고자 하는 특정 메모리 주소를 이용하여 산출한 페이지 넘버가 데이터 감시 리스트에 존재하는 경우에는 해당되는 페이지 넘버를 갖는 감시 구조체가 이미 할당되어 있으며, 또한 감시하고자 하는 특정 메모리 주소가 속하는 페이지가 이미 판독 전용 상태로 변경되었음을 의미하므로, 스텝 S43에서 가져온 데이터 감시 구조체에 현재 시스템 운용자가 감시하고자 하는 특정 메모리 주소 및 그 주소에 저장될 데이터 값과 데이터 크기를 식별자 정보와 함께 기록한 후(스텝 S48), 해당되는 데이터 감시 구조체를 앞에서 산출한 페이지 넘버를 갖는 감시 구조체에 연결 리스트 방식으로 연결하게 된다(스텝 S49).However, if the page number calculated using the specific memory address that the current system operator wants to monitor in step S45 exists in the data monitoring list, the monitoring structure having the corresponding page number is already allocated and the specific monitoring target Since the page to which the memory address belongs is already changed to read-only state, the data monitoring structure obtained in step S43 indicates the specific memory address that the current system operator wants to monitor, and the data value and data size to be stored at the address together with the identifier information. After recording (step S48), the corresponding data monitoring structure is connected to the monitoring structure having the page number calculated above by the linked list method (step S49).

앞에서 설명한 바와 같이 시스템 운용자가 감시하고자 하는 특정 메모리 주소와, 그 메모리 주소에 저장될 데이터 값을 데이터 감시 구조체에 기록한 후에 이를 해당되는 메모리 주소가 속하는 페이지별 감시 구조체에 연결 리스트 방식으로 연결함으로써, 태스크의 비정상적인 메모리 액세스로 인해 변경된 특정 메모리 주소에 대한 감시 기능 즉, 특정 메모리 주소에 대한 메모리 변경 추적 기능을 설정하게 된다.As described above, the system operator writes a specific memory address to be monitored and the data value to be stored in the memory address in the data monitoring structure, and connects it to the page-specific monitoring structure to which the corresponding memory address belongs in a linked list manner. Because of abnormal memory access of, you can set the monitoring function for the changed memory address, that is, the memory change tracking function for the specific memory address.

한편, 상술한 감시 구조체와 데이터 감시 구조체의 연결 구조는 첨부한 도면 도 5를 참조하여 설명할 수 있는데, 도 5는 커널에서 시스템 운용자가 메모리 변경을 추적하기 위해 설정한 특정 메모리 주소 및 그 주소에 저장될 데이터 값을 관리하는 구조를 나타낸 도면으로, 효율적인 관리를 위해 메모리를 페이지 단위로 구분한 후에 이를 감시 구조체로서 관리하고, 각 페이지별로 시스템 운용자에 의해 설정된 특정 메모리 주소 및 그 주소에 저장될 데이터 값이 기록되는 데이터 감시 구조체들을 연결 리스트 방식으로 연결하여 관리하게 된다.Meanwhile, the connection structure of the above-described supervisory structure and the data supervisory structure can be described with reference to FIG. 5, which is attached to a specific memory address set by the system operator in the kernel to track a memory change and the address. This figure shows the structure that manages data values to be stored.It divides memory into page units for efficient management and manages it as a monitoring structure, and the specific memory address set by the system operator for each page and the data to be stored in the address The data monitoring structures in which values are recorded are managed by linking list method.

다음으로, 시스템 운용자가 메모리 변경을 추적하고자 하는 특정 데이터 영역에 대한 주소인 특정 메모리 주소 및 그 주소에 저장될 데이터 값 등이 설정된 후에는 메모리 관리 유닛에서 각 태스크의 메모리 액세스를 추적하여 시스템 운용자에 의해 설정된 특정 메모리 주소의 데이터 값이 변경되는 경우에 이를 시스템 운용자에게 통보하는 일련의 메모리 변경 추적 동작를 수행하는 되는데, 이를 첨부한 도면 도 6을 참조하여 상세하게 설명하면 다음과 같다.Next, after setting the specific memory address, which is the address of the specific data area for which the system operator wants to track the memory change, and the data value to be stored at the address, the memory management unit tracks the memory access of each task to the system operator. When a data value of a specific memory address set by the controller is changed, a series of memory change tracking operations for notifying the system operator are performed. This will be described in detail with reference to FIG. 6.

상술한 시스템에서 실행되는 어느 한 태스크가 소정 명령(instruction)을 실행하게 되면, 메모리 관리 유닛에서는 그 태스크의 명령을 분석하여 액세스하고자 하는 메모리 주소(즉, 특정 데이터 값 저장(즉, write)을 위해 액세스하고자 하는 메모리 주소)와, 그 주소에 저장하고자 하는 데이터 값 및 그 크기를 추출하게 된다.(스텝 S61, S62)When a task executed in the above-described system executes a predetermined instruction, the memory management unit analyzes the instruction of the task to store a memory address (i.e., store a specific data value) that is to be accessed. The memory address to be accessed), the data value to be stored at the address, and its size (steps S61 and S62).

이후, 앞에서 추출한 메모리 액세스 관련 정보 중에서 태스크가 현재 액세스하고자 하는 메모리 주소를 이용하여 그 메모리 주소가 속하는 페이지 넘버를 산출한 후(스텝 S63), 도 4에 도시된 데이터 감시 리스트를 검색하여 동일 페이지 넘버를 갖는 감시 구조체에 연결된 데이터 감시 구조체 중에서 태스크가 현재 액세스하고자 하는 메모리 주소 및 데이터 값을 갖는 데이터 감시 구조체가 존재하는지를 확인하게 된다(스텝 S64).After calculating the page number to which the memory address belongs, using the memory address to which the task currently accesses among the memory access related information extracted earlier (step S63), the data monitoring list shown in FIG. 4 is searched to find the same page number. It is checked whether or not a data monitoring structure having a memory address and a data value that the task currently wants to access exists among the data monitoring structures connected to the monitoring structure having (step S64).

이때, 태스크가 액세스하고자 하는 메모리 주소를 이용하여 산출한 페이지 넘버를 갖는 감시 구조체가 존재하지 않거나, 해당 태스크가 액세스하고자 하는 메모리 주소 및 데이터 값을 갖는 데이터 감시 구조체가 존재하지 않는 경우에는 시스템 운용자가 감시하고자 하는 메모리 주소에 대한 액세스가 아니므로 정상적인 태스크 명령 실행 절차에 따라 메모리를 액세스하여 데이터 처리를 수행한 후(스텝 S65), 태스크의 다음 명령 실행을 대기하게 된다.In this case, when there is no watch structure having a page number calculated using a memory address that the task wants to access, or a data watch structure having a memory address and a data value that the task wants to access does not exist Since it is not an access to the memory address to be monitored, the memory is accessed in accordance with a normal task instruction execution procedure to perform data processing (step S65), and then waits for execution of the next instruction of the task.

하지만, 태스크가 액세스하고자 하는 메모리 주소 및 데이터 값을 갖는 데이터 감시 구조체가 존재하는 경우에는 해당되는 태스크가 다른 태스크에 할당된 특정 메모리 주소를 비정상적으로 액세스하여 데이터 값을 변경하였음을 의미하므로, 현재 해당되는 메모리 주소를 액세스하고자 한 태스크 정보와, 그 태스크가 어떠한 작업을 수행하는 중에 해당되는 메모리 주소에 특정 데이터 값을 저장하고자 하였는지에 대한 태스크 작업 정보를 레지스터에 저장하게 된다(스텝 S66).However, if there is a data monitoring structure with the memory address and data value that the task wants to access, it means that the task has changed the data value by abnormally accessing a specific memory address assigned to another task. The task information for accessing the memory address to be stored and the task task information for which a specific data value is to be stored in the corresponding memory address while the task is performing the task are stored in the register (step S66).

그러면, 커널에서는 DSI 예외 처리 기능을 이용하여 레지스터에 저장된 태스크 정보와 태스크 작업 정보를 포함하는 비정상적인 메모리 변경 추적 정보를 시스템 운용자에게 통보해 줌으로써(스텝 S67), 시스템 운용자는 비정상적인 메모리 변경 추적 정보를 이용하여 신속하고 정확한 디버깅을 수행할 수 있게 된다.Then, the kernel uses the DSI exception handling function to notify the system operator of abnormal memory change tracking information including task information and task operation information stored in registers (step S67), and the system operator uses abnormal memory change tracking information. This allows for quick and accurate debugging.

또한, 메모리 변경 추적 정보를 시스템 운용자에게 통보해 준 커널에서는 해당되는 태스크 실행을 일시 정지시켰다가, 해당되는 메모리 변경 추적 정보를 확인한 시스템 운용자로부터 복귀(exit, quit) 명령을 입력받게 되면 일시 정지상태에서 복귀하여 계속적인 태스크 실행을 진행하게 된다.Also, the kernel that notified the memory change tracking information to the system operator suspends the execution of the task, and when the kernel operator receives the exit (exit, quit) command from the system operator that checks the memory change tracking information, the kernel pauses. It will return from and continue the task execution.

한편으로, 본 발명에 따른 실시예는 상술한 것으로 한정되지 않고, 본 발명과 관련하여 통상의 지식을 가진자에게 자명한 범위내에서 여러 가지의 대안, 수정 및 변경하여 실시할 수 있다.On the other hand, the embodiment according to the present invention is not limited to the above, it can be carried out by various alternatives, modifications and changes within the scope apparent to those skilled in the art with respect to the present invention.

이상과 같이, 본 발명은 멀티태스크 시스템에서 특정 메모리 주소의 데이터 값이 비정상적으로 변경되는 경우 해당되는 메모리 주소 및 그 주소에 저장될 데이터값을 이용하여 메모리 변경 추적 기능을 설정함으로써, 메모리 관리 유닛의 메모리 보호 기능을 이용하여 해당되는 비정상적인 메모리 변경을 추적할 수 있게 되고, 이러한 비정상적인 메모리 변경 추적 정보를 시스템 운용자에게 통보함으로써 어떤 태스크의 어떤 작업 실행에 의해 메모리가 비정상적으로 변경되었음을 알 수 있어 효율적인 디버깅을 수행할 수 있게 된다.As described above, according to the present invention, when the data value of a specific memory address is abnormally changed in a multitask system, the memory change tracking function is set by using a corresponding memory address and a data value to be stored at the address. By using the memory protection function, it is possible to track the corresponding abnormal memory change, and by notifying the system operator with this abnormal memory change tracking information, it is possible to know that the memory has been abnormally changed by the execution of any task of a task, so that efficient debugging can be performed. It can be done.

Claims (4)

특정 메모리 주소에 저장된 데이터 값이 허가되지 않은 태스크 실행에 의해 변경되는 경우 상기 메모리 주소 및 그 주소에 저장될 데이터 값을 이용하여 메모리 변경 추적 기능을 설정하는 과정과;Setting a memory change tracking function using the memory address and the data value to be stored at the address when a data value stored at a specific memory address is changed by an unauthorized task execution; 메모리 관리 유닛에서 상기에서 설정된 메모리 주소 및 데이터 값을 갖는 태스크 실행이 감지되는 경우 해당되는 태스크 정보 및 태스크 작업 정보를 레지스터에 저장하는 과정과;Storing a corresponding task information and task task information in a register when a task execution having the memory address and data value set in the memory management unit is detected; 상기 레지스터에 저장된 태스크 정보 및 태스크 작업 정보를 포함하는 비정상적인 메모리 변경 추적 정보를 시스템 운용자에게 통보해 주는 과정을 포함하는 것을 특징으로 하는 멀티태스크 시스템에서의 메모리 변경 추적 방법.And notifying the system operator of abnormal memory change tracking information including task information and task operation information stored in the register. 제 1항에 있어서,The method of claim 1, 상기 메모리 변경 추적 기능을 설정하는 과정은, 비정상적으로 변경된 메모리 주소 및 그 주소에 저장될 데이터 값을 이용하여 해당되는 메모리 주소에 대한 데이터 변경 추적을 요청하는 단계와;The setting of the memory change tracking function may include requesting data change tracking for a corresponding memory address using an abnormally changed memory address and a data value to be stored at the address; 상기 메모리 주소를 이용하여 페이지 넘버를 산출한 후에 데이터 감시 리스트에 해당되는 페이지 넘버를 갖는 감시 구조체가 존재하는지 확인하는 단계와;After calculating a page number using the memory address, checking whether a watch structure having a page number corresponding to a data watch list exists; 해당되는 페이지 넘버를 갖는 감시 구조체가 존재하는 경우 새로운 데이터감시 구조체에 상기 메모리 주소 및 그 주소에 저장될 데이터 값을 기록한 후에 상기 감시 구조체에 연결리스트 방식으로 연결하는 단계를 포함하는 것을 특징으로 하는 멀티태스크 시스템에서의 메모리 변경 추적 방법.If there is a supervisor structure having a corresponding page number, recording the memory address and data values to be stored at the new data supervisor structure, and then connecting the supervisor structure in a linked list manner. How to track memory changes on task systems. 제 2항에 있어서,The method of claim 2, 상기 메모리 주소를 이용하여 산출한 페이지 넘버를 갖는 감시 구조체가 존재하지 않는 경우 해당되는 메모리 주소가 포함된 페이지를 판독 전용 상태를 변경하는 단계와;Changing a read-only state of a page including a corresponding memory address when a monitoring structure having a page number calculated by using the memory address does not exist; 새로운 감시 구조체를 할당하여 상기 페이지 넘버를 기록한 후에 상기 데이터 감시 리스트에 연결 리스트 방식으로 연결하는 단계를 더 포함하는 것을 특징으로 하는 멀티태스크 시스템에서의 메모리 변경 추적 방법.And allocating a new watch structure to record the page number, and then linking the data watch list to the data watch list in a linked list manner. 제 1항에 있어서,The method of claim 1, 상기 태스크 정보 및 태스크 작업 정보를 레지스터에 저장하는 과정은, 태스크에 의해 실행되는 명령을 분석하여 상기 태스크가 액세스하고자 하는 메모리 주소와, 그 주소에 저장할 데이터 값 및 그 크기를 추출하는 단계와;The storing of the task information and task task information in a register may include analyzing a command executed by a task to extract a memory address to be accessed by the task, a data value to be stored at the address, and a size thereof; 상기에서 추출한 메모리 주소를 이용하여 페이지 넘버를 산출한 후에 해당되는 페이지 넘버를 갖는 감시 구조체에 연결된 데이터 감시 구조체 중에서 상기에서추출한 메모리 주소 및 데이터 값을 갖는 데이터 감시 구조체가 존재하는지 확인하는 단계와;Calculating a page number using the extracted memory address and checking whether a data monitoring structure having the extracted memory address and data value exists among data monitoring structures connected to the monitoring structure having a corresponding page number; 상기에서 추출한 메모리 주소 및 데이터 값을 갖는 데이터 감시 구조체가 존재하는 경우 상기 메모리 주소를 액세스하고자 한 태스크 정보와, 그 태스크의 작업 정보를 레지스터에 저장하는 단계를 포함하는 것을 특징으로 하는 멀티태스크 시스템에서의 메모리 변경 추적 방법.Storing a task information for accessing the memory address and a task information of the task in a register when the data monitoring structure having the extracted memory address and data value exists. How to track memory changes.
KR1020020078838A 2002-12-11 2002-12-11 Method For Tracing Memory Alternate In Multi-Task System KR20040051017A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020020078838A KR20040051017A (en) 2002-12-11 2002-12-11 Method For Tracing Memory Alternate In Multi-Task System

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020020078838A KR20040051017A (en) 2002-12-11 2002-12-11 Method For Tracing Memory Alternate In Multi-Task System

Publications (1)

Publication Number Publication Date
KR20040051017A true KR20040051017A (en) 2004-06-18

Family

ID=37345024

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020020078838A KR20040051017A (en) 2002-12-11 2002-12-11 Method For Tracing Memory Alternate In Multi-Task System

Country Status (1)

Country Link
KR (1) KR20040051017A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294089A (en) * 2015-06-23 2017-01-04 阿里巴巴集团控股有限公司 The method and apparatus assisting the access monitoring to monitored memory headroom

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294089A (en) * 2015-06-23 2017-01-04 阿里巴巴集团控股有限公司 The method and apparatus assisting the access monitoring to monitored memory headroom

Similar Documents

Publication Publication Date Title
CN100428165C (en) Apparatus, system, and method for implementing protected virtual memory subcontexts
US7000225B2 (en) Method for inserting global breakpoints
JP5547373B2 (en) Method for optimizing logging and playback of multitasking applications in a single processor or multiprocessor computer system
US5321835A (en) Method of controlling execution of jobs and system for the same
US6233727B1 (en) Computer system for supporting utilization of functions provided by OS
JP5131563B2 (en) Computer, operation rule application method, operating system
CN101520754A (en) Method and device for positioning function and/or task violating memory access
CN100432955C (en) Detecting method for illegal memory reading and writing
US4623962A (en) Register control processing system
US20060053260A1 (en) Computing system with memory mirroring and snapshot reliability
US20080168239A1 (en) Architecture support of memory access coloring
US5940869A (en) System and method for providing shared memory using shared virtual segment identification in a computer system
KR101701515B1 (en) Apparatus and method for tracing memory access information
US20060123216A1 (en) Locating wasted memory in software applications
US6499094B1 (en) Management of memory heap space for data files accessible to programs operating in different addressing modes
US6785883B1 (en) Software system for tracing data
KR20040051017A (en) Method For Tracing Memory Alternate In Multi-Task System
CN114490054A (en) Context switching method and device, accelerating unit, electronic equipment and system on chip
JPS58211254A (en) Accumulated program controlling system
JP2006018705A (en) Memory access trace system and memory access trace method
US8614799B2 (en) Memory paging
Model Example
CN112667300A (en) Processor data access method and management device based on multiprocessor system
KR20030044319A (en) Debugging method of memory allocation and deallocation for real-time operating system
KR100280569B1 (en) A memory management method using processor

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E601 Decision to refuse application