# wahabkhan000/operating-system-simulator architecture

> Architecture diagram of the GitHub repository wahabkhan000/operating-system-simulator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wahabkhan000/operating-system-simulator
- Repository: https://github.com/wahabkhan000/operating-system-simulator

## Overview

This console-based operating-system simulator accepts RAM and process parameters, initializes process records and page/frame allocations, and exposes FCFS or Round Robin scheduling choices. Its main routine is the sampled orchestration point; process and CPU modules provide scheduling-related state and queue/algorithm structures, while memory modules model paging and physical frames. The excerpts do not show scheduling dispatch into those structures or a complete simulation/result display, so those links are omitted rather than inferred.

Main entry points: [`Operating_System/OperatingSystem.cpp`](https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/OperatingSystem.cpp) (Simulation driver), [`Operating_System/ProcessManagement.cpp`](https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/ProcessManagement.cpp) (Process records and PCB), [`Operating_System/CPU_Management.cpp`](https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/CPU_Management.cpp) (FCFS policy), [`Operating_System/MemoryManagement.cpp`](https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/MemoryManagement.cpp) (Physical memory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Simulation setup"]
  node_main["Simulation driver"]
end

subgraph group_proc["Process management"]
  node_process_state["Process records and PCB"]
  node_page_table["Process page tables"]
end

subgraph group_sched["CPU scheduling"]
  node_cpu_state["CPU and ready queue<br/>[CPU_Management.cpp]"]
  node_fcfs["FCFS policy<br/>[CPU_Management.cpp]"]
  node_rr["Round Robin policy<br/>[CPU_Management.cpp]"]
end

subgraph group_memory["Memory management"]
  node_physical[("Physical memory")]
  node_frames["Frame tracking"]
  node_mmu["Memory translation state"]
end

node_user(("Console user"))

node_user -->|"provides inputs"| node_main
node_main -->|"configures RAM"| node_physical
node_main -->|"initializes processes"| node_process_state
node_main -->|"builds page tables"| node_page_table
node_main -->|"allocates frames"| node_frames
node_main -.->|"selects policy"| node_fcfs
node_main -.->|"selects policy"| node_rr

click node_main "https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/OperatingSystem.cpp"
click node_process_state "https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/ProcessManagement.cpp"
click node_page_table "https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/ProcessManagement.cpp"
click node_cpu_state "https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/CPU_Management.cpp"
click node_fcfs "https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/CPU_Management.cpp"
click node_rr "https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/CPU_Management.cpp"
click node_physical "https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/MemoryManagement.cpp"
click node_frames "https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/MemoryManagement.cpp"
click node_mmu "https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/MemoryManagement.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_user toneBlue
class node_process_state,node_page_table toneAmber
class node_cpu_state,node_fcfs,node_rr toneMint
class node_physical,node_frames,node_mmu toneRose
```

## Components

### Simulation setup

- [Simulation driver](https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/OperatingSystem.cpp): `Operating_System/OperatingSystem.cpp`

### Process management

- [Process records and PCB](https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/ProcessManagement.cpp): `Operating_System/ProcessManagement.cpp`
- [Process page tables](https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/ProcessManagement.cpp): `Operating_System/ProcessManagement.cpp`

### CPU scheduling

- [CPU and ready queue](https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/CPU_Management.cpp): `Operating_System/CPU_Management.cpp`
- [FCFS policy](https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/CPU_Management.cpp): `Operating_System/CPU_Management.cpp`
- [Round Robin policy](https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/CPU_Management.cpp): `Operating_System/CPU_Management.cpp`

### Memory management

- [Physical memory](https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/MemoryManagement.cpp): `Operating_System/MemoryManagement.cpp`
- [Frame tracking](https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/MemoryManagement.cpp): `Operating_System/MemoryManagement.cpp`
- [Memory translation state](https://github.com/wahabkhan000/operating-system-simulator/blob/main/Operating_System/MemoryManagement.cpp): `Operating_System/MemoryManagement.cpp`

### Other components

- **Console user**

## Connections

- Console user → Simulation driver: provides inputs (evidence: `Operating_System/OperatingSystem.cpp`)
- Simulation driver → Physical memory: configures RAM (evidence: `Operating_System/OperatingSystem.cpp`)
- Simulation driver → Process records and PCB: initializes processes (evidence: `Operating_System/OperatingSystem.cpp`)
- Simulation driver → Process page tables: builds page tables (evidence: `Operating_System/OperatingSystem.cpp`)
- Simulation driver → Frame tracking: allocates frames (evidence: `Operating_System/OperatingSystem.cpp`)
- Simulation driver → FCFS policy: selects policy
- Simulation driver → Round Robin policy: selects policy
