CMPSC 311, Introduction to Systems Programming, Spring 2013

Time and Place


Course Home Page

Course Description

Textbooks, both required this semester

Textbooks, both required in previous semesters

Textbook, recommended but optional
Course Goals

System Programming concerns the development of software components and methods for their combination, independent of any particular application.  This course will provide information and experience required to understand, design and implement components of large software systems.

In general, students should be able to evaluate design alternatives according to standard practice, specifications, performance analysis, robustness, etc.  To concentrate attention, we investigate one system and one programming language in detail, through demonstration programs, and short- and long-term programming assignments.  The specific system is Unix, a family of operating systems forming a complete standardized programming environment based on the idea of software tools.  The specific language is C, which is widely used for operating system implementations, and which forms the basis for the C++ and Java languages studied in the prerequisite courses.  This will help students understand operating system services available to application programmers, and provide a firm ground for study of operating systems in general.

What can you expect to learn from the programming projects?  Start early and work effectively, ask questions promptly, know how and where to find answers, and generally how to extend your knowledge and skills.  As always, programming should clarify your thinking.

There are several themes of the course:

(1) Understand computer systems, especially low-level influences on high-level goals.  This includes the machine-level representation of programs and data structures; the memory hierarchy and its impact on performance; access to stored information via file systems, and access to other computer systems via networks.

(2) Understand existing system software and software standards, especially the Unix toolset.  This includes preparing a program (editors, development environments, static analysis); running a program (compilers and interpreters, assembler, linker, loader, debugger, profiler, tracer, dynamic analysis); controlling parts of a program (memory management, threads); communication between programs (within one system using signals, between systems using sockets and communication protocols); and combinations of software tools with scripting languages.

(3) Understand "real code", such as selections from the Linux operating system kernel and GNU utilities and libraries, and through comparative selections from OpenSolaris, GNU/Linux, and Mac OS X.

(4) Understand system performance, including experiments on program performance and optimization techniques.

Course Expectations

You must have completed and passed (with a grade of C or better) the prerequisite course CMPSC 221, Object Oriented Programming with Web-Based Applications, which uses Java.  You must have completed and passed (C or better) the earlier courses CMPSC 121 and 122, which use C++.  If, instead, you have completed and passed similar courses elsewhere, contact the instructor.  Prior experience with Unix or C is not expected, but you should know C++ very well, and be familiar with an integrated development environment such as Microsoft's Visual Studio.

You should take CMPEN 331, Computer Organization and Design, at the same time as this course, or within one semester of it.  The connection between these courses would be stronger if we could require you to take both at the same time, but that's not possible.  In 331, you learn about the basics of memory organization (registers, cache, main memory, virtual memory), instruction execution, exceptions and interrupts, and the translation of procedural programming languages into machine instructions.

This is a three-credit course, and you can expect to spend a lot of time outside of class with reading and programming.  To avoid turning the outside programming into a nightmare of unsuccessful debugging, you should recognize symptoms of confusion early, and promptly ask for help from the instructor or TA.

We will often give you some code as examples or as a starter kit for an assignment, and use of that material is encouraged.  After that point, the programming work should be done on your own, but you can certainly consult with classmates on general issues.  For example, in some cases it's allowed to ask another student for help (how do I use the editor?) and in other cases it's not (how do I write this program?).  If someone has been especially helpful to you, please make a note of that when you turn in an assignment.  But, do not let this go too far.  Do not let anyone else write your programs for you, and do not give your program to anyone except the instructor and TA.

The two books required for this course are excellent introductions to C and Unix system programming, but they won't be your only references.  The optional book is an excellent introduction to the use of Unix.  We hope that you will turn to these books first as a source of information and examples, and we will supplement them with extensive notes, frequent class discussions, and occasional out-of-class help sessions.  There are many on-line sources of information, and we will indicate some good ones.  In general, though, Google search is a real time sink, and we do not recommend its use as a programming manual.  There's a lot of bad stuff out there, and if you have trouble distinguishing good advice from bad, then stick with the recommended sources. 

Followup Courses

CMPSC 311 and CMPEN 331 are the prerequisite courses for CMPSC 473, Operating Systems Design & Construction.  In that course you will be expected to be thoroughly familiar with Unix and C, so that the programming projects are feasible.  In particular, you should retain the textbooks for this course for use during CMPSC 473.

We will discuss some material that will be covered in a more general or more detailed way in other courses, such as

Computer Systems and Assignments

The assignments for the course, and most of the examples, will use the Linux workstations and servers in the CSE Dept. student labs.  Additional examples will use Solaris from Sun Microsystems Oracle, and Apple's Mac OS X.

You do not need your own computer to succeed in this course, but you do need easy access to a computer.  We will provide instructions for accessing the CSE systems locally in the CSE student labs, remotely from the PSU student labs, and remotely from your own system.

Be sure to protect your files from accidental destruction by yourself or inspection by other students.  The PSU and CSE systems have regular backup procedures, so if you lose a file it might be possible to recover it, but you will need to get someone else's help with that, and it will take some time.

Most assignments will be submitted electronically via PSU's ANGEL system, and there will be specific instructions on how to do this with each assignment.  It is important that you follow these instructions carefully, because the assignments will be graded (in large part) by compiling and running the programs without human intervention.  If your program fails to compile correctly, or if the code has not been packaged according to expectations, then it will not receive a grade.

We will grade your programs by reading the source code, compiling the program, running the program, and comparing the actual results to the intended results.  There will often be a description of the test procedure, and some examples to try, but you can expect that the grading runs will try more cases than the suggested samples.  It is absolutely essential to follow the instructions about building and turning in your program, since most of the testing will be automated and not especially sophisticated, flexible or generous.  Programs which generate compile-time warnings will receive a lower grade.  Programs which generate compile-time errors will receive a much lower grade.  Programs which do not run "as expected" will receive a lower grade, depending on the test criteria.  Programs should have useful comments, but don't go overboard on the comments out of fear for your grade; we might simply call you in for a chat to explain what you did.  Most importantly, your programs should be correct, and obviously correct.

The policy on late assignments will described as part of each assignment; some will be more lenient than others.

The policy on cheating is simple.  Don't do it, and then we won't have to flunk you for cheating.

Do your own work, and you will get more from your courses than just a grade.


6 small projects (about 1 week each)
2 large projects (about 2 weeks each)
Midterm exam 1  (Tuesday, Feb. 12, 6:30 - 7:45 pm, 112 Kern Bldg.)
Midterm exam 2  (Wednesday, Mar. 27, 6:30 - 7:45 pm, 110 Wartik, 111 Wartik)
Final exam  (Apr. 29 - May 3, time and place to be announced)

Some Simple Advice

And finally ...

Get up and move once in a while.  Here is part of an actual job description for a Software Engineer, under the heading Qualifications.

Last revised, 9 Jan. 2013