# mirkobrombin/raven architecture

> Architecture diagram of the GitHub repository mirkobrombin/raven, 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/mirkobrombin/raven
- Repository: https://github.com/mirkobrombin/raven

## Overview

Raven runs Windows applications on Linux, using their own installers and a per-application Windows-style prefix. The principal workflow is to launch a PE program, execute its x86/x64 code in Raven’s sandbox, answer Windows system and DLL calls, and present desktop or graphics output through Linux backends. The graph preserves documented installer, compatibility-library, scripting, web, and Direct3D capabilities. Several subsystem links are documented only at product level; edges cite the README, and sampled source references provide additional implementation evidence.

Main entry points: [`native/nt/kernel_context.h`](https://github.com/mirkobrombin/raven/blob/main/native/nt/kernel_context.h) (Kernel context), [`native/main.cpp`](https://github.com/mirkobrombin/raven/blob/main/native/main.cpp) (Runtime launcher), [`native/desktop/window_manager.cpp`](https://github.com/mirkobrombin/raven/blob/main/native/desktop/window_manager.cpp) (Window manager), [`native/cpu/native_cpu.cpp`](https://github.com/mirkobrombin/raven/blob/main/native/cpu/native_cpu.cpp) (Native CPU)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Launch and execution"]
  node_launcher["Runtime launcher<br/>[main.cpp]"]
  node_pe["PE loading<br/>[pe.cpp]"]
  node_module_set["Module management<br/>[module_set.cpp]"]
  node_cpu["Native CPU<br/>[native_cpu.cpp]"]
end

subgraph group_system["Windows system"]
  node_kernel["Kernel context<br/>[kernel_context.h]"]
  node_system_api["Windows services<br/>[api.cpp]"]
  node_process["Process services<br/>[child_process.cpp]"]
  node_paths["Prefix and paths<br/>[paths.cpp]"]
  node_registry[("Registry<br/>[registry.cpp]")]
end

subgraph group_compat["Compatibility libraries"]
  node_guest_libs["Guest system libraries<br/>[user32_private.h]"]
  node_installer["Installer services<br/>[query.c]"]
  node_controls["Common controls<br/>[core.c]"]
end

subgraph group_desktop["Desktop and graphics"]
  node_windowing["Window manager<br/>[window_manager.cpp]"]
  node_desktop_objects["Window objects<br/>[objects.h]"]
  node_presentation["Desktop presentation<br/>[presentation.h]"]
  node_graphics["Graphics bridges<br/>[vulkan_bridge.cpp]"]
  node_thunk32["32-bit Vulkan"]
  node_shader["Shader translation<br/>[hlsl_parser.cpp]"]
end

subgraph group_specialized["Specialized capabilities"]
  node_scripting["Script engines<br/>[engine.c]"]
  node_webengine["Web controls<br/>[engine.c]"]
end

node_user(("Linux user"))
node_program(("Windows program"))

node_user -->|"launches"| node_launcher
node_launcher -->|"loads executable"| node_pe
node_launcher -->|"loads modules"| node_module_set
node_launcher -->|"starts execution"| node_cpu
node_program -->|"runs on"| node_cpu
node_cpu -->|"requests services"| node_kernel
node_kernel -.->|"provides context"| node_system_api
node_kernel -->|"provides context"| node_process
node_kernel -->|"provides paths"| node_paths
node_kernel -->|"provides objects"| node_registry
node_program -->|"imports libraries"| node_guest_libs
node_program -->|"runs installers"| node_installer
node_program -->|"uses controls"| node_controls
node_program -.->|"uses scripts"| node_scripting
node_program -.->|"hosts web controls"| node_webengine
node_program -->|"creates windows"| node_windowing
node_windowing -->|"manages windows"| node_desktop_objects
node_windowing -.->|"presents desktop"| node_presentation
node_program -->|"uses Vulkan"| node_graphics
node_thunk32 -->|"dispatches calls"| node_graphics
node_program -->|"compiles shaders"| node_shader
node_graphics -.->|"draws output"| node_presentation

click node_launcher "https://github.com/mirkobrombin/raven/blob/main/native/main.cpp"
click node_pe "https://github.com/mirkobrombin/raven/blob/main/native/pe/pe.cpp"
click node_module_set "https://github.com/mirkobrombin/raven/blob/main/native/pe/module_set.cpp"
click node_cpu "https://github.com/mirkobrombin/raven/blob/main/native/cpu/native_cpu.cpp"
click node_kernel "https://github.com/mirkobrombin/raven/blob/main/native/nt/kernel_context.h"
click node_system_api "https://github.com/mirkobrombin/raven/blob/main/native/nt/api.cpp"
click node_process "https://github.com/mirkobrombin/raven/blob/main/native/nt/child_process.cpp"
click node_paths "https://github.com/mirkobrombin/raven/blob/main/native/nt/paths.cpp"
click node_registry "https://github.com/mirkobrombin/raven/blob/main/native/nt/registry.cpp"
click node_guest_libs "https://github.com/mirkobrombin/raven/blob/main/native/guest/raven-user32/user32_private.h"
click node_installer "https://github.com/mirkobrombin/raven/blob/main/native/guest/raven-msi/query.c"
click node_controls "https://github.com/mirkobrombin/raven/blob/main/native/guest/raven-comctl32/core.c"
click node_scripting "https://github.com/mirkobrombin/raven/blob/main/native/guest/raven-jscript/engine.c"
click node_webengine "https://github.com/mirkobrombin/raven/blob/main/native/guest/raven-webengine/engine.c"
click node_windowing "https://github.com/mirkobrombin/raven/blob/main/native/desktop/window_manager.cpp"
click node_desktop_objects "https://github.com/mirkobrombin/raven/blob/main/native/desktop/objects.h"
click node_presentation "https://github.com/mirkobrombin/raven/blob/main/native/desktop/presentation.h"
click node_graphics "https://github.com/mirkobrombin/raven/blob/main/native/graphics/vulkan_bridge.cpp"
click node_thunk32 "https://github.com/mirkobrombin/raven/blob/main/native/graphics/vulkan_thunk32_engine.h"
click node_shader "https://github.com/mirkobrombin/raven/blob/main/native/shader/hlsl_parser.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_launcher,node_pe,node_module_set,node_cpu,node_user toneBlue
class node_kernel,node_system_api,node_process,node_paths,node_registry toneAmber
class node_guest_libs,node_installer,node_controls toneMint
class node_windowing,node_desktop_objects,node_presentation,node_graphics,node_thunk32,node_shader toneRose
class node_scripting,node_webengine,node_program toneIndigo
```

## Components

### Launch and execution

- [Runtime launcher](https://github.com/mirkobrombin/raven/blob/main/native/main.cpp): `native/main.cpp`
- [PE loading](https://github.com/mirkobrombin/raven/blob/main/native/pe/pe.cpp): `native/pe/pe.cpp`
- [Module management](https://github.com/mirkobrombin/raven/blob/main/native/pe/module_set.cpp): `native/pe/module_set.cpp`
- [Native CPU](https://github.com/mirkobrombin/raven/blob/main/native/cpu/native_cpu.cpp): `native/cpu/native_cpu.cpp`

### Windows system

- [Kernel context](https://github.com/mirkobrombin/raven/blob/main/native/nt/kernel_context.h): `native/nt/kernel_context.h`
- [Windows services](https://github.com/mirkobrombin/raven/blob/main/native/nt/api.cpp): `native/nt/api.cpp`
- [Process services](https://github.com/mirkobrombin/raven/blob/main/native/nt/child_process.cpp): `native/nt/child_process.cpp`
- [Prefix and paths](https://github.com/mirkobrombin/raven/blob/main/native/nt/paths.cpp): `native/nt/paths.cpp`
- [Registry](https://github.com/mirkobrombin/raven/blob/main/native/nt/registry.cpp): `native/nt/registry.cpp`

### Compatibility libraries

- [Guest system libraries](https://github.com/mirkobrombin/raven/blob/main/native/guest/raven-user32/user32_private.h): `native/guest/raven-user32/user32_private.h`
- [Installer services](https://github.com/mirkobrombin/raven/blob/main/native/guest/raven-msi/query.c): `native/guest/raven-msi/query.c`
- [Common controls](https://github.com/mirkobrombin/raven/blob/main/native/guest/raven-comctl32/core.c): `native/guest/raven-comctl32/core.c`

### Desktop and graphics

- [Window manager](https://github.com/mirkobrombin/raven/blob/main/native/desktop/window_manager.cpp): `native/desktop/window_manager.cpp`
- [Window objects](https://github.com/mirkobrombin/raven/blob/main/native/desktop/objects.h): `native/desktop/objects.h`
- [Desktop presentation](https://github.com/mirkobrombin/raven/blob/main/native/desktop/presentation.h): `native/desktop/presentation.h`
- [Graphics bridges](https://github.com/mirkobrombin/raven/blob/main/native/graphics/vulkan_bridge.cpp): `native/graphics/vulkan_bridge.cpp`
- [32-bit Vulkan](https://github.com/mirkobrombin/raven/blob/main/native/graphics/vulkan_thunk32_engine.h): `native/graphics/vulkan_thunk32_engine.h`
- [Shader translation](https://github.com/mirkobrombin/raven/blob/main/native/shader/hlsl_parser.cpp): `native/shader/hlsl_parser.cpp`

### Specialized capabilities

- [Script engines](https://github.com/mirkobrombin/raven/blob/main/native/guest/raven-jscript/engine.c): `native/guest/raven-jscript/engine.c`
- [Web controls](https://github.com/mirkobrombin/raven/blob/main/native/guest/raven-webengine/engine.c): `native/guest/raven-webengine/engine.c`

### Other components

- **Linux user**
- **Windows program**

## Connections

- Linux user → Runtime launcher: launches (evidence: `README.md`)
- Runtime launcher → PE loading: loads executable (evidence: `native/main.cpp`)
- Runtime launcher → Module management: loads modules (evidence: `native/main.cpp`)
- Runtime launcher → Native CPU: starts execution (evidence: `native/main.cpp`)
- Windows program → Native CPU: runs on (evidence: `README.md`)
- Native CPU → Kernel context: requests services (evidence: `README.md`)
- Kernel context → Windows services: provides context
- Kernel context → Process services: provides context (evidence: `native/nt/kernel_context.h`)
- Kernel context → Prefix and paths: provides paths (evidence: `native/nt/kernel_context.h`)
- Kernel context → Registry: provides objects (evidence: `native/nt/kernel_context.h`)
- Windows program → Guest system libraries: imports libraries (evidence: `README.md`)
- Windows program → Installer services: runs installers (evidence: `README.md`)
- Windows program → Common controls: uses controls (evidence: `README.md`)
- Windows program → Script engines: uses scripts
- Windows program → Web controls: hosts web controls
- Windows program → Window manager: creates windows (evidence: `README.md`)
- Window manager → Window objects: manages windows (evidence: `native/desktop/window_manager.cpp`)
- Window manager → Desktop presentation: presents desktop
- Windows program → Graphics bridges: uses Vulkan (evidence: `README.md`)
- 32-bit Vulkan → Graphics bridges: dispatches calls (evidence: `native/graphics/vulkan_thunk32_engine.h`)
- Windows program → Shader translation: compiles shaders (evidence: `README.md`)
- Graphics bridges → Desktop presentation: draws output
