DOS INIT I/O Error

6 posts / 0 new
Last post
Offline
Last seen: 1 month 1 day ago
Joined: Nov 19 2023 - 15:28
Posts: 306
DOS INIT I/O Error

Hello, 

I continue my quest with the Apple II Disk Emumation, 

I open a new thread to share with you a specific issue, I am facing with the Smartisk Floppy Emulator.

When doing DISKII Emulation, I am testing the write part and I have very strange behavior with DOS Init disk procedure.

 

Using an Apple IIe (with 2 different DISK II card):

- Boot DOS, and INIT HELLO => I/O Error both an real Disk II and SmartDisk emulator,

- Using LockSmith Cerify, Fast Backup, Backup => no issue

 

Using a IIGS no issue using DOS Init

 

Using the logic analyzer and the protocol decoder, I have exactly the same output and correct checksum. 

 

What is causing a I/O Error on DOS ?

 

I am a bit lost here 

 

Thanks

Vincent

 

Online
Last seen: 26 min 10 sec ago
Joined: Jul 5 2018 - 09:44
Posts: 3018
When you do the init, what is

When you do the init, what is the disk image you have selected?  Is it a .dsk image?  How is it generated?  Have you selected a known good .dsk and tried it to see if it will INIT over that?

 

OK, I just tried that, and I get an I/O ERROR so something weird for sure.

 

I can see and hear it move to track zero, then it gives the error.

 

 

 

Offline
Last seen: 12 hours 44 min ago
Joined: May 16 2021 - 08:07
Posts: 48
a guess

To venture a guess...INIT is different because it is the only place the self-sync-bytes have to be written.  Maybe the self-sync-bytes are written wrong, so as soon as INIT is done formatting track 0, it fails in its verify scan, and you get the error right then.

What I didn't follow is whether in the description of the issue you meant that INIT fails with real media also, and if yes under what conditions.  Failure with real media would mean either some unlikely coincidence or that booting off the emulator results in a corrupted DOS...right?

Offline
Last seen: 2 days 6 hours ago
Joined: Apr 1 2020 - 16:46
Posts: 1269
yet another guess ...

The formatting process tries to find out how many bytes it can pack on a track, and this depends on the RPMs of the spindle motor. IIRC it starts with writing the track with long gaps and then verifies if the first sector was overwritten, which is expected. It then decreases the gap size and tries again. Until the first sector is still there. And then it accepts that track to be properly formatted.  Alas, I can't remember all the details ... have been a long time I looked into the book "Beneath Apple DOS" by Don Worth et al. (I can't even find it right now ...)

 

I think that depending on how your Floppy Emu handles the track buffer when a track is being overwritten by too much data, many things could go wrong with this formatting method.

 

- Uncle Bernie

Online
Last seen: 1 hour 35 min ago
Joined: Feb 27 2021 - 18:59
Posts: 796
Your memory is fine...We can

Your memory is fine...

We can now discuss the particular portions of a track in detail. The three gaps will be covered first. Unlike some other disk formats, the size of the three gap types will vary from drive to drive and even from track to track. During the initialization process, DOS will start with large gaps and keep making them smaller until an entire track can be written without overlapping itself. A minimum of five self-sync bytes must be maintained for each gap type (as discussed earlier). The result is fairly uniform gap sizes within each particular track.

Offline
Last seen: 1 month 1 day ago
Joined: Nov 19 2023 - 15:28
Posts: 306
Hello, I finally found the

Hello, 

I finally found the issue I was facing, and it was many issues, and one ultra difficult to find:

- The SDCard is internally buffering the data to be written, and needs a small delay before being able to read new block of data,

- during init process, the track 17 at the end is written and immediately the head is moving to track 18, if you do not keep track of the written track then you write the content of track 17 to track 18...

It is abivous but not easy to find.

 

I have rewritten a big chunk of the engine and it is working super well ;)

 

The next release of the Smartdisk firmware will be managing write part very accurately using the protocol decoder on sigrok. 

Thanks for your answers,

Vincent 

 

 

Log in or register to post comments