Presentation is loading. Please wait.

Presentation is loading. Please wait.

Project 0, Linux Dabbling CS-3013 A-term 20081 Project 0: Linux & Virtual Machine Dabbling CS-3013, Operating Systems.

Similar presentations


Presentation on theme: "Project 0, Linux Dabbling CS-3013 A-term 20081 Project 0: Linux & Virtual Machine Dabbling CS-3013, Operating Systems."— Presentation transcript:

1 Project 0, Linux Dabbling CS-3013 A-term 20081 Project 0: Linux & Virtual Machine Dabbling CS-3013, Operating Systems

2 Project 0, Linux Dabbling CS-3013 A-term 20082 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 Dabbling CS-3013 A-term 20083 In this project, we won’t … … try to change anything in the kernel yet This is for a future project … try to support more than one machine architecture However, 32-bit and 64-bit architectures are different at the kernel level! Hardware-level code for different processor families is organized differently in kernel source code! Your kernel is not portable from one to another

4 Project 0, Linux Dabbling CS-3013 A-term 20084 Installing your Virtual Machine in the Fossil Lab Log into any Fossil Lab workstation Your user ID Your Fossil password (from TAs) Open VMware Workstation Select “Open an existing Virtual Machine” Navigate to folder P:\CS-3013\A-term 2008\Clonable SUSE Linux 10.3 (32-bit) Double click on SUSE Linux (a VMware Configuration File) Select “Clone this Virtual Machine” Select Linked Clone Choose snapshot = Template for clones Save in your home directory on H drive (or on your desktop)

5 Project 0, Linux Dabbling CS-3013 A-term 20085 Starting your Virtual Machine Start your virtual machine When it starts Click in virtual machine screen Use arrow keys to select OpenSUSE 10.3 Login is as student, password = CS-3013 Switching between Host and Guest Click in guest window to focus mouse and keyboard Type CTL-ALT to return focus to host …

6 Project 0, Linux Dabbling CS-3013 A-term 20086 Starting your Virtual Machine (continued) Full screen mode Type CTL-ALT-Enter to switch to or from guest full screen Interrupting CTL-ALT-DEL always goes to host system Use VM menu command to “send CTL-ALT-DEL to guest”

7 Project 0, Linux Dabbling CS-3013 A-term 20087 KDE – a Linux GUI interface Looks and acts a lot like Windows or Mac GUI Many similar tools and applications “Start” menu is in lower left corner under the “Gecko” icon YaST, the SUSE administration tool Select User and group administration Create new user identity for yourself Log out, log in as new identity, delete student

8 Project 0, Linux Dabbling CS-3013 A-term 20088 YaST, the SUSE administration tool A much more efficient/effective way to manage your system Administer hardware, software, users, services, etc. Root password CS-3013 (same as student password) Access via third tab under “Gecko” icon Use it to set up your own user ID Delete student ID

9 Project 0, Linux Dabbling CS-3013 A-term 20089 Other Notes When input focus is in guest window Inserted CD/DVD is recognized by guest OS Same for USB flash drive Snapshots Makes a record of the state of your virtual machine Any subsequent changes are made in copy-on-write mode Shared folder with host operating system Seems to work this term!

10 Project 0, Linux Dabbling CS-3013 A-term 200810 Share your thoughts and experiences in the Fossil Lab with your colleagues Use the class e-mail list!

11 Project 0, Linux Dabbling CS-3013 A-term 200811 Questions?

12 Project 0, Linux Dabbling CS-3013 A-term 200812 To get started with kernel build Find kernel sources in /usr/src –i.e., a link to /home/src –Current version is linux-2.6.22.18-0.2 Clone kernel source tree by linked copy: – –In a command shell, do cp –al /usr/src/linux-2.6.22.18-0.2 kernelSrc –Creates a linked copy of original tree in new directory called kernelSrc –Or whatever you wish to name it

13 Project 0, Linux Dabbling CS-3013 A-term 200813 Digression on Unix/Linux Hard Links Directory entries point directly to files Two directory entries may point to same file! Same or different directories (within same file system) Same or different name Name attached to directory, not file Permissions & attributes attached to file, not directory Called hard links (as opposed to symbolic links) Modifications to file seen thru 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 and file is closed.

14 Project 0, Linux Dabbling CS-3013 A-term 200814 Cloned Source Tree All directories are copied All directory entries are hard-linked to files in original source tree I.e., only one copy of each file exists To modify a file:– Unlink it in your directory (via mv or rm ) Replace with modified copy in your directory Original still remains intact in original directory

15 Project 0, Linux Dabbling CS-3013 A-term 200815 To Modify a File mv file.c file.c~ Edit file.c~ in your favorite editor Save as file.c (Eventually) rm file.c~ EMACS and patch do this automatically Most other editors require you to do it manually

16 Project 0, Linux Dabbling CS-3013 A-term 200816 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

17 Project 0, Linux Dabbling CS-3013 A-term 200817 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 megabytes!

18 Project 0, Linux Dabbling CS-3013 A-term 200818 Making the 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 Nicer; a reasonable GUI with very small print –make O=~/kernelDst gconfig Really nice; a better GUI; highly recommended

19 Project 0, Linux Dabbling CS-3013 A-term 200819 Make configuration (continued) Edit “General Setup” line 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

20 Project 0, Linux Dabbling CS-3013 A-term 200820 To Build Kernel In a terminal window (i.e., a shell), do: – –cd kernelSrc –make –j4 O=~/kernelDst Takes ~30 minutes on dual-core 2.4 GHz Core Duo, 1 GByte RAM in VM (2 GByte real memory) Almost 1.25 hours on 3 gigahertz Pentium, 3 GByte Rebuilds after small edits are much faster Changing.h files causes longer rebuilds

21 Project 0, Linux Dabbling CS-3013 A-term 200821 Note: building with multiple processors Generally faster to do –cd kernelSrc –make –j4 O=~/kernelDst –j = number of concurrent build “jobs” SUSE advice –2  number of processors –Fossil Lab workstations have two processors (dual core)

22 Project 0, Linux Dabbling CS-3013 A-term 200822 Warnings Lots of warnings from files you never touched Not your problem No warnings allowed in your own code! In this course

23 Project 0, Linux Dabbling CS-3013 A-term 200823 For Project Submission Redirect build output to a file Submit –A subset of that file (this project only) –Output of uname –a command

24 Project 0, Linux Dabbling CS-3013 A-term 200824 To Install Kernel Requires root privileges –sudo make modules_install install –Root password = CS-3013 –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

25 Project 0, Linux Dabbling CS-3013 A-term 200825 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

26 Project 0, Linux Dabbling CS-3013 A-term 200826 Submitting your Project From within your virtual machine, visit –http://www.cs.wpi.edu/~kfisler/turnin.htmlhttp://www.cs.wpi.edu/~kfisler/turnin.html Log in Submit output of your build as Project 0 This is to test the ability to submit projects from the virtual machine!

27 Project 0, Linux Dabbling CS-3013 A-term 200827 Project Due Due date:– –Tuesday, September 2, 6:00 PM Normally, projects are due the afternoon before class, but this due date is extended to accommodate problems, questions, etc.

28 Project 0, Linux Dabbling CS-3013 A-term 200828 Questions?


Download ppt "Project 0, Linux Dabbling CS-3013 A-term 20081 Project 0: Linux & Virtual Machine Dabbling CS-3013, Operating Systems."

Similar presentations


Ads by Google