The course topics for each week will be posted here, accompanied by reading suggestions, lecture slides and problem solving materials. Note: the solutions to in-class exercises will NOT be posted, you need to work on them in class and take notes.
Suggested order of learning: do an online prep, come to the lecture to exercise and ask questions, come to the lab tutorial to complete online lab for a week, read suggested book chapters to deepen your knowledge.
Structured interaction: Slides.
Linux operating system. File system. Permissions. Basic commands. I/O redirection. Piping. Slides.
Demo typescript. Input files: months, days, faculty, A, B.
Exercises: Permissions and set operators.
Suggested readings (optional): A Practical Guide to Linux Commands by M. Sobell: Chapters 1-5.
Combining existing Linux tools into useful programs using shell scripts. Slides. Demo code: demo_code.tar
Introduction to bash script syntax summary.
Exercises: Shell scripts.
List of Linux utilities you need to know for this course: LIST
Suggested readings (optional): A Practical Guide to Linux Commands by M. Sobell: Chapters 8 and 10.
By Leo Ufimtsev and Jie Kang (Red Hat): Slides.
C syntax recap. Using printf and scanf. Slides.
Building small tools in C. Preparation for Assignment 1. Slides.
Exercises: Small tools.
Readings: King: Chapters 1-8.
Address of a variable. Motivation for pointers. Arrays vs. pointers. Slides.
Exercises: Pointers.
A beautiful video of this lecture by Elaine Huynh: link
Readings: King: Chapters 11-12.
Memory segments. Stack vs. globals. Static variables. String literals. Dynamic memory allocation on the heap. Slides.
Exercises: Strings and memory.
Readings: King: Chapter 13 and Sections 17.1 - 17.4.
Quizzes: link.
User-defined types: struct, union, enum. Struct pointers. Slides.
Readings: King: Chapter 16.
Linked lists. Valgrind. Slides.
Exercises: Linked lists.
Readings: King: Section 17.5.
Using Eclipse IDE for C programming, by Leo Ufimtsev: Slides.
Memory corruption: detect and fix. Golden rules of C programming. Slides.
Exercises: Memory.
Writing large programs. C compilation model. Automating builds with make. Slides.
Function pointers. Sorting arrays. Slides. Sample code: ducks_code.zip
Exercises: Sorting. Starter code: sorting.c.
Readings: King: Chapter 15, Section 17.7.
System and exec. Process ID. Fork. Slides. Code examples: exit after exec, fork and exec fork_pid.c. Running Python script from C program using exec sample_code.zip.
Exercises: Fork.
Readings: Kerrisk: 2.6, 2.7, 24.1.
Wait. Slides. Code examples: fork pointers, fork with wait.
Exercises: Wait.
Readings: Kerrisk: 24.1 - 24.2, 26.1 - 26.2.
Pipe. File descriptors. Slides. Code example: pipe with exec.
Exercises: Pipe.
Readings: Kerrisk: 43.1, 44.1 - 44.2.
Signals. Sigaction. Sigprocmask. Slides. Example: sigalarm.c.
Exercise 1: Signals. Starter code: greeting_starter.c.
Exercise 2: Fork and signals.
Readings: Kerrisk 63.1 and 63.2.1
Unix domain sockets. Internet sockets. Select. Slides.
Sample code: Unix domain sockets: server and client. Endiannes of your machine: my_endian.c. Resolving IP addresses with getaddrinfo(): showip.c. Internet sockets: server and client. Multi-client socket. Server with select.
Readings: Kerrisk 56.1 - 56.5
Function list available during the exam: list.