CS 241: System Programming

Fall 2011

MWF
11:00am-11:50am

1404 Siebel Center

 

Home

Schedule and Lectures

 

Course Syllabus

Staff

Robin Kravets (Instructor)

Office: 3114 SC

Office Hours:

 

Matt Caesar (Instructor)

Office: 3118 SC

Office Hours:

 

TAs: Wade Fagen, Matt Trower, Farhana Ashraf

Contact: For all technical and class related questions, go to Piazza:
http://www.piazza.com/illinois/cs241

For personal questions only, email questions to: cs241help-fa11@cs.uiuc.edu  

Textbook

Introduction to Systems Concepts and Systems Programming

University of Illinois Custom Edition

Taken from:

Operating Systems: Internals and Design Principles, Fifth Edition

by William Stallings

UNIX™ Systems Programming: Communication, Concurrency, and Threads

by Kay A. Robbins and Steven Robbins

Computer Systems: A Programmer's Perspective

by Randal E. Bryant and David R. O'Hallaron

Copyright © 2007 by Pearson Custom Publishing

ISBN 0-536-48928-9

Description

A computer needs an operating system to manage its resources and provide support for common functions such as accessing peripherals. There are two categories of “customers” that an operating system must support. The first category is the community of users. We have all used computers and you may recognize operating systems functions such as creating folders (directories) and moving files around. These are examples of operating system support for users. User support is not the objective of this course. This course addresses operating system support for the second category of customers; namely, the programmers. Those are people who write code to execute on the computer. When you write a program, it may have to interact with physical hardware (keyboard, screen, mouse, printers, hard disk, or network. For example, you may want to get input from a keyboard or mouse, you may want to read some configuration file stored on disk, you may want to output data to a screen or printer, or you may want to access a remote server across a network. The operating system presents common interfaces for programmers to perform these functions. The operating system also provides useful abstractions such as “tasks” (also called processes) “threads”, and “semaphores”. You can make the computer multitask by calling the operating system interface for creating new tasks or new threads. You can make these tasks coordinate and synchronize by using operating system semaphores. You can tell the computer the order in which you want tasks to be executed, which is called a scheduling policy. Finally, you can manage computer memory by calling the operating system function for memory management. System programming refers to writing code that tasks advantage of operating system support for programmers. This course is designed to introduce you to system programming.

By the end of this course, you should be proficient at writing programs that take full advantage of operating system support. To be concrete, we need to fix an operating system and we need to choose a programming language for writing programs. We chose the C language running on a Linux/UNIX operating system (which implements the POSIX standard). The C over UNIX/Linux is a very common combination used heavily by software that must provide high performance. It is much faster, for example, tha Java or C++ over Windows. Hence, this course introduces you to systems programming via the specific case of C over UNIX. By the end of the course you should be proficient with this programming environment and should be able to write non-trivial pieces of software from web server code to your own multiplayer Internet games. More specifically, after taking this course you should be able to accomplish the following:

  1. Identify the basic components of an operating system, describe their purpose, and explain how they function.
  2. Write, compile, debug, and execute C programs that correctly use system interfaces provided by UNIX (or a UNIX-like operating system).
  3. List UNIX system calls, and invoke them correctly from within C programs.
  4. Describe the difference between programs, processes, and threads.
  5. Explain the meaning and purpose of process control blocks and other mechanisms that the operating system uses to implement the process and thread abstractions.
  6. Write, compile, debug, and execute C programs that create, manage and terminate processes and threads on UNIX.
  7. Define concurrency and explain the problems that may arise because of concurrent execution of multiple processes or threads. Explain how these problems can be avoided. Write code that avoids these problems.
  8. Define semaphores, mutexes, and other synchronization primitives, explain their purpose, and describe their internal implementation.
  9. Describe possible problems that arise from improper use of synchronization primitives (such as deadlocks) and present their solutions.
  10. Write, compile, debug, and execute C programs that use UNIX synchronization primitives.
  11. Describe operating system scheduling and use UNIX interfaces to set and modify scheduling policy parameters.
  12. Define UNIX signals and signal handlers, and describe their use.
  13. Write, compile, debug, and execute C programs with processes and threads that interact by invoking and catching signals.
  14. Describe, configure, and use operating system timers and clocks.
  15. Describe the concepts of I/O devices, files, directories.
  16. Explain the internal implementation of files systems and operating system I/O.
  17. Write, compile, debug, and execute C programs that use files and I/O on UNIX.
  18. Describe the machine memory hierarchy, describe its components such as caches and virtual memory, and explain memory management mechanisms pertaining to these components such as paging and segmentation.
  19. Write, compile, debug, and execute C programs that make use of memory management functions.
  20. Explain the concept of DMA.
  21. Describe the protocols (such as TCP and IP) and interfaces (such as sockets) used for communication among different computers.
  22. Write distributed applications that communicate across a network.

Grading

Further details on grading policy

Late Policies:

Cheating

Cheating is taken very seriously in CS 241. Be sure to understand the departmental policy on cheating.  Your work in this class must be your own. If students are found to have collaborated excessively or to have blatantly cheated (e.g., by copying or sharing answers during an examination or sharing code for the project), all involved will at a minimum receive grades of 0 for the first infraction and reported to the academic office. Further infractions will result in failure in the course and/or recommendation for dismissal from the university.

Note on Machine Problems and Homework Assignments

The programming assignments in this class will be based on Posix Programming Interface. We will have eight machine problems with different difficulty degrees. The MP assignments will be done solo. There will be two to three homework assignments. The homework assignments will be done individually by each student. Please use the EWS 64-bit Linux machines.  To access these machines from outside the university, please use CITES VPN client.

Prerequisites

CS 225, CS 231 and credit or concurrent registration in CS232 are the prerequisites for CS 241.

Lectures

11-11:50 am Monday, Wednesday and Friday in Room 1404 SC. Lectures cover important operating system concepts, and their implementation. It is the students' responsibility to read the textbooks and related materials. You are expected to attend lectures, and will be responsible for announcements made during lecture, on the cs241 web page, and on the newsgroup, class.fa11.cs241 and class.sfa11.cs241.announce.

Discussion Sections

There will be multiple discussion sessions. You should sign up for one of the discussion sessions using Banner as soon as possible.

Laboratory Facilities from CSIL

We will be using linux machines, running POSIX system programming interface, in labs in 1245 DCL, 1265 and 1275 DCL and in 0216 SC (basement). You should make sure that you have accounts on the CSIL machines to do your machine problem assignments. We recommend that you use a 64-bit EWS machine since our auto-grader program will check your MP submissions on these machines.  These machiens have partiular features enabled to aid in debugging your program, but these same features may result in buggy code running differently on the CSIL machines than other machiens (such as EWS or even SC lab machines).  Always check your program on a 64-bit EWS machien before submitting your assignment.

If you register late or otherwise have problems relating to the existence of your account, send email to userhelp@cs.uiuc.edu.

Other Reading

1.      Operating Systems: Internals and Design Principles, Fifth Edition by William Stallings, Prentice Hall ISBN 0-13-147954-7.
OS Book Resource Web Site (Animations, Pseudocode, pdfs, UNIX, Windows, Bibliography, Standards)
Student Resource Web Site (Help for students - maths, coding, writing aids, good practices)

2.      UNIX SYSTEMS Programming: Communication, Concurrency and Threads by Kay A. Robbins and Steven Robbins, Prentice Hall ISBN 0-13-042411-0
Programming Resource Web Site

Often, the inquisitive student will need to broaden their knowledge about Operating Systems.  The following texts are interesting and relevant.

Modern Operating Systems (Second Edition), Andrew S. Tanenbaum, Prentice Hall, 2001
Applied Operating System Concepts, Silberschatz, Galvin, Gagne, 1th Edition, John Wiley&Sons, Inc., 2000
Operating System Concepts, 5th Edition, Silberschatz and Galvin
The Design of the Unix O.S., Maurice J. Bach.
The UNIX System, S. R. Bourne.
The Mythical Man Month, F. Brooks.
Operating System Design, D. Comer, T. Fossum.
Internetworking with TCP/IP, Doug Comer.
An Introduction to Operating Systems, Harvey M. Deitel.
Operating Systems: Design and Implementation, Andrew S. Tanenbaum.
The Logical Design of Operating Systems, Alan Shaw.
Operating Systems, Internals and Design Principles, William Stalling.(3rd Edition).

 

Updated:August 18, 2011