--- title: 系統軟體課程進度與開放資源 categories: system programming, linux, performance, security, compiler, kernel toc: no ... - Instructor: [Jim Huang](/User/jserv) (黃敬群) `` - 課程信箱: `` 進階電腦系統理論與實作 (Fall 2019) ------------------------------------------------------ * 第 1 週 (Sep 12): 誠實面對自己 - [課程簡介和注意須知](https://docs.google.com/presentation/d/1Wo22s5aYuuyry97-z2MMmUmdxhjD0wKTdhxIW5oqjvo/edit?usp=sharing) * [完整解說錄影](https://youtu.be/KaQvUumu81c) (3 小時) * 每週均安排隨堂測驗,採計其中最高分的 8 次 * 學期評分方式: 隨堂測驗 (25%) + 個人作業 (25%) + 分組報告及專題 (25%) + 自我評分 (25%) - 歷屆修課學生心得: [張家榮](/User/JaredCJR), [陳品睿](/User/ggary9424), [蕭奕凱](/User/Veck), [方鈺學](/User/JulianATA) - 分組報告示範: [ARM-Linux](/embedded/arm-linux), [Xvisor](/embedded/xvisor) - [GNU/Linux 開發工具共筆](https://hackmd.io/c/rJKbX1pFZ): 務必 *自主* 學習 Linux 操作, Git, HackMD, LaTeX 語法 (特別是數學式), GNU make, perf, gnuplot - [透過 Computer Systems: A Programmer’s Perspective 學習系統軟體](https://hackmd.io/c/S1vGugaDQ): 本學期教科書 (第 2 週可向助教購書) - [軟體缺失導致的危害](https://hackmd.io/@sysprog/B1eo44C1-) * 1970 年代推出的首款廣體民航客機波音 747 軟體由大約 40 萬行程式碼構成,而 2011 年引進的波音 787 的軟體規模則是波音 747 的 16 倍,約 650 萬行程式碼。換言之,你我的性命緊繫於一系列極為複雜的軟體系統之中,能不花點時間了解嗎? * 軟體開發的安全性設計和測試驗證應獲得更高的重視 - [解讀計算機編碼](https://hackmd.io/@sysprog/rylUqXLsm) * 人們對數學的加減運算可輕易在腦中辨識符號並理解其結果,但電腦做任何事都受限於實體資料儲存及操作方式,換言之,電腦硬體實際只認得 0 和 1,卻不知道符號 + 和 - 在數學及應用場域的意義,於是工程人員引入「補數」以表達人們認知上的正負數 * 您有沒有想過,為何「二補數」(2’s complement) 被電腦廣泛採用呢?背後的設計考量是什麼?本文嘗試從數學觀點去解讀編碼背後的原理 - [圖解傅立葉分析](https://hackmd.io/@sysprog/S1M6kQgiZ) * 傅立葉 (Fourier) 分析不僅是個數學工具,更是種徹底顛覆一個人以前世界觀的思維模式 * 不幸的是,傅立葉分析的公式看起來太復雜,以至於很多人囫圇吞棗,並從此對它深惡痛絕 * 本文在不需要特別熟悉數學工具的狀況下,讓讀者體會到藉由傅立葉分析看到世界的另一個樣貌 - [Bit-wise operations](https://hackmd.io/s/By0MltO_m) / [bit-wise 的應用](https://hackmd.io/s/ByzoiggIb) - [bit-field](https://hackmd.io/s/SJ8y82ZYQ) * [為什麼要深入學習 C 語言?](https://hackmd.io/s/HJFyt37Mx) - C 語言發明者 Dennis M. Ritchie 說:「C 很彆扭又缺陷重重,卻異常成功。固然有歷史的巧合推波助瀾,可也的確是因為它能滿足於系統軟體實作的程式語言期待:既有相當的效率來取代組合語言,又可充分達到抽象且流暢,能用於描述在多樣環境的演算法。」 * [C 語言:記憶體管理、對齊及硬體特性](https://hackmd.io/s/BkuMDQ9K7) * 搭配閱讀: [The Lost Art of Structure Packing](http://www.catb.org/esr/structure-packing/) * [C 語言: 數值系統](https://hackmd.io/s/BkRKhQGae) * [基於 C 語言標準研究與系統程式安全議題](https://hackmd.io/s/S15o_K3cQ) - 藉由研讀漏洞程式碼及 C 語言標準,討論系統程式的安全議題 - 透過除錯器追蹤程式碼實際運行的狀況,了解其運作原理; - 取材自 dangling pointer, CWE-416 Use After Free, CVE-2017-16943 以及 integer overflow 的議題; * [C 語言: 指標](https://hackmd.io/s/HyBPr9WGl) - 解讀 C 語言規格書的 “object” - 重讀 “type” 的定義,並且理解 incomplete type 的意義 - 三位一體: Array, function, pointer types: 都歸類於 derived declarator types - `void *` 的設計考量 - C-style string - [What comes after Moore’s Law?](https://enterprisersproject.com/article/2018/9/what-comes-after-moores-law): 隨著 Moore’s Law 時代的結束, 通用化硬體效能不再如以往快速進步, 因此軟硬體也必須因應如此的變化, 這篇點出 4 個面向: * [Ephemeral](https://www.dictionary.com/browse/ephemeral) applications (短暫的軟體): 這點是以企業軟體來談,許多組織的觀點認為軟體壽命比運作其的硬體來得長久。在許多大企業依然如此,然而後續將大量導入 mobile, web, analytics 與其他軟體,更趨向快速轉變以符合客戶與市場所需; * New workloads, such as machine learning: 呼應諸多計算架構大師所說的 Domain-Specific Architecture (DSA); * Cloud platforms: 對於雲端應用而言,使用者不會在意它是在哪種處理器與加速器上運作的; * Open source software: 主要在於特定的軟體開發商因人力與成本而減少支援硬體的範圍,開放原始碼軟體這時能夠作為考慮方案。儘管無法消弭對硬體的相依性,但不像軟體開發商對硬體平台支援或不支援的要求; - [The Era of General Purpose Computers is Ending](https://www.nextplatform.com/2019/02/05/the-era-of-general-purpose-computers-is-ending/): 過往是研究員和從業者就設計瓶頸與發熱問題來說明困境,這篇則由製程發展與已發生的現象,討論以下變遷: * 能追上最先進製程的晶圓廠商越來越少 * [TOP 500](https://www.top500.org/) 中使用特殊晶片比例不斷上升 * 特殊化處理器各方面變得更為經濟實惠 - [課程基本資料表單](https://forms.gle/8ix6EpskfjLH4qbR9): **務必填寫,以接收課程資訊** - Week1 隨堂測驗: [題目](https://hackmd.io/@sysprog/HksKVpUIr)/[作答表單](https://forms.gle/zJ54J1HLJZRkBN8u9) - [作業](https://hackmd.io/@sysprog/HJvjIvDIr) * [review](https://hackmd.io/@sysprog/rJM4SPw8S) * 第 2 週 (Sep 19): 課堂測驗 - 測驗時間: 15:10-18:10 - 可翻閱書籍和 Google 搜尋,但在測驗期間,禁止任何形式的討論。 - 作答以「紙筆」進行,請同學們記得攜帶文具。  - [測驗題目](https://hackmd.io/@sysprog/B1cWzRaLB) - [作業](https://hackmd.io/@sysprog/BkZ4h5xPB) * [lab0](https://hackmd.io/@sysprog/HyFQpqgPB), [quiz2](https://hackmd.io/@sysprog/rJn1C5xDS) * 第 3 週 (Sep 26): C 語言程式設計 - [以位元駕馭能量](https://hackmd.io/s/rk2RO0cYX) - [C 語言: linked list 和非連續記憶體操作](https://hackmd.io/@sysprog/SkE33UTHf) / [對 Linked List 進行氣泡排序](https://hackmd.io/s/BklGm1MhZ) - [Count Leading Zero (clz) 的實作](https://hackmd.io/s/Skq6P9bpz) * [clz 應用](https://hackmd.io/s/Bk-uxCYxz), [clz 分析](https://hackmd.io/s/Hyl9-PrjW) * [C 語言: 函式呼叫](https://hackmd.io/s/SJ6hRj-zg) * [C 語言: 遞迴呼叫](https://hackmd.io/s/rJ8BOjGGl) * [C 語言: 前置處理器應用](https://hackmd.io/s/S1maxCXMl) * [C 語言: goto 和流程控制](https://hackmd.io/s/B1e2AUZeM) * [C語言:技巧篇](https://hackmd.io/@sysprog/HyIdoLnjl) * Week3 隨堂測驗: - [題目(上)](https://hackmd.io/@sysprog/ByEP8muwr) / [作答表單](https://docs.google.com/forms/d/e/1FAIpQLSciAcG9dJwldW_5fFj8O_l0J9vjiu7nsBLt5W5SkknfXPp9kA/viewform?usp=sf_link) - [題目(下)](https://hackmd.io/@sysprog/ryu20CKvB) / [作答表單](https://forms.gle/bATLWyPoa6yThs2R9) * [作業](https://hackmd.io/@sysprog/BJCG-HGdS) - [list](https://hackmd.io/@sysprog/rJMNq4zuH), [quiz3](https://hackmd.io/@sysprog/rkw4SBMuH) * 第 4 週 (Oct 3): code review * 公告 - 10 月 10 日 15:10-23:10 安排在家測驗,請留意助教的信件通知以得知進行方式; - 10 月 17 日安排課堂 code review,請及早更新 [Homework 3](https://hackmd.io/@sysprog/BJCG-HGdS) / [Homework 4](https://hackmd.io/@sysprog/Bkb5cDMuH) 共筆和程式碼; - [回顧 Homework 1 / 2](https://hackmd.io/@sysprog/HJlug8GOS) * [CS:APP 第 2 章重點提示和練習](https://hackmd.io/s/rJoxSsiuG) * [作業](https://hackmd.io/@sysprog/Bkb5cDMuH) - [compute-pi](https://hackmd.io/@sysprog/H1U778MOH), [quiz4](https://hackmd.io/@sysprog/HkiTiPzdr) * Week 4 隨堂測驗: - [題目](https://hackmd.io/@sysprog/B1keOS-dB) / [作答表單](https://forms.gle/uZP7nPpyNMHhda8d6) * 第 5 週 (Oct 10): 停課一次,在家測驗 * [題目](https://hackmd.io/@sysprog/BJvfgm2_B) / [作答表單](https://forms.gle/hjHiqqYspQZbWY1T7) (測驗時間 15:00 - 23:50 Oct 10) * 第 6 週 (Oct 17): Code Review * [Making C Less Dangerous in the Linux Kernel](https://outflux.net/slides/2019/lca/danger.pdf) / [錄影](https://www.youtube.com/watch?v=FY9SbqTO5GQ) - Linux 核心中各式 C 語言程式設計的安全和正確議題 - Variable Length Arrays are bad and slow - Explicit switch case fall-through - Always-initialized automatic variables - Arithmetic overflow detection - Hope for bounds checking - Control Flow Integrity: forward edges - Control Flow Integrity: backward edges - 也提供了 gcc/clang 相關的編譯參數 - [解說1](https://news.ycombinator.com/item?id=19006025), [解說2](https://www.reddit.com/r/linux/comments/ajztr3/making_c_less_dangerous_in_the_linux_kernel_by/) - [回顧 Homework 1 / 2](https://hackmd.io/@sysprog/HJlug8GOS) * [回顧 Homework 3 / 4](https://hackmd.io/@sysprog/Sy4WU9HFH) * 第 7 週 (Oct 24): 機器內部表示法 * [CS:APP 第 2 章重點提示和練習](https://hackmd.io/s/rJoxSsiuG) * [CS:APP 第 3 章重點提示和練習](https://hackmd.io/s/HJDRfVCFG) * [從餘數運算到 RSA 加密演算](https://hackmd.io/s/SyBXfc8i7) * [隱藏在字典裡的數學](https://hackmd.io/@sysprog/BkE3uSvdN) * [回顧 Homework 3 / 4](https://hackmd.io/@sysprog/Sy4WU9HFH) * [C 語言: 未定義行為](https://hackmd.io/s/Skr9vGiQm): C 語言最初為了開發 UNIX 和系統軟體而生,本質是低階的程式語言,在語言規範層級存在 undefined behavior,可允許編譯器引入更多最佳化 * [C 語言: 編譯器和最佳化原理](https://hackmd.io/s/Hy72937Me) * [C 語言: 連結器與程式行為](https://hackmd.io/s/SysiUkgUV) * [C 語言: 動態連結器](https://hackmd.io/s/HkK7Uf4Ml) * [C 語言: 執行階段程式庫 (CRT)](https://hackmd.io/s/Hkcr5cn97) * [C 編譯器原理和案例分析](https://hackmd.io/s/H1ZzeiCIQ) * [C 語言: Stream I/O, EOF 和例外處理](https://hackmd.io/s/Sy8pJ0x9G) * [作業](https://hackmd.io/@sysprog/rkw3RV0YS) - [dict](https://hackmd.io/@sysprog/S1Nn_ECYS), [quiz5](https://hackmd.io/@sysprog/HkXxerRFS), [quiz7](https://hackmd.io/@sysprog/Hy3zZSAtH) * Week 7 隨堂測驗: - [題目](https://hackmd.io/@sysprog/BkavHnFFS) / [作答表單](https://forms.gle/6peGUaUcEtT48FD16) * 第 8 週 (Oct 31): 程式碼最佳化 * [Snap: a Microkernel Approach to Host Networking](https://ai.google/research/pubs/pub48630/) - 來自 Google 的研究成果,發佈於 [SOSP 2019](https://sosp19.rcs.uwaterloo.ca/) / [Hacker News 討論](https://news.ycombinator.com/item?id=21374204) - Google's user land networking system achieves "over 3x Gbps/core improvement for RPC workloads, RDMA-like perf of up to 5M IOPS/- core." - [淺談 Microkernel 設計和真實世界中的應用](https://hackmd.io/@sysprog/SJ55y7fR) * 為何你要掌握數學?即使 Linux 核心內部也大量可見: - [從 CPU cache coherence 談 Linux spinlock 可擴展能力議題](https://hackmd.io/@sysprog/BJ8djgdnm) - [Linux 核心設計: 淺談同步機制](https://hackmd.io/s/SJpp-bN0m) - [Linux 核心設計: 多核處理器和 spinlock](https://hackmd.io/s/rJbXgzz-4) - [Linux 核心設計: Scalability 議題](https://hackmd.io/@sysprog/HkfDtLnbH) - [Reed-Solomon Library Programming Interface](https://github.com/torvalds/linux/blob/master/Documentation/core-api/librs.rst): Flash ECC - [MTD NAND Driver Programming Interface](https://github.com/torvalds/linux/blob/master/Documentation/driver-api/mtdnand.rst): ECC, 參見 [錯誤更正碼簡介](https://w3.math.sinica.edu.tw/math_media/d184/18404.pdf) / [抽象代數的實務應用](http://bit.ly/abstract-algebra) * [CS:APP 第 5 章重點提示和練習](https://hackmd.io/s/SyL8m4Lnm) * [CS:APP 第 4 章重點提示](https://hackmd.io/s/ByKFm4CFz) * [回顧 Homework 3 / 4](https://hackmd.io/@sysprog/Sy4WU9HFH) * Week 8 隨堂測驗: - [題目](https://hackmd.io/@sysprog/Skz51Kv5B) / [作答表單](https://forms.gle/31iLE35675JDCses5) * 第 9 週 (Nov 7): Computer Architecture * 人工智慧涉及大量運算,和底層計算機結構及數值表示法高度相關: [Making floating point math highly efficient for AI hardware](https://code.fb.com/ai-research/floating-point-math/), [bfloat16 floating-point format](https://en.wikipedia.org/wiki/Bfloat16_floating-point_format) * [CS:APP 第 4 章重點提示和練習](https://hackmd.io/s/ByKFm4CFz) * [CS:APP 第 5 章重點提示和練習](https://hackmd.io/s/SyL8m4Lnm) * Week 9 隨堂測驗: - [題目](https://hackmd.io/@sysprog/B10_EnxoS) / [作答表單](https://forms.gle/CkPAiVtcPBc8SDUL6) * 第 10 週 (Nov 14): Memory Hierarchy * [CS:APP 第 6 章重點提示](https://hackmd.io/s/H1vQ3vu2z) * [Linux: 賦予應用程式生命的系統呼叫](https://hackmd.io/s/HyNbWoD1V) * [Linux: 記憶體管理](https://hackmd.io/s/rJBXOchtE) * 第 11 週 (Nov 21): Virtual Memory * 佳句偶得:「寫程式就可以讓機器做事,當你會使用機器的時候,你就不用把人當機器用。但學校偏偏是個把學生訓練成機器的地方。」([出處](https://twitter.com/zonble/status/1170927028305944576)) * 最佳化來自對系統的掌握 - [Clang-format tanks performance](https://travisdowns.github.io/blog/2019/11/19/toupper.html) * Slow: ```C #include #include ``` * Fast: ```C #include #include ``` - [Performance speed limits](https://travisdowns.github.io/blog/2019/06/11/speed-limits.html) - [Beating up on qsort](https://travisdowns.github.io/blog/2019/05/22/sorting.html) * [CS:APP 第 9 章重點提示](https://hackmd.io/s/SkCLi8YgN) * Week 11 隨堂測驗: - [題目](https://hackmd.io/@sysprog/Hymc9MmhS) / [作答表單](https://forms.gle/uf6nTe4VzkLbcVMaA) * [分組表](https://hackmd.io/@sysprog/B1sHrRQhr): 請在 12 月 3 日前執行選定的任務 * 第 12 週 (Nov 28): 記憶體管理 - 確認 [分組表](https://hackmd.io/@sysprog/B1sHrRQhr) - [The golden age of ever-changing computer architecture](https://hackaday.com/2019/11/27/the-golden-age-of-ever-changing-computer-architecture/) * 李飛飛教授的 TED 演說 [How we teach computers to understand pictures](https://www.youtube.com/watch?v=40riCqvRoMs) - [ImageNet: A Large-Scale Hierarchical Image Database](http://www.image-net.org/papers/imagenet_cvpr09.pdf) - [Now anyone can train Imagenet in 18 minutes](https://www.fast.ai/2018/08/10/fastai-diu-imagenet/) * [CS:APP 第 9 章重點提示](https://hackmd.io/s/SkCLi8YgN) * 第 13 週 (Dec 5): 重新探討 Process * [5G 晶片大廠新品對決](https://tw.appledaily.com/new/realtime/20191204/1672429) - 有好規格就有話語權 - 「高通推出最新旗艦款處理器 S865 晶片需外掛數據晶片,整套開出 120-150 美元,符合市場價格,但今年特別的是,針對中高階的 5G 單晶片,聯發科天璣 1000採用台積電 7 奈米製程,以無敵貴的 75 美元至 80 美元,硬是比高通 5G S765 70 美元還來的高」 * [Linux: 不僅是個執行單元的 Process](https://hackmd.io/@sysprog/r1ojuBGgE) * [Linux: 不只挑選任務的排程器](https://hackmd.io/@sysprog/rJbcHS5LE) * [UNIX 作業系統裡頭 fork/exec 的前世今生](https://hackmd.io/@sysprog/SJMxX4cUB) - [Creating new processes with fork()](https://youtu.be/ss1-REMJ9GA) - [Bash fork bomb](https://kerneltalks.com/scripts/bash-fork-bomb-how-it-works/) * [Malloc Bootcamp](http://www.cs.cmu.edu/~213/activities/mallocbootcamp-f19.pdf) * Week 13 隨堂測驗: - [題目](https://hackmd.io/@sysprog/B1k4cfU6S) / [作答表單](https://forms.gle/9zcWKa1uaPL6ZPBr7) * 第 14 週 (Dec 12): 數學基礎 + 分組報告重點提示 * 2018 年 11 月 16 日新版國際單位制通過,新的公斤定義將改以物理學的普朗克常數為標準 (WTF?!) * 世界上所有的測量結果都可以追溯到「國際單位制」(Système International d'Unités;SI Units) * 國際單位制以七個基本單位為基礎,並由此推導出各種可相互換算的測量單位。多年來,測量的定義 —— 安培(ampere)、燭光(candela)、克耳文(kelvin)、公斤(kilogram)、公尺(meter)、莫耳(mole)以及秒(second) —— 都已重新定義 * 質量測量的標準源於存放在法國巴黎近郊國際度量衡局的單一物件 —— 國際公斤原器 (IPK),自 1884 年被鑄造成為公斤的標準以來一直存放在此,[有什麼問題呢?](https://www.eettaiwan.com/news/article/20181123NT01-The-Kilogram-Has-a-New-Definition) - 根據近年的量測顯示,IPK 重量已減少約 50 微克 - 經過全球國家度量機構數十年的討論和研究,決定捨棄實體的 IPK,改以普朗克常數重新定義公斤單位,其定義比 IPK 至少穩定 100 萬倍 * video: [公斤是如何重新定義?](https://www.youtube.com/watch?v=E-IBVXNHyKc) - 目前的公斤質量是指以地心引力施加特定的力,修訂後的定義改用電磁力取代機械力進行測量 - 未來改以基布爾秤(Kibble balance)測量,後者以電磁力精準量測物體質量,可測量出多少電流產生的電磁力,才等同於作用在給定質量上的力。 * [Week9 提過碎形](https://hackmd.io/@sysprog/B10_EnxoS),現在來思考 [希爾伯特曲線與豪斯多夫維度](https://youtu.be/WCZRRw_0Fa0) * [分組報告重點提示](https://hackmd.io/@sysprog/B1sHrRQhr) * [Linked list comparison](https://github.com/WojciechMula/toys/tree/master/linearsearch) ``` # Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz, 24 cores list : 0.534s, speedup 1.00 array list (4) : 0.293s, speedup 1.82 array list (8) : 0.160s, speedup 3.33 SIMD array list (4) : 0.263s, speedup 2.03 SIMD array list (8) : 0.140s, speedup 3.80 ``` * 第 15 週 (Dec 19): I/O 和開發典範 * CS:APP 第 8 章重點提示: [C 語言: Stream I/O, EOF 和例外處理](https://hackmd.io/s/Sy8pJ0x9G) * [CS:APP 第 10 章重點提示](https://hackmd.io/s/H1TtmVTTz) * [Linux: 中斷處理和現代架構考量](https://hackmd.io/s/S1WKTCFM4) * [C 語言: 物件導向程式設計](https://hackmd.io/s/HJLyQaQMl) * [Functional Programming 風格的 C 語言實作](https://hackmd.io/@sysprog/HyS-9S6OE) - 是種 programming paradigm (開發典範),不是 design pattern 也不是 framework,更不是 language。簡單來說,FP 是種以數學函數為中心的「思考方式」與「程式風格」; - 透過 C 語言程式提供若干案例,如列舉數值、(不需要動態配置記憶體的) 反轉 linked list 元素、對 Linked List 元素進行合併排序; * [An Introduction to Cache-Oblivious Data Structures](https://rcoh.me/posts/cache-oblivious-datastructures/) - 「自動快取資料結構」,特性是無視硬體特定的快取大小,可能達到接近最優化快取的效能; - 在現代 CPU 多層多種大小的快取架構下,它的理論宣稱其能自動優化在所有層的快取的存儲效率。傳統上電腦科學做偏理論的不太重視實作上的效能,而做實作或硬體優化的則不太重視理論分析。這個學門卻是橫跨了相當理論的演算法分析(需要相當多的進階數學工具),以及相當低階的硬體效能理解; - 影片: [Memory Hierarchy Models](https://www.youtube.com/watch?v=V3omVLzI0WE) - Google Research 強者的心得: [關於變強這檔事(九)](https://medium.com/@fchern/%E9%97%9C%E6%96%BC%E8%AE%8A%E5%BC%B7%E9%80%99%E6%AA%94%E4%BA%8B-%E4%B9%9D-3fd36c986313) - [Skip List](http://en.wikipedia.org/wiki/Skip_list): 置放大量數字並進行排序的資料結構。不用樹狀結構,而改用高度不同的 List 來連接資料。資料結構在概念上可以表示成 Left Child-Right Sibling Binary Tree 的模式。是 Cache-oblivious Algorithm 的經典範例,時間複雜度與空間複雜度與 Binary Search Tree 皆相同,但是實際運作效率比 Binary Search Tree 還要好。 * 第 16 週 (Dec 26): Networking * [CS:APP 第 11 章重點提示](https://hackmd.io/s/ByPlLNaTG) * [分組表](https://hackmd.io/@sysprog/B1sHrRQhr) * Week 16 隨堂測驗: - [題目](https://hackmd.io/@sysprog/rkzNb3gJ8) / [作答表單](https://forms.gle/Yvn8puDMkPq1x9vf6) * 第 17 週 (Jan 2): * [CS:APP 第 11 章重點提示](https://hackmd.io/s/ByPlLNaTG) * [Xor Filters: Faster and Smaller Than Bloom Filters](https://lemire.me/blog/2019/12/19/xor-filters-faster-and-smaller-than-bloom-filters/) - 應用案例: 你可能有個希望屏蔽的 Web 地址列表,當有人輸入新的網址時,你可能需要檢查一下它是否位列你的黑名單之中。或者,也許你有份包含大量已用過密碼的清單,而你希望核對建議的新密碼是否屬於此洩露密碼之列; - [xf8](https://github.com/skeeto/xf8): 用 Ubuntu Linux 系統內的 `/usr/share/dict/american-english` 來測試,後者約有 10 萬筆紀錄,透過 8-bit Xor Filter 建立的表格約佔 123 KB * [Toward Concurrency](https://hackmd.io/s/Skh_AaVix) * Linux: [多核處理器和 spinlock](https://hackmd.io/s/rJbXgzz-4), [淺談同步機制](https://hackmd.io/s/SJpp-bN0m), [RCU 同步機制](https://hackmd.io/s/H19V4eyfV) 進階電腦系統理論與實作 (Fall 2018) ------------------------------------------------------ * 第 1 週 (Sep 14): 誠實面對自己 - [課程簡介和注意須知](https://docs.google.com/presentation/d/1Iuyh_ctWxBgV69S-qZej0oIVaufeoz5S_-rvehCab38/edit) - 注意: 每週均安排測驗,取出其中最高分的 6 次採計 - 歷屆修課學生心得: [張家榮](/User/JaredCJR), [陳品睿](/User/ggary9424), [蕭奕凱](/User/Veck) - [21 世紀的系統軟體](https://hackmd.io/s/H1kIhv__X): 「需求」層次: 正確 → 安全 → 可讀 → 優雅 → 利他; Benchmark / Profiling; 運算模式的巨變; Deep Learning 背後的資訊建設 - [軟體缺失導致的危害](https://hackmd.io/s/B1eo44C1-) - [GNU/Linux 開發工具共筆](https://hackmd.io/c/rJKbX1pFZ): 務必 *自主* 學習 Linux 操作, Git, HackMD, LaTeX 語法 (特別是數學式), GNU make, perf, gnuplot - [透過 Computer Systems: A Programmer’s Perspective 學習系統軟體](https://hackmd.io/c/S1vGugaDQ) - [Bit-wise operations](https://hackmd.io/s/By0MltO_m) - [作業](https://hackmd.io/s/SkWIb_O_X) (截止日: Sep 25) * 雖然不用繳交程式碼,但有大量需要細讀的材料,請務必投入超過 35 小時 - [課程基本資料表單](https://goo.gl/forms/oVQ6Lkax4XcmGgPG2) **務必填寫,以接收課程資訊** - Week1 隨堂測驗: [題目](https://hackmd.io/s/S1a9-YO_Q#) / [作答表單](https://goo.gl/forms/bhj6rm0UxHqFn5B53) * 第 2 週 (Sep 21): C 程式設計和協作 - [linked list 題目分析](https://hackmd.io/s/HyELy5bTz) - [bit-field](https://hackmd.io/s/SJ8y82ZYQ) - [從 C 語言規格看資訊安全漏洞](https://hackmd.io/s/SyE5xaWYX) - [Git commit message 撰寫和改進](https://hackmd.io/s/HJQk5dt2x) - [作業](https://hackmd.io/s/rJwiDHGKQ) (截止日: Oct 7) * [lab0](https://hackmd.io/s/BJp_jq-tm) - Week2 隨堂測驗: [題目](https://hackmd.io/UKpj7o20TLuLqm8t2Erv0g) * 第 3 週 (Sep 28): C 程式設計效能 - [以位元駕馭能量](https://hackmd.io/s/rk2RO0cYX) - [對 Linked List 進行氣泡排序](https://hackmd.io/s/BklGm1MhZ) - [Count Leading Zero (clz) 的實作](https://hackmd.io/s/Skq6P9bpz) * [clz 應用](https://hackmd.io/s/Bk-uxCYxz), [clz 分析](https://hackmd.io/s/Hyl9-PrjW) - [C 語言:記憶體管理、對齊及硬體特性](https://hackmd.io/s/BkuMDQ9K7) * 搭配閱讀: [The Lost Art of Structure Packing](http://www.catb.org/esr/structure-packing/) - 課後閱讀: [What comes after Moore's Law?](https://enterprisersproject.com/article/2018/9/what-comes-after-moores-law): 隨著 Moore's Law 時代的結束, 通用化硬體效能不再如以往快速進步, 因此軟硬體也必須因應如此的變化, 這篇點出 4 個面向: * Ephemeral applications (短暫的軟體): 這點是以企業軟體來談,許多組織的觀點認為軟體壽命比運作其的硬體來得長久。在許多大企業依然如此,然而後續將大量導入 mobile, web, analytics 與其他軟體,更趨向快速轉變以符合客戶與市場所需; * New workloads, such as machine learning: 呼應諸多計算架構大師所說的 Domain-Specific Architecture (DSA); * Cloud platforms: 對於雲端應用而言,使用者不會在意它是在哪種處理器與加速器上運作的; * Open source software: 主要在於特定的軟體開發商因人力與成本而減少支援硬體的範圍,開放原始碼軟體這時能夠作為考慮方案。儘管無法消弭對硬體的相依性,但不像軟體開發商對硬體平台支援或不支援的要求; - [作業](https://hackmd.io/s/SkJbKd1c7) (截止日: Oct 17) * [dict](https://hackmd.io/s/B1Bq5Jat7), [review](https://hackmd.io/s/rywcBOy9Q), [list](https://hackmd.io/s/SyVPDd1cX) - Week3 隨堂測驗: [題目](https://hackmd.io/s/BkyQskjK7#) / [作答表單](https://goo.gl/forms/fpLWdyDckGZSQAcC2) * 第 4 週 (Oct 5): code review - 回顧 [Homework1](https://hackmd.io/s/SkWIb_O_X), [Homework2](https://hackmd.io/s/rJwiDHGKQ) - [作業](https://hackmd.io/s/r1Yp07Uqm) (截止日: Oct 21) * [assessment](https://hackmd.io/s/HJ236XI57), [clang](https://hackmd.io/s/rk2uXEU57) - Week4 隨堂測驗 * 上: [題目](https://hackmd.io/s/HyyxpJE5X) / [作答表單](https://goo.gl/forms/QUp3OrcmXCKzCjoZ2) * 中: [題目](https://hackmd.io/s/Syl6me49Q) / [作答表單](https://goo.gl/forms/rwmVkXkeyjh5clLH3) * 下: [題目](https://hackmd.io/s/By7Lwz4qm) / [作答表單](https://goo.gl/forms/DxB7xDm5GK5IgTQI3) * 第 5 週 (Oct 12): CS:APP * [CS:APP 第 2 章重點提示和練習](https://hackmd.io/s/rJoxSsiuG) * [基於 C 語言標準研究與系統程式安全議題](https://hackmd.io/s/S15o_K3cQ) * Week5 隨堂測驗: [題目](https://hackmd.io/s/B1pWKvp97#) / [作答表單](https://goo.gl/forms/8yHW8Z3gBBqpIPlz2) * 第 6 週 (Oct 19): Code Review * [CS:APP 第 2 章重點提示和練習](https://hackmd.io/s/rJoxSsiuG) * [解讀計算機編碼](https://hackmd.io/s/rylUqXLsm) * [從餘數運算到 RSA 加密演算](https://hackmd.io/s/SyBXfc8i7) * Week6 隨堂測驗: [題目](https://hackmd.io/s/S1azdiUiX#) / [作答表單](https://goo.gl/forms/3DbVpeeksrWN2Zcm1) * [作業](https://hackmd.io/s/S1CRTc8jX) (截止日: Oct 31) - [bits](https://hackmd.io/s/r14wRqUjQ) * 第 7 週 (Oct 26): 測驗 + 分組 * 填寫[分組表](https://hackmd.io/s/SydiC6Ism#) * Week7 紙筆測驗: [題目](https://drive.google.com/open?id=1wnbLLZfTF2qBNUinmpIvmyJ3OGd0e2eG) * 第 8 週 (Nov 2): 程式碼最佳化 * 為何你要掌握數學?即使 Linux 核心內部也大量可見: [從 CPU cache 一致性的角度看 Linux spinlock 的 non-scalable](https://hackmd.io/s/BJ8djgdnm) * [CS:APP 第 5 章重點提示和練習](https://hackmd.io/s/SyL8m4Lnm) * [CS:APP 第 4 章重點提示](https://hackmd.io/s/ByKFm4CFz) * 任務分配: [分組表](https://hackmd.io/s/SydiC6Ism) * 第 9 週 (Nov 9): Computer Architecture * 人工智慧涉及大量運算,和底層計算機結構及數值表示法高度相關: [Making floating point math highly efficient for AI hardware](https://code.fb.com/ai-research/floating-point-math/), [bfloat16 floating-point format](https://en.wikipedia.org/wiki/Bfloat16_floating-point_format) * [CS:APP 第 5 章重點提示和練習](https://hackmd.io/s/SyL8m4Lnm) * [CS:APP 第 4 章重點提示和練習](https://hackmd.io/s/ByKFm4CFz) * Week9 隨堂測驗(上): [題目](https://hackmd.io/s/BJ3iW7GaQ#) / [作答表單](https://goo.gl/forms/VAotwuQB6XOYOmin1) * 第 10 週 (Nov 16): Computer Architecture * [CS:APP 第 4 章重點提示和練習](https://hackmd.io/s/ByKFm4CFz) * Week9 隨堂測驗(中): [題目](https://hackmd.io/s/SyEo8mMpm) / [作答表單](https://goo.gl/forms/ttcrNJs7boQ5r8RZ2) * Week9 隨堂測驗(下): [題目](https://hackmd.io/s/ryiEzUzTm) / [作答表單](https://goo.gl/forms/dJ8EjxkAAXwPk5ZG3) * 第 11 週 (Nov 23): 分組討論 * 李飛飛教授的 TED 演說 [How we teach computers to understand pictures](https://www.youtube.com/watch?v=40riCqvRoMs) - [ImageNet: A Large-Scale Hierarchical Image Database](http://www.image-net.org/papers/imagenet_cvpr09.pdf) - [Now anyone can train Imagenet in 18 minutes](https://www.fast.ai/2018/08/10/fastai-diu-imagenet/) * [分組討論](https://hackmd.io/s/SydiC6Ism) * [CS:APP 第 4 章重點提示和練習](https://hackmd.io/s/ByKFm4CFz) * 第 12 週 (Nov 30): Machine Language * [CS:APP 第 3 章重點提示和練習](https://hackmd.io/s/HJDRfVCFG) * [分組討論](https://hackmd.io/s/SydiC6Ism) * Week12 隨堂測驗:[題目](https://hackmd.io/s/ByYwBWCC7) / [作答表單](https://goo.gl/forms/hfW7FhT04E9aeSpy2) * 第 13 週 (Dec 7): Memory Hierarchy * [CS:APP 第 6 章重點提示](https://hackmd.io/s/H1vQ3vu2z) * Week13 隨堂測驗:[題目](https://hackmd.io/s/SyE-NHvyE#) / [作答表單](https://goo.gl/forms/8ll7n4xsVQEQtGx32) * 第 14 週 (Dec 14): Memory Hierarchy * 2018 年 11 月 16 日新版國際單位制通過,新的公斤定義將改以物理學的普朗克常數為標準 (WTF?!) * 世界上所有的測量結果都可以追溯到「國際單位制」(Système International d'Unités;SI Units) * 國際單位制以七個基本單位為基礎,並由此推導出各種可相互換算的測量單位。多年來,測量的定義 —— 安培(ampere)、燭光(candela)、克耳文(kelvin)、公斤(kilogram)、公尺(meter)、莫耳(mole)以及秒(second) —— 都已重新定義 * 質量測量的標準源於存放在法國巴黎近郊國際度量衡局的單一物件 —— 國際公斤原器 (IPK),自 1884 年被鑄造成為公斤的標準以來一直存放在此,[有什麼問題呢?](https://www.eettaiwan.com/news/article/20181123NT01-The-Kilogram-Has-a-New-Definition) - 根據近年的量測顯示,IPK 重量已減少約 50 微克 - 經過全球國家度量機構數十年的討論和研究,決定捨棄實體的 IPK,改以普朗克常數重新定義公斤單位,其定義比 IPK 至少穩定 100 萬倍 * video: [公斤是如何重新定義?](https://www.youtube.com/watch?v=E-IBVXNHyKc) - 目前的公斤質量是指以地心引力施加特定的力,修訂後的定義改用電磁力取代機械力進行測量 - 未來改以基布爾秤(Kibble balance)測量,後者以電磁力精準量測物體質量,可測量出多少電流產生的電磁力,才等同於作用在給定質量上的力。 * [CS:APP 第 6 章重點提示](https://hackmd.io/s/H1vQ3vu2z) * [分組討論](https://hackmd.io/s/SydiC6Ism) * 第 15 週 (Dec 21): Virtual Memory * [CS:APP 第 9 章重點提示](https://hackmd.io/s/SkCLi8YgN) * Week15 隨堂測驗: [題目](https://hackmd.io/s/HkhzU3KeV) / [作答表單](https://goo.gl/forms/HofqIsNureFFXc283) * 第 16 週 (Dec 28): Virtual Memory + 傅立葉分析 * 公告: - 本學期最後一次上課時間為 2019 年 1 月 11 日; - 分組報告應在 2019 年 1 月 18 日前更新共筆並準備解說錄影 (放在 YouTube 上,設定為公開存取以利評分),預計 1 月 20 日遞交學期評分 * [CS:APP 第 9 章重點提示](https://hackmd.io/s/SkCLi8YgN) * [圖解傅立葉分析](https://hackmd.io/s/S1M6kQgiZ) * [CS:APP Assign5.18](https://hackmd.io/s/rkdzvWJTX) * [分組討論](https://hackmd.io/s/SydiC6Ism) * 第 17 週 (Jan 4): I/O + TCP/IP + sockets * [在網頁瀏覽器裡頭執行 MS-DOS 和毀滅戰士遊戲](https://js-dos.com/DOOM/) - [HackerNews 討論](https://news.ycombinator.com/item?id=18817278) - [其他示範](https://github.com/kripken/emscripten/wiki/Porting-Examples-and-Demos) * [CS:APP 第 10 章重點提示](https://hackmd.io/s/H1TtmVTTz) * [CS:APP 第 11 章重點提示](https://hackmd.io/s/ByPlLNaTG) * Week17 隨堂測驗 * 上:[題目](https://hackmd.io/s/Byt68jObE#) / [作答表單](https://goo.gl/forms/p1W1FL89GIS6TaAB2) * 下:[題目](https://hackmd.io/s/r1nwUX3Z4#) / [作答表單](https://goo.gl/forms/hvRhu9PzsCZU5eZr1) * 第 18 週 (Jan 11): Concurrency + 課程回顧 * [隱藏的傅立葉分析](https://hackmd.io/s/S1jR0mHfN) * [簡單的 FizzBuzz 藏有深度 (Google 面試題)](https://medium.com/@william456821/%E7%B0%A1%E5%96%AE%E7%9A%84-fizzbuzz-%E8%97%8F%E6%9C%89-%E6%B7%B1%E5%BA%A6-google-%E9%9D%A2%E8%A9%A6%E9%A1%8C-f5e66e3a97be) * [Toward Concurrency](https://hackmd.io/s/Skh_AaVix) * Linux: [多核處理器和 spinlock](https://hackmd.io/s/rJbXgzz-4), [RCU 同步機制](https://hackmd.io/s/H19V4eyfV) 作業系統設計與實作 (Spring 2018) ------------------------------------------------------ * 第 1 週 (Feb 27): 誠實面對自己 - [課程簡介和注意須知](https://docs.google.com/presentation/d/143asQtaklIxV_3PGZ1EIM_2DrFfOX7Qblt9xZorQXYg/edit?usp=sharing) * [錄影解說](https://www.youtube.com/watch?v=XXiPPUzld84) - [Bit-wise operations](https://hackmd.io/s/HkMAwkzdf) - [CS:APP 學習指引 (1)](https://hackmd.io/s/SJ7V-qikG) - 歷屆修課學生心得: [張家榮](/User/JaredCJR), [陳品睿](/User/ggary9424), [蕭奕凱](/User/Veck) - [GNU/Linux 開發工具共筆](https://hackmd.io/c/rJKbX1pFZ): 務必 自主 學習 Linux 操作, Git, HackMD, LaTeX 語法 (特別是數學式), GNU make, perf, gnuplot - [作業](https://hackmd.io/s/SJONH8fuz) (截止日: Mar 12) * [phonebook](https://hackmd.io/s/SykZ8IMOf), [因為自動飲料機而延畢的那一年](http://opass.logdown.com/posts/1273243-the-story-of-auto-beverage-machine-1) (記錄心得和啟發) * 課後學習: [你所不知道的C語言:數值系統篇](https://hackmd.io/s/BkRKhQGae), [你所不知道的C語言:指標篇](https://hackmd.io/s/HyBPr9WGl), [你所不知道的C語言:遞迴呼叫篇](https://hackmd.io/s/rJ8BOjGGl) - [課程基本資料表單](https://goo.gl/forms/0ImbCMH1VMG0jyKg2) - Week1 隨堂測驗: [題目](https://hackmd.io/s/rJh9U4Guf) / [作答表單](https://goo.gl/forms/alrwn5w6WT0VHfeM2) * 第 2 週 (Mar 6): 數值系統 * [CS:APP 第 2 章重點提示和練習](https://hackmd.io/s/rJoxSsiuG) - 冼鏡光教授的 [使用浮點數最最基本的觀念](http://blog.dcview.com/article.php?a=Az0HYgNrBDU%3D) * [Bitwise Algorithms](https://www.geeksforgeeks.org/bitwise-algorithms/), [bit-reverse](https://hackmd.io/s/ByzoiggIb), [multiplier](https://hackmd.io/s/r1Z_zPx8-) * [Git commit message 撰寫和改進](https://hackmd.io/s/HJQk5dt2x) * Week2 隨堂測驗: [題目](https://hackmd.io/s/SJO5LN9_M) / [作答表單](https://goo.gl/forms/6IgybKUv8hcn0P9y1) * 第 3 週 (Mar 13): 數值運算 * [從根號 2 的運算談浮點數](https://hackmd.io/s/ryOLwrVtz) + 對應 [CS:APP 3/e](http://csapp.cs.cmu.edu/) 的 **2.3.6** (Page 70-74), **2.4.5** (Page 85-87) * [Code Review Guidelines](https://engineeringblog.yelp.com/2017/11/code-review-guidelines.html), Jonathan Maltz, Software Engineer at Yelp * [你所不知道的C語言: linked list 和非連續記憶體操作](https://hackmd.io/s/SkE33UTHf) * 千萬不要小看 [Linux 核心的 linked list 實作](https://github.com/torvalds/linux/blob/master/include/linux/list.h) (不到 800 行),很多人下載 Linux 核心程式碼後,就急著閱讀 `kernel/` 和 `drivers/` 目錄,沒多久就被各種「偉大」的程式碼嚇跑 + 這些人不懂 C 語言和掌握 Linux 核心的設計概念 + 無法掌握關鍵資料結構,如 linked list * [作業](https://hackmd.io/s/BykAwRuKz): (截止日: Mar 27) + [introspect](https://hackmd.io/s/SJvojkBtG), [assessment](https://hackmd.io/s/BJ0v7eBFz) + 課後預習: [現代處理器設計:原理和關鍵特徵](https://hackmd.io/s/Hk2CscGcl), [現代處理器設計: Cache 原理和實際影響](https://hackmd.io/s/HkW3Dr1Rb) * Week3 隨堂測驗: [題目](https://hackmd.io/s/SknkEfVFf) / [作答表單](https://goo.gl/forms/0b4FW4RhOCU46ldK2) * 第 4 週 (Mar 20): 協同開發和計算機結構 * 公告: + Apr 3 配合校際活動週暫時實體授課,當天用 YouTube 補課,當週也會有對應的作業,請留意 + 每週二 19:30 安排在資訊系舊館一樓 4217 室 (系圖書館) 一對一討論 * Video: [George Dyson: The birth of the computer](https://www.ted.com/talks/george_dyson_at_the_birth_of_the_computer) (有中文字幕,但品質不佳,之後會重新翻譯) * Git commits 案例探討: [dcurl](https://github.com/chenwei-tw/dcurl) // [趣聞](https://www.facebook.com/photo.php?fbid=10156207653132389&set=a.484920257388.262658.541762388) + [SITCON 2018 簡報](https://www.slideshare.net/ChenWei15/sitcon2018-analysis-and-improvement-of-iota-pow-implementation) + [reddit 討論](https://www.reddit.com/r/Iota/comments/85bxsv/dcurl_multithreaded_curl_implementation/) + 指導原則: [Commit Often, Perfect Later, Publish Once](https://sethrobertson.github.io/GitBestPractices/) * [CS:APP 第 3 章重點提示](https://hackmd.io/s/HJDRfVCFG) * [CS:APP 第 4 章重點提示](https://hackmd.io/s/ByKFm4CFz) * 回顧 [Homework1](https://hackmd.io/s/SJONH8fuz) 和 [Homework2](https://hackmd.io/s/BykAwRuKz) * [作業](https://hackmd.io/s/BykAwRuKz): (截止日: Apr 2) + [prefix-search](https://hackmd.io/s/ByFWoR_tz) * Week4 隨堂測驗: [題目](https://hackmd.io/s/SyK-WApKM) / [作答表單](https://goo.gl/forms/sL1irdTNE3Oj9QLw2) * 第 5 週 (Mar 27): 計算機結構 * [CS:APP 第 4 章重點提示](https://hackmd.io/s/ByKFm4CFz) * 課後預習: [手機裡頭的 ARM 處理器](https://beta.hackfoldr.org/arm/) 的「系列講座導論」、「架構和指令集」和「基礎指令和開發環境」 * Week5 隨堂測驗: * 上:[題目](https://hackmd.io/s/SynmEVIqG) / [作答表單](https://goo.gl/forms/EurRIrnorTrDq86A3) * 中:[題目](https://hackmd.io/s/HkQjgqI5G) / [作答表單](https://goo.gl/forms/7KlPfjP1cH2U6apf2) * 下:[題目](https://hackmd.io/s/Sk30MXDqM) / [作答表單](https://goo.gl/forms/fYlDUFKo5mUsX5h52) * 第 6 周 (Apr 3): 停課一次 + 自學 * [作業](https://hackmd.io/s/S1iCyyziG) (截止日: Apr 24) - [list](https://hackmd.io/s/HkxZbJzif) - [c-review](https://hackmd.io/s/ByDzIZzjf) * 第 7 週 (Apr 10): 學習檢討 * [測驗題](https://drive.google.com/open?id=1jp3nXj6Jy2JXZhHNwapn0FDFUSqwT2iZ) / [參考解答](https://drive.google.com/open?id=1XJSbR7gD7Q_QwXaC1YBKUIcctyux4_QF) * 回顧 [Homework2](https://hackmd.io/s/BykAwRuKz) * 延伸閱讀: - [Minimum average and bounded worst-case routing lookup time](http://klamath.stanford.edu/~pankaj/thesis/chapter3.pdf) - [Binary Search Is a Pathological Case for Caches](https://www.pvk.ca/Blog/2012/07/30/binary-search-is-a-pathological-case-for-caches/) * 第 8 週 (Apr 17): Memory hierarchy * [淺談 Microkernel 設計和真實世界中的應用](https://hackmd.io/s/SJ55y7fR) * [Effect of CPU caches](https://medium.com/@minimarcel/effect-of-cpu-caches-57db81490a7f) * [CPU caches](https://lwn.net/Articles/252125/) by Ulrich Drepper (前任 GNU glibc 維護人) - 「[有沒有 glibc 的八卦?](https://news.ycombinator.com/item?id=7953771)」: 比較 Linus Torvalds (Linux 核心) 和 Ulrich Drepper (glibc) 管理風格的差異,不能把開放原始碼專案當作「單一文化」看待 * [software pipelining](https://hackmd.io/s/BJWcEb3xM), [現代處理器設計: Cache 原理和實際影響](https://hackmd.io/s/HkW3Dr1Rb) * Week8 隨堂測驗: [題目](https://hackmd.io/s/Hknr4Rx3z) / [作答表單](https://goo.gl/forms/UtKuFEgEcKEBhL2l1) * 填寫 [分組表](https://hackmd.io/MDIXcaHRTTK-SpAHLNYGTQ) * 第 9 週 (Apr 24): Memory hierarchy + Virtual Memory * [CPU caches](https://lwn.net/Articles/252125/) by Ulrich Drepper * [CS:APP 第 6 章重點提示](https://hackmd.io/s/H1vQ3vu2z) * intrusive vs. non-intrusive data structure - [intrusive/non-intrusive data collection](https://medium.com/fcamels-notes/intrusive-non-intrusive-data-collection-2b937f3c0c0b) - 示範: [intrusive-ds](https://github.com/sysprog21/intrusive-ds) - [Intrusive Lists in Doom 3](https://gpfault.net/posts/intrusive-lists-doom3.txt.html) - [DOOM 3 BFG Technical Note](http://fabiensanglard.net/doom3_documentation/DOOM-3-BFG-Technical-Note.pdf) (Page 7-9) * Week9 隨堂測驗: [題目](https://hackmd.io/s/HyZ7mSn2f) / [作答表單](https://goo.gl/forms/Z0naLxHpaG9HriC12) * 第 10 週 (May 1): Memory hierarchy + code review * [CS:APP 第 6 章重點提示](https://hackmd.io/s/H1vQ3vu2z) * 檢視 [分組狀況](https://hackmd.io/MDIXcaHRTTK-SpAHLNYGTQ) * 回顧 [Homework2](https://hackmd.io/s/BykAwRuKz) 及 [Homework3](https://hackmd.io/s/S1iCyyziG) * 預習: [淺談 Semaphore 與 Mutex](https://drive.google.com/file/d/0B-q4G2qfuMOGaDhiSlF1YzBURkU/view) * 錄影: [淺談 Semaphore 與 Mutex](https://www.youtube.com/watch?v=JEXwO_EoyZo) * [練習題](https://docs.google.com/document/d/1HYrW8gzn87ekAhntmrr5Dd00PN0WuRLblxFqvuNlUNg/edit#heading=h.jj4ulvjrppuw) * 第 11 週 (May 8) * Linux 原始程式碼總是充斥大量背景知識 + [Variable-length arrays and the max() mess](https://lwn.net/Articles/749064/) + [The joy of max()](https://lwn.net/Articles/750306/) + [__is_constexpr](https://qiita.com/tomabou/items/a3d2b7436b3c7da8fc9f) * [CS:APP 3/e 第 10 章重點提示](https://hackmd.io/s/H1TtmVTTz) * [CS:APP 3/e 第 11 章重點提示](https://hackmd.io/s/ByPlLNaTG) * Synchronization: 搭配學習 [Toward Concurrency](https://hackmd.io/s/Skh_AaVix) (有錄影) * Week11 隨堂測驗: + [題目(上)](https://hackmd.io/s/r1zL9gnaf) / [作答表單](https://goo.gl/forms/CIto7U908L5K0UGz2) + [題目(下)](https://hackmd.io/s/Hyo1gcC6M) / [作答表單](https://goo.gl/forms/ca2b4Qx9EZK6wuOT2) * 第 12 週 (May 15): 停課一次 * 第 13 週 (May 22): Linux 執行單元和同步機制 * [如何貢獻開源專案?](https://shinglyu.github.io/web/2018/05/12/how-to-contribute-to-open-source.html) * [以 Linux 為分析對象](https://hackmd.io/s/B19wKV70x) * Week13 隨堂測驗: [題目](https://hackmd.io/s/HJV0SEW1Q) / [作答表單](https://goo.gl/forms/JbFclzK4quwHkSyH3) * 第 14 週 (May 29): Linux 執行單元和同步機制 * [以 Linux 為分析對象](https://hackmd.io/s/B19wKV70x) * [Toward Concurrency](https://hackmd.io/s/Skh_AaVix) * [Concurrency in glibc](https://sourceware.org/glibc/wiki/Concurrency) * Week14 隨堂測驗: [題目](https://hackmd.io/s/ByN53wcy7) / [作答表單](https://goo.gl/forms/ReDP1Oy2KKSzbcwG3) * 第 15 週 (Jun 5): Linux 執行單元和同步機制 * [5 bullet-points of IOTA Qubic](https://www.tangleblog.com/2018/06/04/five-bullet-points-of-iota-qubic-and-its-insane-implications-and-consequences-interpreted/) * [以 Linux 為分析對象](https://hackmd.io/s/B19wKV70x) * [Toward Concurrency](https://hackmd.io/s/Skh_AaVix) * [C11 atomic variables and the kernel](https://lwn.net/Articles/586838/) / [Linux Documentation: Circular Buffers](https://www.kernel.org/doc/Documentation/circular-buffers.txt) * [Toward a Better Use of C11 Atomics: Part 1](https://developers.redhat.com/blog/2016/01/14/toward-a-better-use-of-c11-atomics-part-1/), [Part 2](https://developers.redhat.com/blog/2016/01/19/toward-a-better-use-of-c11-atomics-part-2/) + [Part 1: Mutex Locks](https://github.com/angrave/SystemProgramming/wiki/Synchronization,-Part-1:-Mutex-Locks) + [Part 2: Counting Semaphores](https://github.com/angrave/SystemProgramming/wiki/Synchronization,-Part-2:-Counting-Semaphores) + [Part 3: Working with Mutexes And Semaphores](https://github.com/angrave/SystemProgramming/wiki/Synchronization,-Part-3:-Working-with-Mutexes-And-Semaphores) + [Part 4: The Critical Section Problem](https://github.com/angrave/SystemProgramming/wiki/Synchronization,-Part-4:-The-Critical-Section-Problem) + [Part 5: Condition Variables](https://github.com/angrave/SystemProgramming/wiki/Synchronization,-Part-5:-Condition-Variables) + [Part 6: Implementing a barrier](https://github.com/angrave/SystemProgramming/wiki/Synchronization,-Part-6:-Implementing-a-barrier) + [Part 7: The Reader Writer Problem](https://github.com/angrave/SystemProgramming/wiki/Synchronization,-Part-7:-The-Reader-Writer-Problem) + [Part 8: Ring Buffer Example](https://github.com/angrave/SystemProgramming/wiki/Synchronization,-Part-8:-Ring-Buffer-Example) + [Part 9: Synchronization Across Processes](https://github.com/angrave/SystemProgramming/wiki/Synchronization,-Part-9:-Synchronization-Across-Processes) * Week15 隨堂測驗: [題目](https://hackmd.io/s/HyQnpsXgX) / [作答表單](https://goo.gl/forms/YuBqt5R8x0WKAr1s2) * 第 16 週 (Jun 12): Linux 排程 - 公告: 及早預約補考和一對一討論,發訊息到 [jserv 與他愉快的小夥伴](https://www.facebook.com/JservFans/) + 6 月 12 日 19:30- (在資訊系舊館一樓 4216) - [Introduction to Kernel Programming](https://www.slideshare.net/linuxawy/introduction-to-kernel-programming) - [Effectively Measure and Reduce Kernel Latency for Real-time Constraints](https://elinux.org/images/a/a9/ELC2017-_Effectively_Measure_and_Reduce_Kernel_Latencies_for_Real-time_Constraints_%281%29.pdf) - [Linux Locking Mechanisms](https://www.slideshare.net/kerneltlv/linux-locking-mechanisms) - [Deterministic Memory Allocation For Mission Critical Linux](http://schd.ws/hosted_files/ossna2017/cf/Deterministic%20Memory%20Allocation%20for%20Mission-Critical%20Linux.pdf) - Week16 隨堂測驗: [作答表單](https://goo.gl/forms/et8kheitDF62rG153) * 第 17 週 (Jun 19): 課程回顧 * [分組報告](https://hackmd.io/MDIXcaHRTTK-SpAHLNYGTQ) * [區塊鏈發展資源](https://hackmd.io/c/rkpoORY4W) / [6 月 21 日在成大資訊系: 藏身在區塊鏈的特製程式語言執行環境](https://www.facebook.com/JservFans/photos/a.743333619126308.1073741828.638604962932508/1552722364854092/) * video: [為什麼要學數學?](https://www.youtube.com/watch?v=9uqq2ottHnw) - [倖存者偏差](https://en.wikipedia.org/wiki/Survivorship_bias): 只考慮到偏頗的統計數據 - 用線性思維來思考所有事物導致的謬誤 - 黑天鵝事件 - 萬物都有對應的數學模型,而掌握數學就是掌握一種認知的工具,得以更清晰地認識世界 進階電腦系統理論與實作 (Fall 2017) ------------------------------------------------------ * 第 1 週 (Sep 22): 誠實面對自己 - [課程簡介和注意須知](https://docs.google.com/presentation/d/1-6ZlaL3vd-a54omTpcTQPudbpxz-eqisyd7PY4e_Ctc/edit#) - 注意: 第 2 週安排測驗,請準時參加。參考 [春季班考題](https://drive.google.com/file/d/0B2k5UNgAENkrSlBsOUJIQTNqQ0k/view?usp=sharing) - 近期活動: [矽谷工作經驗談](https://headtoengineer.kktix.cc/events/7c90b8a0-5a5191-9487), [協助準備研究所推薦甄試和撰寫推薦信](https://www.facebook.com/JservFans/posts/1283913268401671) - [21 世紀的系統軟體](https://hackmd.io/s/H1oxJ0Wo-): 「需求」層次: 正確 → 安全 → 可讀 → 優雅 → 利他; Benchmark / Profiling; 運算模式的巨變; Deep Learning 背後的資訊建設 - [軟體缺失導致的危害](https://hackmd.io/s/B1eo44C1-) - [GNU/Linux 開發工具共筆](https://hackmd.io/c/rJKbX1pFZ): 務必 *自主* 學習 Linux 操作, Git, HackMD, LaTeX 語法 (特別是數學式), GNU make, perf, gnuplot - [重新理解數值](https://hackmd.io/s/BkRKhQGae): 2 進位, 3 進位 (?!), 數值表達方式和阿貝爾群, integer overflow; 邏輯和算術的差異; 運用 bit-wise operator; 算術和數位邏輯的關聯 * 對應 [CS:APP3e](http://csapp.cs.cmu.edu/) 的第 2 章: 2.3 整數運算, 2.4.2 IEEE 浮點數表示, 2.4.5 浮點運算 - [Programming Small](https://hackmd.io/s/SkfffA-jZ): 對應 [CS:APP3e](http://csapp.cs.cmu.edu/) 的第 5 章: 5.13 效能提高技術 * 案例探討: [bit-reverse](https://hackmd.io/s/ByzoiggIb) * 案例探討: [multiplier](https://hackmd.io/s/r1Z_zPx8-) - [2017 年秋季作業說明](https://hackmd.io/s/B17yi6WoW) - 選修/旁聽的學生請協助填寫 [課程表單](https://docs.google.com/forms/d/e/1FAIpQLScf9CcJ3_ETZQ8CJvE970Q1bSKUisKxdg8C5k-DTqFwoBLbsQ/viewform) - [作業](https://hackmd.io/s/HyxQTaZj-) (截止日: Oct 8) * [ternary](https://hackmd.io/s/Sym0UAk9Z), [phonebook](https://hackmd.io/s/HJJUmdXsZ), [clz](https://hackmd.io/s/Hyl9-PrjW) - 歷屆修課學生心得: [張家榮](/User/JaredCJR), [陳品睿](/User/ggary9424), [蕭奕凱](/User/Veck) * 第 2 週 (Sep 29): 期初測驗 - 時間: 09:10-14:10 (可中途離席,不要在電腦教室飲食) - 總分 300 分,全部是程式設計題目 (主要用 C 語言),只要能得 60 分以上,就具備本學期課程所需要的基礎 - [期初測驗試題](http://wiki.csie.ncku.edu.tw/sysprog/exam-2017fall.pdf) * 第 3 週 (Oct 6): 計算機組織與結構 - [Computer Architecture](https://hackmd.io/s/H1sZHv4R) ([NOTE](https://hackmd.io/s/rkloHgHcx)) - [Modern Microprocessors (A 90-Minute Guide!) 重點提示和解說](https://hackmd.io/s/Hk2CscGcl) * 錄影: [現代處理器原理和關鍵特徵 (上)](https://www.youtube.com/watch?v=9hNl8fWnHLI) / [現代處理器原理和關鍵特徵 (下)](https://www.youtube.com/watch?v=UHOvgmZNjXI) * 對應 [CS:APP3e](http://csapp.cs.cmu.edu/) 的第 4 章 - [作業](https://hackmd.io/s/HkVvxOD2-) (截止日: Oct 16) * [prefix-search](https://hackmd.io/s/Bki0g_P3Z), [software-pipelining](https://hackmd.io/s/S1eEa_w2b) * 第 4 週 (Oct 13): Code Review - [Homework 1 講評](https://hackmd.io/s/HyxQTaZj-) * [Implementation of Binary Search on a Singly Linked List Using Dual Pointers](http://www.ijcsit.com/docs/Volume%205/vol5issue02/ijcsit20140502215.pdf) * 對應 [CS:APP3e](http://csapp.cs.cmu.edu/) 的第 5 章: 5.6 - 作業: [introspect](https://hackmd.io/s/B1aMNkXa-) (截止日: Oct 26) * 第 5 週 (Oct 20): Code Review - 複習統計學: 交通大學開放課程: [統計學(一)](http://ocw.nctu.edu.tw/course_detail.php?bgid=3&gid=0&nid=277) / [統計學(二)](http://ocw.nctu.edu.tw/course_detail.php?bgid=3&gid=0&nid=511) * [一個群體參數的假說檢定](http://ocw.nctu.edu.tw/course/stat032/9.1.pdf) - [Poisson distribution](http://www.agron.ntu.edu.tw/biostat/Poisson.html) * video: [The Poisson Distribution: Mathematically Deriving the Mean and Variance](https://www.youtube.com/watch?v=65n_v92JZeE) - [Homework 1 講評](https://hackmd.io/s/HyxQTaZj-) / [Homework 2 講評](https://hackmd.io/s/HkVvxOD2-) * 第 6 週 (Oct 27): 現代處理器設計 - [第 1 週作業回顧](https://hackmd.io/s/H1crfllC-) - [第 2 週作業回顧](https://hackmd.io/s/HJfSRge0Z) - [現代處理器設計](https://beta.hackfoldr.org/cpu) (原理和關鍵特徵, cache 原理和多核心議題, 虛擬機器設計與實作) * 對應 [CS:APP3e](http://csapp.cs.cmu.edu/) 的第 4 章 - [作業](https://hackmd.io/s/BJR9BTlRW) (截止日: Nov 9) * [simulator](https://hackmd.io/s/BkQgqpe0Z) * 第 7 週 (Nov 3): Blockchain & Sandboxing - [Don Tapscott 闡述為何區塊鏈是改變現有生態的關鍵技術](https://www.ted.com/talks/don_tapscott_how_the_blockchain_is_changing_money_and_business) [有繁體中文字幕] * Don Tapscott 著有 "Blockchain Revolution : How the Technology Behind Bitcon Is Changing Money, Business and the World" 一書,在這個時間點,區塊鏈 + 數位內容 + 共享經濟平台疊合的效應不容小覷,革命性地跳脫中間抽成和交易成本 - [How Merkle trees enable the decentralized Web](https://taravancil.com/blog/how-merkle-trees-enable-decentralized-web/) - [虛擬機器設計與實作](https://hackmd.io/s/SkBsZoReb) - [Dalvik Implementation](https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxudHVhbmRyb2lkMjAxNHxneDoxN2RmZjEyNDQ2YTg1MTli) - [st9007a: simulator](https://hackmd.io/s/Hkf6pkPAb) - [Ledger launches moxie-based secure VM technology for blockchain applications](http://moxielogic.org/blog/introducing-bolos.html) - [加密貨幣硬體錢包公司 Ledger 與 Intel 合作, 將 SGX 技術整合進產品中](http://blockcast.it/2017/10/25/intel-partners-with-ledger-to-integrate-bitcoin-wallet-software-and-sgx-tech/) - [jslinux](https://bellard.org/jslinux/) - [第 2 週作業回顧](https://hackmd.io/s/HJfSRge0Z) * 第 8 週 (Nov 10): Sandboxing & Formal Verification - 注意: 請在 11:10AM 前完成 [分組登錄](https://hackmd.io/OwDghgTALGDGsFpYFZYDMFQEZoCYIE4UAGBSARmWCmWSmFwFMg==?view) - 若你沒打算退選,請在 11 月 15 日前發信到 ``,標題是 `[sysprog] 你的姓名` (中間有空格),說明以下: * 自我評價前 8 週的學習狀況 * 導致學習進度落後的因素 * 預計補救的措施 - [隔離執行環境的建構與應用](https://hackmd.io/s/Hk9HLRbkf): 加密貨幣領域的系統軟體 * Trusted Execution Environment (TEE) * Trusted Platform Module (TPM) * Moxie 處理器架構 * Ledger 公司推出 BOLOS (Blockchain Open Ledger Operating System) 作為區塊鏈處理的作業系統 * Ledger 公司透過特製的 Moxie 虛擬機器,作為 TEE 的基礎 * Intel 的 Software Guard Extensions (SGX) * 採用 Moxie 架構一來確保極小的處理器和 ISA 實作,二來又保證 GNU Toolchain 的支援 * 使用 GNU profiler 来提高程式碼執行速度 * 支援遠端除錯 - [形式化驗證](https://hackmd.io/s/H1xxp3pF0) * [形式化驗證與 cbmc](https://hackmd.io/s/Hk4lYmzkf) * [程式漏洞導致虛擬貨幣被駭客無限制提領](https://technews.tw/2016/06/21/etheriumdao-hack-that-cloud-get-unlimit-refund/) * [DAO 遭駭事件](https://technews.tw/2016/06/21/etheriumdao-hack-that-cloud-get-unlimit-refund/) - 詳情: [Analysis of the DAO exploit](http://hackingdistributed.com/2016/06/18/analysis-of-the-dao-exploit/), [The DAO, The Hack, The Soft Fork and The Hard Fork](https://www.cryptocompare.com/coins/guides/the-dao-the-hack-the-soft-fork-and-the-hard-fork/) - [第 6 週作業回顧](https://hackmd.io/s/BJR9BTlRW) - [作業](https://hackmd.io/s/rk7xxIGkf) (截止日: Nov 23) * [sandbox](https://hackmd.io/s/BJpTWUM1f) * 第 9 週 (Nov 17): CS:APP - [CS:APP 學習指引 (1)](https://hackmd.io/s/SJ7V-qikG) - [Toward Concurrency](https://hackmd.io/s/Skh_AaVix) * 第 10 週 (Nov 24) - 近期活動:[半導體製造的第一手資訊](https://headtoengineer.kktix.cc/events/7c90b8a0-5a5191-9487-copy-2) - nand2tetris: 運用數位邏輯的概念,使用基本閘組出一台電腦 * [用十分鐘向 nand2tetris 學會設計處理器](https://www.slideshare.net/ccckmit/nand2tetris) * [Shimon Schocken 的 TED 演說](https://www.ted.com/talks/shimon_schocken_the_self_organizing_computer_course?language=zh-tw) - [CS:APP 學習指引 (1)](https://hackmd.io/s/SJ7V-qikG) - [第 8 週作業回顧](https://hackmd.io/s/rk7xxIGkf) * 第 11 週 (Dec 1): SPS IPC Drives 展覽,停課一次 * 第 12 週 (Dec 8): [分組報告](https://hackmd.io/s/rk7xxIGkf) * 第 13 週 (Dec 15) - [Toward Concurrency](https://hackmd.io/s/Skh_AaVix) - [分組報告](https://hackmd.io/s/rk7xxIGkf) * 第 14 週 (Dec 22): - 荷蘭能源公司 ElaadNL 發布[使用 IOTA 的動畫](https://www.youtube.com/watch?v=81rXoSRIRSA),很精緻又淺顯地探討分散式帳本技術在智慧充電的關鍵,特別是可靠的結算 * 第 15 週 (Dec 29): - [Fog computing & P2P CDN](http://blog.hitripod.com/p2p-cdn-fog-computing/) - [Web Ledger Protocol](https://w3c.github.io/web-ledger/): W3C 的草案,DLT 大範圍的落實 - [密碼貨幣與區塊鏈原理](http://www.math.sinica.edu.tw/www/file_upload/summer/crypt2017/data/2017/%E4%B8%8A%E8%AA%B2%E8%AC%9B%E7%BE%A9/[20170726][%E5%AF%86%E7%A2%BC%E8%B2%A8%E5%B9%A3%E8%88%87%E5%8D%80%E5%A1%8A%E9%8F%88%E5%8E%9F%E7%90%86].pdf) / [東京電力公司高層參訪成大 開啟交流第一步](http://news.secr.ncku.edu.tw/files/14-1054-173258,r81-1.php) - [分組報告](https://hackmd.io/s/rk7xxIGkf) - CS:APP Page 726 : 為何以下程式碼不能輸出 `Hello, world!` 呢? ```C void *thread(void *vargp); int main() { pthread_t tid; pthread_create(&tid, NULL, thread, NULL); exit(0); } void *thread(void *vargp) { sleep(1); printf("Hello, world!\n"); return NULL; } ``` * 第 16 週 (Jan 5): - Virtual Memory: [Making Virtual Memory Fast](https://www.youtube.com/watch?v=uyrSn3qbZ8U), [TLB example](https://www.youtube.com/watch?v=95QpHJX55bM) - [Kernel-memory-leaking Intel processor design flaw forces Linux, Windows redesign](https://www.theregister.co.uk/2018/01/02/intel_cpu_design_flaw/) * [Reading privileged memory with a side-channel](https://googleprojectzero.blogspot.tw/2018/01/reading-privileged-memory-with-side.html), Project Zero, Google Inc. * [KASLR is Dead: Long Live KASLR](https://gruss.cc/files/kaiser.pdf), TU Graz * [Vulnerability of Speculative Processors to Cache Timing Side-Channel Mechanism](https://developer.arm.com/support/security-update), Arm - Twitter 上的討論 * [Reactions to Meltdown and Spectre exploits](https://twitter.com/CommitStrip/status/948985234837639169) * ["Exploiting Speculative Execution via Javascript" is possibly one of the most terrifying lines of text I've ever seen, especially since this implies DUMPING KERNEL MEMORY from JAVASCRIPT.](https://twitter.com/blackhole0173/status/948687448053182464) * [P5 microarchitecture. That means ORIGINAL PENTIUM, not PENTIUM PRO, which is P6. Pentium II and later are all P6 CPUs, and are vulnerable.](https://twitter.com/Foone/status/948634015090728960) * [Using #Meltdown to steal passwords in real time](https://twitter.com/misc0110/status/948706387491786752) * [not an Intel problem but an entire chipmaker design problem](https://twitter.com/nicoleperlroth/status/948684376249962496) * 第 17 週 (Jan 12): * [Meltdown 的攻擊方式](https://blog.gslin.org/archives/2018/01/07/8030/), [Meltdown 與 Spectre 都有用到的 FLUSH+RELOAD](https://blog.gslin.org/archives/2018/01/05/8028/) * [Why Raspberry Pi isn't Vulnerable to Spectre or Meldown](https://www.raspberrypi.org/blog/why-raspberry-pi-isnt-vulnerable-to-spectre-or-meltdown/) * 延伸閱讀: - [The Last MileAn Empirical Study of Timing Channels on seL4](http://research.davidcock.fastmail.fm/papers/Cock_GMH_14.pdf) - Speculative execution considered harmful in 1995: "Prefetching may fetch otherwise inaccesible instructions in Virtual 8086 mode.": [source](https://pdfs.semanticscholar.org/2209/42809262c17b6631c0f6536c91aaf7756857.pdf) ```C #include #define MAGIC1 0x100 #define MAGIC2 "\0\xff" #define IS_XXX (*(uint16_t *) MAGIC2 < MAGIC1) ``` - Quiz: [Bubble sort in ARM assembly](https://github.com/jserv/bubble-sort-arm) 作業系統設計與實作 (Spring 2017) ------------------------------------------------------ * 第 1 週 (Feb 21): 誠實面對自己:不是這門課程很操,是你過去欺騙了自己 ([第 1 週課程錄影](https://www.youtube.com/watch?v=XXiPPUzld84)) - [課程簡介和注意須知](https://docs.google.com/presentation/d/1eztX6zH26fTaGS5_c4nydp1rE-7UNzhzkx4EPn26B9c/edit#slide=id.p) - [21 世紀的系統軟體](https://hackmd.io/s/BkeL-hLtg): 「需求」層次: 正確 → 安全 → 可讀 → 優雅 → 利他; Benchmark / Profiling; 運算模式的巨變; Deep Learning 背後的資訊建設: GPU; 軟體品質和安全議題 - [重新理解數值](https://hackmd.io/s/Hy-pTh8Fl): integer overflow; 邏輯和算術的差異; 運用 bit-wise operator; Count Leading Zero - [Programming Small](https://hackmd.io/s/HkO2ZpIYe) - [2017 年春季作業說明](https://hackmd.io/s/Bk-1zqIte) - [課程表單](https://goo.gl/forms/jOIG9QDK3QtUE7Xh2) / 推薦閱讀: [因為自動飲料機而延畢的那一年](http://opass.logdown.com/posts/1273243-the-story-of-auto-beverage-machine-1) - [期初測驗](https://drive.google.com/file/d/0B2k5UNgAENkrSlBsOUJIQTNqQ0k/view?usp=sharing) - [作業](https://hackmd.io/s/Hy2rieDYe) (截止日: Mar 4) * [phonebook](https://hackmd.io/s/rJYD4UPKe), [raytracing](https://hackmd.io/s/HyuBWDwYl), [compute-pi](https://hackmd.io/s/HkiJpDPtx), [clz](https://hackmd.io/s/ry1u0uDFg) * 第 2 週 (Feb 28): 重新理解電腦結構 - [Computer Architecture](https://hackmd.io/s/H1sZHv4R) ([NOTE](https://hackmd.io/s/rkloHgHcx)) - [Modern Microprocessors A 90 Minute Guide!](http://www.lighterra.com/papers/modernmicroprocessors/) (必讀) * [重點提示和解說](https://hackmd.io/s/Hk2CscGcl) - 作業 (截止日: Mar 11) * [introspect](https://hackmd.io/s/SyFpOZQqx) * 第 3 週 (Mar 7): 效能改善,從掌握計算機組織開始 - [SIMD Programming Introduction](https://goo.gl/Rc8xPE) - [在計算機裡頭實踐演算法](https://hackmd.io/s/HyKtIPN0) - [論文 When Prefetching Works, When It Doesn’t, and Why 重點提示和解說](https://hackmd.io/s/HJtfT3icx) - [Code Review: Homework1](https://hackmd.io/OwYwjALARiDMCGBaAbMZAzRECmykA4p8RFsQIx1UAGWATmiA) - [作業](https://hackmd.io/s/HkYlSCJil) (截止日: Mar 20) * [software-pipelining](https://hackmd.io/s/rks62p1sl) * 第 4 周 (Mar 14): 開發工具和並行程式設計 - 近期活動: [前往新加坡工作的第一手資訊](https://www.facebook.com/JservFans/posts/1119413731518293), [手機裡的 ARM 處理器: 系列講座導論](https://www.facebook.com/events/431100433897526/) - [C 語言演化背景和編譯器原理](https://hackmd.io/s/rkjxY6Vjx) - [第 1 週作業回顧](https://hackmd.io/s/BkCe3bSox) - [Toward Concurrency](https://hackmd.io/s/Skh_AaVix) - [測驗](https://hackmd.io/s/H1LYz4Box) / [測驗上傳區](https://hackmd.io/s/HyGmSNrie) - [作業](https://hackmd.io/s/r1lxtzpOig) (截止日: Mar 27) * [phonebook-concurrent](https://hackmd.io/s/rkOExTOoe), [mergesort-concurrent](https://hackmd.io/s/B1xV_p_jl), [microarch](https://hackmd.io/s/r1Olsp_og) * 第 5 周 (Mar 21): 並行程式設計 - 近期活動: [手機裡的 ARM 處理器: 架構和指令集](https://www.facebook.com/events/1913208585629605/), [作業系統概念: Concurrency 程式設計篇 (2)](https://www.facebook.com/events/428684527477530/) - [第 3 週作業回顧](https://hackmd.io/s/HkbFAHRjl) - [C 語言程式設計技巧](https://hackmd.io/s/HyIdoLnjl) - 案例分析: [Linaro Cortex String benchmark for ARMv8](https://wiki.linaro.org/WorkingGroups/Kernel/ARMv8/cortex-strings) * [ssvb/tinymembench](https://github.com/ssvb/tinymembench); [hglm/test-arm-kernel-memcpy](https://github.com/hglm/test-arm-kernel-memcpy) - [inline assembly 中文解說](https://hackmd.io/s/S1-0Ymqsg) - [Toward Concurrency](https://hackmd.io/s/Skh_AaVix) - 預習: [手機裡的 ARM 處理器](https://beta.hackfoldr.org/arm) - [作業](https://hackmd.io/s/ryPKJUm2l) (截止日: Apr 8) * [matrix](https://hackmd.io/s/rkrrpHm2e) * 第 6 週 (3 月 28 日): Memory Model and Consistency - 近期活動: [手機裡的 ARM 處理器: 基礎指令和開發環境](https://www.facebook.com/events/155293451659852/) - [Toward Concurrency](https://hackmd.io/s/Skh_AaVix) - [第 4 週作業回顧](https://hackmd.io/s/rkQajOPhx) - 所見所聞: [再次經歷偉大的「1940 年代」](http://technews.tw/2017/03/22/its-the-1940s-again-ibms-scott-crowder-on-the-infancy-of-quantum-computers/); [99% 零組件 Made in Taiwan 的機器人](https://www.facebook.com/roboard.lab/posts/1359336907486389) * 第 7 週 (4 月 4 日): 掃墓,停課一次 * 第 8 週 (4 月 11 日) - [第 5 週作業回顧](https://www.facebook.com/groups/system.software2017/search/?query=week5) - [做好研究作業系統的準備](https://hackmd.io/s/B19wKV70x) - [2017 年春季班第一次分組表](https://hackmd.io/s/Hkxl2Zcpx) * 第 9 週 (4 月 18 日) - 近期活動: [新加坡求職座談會](https://www.facebook.com/JservFans/posts/1154886117971054) - [不要忘記今晚看成大自製人造衛星的升空直播](https://www.facebook.com/groups/system.software2017/permalink/1371429726255726/) * [為何資訊科技公司急欲發射人造衛星?](https://kknews.cc/tech/a9lgb6.html) - [深入理解 CPU 和異質運算核心](https://mp.weixin.qq.com/s/ieNYIhGDmBqY_urmH7O3TA) - [AI 晶片如何降低功耗?](https://zhuanlan.zhihu.com/p/25382177) - ARM: [聯發科手機晶片面臨的挑戰](https://richard-rrb.blogspot.tw/2017/04/20173.html) / [手機裡的 ARM 處理器](https://beta.hackfoldr.org/arm) (有 8 份錄影) - [以 Linux 為分析對象](https://hackmd.io/s/B19wKV70x) - [案例分析: server-framework](https://hackmd.io/s/B1s8hX1yg) * 第 10 週 (4 月 25 日) - [2017 年春季班第一次分組表](https://hackmd.io/s/Hkxl2Zcpx) * 第 11 週 (5 月 2 日) - [2017 年春季班第二次分組表](https://hackmd.io/s/BJRio2rJb) - Quiz: [Bubble sort in ARM assembly](https://github.com/jserv/bubble-sort-arm) * 第 12 週 (5 月 9 日) - [軟體缺失導致的危害](https://hackmd.io/s/B1eo44C1-) - [淺談 Semaphore 與 Mutex](https://drive.google.com/file/d/0B-q4G2qfuMOGaDhiSlF1YzBURkU/view) * 錄影: [淺談 Semaphore 與 Mutex](https://www.youtube.com/watch?v=JEXwO_EoyZo) * [練習題](https://docs.google.com/document/d/1HYrW8gzn87ekAhntmrr5Dd00PN0WuRLblxFqvuNlUNg/edit#heading=h.jj4ulvjrppuw) - [The Little Book of Semaphores](http://greenteapress.com/semaphores/LittleBookOfSemaphores.pdf) - [以 Linux 為分析對象](https://hackmd.io/s/B19wKV70x) * 第 13 週 (5 月 16 日) - video: [Shimon Schocken 的電腦自修課程](https://www.ted.com/talks/shimon_schocken_the_self_organizing_computer_course?language=zh-tw) - [2017q1 期初測驗提示](https://hackmd.io/s/S1DCzEOeZ) * 第 14 週 (5 月 23 日) - [2017 年春季班第二次分組表](https://hackmd.io/s/BJRio2rJb) * 第 15 週 (5 月 30 日): 端午連續假期,停課 * 第 16 週 (6 月 6 日) - 新聞: [成大、永豐銀行 成立Atelier Future未來智慧生活工場](http://web.ncku.edu.tw/files/13-1000-166724.php?Lang=zh-tw) - Blockchain: [動畫](https://www.youtube.com/watch?v=6WG7D47tGb0), [The Blockchain and Us](https://www.youtube.com/watch?v=2iF73cybTBs), [技術簡介](https://www.slideshare.net/IBTSMG/blockchain-67620150), [市場分析](https://blogs.thomsonreuters.com/answerson/blockchain-technology-chain-reaction/) - [2017 年春季班第二次分組表](https://hackmd.io/s/BJRio2rJb) 進階電腦系統理論與實作 (Fall 2016) ------------------------------------------------------ * 第 1 週 (Sep 23): 誠實面對自己:不是這門課程很操,是你過去欺騙了自己 - [課程簡介和注意須知](https://docs.google.com/presentation/d/15F6sTm9WN6Efc5pjP8HkUVCfNbjqK859-7vYJy81kAc/edit#slide=id.p) - [21 世紀的系統軟體](https://hackmd.io/s/r1srX7Za): 「需求」層次: 正確 → 安全 → 可讀 → 優雅 → 利他; Benchmark / Profiling; 運算模式的巨變; Deep Learning 背後的資訊建設: GPU; 軟體品質和安全議題 - [你所不知道的 C 語言](https://hackmd.io/@sysprog/c-prog/): 本週進度為「指標篇」和「物件導向程式設計篇」 - [重新理解數值](https://hackmd.io/s/SkKZBXZT): integer overflow; 邏輯和算術的差異; 運用 bit-wise operator; Count Leading Zero - [Programming Small](https://hackmd.io/s/S1rbwmZ6): 在小處下功夫,不放棄整體改善的機會 - [本學期作業說明](https://hackmd.io/s/B1DmtJfT) - [隨堂測驗](https://hackmd.io/s/r13u0Af6) - [作業](https://hackmd.io/s/H1B7-hGp) (截止日: Sep 29) * [phonebook](https://hackmd.io/s/S1RVdgza), [raytracing](https://hackmd.io/s/B1W5AWza), [compute-pi](https://hackmd.io/s/rJARexQT), [clz](https://hackmd.io/s/B1LHefQ6) * [W1-QA](https://hackmd.io/s/Hka2UE8a) (只有選修課程的學生需要完成這項) * 第 2 週 (Sep 30): 並行 + 演算法分析 - [第 1 週作業回顧](https://hackmd.io/s/HydMPmjT) - [concurrency](https://hackmd.io/s/H10MXXoT): Concurrency (並行) vs. Parallelism (平行); POSIX Threads; Thread Pool; Lock-free Thread Pool; 對 Linked-List 排序; Producer-Consumer Problem - [Algorithm Complexity Analysis](http://discrete.gr/complexity/) - [隨堂測驗](https://goo.gl/forms/mGZvzTbCbJfBkgwr1): 題目: 將 [Linked List Bubble Sort](http://faculty.salina.k-state.edu/tim/CMST302/study_guide/topic7/bubble.html) 裡頭的排序演算法從 recursive bubble sort 更換為 recursive merge sort - [作業](https://hackmd.io/s/HykJUcnT): (截止日: 08:00AM Oct 7) * [introspect](https://hackmd.io/s/BkhIF92p), [phonebook-concurrent](https://hackmd.io/s/rJsgh0na) * [W2-QA](https://hackmd.io/s/Sk29RMbC) (只有選修課程的學生需要完成這項) * 第 3 週 (Oct 7): 重新理解電腦結構 - [第 2 週作業回顧](https://hackmd.io/s/HkUy3wVC) - [Computer Architecture](https://hackmd.io/s/H1sZHv4R) ([NOTE](https://paper.dropbox.com/doc/Computer-Architecture-Notes-NfGP1aZt2pAkgTcFeiEmc)) - [Modern Microprocessors A 90 Minute Guide!](http://www.lighterra.com/papers/modernmicroprocessors/) (必讀) - [SIMD Programming Introduction](https://goo.gl/Rc8xPE) - [在計算機裡頭實踐演算法](https://hackmd.io/s/HyKtIPN0) - [作業](https://hackmd.io/s/Sy-ch58A): (截止日: 08:00AM Oct 14) * [mergesort-concurrent](https://hackmd.io/s/rJ-GWtJ0), [software-pipelining](https://hackmd.io/s/ry7eqDEC) * [W3-QA](https://hackmd.io/s/r1M_l_NA) (只有選修課程的學生需要完成這項) * 第 4 週 (Oct 14): 作業系統概念的實踐 - [2016 年秋季班分組表(第一次)](https://hackmd.io/CYMwbADAHATAhmAtAVmQRiQFjqxAjYTTRYePZGAYwE4BmSsGIA==?view) - [灰姑娘真能穿玻璃鞋跳舞?工程師提出解答](http://archive.eettaiwan.com/www.eettaiwan.com/ART_8800676444_676964_NT_557e5885.HTM) * 1697 年《鵝媽媽的故事》和 1812 年《格林童話》都提到灰姑娘,而灰姑娘穿什麼材質的玻璃鞋,能夠承受她的體重,讓她舒適地走路和跳舞? - [第 3 週作業回顧](https://hackmd.io/s/S1Bj65p0) - Operating System Concepts - [案例探討: 強化 server-framework 效能](https://hackmd.io/s/rJFnrj6A) - [隨堂測驗](https://goo.gl/forms/pDbtYxeoJHNvmBz32): [題目](https://hackmd.io/s/S1jWCna0) - [作業](https://hackmd.io/s/Sy_O7uCA): (截止日: Oct 20) * server-framework, 回顧既有的作業 * 第 5 週 (Oct 21): 為什麼你該理解編譯器 - [淺談 Microkernel 設計和真實世界中的應用](https://embedded2016.hackpad.com/-Microkernel--xeGzRmcbT20) - [回顧 SIMD 和計算機組織](https://hackmd.io/BwFgnATArARgbFAtBOAGAjIkB2AhpsVAZiMXQBMJsJzUIAzIuAYyA===) + [案例分析:轉置矩陣](https://hackmd.io/s/ryTASBCT) - [編譯器和最佳化原理](https://embedded2015.hackpad.com/C-DWAUb7NnQF0) - [動態連結器](https://embedded2015.hackpad.com/C-VESe3UsncpM) - [作業](https://hackmd.io/s/rk7H0Pw1g): (截止日: Oct 27; 下方擇一,並且 Week4 的專題要繼續作) * [jit-compiler](https://hackmd.io/s/SJ7AZJv1e), [rubi](https://hackmd.io/s/SyWEhlDJx) * 第 6 週 (Oct 28): 你所不知道的記憶體 - [回顧第一次分組成果](https://hackmd.io/s/rkKY7RJex) - [2016 年秋季班分組表(第二次)](https://hackmd.io/s/r1-e1Jgll) - [羅輯思維: 怎樣成為一個高手](https://www.youtube.com/watch?v=4JhlfRAzVKY): 從 12:08 開始 - [Memory Allocation](https://hackmd.io/s/B1SRlfeee) - [How a Rogue Optimization Breaks C11 Memory Consistency](https://goo.gl/B68s9X) - [DTrace for Linux 2016](http://www.brendangregg.com/blog/2016-10-27/dtrace-for-linux-2016.html): BPF tracing 是 Linux 效能分析最後一塊拼圖 * 第 7 週 (Nov 4) 數學總複習:線性代數, 離散數學, 機率統計 - [理解矩陣](http://www.52cs.org/?p=175), [從離散數學到數學文化](http://hkumath.hku.hk/~mks/20DiscrMath.pdf) - [形式化驗證 / Formal verification](https://hackmd.io/s/H1xxp3pF0) - [2016q3 Quiz](https://docs.google.com/document/d/1vGH8ZS7cP0DVjr6jeo91NCCNEXJmhDrzaY5qX0nDrG4/edit?usp=sharing) * 第 8 週 (Nov 11): 校慶停課 * 第 9 週 (Nov 18) 第二次分組成果報告 - [學期評分須知](https://hackmd.io/s/rkfCYai-x) - [新的專案題目](https://hackmd.io/s/Hy4g26jbg) (選擇性) - [第二次分組成果回顧](https://hackmd.io/s/r1-e1Jgll)