vms-4a8: bootable-image vms.ko carries the kernel-resident ODS-2 codec (unblocks ACP boot) - #645
Merged
Merged
Conversation
The bootable vmsfs.ko is built by the in-tree drivers/ovmx/ overlay, which
FLATTENS all module sources to basenames. The genuine ODS-2 codec was absent
there: its sources #include the public header by a SUBDIR path
("vmsfs/ods2.h"), which the basename-flatten model could not resolve, so the
overlay Kbuild left -DOVMX_ODS2_KERNEL undefined and dropped the codec objects
(vms-dcd's tracked follow-up). The shipped module therefore could not read a
genuine ODS-2 volume.
Make the flatten subdir-safe, additively:
- overlay-ovmx-drivers.sh: a sources.conf line may now use `<glob> -> <subdir>/`
to stage matched files UNDER the module dir's <subdir>/ instead of at the
flat root. Lines without `->` flatten to basenames exactly as before -- the
convention is purely additive and touches no other module.
- vmsfs/sources.conf: stage the codec (src/vmsfs/ods2/*.c,*.h) and stage the
public header preserving its path: `src/vmsfs/include/vmsfs/ods2.h -> vmsfs/`,
so #include "vmsfs/ods2.h" resolves via -I$(src) in the flat dir.
- vmsfs/Kbuild: add the codec objects (ods2_reader/writer/bdev/path/block_kern
+ vmsfs_ods2ro) and define -DOVMX_ODS2_KERNEL, so the OVMX_ODS2_KERNEL gate in
vmsfs_super.c (vmsfs_ods2ro_register) now resolves -- no dangling symbol.
- Dockerfile.bootable: add binutils and an nm proof that the shipped vmsfs.ko
carries vmsfs_ods2ro_register + ods2_* (codec-compiled-in gate).
ADDITIVE: this makes the shipping module CARRY the codec; it does NOT flip the
boot default or mount SYS$DISK via the ACP (the atomic-flip / boot rung).
Codec source and Kbuild object list are untouched, so the out-of-tree
(src/kernel/vmsfs/Makefile), userspace, Alpha (build-vmsko-alpha.sh) and VAX
(build-vms-module-vax.sh) builds keep their include paths. Alpha/VAX peers
should re-run their cross-builds as a heads-up.
Proof: staged the overlay into a fabricated kernel tree and built the FLAT
layout against real kernel headers with the real Kbuild + -DOVMX_ODS2_KERNEL --
modpost clean (no undefined ods2_/vmsfs_ods2ro symbols) and nm shows
vmsfs_ods2ro_register + ods2_bdev_finish_open + ods2_wvolume_append_file in the
produced vmsfs.ko. Module-home gate 29/29; out-of-tree vms.ko + vmsfs.ko green.
Rung of epic vms-208 (Files-11 ODS-2 ACP in the executive).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…fail-loud on empty glob
The prior commit made the OVERLAY stage the ODS-2 codec, and proved it against a
fabricated kernel tree fed the FULL repo as REPO. But the real bootable build
(distro/Dockerfile.bootable, `kernel-build` stage) hands the overlay a REPO --
/tmp/ovmx-src -- assembled from only two COPYs: src/kernel and src/kernel-core.
src/vmsfs was never copied, so the codec globs (src/vmsfs/ods2/*.c and the
public header src/vmsfs/include/vmsfs/ods2.h) matched NOTHING in the real build.
The overlay merely WARNed (n stayed >0 from the src/kernel globs), the codec .c
files never staged, and the in-tree kernel build died with
make: *** No rule to make target 'drivers/ovmx/vmsfs/ods2_reader.o'
-> no bootable image -> every boot/e2e gate red. The fabricated-tree modpost
proof could not see this because it was given the whole repo, not the Dockerfile
build context (the #623-class in-tree blind spot).
Two fixes:
- Dockerfile.bootable (kernel-build stage): COPY src/vmsfs into /tmp/ovmx-src
before the overlay runs, so the codec sources + the subdir'd public header are
present in the exact REPO the overlay flattens from.
- overlay-ovmx-drivers.sh: a sources.conf glob that matches ZERO files is now a
hard FAIL, not a WARN. A glob naming files that aren't in the build context
silently drops objects the Kbuild requires; failing loudly at overlay time --
with the offending glob and REPO named -- turns a cryptic downstream
"No rule to make target" into an immediate, legible error. This is the guard
that would have caught the miss above at CI overlay time.
Verified: overlay against a REPO lacking src/vmsfs now FAILs with
"sources.conf glob 'src/vmsfs/ods2/*.c' ... matched no files"; against the full
repo it stages all 6 codec objects and the vmsfs/ods2.h header and completes.
Real `docker build --target kernel-build` proof appended below.
Rung of epic vms-208 (Files-11 ODS-2 ACP in the executive).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
baron-3dl
force-pushed
the
work/vms-4a8-bootable-codec
branch
from
August 17, 2026 04:44
dc021cf to
dbcbfc0
Compare
…ame under 2KB
The real Dockerfile kernel-build (previous commit unblocked staging) then
surfaced a genuine in-kernel error the userspace/fabricated builds never see:
ods2_writer.c: In function 'ods2_wvolume_dir_insert':
error: the frame size of 3288 bytes is larger than 2048 bytes
[-Werror=frame-larger-than=]
The function put ~2.6KB of scratch on the stack -- hdr[512] + hdr_parsed(512) +
newrec[512] + lbns[256]*4(1024) -- fine in userspace, but over the kernel's
2048-byte per-frame limit (the kernel stack is a few pages, and this is a leaf
of the ACP call chain). An -O2 userspace sweep with -Wframe-larger-than=2048
confirmed this is the ONLY codec function over the limit.
Fix (behaviour-identical): bundle those four buffers into ONE heap block, struct
di_scratch, allocated through the codec's existing allocator seam (ods2_kzalloc
-> kvmalloc in-kernel, malloc in userspace -- the same seam `flat` already
uses), and free it once at a new single `done:` exit. Every post-allocation
return became `goto done`; `flat`'s own frees fold into the same label (guarded
+ NULLed so the free is idempotent, no double-free on the success path). The
four pre-allocation argument-check returns keep returning directly (nothing to
free yet). No on-disk bytes or control decisions change -- only where the
scratch lives.
Verified: gcc -O2 -Wall -Wextra -Wframe-larger-than=2048 on ods2_writer.c is now
clean (no frame warning, no warnings). Host ods2 ctest + real docker
kernel-build proof below.
Rung of epic vms-208 (Files-11 ODS-2 ACP in the executive).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… (bdev_nr_bytes) With the frame-size fix in, the real Dockerfile kernel-build (6.12.103) advanced past the codec objects to vmsfs_ods2ro.c and hit the next genuine in-kernel break: vmsfs_ods2ro.c:387: error: 'struct block_device' has no member named 'bd_inode' The 6.x block layer removed 'bd_inode' from the public struct block_device (the bdev inode moved out of the struct). ods2ro_fill_super() used i_size_read(sb->s_bdev->bd_inode) purely to read the backing device's size in bytes. Replace it with bdev_nr_bytes(sb->s_bdev) -- the supported device-size accessor (linux/blkdev.h, present since 5.16), same byte count -- and include <linux/blkdev.h> explicitly rather than lean on a transitive include. More portable than before, not less: bdev_nr_bytes() spans 5.16..6.12+, so this also builds under the out-of-tree QEMU harness (src/kernel/vmsfs/Makefile) and the Alpha/VAX cross-builds, which compile the same file. A scan of the rest of vmsfs_ods2ro.c (mount_bdev / iget_locked / sb_set_blocksize / kill_block_super / register_filesystem) shows every other API unchanged in 6.12; the codec .c objects already compiled clean in the prior build. Real kernel-build proof to follow. Rung of epic vms-208 (Files-11 ODS-2 ACP in the executive). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
Real Dockerfile in-tree build now GREEN (the gate that was red)The original PR proved staging against a fabricated kernel tree fed the full repo — which masked the real bug. Rebuilt against the actual
Real build result (exit 0): Regression checks: host |
The zero-match-glob hard-fail added to overlay-ovmx-drivers.sh (previous commit) correctly aborts when a sources.conf glob stages nothing -- but it exposed a STALE scaffold in tests/integration/test_ovmx_module_home.sh. The demonstrator sub-test builds a scratch repo ($WORK/repo) that copies distro/kernel/drivers- ovmx (so vmsfs's sources.conf now carries the src/vmsfs/ods2/*.c codec glob) plus src/kernel + src/kernel-core, but NOT src/vmsfs. The codec glob then matched nothing and the new guard aborted the overlay, cascading the demonstrator's ovmxdemo-wiring assertions (ovmx_module_home_gate, Build & Test #9). Fix mirrors the real distro/Dockerfile.bootable change: the scratch repo now also stages src/vmsfs (carrying src/vmsfs/ods2/ + src/vmsfs/include/vmsfs/ods2.h), the same tree the kernel-build stage COPYs into its overlay context. vmsfs's codec glob matches, the overlay runs clean, and the demonstrator tests its actual concern (a new drivers-ovmx/<mod>/ subdir wires itself in) without tripping the guard. The guard is NOT weakened and vmsfs is NOT special-cased -- the test's scaffold was simply stale relative to the Dockerfile change. Verified via the ctest wrapper this time (not just the script): ctest -R ovmx_module_home_gate -> 1/1 Passed module-home gate: 29 passed, 0 failed (demonstrator + ovmxdemo assertions all green) Rung of epic vms-208 (Files-11 ODS-2 ACP in the executive). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Make the bootable-image vmsfs.ko (built by the in-tree
drivers/ovmx/overlay, not the out-of-treemake -C src/kernel) carry the kernel-resident genuine ODS-2 codec + read-only ODS-2 presentation, so the shipping module can mount+read a genuine ODS-2 volume. Rung of epic vms-208 (Files-11 ODS-2 ACP in the executive); unblocks the ACP boot rung.ADDITIVE: this makes the shipping module carry the codec. It does not flip the boot default or mount SYS$DISK via the ACP — the bespoke-VMFS path still drives boot until the atomic-flip rung. The codec is present-but-not-yet-driving-boot.
The gap (vms-dcd / #623)
The overlay FLATTENS every module source to a basename. The codec's sources
#include "vmsfs/ods2.h"— a subdir path — which the basename-flatten model can't resolve. So the overlay Kbuild deliberately leftOVMX_ODS2_KERNELundefined and dropped the codec objects (to avoid a dangling-symbol modpost break atvmsfs_ods2ro_register). The follow-up was tracked as vms-4a8 invmsfs_super.canddrivers-ovmx/vmsfs/Kbuild.Flatten-safe approach
A single additive convention, no source rename:
overlay-ovmx-drivers.sh: asources.confline may now use<glob> -> <subdir>/to stage matched files under the module dir's<subdir>/instead of the flat root. Lines without->flatten to basenames exactly as before — nothing else in the overlay, and no other module, changes.vmsfs/sources.conf: stage the codec (src/vmsfs/ods2/*.c,*.h) flat, and stage the one subdir'd public header preserving its path:src/vmsfs/include/vmsfs/ods2.h -> vmsfs/.#include "vmsfs/ods2.h"then resolves via-I$(src)(→<moddir>/vmsfs/ods2.h). Every other codec include is basename-only.vmsfs/Kbuild: add the codec objects (ods2_reader/writer/bdev/path/block_kern+vmsfs_ods2ro) and define-DOVMX_ODS2_KERNEL, so the gatedvmsfs_ods2ro_register()call invmsfs_super.cnow resolves — the inverse of vms-dcd: ODS-2 codec runs kernel-resident inside the shared FS engine (epic vms-208) #623's gap.Dockerfile.bootable: addbinutilsand annmgate asserting the shippedvmsfs.kocarriesvmsfs_ods2ro_register+ods2_*(codec-compiled-in proof).The codec source and the object list are untouched — the out-of-tree Makefile keeps its
-I .../vmsfs/includeinclude path, so the fix is invisible to every other build path.Modpost-clean-WITH-codec proof (local, real kernel headers)
Staged the overlay into a fabricated kernel tree and built the flat layout with the real staged Kbuild +
-DOVMX_ODS2_KERNELagainst real kernel headers:vmsfs.kolinks.ods2_*/vmsfs_ods2ro_*symbols.nm vmsfs.koshowsT vmsfs_ods2ro_register,T ods2_bdev_finish_open,T ods2_wvolume_append_file— the codec is compiled in.Regression
make -C src/kernel(vms.ko) andmake -C src/kernel/vmsfs(vmsfs.ko, the QEMU-test module) — both build clean, modpost clean, unchanged (this item edits onlydistro/).tests/integration/test_ovmx_module_home.sh— 29/29 pass (exercises the overlay incl. the new->line; the->-free demo module still flattens normally).distro/build plumbing (Docker + overlay + Kbuild + sources.conf); nothing in the CMake graph.⚠ Cross-build heads-up for peers
This edits only the in-tree overlay's include staging; it does not touch the codec sources or the
-I .../vmsfs/includeinclude convention the cross-builds rely on. As a precaution please re-run:tools/cross-alpha/build-vmsko-alpha.shtools/cross-vax/build-vms-module-vax.shBoth should be unaffected (their include paths are unchanged), but confirm.
🤖 Generated with Claude Code