MIT OpenCourseWare


» 進階搜尋
 課程首頁
 教學大綱
 教學時程
 相關閱讀資料
 課堂講稿
 實作課程
 作業
 測驗
 下載課程

教學大綱


本頁翻譯進度

燈號說明

審定:林偉棻(簡介並寄信)
翻譯:曾琬瑂(簡介並寄信)
翻譯:陳盈夙(Grace Chen)(簡介並寄信)

概要

6.828這門課程教授工程作業系統的基礎。你將詳細地研究虛擬記憶體、核心和使用者模式、系統呼叫、執行緒、環境切換、中斷、行程間通訊、同步活動間的協調,以及軟體和硬體間的介面。最重要的是,你將研討這些概念之間的互動,並且學會如何去處理這些互動產生的複雜度。

為了要掌握這些概念,6.828課程有系統地分成3個部分:課堂講稿、相關閱讀資料和主要的實作課程。課堂講稿和相關閱讀資料可讓你熟悉主要的概念。實作課程則促進你瞭解更深一層的概念,因為你將從最基礎完成創建一個作業系統。在實作課程後你將能體會設計目標的意思,如「降低複雜度」和「概念上的完整性」。

課堂講稿被組織成2個主要部分。第一部分詳細介紹UNIX® v6這個作業系統。在每一課中,我們將以一部分的v6原始碼為例並且研讀,家庭作業將幫助你預習每一課程。在第一部分的最後(大約是期中),你將瞭解一個構思設計精良的作業系統原始碼,如此可幫助你創建自己的作業系統。

第二部分的課堂講稿,包含了在UNIX®v6(1976)之後所創建的重要作業系統概念。藉由閱讀研究論文和課堂討論,我們將研讀更多最新的觀念。你也可以在自己的作業系統中實作這些新的概念。

你可能懷疑為何我們研究的是UNIX®v6,而不是最新和最廣泛的Linux®、Windows®或BSD UNIX®的系統。其中一個理由是UNIX®v6系統不但簡單,程式精簡(由2個人撰寫的9000行程式),而且完整(能提供完整的多使用者分時系統)。另一個理由是v6具備了智慧型的完整性, 是一個良好設計的典範。最後,幾乎大多數的現代作業系統都採用了v6的構思(包含了c程式語言)。許多現代的UNIX®系統有著和v6一樣的內部結構,而且他們的資料結構的命名甚至和v6一樣。總之,v6系統雖然舊,但不表示已不適用。(例如牛頓定律在今天仍然適用,而且愛因斯坦的相對論也還相當值得一讀。)

實作課程就像讓一部車的輪子上路一樣。在實作課程中你將吸收這些概念和他們之間的互動細節。舉例來說,雖然你已在6.004和6.033的課程中學習到虛擬記憶體,而且在6.828課程中又再複習了一次;很快地你將在實作課程中發現,之前讀過的理論並沒有令你真的那麼瞭解虛擬記憶體以及它如何和其他概念互相作用。

實作課程由6主題重疊架構組成一個最精簡的作業系統,在其上你可以用自己的shell程式執行簡單命令。(我們保留了最後一次上課時間讓你示範你的作業系統給班上其他人參考)

你所建構的作業系統要有UNIX®-like的功能(如fork和exec系統呼叫),但是要以外核心的方式呈現(即UNIX®的功能大部分以使用者層次類別庫的方式來實現,而非內建在核心裡 )。作業系統的主要部分為:

1. 啟動載入器
2. 記憶體管理
3. 行程和環境切換
4. Fork系統呼叫和IPC
5. Exec系統呼叫和精簡檔案系統
6. shell程式

我們會提供部分的程式碼架構,但是你將實作所有困難的工作。

前5項作業是獨立作業,最後一項是分組作業。第一部分的作業某些部分細節可自由的設計,最後一項作業大部分皆可自由設計。你當然無法完全仿照UNIX® v6;但藉由不同的方法建構出相似的功能,你將吸收到這些概念。

你將建構個人電腦(x86 PC)的作業系統。為了簡化開發過程,我們使用完整的機器模擬器(Bochs)。這個模擬器足以讓你在實際硬體上真正啟動你的作業系統。

在實作課程的最後,你將能輕鬆了解大多數作業系統的原始碼,簡單來說, 就是能夠輕鬆掌握系統軟體。你將瞭解作業系統概念的細節,並將此概念運用在其他的環境底下。你也會更徹底明白x86處理器和C程式語言。

必備先修課程

C程式語言、6.033 資訊系統工程(Computer System Engineering), and 6.170 軟體工程實驗(Laboratory in Software Engineering) (也涉及 6.004)
研究生學分課程 (高等研究生學分課程)
3-6-3
6延伸學位課程
(譯註:(3-6-3)、「研究生學分」和「高等研究生學分」請參考的解說。)

6.828課程研究作業系統工程的基本設計和實作問題。課堂講稿內容是根據UNIX®的研究和研究論文所編製。課題包含虛擬記憶體、執行緒、環境切換、核心、中斷、系統呼叫、行程間通訊、協調以及軟體和硬體間的介面。各個實作課程的作業教授學生們以C語言和最少數的x86組合語言,發展一個精簡的作業系統。學生希望具有C程式設計的背景知識。

6.828課程可記為學生在電腦系統學程中工程組必修課程之一。

誰適合加入本課程?

6.828預期的對象主要為想詳細學習作業系統的高年級和工學院碩士班學生。博士班學生也相當歡迎,但必須注意6.828課程並非TQE的核心學科。

計分方式

6.828課程的分數主要根據兩次測驗的結果計算(一個在期中,另一個在最後一週,總共佔30%),實作課程練習(50%),還有家庭作業和課程參與度(合計20%)。

作業繳交方式

繳交實作課程,請在實作課程截止日星期四中午前寄送電子郵件。

每一個實作課程都必須繳交。如果沒有繳交實作課程將得到成績「F」,有繳交實作課程但分數是0分時將得到成績[D] 。在整個學期中你可以有3天的遲交時間不會影響到你的成績,遲交天數以整數計算:一個作業只要遲交6小時就算一天遲交。當你用完你的遲交天數,每額外遲交一天,將會讓你總成績受到影響。星期六和星期日也算在內。

合作研究

我們的教學方式相當簡單,皆根據專業標準:在測驗時你不應該和其他同學合作。但所有其他的作業你,可以和任何人合作交換想法和觀念,但是你必須自己完成所有的作業,並且仔細地致謝其他人提供的想法,無論是同學或是你所閱讀的相關資源。


上課時間

授課時間為星期一和星期三各1.5小時。

講師

Frans Kaashoek

講師的致謝

6.828課程由於一群極為出色的助教群今天才能存在:Josh Cates、Russ Cox、Bryan Ford和Emil Sit。他們實現這個課程。我們全體將課程6.828獻給Josh Cates並紀念他,希望Josh對作業系統的熱忱能鼓舞許多的學生。


Overview

6.828 teaches the fundamentals of engineering operating systems. You will study, in detail, virtual memory, kernel and user mode, system calls, threads, context switches, interrupts, interprocess communication, coordination of concurrent activities, and the interface between software and hardware. Most importantly, you will study the interactions between these concepts, and how to manage the complexity introduced by the interactions.

To master the concepts, 6.828 is organized in three parts: lectures, readings, and a major lab. The lectures and readings familiarize you with the main concepts. The lab forces you to understand the concepts at a deep level, since you will build an operating system from the ground up. After the lab you will appreciate the meaning of design goals such "reducing complexity" and "conceptual integrity".

The lectures are organized in two main blocks. The first block introduces one operating system, UNIX® v6, in detail. In each lecture we will take one part of v6 and study its source code; home work assignments will help you prepare for these lectures. At the end of the first block (about half-way the term), you will understand the source code for one well-designed operating system, which will help you building your own operating system.

The second block of lectures covers important operating systems concepts invented after UNIX® v6 (1976). We will study the more modern concepts by reading research papers and discussing them in lecture. You will also implement some of these newer concepts in your operating system.

You may wonder why we are studying UNIX® v6 instead of the latest and greatest version of Linux®, Windows®, or BSD UNIX®. One reason is that UNIX® v6 is simple and small (9,000 lines of code, written by two people), yet complete (it provides a complete multi-user time sharing system). Another reason is that v6 is a great example of good design with intellectual integrity. Finally, almost all modern operating systems have adopted ideas from v6 (including the C programming language). Many modern UNIX® have an internal structure identical to v6 and many of their data structures are still named as in v6. In short, because v6 is old, it doesn't mean it is irrelevant. (The laws of Newton are still relevant and Einstein's papers on relativity theory are still well worth reading too.)

The lab is the place where the rubber meets the road. In the lab you will internalize the details of the concepts and their interactions. For example, although you have seen virtual memory in 6.004, 6.033, and again in 6.828 lectures, you will soon discover, during the labs, that you didn't really understand virtual memory, and how it interacts with other concepts.

The lab is split into 6 major parts that built on top of each other, accumulating in a primitive operating systems on top which you can run simple commands through your own shell. (We reserve the last lecture for you to demo your operating system to the rest of the class.)

The operating system you will build will have UNIX®-like functions (e.g., fork, exec), but is implemented in an exokernel style (i.e., the UNIX® functions are implemented mostly as user-level library instead of built-in to the kernel). The major parts of the operating system are:

1. A boot loader
2. Memory management
3. Processes and context switching
4. Fork and IPC
5. Exec and a primitive file system
6. A shell

We will provide skeleton code for pieces, but most you will have to do all the hard work.

The first 5 assignments are done individually. The last assignment is a team assignment. The first set of assignments have design freedom in the details; the last assignments have a lot of design freedom. You will never be able to pattern match from UNIX® v6; you internalize the concepts by building similar functions in a radical different way.

You will develop your operating system for a personal computer (an x86-based PC). To simplify development we will use a complete machine simulator (Bochs). This simulator is real enough that you can boot your own operating system on the real hardware.

At the end of the lab you will be able to find your way around the source code of most operating systems, and more generally, be comfortable with system software. You will understand many operating systems concepts in detail and will adapt them to other environments. You will also under the x86 processor and the C programming language well.

Prerequisites

C, 6.033, and 6.170 (and, by implication, 6.004)
G (H)
3-6-3
6 EDP

6.828 studies fundamental design and implementation issues in the engineering of operating systems. Lectures are based on a study of UNIX® and research papers. Topics in virtual memory; threads; context switches; kernels; interrupts; system calls; interprocess communication; coordination, and the interaction between software and hardware. Individual laboratory assignments teach students the development of a minimal operating system written in C, with minimal amount of x86 assembly. Knowledge of C programming expected.

Students can use 6.828 to fulfill the engineering concentration requirements for Computer Systems.

Who should take 6.828?

6.828 is primarily intended for seniors and Meng students who want to learn about operating systems in detail. PhD students are also welcome, but note that 6.828 is not a "core" subject for the TQE.

Grading Policy

Grades in 6.828 will be based on the results of two quizzes (one during the term and one in final's week, 30% in total), lab exercises (50%), and home-work assignments and class participation (together 20%).

Turn-in Policy

To turn-in the labs, send email by noon on the Thursday that the lab is due.

You are required to turn in each lab. Labs that are not turned in will receive an F. Labs that are turned in but score 0 points will receive a D. You have a total of 3 late days to use throughout the semester. There are no partial late days: an assignment that is only six hours late uses an entire late day. After you have used up your late days, each additional day late will incur a full letter grade penalty. Saturday and Sunday both count as days.

Collaboration

Our policy is simple, based on professional standards: On quizzes you should not collaborate. On all other assignments you are welcome to work with anyone else on ideas and understanding, but you should complete all assignments on your own, and you should carefully acknowledge all contributions of ideas by others, whether from classmates or from sources you have read.


Class Meetings

Lectures will be held on Monday and Wednesday for 1.5 hours.

Instructor

Frans Kaashoek

Acknowledgements from Instructor

6.828 would not exist today had it not been for a wonderful set of TAs: Josh Cates, Russ Cox, Bryan Ford, and Emil Sit. They made this class a reality. Collectively we dedicate 6.828 to the memory of Josh Cates; We hope that many students will be inspired by Josh's enthusiasm for operating systems.


 
MIT Home
Massachusetts Institute of Technology Terms of Use Privacy