簡易檢索 / 詳目顯示

研究生: 王裴立
Wang, Pei-Li
論文名稱: Linux作業系統統一化硬體抽象層之設計與實作
The Design and Implementation of a Unified Hardware Abstraction Layer for Linux Operating System
指導教授: 陳 敬
Chen, Jing
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 電腦與通信工程研究所
Institute of Computer & Communication Engineering
論文出版年: 2015
畢業學年度: 103
語文別: 中文
論文頁數: 84
中文關鍵詞: 硬體抽象層Linux裝置驅動邏輯裝置遠端操控
外文關鍵詞: hardware abstraction layer, Linux device driver, logical device, remote control
相關次數: 點閱:98下載:5
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 隨著科技的發展,應用程式對於硬體裝置之種類的需求亦趨向多樣化。以Linux作業系統為例,各種硬體裝置在核心空間(kernel space)必須有對應之驅動程式,應用程式在使用者空間(user space)透過系統呼叫(system call)與核心空間之驅動程式溝通。這樣的架構,即是一種抽象化的實現。應用程式欲使用一硬體裝置,必須經由其驅動程式與硬體裝置溝通;常見的方式乃硬體裝置供應商提供使用者空間之函式庫,方便應用程式發開。本論文根據前述之概念設計與實作Linux作業系統之統一化硬體抽象層(UHAL),提供應用程式開發者函式庫,以實現硬體裝置抽象化。使用者依照標準流程使用此標準函式庫,無需瞭解實體裝置之規格或使用方式。
    本論文之設計建構於Linux作業系統的使用者空間,不需要修改Linux作業系統架構,並且可擴充適用於各種裝置設備;主要的內容包含:(1)制定邏輯裝置使用之統一標準;應用程式開發者透過此標準使用該硬體裝置。(2)建立管理機制;在邏輯裝置的使用上,建立有效的管理機制,避免應用程式同時使用裝置之互相干擾。(3)提供應用程式操作介面,以便於適應各種使用環境。
    本論文之實作以Android HAL為基礎框架,於Linux系統建構硬體抽象層。實作內容包含:(1)應用程式操作介面與介面通訊伺服器,提供應用程式開發者在各種環境使用。(2)邏輯裝置管理系統,管理邏輯裝置使用情況。(3)包含感測器、GPS、震動器等類型之邏輯裝置。(4)提供使用者管理介面,使用者可透過此介面操作本系統。
    本論文之主要貢獻為:將統一化硬體抽象層加入Linux系統中,並建立其管理機制。此統一化硬體抽象層,可擴充應用於其它硬體裝置,並且可包含Linux作業系統現有常見之裝置與週邊設備。應用程式透過本論文之架構存取硬體裝置,可簡化存取硬體裝置之流程,降低使用硬體裝置之負擔。

    With the advance in technology of computer hardware and software, computer applications nowadays require diversity in hardware devices. Nevertheless, each hardware device needs its device driver in the software side. Taking Linux operating system as an example, each type of device must have a matching device driver in its kernel space. The application in user space communicates with the device driver through system calls. This is in fact a realization of an abstract concept that, for an application using a hardware device, it needs to communicate with the hardware device through the device driver. The commonly used approaches of the communication is invoking library functions, in user space, which are provided by hardware device maker, and this is convenient for application development. Inspired by the above, this study aims to design and implement a unified hardware abstraction layer (for short, UHAL) on Linux operating system via providing libraries for application developers, and to realize the abstraction of hardware devices. Application programs can invoke suitable application program interfaces in the libraries, without understanding the details of hardware device.
    The UHAL is constructed in the user space of Linux operating system. No modification of the Linux operating system is required and the design can be applied to various devices. The works in this study includes: (1) Develop a unified structure for developers to make use of the logical devices so that application programs can operate physical hardware devices easily. (2) Provide a management mechanism on the usage of logical devices to avoid interference among applications when the hardware device is used. (3) Support application operating interfaces that can be adapted to various scenarios.
    The implementation of UHAL takes advantage of Android HAL to be basic architecture to construct the desired hardware abstraction layer in Linux operating system. The result of this includes: (1) Application program interfaces and logical device server which support application development in various scenarios. (2) Logical device management system which manages the usage of logical devices. (3) Non-traditioned logical devices including sensors, GPS, and vibrators. (4) Providing user management interface for users to operate this system.
    The main contribution of this work is the construction of a unified hardware abstraction layer for Linux operating system with a management mechanism. The unified hardware abstraction layer can be applied to various devices, including existing devices equipped on Linux operation system. When applications operate various devises on Linux operation system, the hardware devices can be accessed via the structure proposed in this study.

    第1章 緒 論 1 1.1 研究背景 1 1.2 研究動機 3 1.3 研究方法 5 1.4 章節規劃 6 第2章 相關研究 7 2.1 硬體抽象層(HAL) 7 2.1.1 Linux作業系統之HAL 7 2.1.2 Android HAL 8 2.1.3 HAL之討論 10 2.2 使用者空間硬體裝置驅動程式 11 2.2.1 Windows Driver Foundation 11 2.2.2 Linux作業系統的使用者空間硬體裝置驅動程式框架 13 2.2.3 使用者空間裝置驅動程式之討論 14 2.3 Android HAL實例應用 14 2.3.1 Android應用伺服器 14 2.3.2 FireFox OS 15 2.4 討論 17 第3章 架構與設計 19 3.1 系統架構概述 19 3.2 應用程式操作介面 22 3.3 邏輯裝置伺服器 25 3.3.1 邏輯裝置存取模組 26 3.3.2 統一化硬體抽象層代理者 28 3.4 邏輯裝置 29 3.5 統一化硬體抽象層管理員 31 3.6 使用者管理介面 33 3.7 UHAL使用說明 35 第4章 實作 37 4.1 實作環境 37 4.2 應用程式操作介面 38 4.3 邏輯裝置伺服器 44 4.3.1 邏輯裝置存取模組 45 4.3.2 統一化硬體抽象層代理者 47 4.4 邏輯裝置 50 4.5 統一化硬體抽象層管理員 55 4.6 使用者管理介面 58 第5章 系統測試與驗證 62 5.1 系統測試環境 62 5.2 系統功能測試 64 5.3 新增裝置範例驗證 72 5.4 效能測試 78 第6章 結論與未來展望 80 6.1 結論 80 6.2 未來展望 80 參考文獻 82

    [1]Android, http://en.wikipedia.org/wiki/Android_(operating_system), accessed on 2014-10-05.
    [2]D-Bus, http://dbus.freedesktop.org/doc/dbus-specification.html, accessed on
    2014-10-05.
    [3]Desktop and Hardware Configuration, http://www.redhat.com/magazine/003jan05/features/hal, accessed on 2014-10-10.
    [4]epoll, http://linux.die.net/man/4/epoll, accessed on 2014-10-20.
    [5]GTK+2.0, https://developer.gnome.org/gtk2, accessed on 2014-10-20.
    [6]Linux Programmer’s Manual (DLOPEN),
    http://man7.org/linux/man-pages/man3/dlopen.3.html, accessed on 2014-10-05.
    [7]Firefox OS, http://en.wikipedia.org/wiki/Firefox_OS, accessed on 2014-10-05.
    [8]HAL, http://en.wikipedia.org/wiki/HAL_(software), accessed on 2014-10-10.
    [9]Human Benchmark, http://www.humanbenchmark.com/tests/reactiontime/statistics, accessed on 2015-01-14.
    [10]Jonathan Corbet, Alessandro Rubini, and Greg Kroah-Hartman, ” Linux Device Drivers,” O'Reilly Media, 2005, ISBN: 9780596005900.
    [11]Mobile Operating System, http://en.wikipedia.org/wiki/Mobile_operating_system, accessed on 2014-10-05.
    [12]Mozilla-Firefox OS,
    https://developer.mozilla.org/en-US/Firefox_OS/Platform/Architecture, accessed on 2014-10-10.
    [13]Nagle’s algorithm, http://en.wikipedia.org/wiki/Nagle%27s_algorithm, accessed on 2015-01-25.
    [14]NMEA 0183, http://en.wikipedia.org/wiki/NMEA_0183, accessed on 2014-10-10.
    [15]Program Club-Windows Sensor Driver,
    http://www.programmer-club.com.tw/ShowSameTitleN/driver/4802.html, accessed on 2014-11-15.
    [16]RS-232, http://zh.wikipedia.org/wiki/RS-232, accessed on 2014-10-20.
    [17]Termios, http://linux.die.net/man/3/termios, accessed on 2014-10-20.
    [18]Udev, http://en.wikipedia.org/wiki/Udev, accessed on 2014-10-10.
    [19]UMDF,
    http://msdn.microsoft.com/en-us/library/windows/hardware/ff560442(v=vs.85).aspx, accessed on 2014-10-10.
    [20]Wii Remote, http://en.wikipedia.org/wiki/Wii_Remote, accessed on 2014-10-20.
    [21]Wiiuse, https://github.com/rpavlik/wiiuse, accessed on 2014-10-20.
    [22]Windows Driver Foundation, http://en.wikipedia.org/wiki/Windows_Driver_Foundation, accessed on 2014-10-10.
    [23]Windows Sensor Device,
    http://msdn.microsoft.com/en-us/library/windows/desktop/dd318936(v=vs.85).aspx, accessed on 2014-10-05.
    [24]X Window System, http://en.wikipedia.org/wiki/X_Window_System, accessed on 2014-10-05.
    [25]Young Jun Cho, Yun Chan Cho and Jae Wook Jeon, “D-Bus Based User Device Driver Framework Design for Linux Mobile Software Platform,” The International Symposium on Industrial Electronics (ISIE), 2009.
    [26]林庭延, XBinder之設計與實作, 碩士論文, 國立成功大學, 2014.
    [27]李駿, 陳小玉, ”Android驅動開發與移植實戰詳解,” 人民郵電出版社, 2012, ISBN: 9787115283610.
    [28]羅昇陽, 老羅的Android之旅- Android HAL概要介紹與學習計畫, http://blog.csdn.net/luoshengyang/article/details/6567257, accessed on 2014-10-20.
    [29]監理法規檢索系統, https://www.mvdis.gov.tw/webMvdisLaw/SorderContent.aspx?SOID=14957, accessed on 2015-01-14.
    [30]陳俊宏, Jollen’s Blog, Android的HAL技術-簡介與發展現況, http://www.jollen.org/blog/2009/10/android-hal-status-report.html, accessed on
    2014-10-10.
    [31]陳俊宏, Jollen’s Blog, Linux Input Device介紹, http://www.jollen.org/blog/2009/04/linux_input_device_apis.html, accessed on
    2014-11-02.
    [32]研製雲端計算環境行動裝置之遠端虛擬服務平台, http://www.openfoundry.org/of/projects/2379, accessed on 2014-10-20.
    [33]吳宜澧, Android應用伺服器之設計與實作, 碩士論文, 國立成功大學, 2013.

    下載圖示 校內:2016-02-16公開
    校外:2016-02-16公開
    QR CODE