GEM S2/S3 issues

Post Reply
VBuckle
Posts: 10
Joined: Mon Apr 29, 2019 9:19 pm

GEM S2/S3 issues

Post by VBuckle » Mon Apr 29, 2019 9:28 pm

When reversing GEM S2/S3 Turbo ROM, I found that its floppy driver supports another disk format.

Having implemented tools to format/write such disk format, I have found an issue with the floppy emulator, in that writing to these images fails for some reason, the error given is a timeout (a single FDC command must finish within ~2000ms, a seperate READ DATA/WRITE DATA command is used for each track; therefore: reading/writing a (partial) track must complete within ~2000ms).

Later GEM devices running MIOS 3 increased this limit to ~3000ms; when hooking various calls on S2/S3 to also provide this limit (obviously intended as a temporary measure), writing a later track fails with sector not found error (SR1 bit 2).

This problem does not occur with a real floppy drive.

(For the record, the same problem occurs when writing large files (~1MB) to raw .img images of disk layout GENERALMUSIC_GEM_S3_1600KB.)

I am using a Gotek emulator with HxE firmware v3.1.48.1a.

Here is the (custom) XML I am using to create a HFE image:

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- HxC Floppy Emulator Disk Layout -->
<disk_layout>
	<disk_layout_name>GENERALMUSIC_GEM_S3_1760KB</disk_layout_name>
	<disk_layout_description>GeneralMusic Gem S2/3 Type-4 HD Floppy Disk</disk_layout_description>
	<prefered_file_extension>img</prefered_file_extension>
	<interface_mode>IBMPC_HD_FLOPPYMODE</interface_mode>
	<file_size>1802240</file_size>
	<layout>
		<number_of_track>80</number_of_track>
		<number_of_side>2</number_of_side>
		<format>IBM_MFM</format>
		<start_sector_id>1</start_sector_id>
		<sector_per_track>11</sector_per_track>
		<sector_size>1024</sector_size>
		<interleave>1</interleave>
		<skew_per_side>0</skew_per_side>
		<skew_per_track>0</skew_per_track>
		<formatvalue>0xCB</formatvalue>
		<gap3>38</gap3>
		<bitrate>500000</bitrate>
		<pregap>0</pregap>
		<rpm>300</rpm>
	</layout>
</disk_layout>
The gap3 value in the xml is the value used when formatting this disk type:

Code: Select all

    case 0x400:
      v1[1].buf.bytes[2] = 3; // 1024 bytes/sector
      v1[1].buf.bytes[3] = 11; // 11 sectors per track
      v1[1].buf.bytes[4] = 38; // gap3 length
      break;
When reading/writing, the VC0 sync value used is 12:

Code: Select all

    case 0x400:                                 // S2S3 1760KB
      operation->write1_buf[5] = 3;
      operation->write1_buf[6] = 11;
      operation->write1_buf[7] = 12;
      break;
I have also tried gap3 value 84 (used when formatting every other disk type, including 720KB/1.44MB, for some reason); this does not work around the issue.

Reading from these images seems to work fine; the issue is with writing.

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

Re: GEM S2/S3 issues

Post by Jeff » Tue Apr 30, 2019 12:35 am

Have you tried to directly use the img files on the gotek ? There are directly supported by the emulator and this should be a way faster.

VBuckle
Posts: 10
Joined: Mon Apr 29, 2019 9:19 pm

Re: GEM S2/S3 issues

Post by VBuckle » Tue Apr 30, 2019 6:23 pm

As I mentioned, the same errors occur with img files.

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

Re: GEM S2/S3 issues

Post by Jeff » Tue Apr 30, 2019 7:17 pm

VBuckle wrote:
Tue Apr 30, 2019 6:23 pm
As I mentioned, the same errors occur with img files.
Just to be sure : you mean that you have tried to save directly to an img file present on the stick (without hfe conversion ?)
if so, have you selected the gem system family in the embedded menu ?
VBuckle wrote:
Tue Apr 30, 2019 6:23 pm
When reversing GEM S2/S3 Turbo ROM, I found that its floppy driver supports another disk format.
This means that normal gem format is working fine ?

VBuckle
Posts: 10
Joined: Mon Apr 29, 2019 9:19 pm

Re: GEM S2/S3 issues

Post by VBuckle » Tue Apr 30, 2019 10:56 pm

Yes.
I have had better results when using hfe, but the problem is still there.
I can load my new 1.76mb files but writing them errors.
This problem does not happen with a real floppy drive.
The error is only with the gotek, I have not tried the hxc sdcard drive as I don't own one.

VBuckle
Posts: 10
Joined: Mon Apr 29, 2019 9:19 pm

Re: GEM S2/S3 issues

Post by VBuckle » Tue Apr 30, 2019 10:58 pm

I can't use a 1.76mb img because the hxc firmware does not support the new format, hence the xml code in the 1st post.

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

Re: GEM S2/S3 issues

Post by Jeff » Tue Apr 30, 2019 11:56 pm

VBuckle wrote:
Tue Apr 30, 2019 10:58 pm
I can't use a 1.76mb img because the hxc firmware does not support the new format, hence the xml code in the 1st post.
ok ! Let me add this format to the firmware, i will post the new one here.

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

Re: GEM S2/S3 issues

Post by Jeff » Wed May 01, 2019 12:06 am

Jeff wrote:
Tue Apr 30, 2019 11:56 pm
VBuckle wrote:
Tue Apr 30, 2019 10:58 pm
I can't use a 1.76mb img because the hxc firmware does not support the new format, hence the xml code in the 1st post.
ok ! Let me add this format to the firmware, i will post the new one here.
attached.

change the file extensions to ".gem" or set the system family preference into the embedded menu to be sure to use the General Music format.
Attachments
gem_test.zip
(80.15 KiB) Downloaded 19 times

VBuckle
Posts: 10
Joined: Mon Apr 29, 2019 9:19 pm

Re: GEM S2/S3 issues

Post by VBuckle » Wed May 01, 2019 6:45 pm

I tried the new firmware but there is nothing displayed on the LED screen so I flashed back to version 3.1.48.1a
I assume the test version does not have support for the LED screen and rotary knob that I have modified the Gotek with.

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

Re: GEM S2/S3 issues

Post by Jeff » Wed May 01, 2019 7:37 pm

VBuckle wrote:
Wed May 01, 2019 6:45 pm
I tried the new firmware but there is nothing displayed on the LED screen so I flashed back to version 3.1.48.1a
I assume the test version does not have support for the LED screen and rotary knob that I have modified the Gotek with.
No, the test version is a normal version. So you should have something on the LED screen.
Please retry.

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

Re: GEM S2/S3 issues

Post by Jeff » Wed May 01, 2019 8:09 pm

fyi there is now an "official" release :

https://hxc2001.com/download/floppy_dri ... rmware.zip
(WIP folder)

VBuckle
Posts: 10
Joined: Mon Apr 29, 2019 9:19 pm

Re: GEM S2/S3 issues

Post by VBuckle » Wed May 01, 2019 9:22 pm

I tried writing the entirety of 1.76MB .gem image, 10 attempts, 5 with the patches in place for the larger timeout and 5 after removing those.

Out of the first 5 attempts (with larger timeout): 2 succeeded, and 3 failed. All the failures were sector not found errors; one was on track 29, one on track 9, and one on track 52.

Out of the second 5 attempts (with original timeout): 4 succeeded, and 1 failed. The failure was, again, a sector not found error, on track 29.

What could be causing the inconsistent sector not found errors?

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

Re: GEM S2/S3 issues

Post by Jeff » Wed May 01, 2019 9:34 pm

with the new firmware ? On a img/gem file ?

if "yes" and "yes", try another usb stick (another model)

The error is not a timeout anymore ?

And what about the sector interleaving ? Are you sure that it is set to 1 ?

VBuckle
Posts: 10
Joined: Mon Apr 29, 2019 9:19 pm

Re: GEM S2/S3 issues

Post by VBuckle » Wed May 01, 2019 10:06 pm

Tried a new sandisk key and it worked fine, 5 out of 5 attempts.

Can you add the 1.76Mb format to the PC software.

Thanks for your help...
Vince

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

Re: GEM S2/S3 issues

Post by Jeff » Wed May 01, 2019 10:12 pm

VBuckle wrote:
Wed May 01, 2019 10:06 pm
Tried a new sandisk key and it worked fine, 5 out of 5 attempts.

Can you add the 1.76Mb format to the PC software.

Thanks for your help...
Vince
ok fine.
what is the non working usb stick model/brand?

Post Reply