# ventoy/pxe architecture

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

- Interactive diagram: https://gitdiagram.com/ventoy/pxe
- Repository: https://github.com/ventoy/pxe

## Overview

This tree is iPXE, the network-boot component identified by the README as part of iVentoy—not Ventoy itself. Its principal workflow starts in the iPXE entry point, proceeds through boot orchestration and network boot services, and hands a selected image to a format-specific loader. The tree also contains hardware drivers, GRUB filesystem support, and decompression libraries. Some subsystem links are documented only at a high level; those are dashed and uncited rather than inferred as direct calls.

Main entry points: [`iPXE/ipxe-bd13697/src/usr/autoboot.c`](https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/usr/autoboot.c) (Autoboot), [`iPXE/ipxe-bd13697/src/arch/x86/image`](https://github.com/ventoy/pxe/tree/master/iPXE/ipxe-bd13697/src/arch/x86/image) (Boot image formats), [`iPXE/ipxe-bd13697/src/core/grub/fs`](https://github.com/ventoy/pxe/tree/master/iPXE/ipxe-bd13697/src/core/grub/fs) (GRUB filesystems), [`iPXE/ipxe-bd13697/src/core/main.c`](https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/core/main.c) (iPXE entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Boot workflow"]
  node_entry["iPXE entry<br/>[main.c]"]
  node_autoboot["Autoboot<br/>[autoboot.c]"]
end

subgraph group_network["Network boot"]
  node_dhcp["DHCP client<br/>[dhcp.c]"]
  node_download["Image download<br/>[downloader.c]"]
  node_pxe_services["PXE services<br/>[pxe_loader.c]"]
end

subgraph group_images["Images and filesystems"]
  node_image_cmd["Image commands<br/>[image_cmd.c]"]
  node_image_formats["Boot image formats"]
  node_grub_fs["GRUB filesystems"]
  node_zstd["Zstandard decoder<br/>[zstd_decompress.c]"]
  node_lzo["LZO decoder<br/>[minilzo.c]"]
end

subgraph group_platform["Platform support"]
  node_usb["xHCI USB driver<br/>[xhci.c]"]
  node_phantom["Phantom NIC driver<br/>[phantom.c]"]
  node_xen["Xen guest interface<br/>[xen.h]"]
end

node_pxe_actor(("PXE environment"))
node_server(("Network boot server"))
node_os(("Booted OS"))

node_pxe_actor -.->|"starts"| node_entry
node_entry -->|"calls"| node_autoboot
node_autoboot -.->|"uses"| node_dhcp
node_autoboot -.->|"fetches"| node_download
node_server -.->|"serves boot config"| node_dhcp
node_server -.->|"serves images"| node_download
node_autoboot -.->|"boots image"| node_image_formats
node_image_cmd -.->|"loads formats"| node_image_formats
node_image_formats -.->|"transfers control"| node_os
node_grub_fs -.->|"uses decoder"| node_zstd
node_grub_fs -.->|"uses decoder"| node_lzo

click node_entry "https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/core/main.c"
click node_autoboot "https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/usr/autoboot.c"
click node_dhcp "https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/net/udp/dhcp.c"
click node_download "https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/core/downloader.c"
click node_pxe_services "https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/arch/x86/interface/pxe/pxe_loader.c"
click node_image_cmd "https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/hci/commands/image_cmd.c"
click node_image_formats "https://github.com/ventoy/pxe/tree/master/iPXE/ipxe-bd13697/src/arch/x86/image"
click node_grub_fs "https://github.com/ventoy/pxe/tree/master/iPXE/ipxe-bd13697/src/core/grub/fs"
click node_zstd "https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/core/grub/lib/zstd/zstd_decompress.c"
click node_lzo "https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/core/grub/lib/minilzo/minilzo.c"
click node_usb "https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/drivers/usb/xhci.c"
click node_phantom "https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/drivers/net/phantom/phantom.c"
click node_xen "https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/include/xen/xen.h"

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_entry,node_autoboot toneBlue
class node_dhcp,node_download,node_pxe_services toneAmber
class node_image_cmd,node_image_formats,node_grub_fs,node_zstd,node_lzo,node_server toneMint
class node_usb,node_phantom,node_xen toneRose
class node_pxe_actor,node_os toneIndigo
```

## Components

### Boot workflow

- [iPXE entry](https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/core/main.c): `iPXE/ipxe-bd13697/src/core/main.c`
- [Autoboot](https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/usr/autoboot.c): `iPXE/ipxe-bd13697/src/usr/autoboot.c`

### Network boot

- [DHCP client](https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/net/udp/dhcp.c): `iPXE/ipxe-bd13697/src/net/udp/dhcp.c`
- [Image download](https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/core/downloader.c): `iPXE/ipxe-bd13697/src/core/downloader.c`
- [PXE services](https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/arch/x86/interface/pxe/pxe_loader.c): `iPXE/ipxe-bd13697/src/arch/x86/interface/pxe/pxe_loader.c`

### Images and filesystems

- [Image commands](https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/hci/commands/image_cmd.c): `iPXE/ipxe-bd13697/src/hci/commands/image_cmd.c`
- [Boot image formats](https://github.com/ventoy/pxe/tree/master/iPXE/ipxe-bd13697/src/arch/x86/image): `iPXE/ipxe-bd13697/src/arch/x86/image`
- [GRUB filesystems](https://github.com/ventoy/pxe/tree/master/iPXE/ipxe-bd13697/src/core/grub/fs): `iPXE/ipxe-bd13697/src/core/grub/fs`
- [Zstandard decoder](https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/core/grub/lib/zstd/zstd_decompress.c): `iPXE/ipxe-bd13697/src/core/grub/lib/zstd/zstd_decompress.c`
- [LZO decoder](https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/core/grub/lib/minilzo/minilzo.c): `iPXE/ipxe-bd13697/src/core/grub/lib/minilzo/minilzo.c`

### Platform support

- [xHCI USB driver](https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/drivers/usb/xhci.c): `iPXE/ipxe-bd13697/src/drivers/usb/xhci.c`
- [Phantom NIC driver](https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/drivers/net/phantom/phantom.c): `iPXE/ipxe-bd13697/src/drivers/net/phantom/phantom.c`
- [Xen guest interface](https://github.com/ventoy/pxe/blob/master/iPXE/ipxe-bd13697/src/include/xen/xen.h): `iPXE/ipxe-bd13697/src/include/xen/xen.h`

### Other components

- **PXE environment**
- **Network boot server**
- **Booted OS**

## Connections

- PXE environment → iPXE entry: starts
- iPXE entry → Autoboot: calls (evidence: `iPXE/ipxe-bd13697/src/core/main.c`)
- Autoboot → DHCP client: uses
- Autoboot → Image download: fetches
- Network boot server → DHCP client: serves boot config
- Network boot server → Image download: serves images
- Autoboot → Boot image formats: boots image
- Image commands → Boot image formats: loads formats
- Boot image formats → Booted OS: transfers control
- GRUB filesystems → Zstandard decoder: uses decoder
- GRUB filesystems → LZO decoder: uses decoder
