簡易檢索 / 詳目顯示

研究生: 羅明遠
Lo, Ming-Yuan
論文名稱: 可熱抽換之作業系統核心之設計與實作
The Design and Implementation of The Hot-Swap Kernel
指導教授: 陳 敬
Chen, Jing
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 電腦與通信工程研究所
Institute of Computer & Communication Engineering
論文出版年: 2006
畢業學年度: 94
語文別: 中文
論文頁數: 56
中文關鍵詞: 核心作業系統熱抽換
外文關鍵詞: operating system, kernel, hot swap
相關次數: 點閱:83下載:3
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  •   本論文探討具備可熱抽換功能之作業系統核心之實作。在一些需要擔負重大任務的電腦系統,為維持其高可用性(high availability),該類系統除了具備容錯功能外,也不可任意地開關機,即使必須進行作業系統的維護也須於最短時間內完成。儘管如此,關機維護的成本仍然不小,有鑑於此,我們以硬體的熱抽換(Hot Swap)的概念出發,設計了架構簡單且容易實作的作業系統之熱抽換機制,使得電腦系統於更新系統核心時,不需關機,也不需關閉已執行的應用程式,即可執行系統的更新工作。而於本論文中,我們也將說明並實作一使用熱抽換機制的作業系統核心(kernel)以作為驗證。
      本論文所設計之熱抽換機制分為三大部分:利用查核點(checkpoint)來儲存系統狀態,核心更新時則直接將新版核心覆蓋於舊版核心的記憶體區段上,再自查核點回復系統狀態,以恢復行程之執行。系統因而可在不重新啟動的狀況下,更新作業系統核心。
    本論文所實作之核心具備三個主要功能模組:行程通訊模組、排程器以及熱抽換模組。行程間通訊負責不同行程間的訊息傳遞以及同步協定;排程器負責安排不同行程的執行順序及優先權;熱抽換則負責儲存核心狀態以及更新核心的工作。此核心於 ARM 架構之平台建立,使用 Compact Flash 作為儲存媒體,並實作查核點技術,將應用程式之狀態儲存至檔案中,待熱抽換完成後,再從檔案將資料讀出以重建執行環境,使應用程式能夠繼續執行在熱抽換前尚未完成的工作。
      藉由實際的測試,我們發現系統可在不重新啟動的狀況下更新核心,而更新核心後的系統,其應用程式依然能夠正常運作,證明本論文所提出的機制是可行的。

     This thesis presents the design and implementation of a kernel with the hot-swap capability. For some computer systems running critial tasks, in order to achieve high availability, the system has to apable of tolerating failures, and maintainance should be done within very short suspend time. Sometimes this suspend time is unacceptable. We propose a hot-swap mechanism of the system kernel that is simple and easy for implementation. Systems with hot-swap feature need not to stop applications nor to be shut down during the system update. An example kernel with this mechanism is presented in this thesis as our proof of concept.
     The hot-swap mechanism consists of checkpointing, which is used to save system states, and the kernel swapping, which is overwriting the old version kernel memory space with the new version kernel image, and recovering, in which the system resumes from the checkpoint. The mechanism makes the system able to be updated without rebooting.
    The kernel presented in the thesis is composed three main modules: inter-process communication (IPC), scheduling and hot-swap module. IPC module achieves message passing and synchronization among processes; the scheduling module maintains the order of execution and the priorities of processes; the hot-swap module stores states of the kernel and undertaking update the job of updating in the system. The kernel is developed on an ARM-based platform, and the checkpoint technology is used to store the states of system in a Compact Flash card. The applications can continue their works after the hot-swap is completed.
     From testing the system, we observe that the kernel can be swapped without rebooting, and all existing applications can continue execution with the updated kernel, which proves that the mechanism proposed in the thesis is both effective and practical.

    1 簡介                1  1.1 背景知識            1    1.1.1 作業系統         1    1.1.2 熱抽換(Hot Swap)    2  1.2 研究動機            2  1.3 論文組織            2 2 相關研究              3  2.1 查核點(Checkpoint)      3  2.2 熱抽換作業系統         4 3 系統模型              8  3.1 核心架構            8  3.2 記憶體及堆疊配置        10  3.3 系統呼叫            11  3.4 排程器             14  3.5 行程間通訊(IPC)       14    3.5.1 號誌           14    3.5.2 信箱           15  3.6 本文切換(Context Switch)   16 4 熱抽換機制             17  4.1 查核點實作           17    4.1.1 檔案結構         18    4.1.2 行程結構         18    4.1.3 事件結構         22    4.1.4 堆疊處理         22  4.2 核心更新            23  4.3 熱抽換前後之狀態一致性問題   24  4.4 不同版本核心資料之相容性問題  25 5 核心之實作             28  5.1 實作平台            28    5.1.1 硬體平台         28    5.1.2 軟體環境         28  5.2 系統呼叫            28  5.3 行程間通訊(IPC)       31  5.4 本文切換(Context Switch)   31  5.5 應用程式之開發         32    5.5.1 開發流程         32    5.5.2 核心服務         34    5.5.3 命令解譯器        39    5.5.4 應用程式開發範例     41 6 系統測試              46  6.1 測試環境            46  6.2 測試程式            46  6.3 測試結果            48  6.4 討論              48 7 結論與展望             52  7.1 結論              52  7.2 展望              52 參考文獻                54 自傳                  56

    [1] A. S. Tanenbaum and A. S. Woodhull, Operating Systems: Design and Implementation. Prentice Hall, 1997.
    [2] M. E. Segal and O. Frieder, "On-the-fly program modification: systems for dynamic updating," IEEE Software, March 1993.
    [3] E. Pinheiro and R. Bianchini, "Nomad: A scalable operating system for clusters
    of uni and multiprocessors," in Proceedings of IEEE International Workshop on
    Cluster Computing, December 1999.
    [4] T. Tannenbaum and M. Litzkow, "Checkpointing and migration of unix processes
    in the Condor distributed processing system," Dr Dobbs Journal, February 1995.
    [5] Truly-Transparent Checkpointing of Parallel Applications.
    http://www.research.rutgers.edu/~edpin/epckpt/paper html/.
    [6] J. S. Plank, M. Beck, G. Kingsley, and K. Li, "Libckpt: Transparent checkpointing under Unix," in Usenix Winter Technical Conference, pp. 213~223, January 1995.
    [7] M. Litzkow, T. Tannenbaum, and M. L. J. Basney, "Checkpointing and migration
    of unix processes in the condor distributed processing system," tech. rep.,
    University of Wisconsin-Madison, 1997.
    [8] K. Li, J. F. Naughton, and J. S. Plank, "Low-latency, concurrent checkpointing for parallel programs," IEEE Transactions on Parallel and Distributed Systems, vol. 5, no. 8, pp. 874~879, 1994.
    [9] M. J. Bach, The Design of The UNIX Operating System. Prentice Hall, 1986.
    [10] L. Yu, G. C. Shoja, H. A. Muller, and A. Srinivasan, "A framework for live software upgrade," in Proceedings of International Symposium on Software Reliability Engineering, 2002.
    [11] L. Nagamatsu, "Runtime software reorganization by traditional os features," in Proceedings of International Symposium on Principles of Software Evolution, 2000.
    [12] A. Baumann, J. Appavoo, D. D. Silva, J. Kerr, O. Krieger, and R. W. Wisniewski, "Providing dynamic update in an operating system," in Proceedings of the 2005 USENIX Technical Conference, pp. 279~291, 2005.
    [13] Kernel Hot Swap Project. http://kernelswap.sourceforge.net/.
    [14] J. J. Labrosse, MicroC/OS-II: The Real Time Kernel. CMP books, 2002.
    [15] ARM Architecture Reference Manual.
    [16] TI TMS320DM270 Technical Reference Manual.
    [17] S. Furber, ARM System-On-Chip Architecture. Pearson, 2000.
    [18] GCC Manual. http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html.
    [19] Using ld. http://sources.redhat.com/binutils/docs-2.15/ld/index.html.
    [20] GDB Manual. http://sources.redhat.com/gdb/current/onlinedocs/gdb toc.html.
    [21] GAS Manual. http://sourceware.org/binutils/docs-2.15/as/index.html.

    下載圖示 校內:立即公開
    校外:2005-10-05公開
    QR CODE