Skip to content

vms-7b15: OVMX/VAX boots from a SINGLE VMB-bootable disk (browser-demo artifact + boot simplification) - #758

Merged
baron-3dl merged 5 commits into
mainfrom
work/vms-7b15
Aug 23, 2026
Merged

baron-3dl merged 5 commits into
mainfrom
work/vms-7b15

Conversation

@baron-3dl

Copy link
Copy Markdown
Contributor

Consolidates the two-disk VAX boot (NetBSD FFS boot disk + separate raw ODS-2 volume) onto ONE labeled VMB-bootable disk — the single-artifact foundation for the PCjs browser demo, and a general boot simplification.

What

  • Single partitioned disk (Approach A): a NetBSD/vax disklabel where partition a VMB-boots the NetBSD root (kernel + /boot + /sbin/init=ovmx_init + vms.kmod/vmsfs.kmod + libc/ld.elf_so) and partition e carries the raw OVMX ODS-2 system volume; the executive mounts DKA0: from partition e.
  • Device map (src/kernel-netbsd/vms_blockdev_netbsd.c, VAX substrate only): DKA0:/DUA0: now carry a NULL-terminated candidate list {/dev/ra1c, /dev/ra0e}, first that opens wins. Strictly additive + backward-compatible/dev/ra1c is still first, so the existing two-disk boot binds ra1c and never reaches ra0e; single-disk falls through to ra0e only when rq1 is absent.
  • Harness: new tests/lab-vax/run-boot.sh sysboot-single mode (+ mk_single_disk.py) that assembles the slim single disk (resize_ffs the root down, inject ODS-2 into partition e, rewrite the disklabel/geometry). Existing sysboot/gate/negctl modes untouched.

Proof (real SIMH, one attach rq0, no rq1)

>>> B/R5:2 DUA0 → NetBSD 10.1 (OVMX) → vms: disk unit DKA0: -> ra0e (9:4)
%OVMX-I-MOUNTED, system disk DKA0: mounted → SYSTEM [1,4] → Username:

sha256 changed across the boot (real ODS-2 writes on partition e, INV-6 teeth). Zero %OVMX-W-OWNER warnings.

Size

340,152,320 bytes (324 MiB) raw, ~53 MiB gzip'd — 6.3× smaller than the two-disk RA92 layout. Slim-sized to fit (256 MiB FFS + 64 MiB ODS-2).

VAX-substrate only (src/kernel-netbsd) — does NOT ride the 3-way gate; the kmod cross-compiles clean. Two real bugs found+fixed en route (a test -c vs -b node check; a masked resize_ffs OOM-kill on the 32 MB VAX). Note: the boot images here are DYNAMIC (ld.elf_so); the -static fast version is vms-0ab.

baron-3dl and others added 5 commits August 23, 2026 03:25
…(ODS-2 partition on the boot disk)

The Files-11 ODS-2 ACP's SYS$DISK (DKA0:) resolve now carries a
NULL-terminated list of candidate backing devices, tried in order, first
that opens wins:

  1. /dev/ra1c -- two-disk layout (ODS-2 = whole separate MSCP disk on rq1)
  2. /dev/ra0e -- single-disk layout (ODS-2 = partition 'e' of the boot disk)

Order is zero-regression for the two-disk proof: with rq1 attached, ra1c
opens and ra0e is never reached. In the single-disk boot rq1 is absent, so
the ra1c open fails honestly (ENXIO) and the resolve falls through to the
ODS-2 partition on the boot disk. A candidate binds only if its real block
open succeeds (INV-6 / Rule 9).

VAX substrate only (src/kernel-netbsd/); not the 3-way convergence gate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…im mk_single_disk

Adds the SLIM single-disk artifact path to the lab-vax boot harness:

- drive_boot_vax.py: assemble-single mode (boot the shared NetBSD disk,
  resize_ffs the target root FFS, MAKEDEV ra0 so /dev/ra0e exists, swap in
  the ra0e-aware vms.kmod) and sysboot-single mode (boot ONE disk, no rq1,
  as a custom-sized RAUSER MSCP disk; require DKA0: -> ra0e + the full
  gate/PROVISION/Username: pass bar).
- mk_single_disk.py: host-side NetBSD disklabel rewrite (shrink 'a', add the
  ODS-2 partition 'e', slim geometry: whole-disk 'c' + secperunit + drop the
  off-disk swap), inject the mastered ODS-2 system volume into 'e', truncate
  to the slim size. Validated: checksum matches, geometry consistent.
- run-boot.sh: sysboot-single mode orchestrating build_single_disk +
  run_sysboot_single, with sha256 before/after INV-6 write teeth.

Slim target: root FFS 200 MiB (resize_ffs) + ODS-2 64 MiB on a RAUSER=280
(~267 MiB) disk, vs the 2 GiB two-disk RA92 install. Two-disk path untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The ODS-2 partition node /dev/ra0e is a block special (brw-, major 9)
opened via vn_bdev_openpath; the assemble-single verification used test -c
(char) and spuriously failed after MAKEDEV ra0 correctly created it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…root lacks it)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…hrink, 256 MiB root

The single-disk boot failed with 'exec /sbin/init: error 22' for every init
binary. Root cause: resize_ffs was OOM-killed ('UVM: ... out of swap') on the
32 MB VAX (single-user enables no swap), its failure masked by a '| tail'
pipe, so the FFS was never shrunk — then host-side truncation cut a full-size
filesystem down to the slim size, corrupting it.

Fixes in do_assemble_single:
- enable a 384 MiB swap FILE on the (writable) shared root before resize_ffs;
- run resize_ffs with NO pipe so run()'s marker captures its REAL exit code,
  and require RESIZE_EXIT=0;
- after mounting, VERIFY via df that the FFS is actually <= the target size —
  refuse to build (and later truncate) a disk that did not shrink;
- clean up the swap file afterward.

Also give resize_ffs comfortable headroom: root FFS 256 MiB (was 200), slim
disk RAUSER=340 (324 MiB) — still ~6x smaller than the 2 GiB two-disk image.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@baron-3dl
baron-3dl merged commit 24f3dd0 into main Aug 23, 2026
93 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.

1 participant