# besteaydogan/rtos-simulation architecture

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

- Interactive diagram: https://gitdiagram.com/besteaydogan/rtos-simulation
- Repository: https://github.com/besteaydogan/rtos-simulation

## Overview

VisuaLearnRtos is an interactive RTOS teaching dashboard. A learner selects a case and adjusts its parameters or mitigation; the React app initializes case state, advances deterministic simulation rules, and presents task, queue, mutex, event, and timeline state. The cases cover scheduling, producer-consumer queues, priority inversion, deadlock, ADAS integration, and shared network-driver backpressure. Shared task, queue, mutex, scheduling, and history primitives support the simulations. CS3 and CS4 also have documented standalone teaching labs. Core wiring is supported by excerpts and the SOURCE INDEX; standalone lab behavior is documented in the README, not sampled source.

Main entry points: [`RtosSim/src/sim/rules.js`](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/rules.js) (Simulation dispatcher), [`RtosSim/src/App.jsx`](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/App.jsx) (Interactive dashboard), [`RtosSim/src/main.jsx`](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/main.jsx) (React entry), [`RtosSim/src/sim/cases.js`](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/cases.js) (Case presets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Learning interface"]
  node_app["Interactive dashboard<br/>[App.jsx]"]
  node_entry["React entry<br/>[main.jsx]"]
end

subgraph group_scenarios["Simulation scenarios"]
  node_presets["Case presets<br/>[cases.js]"]
  node_scheduling["Scheduling and starvation<br/>[rules.js]"]
  node_queues["Producer-consumer queues<br/>[rules.js]"]
  node_inversion["Priority inversion<br/>[rules.js]"]
  node_deadlock["Deadlock recovery<br/>[rules.js]"]
  node_adas["ADAS integration<br/>[rules.js]"]
  node_network["Network backpressure<br/>[rules.js]"]
end

subgraph group_runtime["Simulation runtime"]
  node_rules["Simulation dispatcher<br/>[rules.js]"]
  node_primitives["Task and resource primitives<br/>[core.js]"]
  node_history["Simulation history<br/>[core.js]"]
end

subgraph group_labs["Standalone labs"]
  node_prioritylab["Priority inversion lab<br/>[priority.html]"]
  node_deadlocklab["Deadlock lab<br/>[deadlock.html]"]
end

node_learner(("Learner"))

node_learner -->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"creates case state"| node_presets
node_app -->|"advances simulation"| node_rules
node_presets -->|"creates tasks and resources"| node_primitives
node_rules -->|"uses simulation operations"| node_primitives
node_rules -->|"captures history"| node_history
node_rules -->|"dispatches case steps"| node_scheduling
node_rules -->|"dispatches case steps"| node_queues
node_rules -->|"dispatches case steps"| node_inversion
node_rules -->|"dispatches case steps"| node_deadlock
node_rules -->|"dispatches case steps"| node_adas
node_rules -->|"dispatches case steps"| node_network
node_learner -->|"opens standalone lab"| node_prioritylab
node_learner -->|"opens standalone lab"| node_deadlocklab

click node_app "https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/App.jsx"
click node_entry "https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/main.jsx"
click node_presets "https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/cases.js"
click node_scheduling "https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/rules.js"
click node_queues "https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/rules.js"
click node_inversion "https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/rules.js"
click node_deadlock "https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/rules.js"
click node_adas "https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/rules.js"
click node_network "https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/rules.js"
click node_rules "https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/rules.js"
click node_primitives "https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/core.js"
click node_history "https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/core.js"
click node_prioritylab "https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/public/cases/priority.html"
click node_deadlocklab "https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/public/cases/deadlock.html"

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,node_entry toneBlue
class node_presets,node_scheduling,node_queues,node_inversion,node_deadlock,node_adas,node_network toneAmber
class node_rules,node_primitives,node_history toneMint
class node_prioritylab,node_deadlocklab toneRose
class node_learner toneIndigo
```

## Components

### Learning interface

- [Interactive dashboard](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/App.jsx): `RtosSim/src/App.jsx`
- [React entry](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/main.jsx): `RtosSim/src/main.jsx`

### Simulation scenarios

- [Case presets](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/cases.js): `RtosSim/src/sim/cases.js`
- [Scheduling and starvation](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/rules.js): `RtosSim/src/sim/rules.js`
- [Producer-consumer queues](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/rules.js): `RtosSim/src/sim/rules.js`
- [Priority inversion](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/rules.js): `RtosSim/src/sim/rules.js`
- [Deadlock recovery](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/rules.js): `RtosSim/src/sim/rules.js`
- [ADAS integration](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/rules.js): `RtosSim/src/sim/rules.js`
- [Network backpressure](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/rules.js): `RtosSim/src/sim/rules.js`

### Simulation runtime

- [Simulation dispatcher](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/rules.js): `RtosSim/src/sim/rules.js`
- [Task and resource primitives](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/core.js): `RtosSim/src/sim/core.js`
- [Simulation history](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/src/sim/core.js): `RtosSim/src/sim/core.js`

### Standalone labs

- [Priority inversion lab](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/public/cases/priority.html): `RtosSim/public/cases/priority.html`
- [Deadlock lab](https://github.com/besteaydogan/rtos-simulation/blob/main/RtosSim/public/cases/deadlock.html): `RtosSim/public/cases/deadlock.html`

### Other components

- **Learner**

## Connections

- Learner → React entry: opens app (evidence: `README.md`)
- React entry → Interactive dashboard: renders (evidence: `RtosSim/src/main.jsx`)
- Interactive dashboard → Case presets: creates case state (evidence: `RtosSim/src/App.jsx`)
- Interactive dashboard → Simulation dispatcher: advances simulation (evidence: `RtosSim/src/App.jsx`)
- Case presets → Task and resource primitives: creates tasks and resources (evidence: `RtosSim/src/sim/cases.js`)
- Simulation dispatcher → Task and resource primitives: uses simulation operations (evidence: `RtosSim/src/sim/rules.js`)
- Simulation dispatcher → Simulation history: captures history (evidence: `RtosSim/src/sim/rules.js`)
- Simulation dispatcher → Scheduling and starvation: dispatches case steps (evidence: `RtosSim/src/sim/rules.js`)
- Simulation dispatcher → Producer-consumer queues: dispatches case steps (evidence: `RtosSim/src/sim/rules.js`)
- Simulation dispatcher → Priority inversion: dispatches case steps (evidence: `RtosSim/src/sim/rules.js`)
- Simulation dispatcher → Deadlock recovery: dispatches case steps (evidence: `RtosSim/src/sim/rules.js`)
- Simulation dispatcher → ADAS integration: dispatches case steps (evidence: `RtosSim/src/sim/rules.js`)
- Simulation dispatcher → Network backpressure: dispatches case steps (evidence: `RtosSim/src/sim/rules.js`)
- Learner → Priority inversion lab: opens standalone lab (evidence: `README.md`)
- Learner → Deadlock lab: opens standalone lab (evidence: `README.md`)
