With the development of information age, real-time embedded system is not only applied in industrial automation control, but also more extensive applicatied in multimedia communication, incident handling, environmental monitoring, traffic control and aerospace, etc. The traditional real-time embedded operating system that it's micro kernel structure, only has the function of real-time increasingly unable to satisfy actual application requirements. Therefore, the real-time embedded operating system is developing from the single, weak function to the high specialization multi-purpose, strong function.As a modular monolithic kernel operating system, Linux has powerful, customizable functions, supports nearly all embedded platform, at the same time it has certain real-time performance. In addition, all the development application of Linux must follow the GPL,so its kernel code is open-source, the kernel modifications is completely the free opening. It can be said that, as a general time-sharing system,Linux has great potential to transform into a real-time embedded operating system. This also is a hot spot research of many apex IT companies and Scientific research institution domestic and foreign.First, This topic has researched many classics real-time operating system plans domestic and foreign, detailed analysis on the characteristics of several real-time scheduling algorithm, and has analyzed the structure of Linux kernel and restricts its real-time factors earnestly based on the Linux2.6 kernel code.Then improved the real-time performance of Linux adopted direct modified kernel method:For non-preempted problem of Linux kernel, modify the kernel code, used mutex lock replace the spinlock which hinder preempted, improving the real-time performance of the whole kernel;for the Scheduling algorithm of Linux that it has not enough real-time performance, This topic has combined RM algorithm and EDF algorithm, innovative presented a comprehensive priority-driven scheduling algorithm based on the final time limit while the frequency of the execution as the auxiliary, and programming to replace the scheduling algorithm of Linux kernel, which greatly improved the real-time performance of Linux; In addition, Linux doesn't provide the scheme to prevent priority inversion,this topic adopted the mind of Priority Inheritence Protocol(PIP), add wait queue list and priority records in resource struct, programming in Linux realized the PIP scheme,improved stability and security of the operating system. Finally, using the Lmbench test context switch time of the improved Linux on ARM9 experimental platform building in laboratory, and compared with Linux2.6 to obtain the final results. |