# kuntalsaha05/jarvis-os architecture

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

- Interactive diagram: https://gitdiagram.com/kuntalsaha05/jarvis-os
- Repository: https://github.com/kuntalsaha05/jarvis-os

## Overview

JARVIS-OS combines a bare-metal educational x86-64 kernel with a host-side AI companion. The kernel workflow boots into hardware and interrupt services, then supports process scheduling, memory, IPC, storage, networking, shell access, and a graphical desktop; algorithm simulations and diagnostics provide educational and inspection capabilities. Separately, host requests enter the agent loop, which selects tools under policy, may communicate with the kernel over the JSON bridge, and synthesizes a response through a configured LLM backend. Several subsystem links rely on README descriptions because their implementation files were not sampled.

Main entry points: [`kernel/kernel.c`](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/kernel.c) (Kernel Startup), [`kernel/shell/shell.c`](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/shell/shell.c) (Kernel Shell), [`jarvis/agent/agent.py`](https://github.com/kuntalsaha05/jarvis-os/blob/main/jarvis/agent/agent.py) (Agent Cycle), [`kernel/ipc/ipc.c`](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/ipc/ipc.c) (IPC and Sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Kernel Core"]
  node_kernel["Kernel Startup<br/>[kernel.c]"]
  node_hal["Hardware Abstraction<br/>[hal.c]"]
  node_interrupts["Interrupt Handling<br/>[idt.c]"]
  node_drivers["Console and Input<br/>[terminal.c]"]
end

subgraph group_services["Kernel Services"]
  node_process["Processes<br/>[process.c]"]
  node_scheduler["Scheduler<br/>[scheduler.c]"]
  node_memory["Memory Management<br/>[page.c]"]
  node_ipc["IPC and Sync<br/>[ipc.c]"]
  node_storage[("JARVIS-FS<br/>[fs.c]")]
  node_block["Block Device<br/>[block.c]"]
  node_network["Network Stack<br/>[netstack.c]"]
  node_security["Security Controls<br/>[security.c]"]
  node_diagnostics["System Diagnostics<br/>[diagnostics.c]"]
end

subgraph group_ui["User Interfaces"]
  node_shell["Kernel Shell<br/>[shell.c]"]
  node_desktop["Graphical Desktop<br/>[desktop.c]"]
  node_window_manager["Window Manager<br/>[wm.c]"]
end

subgraph group_host["Host Companion"]
  node_host_cli["Host CLI<br/>[main.py]"]
  node_agent["Agent Cycle<br/>[agent.py]"]
  node_tool_registry["Tool Registry<br/>[registry.py]"]
  node_llm_manager["LLM Manager<br/>[manager.py]"]
  node_llm_backend["LLM Backends"]
  node_bridge["JSON Serial Bridge"]
end

subgraph group_learning["OS Demonstrations"]
  node_algorithms["OS Algorithms"]
end

node_boot_actor(("Bootloader"))
node_host_user(("Host User"))

node_boot_actor -->|"boots"| node_kernel
node_kernel -->|"initializes"| node_hal
node_kernel -->|"initializes"| node_interrupts
node_kernel -->|"initializes"| node_process
node_kernel -->|"initializes"| node_scheduler
node_kernel -->|"initializes"| node_ipc
node_kernel -->|"initializes"| node_storage
node_kernel -->|"uses"| node_block
node_interrupts -->|"ticks"| node_scheduler
node_process -->|"configures"| node_interrupts
node_ipc -->|"blocks tasks"| node_process
node_ipc -->|"uses"| node_scheduler
node_storage -->|"reads and writes"| node_block
node_shell -->|"dispatches filesystem commands"| node_storage
node_shell -->|"reports network status"| node_network
node_shell -->|"runs IPC demos"| node_ipc
node_shell -->|"runs simulations"| node_algorithms
node_kernel -->|"uses"| node_memory
node_kernel -->|"starts"| node_shell
node_desktop -->|"uses"| node_window_manager
node_desktop -->|"reads telemetry"| node_diagnostics
node_hal -->|"registers devices"| node_drivers
node_host_user -->|"submits request"| node_host_cli
node_host_cli -->|"runs cycle"| node_agent
node_agent -->|"selects and executes"| node_tool_registry
node_agent -->|"requests generation"| node_llm_manager
node_llm_manager -->|"routes requests"| node_llm_backend
node_host_cli -->|"starts companion"| node_bridge
node_bridge -.->|"exchanges JSON"| node_kernel
node_agent -->|"returns answer"| node_host_cli
node_security -.->|"enforces permissions"| node_tool_registry

click node_kernel "https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/kernel.c"
click node_hal "https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/hal/hal.c"
click node_interrupts "https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/interrupts/idt.c"
click node_drivers "https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/drivers/terminal.c"
click node_process "https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/process/process.c"
click node_scheduler "https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/process/scheduler.c"
click node_memory "https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/memory/page.c"
click node_ipc "https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/ipc/ipc.c"
click node_storage "https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/storage/fs.c"
click node_block "https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/storage/block.c"
click node_network "https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/net/netstack.c"
click node_security "https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/security/security.c"
click node_diagnostics "https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/diagnostics/diagnostics.c"
click node_shell "https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/shell/shell.c"
click node_desktop "https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/gui/desktop.c"
click node_window_manager "https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/gui/wm.c"
click node_algorithms "https://github.com/kuntalsaha05/jarvis-os/tree/main/kernel/algorithms"
click node_host_cli "https://github.com/kuntalsaha05/jarvis-os/blob/main/jarvis/main.py"
click node_agent "https://github.com/kuntalsaha05/jarvis-os/blob/main/jarvis/agent/agent.py"
click node_tool_registry "https://github.com/kuntalsaha05/jarvis-os/blob/main/jarvis/tools/registry.py"
click node_llm_manager "https://github.com/kuntalsaha05/jarvis-os/blob/main/jarvis/llm/manager.py"
click node_llm_backend "https://github.com/kuntalsaha05/jarvis-os/tree/main/jarvis/llm"
click node_bridge "https://github.com/kuntalsaha05/jarvis-os/tree/main/jarvis/bridge"

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_kernel,node_hal,node_interrupts,node_drivers,node_host_user toneBlue
class node_process,node_scheduler,node_memory,node_ipc,node_storage,node_block,node_network,node_security,node_diagnostics toneAmber
class node_shell,node_desktop,node_window_manager toneMint
class node_host_cli,node_agent,node_tool_registry,node_llm_manager,node_llm_backend,node_bridge toneRose
class node_algorithms,node_boot_actor toneIndigo
```

## Components

### Kernel Core

- [Kernel Startup](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/kernel.c): `kernel/kernel.c`
- [Hardware Abstraction](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/hal/hal.c): `kernel/hal/hal.c`
- [Interrupt Handling](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/interrupts/idt.c): `kernel/interrupts/idt.c`
- [Console and Input](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/drivers/terminal.c): `kernel/drivers/terminal.c`

### Kernel Services

- [Processes](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/process/process.c): `kernel/process/process.c`
- [Scheduler](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/process/scheduler.c): `kernel/process/scheduler.c`
- [Memory Management](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/memory/page.c): `kernel/memory/page.c`
- [IPC and Sync](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/ipc/ipc.c): `kernel/ipc/ipc.c`
- [JARVIS-FS](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/storage/fs.c): `kernel/storage/fs.c`
- [Block Device](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/storage/block.c): `kernel/storage/block.c`
- [Network Stack](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/net/netstack.c): `kernel/net/netstack.c`
- [Security Controls](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/security/security.c): `kernel/security/security.c`
- [System Diagnostics](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/diagnostics/diagnostics.c): `kernel/diagnostics/diagnostics.c`

### User Interfaces

- [Kernel Shell](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/shell/shell.c): `kernel/shell/shell.c`
- [Graphical Desktop](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/gui/desktop.c): `kernel/gui/desktop.c`
- [Window Manager](https://github.com/kuntalsaha05/jarvis-os/blob/main/kernel/gui/wm.c): `kernel/gui/wm.c`

### Host Companion

- [Host CLI](https://github.com/kuntalsaha05/jarvis-os/blob/main/jarvis/main.py): `jarvis/main.py`
- [Agent Cycle](https://github.com/kuntalsaha05/jarvis-os/blob/main/jarvis/agent/agent.py): `jarvis/agent/agent.py`
- [Tool Registry](https://github.com/kuntalsaha05/jarvis-os/blob/main/jarvis/tools/registry.py): `jarvis/tools/registry.py`
- [LLM Manager](https://github.com/kuntalsaha05/jarvis-os/blob/main/jarvis/llm/manager.py): `jarvis/llm/manager.py`
- [LLM Backends](https://github.com/kuntalsaha05/jarvis-os/tree/main/jarvis/llm): `jarvis/llm`
- [JSON Serial Bridge](https://github.com/kuntalsaha05/jarvis-os/tree/main/jarvis/bridge): `jarvis/bridge`

### OS Demonstrations

- [OS Algorithms](https://github.com/kuntalsaha05/jarvis-os/tree/main/kernel/algorithms): `kernel/algorithms`

### Other components

- **Bootloader**
- **Host User**

## Connections

- Bootloader → Kernel Startup: boots
- Kernel Startup → Hardware Abstraction: initializes (evidence: `kernel/kernel.c`)
- Kernel Startup → Interrupt Handling: initializes (evidence: `kernel/kernel.c`)
- Kernel Startup → Processes: initializes (evidence: `kernel/kernel.c`)
- Kernel Startup → Scheduler: initializes (evidence: `kernel/kernel.c`)
- Kernel Startup → IPC and Sync: initializes (evidence: `kernel/kernel.c`)
- Kernel Startup → JARVIS-FS: initializes (evidence: `kernel/kernel.c`)
- Kernel Startup → Block Device: uses (evidence: `kernel/kernel.c`)
- Interrupt Handling → Scheduler: ticks (evidence: `kernel/interrupts/idt.c`)
- Processes → Interrupt Handling: configures (evidence: `kernel/process/process.c`)
- IPC and Sync → Processes: blocks tasks (evidence: `kernel/ipc/ipc.c`)
- IPC and Sync → Scheduler: uses (evidence: `kernel/ipc/ipc.c`)
- JARVIS-FS → Block Device: reads and writes (evidence: `kernel/storage/fs.c`)
- Kernel Shell → JARVIS-FS: dispatches filesystem commands (evidence: `kernel/shell/shell.c`)
- Kernel Shell → Network Stack: reports network status (evidence: `kernel/shell/shell.c`)
- Kernel Shell → IPC and Sync: runs IPC demos (evidence: `kernel/shell/shell.c`)
- Kernel Shell → OS Algorithms: runs simulations (evidence: `kernel/shell/shell.c`)
- Kernel Startup → Memory Management: uses (evidence: `kernel/kernel.c`)
- Kernel Startup → Kernel Shell: starts (evidence: `kernel/kernel.c`)
- Graphical Desktop → Window Manager: uses
- Graphical Desktop → System Diagnostics: reads telemetry
- Hardware Abstraction → Console and Input: registers devices (evidence: `kernel/hal/hal.c`)
- Host User → Host CLI: submits request (evidence: `jarvis/main.py`)
- Host CLI → Agent Cycle: runs cycle (evidence: `jarvis/main.py`)
- Agent Cycle → Tool Registry: selects and executes (evidence: `jarvis/agent/agent.py`)
- Agent Cycle → LLM Manager: requests generation (evidence: `jarvis/agent/agent.py`)
- LLM Manager → LLM Backends: routes requests (evidence: `jarvis/llm/manager.py`)
- Host CLI → JSON Serial Bridge: starts companion (evidence: `jarvis/main.py`)
- JSON Serial Bridge → Kernel Startup: exchanges JSON
- Agent Cycle → Host CLI: returns answer (evidence: `jarvis/main.py`)
- Security Controls → Tool Registry: enforces permissions
