# rizonesoft/impossible-os architecture

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

- Interactive diagram: https://gitdiagram.com/rizonesoft/impossible-os
- Repository: https://github.com/rizonesoft/impossible-os

## Overview

Impossible OS is a from-scratch x86-64 operating system. Its principal workflow is UEFI boot and handoff into the kernel, followed by staged platform and system initialization, then scheduler and desktop startup. Runtime capabilities documented in the README include SMP scheduling, virtual memory, storage/filesystems, networking, ACPI, TPM measured boot, and a developing native API and Windows-like shell. The graph reflects documented relationships and the sampled kernel entry point; many subsystem links are not shown in the excerpts and are therefore omitted.

Main entry points: [`src/kernel/main.c`](https://github.com/rizonesoft/impossible-os/blob/main/src/kernel/main.c) (Kernel entry), [`include/kernel/boot_init.h`](https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/boot_init.h) (Boot phases), [`src/kernel/main/boot_storage.c`](https://github.com/rizonesoft/impossible-os/blob/main/src/kernel/main/boot_storage.c) (Storage and VFS), [`src/boot/uefi/bootx64.c`](https://github.com/rizonesoft/impossible-os/blob/main/src/boot/uefi/bootx64.c) (UEFI bootloader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["UEFI Boot"]
  node_bootloader["UEFI bootloader<br/>[bootx64.c]"]
  node_boot_entries["Boot entry parser"]
  node_boot_info["Boot information ABI<br/>[boot_info.h]"]
end

subgraph group_kernel["Kernel Core"]
  node_kernel_entry["Kernel entry<br/>[main.c]"]
  node_boot_init["Boot phases<br/>[boot_init.h]"]
  node_memory["Virtual memory<br/>[vmm.h]"]
  node_scheduler["SMP scheduler<br/>[task.h]"]
  node_workers["Kernel worker<br/>[kworker.c]"]
  node_acpi["ACPI services<br/>[acpi.h]"]
end

subgraph group_io["System Services"]
  node_storage["Storage and VFS<br/>[boot_storage.c]"]
  node_network["Networking<br/>[net.h]"]
  node_registry[("Win32 Registry<br/>[registry.h]")]
end

subgraph group_security["Security"]
  node_tpm["TPM measured boot<br/>[tpm_nv.h]"]
  node_crypto["Mbed TLS crypto<br/>[crypto.h]"]
end

subgraph group_desktop["Desktop and API"]
  node_graphics_api["Graphics interface<br/>[gfx.h]"]
  node_window_manager["Window manager<br/>[wm.c]"]
  node_desktop["Desktop runtime<br/>[desktop.c]"]
  node_native_api["Native API<br/>[nt_syscall.h]"]
  node_win32["Win32 subsystem<br/>[win32.c]"]
  node_shell["Windows-like shell<br/>[controls.c]"]
end

node_firmware(("UEFI firmware"))

node_firmware -->|"starts"| node_bootloader
node_bootloader -->|"passes boot_info"| node_boot_info
node_boot_info -->|"hands off"| node_kernel_entry
node_kernel_entry -->|"dispatches phases"| node_boot_init
node_kernel_entry -.->|"initializes"| node_memory
node_kernel_entry -.->|"starts"| node_scheduler
node_kernel_entry -->|"runs phase two"| node_storage
node_boot_init -->|"initializes services"| node_storage
node_boot_init -.->|"initializes platform"| node_acpi
node_boot_init -.->|"measures boot"| node_tpm
node_scheduler -->|"runs worker"| node_workers
node_storage -.->|"initializes networking"| node_network
node_storage -.->|"initializes registry"| node_registry
node_scheduler -.->|"supports runtime"| node_desktop
node_graphics_api -->|"draws windows"| node_window_manager
node_window_manager -.->|"composes desktop"| node_desktop
node_desktop -.->|"hosts shell"| node_shell
node_native_api -->|"provides API"| node_win32
node_tpm -.->|"uses cryptography"| node_crypto
node_bootloader -->|"parses entries"| node_boot_entries

click node_bootloader "https://github.com/rizonesoft/impossible-os/blob/main/src/boot/uefi/bootx64.c"
click node_boot_entries "https://github.com/rizonesoft/impossible-os/blob/main/src/boot/uefi/boot_entries_parser.c"
click node_boot_info "https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/boot_info.h"
click node_kernel_entry "https://github.com/rizonesoft/impossible-os/blob/main/src/kernel/main.c"
click node_boot_init "https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/boot_init.h"
click node_memory "https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/mm/vmm.h"
click node_scheduler "https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/sched/task.h"
click node_workers "https://github.com/rizonesoft/impossible-os/blob/main/src/kernel/sched/kworker.c"
click node_acpi "https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/acpi.h"
click node_storage "https://github.com/rizonesoft/impossible-os/blob/main/src/kernel/main/boot_storage.c"
click node_network "https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/net/net.h"
click node_registry "https://github.com/rizonesoft/impossible-os/blob/main/include/registry.h"
click node_tpm "https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/tpm_nv.h"
click node_crypto "https://github.com/rizonesoft/impossible-os/blob/main/src/libs/mbedtls/include/psa/crypto.h"
click node_graphics_api "https://github.com/rizonesoft/impossible-os/blob/main/include/gfx.h"
click node_window_manager "https://github.com/rizonesoft/impossible-os/blob/main/src/desktop/wm.c"
click node_desktop "https://github.com/rizonesoft/impossible-os/blob/main/src/desktop/desktop.c"
click node_native_api "https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/nt/nt_syscall.h"
click node_win32 "https://github.com/rizonesoft/impossible-os/blob/main/user/lib/win32.c"
click node_shell "https://github.com/rizonesoft/impossible-os/blob/main/src/desktop/controls.c"

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_bootloader,node_boot_entries,node_boot_info toneBlue
class node_kernel_entry,node_boot_init,node_memory,node_scheduler,node_workers,node_acpi toneAmber
class node_storage,node_network,node_registry toneMint
class node_tpm,node_crypto toneRose
class node_graphics_api,node_window_manager,node_desktop,node_native_api,node_win32,node_shell,node_firmware toneIndigo
```

## Components

### UEFI Boot

- [UEFI bootloader](https://github.com/rizonesoft/impossible-os/blob/main/src/boot/uefi/bootx64.c): `src/boot/uefi/bootx64.c`
- [Boot entry parser](https://github.com/rizonesoft/impossible-os/blob/main/src/boot/uefi/boot_entries_parser.c): `src/boot/uefi/boot_entries_parser.c`
- [Boot information ABI](https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/boot_info.h): `include/kernel/boot_info.h`

### Kernel Core

- [Kernel entry](https://github.com/rizonesoft/impossible-os/blob/main/src/kernel/main.c): `src/kernel/main.c`
- [Boot phases](https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/boot_init.h): `include/kernel/boot_init.h`
- [Virtual memory](https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/mm/vmm.h): `include/kernel/mm/vmm.h`
- [SMP scheduler](https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/sched/task.h): `include/kernel/sched/task.h`
- [Kernel worker](https://github.com/rizonesoft/impossible-os/blob/main/src/kernel/sched/kworker.c): `src/kernel/sched/kworker.c`
- [ACPI services](https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/acpi.h): `include/kernel/acpi.h`

### System Services

- [Storage and VFS](https://github.com/rizonesoft/impossible-os/blob/main/src/kernel/main/boot_storage.c): `src/kernel/main/boot_storage.c`
- [Networking](https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/net/net.h): `include/kernel/net/net.h`
- [Win32 Registry](https://github.com/rizonesoft/impossible-os/blob/main/include/registry.h): `include/registry.h`

### Security

- [TPM measured boot](https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/tpm_nv.h): `include/kernel/tpm_nv.h`
- [Mbed TLS crypto](https://github.com/rizonesoft/impossible-os/blob/main/src/libs/mbedtls/include/psa/crypto.h): `src/libs/mbedtls/include/psa/crypto.h`

### Desktop and API

- [Graphics interface](https://github.com/rizonesoft/impossible-os/blob/main/include/gfx.h): `include/gfx.h`
- [Window manager](https://github.com/rizonesoft/impossible-os/blob/main/src/desktop/wm.c): `src/desktop/wm.c`
- [Desktop runtime](https://github.com/rizonesoft/impossible-os/blob/main/src/desktop/desktop.c): `src/desktop/desktop.c`
- [Native API](https://github.com/rizonesoft/impossible-os/blob/main/include/kernel/nt/nt_syscall.h): `include/kernel/nt/nt_syscall.h`
- [Win32 subsystem](https://github.com/rizonesoft/impossible-os/blob/main/user/lib/win32.c): `user/lib/win32.c`
- [Windows-like shell](https://github.com/rizonesoft/impossible-os/blob/main/src/desktop/controls.c): `src/desktop/controls.c`

### Other components

- **UEFI firmware**

## Connections

- UEFI firmware → UEFI bootloader: starts (evidence: `README.md`)
- UEFI bootloader → Boot information ABI: passes boot_info (evidence: `README.md`)
- Boot information ABI → Kernel entry: hands off (evidence: `README.md`)
- Kernel entry → Boot phases: dispatches phases (evidence: `src/kernel/main.c`)
- Kernel entry → Virtual memory: initializes
- Kernel entry → SMP scheduler: starts
- Kernel entry → Storage and VFS: runs phase two (evidence: `src/kernel/main.c`)
- Boot phases → Storage and VFS: initializes services (evidence: `src/kernel/main/boot_storage.c`)
- Boot phases → ACPI services: initializes platform
- Boot phases → TPM measured boot: measures boot
- SMP scheduler → Kernel worker: runs worker (evidence: `src/kernel/sched/kworker.c`)
- Storage and VFS → Networking: initializes networking (evidence: `src/kernel/main/boot_storage.c`)
- Storage and VFS → Win32 Registry: initializes registry (evidence: `src/kernel/main/boot_storage.c`)
- SMP scheduler → Desktop runtime: supports runtime
- Graphics interface → Window manager: draws windows (evidence: `src/desktop/wm.c`)
- Window manager → Desktop runtime: composes desktop
- Desktop runtime → Windows-like shell: hosts shell
- Native API → Win32 subsystem: provides API (evidence: `README.md`)
- TPM measured boot → Mbed TLS crypto: uses cryptography
- UEFI bootloader → Boot entry parser: parses entries
