簡易檢索 / 詳目顯示

研究生: 周建甫
Chou, Chien-Fu
論文名稱: 作業系統動態面向管理機制之設計與實作
The Design and Implementation of Dynamic Aspect Management in Operating Systems
指導教授: 陳 敬
Chen, Jing
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 電腦與通信工程研究所
Institute of Computer & Communication Engineering
論文出版年: 2009
畢業學年度: 97
語文別: 中文
論文頁數: 88
中文關鍵詞: 動態織入面向導向程式設計作業系統程式碼接合
外文關鍵詞: Dynamic weaving, AOP, Operating System, Code Splicing
相關次數: 點閱:80下載:2
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 本論文設計並實作出一適用於作業系統之動態面向織入工具,使作業系統執行期間可進行Aspect之織入與抽離。傳統上,若是要對程式本體增加或改變其功能,往往都需要於程式本體中修改或加入所需程式碼並重新編譯;對於作業系統層級而言,所花費的代價將大幅增加。因此若能於系統執行期間動態改變原有系統核心之功能,對系統軟體開發與維護之效益上將有顯著地提昇。面向導向程式設計與動態面向織入技術對此提供了一個良好之理論基礎。
    本論文所設計之動態面向織入工具其架構是基於動態面向織入技術,允許於選擇之程式碼位置(稱為join point)中織入一段程式碼(稱為advice),可以在系統執行時期動態調整存在於系統之程式行為。此一工具之實作包含織入機制與Aspect管理模組。織入機制採用程式碼接合(code splicing)方式,於欲織入之目標位置植入一道跳轉指令以改變程式執行流程。Aspect管理模組提供對Aspect管理所需之操作功能。本論文所設計之架構並支援於同一個join point中織入多個advice,讓使用者可以更有彈性且精細地調整核心功能。
    為了讓使用者方便操作,本論文實作之動態面向織入工具也包含一個圖形化使用者介面(GUI),讓使用者可以藉由GUI介面之導引填入join point、advice等必要資訊,並自動合成系統可用之Aspect;使用者也可以透過GUI介面程式管理目前存在於系統之所有Aspect。本論文之實作於Linux作業系統以較低之系統需求與額外所需花費之代價不高的情況下運作,結果顯示出其可行性與有效性。

    This thesis presents the design and the implementation of a dynamic aspect weaving tool for operating systems, which is based on aspect-oriented programming (AOP) techniques and enables weaving and unweaving aspects into operating system dynamically during runtime. Traditionally, if we want to add or change the functionality of programs, it is always necessary to modify or insert code into the base programs and re-compile to build executable code images. The cost is usually high especially for operating systems. With dynamic changing system operations at runtime, the cost of system development and maintenance would reduce significantly. AOP and dynamic weaving technology have provided basis for this theory.
    The architecture of the dynamic aspect weaving tool in this thesis is designed based on the notion of dynamic aspect weaving which, by injecting a piece of code (called advice) at selected location of code (called join point), can achieve modulating at runtime the behavior of existing program. The implementation includes the weaving mechanism and an aspect manager. The weaving mechanism is developed adopting code splicing technique to change the execution of program. The aspect manager provides managing operations on aspects and supports weaving multiple advices at the same join point, allowing more flexible and fine-grained adjustment of kernel functions.
    In order to allow users to easily facilitate the operations of creating advices and managing aspects, a graphical user interface (GUI) is implemented for the aspect manager, which can guide user in providing required information like join point, advice, etc. The GUI can initiate synthesizing aspect automatically at user request, and can help manage all aspects woven into the system. The implementation runs on Linux operating system with low system requirement and the runtime overhead incurred is very low. This demonstrated its feasibility and effectiveness.

    第1章 緒 論 1 1.1 研究背景 1 1.2 面向導向程式設計(Aspect-Oriented Programming, AOP) 3 1.2.1 AOP簡介 3 1.2.2 AOP術語 5 1.2.3 AOP範例-同步化緩衝區之實作 7 1.3 研究動機及目的 8 1.4 章節規劃 10 第2章 相關研究 11 2.1 Dynamic AOP與Code instrumentation 11 2.1.1 處理器上除錯支援(CPU Debug Support) 11 2.1.2 改寫二進制代碼(Binary Rewriting) 12 2.1.3 低階虛擬機器(Low-Level Virtual Machines) 13 2.1.4 虛擬機器上之HotSwap機制應用 13 2.2 AOP與作業系統之結合 13 2.3 實例探討 14 2.3.1 ARACHNE 14 2.3.2 KLASY 15 2.3.3 TOSKANA 16 2.4 討論 17 第3章 系統設計 19 3.1 系統架構與組成 19 3.1.1 aspectMaker 21 3.1.2 aspectRegistrar 21 3.1.3 aspectManager 22 3.2 Aspect織入程序 22 3.3 Aspect移除程序 23 3.4 Aspect執行流程 24 3.4.1 Before執行流程 25 3.4.2 After執行流程 27 3.4.3 Around執行流程 28 3.4.4 Replace執行流程 30 3.5 系統運作說明 31 第4章 系統實作 33 4.1 系統實作環境 33 4.2 織入機制實作 33 4.3 Aspect生成機制 34 4.3.1 aspectMaker之GUI介面 35 4.3.2 檢查機制及核心符號表轉換 39 4.3.3 Aspect之合成 41 4.4 Aspect註冊及移除機制 46 4.5 Aspect管理機制 54 第5章 系統測試與效能分析 60 5.1 系統測試環境 60 5.2 系統測試 60 5.2.1 Before、After、Around及Replace之驗證 60 5.2.2 掛載多個Advice於同一個Join point 65 5.2.3 系統中同時包含多個Join point 67 5.3 效能分析 68 第6章 結論與展望 71 6.1 結論 71 6.2 展望 71 參考文獻 73 附錄A 核心符號表之符號類型 78 附錄B 使用hash方式實作Join point list 81 附錄C 測試用之Advice程式碼 84 自 述 88

    [1] Mazeiar Salehie, Sen Li, Ladan Tahvildari, “Employing Aspect Composition in Adaptive Software Systems: A Case Study”, Proceedings of the 1st workshop on Linking aspect technology and evolution, 2009.
    [2] Nicolas Loriant, Jean-Marc Menaud, “Generalized Dynamic Probes for the Linux Kernel and Applications with Arachne”, Proceedings of the 2007 IADIS Applied Computing International Conference (AC’07), Salamanca, Spain, February 2007.
    [3] William R. Mahoney, William L. Sousan, “Using Common Off-The-Shelf Tools To Implement Dynamic Aspects”, ACM SIGPLAN Notices, 2007.
    [4] Andy Zaidman, Serge Demeyer, Bram Adams, Kris De Schutter, Ghislain Hoffman, Bernard De Ruyck, “Regaining Lost Knowledge through Dynamic Analysis and Aspect Orientation”, Proceedings of the Conference on Software Maintenance and Reengineering, 2006.
    [5] Bram Adams, “AOP on the Cside”, Proceedings of the 2nd Linking Aspect Technology and Evolution Workshop (LATEr), AOSD 2006.
    [6] Yoshisato, Yanagisawa, Kenichi Kourai, Shigeru Chiba, Rei Ishikawa, “A Dynamic Aspect-oriented System for OS Kernels”, Proceedings of the 5th international conference on Generative programming and component engineering, 2006.
    [7] Hideaki Shinomi, Tetsuo Tamai, “Impact Analysis of Weaving in Aspect-Oriented Programming”, Proceeding s of the 21st IEEE International Conference on Software Maintenance(ICSM’05), 2005.

    [8] Michael Engel, Bernd Freisleben, “Using a Low-Level Virtual Machine to Improve Dynamic Aspect Support in Operating System Kernels”, Proceedings of the 4th AOSD Workshop on Aspects, Component, and Patterns for Infrastructure Software (ACP4IS), Chicago, March 14-18, 2005.
    [9] Michael Engel, Bernd Freisleben, “Dynamic Aspect Support for Native Code”, The International Conference on “Computer as a Tool”, EUROCON 2005, November, 2005.
    [10] Michael Engel, Bernd Freisleben, “Supporting autonomic computing functionality via dynamic operating system kernel aspects”, Proceedings of the 4th international conference on Aspect-oriented software development, 2005.
    [11] Angelo Furfaro, Libero Nigro and Francesco Pupo, “Multimedia synchronization based on aspect oriented programming”, Microprocessors and Microsystems, 2004.
    [12] Francisco Ortin, Juan Manuel Cueva, “Dynamic adaptation of application aspects”, Journal of Systems & Software, 2004.
    [13] Michael Haupt, Mira Mezini, “Micro-Measurements for Dynamic Aspect-Oriented Systems”, Object-Oriented and Internet-Based Technologies, 2004.
    [14] Walter Cazzola, Sonia Pini and Massimo Ancona, “Evolving Pointcut Definition to Get Software Evolution”, Proceedings of the 1st ECOOP Workshop on Reflection, AOP and Meta-Data for Software Evolution(RAM-SE’04), 2004.
    [15] Bart Verheecke, Maria Agustina Cibran and Viviane Jonckers, “AOP for Dynamic Configuration and Management of Web Services”, Web Services ICWS-EUROPE, 2003.
    [16] Miklos Espak, “Improving Efficiency by Weaving at Run-time”, 5th GPCE Young Researchers Workshop, 2003.
    [17] Shigeru Chiba, Yoshiki Sato, Michiaki Tatsubori, “Using HotSwap for Implementing Dynamic AOP Systems”, 1st Workshop on Advancing the State-of-the-Art in Run-time Inspection, 2003.
    [18] Andrel Popovici, Thomas Gross, Gustavo Alonso, “Dynamic Weaving for Aspect-Oriented Programming”, Proceedings of the 1st International Conference on Aspect-Oriented Software Development, 2002.
    [19] Adreeas Gal, Olaf Spinczyk, Wolfgang Schroder Preikschat, “On Aspect-Oriented in Distributed Real-time Dependable Systems”, Proceedings of the 7th International Workshop on Object-Oriented Real-Time Dependable Systems, 2002.
    [20] Pierre-Charles David, Thomas Ledoux, “Dynamic Adaptation of Non-Functional Concerns”, Workshop on Unanticipated Software Engineering(USE), 2002.
    [21] Yvonne Coady, Gregor Kiczales, Mike Feeley, Greg Smolyn, “Using AspectC to improve the modularity of path-specific customization in operating system code”, Proceedings of the Joint European Software Engineering Conference (ESEC) and 9th ACM SIGSOFY International Symposium on the Foundations of Software Engineering (FSE-9), 2001.
    [22] Gregor Kiczales, John Lamping, Anurag Mendhekar, Chris Maeda, Cristina Videira Lopes, Jean-Marc Loingtier, John Irwin, “Aspect-Oriented Programming”, Proceeding of the 11th European Conference Object-Oriented Programming(ECOOP), 1997.
    [23] Walter Hürsch and Cristina Lopes, “Separation of Concerns”, Technical Report, NU-CCS-95-03, 1995.
    [24] Matt Bishop, “How To Write a Setuid Program”, Network security Library software engineering, 2000.

    [25] Hao Chen, David Wangner and Drew Dean, “Setuid Demystified”, Proceedings of the 11th USENIX Security Symposium, 2002.
    [26] Bryan M. Cantrill, Michael W. Shapiro and Adam H. Leventhal, “Dynamic Instrumentation of Production Systems”, Proceedings of USENIX Annual Technical Conference, 2004.
    [27] AOP觀念與術語 website: http://caterpillar.onlyfun.net/Gossip/SpringGossip/AOPConcept.html.
    [28] AspectJ, http://www.eclipse.org/aspectj/.
    [29] AspectC++, http://www.aspectc.org.
    [30] AspectC#, http://www.geocities.com/aspectdotnet/.
    [31] JBoss AOP, http://www.jboss.org/jbossaop/.
    [32] AspectWerkz, http://aspectwerkz.codehaus.org/.
    [33] AspectC, http://www.cs.ubc.ca/labs/spl/projects/aspectc.html.
    [34] ACC, http://research.msrg.utoronto.ca/ACC.
    [35] Aspicere, http://users.ugent.be/badams/aspicere/.
    [36] AOP for Python, http://www.cs.tut.fi/~ask/aspects/index.shtml.
    [37] AOP for Ruby, http://aquarium.rubyforge.org/.
    [38] AOP for perl, http://search.cpan.org/~adamk/Aspect-0.16/lib/Aspect.pm.
    [39] International Conference on Aspect-Oriented Software Development,
    http://aosd.net.
    [40] Aspect-oriented software development wiki, http://en.wikipedia.org/wiki/Aspect-oriented_software_development.
    [41] 面向側向程式設計 wiki, http://zh.wikipedia.org/zh-tw/AOP.
    [42] x86 debug register wiki, http://en.wikipedia.org/wiki/Debug_register.
    [43] Instrumentation wiki,
    http://en.wikipedia.org/wiki/Instrumentation_(computer_programming).
    [44] GTK+, http://www.gtk.org/.
    [45] Loadable kernel module wiki, http://en.wikipedia.org/wiki/Loadable_kernel_module.
    [46] IBM-AOP work, http://www.ibm.com/developerworks/library/j-aopwork1/.
    [47] KernInst, http://www.paradyn.org/html/kerninst.html.
    [48] System call wiki, http://en.wikipedia.org/wiki/System_call.

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