Operating Systems & Administration

[Day 2] 3. Process Management

D
DITISS Admin
••2 min read

!3. ProcessManagement.png

Process: Running an instance of a program.
Program: A set of instructions for the machine (CPU).

Compilation Process

The compilation process involves converting source code into machine code. This is achieved through a compiler, which is also known as a toolchain.

Toolchain Components

A typical toolchain consists of the following components:

  1. Pre-processor: Processes preprocessor directives and removes comments from the source code.
  2. Compiler:
    • Checks for syntax errors and informs the programmer if any errors are found.
    • Converts expanded source code to assembly code.
    • Assigns addresses to variables and functions.
    • Creates a symbol table that stores information about symbols, which include the program's functions and variables.
  3. Assembler: Converts assembly code into machine code.
  4. Linker:
    • Combines the generated machine code with library machine code to create an executable file.
    • Adds an executable header containing information about the program.
  5. Debugger: Helps identify and fix bugs in the code.

Example: GCC Toolchain

The GCC (GNU Compiler Collection) is a widely used toolchain for converting C code into machine code. Its components include:

  1. Pre-processor: CPP
  2. Compiler: CCI
  3. Assembler: AS
  4. Linker: LD
  5. Debugger: GDB

Machine Code Generation

  • The final output of the tool-chain is machine code, which is in binary format.
  • This machine code is organised into sections, hence referred to as sectioned binary.
  • The sectioned binary is stored on the hard disk.

Read Next

8/26/2026

[Day 2] 4. Executable File

!4. Executable File.png ### **Executable File Structure** An executable file contains several key sections, each serving a specific purpose:...

8/26/2026

[Day 2] 5. Process Life Cycle

!5. Process Life Cycle.png The **5-state process model** is commonly used in operating systems to describe the various states a process can be in d...