System Programming 

Course Number: 902 44000

Instructor:
Session: 01
Prof. Tei-Wei Kuo

Class Hour: Tuesday 9:10AM to 12:10PM
Lecture Room: 104 CSIE Building

Office Hour: Thursday 10:00AM to 11:00AM
Office: Room 315 CSIE Building

Session: 02
Prof. Chi-Sheng Shih
Class Hour: Tuesday 9:10AM~12:10PM
Lecture Room: 102 CSIE Building

Office Hour: Friday 11:00AM~12:00PM
Office: Room 523 CSIE Building

TAs: Nei-Chiung Perng and Pi-Cheng Hsiu
Office Hour 1: Monday 12:00AM~13:10PM
Office Hour 2: Monday 17:00PM~18:00PM
Office: Room 438 CSIE Building

Programming Assignment Submission Web Site:
Assignments Submission Website

Announcement:

July 13th, 2005:
For those students who got grades 69 and 79, your final grades might be adjusted to 70 and 80 if you handed in the bonus homework.

July 8th, 2005:
You may check the SP2005 Grades to verify your grades. Both midterm and final count 35% of your grade, and the four programming assignments in total count 30% of your grade. We have an adjustment formula "Final = round(((Total+18)/111)*78+20)" to adjust your grade. In addition, your "Final grade" is adjusted to 60 if your "Final grade" is between 55 and 59 and you handed in the bonus.

If you have any mistaken records, please come to TAs before 7/11 (Monday). The grades will be submitted on 7/12 (Tuesday).

July 4th, 2005:
If you would like to check your grades, please come to TAs before 7/8 (Friday). The grades will be submitted on 7/12 (Tuesday).

July 3th, 2005:
You may check the Final Answer Sheet to verify your grades. If you have any different comments about your grades, please come to TAs before July 8.

May 20th, 2005:
You might get whole 4 points for Question 7 in midterm if you write the return value is either "101th(100th)" or "201th(200th)" charater. Please come to the TA Nei-Chiung Perng at room 438 with your midterm sheet. See the details.

May 20th, 2005:
The file sample_output_2 for Assignment 3 is revised. Thank the student B92902106 to correct our mistakes.

May 13th, 2005:
You may check the Midterm Answer Sheet to verify your grades. If you have any different comments about your grades, please come to TAs at office hours.

April 25th, 2005:
The midterm will be held on April 26th at Room 101, 103, and 104 CSIE Building.

If your student ID is b929020xx, please come to
    Room 101 (for odd numbers of xx, e.g., b92902001) and
    Room 104 (for even numbers of xx, e.g., b92902002).
If your student ID is b929021xx or others, please come to Room 103.

April 18th, 2005:
Grades of MP1 have been announced. Please login submission site and check it. If you have any question, please come to TAs.

April 13th, 2005:
The deadline of MP2 has been postponed to April 15, 2005 @ 23:59 HRS.

April 12th, 2005:
The midter will be from 6:30PM to 9:30PM on 4/26 (Tuesday). Please come 10 minutes before the exam.

March 8th, 2005:
Your first programming assignment is out. Please check out the assignment handout in Assignments section. The assignment is due on March 21st, 2005.

March 1st, 2005:
If you need an account in the Workstation Lab (Rm 217, CSIE building), please stop by the lab and ask for the form. You would need the signature from your lecturer to open an account. All your programming assignments will be asked to be done using the compiler and setting environment in Rm 217. It is recommended to use the workstation lab to work on your programming assignment.

March 1st, 2005:
If you like to use your browser to read the example code as we did in the class, you can download the script files and HTML files here. Please let us know if you encounter any trouble.

February 28th, 2005:
The exercise given on the first lecture is due on March 8th. You can submit it via the submission website, or print it out on A4 papers and hand it to the TAs. The exercise will be a bonus for your final grade. Note that we will NOT take your exercise after March 8th. No late assignment this time.




Syllabus:

Download PDF-format syllabus

Course Description:

This course is designed for sophomore CS-major students and serves the introduction system-level course.

In this course, we will learn how to write the programs using system services in Unix-like systems. The following are the goals of this course.

1. To be familiar with the UNIX-like systems.

This means to know how to make use of the many tools that the system provides, its commands, library calls or system calls. This also means that you understand the model of computation that Unix presents.

2. To become good system programmers.

This means to know how to write a descent C program in Unix/Linux as the semester is over. However, this course should not limit you to write system programs in Unix/Linux. The learning process that you will have in this course should teach you how to program in any other operating systems which you may use later in your career.

At the end of the semester, you may want to go through this list again to see if the goals are met. I will appreciate if you can send me your comments regarding the class at the end of the semester. (Well, you can send me your comments at any time. However, I guess it is more valuable to review the class at the end of the semester.)

Prerequisites:

The students should be familiar with data structures and basic C/C++ programming.

Text Book:

There is one required text book: Advanced Programming in the Unix Environment by W. Richard Stevens, Addison-Wesley, 1993. It is distributed by 開發圖書有限 公司.

Other reference books:

Grading Criteria:

We will have one mid-term, one final, and five programming assignments. Since this is a programming course, I will give heavy weights to the programming assignments. Each written exam counts 35% of your final grade and the five programming assignments in total count 30% of your final grade.

Happy Programming!!

Policy:

Late Assignment: the programming assignments should be handed in via the provided web-based assignment submission system. All assignments must be handed in before 11:59PM at their corresponding due days. Because of the large class size, it is very likely that the assignment submission web site will be extremely busy at the last mininutes. You should not wait until the last minute to submit your assignments. It is your responsibility to make sure that your assignments are handed in before the deadline. The TAs will not accept the assignments via emails or any other means. Check out the submission web site to see how to make sure your assignments are submitted successfully. So, do it as early as possible.

Only the assignments submitted before the deadline will receive full credit. 5% of your grade will be deducted for single day delay.

Plagiarism: There is NO tolerance for plagiarism. (As an engineer, you should check out IEEE's code of ethics.) You can discuss the assignments with your classmates and/or friends. However, you MUST write the codes by yourself. It is YOUR responsibility to protect your own codes so that please don't leave your codes on the table or screen.

Schedule:

The schedule is tentative and subjected to change. However, any change will be annouced in the class and the announcement section.

The lecture slides and handouts will be available on the class web site. Please check out the slides and handouts before the class. The handouts will NOT be distributed in the class. The lecture slides should NOT be the only materials for you to study. They only serve as the guideline for you to study other materials including textbook and other online resources. It is very likely that you will fail the exam if you only study the lecture slides.

Week
Topic Lecture Notes Misc.
1
Syllabus and introduction
2
Introduction (Ch. 1) and Unix Standardization (Ch. 2)


3
File input and output (Ch. 3)

4
File input and output (Ch. 3) and Standard I/O Library (Ch. 5)


5
Standard I/O Library (Ch. 5) and Files and Directories (Ch. 4)


6
Files and Directories (Ch. 4)

7
Files and Directories (Ch. 4)

8
System Data Files and Information (Ch. 6) and Environment of a Unix Process (Ch. 7)

9
Mid-Term


10
Process Control (Ch. 8)

11
Process Control (Ch. 8)


12
Process Control (Ch. 8)


13
Process Relationships (Ch. 9) and Singnals (Ch. 10)


14
Signals (Ch. 10)


15
Signals (Ch. 10)


16
Signals (Ch. 10)


17
Interprocess Communication (Ch. 14)


18
Final Exam


*
TA Presentations:
1. OS Market Analysis
2. Linux Distribution
3. Introduction of Microsoft Windows Embedded

Programming Assignments:

Unless it is explicitly specified, all the assignemnts are individual assignments. Each student must submit his/her own assignments.

MP 1: ReverseIt.
Sample Input files: english, chinese, binary
Sample Output files: english, chinese, binary

MP 2: FindAndReplace.
Tar Checker: MP2Checker.sh

MP 3: Minishell.
Sample Files

MP 4: Message of the day.
Sample Files

MP 5:

Assignments Submission Website

NOTE: Please read the policy section first before you start to work on your programming assignments.

Other Resources:

Source code and Examples

Examples in the text book

GNU Makefile Tutorial

Writing Makefiles

Make - a tutorial

C Tutorial

Command line argument tutorials

C Programming Tutorial

printf tutorial

How to use the GCC Compiler tutorial.

GDB(GNU Debugger) tutorial

DDD: Data Display Debugger

Editor

VIM (Vi IMproved) Tutorial

Emacs

Using the joe Editor