# nt-for-asi/m1n1_windows architecture

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

- Interactive diagram: https://gitdiagram.com/nt-for-asi/m1n1_windows
- Repository: https://github.com/nt-for-asi/m1n1_windows

## Overview

m1n1 is an Apple Silicon bootloader and hardware experimentation platform. Its boot path initializes the device, tries a concatenated kernel/devicetree/initramfs payload, and otherwise exposes a proxy over USB for host-side control. The host client also supports firmware protocols, hardware access, and tracing; the repository documents GPU support in Rust. The graph emphasizes those product stages and the DCP/AOP firmware layers. Some subsystem links are omitted because their implementation excerpts were not provided.

Main entry points: [`src/main.c`](https://github.com/nt-for-asi/m1n1_windows/blob/main/src/main.c) (Boot runtime), [`proxyclient/m1n1/fw/dcp/dcpep.py`](https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/dcp/dcpep.py) (DCP endpoint), [`proxyclient/m1n1/fw/asc/__init__.py`](https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/asc/__init__.py) (ASC endpoints), [`proxyclient/m1n1/fw/afk/epic.py`](https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/afk/epic.py) (EPIC transport)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Boot and payload"]
  node_bootloader["Boot runtime<br/>[main.c]"]
  node_payload["Payload loader<br/>[payload.c]"]
  node_devicetree["Device tree<br/>[adt.c]"]
  node_fdt["FDT operations<br/>[libfdt.h]"]
  node_memory["Memory support<br/>[memory.c]"]
end

subgraph group_hardware["Hardware and firmware"]
  node_proxy_runtime["UART proxy<br/>[uartproxy.c]"]
  node_dcp_parser["DCP parser<br/>[parser.c]"]
  node_asc["ASC endpoints<br/>[__init__.py]"]
  node_epic["EPIC transport<br/>[epic.py]"]
  node_rbep["Ring buffer<br/>[rbep.py]"]
  node_dcp["DCP endpoint<br/>[dcpep.py]"]
  node_dcp_ipc["DCP IPC<br/>[ipc.py]"]
  node_dcp_manager["DCP manager<br/>[manager.py]"]
  node_aop["AOP client<br/>[client.py]"]
  node_microsequence["GPU microsequences<br/>[microsequence.py]"]
end

subgraph group_host["Host control"]
  node_host_setup["Host setup<br/>[setup.py]"]
  node_proxy["Proxy protocol<br/>[proxy.py]"]
  node_proxy_utils["Proxy utilities<br/>[proxyutils.py]"]
  node_construct["Binary structures<br/>[constructutils.py]"]
  node_trace_dcp["DCP tracing<br/>[trace_dcp.py]"]
end

subgraph group_rust["Rust support"]
  node_rust_adt["Rust ADT<br/>[adt.rs]"]
  node_rust_gpu["GPU initialization<br/>[initdata.rs]"]
  node_rust_float["Float support<br/>[float.rs]"]
end

node_operator(("Operator"))
node_kernel_payload["Kernel payload"]

node_operator -->|"boots"| node_bootloader
node_bootloader -->|"tries payload"| node_payload
node_bootloader -->|"starts proxy"| node_proxy_runtime
node_kernel_payload -->|"concatenates with"| node_payload
node_bootloader -->|"reads device info"| node_devicetree
node_devicetree -.->|"uses FDT API"| node_fdt
node_host_setup -->|"constructs"| node_proxy
node_host_setup -->|"initializes"| node_proxy_utils
node_host_setup -.->|"configures"| node_asc
node_asc -->|"imports transport"| node_epic
node_epic -->|"imports ring buffer"| node_rbep
node_dcp -->|"extends"| node_asc
node_dcp -->|"registers endpoint"| node_epic
node_dcp_manager -->|"uses method map"| node_dcp_ipc
node_dcp_manager -->|"sends commands"| node_dcp
node_aop -->|"extends"| node_asc
node_trace_dcp -->|"traces protocol"| node_dcp
node_trace_dcp -->|"dispatches traces"| node_epic
node_rust_gpu -->|"reads device data"| node_rust_adt
node_rust_gpu -->|"uses float routines"| node_rust_float

click node_bootloader "https://github.com/nt-for-asi/m1n1_windows/blob/main/src/main.c"
click node_payload "https://github.com/nt-for-asi/m1n1_windows/blob/main/src/payload.c"
click node_devicetree "https://github.com/nt-for-asi/m1n1_windows/blob/main/src/adt.c"
click node_fdt "https://github.com/nt-for-asi/m1n1_windows/blob/main/src/libfdt/libfdt.h"
click node_memory "https://github.com/nt-for-asi/m1n1_windows/blob/main/src/memory.c"
click node_proxy_runtime "https://github.com/nt-for-asi/m1n1_windows/blob/main/src/uartproxy.c"
click node_dcp_parser "https://github.com/nt-for-asi/m1n1_windows/blob/main/src/dcp/parser.c"
click node_host_setup "https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/setup.py"
click node_proxy "https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/proxy.py"
click node_proxy_utils "https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/proxyutils.py"
click node_construct "https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/constructutils.py"
click node_asc "https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/asc/__init__.py"
click node_epic "https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/afk/epic.py"
click node_rbep "https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/afk/rbep.py"
click node_dcp "https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/dcp/dcpep.py"
click node_dcp_ipc "https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/dcp/ipc.py"
click node_dcp_manager "https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/dcp/manager.py"
click node_aop "https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/aop/client.py"
click node_microsequence "https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/agx/microsequence.py"
click node_trace_dcp "https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/hv/trace_dcp.py"
click node_rust_adt "https://github.com/nt-for-asi/m1n1_windows/blob/main/rust/src/adt.rs"
click node_rust_gpu "https://github.com/nt-for-asi/m1n1_windows/blob/main/rust/src/gpu/initdata.rs"
click node_rust_float "https://github.com/nt-for-asi/m1n1_windows/blob/main/rust/src/float.rs"

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_payload,node_devicetree,node_fdt,node_memory toneBlue
class node_proxy_runtime,node_dcp_parser,node_asc,node_epic,node_rbep,node_dcp,node_dcp_ipc,node_dcp_manager,node_aop,node_microsequence toneAmber
class node_host_setup,node_proxy,node_proxy_utils,node_construct,node_trace_dcp toneMint
class node_rust_adt,node_rust_gpu,node_rust_float toneRose
class node_operator,node_kernel_payload toneIndigo
```

## Components

### Boot and payload

- [Boot runtime](https://github.com/nt-for-asi/m1n1_windows/blob/main/src/main.c): `src/main.c`
- [Payload loader](https://github.com/nt-for-asi/m1n1_windows/blob/main/src/payload.c): `src/payload.c`
- [Device tree](https://github.com/nt-for-asi/m1n1_windows/blob/main/src/adt.c): `src/adt.c`
- [FDT operations](https://github.com/nt-for-asi/m1n1_windows/blob/main/src/libfdt/libfdt.h): `src/libfdt/libfdt.h`
- [Memory support](https://github.com/nt-for-asi/m1n1_windows/blob/main/src/memory.c): `src/memory.c`

### Hardware and firmware

- [UART proxy](https://github.com/nt-for-asi/m1n1_windows/blob/main/src/uartproxy.c): `src/uartproxy.c`
- [DCP parser](https://github.com/nt-for-asi/m1n1_windows/blob/main/src/dcp/parser.c): `src/dcp/parser.c`
- [ASC endpoints](https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/asc/__init__.py): `proxyclient/m1n1/fw/asc/__init__.py`
- [EPIC transport](https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/afk/epic.py): `proxyclient/m1n1/fw/afk/epic.py`
- [Ring buffer](https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/afk/rbep.py): `proxyclient/m1n1/fw/afk/rbep.py`
- [DCP endpoint](https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/dcp/dcpep.py): `proxyclient/m1n1/fw/dcp/dcpep.py`
- [DCP IPC](https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/dcp/ipc.py): `proxyclient/m1n1/fw/dcp/ipc.py`
- [DCP manager](https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/dcp/manager.py): `proxyclient/m1n1/fw/dcp/manager.py`
- [AOP client](https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/aop/client.py): `proxyclient/m1n1/fw/aop/client.py`
- [GPU microsequences](https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/fw/agx/microsequence.py): `proxyclient/m1n1/fw/agx/microsequence.py`

### Host control

- [Host setup](https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/setup.py): `proxyclient/m1n1/setup.py`
- [Proxy protocol](https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/proxy.py): `proxyclient/m1n1/proxy.py`
- [Proxy utilities](https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/proxyutils.py): `proxyclient/m1n1/proxyutils.py`
- [Binary structures](https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/m1n1/constructutils.py): `proxyclient/m1n1/constructutils.py`
- [DCP tracing](https://github.com/nt-for-asi/m1n1_windows/blob/main/proxyclient/hv/trace_dcp.py): `proxyclient/hv/trace_dcp.py`

### Rust support

- [Rust ADT](https://github.com/nt-for-asi/m1n1_windows/blob/main/rust/src/adt.rs): `rust/src/adt.rs`
- [GPU initialization](https://github.com/nt-for-asi/m1n1_windows/blob/main/rust/src/gpu/initdata.rs): `rust/src/gpu/initdata.rs`
- [Float support](https://github.com/nt-for-asi/m1n1_windows/blob/main/rust/src/float.rs): `rust/src/float.rs`

### Other components

- **Operator**
- **Kernel payload**

## Connections

- Operator → Boot runtime: boots
- Boot runtime → Payload loader: tries payload (evidence: `src/main.c`)
- Boot runtime → UART proxy: starts proxy (evidence: `src/main.c`)
- Kernel payload → Payload loader: concatenates with
- Boot runtime → Device tree: reads device info (evidence: `src/main.c`)
- Device tree → FDT operations: uses FDT API
- Host setup → Proxy protocol: constructs (evidence: `proxyclient/m1n1/setup.py`)
- Host setup → Proxy utilities: initializes (evidence: `proxyclient/m1n1/setup.py`)
- Host setup → ASC endpoints: configures
- ASC endpoints → EPIC transport: imports transport (evidence: `proxyclient/m1n1/fw/afk/epic.py`)
- EPIC transport → Ring buffer: imports ring buffer (evidence: `proxyclient/m1n1/fw/afk/epic.py`)
- DCP endpoint → ASC endpoints: extends (evidence: `proxyclient/m1n1/fw/dcp/client.py`)
- DCP endpoint → EPIC transport: registers endpoint (evidence: `proxyclient/m1n1/fw/dcp/client.py`)
- DCP manager → DCP IPC: uses method map (evidence: `proxyclient/m1n1/fw/dcp/manager.py`)
- DCP manager → DCP endpoint: sends commands (evidence: `proxyclient/m1n1/fw/dcp/manager.py`)
- AOP client → ASC endpoints: extends (evidence: `proxyclient/m1n1/fw/aop/client.py`)
- DCP tracing → DCP endpoint: traces protocol (evidence: `proxyclient/hv/trace_dcp.py`)
- DCP tracing → EPIC transport: dispatches traces (evidence: `proxyclient/hv/trace_dcp.py`)
- GPU initialization → Rust ADT: reads device data (evidence: `rust/src/gpu/initdata.rs`)
- GPU initialization → Float support: uses float routines (evidence: `rust/src/gpu/initdata.rs`)
