Add Windows WHP runtime support - #1
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Windows/WHP as a supported runtime backend and extends the CLI/SDK surface to cover Windows-friendly networking, disk persistence/attachment, and release-time distribution of prebuilt rootfs assets.
Changes:
- Introduces Windows/WHP native backend modules (devices, IRQ delivery, boot params, ELF loader, etc.) and Windows build/packaging support (libslirp vendoring, prebuild staging, CI/workflows).
- Extends runtime/networking/disk UX:
slirpnetworking mode, attached disks, persistent/explicit root disk materialization, and related type/CLI changes. - Adds scaffolding for a future pure-TS ext4 writer (stubs + contract tests) and improves OCI blob downloads with progress reporting.
Reviewed changes
Copilot reviewed 80 out of 93 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| vcpkg.json | Adds a vcpkg manifest for Windows native deps (libslirp/glib). |
| third_party/libslirp/lib/x64-windows/libslirp.lib | Adds vendored Windows import library for libslirp. |
| third_party/libslirp/lib/x64-windows/libslirp.exp | Adds vendored export file used to generate the import library. |
| third_party/libslirp/lib/x64-windows/libslirp.def | Adds DEF file enumerating exported libslirp symbols. |
| third_party/libslirp/include/libslirp-version.h | Adds vendored libslirp version header. |
| test/ext4.test.ts | Adds contract tests for ext4 writer scaffolding / NotImplemented stubs. |
| src/types.ts | Expands SDK/CLI types (slirp, host capabilities, disk attach/persist/prebuilt knobs). |
| src/process.ts | Improves Windows compatibility (where.exe) + coverage annotations for OS-specific paths. |
| src/oci.ts | Adds blob download progress plumbing + progress formatting/reporting. |
| src/net.ts | Adds slirp network mode and hostfwd mapping generation for libslirp. |
| src/kvm.ts | Adds config validation, updates default cmdline, and adds virtio-mmio arg helpers for attached devices. |
| src/ext4/writer.ts | Introduces Ext4ImageWriter scaffold (all methods stubbed for phase 1). |
| src/ext4/types.ts | Adds shared ext4 writer types/enums/spec structs. |
| src/ext4/superblock.ts | Adds superblock model and NotImplementedError scaffold. |
| src/ext4/inode.ts | Adds inode + inode table scaffolding (stubs). |
| src/ext4/index.ts | Adds ext4 public re-export entrypoint (unstable namespace). |
| src/ext4/group.ts | Adds group descriptor table scaffolding (stubs). |
| src/ext4/dir.ts | Adds directory writer scaffolding + recordLength helper. |
| src/ext4/bitmap.ts | Adds bitmap scaffolding + group bitmap factory. |
| src/disk.ts | Adds persistent/explicit disk materialization + attached disk resolution/validation utilities. |
| src/cli.ts | Extends CLI flags (disk-path/size, prebuilt, persist/reset, attach-disk, slirp) and parsing. |
| scripts/whp-app-smoke.mjs | Adds Windows/WHP “framework apps” runtime smoke script. |
| scripts/vendor-libslirp.mjs | Vendors MSYS2 libslirp/glib DLLs and generates MSVC import lib/DEF. |
| scripts/package-prebuild.mjs | Extends prebuild packaging for Windows and ships Linux console helper. |
| scripts/pack-check.mjs | Makes pack-check work cross-platform and requires Win prebuilds when gated. |
| scripts/check-gcov.mjs | Updates gcov paths for the refactored native/kvm file layout. |
| scripts/build-prebuilt-rootfs.mjs | Adds script to produce release rootfs assets (.ext4.gz + manifest). |
| scripts/build-native.mjs | Adds Windows libslirp detection/staging logic for node-gyp builds. |
| package.json | Adds test:whp-apps and tweaks TS coverage command invocation. |
| native/whp/win_io.h | Adds Windows file I/O helper utilities for WHP virtio-blk and overlays. |
| native/whp/win_console_ctrl.h | Adds scoped Windows console Ctrl handler interface. |
| native/whp/win_console_ctrl.cc | Implements scoped console Ctrl handler (Ctrl-C/Ctrl-Break). |
| native/whp/virtio/rng.h | Adds virtio-rng-mmio device declaration. |
| native/whp/virtio/rng.cc | Implements virtio-rng device using BCryptGenRandom. |
| native/whp/virtio/desc.h | Adds shared virtio-mmio constants and descriptor helpers. |
| native/whp/virtio/blk.h | Adds virtio-blk-mmio device declaration (Windows). |
| native/whp/page_tables.h | Adds identity-map page table builder + segment/table helpers. |
| native/whp/page_tables.cc | Implements WHP bootstrap page table + segment/table helpers. |
| native/whp/irq.h | Adds WHP IRQ delivery state machine interface and helpers. |
| native/whp/irq.cc | Implements WHP IRQ delivery logic and injection decision helper. |
| native/whp/guest_memory.h | Adds typed guest RAM view helper for device address deref. |
| native/whp/elf_loader.h | Adds ELF64 kernel loader interface for WHP. |
| native/whp/elf_loader.cc | Implements ELF64 kernel loading into guest memory with bounds checks. |
| native/whp/devices/uart.h | Adds UART device interface and IRQ decoupling hooks. |
| native/whp/devices/pit.h | Adds minimal PIT device interface. |
| native/whp/devices/pit.cc | Implements PIT channels/modes used by Linux calibration. |
| native/whp/devices/pic.h | Adds minimal PIC device interface for early interrupt delivery. |
| native/whp/devices/pic.cc | Implements PIC init/mask and fixed-interrupt request routing. |
| native/whp/devices/hpet.h | Adds minimal HPET device interface/constants for MMIO clocksource. |
| native/whp/devices/cmos.h | Adds minimal CMOS/RTC device interface. |
| native/whp/devices/cmos.cc | Implements CMOS time registers from host UTC time. |
| native/whp/devices/acpi_pm_timer.h | Adds ACPI PM timer I/O port device interface. |
| native/whp/devices/acpi_pm_timer.cc | Implements ACPI PM timer monotonic counter reads. |
| native/whp/boot_params.h | Adds boot params + MP table writer declarations. |
| native/whp/boot_params.cc | Implements boot params + MP table writers. |
| native/whp/api.h | Adds dynamic WHP API loader (WinHvPlatform/WinHvEmulation). |
| native/common/bytes.h | Consolidates shared endian/range/Windows error helpers for native code. |
| guest/node-vmm-console.cc | Improves CRLF handling, TTY sizing, and exit drain behavior in console helper. |
| docs/testing.md | Updates testing guidance and adds WHP app smoke and Windows matrix notes. |
| docs/sdk.md | Updates SDK docs for Windows/WHP, prebuilt rootfs, disk persistence, and attached disks. |
| docs/publishing.md | Updates publishing/release process to include Windows prebuilds and rootfs prebuilts. |
| docs/features.md | Updates feature matrix for WHP runtime, prebuilt rootfs, and new disk/network surface. |
| docs/cpp-coverage-exclusions.json | Updates exclusion paths for the refactored KVM backend file name. |
| binding.gyp | Updates sources/layout and adds Windows compilation units + optional libslirp link. |
| .gitignore | Ignores new local tool/cache directories. |
| .github/workflows/release-prebuilds.yml | Adds tag workflow to build/upload Linux+Windows prebuilds and publish npm. |
| .github/workflows/prebuilt-rootfs.yml | Adds tag workflow to build and attach prebuilt rootfs release assets. |
| .github/workflows/ci.yml | Splits hosted/self-hosted jobs and adds Windows WHP gate structure. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
misaelzapata
force-pushed
the
windows-whp-bringup
branch
3 times, most recently
from
May 3, 2026 15:24
6f1d46d to
fe18258
Compare
misaelzapata
force-pushed
the
windows-whp-bringup
branch
from
May 3, 2026 15:32
fe18258 to
803dacd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation