Skip to content

Add Windows WHP runtime support - #1

Merged
misaelzapata merged 1 commit into
mainfrom
windows-whp-bringup
May 3, 2026
Merged

Add Windows WHP runtime support#1
misaelzapata merged 1 commit into
mainfrom
windows-whp-bringup

Conversation

@misaelzapata

Copy link
Copy Markdown
Owner

Summary

  • add Windows/WHP runtime support with modular WHP devices, virtio block/net/rng, lifecycle, SMP, console handling, and tests
  • add prebuilt rootfs download/build workflow plus persistent and attached disk support across CLI/SDK
  • update public README/docs/testing/publishing guidance for Windows, prebuilt disks, npm prebuilds, and release gates

Validation

  • npm test
  • NODE_VMM_PACK_REQUIRE_WIN32=1 node scripts/pack-check.mjs
  • npm run build:ts
  • git diff --check

Copilot AI review requested due to automatic review settings May 2, 2026 23:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: slirp networking 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.

Comment thread native/whp/boot_params.cc
Comment thread scripts/package-prebuild.mjs
Comment thread src/net.ts Outdated
Comment thread src/cli.ts
@misaelzapata
misaelzapata force-pushed the windows-whp-bringup branch 3 times, most recently from 6f1d46d to fe18258 Compare May 3, 2026 15:24
@misaelzapata
misaelzapata force-pushed the windows-whp-bringup branch from fe18258 to 803dacd Compare May 3, 2026 15:32
@misaelzapata
misaelzapata merged commit 777c2e7 into main May 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants