Handler Mode

14,000,000 Leading Edge Experts on the ideXlab platform

Scan Science and Technology

Contact Leading Edge Experts & Companies

Scan Science and Technology

Contact Leading Edge Experts & Companies

The Experts below are selected from a list of 3 Experts worldwide ranked by ideXlab platform

Chun-wei Chang - One of the best experts on this subject based on the ideXlab platform.

  • Design and Implementation of the Memory Protection Scheme in the µC/OS-III on ARM Cortex-M3 Embedded Systems
    2021
    Co-Authors: Chun-wei Chang
    Abstract:

    利用微控制器(Microcontroller Unit,MCU)搭載即時作業系統(Real-Time Op-erating System, RTOS)被廣泛應用於各式各樣的嵌入式系統,對於眾多嵌入式系統而言,穩定及安全是其重要的特色與要求。然而應用程式的錯誤或惡意的非法存取資料,將使得應用程式或即時作業系統出現不可預測的錯誤。 有鑑於此,本論文探討如何利用ARM Cortex-M3的記憶體保護單元,在µC/OS-III即時作業系統實現記憶體保護功能。我們利用ARM Cortex-M3微處理器的Thread模式和Handler模式與特權和非特權的不同存取等級,搭配其記憶體保護單元,並藉由適當的記憶體配置管理設計,達到防止µC/OS-III的核心資料和堆疊被應用程式存取,且各應用程式之間的資料和堆疊不可互相存取,以及堆疊溢出的偵測。Running a real-time operating system (RTOS) in microcontrollers (MCU) has drawn considerable attention and become a widely used solution for embedded systems. For embedded systems, both security and reliability are the important characteristics and fundamental requirements. However, any application bug or illegal memory access could cause unpredictable mistakes to the applications and even the RTOS. To address this issue, in this work, we study how to realize the memory protection function in µC/OS-III RTOS on the ARM Cortex-M3 based microprocessors. On the basis of the various features of ARM Cortex-M3, including thread Mode and Handler Mode, privileged access level and unprivileged access level, and the memory protection unit, we design an memory allocation scheme that assign different memory regions to OS and applications, so that applications can not access the memory areas of OS. Be-sides, we dynamically assign the memory regions to applications during the context switches, so that applications’ memory areas are isolated and thus applications can only access its own memory area. Finally, we also realize the stack overflow detection scheme. From the experimental results, we can successfully make the µC/OS-III RTOS secure and reliable.誌謝 i 摘要 ii Abstract iii 目次 iv 圖目次 vi 表目次 viii 1. 緒論 1 1.1 簡介 1 1.2 研究動機 2 1.3 貢獻 3 1.4 論文架構 3 2. 背景知識 4 2.1 ARM Cortex-M3介紹 4 2.1.1 ARM Cortex-M3處理器模式 4 2.1.2 Cortex-M3 CONTROL暫存器 5 2.1.3 Cortex-M3記憶體保護單元 6 2.1.4 Cortex-M3對於支援作業系統的特性 11 2.2 ARM Linker的scatter-loading機制 12 3. 研究方法 15 3.1 作業系統核心與應用程式的記憶體配置 15 3.2 記憶體保護單元配置 16 3.3 記憶體保護單元存取屬性配置 17 3.4 記憶體保護單元區域範圍和大小設定 18 3.5 記憶體保護單元切換 19 4. 應用程式實作說明 21 4.1 µC/OS-III部署在ARM Cortex-M3 21 4.1.1 建立µC/OS-III專案 21 4.1.2 µC/OS-III應用程式開發 27 4.2 ITM 實作 27 4.2.1 ITM Core Clock設定 27 5. 實驗結果與討論 30 5.1 實驗環境 30 5.2 實驗方法 30 5.3 實驗結果 31 6. 結論與未來展望 41 參考文獻 4