研究生操作系统大纲

College of Software Engineering
Undergraduate Course Syllabus
Course ID 311006040 Course Name Operating System
Course
Attribute
■Compulsory □Selective Course Language ■English ■Chinese
Credit Hour 4 Period 64
Semester □First Fall □First Spring □Second Fall ■Second Spring
□Third Fall □Third Spring □Fourth Fall □Fourth Spring
Instructors Zhao Kui, Liang Gang, Hu Xiao-qin
Description
This course covers the fundamentals of Operating Systems and Systems
Programming, revealing the mysteries of the software layer between application
programs and hardware, and covering techniques and algorithms for dealing with
thorny problems of resource management, sharing, and protection, as well as
concurrency and complex systems. Perhaps best of all, four programming projects
give students the chance to implement important and realistic subsystems of a small
operating system kernel.
Between the lectures, reading, and programming assignments, we hope that the course
will help students become not only an OS expert and/or kernel hacker, but also a
better programmer and user of computer systems, and a better computer scientist who
has insight into managing complex and concurrent interactions within and between
hardware and software systems!
Prerequisites
C Language Programming
Computer Architecture
Data Structures and Algorithms

Textbook William Stallings, Operating Systems Internals and Design Principles (Fifth Edition),Publish
House of Electronics Industry,2007
2
Resource
• Course Webpage: cs.scu.edu.cn/~zhaokui
All vital information will appear on the course webpage, including lecture
notes and programming assignments.
• Mailing list: zhaokui@cs.scu.edu.cn
lianggang@cs.scu.edu.cn
huxiaoqin@cs.scu.edu.cn
The staff email is where you should send questions regarding course
administration and any questions which would be inappropriate if posted
publicly to the newsgroup (i.e. questions that contain your code or other
private information).
• Reference:

  1. Computing Operating System tangziyin, Xian University of Electronic Science and
    Technology Press 出版社, 2004,Edition 3.
  2. Operating System:Design and Implementation,Andrew S.Tanenbaum,Pulishing
    House of Electronics Industry,1998,Edition 2.
  3. Operating System,Harvey M.Deitel, Tsingha University Press,2007,Edition 3.
  4. Operating System Concepts , James L.Peterson , Addison-Wesley Publishing
    Company,2001,Edition 6.
  5. Operating Systems Concepts, Abraham Silberschatz, Peter Galvin, and Greg Gagne,
    John Wiley and Sons, Higher Education Press, 2002,Edition 6.
  6. Operationg System—Excise and Analyze ,ZengPing,Tsingha University Press,
    2001,Edition 1
  7. Williamstallings.com/os/os5e.html
  8. Comp.os.research
  9. comp.os.misc
  10. comp.unix.internals
  11. comp.os.linux.development.system
  12. http://ocw.zju.edu.cn/OcwWeb/index.jsp
    Grading

Class participation and homework (30%), final exam (50%), course practice(20)

3
Topics
(48 credit
hours)
The lecture of this course will cover the following topics:

  1. Computer System Overview (1 credit hours)
    º .Overview of computer architecture and organization;
    º Computer-System Operation;
    º Interrupts;
    º The memory of hierarchy;
    º I/O communication techniques
  2. Operating System Overview (3 credit hours)
    º History of operating system;
    º Operating system concepts, objective and function;
    º Introduction of the type of Operating system including multiprogramming system,
    Real-Time System, Batch system, Time-sharing system, Distributed operating system,
    Network operating system
    º Overview of the modern operating system structure;
  3. Process Description and Control (5 credit hours)
    º The concepts of process including states and its transitions, PCB;
    º The operations on processes and process states;
    º Introduction of process control;
  4. Threads, SM and Microkernels ( 5 credit hours )
    º Thread definition, creation, manipulation, User and Kernel Thread.;
    º The concept of SMP and the management of SMP;
    º Microlekernels definition, objective;
  5. Concurrency ( 9 credit hours )
    º The conceptions of concurrency and the implication of execution of multiple
    concurrent process;
    º The hardware mechanisms that support mutual exclusion;
    º Three operating system and programming language mechanisms used to provide
    concurrency;
    º Introduction two problems of concurrency: deadlock and starvation and solutions of
    these two problems.
  6. Memory ( 9 credit hours )
    º Memory organization and management;
    4
    º Paging and segmentation, address mapping;
    º Virtual memory concepts;
    º Virtual memory management, page replacement algorithms.
  7. Scheduling (9 credit hours )
    º Basic Concepts (including Long-term scheduling, Medium-term scheduling,
    Short-term scheduling.);
    º Scheduling algorithms(including First-Come-First-Served (FCFS), Priority,
    Round-Robin );
    º Multiprocessor scheduling;
    º Real-Time Scheduling;
  8. Input/Output Device ( 4 credit hours )
    º The concepts relation to I/O devices and the classification of the I/O devices;
    º The task and function of the I/O device management;
    º The data structure and algorithms relation to I/O device management;
    º The virtual device techniques;
  9. File Management ( 3 credit hours )
    º File Concept, Access Methods, Directory Structure, File Sharing and Protection
    º File-System Structure, File-System Implementation, Directory Implementation,
    Allocation Methods, Free-Space Management.
    Tools &
    Environment
    Windows XP, Redhat linux 9.0, Vmware virtual machine, gcc, g++
    Projects
    ( 16 credit
    hours )
    Lab 1: Develop a shell in Nachos
    Requirement:
    º Design a simples command line shell that has following properties:
  10. The shell must support the following internal commands: cd , dir, clr,environ,
    echo ,help ,pause and quit;
  11. All other command line input is interpreted as program invocation which should
    be done by the shell forking and executing the programs as its own child
    processes;
  12. The shell must be able to take its command line input from a file;
    5
  13. The shell must support i/o redirection on either or both stdin and/or stdout;
  14. The shell must support background execution of programs.
  15. The command line prompt must contain the pathname of the current directory.
    º Write a simple manual describing how to use the shell. The manual should contain
    enough detail for a beginner to linux to use it;
    º The source code must be extensively commented and appropriately structured to
    allow your peers to understand and easily maintain the code;
    º Details of submission procedures will be supplied well before the deadlines;
    º The submission should contain only source code files, include files, a makefile and
    the readme file.
    Lab 2: Upgrade the Nachos thread management model
    Requirement:
    Modify the source code of the Nachos to achieve the following objectives:
    º Expand thread data structure and add the “user ID, thread ID” two members of the
    data structure of Nachos. Meanwhile, add the safeguard mechanism of these two data
    members in the Nachos existing thread management model;
    º Expand the existing state of threads. There are only “new”, “ready”, “block” and
    “running” four states in Nachos. Please add “suspending” state in Nachos. The
    so-called “hang up” refers to the current thread disk image stored in documents rather
    than memory. “Suspend” state is the important foundation of the future realization of
    virtual memory management.
    º Modify thread scheduling algorithm. Change the thread management mechanism to
    the “preemptive.” You can add “timing” and “priority scheduling,” “Multi-Queue”
    different algorithm into Nachos thread management model.
    º Add the global thread management mechanism and expand the existing operations
    command in Nachos. For example, you can add a command called “ThreadView” in
    order to show the current existence of all the threads of information, including the
    “user ID”, “Thread ID”, “Current status” on the screen.
    º Design a mutual exclusion and synchronization example. After the above
    modifications, you can design a program to implement one mutual exclusion and
    synchronization classic solution. For example, you can choose “philosopher dining”
    problem and create five philosopher threads which have same user ID and follow the
    “signal of” mechanisms to correct the operation in your program. You can also choose
    “producers - consumers”, “Sleep Barber of Seville” and other classic IPC problems to
    6
    finish this task.
    Lab 3: Upgrade the Nachos File management model
    Requirement:
    Modify the source code of the Nachos to achieve the following objectives:
    º Add longer document name support and the following described information in
    Nachos kernel.
    File Types
    Create time
    Document the last visit time
    File trails
    º Achieve dynamic content distribution according to the file size. Now,Nachos allocate
    the space according to the designated size of when creating a file and if we want to
    amend file, we are limited to allocated space. So, modify the kernel to satisfy the
    dynamic distribution.
    º Modify the file index means in Nachos to achieve unlimited length of documents. You
    can refer to the file index mechanism of Unix to achieve this requirement.
    º Modify the directory structure to implement multi-level directory which there is no
    restriction on the number of the files.
    º Achieve synchronous operation of the file system. Directory files, bitmap files are all
    critical resources and they do not allow multiple processes at the same time visit. The
    current system did not impose synchronous control, so, modify this defect.
    Lab 4: Upgrade the Nachos Memory management model
    Requirement:
    Modify the source code of the Nachos to achieve the following objectives:
    º Add the data structure to describe the process of memory and the corresponding
    relations. That is, add the “process ID” member in memory describing structure and it
    can make understand the distribution of memory easily and facilitate to measure the
    performance of memory management.
    º Achieve the multi-programming, which there are multiple programs co-exist in
    memory.
    º Modify the Nachos to support virtual memory. Nachos only support the process
    which it’s size is not more than the size of the memory. If the size of process is more
    7
    than the size of the memory, it will not be execute. So, amend this defect to support
    big size process.
    º Implementation monitoring thread and it can real-time reflect the use of memory.

Version No: 1.0
Author: Kui Zhao Date: 2008-7 -15
Auditor: Mei Hong Date: 2008-7-25
Signature of leader:
Date: 2008-7-30

中文翻译:

软件工程学院
本科课程大纲
课程ID 311006040课程名称操作系统
课程
属性
■强制□选修课程语言■英文■中文
信用小时4期64
学期□第一次秋季□初春□二秋■二春
□三秋□第三泉□第四秋□第四春
导师赵奎梁良胡晓琴
描述
本课程涵盖了操作系统和系统的基础知识
编程,揭示应用程序之间软件层的奥秘
程序和硬件,并涵盖处理的技术和算法
资源管理,共享和保护的棘手问题,以及
并发和复杂系统。也许最重要的是四个编程项目
让学生有机会实现一个小型的重要和现实的子系统
操作系统内核。
在讲座,阅读和编​​程任务之间,我们希望这个课程
将帮助学生成为不仅仅是操作系统专家和/或内核黑客,而且也是一个
更好的程序员和计算机系统用户,以及更好的计算机科学家
有洞察力来管理内部和内部的复杂和并发交互
硬件和软件系统!
先决条件
C语言编程
计算机体系结构
数据结构和算法

教材William Stallings,操作系统内部和设计原则(第五版),发布
电子工业之家,2007年
2
资源
•课程网页:cs.scu.edu.cn/~zhaokui
所有重要信息将显示在课程网页上,包括讲座
笔记和编程作业。
•邮寄名单:zhaokui@cs.scu.edu.cn
lianggang@cs.scu.edu.cn
huxiaoqin@cs.scu.edu.cn
工作人员电子邮件是您应该在哪里发送有关课程的问题
管理和任何不适当的问题,如果发布
公开给新闻组(即包含你的代码或其他的问题)
私人信息)。
•参考:

西安电子科技大学计算机操作系统tangziyin
技术出版社出版社,2004,第3版。
操作系统:设计和实现,Andrew S.Tanenbaum,Pulishing
电子工业之家,1998年版,第2版。
操作系统,Harvey M.Deitel,青海大学出版社,2007年3版。
操作系统概念,James L.Peterson,Addison-Wesley Publishing
公司,2001年,第6版。
操作系统概念,Abraham Silberschatz,Peter Galvin和Greg Gagne,
John Wiley and Sons,Higher Education Press,2002,Edition 6。
清华大学出版社,曾平,
2001,第1版

教材William Stallings,操作系统内部和设计原理(第五版),
2007年电子工业出版社
2
资源
•课程网页:cs.scu.edu.cn/~zhaokui
所有重要信息将显示在课程网页上,包括讲座
笔记和编程作业。
•邮寄名单:zhaokui@cs.scu.edu.cn
lianggang@cs.scu.edu.cn
huxiaoqin@cs.scu.edu.cn
工作人员电子邮件是您应该在哪里发送有关课程
管理的问题和任何不恰当的问题如果
公开发布到新闻组(即包含您的代码或其他
私人信息的问题)。
•参考:

  1. 西安电子科技大学计算机
    操作系统tangziyin出版社,2004,第3版。
  2. 操作系统:设计与实现,Andrew S.Tanenbaum,
    电子工业制造所,1998年版,第2版。
  3. 操作系统,Harvey M.Deitel,青海大学出版社,2007年3版。
  4. 操作系统概念,James L.Peterson,Addison-Wesley Publishing
    Company,2001,第6版。
  5. 操作系统概念,Abraham Silberschatz,Peter Galvin和Greg Gagne,
    John Wiley and Sons,Higher Education Press,2002,Edition 6。
  6. 青岛大学出版社,
    2001版,第1版
  7. Williamstallings.com/os/os5e.html
  8. Comp.os.research
  9. comp.os.misc
  10. comp.unix.internals
  11. comp.os.linux.development.system
  12. http://ocw.zju.edu.cn/OcwWeb/index.jsp
    评分

班级参与和作业(30%),期末考试(50%),课程实践(20)

3
课程
(48学分

本课程的讲座将涵盖以下主题:

  1. 计算机系统概述(1学时)
    º。计算机体系结构和组织概况;
    º计算机系统操作;
    º中断;
    º层次记忆;
    ºI / O通信技术
  2. 操作系统概述(3学分)
    º操作系统历史;
    º操作系统概念,目标和功能;
    º介绍操作系统类型,包括多编程系统,
    实时系统,批处理系统,分时系统,分布式操作系统,
    网络操作系统
    º现代操作系统结构概述;
  3. 过程描述和控制(5学分)
    º过程概念包括状态及其过渡,PCB;
    º对过程和过程状态的操作;
    º过程控制介绍;
  4. 线程,SM和微内核(5学分)
    º线程定义,创建,操作,用户和内核线程;
    ºSMP的概念和SMP的管理;
    ºMicrolekernels定义,客观;
  5. 并发(9个小时)
    º并发的概念和多个
    并发进程的执行的含义;
    º支持互斥的硬件机制;
    º用于提供
    并发的三种操作系统和编程语言机制;
    º引入并发的两个问题:死锁和饥饿以及
    这两个问题的解决方案。
  6. 记忆(9个小时)
    º记忆组织与管理;
    4
    º寻呼和分割,地址映射;
    º虚拟内存概念;
    º虚拟内存管理,页面替换算法。
  7. 计划(9个小时)
    º基本概念(包括长期调度,中期调度,
    短期调度)。
    º调度算法(包括先到先得(FCFS),优先级,
    循环);
    º多处理器调度;
    º实时调度;
  8. 输入/输出设备(4个小时)
    º与I / O设备的概念关系和I / O设备的分类;
    ºI / O设备管理的任务和功能;
    º数据结构和算法与I / O设备管理的关系;
    º虚拟设备技术;
  9. 文件管理(3个小时)
    º文件概念,访问方法,目录结构,文件共享和保护
    º文件系统结构,文件系统实现,目录实现,
    分配方法,自由空间管理。
    工具和
    环境
    Windows XP,Redhat linux 9.0,Vmware虚拟机,gcc,g ++
    项目
    (16学分

    实验1:在
    玉米片中开发shell 要求:
    º设计具有以下属性的simples命令行shell:
  10. shell必须支持以下内部命令:cd,dir,clr,environ,
    echo,help,pause and quit;
  11. 所有其他命令行输入被解释为程序调用,应该
    由shell执行程序调用并执行程序作为其自己的子
    进程;
  12. shell必须能够从文件中获取其命令行输入;
  13. shell必须在stdin和/或stdout两者之一上支持i / o重定向;
  14. shell必须支持程序的后台执行。
  15. 命令行提示必须包含当前目录的路径名。
    º写一个简单的手册来描述如何使用shell。手册应该包含
    足够的细节,让初学者使用linux来使用它;
    º源代码必须进行广泛的评论和适当的结构,以
    允许对等体了解并轻松维护代码;
    º提交程序详情将在截止日期前提供;
    º提交内容只能包含源代码文件,包含文件,makefile和
    自述文件。
    实验2:升级Nachos线程管理模型
    要求:
    修改Nachos的源代码,实现以下目标:
    º扩展线程数据结构,并添加“用户ID”
    线程ID“两个成员的数据结构的玉米片。同时,将这两个数据
    成员的保护机制加入到现有的线程管理模型中;
    º展开线程的现有状态。
    玉米片中只有“新”,“准备好”,“封锁”和“跑”了四个州。请在玉米片中添加“暂停”状态。在
    所谓的“挂机”是指存储在文档中,而当前线程的磁盘映像
    比内存。“暂停”状态是未来
    虚拟内存管理实现的重要基础。
    º修改线程调度算法。将线程管理机制更改为
    “抢先”。您可以
    在Nachos线程管理模型中添加“定时”和“优先级调度”,“多队列” 等不同算法。
    º添加全局线程管理机制,并
    在Nachos中展开现有操作命令。例如,您可以添加一个名为“ThreadView”的
    命令,以显示当前存在的所有线程的信息,包括屏幕上的
    “用户ID”,“线程ID”,“当前状态”。
    º设计互斥和同步示例。经过上述
    修改,您可以设计一个程序来实现一个互斥和
    同步的经典解决方案。例如,您可以选择“哲学家餐饮”
    问题,并创建具有相同用户ID的五位哲学家线索,并遵循
    “机制信号”来纠正程序中的操作。您也可以选择
    “生产者 - 消费者”,
    “塞维利亚睡眠理发师”等经典IPC问题6
    完成此任务。
    实验3:升级Nachos文件管理模型
    要求:
    修改Nachos的源代码以实现以下目标:
    º在
    Nachos内核中添加更多文档名称支持和以下描述的信息。
    文件类型
    创建时间
    记录上次访问时间
    文件路径
    º根据文件大小实现动态内容分发。现在,Nachos根据
    创建文件的指定大小分配空间,如果我们要
    修改文件,我们仅限于分配的空间。所以,修改内核以满足
    动态分布。
    º修改Nachos中的文件索引,以实现无限长的文档。您
    可以参考Unix的文件索引机制来实现这一要求。
    º修改目录结构以实现多级目录,
    对文件数量没有限制。
    º实现文件系统的同步操作。目录文件,位图文件都是
    关键资源,它们不允许多个进程同时访问。在
    现行制度没有实行同步控制,因此,修改此缺陷。
    实验4:升级Nachos内存管理模型
    要求:
    修改Nachos的源代码,实现以下目标:
    º添加数据结构来描述内存的过程和相应的
    关系。也就是说,将“进程ID”成员添加到内存描述结构中,
    可以轻松
    了解内存分配,便于测量内存管理的性能。
    º实现多编程,
    内存中共存有多个程序。
    º修改Nachos以支持虚拟内存。玉米片只支持其
    大小不超过内存大小的进程。如果进程的大小比内存的大小多
    7
    ,那么它将不会执行。所以,修改这个缺陷来支持
    大尺寸的过程。
    º执行监控线程,可以实时反映内存的使用情况。

版本号:1.0
作者:

钊日期:2008-7-15 审计人
:梅红日期:2008-7-25 领导签名:日期:2008-7-30

打赏鼓励一下。