作業系統
臺北科技大學 115-1 學期課程,課號 366596。
- 學期:115-1
- 授課教師:賴建宏
- 學分:3
- 選修
- 上課時段:週六 2、3、4 節
課程大綱
本課程以 Windows 11 原機作為主要實作平台,使用 Rust 程式語言帶領學生理解作業系統的核心概念與實務運作方式。課程內容涵蓋 Windows 11 系統架構、user mode 與 kernel mode、process、thread、CPU scheduling、memory management、virtual memory、file system、disk management、registry、Windows service、event log、network stack、security、UAC、Device Manager、Plug and Play 與 driver model 等主題。 不同於傳統以理論講授為主的作業系統課程,本課程強調「以系統工具實作理解作業系統」。學生將使用 Rust 撰寫 Windows 系統監控與管理工具,例如 process viewer、memory monitor、disk information tool、network communication tool、event log tool、service monitor、device information viewer 或 GUI dashboard。透過這些實作,學生能觀察 Windows 如何管理行程、執行緒、記憶體、檔案、磁碟、服務、網路、權限與裝置,並理解應用程式如何透過 Windows API 與作業系統互動。 本課程期中作品要求學生完成 Rust Windows System Monitor CLI,期末作品則要求學生完成 Rust Windows OS Utility,整合至少三項 Windows 作業系統機制,並能說明作品背後對應的作業系統原理。課程最後兩週配合學校自主學習安排,不安排新進度,學生可延伸、修正與補強期末作品。
課程進度
第1週:課程導入:Windows 11 作業系統架構與課程定位。說明本課程以 Windows 11 原機作為主要實作平台,使用 Rust 撰寫系統工具,從實作理解作業系統如何管理行程、執行緒、記憶體、檔案、磁碟、服務、網路、權限與裝置。介紹 user mode、kernel mode、Windows API、system call、Windows kernel architecture 與本課程期中、期末作品要求。 第2週:Windows 系統觀察工具與作業系統基本資源。介紹 Task Manager、Resource Monitor、Event Viewer、Device Manager、Services、Performance Monitor 與 Sysinternals 工具。實作內容為觀察 Windows process、thread、memory、disk、network、service 與 device 狀態,建立學生對 Windows 系統內部運作的初步觀察能力。 第3週:Process、Thread 與 Scheduler。介紹 process、PID、thread、handle、context switch、priority、scheduler、foreground/background process 與 multitasking 概念。實作內容為使用 Rust 撰寫 process viewer,列出目前執行中的 process,顯示 PID、process name、thread count 與基本狀態。 第4週:CPU Scheduling 與多執行緒程式設計。介紹 CPU scheduling、time slice、concurrency、parallelism、race condition、mutex 與同步概念。實作內容為使用 Rust 建立多執行緒工作負載,觀察 CPU 使用率、thread 數量與系統反應變化,理解 OS 如何分配 CPU 資源。 第5週:Windows 記憶體管理。介紹 virtual memory、physical memory、working set、private bytes、commit charge、page file、heap、stack 與 process address space。實作內容為撰寫 Rust memory monitor,顯示系統記憶體與指定 process 的記憶體使用狀態。 第6週:檔案系統、磁碟與 NTFS。介紹 file system、path、metadata、permission、ACL、file handle、file cache、disk volume、partition 與 NTFS 基本概念。實作內容為撰寫檔案掃描器與磁碟空間查詢工具,顯示檔案資訊、磁碟容量、可用空間與使用比例。 第7週:Windows API、Handle、User Mode / Kernel Mode 邊界與期中作品規格說明。介紹 Windows API、handle table、system call boundary、user mode 與 kernel mode 的分工。實作內容為使用 Rust 呼叫 Windows API 取得系統資訊。課堂後段說明期中作品規格、繳交格式與評分標準。 第8週:期中作品製作週。本週不安排正式授課,保留時間讓學生完成期中作品。學生需完成一個 Rust Windows System Monitor CLI,功能至少包含 process list、memory usage、disk information 與 basic system information,並準備簡短作品說明。 第9週:期中作品繳交、展示與評分。學生於當週課堂繳交期中作品,由教師現場檢查程式執行結果、原始碼、功能完成度與系統概念說明。學生需能說明作品如何對應 process、thread、memory、file system、disk management 與 Windows API 等作業系統概念。 第10週:Registry、系統設定與權限管理。介紹 Windows Registry、key/value、系統設定、應用程式設定、系統組態與存取權限。實作內容為使用 Rust 讀取指定 registry key,並觀察不同權限下可存取的系統設定範圍,理解 registry 在 Windows OS 中的角色。 第11週:Windows Service 與 Service Control Manager。介紹 service、daemon、background process、Service Control Manager、啟動類型、service lifecycle、service permission 與 background monitoring 概念。實作內容為建立簡易 Rust background service 或 service simulator,理解 Windows 服務如何由作業系統管理。 第12週:Event Log 與系統診斷。介紹 Event Viewer、event log、log level、system log、application log、security log、故障診斷與維運觀念。實作內容為撰寫 log 工具,記錄程式執行狀態與錯誤訊息,並觀察 Windows 事件紀錄與系統診斷流程。 第13週:Network Stack 與 Socket Programming。介紹 TCP、UDP、IP、port、socket、client/server、connection state、firewall 與 Windows network stack。實作內容為使用 Rust 撰寫 TCP client/server 或 UDP broadcast 工具,理解應用程式如何透過作業系統進行網路通訊。 第14週:Device Manager、PnP、Driver Model、Security 與 UAC。介紹 Device Manager、Plug and Play、driver stack、kernel driver、user-mode driver、HID、USB serial、device abstraction、administrator privilege、ACL、UAC、process token 與基本安全模型。實作內容為觀察裝置與驅動程式資訊,並建立簡易 user-mode device interaction demo 或 device information viewer。 第15週:期末作品製作週。本週不安排正式授課,保留時間讓學生完成期末作品。學生需完成一個 Rust Windows OS Utility,可選擇 system monitor、memory monitor、service monitor、network tool、event log tool、device information viewer、GUI dashboard、input helper 或 user-mode device simula
評量方式
期中繳交企劃即可 50%,期末則必須有完整的作品展示或錄影、詳細設計內容 50%
教材
【遵守智慧財產權觀念,請使用正版教科書,不得使用非法影印教科書】 使用外文原文書:否 第一次上課由我提供自製講義