Responsive image
博碩士論文 etd-0817107-115635 詳細資訊
Title page for etd-0817107-115635
論文名稱
Title
嵌入式系統上之使用者模式驅動程式架構的設計與實作
Design and Implementation of a User Mode Driver Framework on Embedded Systems
系所名稱
Department
畢業學年期
Year, semester
語文別
Language
學位類別
Degree
頁數
Number of pages
46
研究生
Author
指導教授
Advisor
召集委員
Convenor
口試委員
Advisory Committee
口試日期
Date of Exam
2007-07-24
繳交日期
Date of Submission
2007-08-17
關鍵字
Keywords
Linux、驅動程式、使用者模式驅動程式
User Mode Driver, Device Driver, Linux
統計
Statistics
本論文已被瀏覽 5680 次,被下載 0
The thesis/dissertation has been browsed 5680 times, has been downloaded 0 times.
中文摘要
驅動程式在作業系統中是很重要的一部份,所有I/O裝置的存取皆需透過驅動程式。其位於核心空間,可以直接存取核心內的資源,所以驅動程式的錯誤亦可能造成系統錯誤。很多嵌入式系統對於系統穩定性有著很高的要求,它們可能執行一些安全相關的工作,或處於一般人無法觸及的環境中。對這些嵌入式系統而言,系統錯誤將會造成嚴重的損失。
使用者模式驅動程式(user mode driver)可以用來避免驅動程式影響作業系統的正常運作。早在1980年代,微核心的研究學者就已經提出使用者模式驅動程式,然而當時在效能上有很大的問題。然而,由於現今Linux 有很好的system call和context switch實作的原因,效能的問題已經漸漸獲得改善。根據研究指出,Gigabit網路卡使用者模式驅動程式的效能已可達到核心驅動程式的93%。
雖然使用者模式驅動程式的效能問題已漸漸解決,但其仍有一大問題阻擾其被廣泛應用。那就是,為了支援使用者空間驅動程式,驅動程式的程式碼必須逐個修改。因此,本論文提出一個使用者驅動程式架構,使現存核心模式驅動程式可以不經修改的移到使用者空間。該架構在使用者空間模擬出核心空間的執行環境,並藉由I/O需求導送與shared memory達成使用者模式驅動程式與核心間的溝通。我們將此架構實作在以ARM Linux為基礎的嵌入式開發平台上。目前的架構雛形支援兩類使用者空間驅動程式:字元裝置驅動程式與網路裝置驅動程式。前者我們實作了LED使用者模式驅動程式與七段顯示器使用者模式驅動程式,而後者我們實作了Ehternet使用者模式驅動程式。
此篇論文的貢獻為二。第一,我們讓核心模式驅動程式可以原封不動的執行在使用者空間。第二,我們實際測量了使用者驅動程式架構在嵌入式系統上之效能。就我們所知,目前也未有文獻提及使用者模式驅動程式在嵌入式系統的效能。根據實驗結果顯示,使用者模式驅動程式的效能可達61%~99%。這顯示我們所提的架構可以在可接受的效能負擔下提升系統的可信賴度。
Abstract
Device driver is an important part of an operating system. All I/O device accesses must be done through device drivers. Because they reside in the kernel address space, a driver fault may lead to a system failure, which is not acceptable for embedded systems with high dependability requirements. Many embedded systems execute safety-critical tasks and hence a system failure will cause a great loss.
Running drivers in user mode can prevent the drivers from damaging the operating system kernel. User mode driver resulted in a large performance degradation when it was proposed during the 1980s. Nonetheless, the performance has been improved due to good implementations of system call and context switch. According to the previous study, the performance of a user mode driver for a Gigabit network card can achieve 93% of that of the kernel mode driver in a Linux-based platform.
Although the performance of user mode drivers has been improved, there is still a crucial problem which handicaps user mode drivers from being utilized widely. That is, drivers have to be modified in order to support a given user mode driver framework. In this thesis, we propose a user mode driver framework, which allows a kernel mode driver to be executed in the user space without any code modifications. The framework emulates the kernel-space execution environment in the user space, In this framework, communication between user mode driver process and the kernel is done through I/O request redirection and shared memory. We implemented the framework on an ARM Linux based embedded system platform. The prototype of our framework supports two classes of user mode drivers: character device drivers and network interface drivers. The former includes a LED and a 7-segment user mode device drivers, and the latter consists of an Ethernet user mode device driver.
Our work has two contributions. First of all, we enable direct execution of kernel mode drivers in the user space without any driver code modifications.. Second, we evaluate the performance of user mode drivers in an embedded system. To the best of our knowledge, no results about performance of user mode drivers on embedded systems have been reported. According to the experimental results, the performance of our user mode drivers can achieve 61%~99% of that of the kernel mode ones. This demonstrates that the framework we propose can improve the reliability of system under the acceptable costs of performance.
目次 Table of Contents
致謝 III
中文摘要 IV
英文摘要 VI
目錄 VIII
圖表目錄 X
第一章 簡介 1
1.1 前言與動機 1
1.2 論文架構 3
第二章 相關研究 4
2.1 核心內部保護領域(In-kernel Protection Domain) 4
2.2 虛擬機器 (Virtual Machines) 4
2.3型別安全語言 (Type-Safe Languages) 4
2.4 使用者模式驅動程式 (User-mode Drivers) 5
2.5 混合模式驅動程式架構 6
第三章 設計與實作 7
3.1設計與實作上之議題 7
3.1.1 核心與使用者空間的溝通機制 7
3.1.1.1 驅動程式介面 9
3.1.1.2 核心程式介面 9
3.1.2 使用者空間存取I/O 10
3.1.3中斷的傳遞與中斷執行緒的實現 11
3.1.4 睡眠與喚醒機制 12
3.1.5 核心資料的同步 13
3.1.6 X86與ARM架構的記憶體管理單元 14
3.2 使用者模式驅動程式架構元件介紹 15
3.2.1 Redirection Module 16
3.2.2 Shared Memory 的設計與管理 17
3.2.3多執行緒的Driver Process實作 18
3.2.4 使用者函式庫 18
3.3 雛型系統實作 19
第四章 實驗結果與分析 21
4.1 實驗平台與測試軟體 21
4.2 CS8900網路卡驅動程式效能測試與分析 22
4.2.1 網路卡驅動程式的效能測試 22
4.2.1.1 單一封包效能測試 23
4.2.1.2 使用Ttcp程式的測試結果與分析 24
4.2.1.3 使用FTP程式的測試結果與分析 26
4.2.1.4 使用web server程式的測試結果與分析 27
4.2.1.5 使用Ping程式的測試結果與分析 28
4.2.2 執行緒間的優先權關係對效能的影響 29
4.2.3 網路驅動程式的部份搬移 30
4.3 字元驅動程式的測試 31
4.3.1 LED驅動程式之效能 31
4.4測試結果與討論 32
第五章 結論與未來工作 33
參考文獻 34
參考文獻 References
[1] ACME Labs Software. “mini_httpd - Small HTTP Server”, available at http://www.acme.com/software/mini_httpd/, Dec 2003.
[2] ACME Labs Software. “http_load – Multiprocessing HTTP Test Client”, available at http://www.acme.com/software/http_load/, Mar 2006.
[3] M. Aiken, M. F¨ahndrich, C. Hawblitzel, G. Hunt, and J.R. Lauris. “Deconstructing Process Isolation”, Microsoft Technical Report MSR-TR-2006-43. Microsoft Inc., 2006.
[4] A. Balakrishnan , S. Krishnan. ”Factorization of Device Driver Code between Kernel and User Spaces”, available at
http://www.cs.wisc.edu/~arinib/report.pdf, May 2006.
[5] A. Chou, J. Yang, B. Chelf, S. Hallem, D. Engler. “An Empirical Study of Operating Systems Errors”, Proceedings of the 18th ACM Symposium on Operating Systems Principles, pp. 73-88, Oct. 2001.
[6] P. Chubb. “Get More Device Drivers out of the Kernel!”, Proceedings of the Ottawa Linux Symposium, vol.1, pp. 149-161, Ottawa, Canada, July, 2004.
[7] C. L. Conway and S. A. Edwards, “NDL: a Domain-specific Language for Device Drivers”, Proceedings of the 2004 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools for Embedded Systems, pp. 30-36, Washington, DC, USA.
[8] T. Chiueh, G. Venkitachalam, and P. Pradhan. ”Integrating Segmentation and Paging Protection for Safe,Efficient and Transparent Software Extensions”, Proceedings of the 17th SOSP, pages 140–153,Kiawah Island Resort, South Carolina, Dec. 1999.
[9] K. Fraser, S. Hand, R. Neugebauer, I. Pratt, A. Warfield, and M. Williamson. “Safe Hardware Access with the Xen Virtual Machine Monitor”, Proceedings of the 1st Workshop on Operating System and Architectural Support for the on Demand IT Infrastructure, Boston, MA, Oct. 2004.
[10] G. C. Hunt. “Creating Uuser-mode Device Drivers with a Proxy”, Proceedings of the 1st USENIX Windows NT WS, 1997.
[11] J. N. Herder, H. Bos, B. Gras, P. Homburg, A. S. Tanenbaum. ”Construction of a Highly Dependable Operating System”, Proceedings of the 6th European Dependable Comp. Conference, Oct 2006.
[12] B. Leslie, P. Chubb, N. Fitzroy-Dale, S. Gotz, C. Gray, L. Macpherson, D. Potts, Y. Shen, K. Elphinstone and G. Heiser. “User-level Device Drivers: Achieved Performance”, Journal of Computer Science and Technology, 20(5):654-664, September, 2005.
[13] J. LeVasseur, V. Uhlig, J. Stoess, and S. Gotz. ”Unmodified Device Driver Reuse and Improved System Dependability via Virtual Machines”, Proceedings of the 6th Symposium on Operating Systems Design and Implementation, pp. 17-30, San Francisco, CA, December 6-8, 2004 .
[14] J. Matthews. “Test TCP (TTCP)”, available at http://www.clarkson.edu/projects/itl/HOWTOS/PCATTCP-jnm-20011113.htm.
[15] F. Merillon, L. Reveillere, C. Consel, R. Marlet and G. Muller. ”Devil: an IDL for Hardware Programming”, Proceedings of the 4th Symposium on Operating Systems Design and Implementation (OSDI 2000), 2000.
[16] Microsoft Corporation. “Introduction to the WDF User Mode Driver Framework”, available at http://www.microsoft.com/whdc/driver/wdf/UMDF_ Intro.mspx, May 16, 2006.
[17] Microsoft Corporation. “FAQ: User-Mode Driver Framework”, available at http://www.microsoft.com/whdc/driver/wdf/UMDF_FAQ.mspx, May 16, 2006.
[18] A. Rubini and J. Corbet. Linux Device Drivers, 2nd Edition, O’Reilly.
[19] M. M. Swift, B. N. Bershad, and H. M. Levy. ”Improving the Reliability of Commodity Operating Systems”, Proceedings of the 19th ACM Symposium on Operating Systems Principles, pp. 207-222, Bolton Landing, NY, October 2003.
[20] M. M. Swift, S. Martin, H. M. Leyand, and S.J. Eggers. “Nooks: An Architecture for Reliable Device Drivers”, Proceedings of the Tenth ACM SIGOPS European Workshop, Saint-Emilion, France, 2002.
[21] A. S. Tanenbaum , J. N.Herder and H. Bos. ”Can We Make Operating System Reliable and Secure ?”, IEEE Computer 39(5): 44-51, 2006.
[22] H. Vemuri., D. Gupta, and R. Moona. “Userdev: A Framework for User Level Device Drivers in Linux”, Proceedings of the 5th NordU/USENIX Conference. Sweden, February 2003.
電子全文 Fulltext
本電子全文僅授權使用者為學術研究之目的,進行個人非營利性質之檢索、閱讀、列印。請遵守中華民國著作權法之相關規定,切勿任意重製、散佈、改作、轉貼、播送,以免觸法。
論文使用權限 Thesis access permission:校內校外均不公開 not available
開放時間 Available:
校內 Campus:永不公開 not available
校外 Off-campus:永不公開 not available

您的 IP(校外) 位址是 3.147.44.118
論文開放下載的時間是 校外不公開

Your IP address is 3.147.44.118
This thesis will be available to you on Indicate off-campus access is not available.

紙本論文 Printed copies
紙本論文的公開資訊在102學年度以後相對較為完整。如果需要查詢101學年度以前的紙本論文公開資訊,請聯繫圖資處紙本論文服務櫃台。如有不便之處敬請見諒。
開放時間 available 已公開 available

QR Code