ppt
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

ppt

on

  • 876 views

 

Statistics

Views

Total Views
876
Views on SlideShare
876
Embed Views
0

Actions

Likes
0
Downloads
13
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Assumptions: Graduate level Operating Systems Making Choices about operation systems Why a micro-century? …just about enough time for one concept

ppt Presentation Transcript

  • 1. Project 0: Linux & Virtual Machine Dabbling CS-502, Operating Systems CS-502, Fall 2007 Project 0: Linux & VM 1 Dabbling
  • 2. In this project, we will … • Install our virtual machines and learn how to use them – This is the place you will work during this course! • Build and install the Linux kernel – With your name on it! • Follow Linux naming & numbering conventions • Turn in the project using web-based Turnin CS-502, Fall 2007 Project 0: Linux & VM 2 Dabbling
  • 3. In this project, we won’t … • … try to change anything in the kernel yet • This is for next project • … try to support more than one machine architecture • However, 32-bit and 64-bit architectures are different at the kernel level! • Your virtual machine is not portable from one to the other CS-502, Fall 2007 Project 0: Linux & VM 3 Dabbling
  • 4. Installing your Virtual Machine – Options • Install from DVD using VMware Player or any other VMware product • Needs 8 gigabytes of disk, 1-2 gigabytes of RAM, fast Pentium CPU (dual core would be very nice!) • Use VMware Server on csopt4.wpi.edu • Needs VMware client on your PC • GUI interface to virtual machine • Use Parallels on Macintosh (or other) • See instructor CS-502, Fall 2007 Project 0: Linux & VM 4 Dabbling
  • 5. Installing from DVD • See instructions on-line • .doc, .html • Download and install VMware Player • Or other VMware product • Unzip your virtual machine to new directory • … CS-502, Fall 2007 Project 0: Linux & VM 5 Dabbling
  • 6. Installing from DVD (continued) • Choose type of networking • Bridged vs. NAT (Network Address Translation) • Start your virtual machine • Fix up MAC address for network • Boot OpenSUSE 10.2 • Login is as student, password = CS-502 • Open YaST, the SUSE administration tool • Fix and test networking • Create new user identity for yourself • Log out, log in as new identity, delete student CS-502, Fall 2007 Project 0: Linux & VM 6 Dabbling
  • 7. Using VMware Server on csopt4 • See instructions • .doc, .html • Get CS Department user ID and password • Download and install VMware client • Log onto csopt4, make new directory on /xtra_space drive • Unzip the following file to your new directory – /xtra_space/CS-502/CS-502_Fall-07_x86_64.zip • … CS-502, Fall 2007 Project 0: Linux & VM 7 Dabbling
  • 8. Using VMware Server on csopt4 (continued) • Start VMware client, log into csopt4 • Browse to and open your virtual machine • Rename it to something unique (your user ID) • Set permissions • Start your virtual machine • Follow instructions for distributed version – Networking, user identity, etc. CS-502, Fall 2007 Project 0: Linux & VM 8 Dabbling
  • 9. Setting OpenSUSE Linux 10.2 on Parallels • See instructor • Will install OpenSUSE Linux 10.2 directly to disk partition – Be sure to get on-line updates • Best to create a separate partition for /home directory • Need to move /usr/src to /home/src – Create link /usr/src /home/src CS-502, Fall 2007 Project 0: Linux & VM 9 Dabbling
  • 10. Questions? CS-502, Fall 2007 Project 0: Linux & VM 10 Dabbling
  • 11. To get started with kernel • Find kernel sources in /usr/src, i.e., a link to /home/src linux-2.6.18.2-34 linux-2.6.18.8-0.5 • Clone kernel source tree by linked copy: – – In a terminal window, do cp –al /usr/src/linux-2.6.18.8-0.5 kernelSrc – Creates a linked copy of original tree in new directory called kernelSrc CS-502, Fall 2007 Project 0: Linux & VM 11 Dabbling
  • 12. Digression on Unix/Linux Hard Links • Directory entries point directly to files • Two entries may point to same file! • Same or different directories • Same or different name • Permissions attached to file, not directory • Called hard links (as opposed to symbolic links) • Modifications to file seen via all hard links • mv and rm commands change directories, not files! • File goes away when all directory entries (i.e., hard links) to that file are deleted. CS-502, Fall 2007 Project 0: Linux & VM 12 Dabbling
  • 13. Cloned Source Tree • All directories are copied • All directory entries in copy are hard-linked back to files in original source tree • I.e., only one copy of each file exists • To modify a file:– • Unlink it (via mv or rm) • Replace it with modified copy in your directory • Original is preserved intact in original directory CS-502, Fall 2007 Project 0: Linux & VM 13 Dabbling
  • 14. To Modify a File • mv file.c file.c~ • Edit file.c~ in your favorite editor • Save as file.c • (Eventually) delete file.c~ • EMACS and patch do this automatically • Most other editors require you to do it manually CS-502, Fall 2007 Project 0: Linux & VM 14 Dabbling
  • 15. To Build Linux Kernel • Make configuration step – As ordinary user • Build kernel files and modules – As ordinary user • Install modules, boot file, etc. – Need root privileges CS-502, Fall 2007 Project 0: Linux & VM 15 Dabbling
  • 16. To Build Linux Kernel (continued) • Always build to a separate destination tree mkdir ~/kernelDst make O=~/kernelDst … • Reason – Making the configuration generates a lot of include files and other sources – If you don’t specify a destination, it fills up your source tree – Your patch files grow to > 1 megabyte! CS-502, Fall 2007 Project 0: Linux & VM 16 Dabbling
  • 17. Make configuration • In a command shell – cd kernelSrc • Do one of:– – make O=~/kernelDst config • Very long and tedious – make O=~/kernelDst menuconfig • Still somewhat long and tedious; also hokey – make O=~/kernelDst xconfig • Nice; a GUI with very small print – make O=~/kernelDst gconfig • Really nice; a better GUI; highly recommended CS-502, Fall 2007 Project 0: Linux & VM 17 Dabbling
  • 18. Make configuration (continued) • Edit “General Setup” to name your “Local version” • No other edits necessary for this project. • Save and quit • If need to rebuild, use • make O=~/kernelDst oldconfig to reuse same configuration CS-502, Fall 2007 Project 0: Linux & VM 18 Dabbling
  • 19. To Build Kernel • In a terminal window (i.e., a shell), do: – – cd kernelSrc – make O=~/kernelDst • Takes • 20 minutes on dual-core 2.4 GHz Pentium, 2 GByte • 40 minutes on csopt4 (last year) • Almost two hours on 3 gigahertz Pentium, 1 GByte • Rebuilds after small edits are much faster • Changing .h files can cause longer rebuilds CS-502, Fall 2007 Project 0: Linux & VM 19 Dabbling
  • 20. One little glitch … • File include2/asm/asm-offsets.h not generated by make config • Build crashes within about 2-3 minutes • Link file from • ~/kernelDst/include/asm-i386/ or • ~/kernelDst/include/asm-x86_64 to • ~kernelDst/include2/asm • Run make O=~/kernelDst again • Without trying to remake the config • Build “should” complete without further errors CS-502, Fall 2007 Project 0: Linux & VM 20 Dabbling
  • 21. For Project Submission • Redirect build output to a file • Submit that file (this project only) • Note that there are lots of warnings in the Linux kernel • Not your problem! CS-502, Fall 2007 Project 0: Linux & VM 21 Dabbling
  • 22. To Build Kernel on a Dual Processor • Generally faster to do – cd kernelSrc – make –j2 O=~/kernelDst • Sometimes, this is even faster – make –j4 O=~/kernelDst • SUSE advice –2 number of processors CS-502, Fall 2007 Project 0: Linux & VM 22 Dabbling
  • 23. To Install Kernel • Requires root privileges – sudo make modules_install install – Note order of arguments! • Puts kernel, initrd file, symbols in /boot – Changes links for vmlinuz, initrd • Adds entries to /boot/grub/menu.lst – So your kernel shows up on boot screen – So you can select which kernel to boot CS-502, Fall 2007 Project 0: Linux & VM 23 Dabbling
  • 24. Running Your Kernel • Restart your virtual machine • Click in boot window • Use arrow keys to select desired kernel or system • To determine which kernel is running:– – uname -a CS-502, Fall 2007 Project 0: Linux & VM 24 Dabbling
  • 25. Submitting your Project • From within your virtual machine, visit – http://turnin.cs.wpi.edu:8088/servlets/turnin.ss • Log in • Submit output of your build as Project 0 • This is to test the ability to submit projects from the virtual machine! CS-502, Fall 2007 Project 0: Linux & VM 25 Dabbling
  • 26. Questions? CS-502, Fall 2007 Project 0: Linux & VM 26 Dabbling