At universities in China, operating systems courses are usually taught in two terms: an introductory course of operating systems and a course in experiment and project design. The universities typically use Windows®, UNIX, or Linux as examples to present operating system concepts.
Until the Windows operating system source code and some kernel technologies were made available with the Windows Research Kernel (WRK)i, the schools were unable to fully introduce the Windows kernel technology and its implementation to students. With the introduction of the WRK, however, universities are now able to involve more Windows examples in their operating systems courses.
WRK packages most of the Windows kernel source code and is useful in design projects that allow students to explore operating system principles. It enables advanced teaching by facilitating experiments and projects based on modifying the Windows kernel, as well as by promoting better understanding of the Windows architecture and implementation.
With the support of Microsoft Research Asia (MSRA), Chinese universities have been able to analyze the WRK; design new experiments and projects based on the WRK; update existing courseware, exercise, exams, and experiments; and share the results of their efforts with each other to facilitate the instruction of core Windows kernel technologies in universities.
The MSRA University Relations group initiated a program to support pioneering professors who are developing experimental courses for a WRK Teaching Resource Kit. Six well-known professors teaching operating systems in top universities in China joined the program. They are:
||Beijing University of Posts and Telecommunications
These professors cooperated with MSRA to write an operating system textbook and develop experimental courseware to help students better understand the principles and implementation of the Windows operating system. As of now, the professors have finished two key milestones of the program: analysis of WRK source code and development of sample experimental cases. The MSRA University Relations group is coordinating the final packaging of a Teaching Resource Kit to share with other universities and faculty worldwide. Following is the update of the process of experimental course development.
Course Development Process
The professors, who worked as a team coordinated by the University Relations team at MSRA, met together quarterly to design the structure of the experimental course, update the progress of content development, and share their experiments. This process has facilitated content design and case development.
The faculties analyzed the source code in the WRK, completed a source code analysis report, and designed a course structure based on their teaching experience. Then, the professors tested the course in their own universities. The experimental course teaches students to analyze source code in the WRK and to design new experiments and projects based on it. For instance, several cases demonstrate the implementation of the Windows kernel. Students can experience how to change the configuration parameters of these cases to influence system behavior and performance; they can also replace some algorithms of Windows components with their own code to change functionality and performance. In addition, the team designed some topics for students to develop new cases based on the course platform.
About the Courseware
The courseware contains exercises, experiments, and exams. Based on the WRK source code analysis report, the team put together Microsoft® Office PowerPoint® slides and Office Word documents to be used as teaching materials by operating system professors.
To facilitate use of the courseware at more universities, the team packaged the materials into a Teaching Resource Kit. Many topics of operating system implementation are covered in the Teaching Resource Kit, such as kernel synchronization, process and thread management, processor scheduling, pre-fetching of the file system cache, page replacement, physical memory management, working set policy, multiple page size support for virtual memory, device management, object management, and so on. Each case includes a task description, reference, experiment guide, test example, and sample source code.
Experiment 1: Analysis on Process and Thread Structures
By Professor MENG Xiangwu - Beijing University of Posts and Telecommunications
Professor Meng began this experiment with a review of the executive process (EPROCESS) and executive thread (ETHREAD) blocks. The purpose of the experiment was to help students more clearly understand the relationship of the NTOS kernel with process management. Specifically, the experiment consisted of the analysis of thread and process data structures per these instructions:
- Analyze the EPROCESS structure, which is in folder ...inc\ps.h. Give each field function of the structure. Every process is defined with the executive process (EPROCESS). The EPROCESS structure is a process structure, which describes basic information related to processes and points to structures related to processes controls.
- Analyze the KPROCESS structure, which is also in folder ...inc\ps.h. Give each field`s function in the structure.
Experiment 2: Process Management
By Professor MENG Xiangwu - Beijing University of Posts and Telecommunications
In this experiment, Professor Meng changed the kernel code to achieve the desired result. Making changes to the kernel and observing the results teaches students about the management of processes and threads.
Experiment 3: Hands-On Computer Practice of Interprocess Communication (IPC) Problems in the WRK Environment
By Associate Professor SHI Guangshun - Nankai University
Professor Shi examined interprocess communication. Interprocess communication plays an important role in the process management of time-sharing operating systems.
Experiment 4: WRK Processor-Scheduling Experiment
By Associate Professor XIANG Yong and Associate Professor CHEN Yu - Tsinghua University
In this experiment, Associate Professor Xiang and Associate Professor Chen used the compilation environment included with the WRK package to generate a kernel image named "wrkx86.exe." This kernel image can be substituted for the Windows Server® 2003 kernel to form a WRK-based Windows Server 2003 operating system that allows actual operations.
Because the source code in the WRK is actual Windows source code and is visible, the professors were able to dynamically trace the running state of the Windows operating system kernel by adding their own code, and they used the debugging tool WinDBG to analyze the working mechanism of the kernel in depth. The purpose of this experiment was to understand the process and thread control data structure and the processor-scheduling mechanism in the WRK by analyzing and tracing the running state of the processor-scheduling code in the WRK and designing appropriate test cases.
Experiment 5: Working Set
By Associate Professor WANG Lei - Beihang University
Professor Wang analyzed the working set page replacement of Windows memory management by using Windows Server 2003 as the platform for the experiment, and by using the kernel source code and the debug tool WinDBG. The experiment involved analyzing the peak value of the process working set and the page replacement algorithm, writing an application that verifies its peak value and replacement algorithm, modifying the replacement algorithm appropriately, and looking for the effect of the new algorithm in the application.
The working set is a very important concept in memory management. The Windows operating system often divides the working sets into a process working set and a kernel working set, which are used, respectively, to trace the physical memory usage of each process and kernel.
Operations on the working set page in the Windows kernel are divided into the page-trimming algorithm of the working set manager (system level) and the page-replacement algorithm of the process. The former mainly scans the memory usage of the system periodically and trims the pages of some processes; for example, it selects a process with a low priority and applies the Least Recently Unused (LRU) algorithm to select the page to delete. The latter is mainly used inside the process; if the process is requested after the process requisition page exceeds a certain peak value, the working set size no longer increases and the existing pages are replaced using a certain policy.
Conclusions and Further Work with the WRK
- In September 2007, the MRSA University Relations team shared its experiences at the Ninth National Operating System Teaching Workshop of China, at Yantai University, in which more than 120 Chinese teachers involved in operating system instruction participated. The team’s plan of developing an experimental course based on the WRK was welcomed by the audience. The Teaching Resource Kit was launched that same autumn.
- In the spring of 2008, MSRA University Relations held a regional Windows teaching workshop in Beijing for universities in the Asia Pacific region. At this workshop, more professors were taught to use the Teaching Resource Kit and to design their own Windows experimental courses. MSRA also launched a Windows Core Curriculum Invitation for Proposal (IFP). As a result, 19 projects from the Asia Pacific region won IFP awards. In future years, projects owners will deliver WRK-based courseware, hands-on labs, and other teaching materials at the workshop. To see the current project list submitted by university faculty, go to: http://research.microsoft.com/en-us/collaboration/global/asia-pacific/faculty-projects_list.aspx
- MRSA University Relations packaged the "Windows Academic Resources Kit II" with updated WAP materials from the worldwide program and hands-on labs developed by faculty members. This kit was shared with more than 200 attendees of a MSRA faculty summit in November 2008, which included deans and professors from more than 100 universities in the Asia Pacific region.
- MSRA University Relations will upload sample courses to its Web site and continually update its Teaching Resource Kit for universities to use. MSRA also is designing a "Best Case Award" to encourage faculties and students to develop more cases based on the experimental platform.
Windows Research Kernel (WRK)
The WRK contains the bulk of the source code for the core Windows (NTOS) kernel (compatible with Windows Server 2003 Service Pack 1 [SP1] and Windows XP for x86-based and x64-based computers). It includes the core sources for object management, processes, threads, virtual memory, and more. Other modules are provided as binary objects that can be linked to produce a fully functional NTOS executable file and booted using Windows Server 2003 SP1 or Windows XP Professional x64 Edition. The current WRK release (version 1.2) is a kit with a build environment, Microsoft Virtual PC 2007, and documentation.
This case study is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.
Document published June 2009.