College of Computer Science & Information Technology King Khalid University · جامعة الملك خالد
Week
Week 2
Topic
Processes
Workload
6–8 Hours
Status
Materials Placeholder
Overview Schedule Objectives Materials Reading Lab Assignment Quiz Downloads Checklist
Module Overview

Week 2 moves from the general idea of an operating system to one of its most important abstractions: the process. Students study how a running program is represented, how processes are created, and how the OS switches between them.

Lecture
Process abstraction and process API
Reading
OSTEP Chapters 4–6
Lab
fork(), wait(), exec(), and pstree
Due
Update date later
Weekly Schedule
Time Activity What Students Do Link
Before Lecture Preparation Reading Read OSTEP Chapters 4–6 and write two questions about processes. Book →
Lecture 1 Process Abstraction Program vs process, address space, PCB, process states, and context switch. Slides →
Lecture 2 Linux Process API fork(), exec(), wait(), exit(), parent process, child process, and zombies. Slides →
Lab Session Process Creation Compile C programs, create child processes, and inspect process trees. Lab →
After Lecture Assignment 2 Write a C program that creates five child processes and waits for them. Assignment →
End of Week Quiz 2 Complete short quiz on processes, states, fork(), exec(), and wait(). Quiz →
Learning Objectives
Outcome
By the end of Week 2, students should be able to:

Explain the difference between a program and a process, describe process states, identify the role of the PCB, create processes using fork(), replace a process image using exec(), wait for child processes, and inspect processes using Linux tools.

Processes fork() exec() wait() Linux
Module 2
Core
Lecture Materials
Slides
Week 2 Lecture Slides

Slides for process abstraction, program vs process, process states, context switching, process creation, and the Linux process API.

PDF Lecture Required
PDF
Lecture
Open Slides →
Notes
Week 2 Lecture Notes

Instructor notes and class summary for reviewing process states, fork behavior, parent-child relationships, and common process commands.

PDF Review Summary
PDF
Notes
Download →
Video
Lecture Recording

Placeholder for Week 2 lecture recording. Replace this href with YouTube, Blackboard, Google Drive, or the local recording URL.

Video Recording Optional Review
Video
TBD
Watch →
Code
Live Coding Examples

Starter files for fork_example.c, wait_example.c, exec_example.c, process_tree.c, and a simple Makefile.

C GCC Processes Makefile
ZIP
Starter
Download →
Reading
Required
Operating Systems: Three Easy Pieces

Read Chapters 4, 5, and 6. Focus on the process abstraction, the process API, fork(), exec(), wait(), and the idea of limited direct execution.

OSTEP Ch. 4 Ch. 5 Ch. 6
Required
Book
Open →
Reference
Linux man-pages: fork, exec, wait

Use the Linux manual pages to review the exact behavior and return values of fork(), exec-family calls, wait(), waitpid(), and exit().

Linux System Calls Manual
Reference
man7
Open →
Lab
Lab 2
Process Creation and Observation

Students write C programs that create child processes, print PIDs, use wait() for synchronization, and verify process structure using pstree and ps.

fork() wait() pstree ps
Required
90 min
Open Lab →
Assignment
HW 2
Process Tree Programming

Write a C program that creates five child processes. Each child prints its PID and parent PID. The parent must wait for all children before printing a final completion message.

Homework Process Tree C Programming Submission
10 points
Due TBD
Download →
Quiz
Quiz 2
Processes Quiz

Short quiz covering program vs process, process states, PCB, context switching, fork(), exec(), wait(), zombies, and Linux process commands.

10 Questions 15 Minutes Online
Quiz
TBD
Start →
All Downloads
Files
Week 2 File Package

Use this section as the central download area for students. Replace the placeholder paths after you upload the actual slides, notes, lab manual, assignment, and starter code.

Slides Notes Lab Assignment Code
Package
ZIP
Download All →
Student Checklist
  • □ Read OSTEP Chapters 4–6
  • □ Open Week 2 slides
  • □ Review lecture notes
  • □ Compile fork_example.c
  • □ Complete Lab 2
  • □ Submit Assignment 2
  • □ Complete Quiz 2
  • □ Prepare questions for Week 3

Next week focuses on threads and concurrency. Students should be comfortable with process creation, process IDs, parent-child process relationships, and basic Linux process commands before Week 3 begins.