# dhruvaggarwal419/an-operating-system-simulator architecture

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

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

## Overview

This is an educational Streamlit operating-system simulator. Users choose a module in the navigation app, enter algorithm-specific inputs, and view results or visualizations. The principal workflow branches into process scheduling, disk scheduling, memory allocation, deadlock safety, and page replacement; a documentation view explains OS concepts. Process scheduling also compares scheduling metrics and produces Gantt-style charts. A chatbot implementation and C++ algorithm sources are present, though the chatbot is not wired into the app navigation. Some imported runtime modules and the memory backing file are absent from the tree, so their internals are not represented.

Main entry points: [`app.py`](https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/app.py) (Streamlit Navigation), [`process_scheduling_python.py`](https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/process_scheduling_python.py) (Scheduling Interface), [`chatbot.py`](https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/chatbot.py) (Chatbot Interface), [`process_scheduling.cpp`](https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/process_scheduling.cpp) (Scheduling Algorithms)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application"]
  node_app["Streamlit Navigation<br/>[app.py]"]
end

subgraph group_scheduling["Process Scheduling"]
  node_process_ui["Scheduling Interface"]
  node_scheduler["Scheduling Algorithms"]
  node_chart_scheduler["Chart Algorithms"]
end

subgraph group_memory["Memory Concepts"]
  node_memory_ui["Memory Allocation"]
  node_memory_cpp["C++ Allocation"]
end

subgraph group_other_algorithms["Other Simulations"]
  node_disk_ui["Disk Scheduling"]
  node_deadlock_ui["Deadlock Checker"]
  node_page_replacement["Page Replacement"]
end

subgraph group_learning["Learning Tools"]
  node_documentation["OS Documentation"]
  node_chatbot["Chatbot Interface<br/>[chatbot.py]"]
end

node_user(("Learner"))
node_gemini["Gemini API"]

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_process_ui
node_app -->|"routes to"| node_disk_ui
node_app -->|"routes to"| node_memory_ui
node_app -->|"routes to"| node_deadlock_ui
node_app -->|"routes to"| node_page_replacement
node_app -->|"routes to"| node_documentation
node_process_ui -->|"runs algorithms"| node_scheduler
node_process_ui -->|"gets chart data"| node_chart_scheduler
node_user -->|"chats with"| node_chatbot
node_chatbot -->|"sends prompt"| node_gemini

click node_app "https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/app.py"
click node_process_ui "https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/process_scheduling_python.py"
click node_scheduler "https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/process_scheduling.cpp"
click node_chart_scheduler "https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/process_scheduling_chart.cpp"
click node_disk_ui "https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/disk_scheduling_python.py"
click node_memory_ui "https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/memory_management_python.py"
click node_memory_cpp "https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/memory_management.cpp"
click node_deadlock_ui "https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/deadlock_detection_python.py"
click node_page_replacement "https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/page_fault_python.py"
click node_documentation "https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/project_documentation.py"
click node_chatbot "https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/chatbot.py"

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_app toneBlue
class node_process_ui,node_scheduler,node_chart_scheduler toneAmber
class node_memory_ui,node_memory_cpp,node_gemini toneMint
class node_disk_ui,node_deadlock_ui,node_page_replacement toneRose
class node_documentation,node_chatbot,node_user toneIndigo
```

## Components

### Application

- [Streamlit Navigation](https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/app.py): `app.py`

### Process Scheduling

- [Scheduling Interface](https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/process_scheduling_python.py): `process_scheduling_python.py`
- [Scheduling Algorithms](https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/process_scheduling.cpp): `process_scheduling.cpp`
- [Chart Algorithms](https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/process_scheduling_chart.cpp): `process_scheduling_chart.cpp`

### Memory Concepts

- [Memory Allocation](https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/memory_management_python.py): `memory_management_python.py`
- [C++ Allocation](https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/memory_management.cpp): `memory_management.cpp`

### Other Simulations

- [Disk Scheduling](https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/disk_scheduling_python.py): `disk_scheduling_python.py`
- [Deadlock Checker](https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/deadlock_detection_python.py): `deadlock_detection_python.py`
- [Page Replacement](https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/page_fault_python.py): `page_fault_python.py`

### Learning Tools

- [OS Documentation](https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/project_documentation.py): `project_documentation.py`
- [Chatbot Interface](https://github.com/dhruvaggarwal419/an-operating-system-simulator/blob/main/chatbot.py): `chatbot.py`

### Other components

- **Learner**
- **Gemini API**

## Connections

- Learner → Streamlit Navigation: opens (evidence: `app.py`)
- Streamlit Navigation → Scheduling Interface: routes to (evidence: `app.py`)
- Streamlit Navigation → Disk Scheduling: routes to (evidence: `app.py`)
- Streamlit Navigation → Memory Allocation: routes to (evidence: `app.py`)
- Streamlit Navigation → Deadlock Checker: routes to (evidence: `app.py`)
- Streamlit Navigation → Page Replacement: routes to (evidence: `app.py`)
- Streamlit Navigation → OS Documentation: routes to (evidence: `app.py`)
- Scheduling Interface → Scheduling Algorithms: runs algorithms (evidence: `process_scheduling_python.py`)
- Scheduling Interface → Chart Algorithms: gets chart data (evidence: `process_scheduling_python.py`)
- Learner → Chatbot Interface: chats with (evidence: `chatbot.py`)
- Chatbot Interface → Gemini API: sends prompt (evidence: `chatbot.py`)
