Second Year Course

Operating Systems & C Programming

A comprehensive systems programming course covering processes, signals, inter-process communication, sockets, threads, and synchronization — all in C on Linux. Progresses from C fundamentals through fork/exec, pipes, shared memory, and pthreads, culminating in real-world concurrent systems like chat servers, bank simulations, and the dining philosophers problem.

17 lessons146 code examplesCLanguageCurriculum: Yoram BibermanTA: Yaniv Gabay (Teaching Assistant)
Your Progress0 / 17 completed
2

Processes

6 lessons

02

Process Creation with fork()

intermediate

Process creation with fork(): the child gets a copy of memory (and of the output buffer), the classic fork-in-a-loop mistake and its fix, decoding how a child ended with waitpid(), a live zombie and an orphan, and timing with gettimeofday.

forkwaitwaitpid+2
11
03

Introduction to Signals

intermediate

Signals with signal(): default actions, catching and ignoring SIGINT, kill() between processes and the kill command from another terminal, SIGALRM timers, one-shot handlers, the safe flag pattern for a graceful shutdown, and signal() vs sigaction().

signalkillSIGINT+2
10
04

Program Execution with exec()

intermediate

Replacing a process image with exec(): same PID, never returns on success, -1 and errno when it fails. The exec family (execl, execlp, execv, execvp, execle), the fork+exec pattern with a calculator, open files and environment across exec, and a tiny shell that runs your commands.

execexecvpfork-exec+2
9
05

Process Spawning: Windows and Linux

intermediate

Spawning a program in one call. Read the Windows versions (_spawnl, _spawnlp, _spawnv with _P_WAIT/_P_NOWAIT, and the argv quirks with spaces and *), then run the Linux counterpart posix_spawn — and see that on Linux it is the shell, not spawn, that splits words and expands *.

spawnposix_spawnWindows+2
8
06

Advanced Signals with sigaction

intermediate

Deep dive into sigaction() — the robust, portable replacement for signal(). Covers the sigaction struct anatomy, sa_mask for blocking signals during handling, SA_RESTART and SA_RESETHAND flags, and SA_SIGINFO for accessing detailed signal metadata.

sigactionsa_maskSA_SIGINFO+2
7
07

Signal Coordination

advanced

Applied signal programming bringing together fork, exec, and signals. Includes a two-program alarm management system, parent-child coordination using signals, and multiplexing signals across four child processes.

coordinationalarmmulti-process+2
4