--- title: Lab21: RTOS toc: no ... 預期目標 ------- * 在 QEMU 模擬的 STM32 環境中,嘗試執行 [FreeRTOS](http://www.freertos.org/) 並且學習相關的操作 - 熟悉 FreeRTOS 的內部運作機制 - 實地練習 Multi-tasking 程式設計 * 整合 Lab19 和 Lab20 的開發成果 - 複習 GNU Toolchain, ARM semihost, GDB 操作 FreeRTOS --------------- * [The Architecture of Open Source Applications: FreeRTOS](http://www.aosabook.org/en/freertos.html) - [簡體中文翻譯](http://www.ituring.com.cn/article/4063) FreeRTOS + romfs ------------------------------- * 已整合檔案系統到 FreeRTOS 中,並在 UART 顯示檔案系統 (romfs) 中 test.txt 的內容 * 預期 make qemuauto 執行後,會自動啟動 QEMU + GDB + FreeRTOS,並在 5 秒後 kill QEMU/GDB,最終的終端機畫面為 test.txt 的檔案內容 * 測試方式 - ``git clone git@github.com:embedded2013/freertos.git`` # 或者: ``git clone git://github.com/embedded2013/freertos.git`` - ``cd freertos`` - ``make`` - ``make qemuauto`` - 留意 Host 端應該會有 ``Romfs Test!`` 字樣 * 實作程式碼 - romfs.c - hash-djb2.c - filesystem.c - fio.c 參考作業提案 -------------------- * 將 Lab19 實作的 shell 整合進 FreeRTOS,至少提供 ``ps`` (顯示系統中 Task 資訊), ``exec`` (建立新的 Task) 等指令 * 將 Lab20 實作的 semihosting 整合進 FreeRTOS + 你的 shell,至少得提供 ``host`` 指令 - 參考格式:``host`` ``將在 Host 端執行的指令`` - Host 端執行後,應該將其輸出顯示於 shell - 在 shell 中提供檔案系統相關的指令,如 ``ls`` 和 ``cat``,得以顯示 romfs 的資訊 作業繳交方式 ------------------- * 更新作業提案到共筆網站: [Lab 21 / 作業共筆](https://embedded2013.hackpad.com/Lab21-RTOS-shzzlckJ50f),需要標注自己的 ID,可參考 [Lab 20 / 作業共筆](https://embedded2013.hackpad.com/Lab20-GNU-Toolchain-zI6gzN3uv1c) 格式 * 在 Oct 18, 2013 前,將符合作業提案的程式碼,提交到自行 fork 的 repository - https://github.com/embedded2013/freertos 參考資訊 ------------- * [FreeRTOS Implementation](http://www.freertos.org/implementation/main.html)