课程内容

advertisement
操作系统课程设计
汪芸
2012年8月
课程设计内容
• WRK平台的安装和调试
• 基于WRK平台的同步/互斥实验
• 基于WRK平台的进程工作集实验
实验时间
• 共三周
• 第2周:周一、周三、周五晚6:30—9:30
• 第3周:周一、周三晚6:30—9:30,
周五上午1-4节
• 第4周:周一、周三、周五下午6-9节
助教信息
• 袁飞飞
WRK平台的安装和调试
• 安装配置WRK平台
• 实现WRK平台的联机调试
WRK(1)
• Windows Research Kernel (WRK)
– The WRK packages core Windows XP x64
and Windows Server 2003 SP1 kernel source
code with an environment for building and
testing experimental versions of the Windows
kernel for use in teaching and research.
-6-
WRK(2)
 We can use it to:
--- Explore operating system (OS) principles
--- Modify, build, run and test the Windows kernel
--- Better understand the Windows architecture and
implementation.
 Including:
--- Windows XP x64/Server 2003 SP1 kernel sources
--- An environment for building and testing
-7-
WRK(3)
• Windows XP x64/Server 2003 SP1 kernel sources
– Contains the sources for the core Windows (NTOS) kernel:
•
•
•
•
•
•
•
•
•
•
Processes
Threads
Virtual memory and cache managers
I/O management
The registry
Executive functions, such as the kernel heap and synchronization
Object manager
Local procedure call mechanism
Security reference monitor
Low-level CPU management (thread scheduling, Asynchronous and
Deferred Procedure calls, interrupt/trap handling, exceptions)
-8-
WRK(4)
– Not include (loaded into kernel mode as dynamic
libraries):
• The NT Hardware Abstraction Layer
• File systems
• Network stacks
• Device drivers
-9-
WRK(5)
• Use and Restrictions
– The WRK, and all the components of the
Windows Academic Program, are for
academic, non-commercial use only.
– Users must accept the terms and conditions
of the “Microsoft Windows Research Kernel
Source Code License”
(http://www.microsoft.com/resources/shareds
ource/licensing/basics/wrklicense.mspx)
-10-
实验一:基于WRK平台的
进程同步/互斥实验
• 第一部分
-- 阅读WRK代码,理解WRK中同步/互斥的
对象管理
-- 分析同步对象的释放和WRK的调度机制
WRK中的同步对象
• Dispatcher Object
• Signaled state and non-signaled state
同步数据之间的关系
基于WRK平台的同步/互斥实验
• 第二部分
-- 了解WinDbg的一些常用命令
-- 联机查看一个线程等待的所有同步对象
-- 联机查看等待一个同步对象的所有线程
基于WRK平台的同步/互斥实验
• 第三部分
-- 编写“生产者-消费者”程序
-- 该程序在WRK平台下的调试
-- 修改WRK代码,增加同步/互斥数据结构的
输出
实验二:基于WRK的
进程工作集实验
• 阅读Windows源码中工作集管理相关部分
• 深入理解工作集和页面置换算法
• 修改Windows内核中页面置换算法
Windows系统中的工作集
• 工作集:一个进程当前正在使用的页面的
集合
• 进程工作集和系统工作集
• Windows内核对工作集页面的操作
-- 工作集管理器的页面修剪算法
-- 进程的页面置换算法
修改页面置换算法
• 采用碰到有效页面即替换的策略
实验内容
• 搭建实验环境
• 源码阅读及算法验证
-- 编写测试程序
-- 查看工作集
-- 验证页面置换算法
评分标准
• 基本要求(占70%)
-- 完成WRK系统的安装
-- 完成实验一,即进程同步/互斥实验
• 提高要求(占22%)
-- 完成实验二,即进程工作集实验
• 卓越要求(占8%)
-- 完成通过添加系统调用来执行页面置换算
法
操作系统实验报告规范
•
•
•
•
•
•
•
基本信息:完成人姓名、学号、报告日期
实验内容
实验目的
设计思路和流程图
主要数据结构及其说明
源程序并附上注释
程序运行时的初值和运行结果
操作系统实验报告规范
• 实验体会:实验中遇到的问题及解决过程、
实验中产生的错误及原因分析、实验的体
会及收获、对做好今后实验提出建设性建
议等。
• 实验报告应以书面方式提交,要求做到内
容翔实、清晰,层次分明,标题突出。
Download