Courses/Computer Science/CPSC 457.W2012/Tutorial Schedule

From wiki.ucalgary.ca
< Courses‎ | Computer Science‎ | CPSC 457.W2012
Revision as of 20:33, 5 April 2012 by Danielmncastro (talk | contribs) (Apr 5: SystemTap)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Tutorial topics that the TA will discuss each week are below. This schedule is under construction and is subject to change as needed.

Tutorial session 1 takes place from 11 to 11:50.

Tutorial session 2 takes place from 4 to 4:50.

Both begin on 17 January and end on 12 April.

Daniel's Feedback Form

The feedback form is available here. It is anonymous. Please use with responsibility.

Jan 17: SVN tutorial

A brief tutorial of using Subversion, a source code control package.

Other source or revision control packages include cvs and git, but this class will use svn, especially for submitting homework assignments.

Includes use of ssh-based public key authentication.

Notes


Reading

Jan 19: Introduction to the C language

  • A refresher on the C programming language, including language basics, the C library, I/O, error handling, getopts, cmd line args, environment, the C preprocessor macro language, header files, linking, gcc options, debugging.
  • Practice of writing basic Makefiles and controlling compilation from the command line.
  • Writing a Unix Shell

This content will be spread along the next 5 sections, i.e., from Jan 19 to Feb 02.

Notes

Today we covered the very basics of C and makefiles. In practice, a bit of focus on makefiles and a little bug hunting.

Specifically about the bug hunting in questions 9 and 10. The functions should be returning value, main is not receiving parameters and there should be a casting. These were unintended and spotted by the students. There are three more.

Jan 24: Intro to C (cont.) / Writing a UNIX shell

A continuation of the 19th, we will talk briefly about C and move on to a guided exercise of implementing a simple shell in C.

This exercise intends to reinforce C programming skills, I/O, and invocation of standard system calls from userland or via the C library. It should also offer insight into the operation of the standard set of Unix shells and put the use of Makefiles into practice.

We will continue developing our UNIX shell for the next two sessions.

Notes

The tutorial in the morning did not work as I expected. My apologies to all of you. In the afternoon, we did the "practice exercise" approach again.

About "extra features": if time permits, it was suggested pipes and also command history.


When (re)viewing the practice, please attention to the following steps:

  • Step 5: Remember checking for errors.
  • Step 10: Use of _fork_ and _execve_. We are calling the "library" implementations. We will eventually do the same using system calls (for educational purposes).

The source code for today (including the functions for "cd" and "echo") is provided below. For those that are not familiar with TGZ files (.tgz, .tar.gz):

 tar -zxvf 457shell-20120124.tar.gz

Jan 26: Writing a UNIX shell (cont.)

A continuation of the last tutorial session.

Jan 31: Writing a UNIX shell (cont.)

Conclusion of the previous tutorials. Topics: Running in background, system calls


Feb 2: Installing and running a virtual machine in VMWare

A guided tour of installing an OS image into VMWare Workstation.

Notes

  • We attempted a live demo of creating an VMware and installing a existent VM (appliance).
  • Due to limited disk space, we could not have practice on this. So, if you have any questions, please let me know.


Feb 7: Measuring time

An exercise on performing measurements, using the "time" command and also performing system calls.

Feb 9: An overview of pthreads

An introduction to the pthreads package, API, and features. Creating and destroying pthreads.

Feb 14: An overview of pthreads (cont.)

Continued discussion of pthreads API. Synchronization using Mutex.

Feb 16: The Patch and Diff tools

An overview of using patch(1) and diff(1)

Time also allotted for questions about HW 3.


Feb 21 / 23: No tutorials (Reading Week)

Feb 28: Midterm Review

A discussion and review of topics that may appear on the midterm exam.

Mar 1: Midterm Exam, no tutorials

Mar 6: Configuring, Compiling, and Installing a fresh kernel

Using your virtual machine, download, configure and compile.

Notes

  • Suggested directory structure:
~/kernel/linux-3.0.23-pristine
~/kernel/linux-3.0.23-work
~/kernel/built-3.0.23-daniel

Where 3.0.23 is our kernel version. Feel free to use a version that is closest to the one in use in your current distribution.

  • Download source:

http://www.kernel.org

http://mirror.cpsc.ucalgary.ca/mirror/kernel.org/linux/kernel/

  • To compile:
make mrproper
make O=$BUILD oldconfig
make O=$BUILD
make O=$BUILD modules

where $BUILD is a environment variable that stores the path to our build directory.

Mar 8: Configuring, Compiling, and Installing a fresh kernel

Installing a fresh kernel, introduction to GRUB and starting the development of a new system call.

Helpful for HW 4.

Notes

  • Installing your recently compiled kernel.
cd $WORK 
make O=$BUILD install modules_install

Notice that you should not forget installing the modules as well. If you did, select the option "Previous Linux version" in the GRUB menu and you should have access to the original kernel.


  • Remember: $WORK and $BUILD are environment variables. $WORK refers to your work directory, i.e., the one that you are modifying. And $BUILD refers to the directory where you are building the kernel. And, for those who do not remember, defining environment variable depends on the shell you are using.


- If you are using BASH or any variant:

export BUILD=/home/USERNAME/kernel/built-VERSION-USERNAME


- If you are using TCSH or variant:

setenv BUILD /home/USERNAME/kernel/built-VERSION-USERNAME


- Notice that you could even include a script that is executed when your terminal session starts. For BASH, the file is ~/.bashrc.

- Also notice that these are examples of how to define environment variables. Adjust the path to your own directory structure.


Mar 13: Modifying a kernel (creating a system call)

Today we should finish our system call.

Notes

Mar 15: Kernel (Final steps) and HW 4 Questions

We go over the system call implementation (as per task list from last tutorial), then the space is yours for questions about HW4.

Mar 20: Program supervision with Ptrace

Today we had a refresh/review on Ptrace. We looked at the kernel source for code that is related to ptrace (such as API and implementation).

Notes

Mar 22: Homework 4

Use this time to work on HW4.

Any questions will be welcome!

Mar 27: LKM

Mar 29: ELF overview

Apr 3: LKM and system calls

Today we talked about how to use LKMs to modify a system call implementing what is usually called a "hook". As practice, we modified sys_open to send a message using the syslog system (printk).

NOTE: Due to the slide format, in special because of some pictures in the slides. This slide set is not available yet. Coming soon!

Apr 5: SystemTap

Apr 10-12: No Tutorials

As suggested by the instructor, there will not happen "formal" tutorials this week. However, during the tutorial times, the TA will be in class in case you need.