In this study module, you'll be learning some very fundamental concepts related to how a simple C program becomes a Process in the Operating System.
The primary focus of this study module will be on the Windows operating system but there will be some comparisons with Linux to understand certain concepts.
All the notes are written and all the diagrams are created by Nandan Desai
- Knowledge of Physical and Virtual Memory: https://nkdesai409.blogspot.com/2022/02/understanding-computer-memory.html (my blogpost)
- If you've written any simple C program before, you're good to go! You'll learn the internals of it here.
- You'll learn all the stages of compilation and linking in detail.
- You'll learn about what an object file is, and what's inside it (like Sections, Symbol Table and Relocation Table).
- You'll learn about Static and Dynamic Libraries.
- You'll be able to understand the internals of the PE (Portable Executable) file format.
- You'll understand various data structures (or rather, "data directories") in a PE file like Import Table, Export Table, Base Relocation Table etc.
- You'll learn how a Loader works and how DLLs are loaded.
- You'll understand the memory structure of a process's virtual address space.
- Overall, you'll have a pretty clear understanding of how a C program that you write in a text file turns into a process in the operating system!
- 1. Introduction
- 2. Compilation Stages
- 2.1. Stage 1: Preprocessing
- 2.2. Stage 2: Compilation
- 2.3. Stage 3: Assembly
- 2.4. Stage 4: Linking - Part 1
- 2.5. Stage 4: Linking - Part 2
- 3. Process Creation
This entire GitHub repository is published under Creative Commons BY-NC-SA 4.0 license. "This license lets others remix, tweak, and build upon your work non-commercially, as long as they credit you and license their new creations under the identical terms."