Systems Programming

Instructor: Prof. Sibin Mohan, The George Washington University

CSCI 2410 | Fall 2024 | 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, Quizzes, In-class Exercises 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 22, 2024
  • Intro to Labs
    [basics of compilation, ssh, etc.]
2 Aug 27, 2024
  • Intro, course syllabus, policies.
Aug 29, 2024
  • Basics of computer organization.
  • Computer Organization Slides
3 Sep. 03, 2023
  • Memory

  • Intro to C Basics.
Sept. 03, 2024
Homework 0 assigned.
Due Date: Sept. 05, 2024 [6:00 PM ET]
Sept. 03, 2024
Homework 0.5 assigned.

Due Dates:
  1. M0 due: Sept. 09, 2024 [6:00 PM ET]
  2. M1 due: Sept. 13, 2024 [6:00 PM ET]
Sep. 05, 2024
  • Intro to C Basics [contd.].
4 Sep 10, 2024
  • Pointers in C.
Sep 12, 2024
  • Pointers (contd.)
    • Modifiers
    • Memory Allocation
5 Sept. 17, 2024
Homework 1 assigned.
Due Date: Sept. 30, 2024 [6:00 PM ET]
Sept. 27, 2024 [6:00 PM ET]
Sep 17, 2024
  • Pointers (contd.)
    • Memory Allocation (contd.)
    • Arrays
Sep 19, 2024
  • Pointers | Arrays
  • In-class Exercise I:
    sorting and double pointers
6 Sep 24, 2024
  • Pointers | Memory Layouts
  • Interfaces
Sep 26, 2024
  • Interfaces (contd.)
  • Pointers | Casting
7 Oct 01, 2024
  • Pointers | Casting (contd.)
  • C Scoping Rules
  • In-Class Exercise II:
    pointer casting.
Oct. 02, 2024
Homework 2 assigned.
Due Date: Oct. 16, 2024 [6:00 PM ET]
Oct 03, 2024
  • C Scoping Rules (contd.)
8 Oct 08, 2024
  • Function Pointers
Oct. 10, 2024
Fall Break. No Class.
9 Oct 15, 2024
  • Function Pointers (contd.)
  • In-Class Exercise III:
    generic insertion sort.
Oct 17, 2024
  • Pointers | Lifetimes
  • Stacks and Heaps
  • In-Class Exercise (informal):
    stack growth.
Oct. 18, 2024
Homework 3 assigned.

Due Dates:
  1. M0 due: Oct. 25, 2024 [6:00 PM ET]
  2. M1 due: Nov. 08, 2024 [6:00 PM ET]
  3. M2 due: Dec. 06, 2024 [6:00 PM ET]
  4. M3 due: Dec. 06, 2024 [6:00 PM ET]
  5. EC due: Dec. 06, 2024 [6:00 PM ET]
10 Oct. 22, 2024
  • API Design.
  • Error Handling.
  • In-Class Exercise (informal):
    print all error strings.
Oct. 24, 2024
  • Processes | fork().
11 Oct. 29, 2024
  • Processes
    • wait()
    • exit()
11 Oct. 31, 2024
  • Processes | exit() (contd.)
  • In-Class Exercise IV:
    forkonacci.
12 Nov. 05, 2024
Election Day. No Class.
Nov. 07, 2024
  • Executing other Processes | execve()
13 Nov. 12, 2024
  • Processes | Descriptors
Nov. 14, 2024
  • Communication between Processes | Pipes
14 Nov. 19, 2024
  • Pipes [contd.]
  • In-Class Exercise V:
    chatGPT and forkonacci.
Nov. 21, 2024
  • Signals
15 Nov. 26, 2024
Thanksgiving Break. No Class.
Nov. 28, 2024
Thanksgiving Break. No Class.
16 Dec. 03, 2024
  • Signals | The Dark Side
  • Files
Dec. 05, 2024
  • Files | Other Mechanisms
    • mmap()
    • streams
17 Dec. 10, 2024
  • Inter-process Comunication (IPC)
    • sockets

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 (or other exceptions like sports/athletics but need confirmation from your coach/atheletic departments).

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).

Note: We will regularly run a code analysis tool that will check for similarity among, (a) all submissions in current class and (b) submissions from previous years. If we find any similarities (the tool is very comprehensive) then you will be reported for academic integrity violations and face the additional consequences mentioned below.

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. In addition, there will be additional consequences (see below).

Consequences for Violating any of the Above Policies

If we find violations of academic integrity (cheating, sharing code, use of unauthorized tools as mentioned above or additional violations as decided by the teaching staff), then the following actions will be taken:
  1. if this is the first violation in this class, your grade for the entire assignment (all parts) will be set to zero
  2. if a second violation is detected, your grade for the course will be set to F.
  3. you will be reported to the academic integrity office in all cases.

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