Skip to content

Feature/os9 short track0 - #94

Merged
DrPitre merged 2 commits into
nitros9project:mainfrom
tlindner:feature/os9-short-track0
Oct 31, 2026
Merged

DrPitre merged 2 commits into
nitros9project:mainfrom
tlindner:feature/os9-short-track0

Conversation

@tlindner

Copy link
Copy Markdown
Member

Fix librbf segment I/O across T0S and the 68K T0S field
A segment that starts below T0S on a short track 0 disk was transferred
in one run from its start, so its sectors at or past T0S landed in the
unused track 0 slots instead of where _os9_lsn_fseek puts them. Reads
repeated the mistake, which hid it. Reads and writes now split at T0S
through new _os9_lsn_read and _os9_lsn_write helpers.

OS-9/68K disks read pd_t0s from the 6809 layout, one byte too early,
which gave spt * 256 instead of the real value. The mapping then ran
backward for LSNs past that value and overlapped earlier sectors.

Images written by the old code read differently now: sectors at or past
T0S in a crossing segment, and on 68K disks any LSN mapped with the
wrong T0S.

Make os9 format honor short track 0 layout
_os9_format wrote every LSN in sequence, so on a short track 0 disk any
sector at or past T0S was not where _os9_lsn_fseek looks for it. A root
FD past T0S made the disk unusable, and -e images were short by the
unused slots. Format now fills those slots with E5 on reaching T0S.

T0S below 1 or above sectors per track has no valid layout, so format
rejects it before touching an existing image. os9 format also shadowed
its error code and exited 0 on failure, which would have hidden this.

The bitmap was transferred in one run from LSN 1, so it now splits at
T0S too. _coco_identify_image looked for the root directory at a linear
offset and treated a disk with the directory past T0S as Disk BASIC.

Co-Authored-By: Claude Opus 5.5 [email protected]

tlindner and others added 2 commits October 30, 2026 19:31
A segment that starts below T0S on a short track 0 disk was transferred
in one run from its start, so its sectors at or past T0S landed in the
unused track 0 slots instead of where _os9_lsn_fseek puts them. Reads
repeated the mistake, which hid it. Reads and writes now split at T0S
through new _os9_lsn_read and _os9_lsn_write helpers.

OS-9/68K disks read pd_t0s from the 6809 layout, one byte too early,
which gave spt * 256 instead of the real value. The mapping then ran
backward for LSNs past that value and overlapped earlier sectors.

Images written by the old code read differently now: sectors at or past
T0S in a crossing segment, and on 68K disks any LSN mapped with the
wrong T0S.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
_os9_format wrote every LSN in sequence, so on a short track 0 disk any
sector at or past T0S was not where _os9_lsn_fseek looks for it. A root
FD past T0S made the disk unusable, and -e images were short by the
unused slots. Format now fills those slots with E5 on reaching T0S.

T0S below 1 or above sectors per track has no valid layout, so format
rejects it before touching an existing image. os9 format also shadowed
its error code and exited 0 on failure, which would have hidden this.

The bitmap was transferred in one run from LSN 1, so it now splits at
T0S too. _coco_identify_image looked for the root directory at a linear
offset and treated a disk with the directory past T0S as Disk BASIC.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@DrPitre
DrPitre merged commit 5e7b479 into nitros9project:main Oct 31, 2026
6 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