Repository navigation
Feature: libdiskimage and diskinfo - #96
Merged
Merged
Conversation
Add a library that opens DMK, JVC, SDF and raw (256 byte sectors, 18 per track) images through one API: identify, open, close, query geometry, read and write sectors, and streams over all logical sectors. Nothing uses it yet; decb, libdecb, os9 and librbf can move to it later. Only raw images can grow. _diskimage_create makes new images, with a short side 0 of track 0 on DMK, SDF and raw, and sector interleave on DMK and SDF. Short track 0 on raw images is read from LSN0 and follows the layout in _os9_lsn_fseek, where the file keeps all 18 slots of track 0. SDF offsets and density follow dmk2sdf: the data offset is the first data byte after the mark, and density comes from the track bytes because dmk2sdf never sets the single density bit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add a blank RS-DOS disk in DMK and SDF, made by MAME, as test data, and test that _diskimage_create reproduces both byte for byte. The library also reads them back correctly. Matching them changes every created DMK and SDF track: a $00 starts the track, 8 zeros precede each ID instead of 12, the gap after each sector is 24 unless it must shrink to fit, and the DMK track length is $18EA. 19 sectors of 256 bytes now fit on a track. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
diskinfo reports an image's format and track layout, grouping tracks with the same layout. libdiskimage gains the VDK format, honors write protect on DMK, SDF and VDK images, and adds an open flag to override it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Adds libdiskimage, a common API for DMK, SDF, JVC, VDK and raw disk images: identify, create, sector and stream access, with write protect honored unless overridden.
Adds the diskinfo command, which reports an image's format and track layout, including deleted data marks and data CRC errors.
Not yet used by decb, os9 or the other tools; adds unit tests, including byte-identical checks against MAME's blank RS-DOS DMK and SDF images.