【正文】
支持多核處理器的 RTEMS 嵌入式操作系統(tǒng)研究 分類號: 密級: UDC: 編號: 工學碩士學位論文 支持多核處理器的 RTEMS 嵌入式操作系統(tǒng)的研究 碩士研究生 : ?,撴? 指導教師 : 張國印 教授 學科、專業(yè) : 計算機系統(tǒng)結(jié)構(gòu) 論文主審人 : 姚愛紅 副教授 哈爾濱工程大學 2021 年 03 月 分類號: 密級: UDC: 編號: 工學碩士學位論文 支持多核處理器的 RTEMS 嵌入式操作系統(tǒng)的研究 碩 士 研 究 生 : ?,撴? 指 導 教 師 : 張國印 教授 學 位 級 別 :工學碩士 學 科 、 專 業(yè) : 計算機系統(tǒng)結(jié)構(gòu) 所 在 單 位 : 計算機科學與技術(shù)學院 論 文 提 交 日 期 : 2021 年 1 月 論 文 答 辯 日 期 : 2021 年 3 月 學 位 授 予 單 位 :哈爾濱工程大學 支持多核處理器的 RTEMS 嵌入式操作系統(tǒng)研究 Classified Index : : A Dissertation for the Degree of Research On RTEMS Supporting Multicore Processor Candidate : Niu Yingjiao Supervisor : Prof. Zhang Guoyin Academic Degree Applied for : Master of Engineering Speciality : Computer Architecture Date of Submission : Jan.,2021 Date of Oral Examination : Mar., 2021 University : Harbin Engineering University 哈爾濱工程大學 學位論文原創(chuàng)性聲明 本人鄭重聲明:本論文的所有工作,是在導師的指導下,由作者本人獨立完成的。有關(guān)觀點、方法、數(shù)據(jù)和文獻的引用已在文中指出,并與參考文獻相對應。除文中已注明引用的內(nèi)容外,本論文不包含任何其他個人或集體已經(jīng)公開發(fā)表的作品成果。對本文的研究做出重要貢獻的個人和集體,均已在文中以明確方式標明。本人完全意識到本聲明的法律結(jié)果由本人承擔。 作者 (簽字 ): 日期: 年 月 日 哈爾濱工程大學 學位論文授權(quán)使用聲明 本人完全了解學校保護知識產(chǎn)權(quán)的有關(guān)規(guī)定,即研究生在校攻讀學位期間論文工作的知識產(chǎn)權(quán)屬于哈爾濱工程大學。哈爾濱工程大學有權(quán)保留并向國家有關(guān)部門或機構(gòu)送交論文的復印件。本人允許哈爾濱工程大學將論文的部分或全部內(nèi)容編入有關(guān)數(shù)據(jù)庫進行檢索,可采用影印、縮印或掃描等復制手段保存和匯編本學位論文,可以公布論文的全部內(nèi)容。同時本人保證畢業(yè)后結(jié)合學位論文研究課題再撰寫的論文一律注明作者第一署名單位為哈爾濱工程大學。涉密學位論文待解密后適用本聲明。 本論文 (□在授予學位后即可 □ 在授予學位 12個月后 □解密后 )由哈爾濱工程大學送交有關(guān)部門進行保存、匯編等。 作者 (簽字 ): 導師 (簽字 ): 日期: 年 月 日 年 月 日 支持多核處理器的 RTEMS 嵌入式操作系統(tǒng)研究 摘 要 近年來,隨著信息量爆炸式增長, 計算機系統(tǒng)的性能和功耗之間的矛盾日益凸現(xiàn),單核處理器已不能滿足 各領(lǐng)域 電腦用戶的需求。 單芯片多核處理器 通過在芯片上集成多個頻率較低的可執(zhí)行核來解決單核發(fā)展遇到的瓶頸問題,而研究支持多核處理器的操作系統(tǒng)是多核得以應用的基礎。 RTEMS 嵌入式操作系統(tǒng)對多處理器提供了很好的 支持。但是具體硬件體系結(jié)構(gòu)不同,多核化設計過程中需要實現(xiàn)機制不一樣。本文主 要研究支持 SMP 體系的 RTEMS 多核化實現(xiàn)機制。 論 文首先 剖析 RTEMS 操作系統(tǒng)內(nèi)核,在此基 礎上 研究 RTEMS 系統(tǒng)對多核處理器的支持。 系統(tǒng)采用了共享內(nèi)存的體系架構(gòu),通過中斷機制實現(xiàn)多核之間的通信。針對單核情況下的同步互斥機制在多核系統(tǒng)中不能保持原有語義的問題,系統(tǒng)采用改進 的任務自旋鎖與中斷自旋鎖相結(jié)合的機制,該機制較好的實現(xiàn)了 RTEMS 多核化的同步與互斥 。針 對 RTEMS 多核任務調(diào)度采用統(tǒng)一分配策略帶來 的 不足,在對現(xiàn)有 動態(tài) 調(diào)度算法研究的基礎上,提出根據(jù)系統(tǒng)資源動態(tài)變化自動進行任務調(diào)整 的 兩級動態(tài)任務調(diào)度算法。 本文在 M5 多核仿真平臺上 利用隨機任務圖生成測試任務的方法進行實驗,驗證RTEMS 多核化系統(tǒng)的可行性和高效性,并選擇 加速比和負載平衡效率作為策略性能評價指標 。 測試結(jié)果證明了系統(tǒng)正確性,并且隨著計算規(guī)模不斷增大,新機制 縮短了任務執(zhí)行時間、改善了系統(tǒng)并行效率。 關(guān)鍵詞: 多核處理器; 對稱多處理器; RTEMS; 互斥 ;動態(tài)調(diào)度Abstract In recent years, with the explosive growth of the information, coupled with Moore39。s Law limit, singlecore processors can not meet the needs of puter users in various fields. Singlechip multicore processors solves the bottleneck problems encountered in the development of the singlecore through integrated multiple lower frequencies executable nuclear onchip. Researching operating system that supports multicore processors is the basis of the multicore applications. RTEMS embedded operating system provides a good support for multiprocessor. But realizing what kind of mechanism in the multicore design process should be based on the specific hardware architecture. This article studies the RTEMS implementation mechanism which support SMP architecture. The article first analyze the RTEMS operating systems kernel, then research RTEMS system which provides support for multicore processors. The system uses a shared memory architecture. Multicore achieve munication through the interrupt mechanism. For Synchronization mutex mechanism in the case of the singlecore can not maintain the original semantics in the multicore system, the system uses the task spinlock and the interrupt spinocked bination mechanisms, and to prevent processor core has been in busy state it limits the waiting time for the spinlock. For the deficiencies of the unified allocation strategy implemented in RTEMS multicore system, proposing two dynamic task scheduling algorithm which can automatically adjusted the task according to the dynamic changes of the system resources on the basis of the study in the existing dynamic scheduling algorithm. This article experiments by use of random task graph to generate test tasks on the M5 multicore simulation platform to verify RTEMS multicore system feasibility and efficiency, and select the speed up and load balancing efficiency as a strategic performance evaluation. The test results prove the system correctness, and with the calculation of the increasing scale, the new mechanism shortens the task execution time and improves the parallel efficiency of the system. Key words: multicore processor。 symmetric multi processing。 RTEMS。 mutex mechanism。 dynamic scheduling支持多核處理器的 RTEMS 嵌入式操作系統(tǒng)研究 目 錄 第 1 章 緒論 1 研究背景和意義 1 國內(nèi)外研究現(xiàn)狀 2 主要研究內(nèi)容 3 論文的組織結(jié)構(gòu) 4 第 2 章 RTEMS 操作系統(tǒng)內(nèi)核剖析 5 RTEMS 簡介 5 RTEMS 體系結(jié)構(gòu) 6 RTEMS 內(nèi)核剖析 7 對象 7 任務管理 183