摘 要:針對以往車載監控系統存在較大延時的缺點,設計一種實時寬帶車載監控系統。該系統通過在32位ARM微處理器中選用可搶占內核和O(1)調度器的Linux 2.6.13 操作系統,以直接修改Linux 內核的方式,從線程化中斷、自旋鎖可搶占兩方面提高系統的實時響應性。測試表明,此系統的數據傳輸實時性和帶寬可以滿足車載監控的要求。
關鍵詞:Linux; ARM微處理器; 線程化中斷; 自旋鎖; 實時響應性
中圖分類號:TN919; TP914文獻標識碼:A
文章編號:1004-373X(2010)15-0173-04
Real-time Vehicle Monitoring System Based on Linux Kernel Modification
LIANG Zhong-hua1,WU Xiao-yun1, FENG Xing-le1,2
(1. School of Information Engineering, Chang’an University, Xi’an 710064, China; 2. Xi’an Research Institute of Navigation Technology, Xi’an 710068, China)
Abstract: A real-time wide-band vehicle monitoring system was designed in view of the long time delay of former vehicle monitoring system. The Linux2.6.13 kernel of O(1) scheduler and preemption in the 32 bits ARM microprocessor is selected. In order to improve real-time responsiveness, the kernel is modified directly by means of threaded interrupt and preemptive spin lock. It is demonstrated that the real-time performance and the band width of this system can satisfy the request of vehicle monitoring system.
Keywords: Linux; ARM microprocessor; threaded interrupt; preemptive spin lock; real-time responsiveness
0 引 言
隨著信息化社會和公路交通的快速發展,車載監控系統已廣泛應用于物流、公交、客運等方面,監控內容也由單純的位置信息轉變為實時在線的多媒體信息,這對系統的實時處理能力和傳輸帶寬提出了更高的要求,選用高性能的嵌入式CPU成為目前高端車載監控系統的發展趨勢,其中選擇嵌入式操作系統又成為影響傳輸效率和實時性的重要因素。目前主流的商用實時嵌入式操作系統(如QNX ,VxWorks 和pSOS 等)由于價格昂貴、技術保密的特點而限制了它的廣泛應用。而Linux操作系統具有開放代碼,易于移植的優點,但由于其設計初衷是實現多任務/多用戶功能,強調各任務共享資源的公平性,采用非搶占式的調度方法,所以無法滿足實時系統的需求[1]。為了使Linux適應實時系統的要求,許多文獻從內核構架、調度機制和搶占能力等方面對現有的Linux操作系統進行改良。文獻[2]提出在Linux內核中插入搶占點的辦法提高實時性,但該方法需要在很多模塊中插入搶占點,實現復雜度很高;另外,若缺乏有效的機制保證搶占前后內核狀態的一致性,特別是搶占點的插入位置選擇不當可能使整個系統崩潰。……