| 研究生: |
林威仁 Lin, Wei-Ren |
|---|---|
| 論文名稱: |
以虛擬檔案系統實現裸機檔案操作之研究 A Study on Implementing Bare-Metal File Operations Using Virtual File System |
| 指導教授: |
陳敬
Chen, Jing 戴顯權 Tai, Shen-Chuan |
| 學位類別: |
碩士 Master |
| 系所名稱: |
電機資訊學院 - 電機工程學系 Department of Electrical Engineering |
| 論文出版年: | 2024 |
| 畢業學年度: | 112 |
| 語文別: | 中文 |
| 論文頁數: | 191 |
| 中文關鍵詞: | 裸機環境 、裸機檔案系統 、虛擬檔案系統 |
| 外文關鍵詞: | Bare-Metal environment, Bare-Metal File System, Virtual File System |
| 相關次數: | 點閱:88 下載:3 |
| 分享至: |
| 查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
裸機(Bare Metal)是指執行應用程式之硬體無作業系統之支援。裸機環境則是許多嵌入式系統應用不使用作業系統支援而執行各種應用程式功能的系統環境。本論文描述以虛擬檔案系統實現裸機嵌入式系統檔案操作之研究,主要研究方向為:(1)透過虛擬檔案系統使裸機嵌入式系統應用程式(以下簡稱裸機應用程式)具備檔案操作之能力;(2)透過虛擬檔案系統使裸機應用程式之開發可使用 POSIX 標準檔案操作函式;(3)透過虛擬檔案系統使裸機應用程式在執行階段掛載多種不同實體檔案系統,以因應不同檔案組織與不同硬體之需求。
本研究設計並實作一裸機檔案系統,稱為 BMFS(Bare Metal File System),作為研究虛擬檔案系統實現裸機檔案操作之驗證實例。BMFS 的組成分為三個部分,依據層級順序由上而下分別為:(1)檔案操作介面,提供 POSIX 標準之檔案操作函式;(2)虛擬檔案系統,負責管理記憶體中多個檔案與檔案系統;(3)實體檔案系統,負責對儲存媒體中的檔案進行存取。其中虛擬檔案系統的組成分為:(1)檔案操作介面實作層,負責實作 POSIX 標準之檔案操作函式庫;(2)抽象物件管理層,負責在記憶體中維護檔案與檔案系統管理所需之抽象物件;(3)墊片層,負責解析虛擬檔案系統中檔案操作之行為與參數並轉換成實體檔案系統接受之格式。本研究在驗證方面使用樹莓派 3B+ 嵌入式系統開發平台證明 BMFS 可在裸機環境執行並且功能正確。
本研究之主要貢獻為:(1)BMFS 提供的檔案操作函式庫使裸機應用程式可進行檔案操作;(2)BMFS 透過虛擬檔案系統使裸機應用程式開發者在檔案操作方面可使用 POSIX 標準開發程式;(3)BMFS 透過虛擬檔案系統使裸機應用程式可在系統初始化階段掛載多個實體檔案系統作使用;(4)BMFS 可藉由撰寫其虛擬檔案系統墊片層移植實體檔案系統,增加 BMFS 支援實體檔案系統之種類數量。
This thesis describes a study on implementing bare-metal file operations using virtual file system. The study focuses on: (1) Enabling bare-metal applications to perform file operations through a virtual file system; (2) Allowing bare-metal applications to use POSIX standard file operation functions during the development phase; (3) Enabling bare-metal applications to mount various file systems at runtime to meet different file storage needs.
A bare-metal file system, namely BMFS (Bare Metal File System), is developed in this study as an example of implementing virtual file system to support bare-metal file operations. BMFS consists of three parts: (1) File operation API which provides file operation functions compliant with the POSIX standard; (2) Virtual file system which is responsible for managing multiple files and file systems in memory; (3) Physical file systems which are real file storage for keeping files. The virtual file system is composed of three components: (1) A function library which provides POSIX APIs to implement file operations; (2) Abstract object management layer, which maintains the abstraction required for managing file and file in memory; (3) Shim layer, which is responsible for parsing the operations and parameters of file operations requested by the virtual file system, and converting them into formats acceptable by the mounted physical file system. In terms of verification and evaluation, the example implementation using Raspberry Pi 3B+ demonstrates that BMFS can operate in a bare-metal environment and functions correctly.
The main contributions of this thesis: (1) Enabling file operations for bare-metal applications through the BMFS file operation library; (2) Providing bare-metal application developers the APIs of POSIX standard file operations for programming through BMFS; (3) Addressing various file storage needs of bare-metal applications by enabling mounting multiple different physical file systems;(4) Providing good scalability by allowing multiple file systems to be ported to BMFS though implementing BMFS shim layers.
[1] Alexander S. Gillis. object-oriented programming (OOP). https://www.techtarget.com/searchapparchitecture/definition/object-oriented-programming-OOP, accessed on 2024/07/30.
[2] ARM FAT File System - Long and Short File Name handling. https:/www.keil.com/pack/doc/mw/FileSystem/html/fat_fs.html, accessed on 2024/07/30.
[3] ASUS. M840MB. https://reurl.cc/A4A4pK, accessed on 2024/07/30.
[4] Carsten Bormann, Mehmet Ersue, and Ari Ker3nen. Terminology for Constrained-Node Networks. RFC 7228, May 2014.
[5] Broadcom. BCM2835 ARM Peripherals. https://reurl.cc/VzkezZ, accessed on 2024/07/30.
[6] Chip Way Technology Ltd. GPIO. https://www.chipwaygo.com/doc/gpio_pin.php, accessed on 2024/07/30.
[7] Computer Science from the Bottom Up. File Descriptors. https://bottomupcs.com/ch01s03.html, accessed on 2024/07/30.
[8] Robert P. Dick, Ganesh Lakshminarayana, Anand Raghunathan, and Niraj K. Jha. Power analysis of embedded operating systems. In Proceedings of the 37th Annual Design Automation Conference, DAC 00, page 312-315, New York, NY, USA, 2000. Association for Computing Machinery.
[9] Eclipse. 2023 IoT & Edge DeveloperSurvey ReporL https://outreach.eclipse.foundation/iot-edge-developer-survey-2023, accessed on 2024/07/30.
[10] Embedded Artistry. https://embeddedartistry.com/libraries/, accessed on 2024/07/30.
[11] Embedded Artistry. libc. https:/github.com/embeddedartistry/libc, accessed on 2024/07/30.
[12] Giovanni Di Sirio. ChibiOS/RT The Ultimate Guide. https://www.chibios.org/dokuwiki/doku.php?id=chibios:documentation:books:rt:start, accessed on 2024/07/30.
[13] IBM. Virtual File Systems. https://reurl.cc/eLDLnQ, accessed on 2024/07/30.
[14] ICIW 2016. The Eleventh International Conference on Internet and Web Applications and Services. https://www.iaria.org/conferences2016/ICIW16.html, accessed on 2024/07/30.
[15] IEEE. https://www.ieee.org/, accessed on 2024/07/30.
[16] IEEE/Open Group Std 1003.1-2024 (Revision of IEEE Std 1003.1-2017). IEEE/Open Group Standard for Information Technology Portable Operating System Interface(POSIX™) Base Specifications, https://ieeexplore.ieee.org/document/10555529, accessed on 2024/07/30 .
[17] jserv. linked list. https://hackmd.io/@sysprog/c-linked-list, accessed on 2024/07/30.
[18] jserv. Linux 核心原始程式碼巨集: container_of, https://hackmd.io/@sysprog/linux- macro-containerof, accessed on 2024/07/30.
[19] jserv. Linux 核心設計: 檔案系統概念及實作手法, htps//hackmd.io/@sysprog/linux-file-system, accessed on 2024/07/30.
[20] Xiaodong Lin. Examining FAT File System, pages 115-144. Springer International Publishing, Cham, 2018.
[21] Linux. https://www.linux.org/, accessed on 2024/07/30.
[22] LinuxQuestions. Difference between inode and vnode? https://reurl.cc/D19kRm, accessed on 2024/07/30.
[23] Marlin. https://marlinfw.org/, accessed on 2024/07/30.
[24] Michael Kerrisk man7.org. readdir(3) - Linux manual page. https://man7.org/linux/man-pages/man3/readdir.3.html, accessed on 2024/07/30.
[25] Microsoft. Azure RTOS FileX documentation. https://learn.microsoft.com/en-us/azure/rtos/filex/l, accessed on 2024/07/30.
[26] Microsoft. Overview of Azure RTOS ThreadX. https://learn.microsoft.com/en-us/azure/rtos/threadx/overview-threadx, accessed on 2024/07/30.
[27] NCTU. Operating System Design & Implementation, Spring 2020. https://grasslab.github.io/osdi/en/index.html, accessed on 2024/07/30.
[28] Oracle. Kernel Overview. https://reurl.cc/G4A4Qy, accessed on 2024/07/30.
[29] PL2303TA. httpsJ/www.amazon.cn/dp/B08HS9M3P9, accessed on 2024/07/30.
[30] Prusa Mini. https://reurl.cc/ka7v43, accessed on 2024/07/30.
[31] PuTTY. https://www.putty.org/, accessed on 2024/07/30.
[32] Raspberry Pi Operating system images. https://www.raspberrypi.com/software/operating-systems/, accessed on 2024/07/30.
[33] Raspberry Pi 3 Model B+. https://reurl.cc/nr7A0Oe, accessed on 2024/07/30.
[34] Raspberry Pi Taiwan. 樹莓派 Raspberry Pi 3 Model B+ 開發版. httpsJ//piepie.com.tw/product/raspberry-pi-3-model-b-plus, accessed on 2024/07/30.
[35] Rocky D. Pulley. Low Level Devel - Raspberry Pi Bare Metal. https://github.com/rockytriton/LLD/tree/main/rpi_bm, accessed on 2024/07/30.
[36] Roy, Duncan. Design goals and implementation of the new High Performance File System. http://cd.textfiles.com/megademo2/INFO/OS2_HPFS.TXT, accessed on 2024/07/30.
[37] rsta2. uspi. https:/github.com/rsta2/uspi, accessed on 2024/07/30.
[38] RT-Thread. https://www.rt-thread.io/, accessed on 2024/07/30.
[39] RT-Thread. https://www.rt-thread.org/, accessed on 2024/07/30.
[40] Sanlien. Guralp Minimus 智能地震數據接收器. https//reurl.ce/D4plo, accessed on 2024/07/30.
[41] Sanlien. TILTdot 電子式傾料儀. httpsJ/reurl. ce/WRoNRK5, accessed on 2024/07/30.
[42] Sanlien. WBdot 電阻式記錄器. httpsJ/reurl.ce/37QX0j, accessed on 2024/07/30.
[43] STM32 Arm Cortex MCU wiki. Introduction to FILEX. https://wiki.st.com/stm32mcu/wiki/Introduction_to_FILEX, accessed on 2024/07/30.
[44] The Electronic Lives Manufacturing. FatF - Generic FAT Filesystem Module. http:/lelm-chan.org/fsw/ff/00index_e.html, accessed on 2024/07/30.
[45] The Electronic Lives Manufacturing. FatFs Media Access Interface. http://elm-chan.org/tsw/ft/00index_e.html, accessed on 2024/07/30.
[46] The Electronic Lives Manufacturing. FatFs Module Application Note. http://elm-chan.org/tsw/ft/doc/appnote.html, accessed on 2024/07/30.
[47] The Electronic Lives Manufacturing. My Profile. http://elm-chan.org/profile_e.html,accessed on 2024/07/30.
[48] The Linux Kernel. File system drivers. https://linux-kernel-labs.github.io/refs/heads/master/labs/filesystems_part2.html, accessed on 2024/07/30.
[49] The Open Group. time.h. https://pubs.opengroup.org/onlinepubs/007908775/xsh/time.h.html, accessed on 2024/07/30.
[50] The Open Group Base Specifications Issue 6. dirent.h. https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/dirent.h.html, accessed on 2024/07/30.
[51] The Open Group Base Specifications Issue 6. sys/stat.h. https://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/stat.h.html, accessed on 2024/07/30.
[52] The Open Group Base Specifications Issue 6. sys/statvfs.h. https://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/stat.h.html, accessed on 2024/07/30.
[53] TP-Link. 智慧溫溼度感測器. https://reurl.cc/N404nk, accessed on 2024/07/30.
[54] UniTrento. The VFS Inode Cache. https://www.science.unitn.it/~fiorella/guidelinux/tlk/node110.html, accessed on 2024/07/30.
[55] Unix. https://www.hpc.iastate.edu/guides/unix-introduction, accessed on 2024/07/30.
[56] VFS. https://opensource.com/article/19/3/virtual-filesystems-linux, accessed on 2024/07/30.
[57] Sonjie Liang Alcxander L. Wijesinha Hamdan Alabsi William Thompson, Ramesh K. Karne and Hojin Chang. Implementing a usb file system for bare pc applications. ICIW 2016 : The Eleventh International Conference on Internet and Web Applications and Services, 2016.
[58] Zephyr. https://zephyrproject.org/, accessed on 2024/07/30.
[59] Zoltan Baldaszti. raspi3-tutorial. https:/github.com/bztsrc/raspi3-tutorial, accessed on 2024/07/30.
[60] Zoltan Baldaszti. raspi3-tutorial. https:/github.com/bztsrc/raspi3-tutorial/tree/master/12_printf, accessed on 2024/07/30.
[61] 林咸禮. 存取智慧卡之linux檔案系統的設計與實作. 國立臺灣大學資訊工程學研究所, 2002.
[62 ] 蔡德明. 鳥 哥 私 房 菜 - Linux 的檔案權限與目錄配置. https//linux.vbird.org/lnux basic/centos7/0210filepermission.php, accessed on 2024/07/30.
[63] 詹榮開. Linux inode cache 機制分析. https://blog.csdn.net/wishfly/article/details/280643, accessed on 2024/07/30.