Presentation is loading. Please wait.

Presentation is loading. Please wait.

Project 0: Linux & VM Dabbling CS-502, Fall 20071 Project 0: Linux & Virtual Machine Dabbling CS-502, Operating Systems.

Similar presentations


Presentation on theme: "Project 0: Linux & VM Dabbling CS-502, Fall 20071 Project 0: Linux & Virtual Machine Dabbling CS-502, Operating Systems."— Presentation transcript:

1 Project 0: Linux & VM Dabbling CS-502, Fall 20071 Project 0: Linux & Virtual Machine Dabbling CS-502, Operating Systems

2 Project 0: Linux & VM Dabbling CS-502, Fall 20072 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

3 Project 0: Linux & VM Dabbling CS-502, Fall 20073 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

4 Project 0: Linux & VM Dabbling CS-502, Fall 20074 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

5 Project 0: Linux & VM Dabbling CS-502, Fall 20075 Installing from DVD See instructions on-line.doc,.html.doc.html Download and install VMware Player Or other VMware product Unzip your virtual machine to new directory …

6 Project 0: Linux & VM Dabbling CS-502, Fall 20076 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

7 Project 0: Linux & VM Dabbling CS-502, Fall 20077 Using VMware Server on csopt4 See instructions.doc,.html.dochtml 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 …

8 Project 0: Linux & VM Dabbling CS-502, Fall 20078 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.

9 Project 0: Linux & VM Dabbling CS-502, Fall 20079 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

10 Project 0: Linux & VM Dabbling CS-502, Fall 200710 Questions?

11 Project 0: Linux & VM Dabbling CS-502, Fall 200711 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

12 Project 0: Linux & VM Dabbling CS-502, Fall 200712 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.

13 Project 0: Linux & VM Dabbling CS-502, Fall 200713 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

14 Project 0: Linux & VM Dabbling CS-502, Fall 200714 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

15 Project 0: Linux & VM Dabbling CS-502, Fall 200715 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

16 Project 0: Linux & VM Dabbling CS-502, Fall 200716 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!

17 Project 0: Linux & VM Dabbling CS-502, Fall 200717 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

18 Project 0: Linux & VM Dabbling CS-502, Fall 200718 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

19 Project 0: Linux & VM Dabbling CS-502, Fall 200719 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

20 Project 0: Linux & VM Dabbling CS-502, Fall 200720 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

21 Project 0: Linux & VM Dabbling CS-502, Fall 200721 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!

22 Project 0: Linux & VM Dabbling CS-502, Fall 200722 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

23 Project 0: Linux & VM Dabbling CS-502, Fall 200723 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

24 Project 0: Linux & VM Dabbling CS-502, Fall 200724 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

25 Project 0: Linux & VM Dabbling CS-502, Fall 200725 Submitting your Project From within your virtual machine, visit –http://turnin.cs.wpi.edu:8088/servlets/turnin.sshttp://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!

26 Project 0: Linux & VM Dabbling CS-502, Fall 200726 Questions?


Download ppt "Project 0: Linux & VM Dabbling CS-502, Fall 20071 Project 0: Linux & Virtual Machine Dabbling CS-502, Operating Systems."

Similar presentations


Ads by Google