Experiences Teaching Operating Systems Using Virtual Platforms and Linux
Total Page:16
File Type:pdf, Size:1020Kb
Experiences Teaching Operating Systems Using Virtual Platforms and Linux Jason Nieh Chris Vaill Department of Computer Science Department of Computer Science Columbia University Columbia University New York, NY 10027 New York, NY 10027 [email protected] [email protected] ABSTRACT crucial for helping students to understand how the text- Operating system courses teach students much more when book concepts can be applied in practice. However, devel- they provide hands-on kernel-level project experience with oping and administering programming projects that teach a real operating system. However, enabling a large class of students about real-world operating system design and im- students to do kernel development can be difficult. To ad- plementation is difficult for two important reasons. dress this problem, we created a virtual kernel development First, unlike other application software which runs at user- environment in which operating systems can be developed, level, operating system code runs in supervisor mode. To debugged, and rebooted in a shared computer facility with- write or modify operating system code that runs in super- out affecting other users. Using virtual machines and remote visor mode, students must be given root privileges to do display technology, our virtual kernel development labora- many of the things required for kernel development such as tory enables even distance learning students at remote loca- installing a new kernel, rebooting, kernel testing and de- tions to participate in kernel development projects with on- bugging, etc. In addition, the kernel development cycle of campus students. We have successfully deployed and used plan-implement-reboot-test-debug results in system down- our virtual kernel development environment together with time that necessitates exclusive access to a computer to the open-source Linux kernel to provide kernel-level project avoid inconveniencing others. For a large introductory oper- experiences for over nine hundred students in the introduc- ating systems class, providing each student with a computer tory operating system course at Columbia University. on which to run as root to do kernel development would be difficult to administer and prohibitively expensive. Second, real production operating systems are large, com- Categories and Subject Descriptors plex pieces of software. The sheer size of these systems D.4.0 [Operating Systems]: General; K.3.1 [Computers makes them difficult to understand and learn about. These and Education]: Computer Uses in Education—distance operating systems are also not primarily designed as teach- learning; K.3.2 [Computers and Education]: Computer ing tools, but instead to be used in commercial deployment. and Information Science Education—computer science edu- For example, such operating systems are already fully func- cation tional and do not have major missing subsystems that stu- dents can design and implement. These factors make it dif- ficult to design projects for students that enable them to General Terms learn about interesting and important aspects of real-world Design, Experimentation, Human Factors operating system design. To address these issues, we created a virtual kernel de- velopment environment in which operating systems can be Keywords developed, debugged, and rebooted in a shared computing Operating systems, computer science education, virtualiza- lab environment without affecting other application users. tion, virtual machines, open-source software Using virtual machines and remote display technology, our virtual kernel development laboratory enables even distance learning students at remote locations to participate in kernel 1. INTRODUCTION development projects with local on-campus students. We Programming projects are an important aspect of learn- have combined our virtual kernel development laboratory ing about operating systems. The hands-on experience is with a set of novel programming projects using the Linux kernel to provide real-world project experiences for students. These projects enable students to modify and replace sub- stantial subsystems of Linux in a manner that provides many Reprinted from Proceedings of the 36th SIGCSE Technical Symposium on of the benefits of building new operating system subsystems Computer Science Education, February 2005. Permission to make digital from scratch. We leverage the benefits of the Linux open- or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for source software base and widely available development tools profit or commercial advantage and that copies bear this notice and the full to enable students to effectively manage the software com- citation on the first page. To copy otherwise, to republish, to post on servers plexity associated with a production operating system. or to redistribute to lists, requires prior specific permission and/or a fee. Both our virtual kernel development environment and pro- http://doi.acm.org/10.1145/1047124.1047508 100 gramming projects build on production technologies that are erating systems, such projects are typically based on a small widely used. Our virtual kernel development environments pedagogical operating system like MINIX [8]. While MINIX builds on virtual machines provided by VMware [9] and re- can be setup and run on modest PC hardware, this would mote display mechanisms such as VNC [7]. Our program- require providing every student with their own machine on ming projects are based on Linux. Building on production which to do kernel development, which is impractical in most technologies enables us to leverage other large development university settings and does not scale to large class sizes or efforts to support operating system education without the supporting distance learning students effectively. Since ped- need to to maintain substantial pedagogical infrastructure agogical operating systems are small though, they can often on our own. We do not need to maintain our own simula- be used with a machine simulator instead, such as Bochs [5]. tors or pedagogical operating systems, which is difficult to One may even design a pedagogical operating system to be do given the rapid pace of industry practice and the limited used only in a simulated environment [4]. At the same time, teaching resources available at most universities. Instead, because pedagogical operating systems are smaller than pro- our approach inherently keeps up and evolves as technology duction operating systems, developing code in one does not changes without requiring an in-house development effort. expose students to many of the real-world issues that arise in We have deployed, refined, and used our virtual kernel practice. Furthermore, because pedagogical operating sys- development environment together with Linux kernel pro- tems are not used in practice, keeping them from becoming gramming projects in teaching an introductory operating dated can require substantial effort and they may have more systems course at Columbia University. We were the first limited lifetimes due to changes in technology and operating to use this approach for teaching operating systems [6], and system practice [4]. Examples of pedagogical operating sys- have used it successfully over the last five years to teach over tems that have become obsolete include Xinu [2] and TOY, nine hundred students. These students range from sopho- which was originally developed by Brian Kernighan in 1973. more undergraduates to doctoral students and include even In contrast, a production operating system such as UNIX distance learning students located halfway around the world. predates both TOY and Xinu yet continues to be widely Our experiences using our virtual kernel development lab to- used today. gether with Linux demonstrate the utility of this approach for enhancing operating systems education by providing ef- fective kernel-level project experiences for students. 3. A VIRTUAL KERNEL DEVELOPMENT This paper describes how we developed our approach to LABORATORY operating systems education and our experiences with it in To support kernel-level programming projects for students the classroom. Section 2 discusses related work. Section to learn about operating systems, what we would like to do 3 describes the development of our virtual kernel develop- is provide each student with effectively root access on a dedi- ment environment. Section 4 describes the design of our cated machine which the student can use to test kernel code Linux kernel programming projects. Section 5 discusses ex- and crash and reboot at will. However, we would like to periences using the virtual kernel development laboratory do this without the expense and administrative difficulties and the Linux kernel projects. Finally, we present some of providing a dedicated physical machine for each student. concluding remarks. Note that the key issue is testing and debugging kernel code, not writing kernel code. Many users can share the same 2. RELATED WORK machine to write and compile kernel code since that activ- The two main approaches to providing programming ex- ity does not result in frequently crashing and rebooting a perience in operating system courses can be loosely cat- machine due to student programming errors. egorized as user-level or kernel-level. User-level projects Our solution was to use VMware [6, 9] virtual machine require only developing code designed to run in unprivi- technology to create a virtual development platform that leged