Skip to content

Add Graphite-owned PBHGetVInfo for every mounted volume - #42

Merged
colemancda merged 4 commits into
masterfrom
feature/volume-info
Dec 1, 2026
Merged

colemancda merged 4 commits into
masterfrom
feature/volume-info

Conversation

@colemancda

Copy link
Copy Markdown
Member

Adds volume information for the POSIX volume and mounted snapshot-catalog volumes, completing the volume side of the File Manager routing from #41.

HVolumeParam codec

  • HVolumeParam and HVolumeParamGuestCodec cover the 122-byte record. Offsets come from Retro68's Multiversal headers via the compiler, not from memory: a 4-byte filler follows ioVRefNum, so ioVolIndex sits at byte 28.
  • Five 32-bit fields are only two-byte aligned (ioVNxtCNID at 58, ioVBkUp at 72, ioVWrCnt at 78, ioVFilCnt at 82, ioVDirCnt at 86), so every field is assembled from bytes.
  • results writes back ioResult, ioVRefNum and the volume description from ioVCrDate on, or only ioResult when the call fails.

PBHGetVInfo (FileSystem.volumeInformation)

  • Choosing the volume: a positive ioVolIndex picks by position (POSIX volume first, then catalogs in mount order). A negative one picks by name, ignoring case and accepting Volume: or a full path, then falls back to ioVRefNum. Zero picks by number, where 0 is the default volume, which may be a catalog. An index or name that matches nothing is nsvErr.
  • Catalog volumes report root and total file counts, folder count, size in 512-byte blocks, the next catalog ID, and the hardware-lock attribute (bit 7), as a CD-ROM does.
  • The POSIX volume reports its real space from Volume.space in 16-bit block counts.
  • The volume name is returned for the host to write at ioNamePtr, and asynchronous calls name their completion routine.
  • SnapshotCatalog.statistics supplies the catalog counts.

Policies to review

  • Drive numbers are volume positions starting at 1, and driver reference numbers are 0.
  • Catalog volumes have no dates and no free space.
  • The POSIX volume reports 0 file and folder counts rather than counting a host disk.
  • An unknown volume number falls back to the POSIX volume, matching the other calls.

None of these are checked against Mac OS 9 yet.

Tests

VolumeInformationTests cover the record layout, unaligned fields, write-back fields, and selection by index, name and number, including a catalog as the default volume. All package tests pass.

@colemancda
colemancda merged commit 9a63852 into master Dec 1, 2026
3 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