Spring 2002 EECS 338:
Operating Systems

Steven Huwig
Thursday 1:15PM-2:05PM Recitation, Rockefeller 309

Page Contents

Contact Information

Steven Huwig
sjh13@po.cwru.edu
216-397-3261
AIM: Orwell823 | Yahoo: aliftedlorax | irc.cwru.edu: steve

Office Hours (UNIX Lab)

  • Tuesday 1:30-2:30 PM
  • Thursday 10:30-11:30 AM
  • Friday 1:30-2:30 PM

Announcements

4 April 2002

I've updated the lecture notes with another Unix help document, this one about tools that might make your life easier. Additionally, I will be covering threads in the next two sessions, and will be taking your sockets questions for the assignment due Tuesday.

19 March 2002

Unfortunately I have come down with a case of the Killer Death Flu and will be unable to be at office hours today. I will hopefully offer "makeup" office hours tomorrow from 1:30-2:30. Sorry for any inconvenience this causes.

15 February 2002

In college I worked as a consultant. One day this grad student was having troubles with his Fortran program and brought the printout to me. He said he kept changing things but couldn't get it to run correctly. His analysis: "I get the feeling that the computer just skips over all the comments." --- Computer Stupidities

14 February 2002


8 February 2002

A number of you have been having issues with getting fprintf() to output data. Try following fprintf() statements with a call to fflush(FILE *) on your file pointer. This forces pending writes to be made.

7 February 2002:

You have an assignment due next Tuesday. There is a typographical error in the handout passed out in class... the second process should attempt to get a WRITE (not read) lock on the file created by the first process. I apologize for any confusion this may have caused.

4 February 2002:

I've posted a list of web pages for students in the Thursday recitation. Please make sure that your name is on it and that it is linked correctly.

31 January 2002:

Because of a quirk in the getlogin() C library function, it will segfault if you try to use it while running a script. Use cuserid() instead, as per the manpage's suggestion.

28 January 2002:

There are several important announcements to be made. As you know, you have an assignment due Tuesday. I made a rather big error in the sample code distributed last Thursday. The execlp calls should be of the form execlp("date", "date", NULL), since the name of the command itself is included in argv[]. Let this be a lesson to check the prototypes of system calls carefully! :-)

18 January 2002:

I apologize that I will not be holding office hours this Friday afternoon. If you have any questions about setting up your account, feel free to e-mail me.

15 January 2002:

Please get an account on the JCC Unix computers as soon as possible. We will be going over basic Unix commands and initial setup questions at the first recitation.

Course Information

EECS 338 is a junior/senior level operating systems course. In Spring 2002 it is being taught by Professor Tekin Ozsoyoglu. Materials covered will include concurrent programming, process and thread management, and CPU, memory, and disk resource allocation algorithms.

EECS 338 Course Links

Recitation Notes

Recitation #1, 17 January 2002

The UNIX family of operating systems is very powerful yet somewhat arcane. As an introduction to the UNIX systems on campus, we will learn how to log in to the Jennings Computing Center's Solaris machines and perform basic file manipulation and programming tasks. Instructions for acquiring an account can be found at the lab's web site. Please make sure you have a working account as soon as possible, as all grading is done from the online versions of your projects. I have prepared a short and fast-paced tutorial for those of you who are not familar with the basics of programming and using a Unix system. Stuart Morgan has also written a Unix help document. Any feedback you might have is appreciated. There are also instructions for setting up your course web pages at http://www.eecs.cwru.edu/jcc/webpages.shtml. Lecture Notes (pdf) here.

Recitation #2, 24 January 2002

In lecture you will be given an assignment that demonstrates several of the Unix system calls covered in chapters 1-3 of your Unix textbook (hereafter referred to as the "Monkey Book"). There are a few important differences between developing C++ applications on Windows and using C on a Unix machine. I strongly suggest that you enter in a few of the example programs in chapters 1-3 and play around with the settings to get a feel for how they work. I have compiled a list of differences between C and C++. Here are the examples I passed out in class.

Recitation #3, 31 January 2002

There are many common features of system calls like getrusage and getopt.

Recitation #4, 7 February 2002

This week's assignment requires you to create, open, output to, and lock a file, as well as make a Unix signal handling function. I will go over Unix file handling as well as the C Standard Library's output functions. Then I will answer questions you have regarding the assignment.

Recitation #5, 14 February 2002

System V semaphores are one of the three IPC (interprocess communication) facilities common to nearly every modern version of Unix. Like nearly every other non-trivial system call, semget(), semctl(), and semop() require manipulation of predefined system structures. A brief overview of these commands will be forthcoming. The program prodcons.c which I passed out in class is a fairly comprehensive example of Unix semaphores. Also, Stuart Morgan has some practical advice about IPC facilities.

Recitation #6, 21 February 2002

The example given last time for an implementation of the producers-consumers problem suffered from requiring disk access. Memory access is of course much faster, but to allow many processes to access the same memory, you must use the IPC shared memory facilities. The basic procedure is to use the shmget() call to create shared memory in one process, have other processes use the same key to access this same memory with shmget(), and allow the processes to access this memory via a pointer by attaching it with shmat(). I have rewritten the prodcons.c program to generate random strings and use shared memory. One other change is the method of naming semaphores...please note that where describing semaphore operations is concerned, DOWN == wait == P(asseren) and UP == signal == V(rijgeven). I have used the language from the Tanenbaum text (UP/DOWN).

Recitation #9, 4 April 2002

Today I will be going over the basics of threads. I have implemented the famous Tina-Judy-Cookie Jar problem (it took me no more than a half-hour, to show you how nice threads are once you get over some of their weird arguments). Here is the handout. By popular demand, here's last week's sockets handout as well.

I've written another document to help you with your last two Unix assignments. This one covers some nice features of the tcsh shell, as well as some command-line tricks, gdb, and rcs.

Other Resources

The following resources (derived from a list from Ben Karas, who himself copied them from Andy Reitz) will help you learn to use Unix. I personally use both FreeBSD and Mac OS X, and will gladly give anyone advice for installing and running these systems on their own machines. My first suggestion for those who want to do well in this class is to procure a copy of Kernighan and Ritchie's The C Programming Language, Second Edition. I cannot overstate the value of this book, both in this course and in the computing field at large. Trust me. It's worth having your own copy.


Steven James Huwig
Last modified: Thu Apr 4 14:06:17 EST 2002