The Unix Programming Environment
Here are the major Unix topics you should understand:
- processes and fork
- the shell: a user-mode command interpreter
- the current directory and name resolution
- arguments
- environment variables
- $PATH and command execution
- inheritance
- "everything is a file"
- file descriptors
- open/read/write/lseek/close
- stdio/stdout/stderr
- pipes and redirection
- dup/exec
- foreground and background
- signals and kill
- uid and groups
- user/group/other * rwx file permissions
- the setuid bit
Exercises
These may be useful in helping you to become familiar with Unix,
and for understanding what we might be asking you to do in a real
OS class.
lmbench
[lmbench] lmbench: Portable Tools for Performance Analysis. By Larry McVoy and Carl Staelin. In the USENIX Technical
Conference, 1996.
The lmbench distribution, built for our linux systems, can be found
in the course directory /usr/project/courses/spring06/cps196
on CS department systems (e.g., login.cs.duke.edu).
There are some other simple Unix programs in toys and ctoys
that may be interesting or useful.
lmbench is also available at /usr/research/playground/cps196/lmbench, accessible from all departmental and research machines.
Read the following sections of [lmbench]
to understand some basic issues of benchmarking methodology:
introduction,
sizing the benchmarks, and timing issues. Read section 5 well
enough to understand the bandwidth measures and why they are important.
Read 6.3-6.9: syscall overhead, signal handling overhead, process
creation overhead, context switching, IPC latency, file system
latency, and disk latency.
Run the lmbench latency numbers on your Xen virtual machines.
Consider the following questions:
- How much better are the latencies than they are on the mid-1990s
machines reported in the paper?
- How much faster does Moore's Law predict they should be?
- What does this test say about Moore's Law and operating systems?
- Is this a fair test? What are some likely sources of error?
- lmbench is a microbenchmark suite. You should
understand how microbenchmarks differ from other kinds
of benchmarks. Why are they useful? How can they help predict
application performance? What other information is required?
Why aren't operating systems getting faster as fast as hardware?
Running lmbench
You can find the lmbench distribution compiled and ready to go at
/usr/research/playground/cps196/lmbench/lmbench. Copy this directory over
to your own playground space, or anywhere else you prefer that is
accessible from your virtual machine. Read the "README" file to find out
how to run the benchmarks.
- You can NOT run the benchmarks where they are located now. Copy the
directory over to your own space
- You CAN use the lmbench3.tar.gz file if you want, but if you do,
please see below:
- Go through the Makefile and remove all dependencies to "bk.ver" that
you find.
OR
- Copy my Makefile over the one you get from the tarball.