Formatting

HxC Floppy emulator support for all others computers...
Post Reply
bazzano
Posts: 10
Joined: Thu Dec 12, 2019 10:18 pm

Formatting

Post by bazzano »

Hello.

I have a SD HxC Floppy emulator that I'm using with Nuova Elettronica Z80 computer (http://www.z80ne.com)
I have a lot of working images on HxC, but I'm unable to format them using the Z80 computer.
This computer is very similar to TRS-80 model 1: it uses an OS derived from NEWDOS 2.1, and floppy disks format is identical to trs-80 model 1 with the only difference that it uses 40 tracks instead of 35 as in the trs80.

The problem is that when I try to run newdos format command, it returns the error "drive speed too slow".
Any idea why? I think that the program is testing speed by reading index pulses intervals. Are they correctly simulated like a drive running at 300 rpm?

Thank you.
Roberto

Audronic
Posts: 63
Joined: Thu May 22, 2014 3:28 am
Location: Williamstown Victoria Australia

Re: Formatting

Post by Audronic »

Hi Roberto

I Found this eventually :-

For anyone that needs it..

The HXC SD Floppy Emulator is one clever piece of work. After digging into the code and observing it's operation with a scope it became clear that in order to make sure the emulator didn't miss any data the index pulse is held down longer than a normal physical floppy disk drive pulse when necessary. By holding the index pulse down longer the HXC can then have time to write to slower SD cards. This 'throttling' ( Longer Pulse width ) will look like an incorrect RPM to any OS that is checking.

SYS6 Zap for NewDos80 v2.0 Model 1

Since the HXC SD Floppy Emulator uses a throttling technique to handle slower SD cards and the fact that NewDos80 is sensitive to the incorrect RPM of floppy disk drives during format operations, I have created this zap to bypass the RPM checking during the format operation.

I can now format HFE disks with my LNW80 without getting the 'Motor Slow' error using a Sandisk 8gb. Ultra SDHC Class 10 at 40MB/s read (Not sure the Write speed)

A disassembly below of SYS6/SYS shows where we need to make the zap.

6BD0 ED42 SBC HL,BC .B
6BD2 DA7D6C JP C,6C7DH .}l ; Motor Fast test
6BD5 017D00 LD BC,007DH .}.
6BD8 B7 OR A .
6BD9 ED42 SBC HL,BC .B
6BDB D2826C JP NC,6C82H ..l ; Motor Slow test
6BDE 3E88 LD A,88H >.
6BE0 32C446 LD (46C4H),A 2.F

Using Superzap F,42,DA,7D,6C
That will get you on the correct sector within the file

Change to:

6BD0 ED42 SBC HL,BC .B
6BD2 000000 NOP NOP NOP ; Motor Fast bypass
6BD5 017D00 LD BC,007DH .}.
6BD8 B7 OR A .
6BD9 ED42 SBC HL,BC .B
6BDB 000000 NOP NOP NOP ; Motor Slow bypass
6BDE 3E88 LD A,88H >.
6BE0 32C446 LD (46C4H),A 2.F

Good luck. Ray
If it ain't Broke then PLEASE DONT fix it.

Procrastinators Unite !

bazzano
Posts: 10
Joined: Thu Dec 12, 2019 10:18 pm

Re: Formatting

Post by bazzano »

Hi.

I haven't found the same bytes sequence into sys6/sys (yet) for that OS (named NE-DOS, similar to NEWDOS 2.1), anyway thanks for the tip.
Apart from that, it's not so fine to patch the OS to fix it: may be a HxC configuration switch to fix rpm speed could be a good thing to implement.

Thank you.
Roberto

Jeff
Site Admin
Posts: 7287
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Formatting

Post by Jeff »

bazzano wrote:
Fri Dec 13, 2019 2:33 am
Hi.

I haven't found the same bytes sequence into sys6/sys (yet) for that OS (named NE-DOS, similar to NEWDOS 2.1), anyway thanks for the tip.
Apart from that, it's not so fine to patch the OS to fix it: may be a HxC configuration switch to fix rpm speed could be a good thing to implement.

Thank you.
Roberto
A switch can't help, unless you mean sending fake index pulses while writing to the SDCard... but this will probably lead to read/verify error or other issues.
The only thing that may help is to use a faster SDCard. I know that the Class 10 Sandisk extreme Series are quite good.
@Audronic The Ultra SDHC Class 10 are not very good with small packets write if i remember well.

bazzano
Posts: 10
Joined: Thu Dec 12, 2019 10:18 pm

Re: Formatting

Post by bazzano »

Jeff wrote:
Fri Dec 13, 2019 8:21 am
A switch can't help, unless you mean sending fake index pulses while writing to the SDCard... but this will probably lead to read/verify error or other issues.
The only thing that may help is to use a faster SDCard. I know that the Class 10 Sandisk extreme Series are quite good.
@Audronic The Ultra SDHC Class 10 are not very good with small packets write if i remember well.
So index pulses speed is directly related to SD card speed, and if I use a faster SD it speeds up index pulses?
Is there an "upper" limit so it doesn't exceed 300 rpm?

Thank you.

Jeff
Site Admin
Posts: 7287
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Formatting

Post by Jeff »

bazzano wrote:
Fri Dec 13, 2019 10:40 am
So index pulses speed is directly related to SD card speed, and if I use a faster SD it speeds up index pulses?
During the write/formatting yes this is speed-up the write operations.
bazzano wrote:
Fri Dec 13, 2019 10:40 am

Is there an "upper" limit so it doesn't exceed 300 rpm?

Thank you.
In fact a whole track change (formatting) will be always be longer than the physical floppy write time. I may compensate the latency with fake index signal (sending an index signal if we still writing to the sdcard after 200ms) or starting some sector after the track begin, but i suspect that these attempts will lead to some verify error since the emulator will not be able to provide the formatted track right after the fake index.

So the question is : What is the RPM variation tolerance of the Nuova Elettronica Z80 ?

To be honest i think that the Audronic's solution is not so bad as it appears quite efficient :wink:

bazzano
Posts: 10
Joined: Thu Dec 12, 2019 10:18 pm

Re: Formatting

Post by bazzano »

Jeff wrote:
Fri Dec 13, 2019 11:49 am
bazzano wrote:
Fri Dec 13, 2019 10:40 am
So index pulses speed is directly related to SD card speed, and if I use a faster SD it speeds up index pulses?
During the write/formatting yes this is speed-up the write operations.
bazzano wrote:
Fri Dec 13, 2019 10:40 am

Is there an "upper" limit so it doesn't exceed 300 rpm?

Thank you.
In fact a whole track change (formatting) will be always be longer than the physical floppy write time. I may compensate the latency with fake index signal (sending an index signal if we still writing to the sdcard after 200ms) or starting some sector after the track begin, but i suspect that these attempts will lead to some verify error since the emulator will not be able to provide the formatted track right after the fake index.

So the question is : What is the RPM variation tolerance of the Nuova Elettronica Z80 ?

To be honest i think that the Audronic's solution is not so bad as it appears quite efficient :wink:
Hi.
About "upper limit" I mean if there is some check so that if the SD card is too fast then the index pulse is at most at 5 Hz (300 rpm) and not faster.

I also think that probably fake indexes is not an option, because may be that the program would send another track at index pulse but HxC would not be ready to accept it because it hasn't finished to write the previous track, correct?

I'm not sure exactly what is the RPM variation tolerance of Z80NE, I'll make a few tests to find it. Anyway I know by experience that it's little: drive rotation speed needs to be accurately calibrated otherwise it's easy to get an error.

The solution to patch OS could be a way (even if I don't like to patch original software :-) ), but I need to find where to do it because Z80NE uses Newdos 2.1, while the suggested patch is for Newdos/80 that is different.

I'm curious if Newdos80 sys6/sys patch is related to format command only, or if it's for every command accessing the floppy disk. In Newdos 2.1 format/cmd is a separate command, so I'm not sure. I think I need to read some manual... :-)

Thank you very much.

Jeff
Site Admin
Posts: 7287
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Formatting

Post by Jeff »

bazzano wrote:
Fri Dec 13, 2019 2:55 pm
About "upper limit" I mean if there is some check so that if the SD card is too fast then the index pulse is at most at 5 Hz (300 rpm) and not faster.
No there is no check to do on the "upper limit". The max RPM is guided by the HFE file.

Audronic
Posts: 63
Joined: Thu May 22, 2014 3:28 am
Location: Williamstown Victoria Australia

Re: Formatting

Post by Audronic »

Hi Roberto.
If the Format command is different in the 2.1 dos then please have a look at the bytes in " format/cmd " they may be there ? ?

Good luck. Ray

Seasons Greetings.
If it ain't Broke then PLEASE DONT fix it.

Procrastinators Unite !

bazzano
Posts: 10
Joined: Thu Dec 12, 2019 10:18 pm

Re: Formatting

Post by bazzano »

Jeff wrote:
Fri Dec 13, 2019 8:42 pm
bazzano wrote:
Fri Dec 13, 2019 2:55 pm
About "upper limit" I mean if there is some check so that if the SD card is too fast then the index pulse is at most at 5 Hz (300 rpm) and not faster.
No there is no check to do on the "upper limit". The max RPM is guided by the HFE file.
So it could lead to "drive too fast" error also.

Roberto

Jeff
Site Admin
Posts: 7287
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Formatting

Post by Jeff »

bazzano wrote:
Sat Dec 14, 2019 5:20 pm
Jeff wrote:
Fri Dec 13, 2019 8:42 pm
bazzano wrote:
Fri Dec 13, 2019 2:55 pm
About "upper limit" I mean if there is some check so that if the SD card is too fast then the index pulse is at most at 5 Hz (300 rpm) and not faster.
No there is no check to do on the "upper limit". The max RPM is guided by the HFE file.
So it could lead to "drive too fast" error also.

Roberto
No you don't understand me : You can't have the "drive too fast" error. If the HFE is a 300 RPM file, max speed is 300RPM.

bazzano
Posts: 10
Joined: Thu Dec 12, 2019 10:18 pm

Re: Formatting

Post by bazzano »

Jeff wrote:
Sat Dec 14, 2019 6:42 pm
bazzano wrote:
Sat Dec 14, 2019 5:20 pm
Jeff wrote:
Fri Dec 13, 2019 8:42 pm


No there is no check to do on the "upper limit". The max RPM is guided by the HFE file.
So it could lead to "drive too fast" error also.

Roberto
No you don't understand me : You can't have the "drive too fast" error. If the HFE is a 300 RPM file, max speed is 300RPM.
Ah, ok, fine!

Thank you.

bazzano
Posts: 10
Joined: Thu Dec 12, 2019 10:18 pm

Re: Formatting

Post by bazzano »

Jeff wrote:
Fri Dec 13, 2019 11:49 am
bazzano wrote:
Fri Dec 13, 2019 10:40 am
So index pulses speed is directly related to SD card speed, and if I use a faster SD it speeds up index pulses?
During the write/formatting yes this is speed-up the write operations.

[...]

To be honest i think that the Audronic's solution is not so bad as it appears quite efficient :wink:
Anyway, I have tried with a fast SD (class 10), but I still get "drive too slow" error.
I think that I need to disassemble format/cmd program to patch it, because the suggested patch bytes are not present in that file.

Thank you.
Roberto

Jeff
Site Admin
Posts: 7287
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Formatting

Post by Jeff »

bazzano wrote:
Sun Dec 15, 2019 12:35 pm
Anyway, I have tried with a fast SD (class 10), but I still get "drive too slow" error.
I think that I need to disassemble format/cmd program to patch it, because the suggested patch bytes are not present in that file.

Thank you.
Roberto
The SD Card brand and the serie is also very important !

bazzano
Posts: 10
Joined: Thu Dec 12, 2019 10:18 pm

Re: Formatting

Post by bazzano »

Jeff wrote:
Sun Dec 15, 2019 1:03 pm
bazzano wrote:
Sun Dec 15, 2019 12:35 pm
Anyway, I have tried with a fast SD (class 10), but I still get "drive too slow" error.
I think that I need to disassemble format/cmd program to patch it, because the suggested patch bytes are not present in that file.

Thank you.
Roberto
The SD Card brand and the serie is also very important !
Hi.
Just to inform that I tried with a SanDisk Extreme SD card, 32GB, 100MB/s read speed, 90 MB/s write speed, but I still get "motor too slow" error.
I think that probably don't exist faster cards.

Trying to disassemble the format command now...

Thank you.
Roberto

Post Reply