簡易檢索 / 詳目顯示

研究生: 黃俊霖
Huang, Jun-Lin
論文名稱: 微核心作業系統通用串列匯流排驅動程式之設計與實作
The Design and Implementation of Universal Serial Bus Driver in a Microkernel Operating System
指導教授: 陳 敬
Chen, Jing
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 電腦與通信工程研究所
Institute of Computer & Communication Engineering
論文出版年: 2009
畢業學年度: 97
語文別: 中文
論文頁數: 127
中文關鍵詞: 微核心驅動程式嵌入式系統通用串列匯流排
外文關鍵詞: Microkernel, Driver, USB, Embedded System
相關次數: 點閱:116下載:2
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 本論文研究微核心(Micro-Kernel)作業系統為基礎架構的通用串列匯流排(Universal Serial Bus, USB)驅動控制模組之設計並進行實作,其主要的目的在於提供微核心作業系統對以USB為介面之週邊裝置進行溝通與控制之功能,應用程式因而可使用USB介面之週邊裝置。
    本論文設計與實作之重點是微核心架構下的USB主機驅動模組,此模組包含︰USB管理模組(USB Manager)及提供應用程式USB功能介面的函式庫。USB管理模組採用標準的三層式架構︰主機控制器驅動程式(Host Controller Driver, HCD)、USB驅動程式(USB Driver, USBD)及類別驅動程式(Class Driver)。USBD是最重要的管理中樞,系統核心利用訊息傳遞機制與其溝通,以達到管理控制USB裝置的效用;HCD提供USB堆疊一個制式的控制介面;類別驅動程式支援三種常用的USB裝置類別,提供USB集線器(Hub)裝置、大容量儲存裝置(Mass Storage Device)及HID(Human Interface Device)鍵盤的驅動程式。而USB函式庫實作易於使用的應用程式介面,以提供軟體開發人員用設計應用USB裝置之程式。
    USB裝置的普及與大量應用已經在現今成為不可擋的趨勢,不論在桌上型電腦、筆記型電腦、嵌入式系統產品甚至於各種手持裝置,USB已幾乎成為必備的裝置連接介面。因此本論文之主要成果在於為微核心作業系統提供有效率且可靠的USB驅動模組實作及輸入與輸出控制功能。此一實作相當模組化與參數化,並擁有一個與系統核心及其它模組互相獨立的熱插拔機制,也能很容易地移植到其它平台。

    This thesis presents the design and implementation of a USB host driver module as part of a microkernel opering system for embedded system platform. The goal is to provide the microkernel operating system the capability of communicating with other devices, through standard USB interfaces, when they are attached to the system. The resulting implementation is a host-side USB driver module which consists of a USB manager and a USB library.
    The design concept of this USB manager is a three-layer architecture which includes HCD(Host Controller Driver) layer, USBD(USB Driver) layer, and Class Driver layer. The USBD is the control center for USB protocols and devices. It operates with the microkernel through message passing. The HCD provides an interface for USBD to control the USB host controller. The USB module supports popular USB device class drivers including USB hub device, mass storage device and HID(Human Interface Device)-keyboard. The USB library implements essential APIs(Application Programing Interfaces) for user to develop their own USB applications.
    The USB devices have been very popular in varuous comsumer eletronic products nowadays and make USB a indispensable interface to these products. This thesis attempts to provide an impltmentation of achiving an efficient and reliable USB module in a microkernel operating system. Its implementation is modulized and parameterized. The USB module has a hot swapping mechanism which is separated from the microkernel and other modules in the system. It can be ported to other platform without much effort.

    目 錄 第1章 簡 介 1 1.1 微核心作業系統 1 1.2 通用串列匯流排簡介 2 1.3 研究動機 6 1.4 章節規劃 6 第2章 相關研究 7 2.1 USB協定與架構 7 2.1.1 USB資料流模式與管線概念 7 2.1.2 USB通訊流 8 2.1.3 裝置端點 10 2.1.4 管線 10 2.1.5 USB傳輸模式 11 2.1.6 USB描述元 12 2.2 微核心作業系統之USB模組 14 2.2.1 QNX 14 2.3 單體式核心作業系統之USB模組 16 2.3.1 Linux 16 2.3.2 Windows 18 2.4 獨立式USB模組 20 2.4.1 Embedded USB Host Stack 20 2.4.2 USBware Host Stack 21 2.5 USB函式庫 22 2.5.1 libusb USB函式庫 22 2.6 比較與討論 23 第3章 USB主機堆疊之設計與實作 25 3.1 概述 25 3.1.1 硬體開發環境 27 3.1.2 軟體開發環境 28 3.1.3 Zinix微核心作業系統 28 3.1.4 Zinix之訊息傳遞機制 28 3.1.5 Zinix之驅動程式模型 30 3.1.6 Zinix之軟計時器機制 32 3.2 主機控制器驅動程式(HCD) 33 3.2.1 OHCI主機通訊資料結構 33 3.2.2 主機控制器之管理 35 3.2.3 排程機制 36 3.2.4 HCD傳輸機制之設計與實作 37 3.3 USB匯流排驅動程式(USBD) 38 3.3.1 管線介面 38 3.3.2 指令介面 40 3.3.3 裝置列舉(Device Enumeration) 41 3.4 類別驅動程式(Class Driver) 43 3.5 熱插拔機制 44 3.6 USB函式庫 46 第4章 USB裝置驅動程式之設計與實作 47 4.1 USB集線器驅動程式(Hub Driver) 47 4.1.1 集線器功能概述 47 4.1.2 集線器驅動程式之設計與實作 48 4.2 USB大容量儲存裝置驅動程式(Mass Storage Driver) 50 4.2.1 Zinix之檔案系統 51 4.2.2 USB大容量儲存類別裝置規範及相關知識 53 4.2.3 大容量儲存裝置底層驅動程式之實作 60 4.3 USB鍵盤驅動程式(Keyboard Driver) 62 4.3.1 Zinix之TTY介面 63 4.3.2 USB HID規範及相關知識 65 4.3.3 USB鍵盤驅動程式之實作 70 第5章 USB模組之測試與效能分析 72 5.1 測試環境 72 5.2 功能性驗證 74 5.2.1 USB主機驅動程式(含根集線器驅動程式)測試 74 5.2.2 USB集線器驅動程式測試 80 5.2.3 USB大容量儲存裝置驅動程式測試 84 5.2.4 USB鍵盤驅動程式測試 87 5.3 USB函式庫之使用 89 5.4 效能評估 95 5.4.1 USB大容量儲存裝置驅動程式之效能評估 95 5.4.2 USB鍵盤驅動程式之效能評估 102 5.5 多工測試 102 5.5.1 USB大容量儲存裝置驅動程式之多工效能評估 103 5.5.2 USB鍵盤驅動程式之多工效能評估 104 5.6 USB模組實作成果 106 第6章 結論與未來工作 107 6.1 結論 107 6.2 未來工作 108 參考文獻 109 附錄A 1ms連續中斷對Zinix系統之效能影響評估 112 附錄B FAT驅動程式對USB大容量儲存裝置存取之影響評估 114 附錄C USB HID規範相關對照表 117 自  述 127

    參考文獻

    [1] Benjamin Roch, TU Wien, “Monolithic kernel vs. Microkernel”, 2004.

    [2] USB-IF Embedded Host Compliance Plan Revision 1.0, http://www.usb.org /.

    [3] Universal Serial Bus Revision 2.0 specification, http://www.usb.org /.

    [4] Universal Serial Bus 3.0 Specification, http://www.usb.org/.

    [5] USB, http://en.wikipedia.org/wiki/USB/.

    [6] OMTP, “OMTP Local Connectivity: Data Connectivity”,
    http://www.omtp.org/.

    [7] QNX, http://www.qnx.com/.

    [8] Introduction to the QNX usb subsystem,
    http://www.qnx.com/developers/docs/6.3.2/ddk_en/usb/.

    [9] Linux, http://www.linux.org/.

    [10] GPL, http://www.gnu.org/copyleft/gpl.html/.

    [11] J. Corbet, A. Rubini & G. Kroah-hartman, “Linux Device Driver”, 3rd Edition, O’Reilly, 2005.

    [12] 孫天澤, 袁文菊編著, ”嵌入式設計及Linux驅動開發指南—基於ARM9處理器”,第二版, 大學出版社, 2006.

    [13] Windows, http://zh.wikipedia.org/wiki/Microsoft_Windows/.

    [14] 蔡孟哲, ”WDM Driver程式設計實務”, 碁峰, 2004.

    [15] Jan Axelson原著, 徐瑞明, 陳黎光譯, ”USB 2.0、Wireless USB、USB OTG技術徹底研究”, 第三版, 旗標, 2005.

    [16] Walter Oney原著, 廖榮貴研究室編譯, ”Windows程式設計指南”, 文魁, 2004.

    [17] THESYCON, http://www.thesycon.com/eng/embusbhost.shtml.

    [18] Jungo Inc., ”USBware USB Host Stack White Paper”, http://www.jungo.com/st/embedded_usb_host_stack.html.

    [19] libusb, http://libusb.sourceforge.net/.

    [20] libusb-win32, http://libusb.sourceforge.net/.

    [21] Intel, “Intel PXA27x Processor Family Developer's Manual”.

    [22] 新華電腦公司, “PreSOCes”,
    http://www.microtime.com.tw/product/PreSOCes/PreSOCes.htm.

    [23] Jochen Liedtke, “Toward Real Micro-kernels”, Communications of the ACM, September 1996.

    [24] 洪文彬, ”嵌入式微心系統之設計與實作”, 碩士論文, 國立成功大學, 2005.

    [25] D. Anderson, D. Dzatko, “Universal Serial Bus System Architecture”, 2nd Edition, MindShare, Inc., 2001.

    [26] John Hyde, “USB Design by Example:A Practical Guide to Building I/O Devices”, John Wiley & Sons, Inc., 1999.

    [27] 廖濟林著, “USB 2.0系統開發實例精解”, 電腦人文化出版, 2007.

    [28] 許永和著,”微處理機與USB主從介面之設計與應用”, 儒林, 2005.

    [29] Compaq, Microsoft, National Semiconductor, “OpenHCI, Open Host Controller Interface Specification for USB”, Ver.1.0a, 1999.

    [30] Ubuntu, http://www.ubuntu-tw.org/.

    [31] Das U-Boot, http://www.denx.de/wiki/U-Boot/.

    [32] Jan Axelson, “USB mass storage : designing and programming devices and embedded hosts”, Lakeview Research, 2006.

    [33] 馮育新, ”整合USB之嵌入式系統實作”, 碩士論文, 國立中正大學, 2003.

    [34] USB Device Working Group Committee, http://www.usb.org/about/dwg_charter/.

    [35] Mass Storage Overview, http://www.usb.org/developers/devclass_docs/.

    [36] HID Information, http://www.usb.org/developers/hidpage/.

    [37] Device Class Definition HID 1.11, http://www.usb.org/developers/hidpage/.

    [38] HID Usage Tables 1.12, http://www.usb.org/developers/hidpage/.

    [39] SCSI Standards, T10 Technical Committee, http://www.t10.org/.

    [40] File Allocation Table, http://en.wikipedia.org/wiki/File_Allocation_Table/.

    [41] linux-usb-devel(developer) mailing list, http://www.linux-usb.org/mailing.html/.

    [42] USB Common Class Specification, http://www.usb.org/developers/devclass_docs/.

    [43] 即時與內嵌式系統實驗室, “Zinix技術手冊”, 國立成功大學電腦與通信工程研究所, 2006.

    [44] Andrew S.Tanenbum, Albert S.Woodhull, “Operating Systems – Design and Implementation”, 3rd edition, Prentice Hall, 2006.

    [45] 倉頡輸入法, http://zh.wikipedia.org/w/index.php?title=倉頡輸入法/.

    [46] usbview for windows, http://msdn.microsoft.com/en-us/library/cc748123.aspx/.

    [47] usbview for Linux, http://sourceforge.net/projects/usbview/.

    [48] Scancode, http://en.wikipedia.org/wiki/Scancode/.

    [49] Linux Kernel Source Code, http://www.kernel.org/.

    下載圖示 校內:2010-08-18公開
    校外:2012-08-18公開
    QR CODE