# timeto2025/ios-26-hot-raphael architecture

> Architecture diagram of the GitHub repository timeto2025/ios-26-hot-raphael, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/timeto2025/ios-26-hot-raphael
- Repository: https://github.com/timeto2025/ios-26-hot-raphael

## Overview

This is an experimental iOS 26 port for the Redmi K20 Pro/Mi 9T Pro. Its main runtime path is booting the phone into iOS, then using userland drivers and services to expose hardware capabilities. The graph includes documented audio, Wi-Fi, and GPU/Metal paths, plus the boot shim and cellular client. README statements establish several cross-subsystem relationships; source excerpts and the index support the more specific internal links. The tree does not include the XNU implementation, and cellular, camera, and GPS are documented as unfinished.

Main entry points: [`phone/metal2`](https://github.com/timeto2025/ios-26-hot-raphael/tree/master/phone/metal2) (HotMetal2 frontend), [`phone/adsp/adspd.c`](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/adsp/adspd.c) (ADSP daemon), [`phone/audio/audio_plugin.c`](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/audio/audio_plugin.c) (CoreAudio plugin), [`shim/shim.c`](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/shim/shim.c) (Boot shim)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Boot and diagnostics"]
  node_shim["Boot shim<br/>[shim.c]"]
  node_gpu_probe["GPU probe<br/>[gpuprobe.c]"]
end

subgraph group_audio["Audio"]
  node_adsp_glink["ADSP GLINK transport<br/>[adsp_glink.c]"]
  node_adsp_q6["Q6 audio engine<br/>[adsp_q6.c]"]
  node_adspd["ADSP daemon<br/>[adspd.c]"]
  node_audio_plugin["CoreAudio plugin<br/>[audio_plugin.c]"]
  node_hostclock["Host clock fix<br/>[hot_hostclock.h]"]
end

subgraph group_wireless["Wireless"]
  node_wland["Wi-Fi daemon<br/>[wland.c]"]
  node_wifi_radio["WLAN radio<br/>[radio.c]"]
  node_cellular_qmi["Cellular QMI client<br/>[qmi_cellular.c]"]
end

subgraph group_graphics["Graphics"]
  node_gpu_userland["GPU userland<br/>[gpu.c]"]
  node_gpu_memory["GPU memory<br/>[pmem.c]"]
  node_metal_frontend["HotMetal2 frontend"]
  node_metal_bridge["Metal bridge"]
  node_turnip["Turnip Vulkan<br/>[vktest.c]"]
  node_sweetgpu["GPU service interface<br/>[sweetgpu.c]"]
end

node_phone_user(("Phone user"))

node_phone_user -->|"boots through"| node_shim
node_shim -->|"runs probe"| node_gpu_probe
node_adspd -->|"uses transport"| node_adsp_glink
node_adspd -.->|"uses audio engine"| node_adsp_q6
node_audio_plugin -.->|"exchanges audio"| node_adspd
node_audio_plugin -->|"fixes clock"| node_hostclock
node_wland -->|"starts radio"| node_wifi_radio
node_cellular_qmi -->|"uses QRTR socket"| node_wland
node_gpu_userland -->|"allocates memory"| node_gpu_memory
node_metal_frontend -.->|"uses bridge"| node_metal_bridge
node_metal_frontend -.->|"uses Vulkan backend"| node_turnip
node_metal_frontend -.->|"uses GPU interface"| node_sweetgpu

click node_shim "https://github.com/timeto2025/ios-26-hot-raphael/blob/master/shim/shim.c"
click node_gpu_probe "https://github.com/timeto2025/ios-26-hot-raphael/blob/master/shim/gpuprobe.c"
click node_adsp_glink "https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/adsp/adsp_glink.c"
click node_adsp_q6 "https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/adsp/adsp_q6.c"
click node_adspd "https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/adsp/adspd.c"
click node_audio_plugin "https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/audio/audio_plugin.c"
click node_hostclock "https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/audio/hot_hostclock.h"
click node_wland "https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/wifi/wland.c"
click node_wifi_radio "https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/wifi/radio.c"
click node_cellular_qmi "https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/cellular/qmi_cellular.c"
click node_gpu_userland "https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/gpu/gpu.c"
click node_gpu_memory "https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/gpu/pmem.c"
click node_metal_frontend "https://github.com/timeto2025/ios-26-hot-raphael/tree/master/phone/metal2"
click node_metal_bridge "https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/metal2/bridge/NativeMetalObjects.rs"
click node_turnip "https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/turnip/vktest.c"
click node_sweetgpu "https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/metal/sweetgpu.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_shim,node_gpu_probe,node_phone_user toneBlue
class node_adsp_glink,node_adsp_q6,node_adspd,node_audio_plugin,node_hostclock toneAmber
class node_wland,node_wifi_radio,node_cellular_qmi toneMint
class node_gpu_userland,node_gpu_memory,node_metal_frontend,node_metal_bridge,node_turnip,node_sweetgpu toneRose
```

## Components

### Boot and diagnostics

- [Boot shim](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/shim/shim.c): `shim/shim.c`
- [GPU probe](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/shim/gpuprobe.c): `shim/gpuprobe.c`

### Audio

- [ADSP GLINK transport](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/adsp/adsp_glink.c): `phone/adsp/adsp_glink.c`
- [Q6 audio engine](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/adsp/adsp_q6.c): `phone/adsp/adsp_q6.c`
- [ADSP daemon](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/adsp/adspd.c): `phone/adsp/adspd.c`
- [CoreAudio plugin](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/audio/audio_plugin.c): `phone/audio/audio_plugin.c`
- [Host clock fix](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/audio/hot_hostclock.h): `phone/audio/hot_hostclock.h`

### Wireless

- [Wi-Fi daemon](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/wifi/wland.c): `phone/wifi/wland.c`
- [WLAN radio](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/wifi/radio.c): `phone/wifi/radio.c`
- [Cellular QMI client](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/cellular/qmi_cellular.c): `phone/cellular/qmi_cellular.c`

### Graphics

- [GPU userland](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/gpu/gpu.c): `phone/gpu/gpu.c`
- [GPU memory](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/gpu/pmem.c): `phone/gpu/pmem.c`
- [HotMetal2 frontend](https://github.com/timeto2025/ios-26-hot-raphael/tree/master/phone/metal2): `phone/metal2`
- [Metal bridge](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/metal2/bridge/NativeMetalObjects.rs): `phone/metal2/bridge/NativeMetalObjects.rs`
- [Turnip Vulkan](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/turnip/vktest.c): `phone/turnip/vktest.c`
- [GPU service interface](https://github.com/timeto2025/ios-26-hot-raphael/blob/master/phone/metal/sweetgpu.c): `phone/metal/sweetgpu.c`

### Other components

- **Phone user**

## Connections

- Phone user → Boot shim: boots through (evidence: `README.md`)
- Boot shim → GPU probe: runs probe (evidence: `shim/shim.c`)
- ADSP daemon → ADSP GLINK transport: uses transport (evidence: `phone/adsp/adsp_glink.c`)
- ADSP daemon → Q6 audio engine: uses audio engine (evidence: `README.md`)
- CoreAudio plugin → ADSP daemon: exchanges audio (evidence: `README.md`)
- CoreAudio plugin → Host clock fix: fixes clock (evidence: `phone/audio/audio_plugin.c`)
- Wi-Fi daemon → WLAN radio: starts radio (evidence: `phone/wifi/wland.c`)
- Cellular QMI client → Wi-Fi daemon: uses QRTR socket (evidence: `phone/cellular/qmi_cellular.c`)
- GPU userland → GPU memory: allocates memory (evidence: `phone/gpu/gpu.c`)
- HotMetal2 frontend → Metal bridge: uses bridge
- HotMetal2 frontend → Turnip Vulkan: uses Vulkan backend (evidence: `README.md`)
- HotMetal2 frontend → GPU service interface: uses GPU interface
