Course-Info
This page has general information which is common to all offerings. Your instructor may publish additional details or adjustments for your course section.
Getting Extra Help
Some great ways to get extra help are:
- Lab
Please come to the labs to gain some practical experience with the course topics. This is the best place to start your journey of writing code to apply what is covered in lecture, and to prepare for writing assignments. - Piazza discussion forum
Check out classmate's questions and answers. Answer someone else's question, or ask your own. You can even post anonymously! Great for questions that everyone can check out. Also used for requesting regrading of assignments (see below). Link in sidebar.
Note: Piazza is hosted outside of Canada; it is not mandatory to use; you can sign-up under an expendable email account; emailing your instructor is always an option. - Discord Chat
If used by your instructor, use it to connect with classmates, instructor, and TAs using Discord. Channels are setup for talking to course staff, for asking questions, and for chatting with fellow students. Great for chatting and immediate help; not as good for someone seeing/answering later.
Note: Discord is hosted outside of Canada; it is not mandatory to use; you can sign-up under an expendable email account; emailing your instructor is always an option. - Office Hours
Both the instructor and TA have online office hours. Great for getting one-on-one help or discussing personal concerns. Also, seeing TAs in-person during lab times can be very effective. See your course section for details on how to connect for online office hours. - Peer Tutoring Drop in to CS Peer Tutoring available online or in-person. Get help from your fellow students who have already taken the course! They can help you identify and tackle your issues in the courses. Come early to stay ahead of the curve. See your tutors' office hours on the website (scroll down to Peer Tutoring)
- Email Good for private questions, but see your course section for your instructor's preference on how to contact them directly (email vs Discord vs ...). Please include course number email's subject line. See sidebar for emails.
About CMPT 201 - System Programming
CMPT 201 Systems Programming replaces part of an older course, CMPT 300 Operating Systems, for both CS and SoSy students. By taking this course, students will learn:
- User-level services and abstractions provided by operating systems, and
- How to write low-level programs that utilize those services and abstractions correctly, efficiently, and reliably, using Linux.
Although this course is known to be a challenging course, it is not designed for an advanced programmer. The training that this course aims to provide is to get students out of the beginning stage and move them to an early intermediate stage. Students have to make that jump at some point in their college career. This course forces students to make that jump, so they can advance much further with upper-level courses.
Prerequisites
- (CMPT 125 or CMPT 135) and MACM 101, all with a minimum grade of C-
- This course assumes that students thoroughly understand the intro programming materials and they do not struggle with them at all. This includes, but not limited to, basic programming constructs (e.g., loops, conditionals, functions/methods/modules, etc.) as well as basic data structures (e.g., linked lists, hashing and hash tables, etc.).
- Proficiency in C programming
- This course uses C but does not teach C.
- This course assumes that students thoroughly know C. This includes, but not limited to, the
syntax of C, C
struct
s, C strings and how to manipulate them, arrays and pointers, the use ofmalloc()
andfree()
, etc. - Knowing C++ is better but not enough. C is still different from C++.
- A very basic test is asking yourself, "Can I write a doubly-linked list in C without getting any help (with all the features, creating/appending/deleting a node and traversing the list)?"
- The following seem to be good resources to learn C.
- C for Python programmers: I think this can serve as a general intro to C, not just for Python programmers but any programmers.
- C for Java programmers
- Here's another one that talks about pointers and strings, which might be helpful.
- Experience in using the command-line interface on Linux
- We do not expect students to have proficiency but some experience.
General Learning Outcomes
Upon completion of this course, students are expected to achieve proficiency in the following areas:
- Interacting with, and programming in, a Linux environment using the command-line interface.
- Utilizing programming tools such as build systems and debuggers.
- Programming with processes and threads.
- Understanding concurrency concepts such as semaphores, locks, critical sections, deadlocks, common concurrency patterns, etc.
- Manipulating and managing data in memory correctly.
- Understanding file system abstractions and programming with them.
- Understanding communication abstractions such as IPC, sockets, and RPC and programming with them.
- Understanding cryptographic functions and programming with them.
Use of Generative AI Tools
Large Language Models (LLMs) such as ChatGPT and Copilot are very powerful for assisting programmers. However, they also make it really easy to not learn how to code! To be a good software developer you need to know how to write the code yourself (with and without the AI tools). For this course, here are the rules:
- You must have written the code yourself, and be able to re-create the application on an exam (or job interview)!
- If use use an AI tool, you must mention it in your code, such as putting the following comment at the top of your file:
// Used help from ChatGPT to find null pointer in tokenization code.
- If you are finding that you need a lot of specific mentions on what AI is doing for you, then you are likely relying on it too much and not building your own software development and systems programming skills.
- Incorrect use of AI tools is considered a violation of the course's academic honesty policy and will earn a grade of 0 and an academic dishonesty report being filed with the university.
Allowable uses of AI
- Experiment with code shown in lectures.
- Help understand concepts.
- Help understand code and its behaviour.
- Answer questions such as:
- "Explain the return values of
fork()
?" - "In this example, what are the arguments to
fork()
?" - "Why does this code crashes when I enter an empty string?"
(Note: you should first use the debugger and build your skills, but the AI can help)
- "Explain the return values of
Forbidden uses of AI
- Don't use it to write your lab or assignment code for you.
- Don't ask questions like:
- "What is an implementation of the following assignment?"
- "Write a C function which reads in user input and tokenizes it into an array."
- "Write a C program which passes the following tests."
Coding practice (assignments) are heavily weighted to encourage everyone to solve problems and learn to code. We give grades for what you have learned, not what your AI tool can do for you.
Grading (tentative)
- Midterm: 15%
- Sample midterm from Fall 2023
- Final: 15%
- Sample final from Fall 2023
- Programming assignments: 66%
- 8 short assignments: 2% each
- 5 long assignment: 10% each
- Lab Completion or In-class activities: 4%
Course Policies
Pull Request Policy
- If you see that you have a pull request, please merge it. Pull requests contain updates to the assignments.
- In order to do it, go to your repo's webpage, check if your
Pull requests
tab shows a number. If it doesn't show a number, you don't need to do anything as there is no pull requests. - If it does show a number, click the tab, click a pull request, scroll all the way down, and click
Merge pull request
(green button). If there are more than one pull request, please merge each and every one.
Grading Policy
- All submissions should be done on GitHub Classroom and/or CourSys. Email submissions are not accepted.
- Submissions that do not follow the instructions down to the letter receive a zero.
- Students must attain an overall passing grade on the weighted average of exams (quizzes/midterms/final) in the course in order to obtain a clear pass (C- or better).
- If a student earns a "pass" (usually 50% or more) on the weighted average of the final and midterm, then the student gets whatever grade they have otherwise earned in the course.
- If a student does not earn a pass on the weighted average of the midterm and final, then the student can get at most a D in the class. The grade D is a pass, but means the course cannot be used as a prerequisite for later courses.
- This policy ensures that students are able to demonstrate they are proficient with the course content in an exam setting in order to earn a C- or better. For example, if a student does not know the course material but has relied too heavily on others for completing their assignments, they will likely have low exam scores and high assignment scores. This policy helps ensure everyone can independently demonstrate their knowledge on exams.
Late Policy
- Assignment Late Policy
- There is a 60 minute grace period after a deadline to account for technical issues such as network failures or git issues.
- Over the semester, you have a total of 15 late-days to use.
- One late-day allows you to turn in your work 24h late for no penalty.
- You may use at most 3 late-days on any given assignment. i.e., you can submit up to 3 days (+60m) late for no penalty, but using up 3 of your total late-days.
- If making late submissions (i.e., pushing code to your assignment repo after the due date), once it improves your grades from those before the deadline, we will automatically use late-days and the latest grades (no need to tell us or request it, and we very much don't want to handle requests to "un-spend" a late-day).
- Submissions outside of this late policy will not be marked.
- Contact your instructor if there are extenuating circumstances; however, generally these flexible late days should account for being sick, having conflicting course deadlines, unexpected work commitments, and most family emergencies.
- Extensions and Deferrals
In cases where some concession is requested for assignments or exams, you may need to email your instructor a completed SFU Academic Concession Self-Declaration Form. Doctor's notes are usually not required.
Remark Assignment Process
You must contact a TA or instructor within 7 days of an assignment's grade being released on CourSys to request a remark. It is best to see TAs during their office hours.
To remark an assignment, your TA will ask you to open the CMPT201 container and clone into a fresh directory a copy of the assignment in question. First you will run git log
to show the history of commits to ensure nothing was submitted past the due date / late submission date. Then you will run the checker in that folder, and the TA may ask you to run certain additional steps to demonstrate the solution works.
The TA will then adjust your marks according, adding a comment in CourSys explaining what was changed on the marking.
Talk to your instructor if you have concerns with the remark procedure.
Piazza Policy
- In this course, Piazza is mainly for you to help each other. If you know how to answer a question, please provide your answer and help out others.
- If no sensitive information is involved, always consider posting a question as a public question, not as a private question. It could be beneficial for other people in class.
- Depending on the volume of questions, the teaching staff may not be able to answer all questions in a timely fashion.
- The teaching staff is expected to monitor Piazza only during regular work days (Mon-Fri, excluding holidays) and regular work hours (9 am - 5 pm).
- For coding questions, it is most likely necessary to examine your code carefully and perhaps run it as well. This means that most of the times, it is much better to use the office hours than Piazza.
- For a followup discussion, always come back and mark it as resolved if the answer has been provided.
Academic Integrity Policy
- All submitted work should be your own. For example, if you copy code from the Internet, from your peers, or from an AI tool then it is not your own work.
- You should not allow others to copy your code either. For example, your peer should not copy your code and you should not post your code on the Internet.
- The MOSS tool will be used to check the originality of all electronic submissions (within this class, and against previous offerings as needed).
- SFU's Academic Honesty policy is crucial to earning credit in this course. Violations of the policy will be taken seriously and reported to the department and university.
- Explanation of penalties often applied for academic dishonesty (Dr. Brian).
Text books
Recommended Textbooks
The Linux Programming Interface: A Linux and UNIX System Programming Handbook, Michael Kerrisk, 2010.
- This book is arguably the best book on systems programming using Linux.
- If someone is looking to purchase one book on systems programming, this book is that book.
- A lot of the course materials are based on this book.
- This book is almost required. There are two reasons why it is almost.
- The book covers much more than what this course covers.
- The book is not inexpensive.
- If there is a student struggling with the materials of this course, it is recommended to purchase this book and read along.
Operating Systems: Three Easy Pieces, Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau
- This is a free online book on operating systems.
- This course teaches some of the concepts described in the book. However, the book goes much more in detail than what this course teaches, hence it is not a required book.
- Nevertheless, the course lecture notes refer to some chapters of the book and students are expected to read those chapters.
Reference Books
- Computer Systems: A Programmer's Perspective, 3rd Edition, Randal E. Bryant and David R. O'Hallaron, 2015.
- Advanced Programming in the UNIX Environment, 3rd Edition, W. Stevens and Stephen Rago, 2013
- Unix Network Programming, Volume 1: The Sockets Networking API, 3rd Edition, W. Stevens, Bill Fenner, and Andrew Rudoff, 2003
- UNIX Network Programming, Volume 2: Interprocess Communications, 2nd Edition, W. Richard Stevens, 1998
- The Art of Unix Programming, Eric Steven Raymond, 2003
- C Programming Language, 2nd Edition, Dennis Ritchie and Brian Kernighan, 1988