Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

University of Illinois at Urbana-Champaign

CS 241: System Programming

University of Illinois at Urbana-Champaign via Independent

Overview

This coursebook is being built by students and faculty from the University of Illinois. It is based on a crowd-source authoring wikibook experiment by Lawrence Angrave from CS @ Illinois, but is now its own .tex based project. Its source code is located at the Github link which you can find a pdf version of the book as well.

This book is an introduction to programming in C, and system programming (processes, threads, synchronization, networking and more!). We assume you’ve already had some programming experience, in an earlier computer science course. If you have any typos to report or content to request, feel free to file an issue at the link above. Happy Reading!

Syllabus

1. Introduction 
  1. Authors
2. Background 
  1. Systems Architecture
  2. Debugging and Environments
  3. Valgrind
  4. GDB
  5. Homework 0
  6. UIUC Specific Guidelines
3. The C Programming Language 
  1. History of C
  2. Crash course introduction to C
  3. Language Facilities
  4. The C and Linux
  5. Common C Functions
  6. C Memory Model
  7. Pointers
  8. Common Bugs
  9. Logic and Program flow mistakes
  10. Topics
  11. Questions/Exercises
  12. Rapid Fire: Pointer Arithmetic
4. Processes 
  1. File Descriptors
  2. Processes
  3. Process Contents
  4. Intro to Fork
  5. Waiting and Executing
  6. exec
  7. The fork-exec-wait Pattern
  8. Further Reading
  9. Questions/Exercises
5. Memory Allocators 
  1. Introduction
  2. C Memory Allocation API
  3. Intro to Allocating
  4. Memory Allocator Tutorial
  5. Case Study: Buddy Allocator, an example of a segregated list
  6. Case Study: SLUB Allocator, Slab allocation
  7. Further Reading
  8. Topics
  9. Questions/Exercises
6. Threads 
  1. Processes vs threads
  2. Thread Internals
  3. Simple Usage
  4. Pthread Functions
  5. Race Conditions
  6. Topics
  7. Questions
7. Synchronization 
  1. Mutex
  2. Condition Variables
  3. Thread-Safe Data Structures
  4. Software Solutions to the Critical Section
  5. Working Solutions
  6. Implementing Counting Semaphore
  7. Barriers
  8. Ring Buffer
  9. Extra: Process Synchronization
  10. External Resources
  11. Topics
  12. Questions
8. Deadlock 
  1. Resource Allocation Graphs
  2. Coffman Conditions
  3. Approaches to Solving Livelock and Deadlock
  4. Dining Philosophers
  5. Viable Solutions
  6. Topics
  7. Questions
9. Virtual Memory and Interprocess Communication
  1. Translating Addresses
  2. mmap
  3. Pipes
  4. Named Pipes
  5. Files
  6. IPC Alternatives
  7. Topics
  8. Questions
10. Scheduling 
  1. High Level Scheduler Overview
  2. Measurements
  3. Measures of Efficiency
  4. Scheduling Algorithms
  5. Topics
  6. Questions
11. Networking 
  1. The OSI Model
  2. Layer 3: The Internet Protocol
  3. Layer 4: TCP and Client
  4. Layer 4: TCP Server
  5. Layer 4: UDP
  6. Layer 7: HTTP
  7. Non-Blocking IO
  8. Remote Procedure Calls
  9. Topics
  10. Questions
12. Filesystems 
  1. What is a filesystem?
  2. Storing data on disk
  3. Permissions and bits
  4. Virtual filesystems and other filesystems
  5. Memory Mapped IO
  6. Reliable Single Disk Filesystems
  7. Simple Filesystem Model
  8. Topics
  9. Questions
13. Signals 
  1. The Deep Dive of Signals
  2. Sending Signals
  3. Handling Signals
  4. Blocking Signals
  5. Signals in Child Processes and Threads
  6. Topics
  7. Questions
14. Security 
  1. Security Terminology and Ethics
  2. Security in C Programs
  3. Cyber Security
  4. Topics
  5. Review
15. Review 
  1. C
  2. Processes
  3. Memory
  4. Threading and Synchronization
  5. Deadlock
  6. IPC
  7. Filesystems
  8. Networking
  9. Security
  10. Signals
16. Honors topics 
  1. The Linux Kernel
  2. Containerization
17. Appendix 
  1. Shell
  2. Stack Smashing
  3. Compiling and Linking
  4. Banker’s Algorithm
  5. Clean/Dirty Forks (Chandy/Misra Solution)
  6. Actor Model
  7. Includes and conditionals
  8. threads.h
  9. Modern Filesystems
  10. Linux Scheduling
  11. The Curious Case of Spurious Wakeups
  12. Condition Wait Example
  13. Implementing CVs with Mutexes Alone
  14. Higher Order Models of Synchronization
  15. Actor Model and Goroutines
  16. Scheduling Conceptually
  17. Networking Extra
  18. Assorted Man Pages
  19. System Programming Jokes
18. Post Mortems 
  1. Shell Shock
  2. Heartbleed
  3. Dirty Cow
  4. Meltdown
  5. Spectre
  6. Mars Pathfinder
  7. Mars Again
  8. Year 2038
  9. Northeast Blackout of 2003
  10. Apple IOS Unicode Handling
  11. Apple SSL Verification
  12. Sony Rootkit Installation
  13. Civilization and Ghandi
  14. The Woes of Shell Scripting
  15. Appnexus Double Free
  16. ATT Cascading Failures - 1990

Taught by

Lawrence Angrave

Reviews

Start your review of CS 241: System Programming

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.