# ipxe/wimboot architecture

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

- Interactive diagram: https://gitdiagram.com/ipxe/wimboot
- Repository: https://github.com/ipxe/wimboot

## Overview

wimboot is a Windows Imaging Format bootloader that stages WinPE files and transfers control to Windows boot code, supporting BIOS and UEFI boot environments. Its main workflow is documented as loading a WIM directly, exposing boot files through a virtual disk, and launching the Windows boot manager; iPXE can provide network boot over HTTP. The graph preserves WIM handling, decompression, patching, disk emulation, PE loading, and firmware support. Source excerpts are partial, so unverified implementation links are dashed rather than asserted as calls.

Main entry points: [`src/main.c`](https://github.com/ipxe/wimboot/blob/master/src/main.c) (Boot entry), [`src/efimain.c`](https://github.com/ipxe/wimboot/blob/master/src/efimain.c) (UEFI boot support), [`src/wim.c`](https://github.com/ipxe/wimboot/blob/master/src/wim.c) (WIM parser), [`src/peloader.c`](https://github.com/ipxe/wimboot/blob/master/src/peloader.c) (PE loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Boot orchestration"]
  node_main["Boot entry<br/>[main.c]"]
  node_cmdline["Command line<br/>[cmdline.c]"]
  node_bootapp["Boot application ABI<br/>[bootapp.h]"]
  node_pe["PE loader<br/>[peloader.c]"]
  node_paging["Memory paging<br/>[paging.c]"]
  node_memmap["Memory map<br/>[memmap.c]"]
end

subgraph group_wim["WIM processing"]
  node_wimfile["WIM file access<br/>[wimfile.h]"]
  node_wim["WIM parser<br/>[wim.c]"]
  node_lzx["LZX decompression<br/>[lzx.c]"]
  node_huffman["Huffman decoding<br/>[huffman.c]"]
  node_lznt1["LZNT1 decompression<br/>[lznt1.c]"]
  node_xca["XCA resources<br/>[xca.c]"]
  node_patch["WIM patching<br/>[wimpatch.c]"]
end

subgraph group_disk["Virtual boot media"]
  node_vdisk[("Virtual FAT disk<br/>[vdisk.c]")]
  node_int13["BIOS disk access<br/>[int13.c]"]
end

subgraph group_firmware["Firmware support"]
  node_efi["UEFI boot support<br/>[efimain.c]"]
  node_efi_io["UEFI file and block I/O<br/>[efifile.c]"]
  node_efi_specs["UEFI interfaces"]
  node_efi_device["UEFI device paths<br/>[DevicePath.h]"]
  node_efi_pe["EFI image format<br/>[PeImage.h]"]
  node_efi_block["UEFI block device<br/>[efiblock.c]"]
end

node_ipxe(("iPXE / operator"))

node_ipxe -.->|"starts boot"| node_main
node_main -->|"adds boot files"| node_vdisk
node_main -.->|"loads executable"| node_pe
node_main -.->|"passes boot ABI"| node_bootapp
node_main -.->|"reads options"| node_cmdline
node_main -.->|"opens WIM"| node_wim
node_main -.->|"patches boot image"| node_patch
node_main -.->|"decompresses image"| node_lznt1
node_main -.->|"configures paging"| node_paging
node_main -.->|"uses memory map"| node_memmap
node_main -.->|"handles BIOS disk"| node_int13
node_wim -.->|"uses decompressor"| node_lzx
node_lzx -.->|"uses decoding"| node_huffman
node_wim -.->|"reads resources"| node_xca
node_wim -.->|"reads files"| node_wimfile
node_patch -.->|"patches virtual files"| node_vdisk
node_efi -.->|"uses firmware I/O"| node_efi_io
node_efi -.->|"uses UEFI interfaces"| node_efi_specs
node_efi -.->|"exposes block device"| node_efi_block
node_efi -.->|"uses device paths"| node_efi_device
node_pe -.->|"loads PE images"| node_efi_pe
node_main -.->|"supports UEFI boot"| node_efi
node_main -.->|"supports BIOS boot"| node_int13

click node_main "https://github.com/ipxe/wimboot/blob/master/src/main.c"
click node_cmdline "https://github.com/ipxe/wimboot/blob/master/src/cmdline.c"
click node_bootapp "https://github.com/ipxe/wimboot/blob/master/src/bootapp.h"
click node_pe "https://github.com/ipxe/wimboot/blob/master/src/peloader.c"
click node_paging "https://github.com/ipxe/wimboot/blob/master/src/paging.c"
click node_memmap "https://github.com/ipxe/wimboot/blob/master/src/memmap.c"
click node_wimfile "https://github.com/ipxe/wimboot/blob/master/src/wimfile.h"
click node_wim "https://github.com/ipxe/wimboot/blob/master/src/wim.c"
click node_lzx "https://github.com/ipxe/wimboot/blob/master/src/lzx.c"
click node_huffman "https://github.com/ipxe/wimboot/blob/master/src/huffman.c"
click node_lznt1 "https://github.com/ipxe/wimboot/blob/master/src/lznt1.c"
click node_xca "https://github.com/ipxe/wimboot/blob/master/src/xca.c"
click node_patch "https://github.com/ipxe/wimboot/blob/master/src/wimpatch.c"
click node_vdisk "https://github.com/ipxe/wimboot/blob/master/src/vdisk.c"
click node_int13 "https://github.com/ipxe/wimboot/blob/master/src/int13.c"
click node_efi "https://github.com/ipxe/wimboot/blob/master/src/efimain.c"
click node_efi_io "https://github.com/ipxe/wimboot/blob/master/src/efifile.c"
click node_efi_specs "https://github.com/ipxe/wimboot/tree/master/src/efi/Uefi"
click node_efi_device "https://github.com/ipxe/wimboot/blob/master/src/efi/Protocol/DevicePath.h"
click node_efi_pe "https://github.com/ipxe/wimboot/blob/master/src/efi/IndustryStandard/PeImage.h"
click node_efi_block "https://github.com/ipxe/wimboot/blob/master/src/efiblock.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_main,node_cmdline,node_bootapp,node_pe,node_paging,node_memmap toneBlue
class node_wimfile,node_wim,node_lzx,node_huffman,node_lznt1,node_xca,node_patch toneAmber
class node_vdisk,node_int13 toneMint
class node_efi,node_efi_io,node_efi_specs,node_efi_device,node_efi_pe,node_efi_block toneRose
class node_ipxe toneIndigo
```

## Components

### Boot orchestration

- [Boot entry](https://github.com/ipxe/wimboot/blob/master/src/main.c): `src/main.c`
- [Command line](https://github.com/ipxe/wimboot/blob/master/src/cmdline.c): `src/cmdline.c`
- [Boot application ABI](https://github.com/ipxe/wimboot/blob/master/src/bootapp.h): `src/bootapp.h`
- [PE loader](https://github.com/ipxe/wimboot/blob/master/src/peloader.c): `src/peloader.c`
- [Memory paging](https://github.com/ipxe/wimboot/blob/master/src/paging.c): `src/paging.c`
- [Memory map](https://github.com/ipxe/wimboot/blob/master/src/memmap.c): `src/memmap.c`

### WIM processing

- [WIM file access](https://github.com/ipxe/wimboot/blob/master/src/wimfile.h): `src/wimfile.h`
- [WIM parser](https://github.com/ipxe/wimboot/blob/master/src/wim.c): `src/wim.c`
- [LZX decompression](https://github.com/ipxe/wimboot/blob/master/src/lzx.c): `src/lzx.c`
- [Huffman decoding](https://github.com/ipxe/wimboot/blob/master/src/huffman.c): `src/huffman.c`
- [LZNT1 decompression](https://github.com/ipxe/wimboot/blob/master/src/lznt1.c): `src/lznt1.c`
- [XCA resources](https://github.com/ipxe/wimboot/blob/master/src/xca.c): `src/xca.c`
- [WIM patching](https://github.com/ipxe/wimboot/blob/master/src/wimpatch.c): `src/wimpatch.c`

### Virtual boot media

- [Virtual FAT disk](https://github.com/ipxe/wimboot/blob/master/src/vdisk.c): `src/vdisk.c`
- [BIOS disk access](https://github.com/ipxe/wimboot/blob/master/src/int13.c): `src/int13.c`

### Firmware support

- [UEFI boot support](https://github.com/ipxe/wimboot/blob/master/src/efimain.c): `src/efimain.c`
- [UEFI file and block I/O](https://github.com/ipxe/wimboot/blob/master/src/efifile.c): `src/efifile.c`
- [UEFI interfaces](https://github.com/ipxe/wimboot/tree/master/src/efi/Uefi): `src/efi/Uefi`
- [UEFI device paths](https://github.com/ipxe/wimboot/blob/master/src/efi/Protocol/DevicePath.h): `src/efi/Protocol/DevicePath.h`
- [EFI image format](https://github.com/ipxe/wimboot/blob/master/src/efi/IndustryStandard/PeImage.h): `src/efi/IndustryStandard/PeImage.h`
- [UEFI block device](https://github.com/ipxe/wimboot/blob/master/src/efiblock.c): `src/efiblock.c`

### Other components

- **iPXE / operator**

## Connections

- iPXE / operator → Boot entry: starts boot
- Boot entry → Virtual FAT disk: adds boot files (evidence: `src/main.c`)
- Boot entry → PE loader: loads executable
- Boot entry → Boot application ABI: passes boot ABI
- Boot entry → Command line: reads options
- Boot entry → WIM parser: opens WIM
- Boot entry → WIM patching: patches boot image
- Boot entry → LZNT1 decompression: decompresses image
- Boot entry → Memory paging: configures paging
- Boot entry → Memory map: uses memory map
- Boot entry → BIOS disk access: handles BIOS disk
- WIM parser → LZX decompression: uses decompressor
- LZX decompression → Huffman decoding: uses decoding
- WIM parser → XCA resources: reads resources
- WIM parser → WIM file access: reads files
- WIM patching → Virtual FAT disk: patches virtual files
- UEFI boot support → UEFI file and block I/O: uses firmware I/O
- UEFI boot support → UEFI interfaces: uses UEFI interfaces
- UEFI boot support → UEFI block device: exposes block device
- UEFI boot support → UEFI device paths: uses device paths
- PE loader → EFI image format: loads PE images
- Boot entry → UEFI boot support: supports UEFI boot
- Boot entry → BIOS disk access: supports BIOS boot
