Deep Dive into the C Compilation Process: From Source Code to Machine Execution
This project provides a rigorous, systems-level explanation of how C source code becomes machine-executable programs. It focuses on real toolchains, binary formats, and runtime behavior without oversimplifying the underlying mechanisms.
- Build a mental model of CPU execution and memory behavior.
- Understand each stage of the C compilation pipeline.
- Inspect real artifacts such as preprocessed output, assembly, object files, and ELF binaries.
- Explain linking, relocation, and dynamic loading at a practical level.
- Reason about ABIs and platform differences.
Learners who want a precise, low-level view of how C programs are built and executed.
- Basic C programming and command-line use.
- Familiarity with basic computer architecture terms is helpful.
chXX-name/contains chapter content in both Markdown and LaTeX.chXX-name/assets/stores figures and diagrams for the chapter.chXX-name/exp/contains a guided experiment in Markdown and LaTeX.ccomp-style.stydefines LaTeX styling used across chapters.Makefilebuilds the PDF book withlatexmk.
- Install a LaTeX distribution that includes
latexmk. - Run
make allfrom the project root. - The final PDF is written to
dist/ccomp-book.pdf.
- Open each
chXX-name/chXX-name.mdfile in order. - Each chapter includes an experiment in
exp/exp.md. - You can also download the pdf from Here.
- Keep terminology precise and consistent with existing chapters.
- Prefer small, focused changes with clear rationales.
- Add experiments that are reproducible with standard toolchains.
Important
Most of the work is done by openclaw(claude), and copilot formulate a detailed plan rather I only concept the outline.
MIT