This repository provides a reproducible Linux development environment for the Operating Systems course.
You do NOT need to install gcc, gdb, or other development tools on your host OS.
All tools are provided inside a Docker container.
-
Base image:
ubuntu:22.04 -
Architecture: Automatically matches your Docker platform
- Apple Silicon (M1/M2/M3) →
ARM64 - Intel Mac / Windows →
x86_64
- Apple Silicon (M1/M2/M3) →
-
Your local
workspace/directory is mounted into the container at:
/workspace- Files stored in
workspace/persist on your machine even after the container exits.
Install Docker Desktop for your platform:
- macOS: https://docs.docker.com/desktop/install/mac-install/
- Windows: https://docs.docker.com/desktop/install/windows-install/
- Linux: https://docs.docker.com/desktop/install/linux/
docker compose builddocker compose up -ddocker exec -it os-lab bashThis opens a Linux shell inside the container. The workspace/ folder on your local machine is mounted to /workspace in the container, so any files you edit locally are immediately available inside the container.
When you're done working, simply type exit. The container keeps running in the background, so you can reconnect at any time with the same docker exec command.
When you no longer need the environment (e.g., end of semester), stop and remove it:
docker compose downNote: Files in
workspace/are stored on your local machine and will NOT be deleted.
cd /workspace
gcc -o my_program my_program.c
./my_program| Tool | Purpose |
|---|---|
| gcc, g++ | C/C++ compilation |
| make, cmake | Build systems |
| python3 | Python execution |
| gdb | Debugging |
| valgrind | Memory leak detection |
| strace | System call tracing |
| man | Manual pages (POSIX) |
# Process Inspection
ps aux # List all running processes
htop # Real-time process monitor
pstree # Show process tree hierarchy
cat /proc/<PID>/status # Detailed process status
cat /proc/<PID>/maps # Process memory map
# Memory Inspection
free -h # System memory usage
cat /proc/meminfo # Detailed memory info
# File Descriptors
lsof -p <PID> # List open file descriptors
# Signals
kill -l # List all signals
kill -9 <PID> # Send SIGKILL to a process
# Trace system calls
strace ./my_program
# Check for memory leaks
valgrind --leak-check=full ./my_program
# Debug with gdb
gdb ./my_program
# Read manual pages
man fork
man pthread_create
man pipeTBA