This page documents what we do in class. It contains C programs that we will discuss in class, reading assignments from our textbook, simple homework exercises that you can work on for practice and exam preparation (not for credit), links to other sources of information, etc.
The reading assignments and practice problems are listed by the date on which they were assigned. The sample program files are listed by the date on which they were used. When you are viewing a source code page, you can use your browser's "File -> Save As..." menu item to save a copy of the code on your computer. It is a good idea for you to "play" with these example programs; compile them, run them, make simple changes to them and compile and run them again.
|
- Wednesday, April 29.
- Remember that the second exam will be on Monday, May 4, from 8:00pm - 10:00pm. Be sure to look at the set of review problems.
- Monday, April 27.
- Read Chapter 9, Sections 9.7-9.11 (pages 390-409) from the operating systems textbook.
- Here are two more Win32 virtual memory program examples.
- Here is a link to a "Performance Monitor object" that you can use to observe the difference between "hard page faults" (green graph) and "soft page faults" (blue graph). Download this object and double click on it. It should start up Performance Monitor and start recording data right away.
- Here are a few links to information about virtual memory and memory management.
- Wednesday, April 22.
- The second exam will be on Monday, May 4, at 8:00 PM. Here is a file that contains sample questions for the exam.
- Read Chapter 9, Sections 9.5-9.6 (pages 382-390) from the operating systems textbook.
- Monday, April 20.
- Read Chapter 9, Sections 9.1-9.4 (pages 357-381) from the operating systems textbook.
- Here are some notes about paged virtual memory and a zip file containing some more information about virtual memory systems.
- Wednesday, April 15.
- See the homework page for your sixth homework assignment.
- Read Chapter 8, Section 8.5-8.8 (pages 337-350) from the operating systems textbook.
- Here are a few examples of using Win32 virtual memory functions.
- Here is a zip file containing a few programs that can be used to create maps of virtual memory for running processes.
- Monday, April 13.
- Read Chapter 8, Sections 8.1-8.4 (pages 315-337) from the operating systems textbook.
- Here are links to web sites that have Java applets that animate some of the famous synchronization problems.
- Here are links to a few articles that point out why concurrency has recently become important to all developers and why this is a bit of a problem. Read as much, or as little, of this as you find interesting.
- Monday, April 6.
- The following zip file contains all of the code examples about threads and synchronization.
- Here are several implementations of two very simple synchronization patterns.
- Here are several pseudo code "solutions" to the Dining Philosophers Problem.
- Here are two pseudo code solutions to the Readers and Writers Problem.
- Wednesday, April 1.
- Read Section 4.2 (pages 71-86) from The Little Book of Semaphores by Allen B. Downey.
- Here is an outline of various ways to implement critical sections using hardware.
- Here are a few examples of how to implement critical sections, both in hardware and in software.
- Monday, March 30.
- See the homework page for your fifth homework assignment.
- Read Chapter 6, Section 6.8 (pages 252-257) from the operating systems textbook.
- Read Section 4.4 (pages 93-105) from The Little Book of Semaphores by Allen B. Downey.
- Here are two simple examples of the Producer Consumer synchronization problem.
- Wednesday, March 25.
- Read Chapter 6, Sections 6.4-6.6 (pages 231-244) from the operating systems textbook.
- Read Section 4.1 (pages 61-71) from The Little Book of Semaphores by Allen B. Downey.
- Here are Win32 programs that demonstrate more race conditions and that use mutexes and semaphores to protect the critical sections.
- Monday, March 23.
- Wednesday, March 11.
- The midterm exam is today.
- Read Chapter 6, Sections 6.1-6.3 (pages 225-230) from the operating systems textbook.
- Monday, March 9.
- Read Chapter 5, Sections 5.4-5.8 (pages 199-218) from the operating systems textbook.
- Here are a couple programs that let us try to observe some of Window's thread scheduling policies.
- Monday, March 2.
- There will be a midterm exam next Wednesday, March 11. Here is a file that contains sample questions for the midterm exam.
- Wednesday, February 25.
- See the homework page for your fourth homework assignment.
- Read Chapter 5, Sections 5.1-5.3 (pages 183-199) from the operating systems textbook.
- Here are several Win32 programs that create threads.
- When running multiple processes or threads on a multicore CPU, it is sometimes useful to control which core a process or thread runs on. Here is some information about "Processor Affinity" and a small utility that makes it easier to set a process's affinity.
- Monday, February 23.
- Here are some review problems, from the end of each textbook chapter, that you should look at in preparation for the first midterm exam.
- Chapter 1, page 42, Exercises 1, 2, 3, 7, 8, 22.
- Chapter 2, page 91, Exercises 1, 2, 3, 5, 13, 17.
- Chapter 3, page 141, Exercises 3, 6, 7, 9, 10.
- Chapter 4, page 174, Exercises 1, 2, 3, 4, 7, 9, 10, 11.
- Wednesday, February 18.
- Read Chapter 4, Sections 4.1-4.6 (pages 153-174) from the operating systems textbook.
- Monday, February 16.
- Wednesday, February 11.
- Read Chapter 3, Sections 3.1-3.4 (pages 101-123) from the operating systems textbook.
- This zip file contains several very short programs that demonstrate different kinds of "exceptions" or "software interrupts" that the Pentium CPU can handle (besides the system call instruction).
- Here is an example of a Win32 program that creates processes using the
CreateProcess() function.
- Here is an example of a Posix (i.e., Linux or Unix) program that creates processes using the
fork() function..
- Monday, February 9.
- Be sure to look at the homework assignment page for your third assignment.
- Read Chapter 2, Sections 2.1-2.7 (pages 49-76) from the operating systems textbook.
- Here is a web site that summarizes much of what we have covered about C, the C runtime, and assembly language.
- Here are a few references about "system calls" in Windows.
- Wednesday, February 4.
- Read Chapter 1 (pages 3-42) from the operating systems textbook.
- Look at this brief explanation of why we need operating systems.
- Here are three simple C programs that demonstrate basic I/O in C and also demonstrate a couple of important operating systems concepts.
- A good input file for testing the above three programs is War and Peace from Project Gutenberg
- It is a good idea to run the above programs and watch them run using the QuickSlice (qslice.exe) program.
- An easy way to compute their runtimes is to use Timethis (timethis.exe) or ptime.
- If you want, you can use the following files to make timing and observing the above programs easier.
- Wednesday, January 28.
- Be sure to look at the homework assignment page for your second assignment.
- To make your life a bit easier, here is a zip file, CS302-up-to-Jan-28.zip that contains all of the source code files linked to below.
- Here are some linking diagrams that try to help you visualize the steps in creating and using static and dynamic libraries.
- Here is a simple example of a single program made up of two separate compilation units (the second compilation unit can be thought of as a small "library" for the first compilation unit).
- Here is an example of a single program made up of three compilation units.
- Here is an example that shows how to create and use a dll.
- Here are some references on linking and dll's.
- For a bit of information about using make and makefiles, read any of the following.
- I've mentioned in class that function calls do not really need the base pointer (ebp) in their stack frames. Here is how to "turn off" the base pointers with the cl and gcc compilers.
- Monday, January 26.
- Be sure to study this handout about the "C runtime system".
- Here are some C programs that we will use to understand how the C runtime handles function calls (i.e., parameter passing, return addresses, stack frames, and return values).
- Here are some references about how C function calls are implemented in assembly language.
- Here are some programs that demonstrate various C calling conventions.
- Here are references to more information about calling conventions.
- Wednesday, January 21.
- Here are some C programs for which we shall examine the assembly language translations.
What you need to know about pointers.
- Here is a link to a brief movie, made at Stanford University, about pointers.
- Here are a couple more good references about pointers.
- Here are some simple C programs that demonstrate ideas about pointers.
- Part of understanding pointers is understanding pointer declarations. Here are some explanations of how to read C declarations.
Wednesday, January 14.
- No class, due to weather conditions.
Monday, January 12.
- Be sure to look at the homework assignment page. Your first assignment is already listed there.
- If you would like to buy a good, but very cheap, used book on C, download this zip file that contains Internet shortcuts to a few suggested books. (I have placed copies of a few of these books on reserve in the library for this course.)
- Print and study this handout about variables and the C run time system. Use a book about C to familiarize yourself with ideas and terms mentioned in the handout.
- Here are C programs that demonstrate some ideas about the C run time system.
- Here is a link to a zip file that contains four C compilers that we will use in this course. Download this zip file and unzip it into the top level of your
C:\ drive. We will go over in class how to use these compilers.
|
Return to the CS 302 home page.
compliments and criticisms
|