| Embedded systems, especially real-time embedded systems, not only require the logic correctness, but also have strong demand for the execution time. However, the execution time is affected by many factors, such as task scheduling, resource contention, or interrupts. In this situation, traditional system-level debugging mechanism is unable to find this information. It is the superiority of task-level debugging mechanism. Task-level debugging can provide much higher debugging function and analyze the behavior of debugged programs in the framework of operating system, making it suitable to find the task-level bugs.This thesis gives a systematic research on the task analysis mechanism in embedded operating systems, focusing on real-time recording, real-time display, and fast replay mechanism. The main contributions of this thesis are as follows:1. We provide a mechanism to analyze the dynamic task information of embedded operating systems. It includes real-time recording, real-time display, and fast replay. Real-time recording can record all the task information on the fly. Real-time display can draw the states of all the executing tasks. Replay mechanism can show the past task information according to different conditions.2. We implement a task analysis system based on AT697 software simulator and real-time operating system. This system includes an AT697 simulator which simulates the architecture and function of AT697 processor. The simulator can monitor the modification of task information and make a record for that. The system also has an integrated development environment (IDE) which can display the states of task execution on the fly. The IDE is also responsible for the reply of task information.3. We introduce a compression mechanism to reduce the size of recording file. We use different comparison methods for different kinds of task records. Experiment results show that we can reduce almost 70% of the file size, while the slow-down ratio is less than 10%. |