Systems Programming

References and Resources

Intrepid systems hackers: here are some resources you may find useful. This is by no means an exahustive list, and you must not feel limited by what you see here. If you come across something that you think is helpful, then please share it with the rest of us!

If you need some review of programming in the Wellesley CS Linux environment using Emacs, you can review the CS230 Unix introduction, Linux/Emacs/X tutorial, and this introduction to emacs. Of course, you don't need to read the parts about Java. If you don't appreciate it yet, then this course should help you understand why this is one of the most hilarious rants ever written! (Scroll down to the post by Patrick LoPresti.) You may also want to peruse these quotations.

Everyone in the class must read Scott Anderson's introduction to C and C++ for Java programmers.

Two of your best resources in this class are the Linux man command and web-based search engines like Google. The man command prints out a manual page for a particular command or library function. You can even type man man to find out more about man! I use man on library/system calls constantly to check arguments, error conditions and return values, and include files. Get in the habit of reading the man page for every system call you use!

The C language

The classic text is The C Programming Language by Brian Kernighan and Dennis Richie, referred to everywhere as K&R. This book is rather dated and doesn't reflect more recent standards; however, it was revised and turned into The ANSI C Programming Language. So as a present day reference, see C, A Reference Manual by Samuel P. Harbison and Guy L. Steele Jr.

C and C++ for Java Programmers, Scott Anderson.

The official Wellesley C Tutorial.

A C Crash Course courtesy of the MIT Student Information Processing Board (SIPB).

C Programming FAQ

A reference for Standard C

A C tutorial

A C reference site.

A guide to programming in ANSI C under Unix.

A list of more C resources.

C Traps and Pitfalls, by Andrew Koenig, describes problems C programmers, especially beginning C programmers, encounter.

Some observations by Julie Sussman.

C programming style

There is no shortage of advice on programming style. C programmers are known for preferring a rather spare programming style. For example, long variable names, often used in Java, are spurned except for global variables.

When you join a company or work on a collaborative project (like a Linux or GNU project), there is often a defined set of coding rules and standards that all programmers are required to apply. Therefore, we will adopt course coding standards for assignments and project code.

Linus Torvalds's advice on coding for the Linux kernel.
Henry Spencer's Ten Commandments of C Coding.
Rob Pike's notes on Programming in C
AT&T Indian Hill C coding style guide.

Debugging

Search engines like Google have really changed debugging: it is very common now to cut and paste an error message one doesn't understand into a search engine and look it up that way. But that is not enough.

You will benefit by becoming familiar with a proper debugger. Runtime error messages are generally uninformative, and sometimes, a flood of print statements won't do the trick. gdb is the GNU debugger and has a line-oriented interface. It has a GUI front end called ddd, which has documentation available via the web and in a downloadable PDF document.

Unix

We will make extensive use of Marc Rochkind's Advanced Unix Programming, Second Edition (Addison Wesley, 2004). You can get at the sample code here.

Advanced Programming in the UNIX Environment by W. Richard Stevens (Addison Wesley, 1993) is an often-used text. The notes will refer to it from time to time.

The UNIX Programming Environment by Brian Kernighan and Rob Pike is a classic text.

Norman Matloff's tutorial (including a C tutorial).

MIT's DESLAB's Unix help pages.

Stanford guide to Unix Tools.

Eric Raymond's online version of The Art of Unix Programming

UNIX Programming FAQ

Linux

Robert Love's Linux Kernel Devlopment is a very good and readable reference.

All kernel sources can be had from kernel.org.

A great source of Linux documentation.

Notes on device drivers

CVS

For the class projects, we will use a source management tool called Concurrent Versions System (CVS). The CVS website includes a comprehensive manual, however, we will likely need to use only a fraction of CVS's capabilities.

Miscellaneous

Here are two Posix Threads tutorials: one from YoLinux and another from Lawrence Livermore.

RFC 1094 NFS Protocol Specification

NFS Version 4

A good introduction to RPC with a working example that we studied in lecture.

Why Pascal is Not My Favorite Programming Language, by Brian W. Kernighan, is an interesting take on Pascal written by one of the designers of the C language.

A Brief History of the BSD Fast File System by Marshall Kirk McKusick is an inside look the evolution of the BSD file system by one of its principal designers/implementers. He describes how the OO approach to coding the vnode interface was used as the basis of layered file systems in the 1980s.




Author: Mark A. Sheldon
Last Modified: 28 March 2007