Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOS 3.2 - INIT gives an I/O ERROR #537

Closed
tomcw opened this issue Feb 10, 2018 · 6 comments
Closed

DOS 3.2 - INIT gives an I/O ERROR #537

tomcw opened this issue Feb 10, 2018 · 6 comments

Comments

@tomcw
Copy link
Contributor

tomcw commented Feb 10, 2018

Officially there's no support for DOS 3.2 in AppleWin (eg. there's no mention of DOS 3.2 in the docs, and .d13 disk images have never been supported).

To reproduce this using AppleWin 1.27.0:

  • From a system master disk (eg. "Apple DOS 3.3 January 1983.dsk"), RUN START13, and then insert "Apple DOS 3.2.1 Standard.nib" in drive-1 and hit return to boot it.
  • Insert a new/blank .nib into drive-2 (eg. just type the name of a file that doesn't exist, but with a .nib extension).
  • Now INIT HELLO,D2 will quickly give an I/O ERROR.

NB. AppleWin 1.25.0.4 completes the INIT without error. But if you try to open the .nib with CiderPress, then it prompts with Filesystem=Unknown filesystem. Selecting "DOS sector ordering" and "DOS 3.2" gives the error:

Unable to access disk image using selected parameters. Error: specified filesystem not found.

@tomcw
Copy link
Contributor Author

tomcw commented Feb 10, 2018

The difference between 1.25.0.4 and 1.27.0 is how the disk's write-protect state is returned.

For DOS 3.2.1, after INIT writes a track, it'll attempt to read it (eg. to check that the gaps aren't too big and no sectors have been overwritten).

Here's the code to read the disk's write-protect state and set read mode:

bf7b:
 lda $c08d,x	; DiskLoadWriteProtect()
				; - but floppywritemode==1, so this is no-op
				; - ie. floppylatch is unaffected (remains 0xff)
				; - when floppylatch.b7 should've been cleared
 lda $c08e,x	; DiskSetReadMode()
				; Sets floppywritemode:=0 and returns floppylatch
 bmi bfb5
 ...

bfb5:
 lda #$40	; I/O Error?
 jmp be39

be39:
 sec
 ldy #$0d
 sta ($48),y	; b7f5
 lda $c088.x	; Motor off
 rts

For AppleWin 1.27.0, because floppywritemode==1, then the write protect state isn't written to the latch (bit7), and the latch value remains at 0xFF. So the INIT fails. See DiskLoadWriteProtect().

Is this a bug? Or a difference between the 13-sector and 16-sector Disk II interface controller cards?

@tomcw
Copy link
Contributor Author

tomcw commented Feb 10, 2018

In DiskLoadWriteProtect(), if I comment out this line then the INIT completes (just like 1.25.0.4):

	if (!floppywritemode)

@sicklittlemonkey - Nick: you did the improvements and changes in this area. Do you have thoughts about this?

@sicklittlemonkey
Copy link
Contributor

sicklittlemonkey commented Feb 11, 2018 via email

@tomcw
Copy link
Contributor Author

tomcw commented Feb 11, 2018

Nick: thanks for the quick Sather reference (that's fixed and committed now).

I'm leaving this issue open for now, as there are a few DEBUG asserts to tidy up (due to 13 sectors), and it would be nice to understand why CiderPress doesn't like these DOS 3.2 .nib's that AppleWin is creating.

@tomcw
Copy link
Contributor Author

tomcw commented Feb 15, 2018

Added test for DOS 3.2.1 INIT (AppleWin/AppleWin-Test@21185bd)

@tomcw
Copy link
Contributor Author

tomcw commented Feb 15, 2018

it would be nice to understand why CiderPress doesn't like these DOS 3.2 .nib's that AppleWin is creating.

There's a subtle bug in CP:
fadden/ciderpress#30

@tomcw tomcw closed this as completed Feb 15, 2018
@tomcw tomcw added this to the 1.28 milestone Feb 15, 2018
@tomcw tomcw modified the milestones: 1.28, 1.27.1 Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants