|

|
CS 241 Fall 2009
System Programming
|
|
|
11-11:50am MWF
1404
Siebel Center
for Computer Science
|
|
|
|
Course Syllabus
Staff:
Marco Caccamo (Instructor)
Office: 4118 SC
Tel: (217) 244-0528
TAs: Wade Fagen, Liping Chen, Farhana Ashraf, and Chi-Yao Hong
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. Identify and
apply principles of queueing theory to evaluate system performance.
16. Describe the
concepts of I/O devices, files, directories.
17. Explain the
internal implementation of files systems and operating system I/O.
18. Write, compile,
debug, and execute C programs that use files and I/O on UNIX.
19. 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.
20. Write, compile,
debug, and execute C programs that make use of memory management functions.
21. Explain the
concept of DMA.
22. Describe the
protocols (such as TCP and IP) and interfaces (such as sockets) used for
communication among different computers.
23. Write distributed
applications that communicate across a network.
Grading:
Final Exam: 35%
Mid-term Exam: 25%
Homework (two total): 10%
Team Machine Problems (eight total): (3% * 6 one-week MPs) +
(6% * 2 two-week MPs) = 30%
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 in groups. There will be
two homework assignments. The homework assignments will be done individualNote 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 in groups of two students.
There will be two homework assignments. The homework assignments will be done
individually by each student. Please use the TSG Linux machines. To access
these machines from outside the university, please use CITES VPN client.
Cheating is taken very seriously in CS 241. Be sure to
understand the departmenal policy on cheating at
https://agora.cs.illinois.edu/display/undergradProg/Honor+Code
Prerequisites
11:00-11:50am 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.l be
multiple discussion sessions. You should sign up for one of the discussion
sessions using Compass 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 the 'csil-core1 - csil-core25
machines since our auto-grader program will check your MP submissions on these
machines.
TSG runsCSIL
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 the csil-linux-ts1.cs.uiuc.edu or
csil-linux-ts2.cs.uiuc.edu machines 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 csil-linux-ts machien before submitting your assignment.
TSG runs the CSIL labs, you can find out more details here:
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).