Using Virtual Machines to Teach CS-502 Operating Systems

Slides:



Advertisements
Similar presentations
UNIX System Programming Installing OpenSolaris. 2/86 Contents How to setup a virtual machine guest How to install OpenSolaris as a guest How to update.
Advertisements

Memory Protection: Kernel and User Address Spaces  Background  Address binding  How memory protection is achieved.
PlanetLab Operating System support* *a work in progress.
Project 0, Linux Dabbling CS-3013 A-term Project 0: Linux & Virtual Machine Dabbling CS-3013, Operating Systems.
DiscussionCS-502 Fall Outline and Discussion CS-502 Operating Systems Week 4, Fall 2006.
Project 0: Linux & VM Dabbling CS-3013, C-term Project 0: Linux & Virtual Machine Dabbling CS-3013, Operating Systems.
Project #2, Linux Kernel Modifications CS-502 Fall Programming Project #2 Linux Kernel Hacking CS-502 Operating Systems Fall 2006.
Project 0: Linux & VM Dabbling CS-502, Fall Project 0: Linux & Virtual Machine Dabbling CS-502, Operating Systems.
Project 0 -- Linux Dabbling CS-502 (EMC) Fall Project 0 Linux & Virtual Machine Dabbling CS-502, Operating Systems Fall 2009 (EMC)
Offering your Windows Server Class Online. Tony Basilico Community College of Rhode Island
Project 4 -- DiscoveryCS-502 Fall Project 3 Discovering things about Linux Kernel CS-502, Operating Systems Fall 2007 Due, Monday, December 3, 2007.
DiscussionCS-502 Fall Class Discussion Peterson’s Solution for n > 2.
Overview Basic functions Features Installation: Windows host and Linux host.
Project #1, Linux Kernel Modifications CS-502 Fall Programming Project #1 Linux Kernel Hacking CS-502, Operating Systems Fall 2007.
Project 0 -- Linux Dabbling CS-3013 A-term Project 0 Linux & Virtual Machine Dabbling CS-3013, Operating Systems.
Cambodia-India Entrepreneurship Development Centre - : :.... :-:-
VMWare Workstation Installation. Starting Vmware Workstation Go to the start menu and start the VMware Workstation program. *Note: The following instructions.
Virtual Machine Management
Using Virtualization in the Classroom. Using Virtualization in the Classroom Session Objectives Define virtualization Compare major virtualization programs.
Tanenbaum 8.3 See references
Computer Concepts 2013 Chapter 4 Operating Systems and File Management.
Fundamentals of Networking Discovery 1, Chapter 2 Operating Systems.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Hands-On Virtual Computing
1 Guide to Novell NetWare 6.0 Network Administration Chapter 13.
Using Virtualization in the Classroom. Using Virtualization in the Classroom Session Objectives Define virtualization Compare major virtualization programs.
CMPF124:Basics Skills for Knowledge Workers Introduction to Windows OS.
VMWare Workstation Installation. Starting Vmware Workstation Go to the start menu and start the VMware Workstation program. *Note: The following instructions.
CSC190 Introduction to Computing Operating Systems and Utility Programs.
Hands-On Virtual Computing
Virtual Machines Module 2. Objectives Define virtual machine Define common terminology Identify advantages and disadvantages Determine what software is.
System Requirements  Supports 32 bit i586 and 64 bit x86-64 PC hardware.  PowerPC(PPC) processors.  RAM: 256 MB minimum, 512 MB recommended.  Hard.
 Prepared by: Eng. Maryam Adel Abdel-Hady
Linux and Coldfusion MX Mid-Michigan Coldfusion User’s Group, Nov
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Virtualisation Exercise Installing VirtualBox Installing FreeBSD in a virtual machine Chris Wilson Joel Jaeggli AfNOG 2012.
Rebuilding Linux Kernel Dedicated to penguin lovers everywhere 26 September 20161Rebuilding kernel by Visakh M R.
Virtualization With:. Virtualization With: What Kind of Virtualization? Full virtualization Platform Resource.
Chapter 2 Operating Systems
Using Virtualization in the Classroom
Operating System Kernel Compilation
bitcurator-access-webtools Quick Start Guide
Introduction to Operating Systems
UNDERSTANDING YOUR COMPUTER
Prepared by: Eng. Maryam Adel Abdel-Hady
CS 6560: Operating Systems Design
COMP 170 – Introduction to Object Oriented Programming
Course Information Mark Stanovich Principles of Operating Systems
Operating Systems Overview
Bomgar Remote support software
Operating Systems and Systems Programming
Project 0: Linux and Virtual Machine Dabbling
OS Virtualization.
Computer Science I CSC 135.
Introduction to Operating Systems
Andy Wang Operating Systems COP 4610 / CGS 5765
SAPC Hardware Pentium CPU (or 486) 4M usable memory
Project 0: Linux & Virtual Machine Dabbling
HC Hyper-V Module GUI Portal VPS Templates Web Console
Andy Wang Operating Systems COP 4610 / CGS 5765
Andy Wang Operating Systems COP 4610 / CGS 5765
OPS235: Week 1 Installing Linux ( Lab1: Investigations 1-4)
Programming Project #1 Command Shell
Multithreaded Programming
Andy Wang Operating Systems COP 4610 / CGS 5765
Linux Operations and Administration
bitcurator-access-webtools Quick Start Guide
Programming Project #2 Linux Kernel Hacking
Administrator’s Manual
Andy Wang Operating Systems COP 4610 / CGS 5765
Presentation transcript:

Using Virtual Machines to Teach CS-502 Operating Systems PEDS November 6, 2006 Assumptions: Graduate level Operating Systems Making Choices about operation systems Why a micro-century? …just about enough time for one concept PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Using Virtual Machines to Teach CS-502 Problem Project work in Operating Systems course has a “make believe” quality about it Fossil Lab not available to M. Sc. Students Part-time students not present on campus — so could not use Fossil Lab even if available User space projects do not demystify the system infrastructure Too much of what OS does is still hidden from students No practical experience about insides of OS PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Using Virtual Machines to Teach CS-502 Approach Create VMware virtual machine with Linux Assign programming projects inside kernel Expose Workings of an OS kernel Differences between working inside of OS and outside Practical experience with principles that we teach PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Using Virtual Machines to Teach CS-502 This Presentation An interim report on experiences in CS-502 during Fall 2006 Practical problems with using VMware Successes and missteps Pedagogical issues Problem assignments Grading PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Using Virtual Machines to Teach CS-502 Starting out Created VMware virtual machine on csopt4 SUSE Linux 9.3 same as CS Department 5 GByte hard drive, 256 MByte RAM, single processor NAT (Network Address Translation) networking VMware Tools installed Students copy virtual machine to own directories Minor adjustment to change Ethernet MAC address Students access remotely on or off campus via VMware Console (aka VMware client) PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Panic in system team! 20-21 registered students, implies 100+ gigabytes on /xtra_space Close to total available space; Pressure on disk drives; Pressure on processors PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Using Virtual Machines to Teach CS-502 Another Problem VMware console is awkward and jerky to use from off campus To the point of being impractical to use Affects about ½ to ¾ of students PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Solution (to both problems) Created a virtual machine using my own copy of VMware Workstation on my Pentium at home Includes VMware Tools (needed for display) Copied onto DVDs, distributed to class Also on CDs; also available for download from csopt4 Most students downloaded VMware Player Freeware player capable of running virtual machines created on other VMware products No snapshots, no reconfiguration of VM, etc. Three students chose to remain on csopt4 One elected to switch to VMware Player for next project Two students created own virtual machines on Macintosh Parallels (Intel platform) Instructions published on course web-site PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Using Virtual Machines to Teach CS-502 Recommended Resource Robert Love, Linux Kernel Development, 2nd edition, Novell Press, 2005 Other kernel development books are available PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Using Virtual Machines to Teach CS-502 Practical Issues Networking — bridged vs. NAT Wireless users on campus must use NAT Macintosh Parallels does not offer NAT Must use web-based turnin program CCC turnin too awkward from virtual machine Incompatible virtual machines Pentium and Opteron (csopt4) are different kinds of CPUs Virtual machines constructed on one do not run on other Kernel projects developed on one are incompatible at source code level with those of the other Network connections are fragile Seem to fail when new kernels are installed; no solution yet PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Using VMware Player on a Windows PC Full Linux with KDE desktop environment, Mozilla browser, etc. GUI based system administration (YaST) & other tools Uniform compiler, build environment, etc. VM runs either in window or full-screen Rapid switch between Windows and VM First class citizen on my home network Good, responsive performance even with other Windows applications active Missing: cut, copy, paste between Windows and Linux PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Using Virtual Machines to Teach CS-502 Building Linux Kernel Create copy-on-write tree cp –al /usr/src/linux-2.6.11.4-21.13 kernelSrc Edit kernel by replacing files within tree Automatic with EMACS, patch Needs extra step with vi, kwrite, Eclipse, etc. Build to separate build tree make O=~/kernelBuild xconfig (or oldconfig) make O=~/kernelBuild Install make O=~/kernelBuild modules_install install Automatically installs in grub PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Using Virtual Machines to Teach CS-502 Build performance Entire kernel from scratch Approx 1 hour on 3-GHz, 1-Gigabyte Pentium Approx 40 minutes on csopt4 Opteron Rebuild with new label ~ 30 minutes on 3-GHz, 1-Gigabyte Pentium < 20 minutes on csopt4 Opteron Rebuild with same label (make oldconfig) 5 minutes on 3-GHz, 1-Gigabyte Pentium < 2 minutes on csopt4 Opteron PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Submitting Kernel Project Create patch file diff -urN /usr/src/linux-2.6.11.4-21.13 kernelSrc Submit patch file test program(s) Makefile to build test programs Write-up, etc. Notes: Building to separate build-tree keeps junk out of patch file Symbolic link in original kernel source adds junk to patch PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Preparing to Grade a Kernel Project Build entire kernel (on each machine type) cp –al /usr/src/linux-2.6.11.4-21.13 kernelSrc cd kernelSrc make O=~/kernelBuild xconfig make O=~/kernelBuild Fetch students’ submissions from turnin Expand to separate directories for each student Take snapshot of virtual machine Allows restoring to same state for each student Keeping same label on kernel minimizes rebuild time PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Grading Kernel Project Restore virtual machine to snapshot for each student Patch and rebuild cd kernelSrc patch –p1 < {student’s patch file} make O=~/kernelBuild oldconfig make O=~/kernelBuild Install, reboot, and test make O=~/kernelBuild modules_install install reboot cd {student’s directory} make run tests About 10-15 minutes to actually build and test per student PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Using Virtual Machines to Teach CS-502 Problems and Issues Building and installing new kernel seems to make network fail May be due to VMware Tools vs. kernel modules Installation order is critical (modules must be 1st!) make O=~/kernelBuild modules_install install make install assumes new kernel is default Can be corrected by copying and modifying scripts /sbin/installkernel and /sbin/mkinitrd printk() output doesn’t appear on syslog Seems to be filtered; unable to find correct settings Use cat /proc/kmsg or /bin/dmesg instead PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Problems and Issues (continued) printf semantics don’t work in printk Ability to embed “%d” in strings, etc. Plenty of examples in kernel where it is supposed to work! make gconfig doesn’t work Superior interface for configuration Some Gnome libraries are missing from virtual machine; don’t know which Grader needs access to tools VMware Workstation, PC big enough to run it Printing in general Works fine in my home network via CUPS Haven’t been able to set up in CS Department PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Problems and Issues (continued) No practical way for students to back up their work Untried: ability to map to drives on other machines Possibility: USB flash drive Alternative: create a virtual machine with two hard disks (one for kernel, one for user) This problem needs a solution — the whole idea of the virtual machine is to be able to safely make mistakes! PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Using Virtual Machines to Teach CS-502 Project Assignments Project #1 completed Add a system call and use printk() Project #2 in progress Mailbox and messaging system Optionally use kdb Project #3 to be assigned TBD, probably Page replacement PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Project #1 — Add a system call Learn to build kernel Claypool, “Linux dabbling” Add “Hello, world” system call, use printk Silbershatz, Chapter 2 project Add getprinfo system call Prof. Jason Nieh (Columbia Univ) Three weeks total Could be reduced to two weeks when bugs are ironed out Educational value Kernels are different (and difficult) A lot of fumbling before running Overcome the intimidation of reaching inside something “magic” PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Project #2 – Mailbox and Message system Patterned after similar user-space projects of previous terms Lauer, Tabloski, Wills, etc. Educational value Memory allocation, esp. in kernel Synchronization via semaphores, reader-writer locks Difference between kernel code and user-space wrapper This turns out to be a really hard project Even in user space! PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Using Virtual Machines to Teach CS-502 Other Kernel Projects Nieh Thread synchronization GWRR scheduling Page replacement algorithm Access control lists for files Claypool Linux Dabbling Background scheduling policy Hidden processes Process, thread accounting PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502

Using Virtual Machines to Teach CS-502 Teaching Goals Kernel is not magic Kernel is not like any other program Cement the fundamental concepts of an operating system course Ability to say at a job interview:– “Yes indeed, I have worked inside a major OS kernel.” PEDS, November 6, 2006 Using Virtual Machines to Teach CS-502