Systems Programming

Instructor: Prof. Sibin Mohan, The George Washington University

CSCI 2410 | Fall 2023 | TR 02:20 -- 03:35PM ET | SEH 1300/1400/1450

This course will focus on teaching the fundamentals of systems programming, using C.

A Sample Hello World Program in C

On completion of this class, students will,

Fundamentally, students will understand that processes are manipulable data, that processes control and manage other processes, and that applications are composed out of libraries and processes.

Structure - This class is broken into two main activities: lectures and labs:

In addition,

Prerequisites: None.

Assignments for this class will be done in C.


Course Staff

Course Details

[* Note: Please message ahead of time and set up alternate slot in case of conflicts for office hours.] Note: Make sure that you're properly preparing and presenting yourself at office hours!

Communication

We will use Discord for all course-related communications. Blackboard will be used for official announcements (duplicated on Discord as well) and for grade entry.

Target Audience

Undergraduate students who wish to learn about the design and development of systems as well as the C programming language.

Covid

This class will run in accordance to GWU's policies around Covid. Please attend to your regular tests, the mask requirements, and actions should you be exposed or symptomatic.

If you suspect you have been exposed to someone with Covid, or are feeling sick yourself, please let me know and I will provide a Zoom link for you to attend remotely. And get some rest!

Grading Criteria

Tests and Quizzes 50 %
Homework Assignments ** 40 %
In-class participation ++ 10 %

** Important Note about Homework Grading:
1. We use automated grading scripts. If your code does not pass these scripts, then you will be penalized accordingly.
2. After a homework submission deadline has passed, we will randomly select a group of students who must show up at TA office hours within 7 days and answer oral questions about their submission. If any selected student either (a) fails to show up or (b) cannot answer the oral questions satisfactorily, then they will receive a failing grade for that assignment if that is the first such failure! Any subsequent failures of the oral exam will result in the student being reported for academinc integrity violations. This is regardless of their score from the grading scripts.

Note: ONLY talk about your grade with Prof. Sibin Mohan. None of the other instructional staff have access to grades or the ability to modify them.

In Class Participation

++ We encourage you to ask questions and ask often. Participate in discussions as well. Take notes since that helps with the learning.

Course Materials

Required reading.

You must read through the material at the repo for class resources.

This includes some intuition as to how to develop C, how to think about debugging and testing, and how to think about generating good code.

Lecture material

Lectures for the class are code-heavy. You might find the source for the lectures (or a pdf of the material) useful.

Textbook and Other Resources

The required text book is Computer Systems: A Programmer's Perspective, by Randal E. Bryant and David R. O'Hallaron.

Though other editions should be OK, we'll reference chapters in the 3rd edition.

Optional, but strongly encouraged resources:

A few additional resources:


Schedule

Week Date Topic Links
1 Aug 24, 2023
Intro, course syllabus, policies.
2 Aug. 28, 2023
Homework 0 assigned.
Due Date: Sept. 01, 2023 [6:00 PM ET]
Aug 29, 2023
Basics of computer organization.
Aug 31, 2023
Memory.
3 Sept. 04, 2023
Homework 0.5 assigned.
Due Date: Sept. 15, 2023 [6:00 PM ET]
Sep 5, 2023
C basics, types, includes.
Sep 7, 2023
Pointers in C, const.
4 Sep 12, 2023
Arrays and pointers, malloc, free.
Sep 12, 2023
Memory layout for pointers, arrays.
5 Sept. 18, 2023
Homework 1 assigned.
Due Date: Sept. 29, 2023 [6:00 PM ET]
Sep 19, 2023
C scoping Rules.
Sep 21, 2023
C scoping Rules [contd.] (file scope).
Pointer arithmetic for array access (in-cass exercise).
6 Sep 26, 2023
Memory Allocation.
Some pointer magic
(casting, memory access).
Sep 28, 2023
Pointers and Casting.
7 Oct. 02, 2023
Homework 2 assigned.
Due Date: Oct. 18, 2023 [6:00 PM ET]
Note: early credit date: Friday, Oct. 13 [6:00 PM].

Extra Credit due: Oct. 27, 2023 [6:00 PM ET]
Oct. 03, 2023
Function Pointers.
Oct. 05, 2023
Function Pointers contd.
(in-class exercise:
generic insertion sort for struct map).
8 Oct. 10, 2023
Pointer lifetime management.
Stacks and heaps.
(in-class exercise: direction of stack growth).
Oct. 12, 2023
Fall Break. No Class.
9 Oct. 17, 2023
API Design.
Error Handling.
(in-class exercise: print all error codes in sequence).
Oct. 19, 2023
Processes and intro to fork().
10 Oct. 24, 2023
Homework 3 assigned.
Due Dates:
  1. M0 due: Nov. 03, 2023 [6:00 PM ET]
  2. M1 due: Nov. 17, 2023 [6:00 PM ET]
  3. M2 due: Nov. 29, 2023 [6:00 PM ET]
  4. M3 due: Dec. 08, 2023 [6:00 PM ET]
  5. Extra Credit due: Dec. 08, 2023 [6:00 PM ET]
Oct. 24, 2023
Processes [contd.]:

wait() and exit().
Oct. 26, 2023
Processes [contd.]:
(in-class exercise: forkonacci).
11 Oct. 31, 2023
Executing Other Processes:

exec().
Nov. 02, 2023
Process Descriptors
12 Nov. 07, 2023
Communication between Processes | pipes.
Nov. 09, 2023
Communication between Processes | pipes.
(in-class exercise: communication between
children using pipes)
13 Nov. 14, 2023
Signals.
Nov. 14, 2023
Signals [contd.] | The Dark Side.

Slow and reentrant code.
14 Nov. 21, 2023
Fall Break. No Class.
Nov. 23, 2023
Fall Break. No Class.
15 Nov. 28, 2023
Files and Files Handling.
Nov. 30, 2023
Files | Other Access Mechanisms.

Memory Mapping (mmap),
Streams and Directories.
16 Dec. 05, 2023
Inter-Process Communication (IPC).

Sockets.
Dec. 07, 2023
Inter-Process Communication (IPC) [contd.].

Sockets [contd.].
(in-class exercise: haikus.txt file
handling using Streams.)

Policies

Expectations and Responsibilites

Each semester, you're expected to spend at least:

Student Responsibilites: Students must,

We will work with you to come up with a plan to be successful in the class.

We also need your feedback for parts of the class that aren't working for you. We do our best in running the class, but certainly make mistakes, or overlook different aspects. Class evaluations are of limited use since they only are given at the end of the class. Please provide feedback using the linked feedback form on Piazza.

Professor and Instructional Staff Responsibilities

You should depend on the instructional staff (including Sibin) for the class to:

These can be remembered as "we're here to make it clear what you should do, what you should know, and what to do if you don't feel like you know what you're supposed to do or know".

If at any point, you have concerns about any of these, of if we're dropping the ball on any of them, please let us know and we'll do better.

There are trade-offs made in the class (for example, homeworks are not formally specified as I don't want them to be 50 pages each), but you always encouraged to ask questions and clarify.

Further, it is our intent that students from all diverse backgrounds and perspectives be well-served by this course, that students’ learning needs be addressed both in and out of class, and that the diversity that the students bring to this class be viewed as a resource, strength and benefit.

It is our intent to present materials and activities that are respectful of: gender identity, sexuality, disability, age, socioeconomic status, ethnicity, race, nationality, religion, and culture.

Your suggestions are encouraged and appreciated. Please let us know ways to improve the effectiveness of the course for you personally, or for other students or student groups.

Late Policies

Submission/due dates are announced along with the Homeworks descriptions.

The late policy for this class is strict. This is for two reasons:

As such, the only acceptable excuses for late submissions are medical and family issues. I will strongly encourage you to use your module that will be counted as extra-credit if you miss a deadline so that you don't fall behind on the coming deadlines.

Generally unacceptable excuses include:

You get 0 credit for late work that is unexcused.

Homeworks are due every week or every other week, so it is very harmful to get behind on them, or to add more work to your schedule. Thus, our late policy is quite strict to discourage procrastination.

Please note that in terms of academic honesty, you cannot share your code with your peers even after it is due.
Resubmissions

However, once the grades are released, you can resubmit your code within seven days, rounded up to the closest midnight.

For example, if the grades are released at 2:30pm on the 8th, resubmissions are due at midnight on the 15th (i.e. $8 + 7 = 15$).

You will get 0 credit for submissions after this date.

We will grade the last commit before the resubmission deadline, and you will receive 50% of the credit on top of the original grade, rounded up to the nearest percent.

For example, if you got a 43% on the initial deadline, and resubmit and get a 68%, your final grade ($g$) will be $g = \lceil 43 + \frac{(68 - 43)}{2} \rceil = 56$.

Do not come to rely on the resubmission process.

Testing your implementation

You are required to test your own code. Our tests will attempt to test every edge case in the implementation. If you do not write code to test the edge-cases of the specifications, then you will lose credit. This is the largest reason why students get lower grades than they believe they deserve.

If you believe that an error was made in grading, then please explicitly address why you believe your test cases are sufficient to test all cases. See the discussion about testing and debugging below.

Style and Code Craftsmanship

You must adhere to the class style spelled out in the lecture notes.

It is very important that you not only get your code working, but view your work as fine code craftspersonship.

If you want to understand a more complete set of style guidelines, see the Composite Style.

Collaboration and the Honor Code

You are encouraged to work together. You may discuss the homeworks with other people to understand the problem and reach a solution. However, each student/group must write down the solution independently, without referring to written notes from others. Hence, you must understand the solution well enough to discuss it yourself. In addition, each student/group must explicitly mention the names of the people with whom they collaborated. If I suspect cheating, I might have the student(s) come and answer questions in my office. If my suspicions are confirmed, I will refer the student to the disciplinary committee.

The purpose of problem sets in this class is to help you think about the material, not just give us the right answers. You are encouraged to use online resources for learning more about the material covered in class; however, you should not look for or use found solutions to questions in the problem sets. Specifically, you must not look at any code that has been created to solve the assignment, including solutions found on the internet to questions in the problem sets, code created by a student in a previous class or code created by a current classmate. (Though frankly, I seriously doubt you'll find anything, I regularly change the assignments).

ChatGPT, Github CoPilot and Other Code Generation Tools

The use of ChatGPT, GitHub CoPilot and any/all other code generation tools (that currently exist or will be developed in the future) is expressly forbidden!

If any student is found using such tools then it will be considered a violation of academic integrity and reported appropriately.

Academic Integrity

Academic Integrity is an integral part of the educational process, and GW takes these matters very seriously. Violations of academic integrity occur when students fail to cite research sources properly, engage in unauthorized collaboration, falsify data, and in other ways outlined in the Code of Academic Integrity. Students accused of academic integrity violations should contact the Office of Academic Integrity to learn more about their rights and options in the process. Outcomes can range from failure of assignment to expulsion from the University, including a transcript notation. The Office of Academic Integrity maintains a permanent record of the violation.

Familiarize yourself with the standards set forth in the GWU Code of Student Conduct and specifically the University’s “Guide of Academic Integrity in Online Learning Environments". If there is any question about whether an act constitutes academic misconduct, it is your responsibility to seek clarification and approval from the instructor prior to acting. When in doubt, ask, or don't do it.

Contact information:

Absence Policy

If you miss a class, for whatever reason, you are still responsible for that class' material. Go through the lectures, consult the scribe notes, come to office hours (in that order), and talk to your fellow students, to learn the material.

Grade Review Policy

You have one week after a grade is released to ask me questions about it and seek a correction. After the week has passed, the grade is finalized.

In case you are seeking a correction to the grade, you need a specific reason: e.g., your implementation on HW1 was essentially correct but some errors in our test cases resulted in a lower grade. We will not accommodate general requests that are a variation on "I think my grade was too low". Why do you think that? Based on our discussion, I might increase the grade, decrease it, or leave it as is.

Of course, you can stop by anytime during the term to ask questions about any part of the material. The one-week deadline applies to grade-specific questions.

Use of Electronic Course Materials and Class Recordings

Students are encouraged to use electronic course materials, including recorded class sessions, for private personal use in connection with their academic program of study. Electronic course materials and recorded class sessions must not be shared and must not be used for non-course related purposes unless express permission has been granted by the instructor. Students who impermissibly share any electronic course materials are subject to discipline under the Student Code of Conduct. Please contact the instructor if you have questions regarding what constitutes permissible or impermissible use of electronic course materials and/or recorded class sessions. Please contact Disability Support Services if you have questions or need assistance in accessing electronic course materials.

Academic support

Writing Center

GW’s Writing Center cultivates confident writers in the University community by facilitating collaborative, critical, and inclusive conversations at all stages of the writing process. Working alongside peer mentors, writers develop strategies to write independently in academic and public settings.  Appointments can be booked online at: gwu.mywconline.

Academic Commons

Academic Commons provides tutoring and other academic support resources to students in many courses. Students can schedule virtual one-on-one appointments or attend virtual drop-in sessions. Students may schedule an appointment, review the tutoring schedule, access other academic support resources, or obtain assistance at academiccommons.gwu.ed.

COVID-Related Topics

The university's COVID-19 Safety and Success website serves as the primary communication channel for the GWU regarding COVID-19 logistics and classroom guidelines.

Face Coverings

The university has a requirement to use a face covering when in indoor spaces in order to contribute to the health and safety of the GWU community during the ongoing COVID-19 pandemic. Accordingly, you are expected to use a face covering when attending class, including when you speak. I will do the same.

Acceptable face coverings include:

If you don't have your own, face coverings are available at various campus locations.

Requests for exemption from wearing a face covering in indoor spaces require prior approval. Please follow this link for more information.

Students with Disabiities [202-994-8250]

Accommodations for students with disabilities are determined and approved by Disability Support Services(DSS). If you, as a student, feel that you need accommodations but have not obtained approval please contact DSS immediately at 202-994-8250 or at https://disabilitysupport.gwu.edu. DSS notifies students and faculty members of approved academic accommodations and coordinates implementation of those accommodations. While not required, students and faculty members are encouraged to discuss details of the implementation of individual accommodations.

Ethical and Respectful Behavior

We expect all students to act in an respectful and ethical way, both with respect to the treatment of their peers in the classroom during discussion but also in the design and execution of their course projects. Actions should meet the expectations of ethical research and follow the norms and proper behavior of the George Washington University community. We strive for an inclusive classroom, which includes but is not limited to anti-racism, anti-sexism, accessibility, LGBTQ+ inclusivity. If you feel like you are unable to use inclusive language and behave in a non-discriminatory way, please drop the class.

University policy on observance of religious holidays

In accordance with University policy, students should notify faculty during the first week of the semester of their intention to be absent from class on their day(s) of religious observance. For details and policy, see “Religious Holidays”.

Reach Out for Success/Wellness

University students encounter setbacks from time to time. If you encounter difficulties and need assistance, it's important to reach out. Consider discussing the situation with an instructor or academic advisor. Learn about resources that assist with wellness and academic success at Health and Wellness Center. If you or someone you know are in immediate crisis, please contact one of the following resources immediately:

Safety and Security