Font Size: a A A

Design And Implementation Of An Embedded OS Kernel

Posted on:2010-07-20Degree:MasterType:Thesis
Country:ChinaCandidate:W H CaoFull Text:PDF
GTID:2178360272497578Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
Embedded operating system as a software platform for embedded systems, need tohave strong real-time performance and stability, and can be tailored to specificapplication environments to carry out cutting and configuration. This thesis's target isto implement a embedded operating system kernel on the platform ofDeviceARM2200 which name is QMGmini. DeviceARM2200 is an ARM7-TDMIcore embedded computer boards, the main components on it are LPC2290 processorand some memory resources.QMGmini embedded operating system kernel is small and can be cut and curing,may be deprived of their type belong to the kernel. Function modules contained in thekernel are: task scheduling modules, the task management module, taskcommunication module, memory management module and the time managementmodule. QMGmini core structure as simple as possimble only contains the above basicfunction modules.The device driver modules, and other non-essential sequence placedat the external of the kernel, kernel only provide the driver framework to enableapplication-level penetration interface directly over the use of equipment, to avoid toomuch interaction with the kernel. System aparts about the interruption of equipment,processors, hardware registers and clock-related part of the compilation procedures arecompleted with ASM, this part of the code are not to be able to transplant. QMGmini'sinterrupt service routine only provides the basic framework, the specific interruptservice reuse in accordance with required C language __swi to achieve soft interrupt.The rest of the code were wirten by the C language, except with the processor on thepart of all ,be able to achieve a standard of transplant.In most embedded operating systems, task is the smallest unit of processorscheduling, a QMGmini task is a thread. There are 4 status of the task, respectively, aredormant, ready status, running status and block status. That is, the presence of dormanttask status in memory, when the task will not be selected to scheduling; when therunning conditions of the task needed are ready the task will enter the ready status, waiting to be selected scheduling; by scheduling selected task will enter running state;because of some reasons, forced or voluntary waiver of the right to use the processorwill enter blocking state, the causes of obstruction can be expressed through the flagbit. After the task was created by system it will direct turn into ready state, until thescheduler has been selected it and put it into running state, by calling the delayefunction the task can blocked itself, or wait for some resouse and events,after thecompletion of task system will destroy it.Task scheduler is apart of real-time kernel module as an important component ofthe merits its performance directly affects the real-time system response time.QMGmini was designed as a kernel can be deprived ,a kernel which can be deprivedcould ensure the emergency response speed.When there is a new tsak appear in theready task table with a priority higher than the class of the task is currently running onthe mission when switching, high-priority task will deprive the runing task's right touse the processor. QMGmini adopted priority-based scheduling algorithm whitch canbe deprived, carry the highest priority ready task out from the ready task table by usingan improved Bitmap algorithm, improved Bitmap Algorithm Supporting an increase ofthe maximum quantity task. Improved support for an increase of Bitmap Algorithm tothe largest number of mission 4 times the original the priority of task can only expressa task. QMGmini provide two kinds of priority class management, one of them is inthe creation of a task when the explicit designation of a priority, this priority class arestatic, in task's life will not be changed; the other one is in the creation of task give thecharacteristic parameters of the task, the system will give the basis of characteristicparameters of the dynamic distribution for the task priority on improved EDF. In thecourse of the study made on the EDF algorithm improvements, taking into account thevalue of the assessment mission. The vaEDF the characteristic parameters of the use oftask to the distribution of priority,The characteristic parameters including the final taskdeadline and achieve value of the task, deadline express the urgency of a task, andvalues is the importance of that task. Using vaEDF could reduce 30% content switch.Tasks carried out between each other the normally required to exchange orsynchronize information, QMGmini has 3 kinds of functions on communicationbetween the tasks, they are interruption switch, semaphores and message queues.Interrupt switch is used to shared one or more global variables to achievecommunication between the tasks, when task in visit the global variable interrupted by anthoer task, then the task visit the variable may change the global variable unexpectedcause a dirty data, when the task enter the critical region should be locked theinterruption, and open it when it quit the critical region. Clearance technology willcause the kernel interrupt response time to be too long, so the use of semaphores andmessage queues are a better choice. A semaphore is a counting value when it is used toexpress a resource the initial value is the large quantity of resources, when it used as amutex the initial value is 1, when it use to express a task is waiting for a flag the initialvalue is 0. Task wants to access resources or waits for the event to obtain should usea semaphore, if the signal is less than 0 put the task on the status of block. Messagequeue is use for inter-task to send chunks of data, and message queue is a cyclestructure, stored in the queue is a pointer whitch point to a C structure. Whether thesignal is from a semphore or the message from the message queue have been abstractinto a event, so there need't to consider higher level communication details of tasks.Once the system equipment has power on,in-chip memory resources of the former64-byte is mapped to the beginning of the 0x00000000 address, this piece of memoryused to store interrupt vectors. QMGmini memory management is an optional module,no need for memory management can put its case removed from the core to reduce thesize of the kernel. Zoning QMGmini memory management implemented in a mannersimilar to the memory distribution memory barrels. Memory for each partition thatcontains the same number of block size, block and block the use of links between theconnected together. From small to large districts might be arranged in a directory, thedirectory identifies the size of each partition, the application memory task adaptationalgorithm used in the first to be met.QMGmini's system clock using the hardware clock signal, LPC2200 has twotimers on the chip, use of the hardware timer can provide accurate clock beats.Oscillation signal from the on-chip crystal oscillator, the frequency latch timer 0 afterPLL change the frequency, the clock pulse frequency can be interrupted in the systemconfiguration. Clock interrupt function provides very important functions, the systemtime, task delays, and a lot of scheduling related operations are handed in the beat theclock function.
Keywords/Search Tags:Embedded System, Kernel, Scheduler, ARM
PDF Full Text Request
Related items