# Linux Kernel開發學習日誌2020.2.29 # 行動筆記 [2020 年春季 Linux 核心設計課程作業 —— lab0](/@sysprog/linux2020-lab0) 目標: linux kernel lab0 作業 設定2/22~3/7完成 * 1+1+1+1+1 tomatos * 作業 (HackMD) * my [lab0-c](https://hackmd.io/@unknowntpo/lab0-c) * [同學範本](https://hackmd.io/@WaryvM_MTuOkXtEEalFsvQ/Sy5oUP6MU) ------ # 構思筆記 [2020 年春季 Linux 核心設計課程作業 —— lab0](/@sysprog/linux2020-lab0) 目標: linux kernel lab0 作業 設定2/22~3/7完成 ## 列出所有前置作業與小步驟 * linked-list * Prerequisite: * c structure掌握 [Linux Kernel開發學習日誌2020.2.22](/iBoS_FhaSL6AkfX9LMw0hw) * structure variable. * structure tag. * NULL pointer * Dynamic memory allocation * [Linux Kernel開發學習日誌2020.2.27](/c9JK5umZT7y5mujk0NVUOA) * [Linux Kernel開發學習日誌2020.2.26](/buxtMt5wTX6dcnPRSwn7Lw) * [Linux Kernel開發學習日誌2020.2.25](/92Q55jYhQbGss0aoljjUZw) * typedef (linked list會用到) * typedef 費曼學習法自我解釋 * Task: * :package: 開發環境設定 * :dart: 取得程式碼並進行開發 * clang-format 工具和一致的程式撰寫風格 * Git Hooks 進行自動程式碼排版檢查 * 撰寫 Git Commit Message 和自動檢查機制 * 牛刀小試 * 實作 ```q_size``` tutorial * 以 Valgrind 分析記憶體問題 * Valgrind 使用案例 * :microscope: 自動測試程式 * 追蹤記憶體配置和釋放的狀況 * ```qtest``` 命令直譯器的實作 * Signal 處理和應用 * 命令直譯器的初始化準備 * [你所不知道的C語言: Stream I/O, EOF 和例外處理](https://hackmd.io/@sysprog/c-stream-io) * :penguin: 作業要求 * 在 GitHub 上 fork [lab0-c](https://github.com/sysprog21/lab0-c) * 參閱 [Git 教學和 GitHub 設定指引](https://hackmd.io/@sysprog/git-with-github) ^附教學影片^ * ==詳細閱讀 [C Programming Lab](http://www.cs.cmu.edu/~213/labs/cprogramminglab.pdf)== ,依據指示著手修改 `queue.[ch]` 和連帶的檔案,測試後用 Git 管理各項修改,記得也該實作 `q_sort` 函式。 * 在提交程式變更前,務必詳閱 [如何寫好 Git Commit Message](https://blog.louie.lu/2017/03/21/%E5%A6%82%E4%BD%95%E5%AF%AB%E4%B8%80%E5%80%8B-git-commit-message/) * 不用理會 [Autolab](http://www.autolabproject.com/) 和檔案下載的描述,這兩者都是 CMU 專屬 * 修改排序所用的比較函式,變更為 [natural sort](https://github.com/sourcefrog/natsort),在 "simulation" 也該做對應的修改,得以反映出 [natural sort](https://github.com/sourcefrog/natsort) 的使用。 * 除了修改程式,也要編輯「[作業區](https://hackmd.io/@sysprog/linux2020-homework1)」,增添開發紀錄和 GitHub 連結,除了提及你如何逐步達到自動評分程式的要求外,共筆也要涵蓋以下: * queue ---- # 封存筆記 * guess: * clone 一份 code 到 local computer? * 查資料驗證: ### Fork a repo [github-help](https://help.github.com/en/enterprise/2.13/user/articles/fork-a-repo) A fork is a copy of a repository (repo) Forking a repo allow you to freely experiment with changes without affecting the original project. ### Propose changes is for bug fixes: * Step1 * Fork the repo. * Step2 * Make the fix. * Step3 * Summit a ==pull request==(PR) to the project owner. * If the project owner likes your fork, * They might pull your fix into the original repo. e.g. [lab0-c (forked by me)](https://github.com/unknowntpo/lab0-c) * login and press fork from original github repo. [sysprog21/lab0-c](https://github.com/sysprog21/lab0-c) <img src="https://i.imgur.com/T1CMzDC.png" /> * and use git clone to clone into your local computer. ```shell $ git clone git@github.com:unknowntpo/lab0-c.git ``` --- ## Clone v.s. Fork [Clone v.s. Fork](http://support.rightscale.com/12-Guides/Chef_Cookbooks_Developer_Guide/04-Developer/Source_Control_Management_Systems/GitHub/Clone_vs._Fork/) <img src= "http://support.rightscale.com/@api/deki/files/1817/diag-Fork-Clone-Repo-v1.png%3Frevision=1"/> By forking a repo, you're maintaining a relationship between the original repo and your modified version.