Gotek + Flashfloppy: How-to.

Nagging hardware related question? Post here!
BackToQL
ROM Dongle
Posts: 22
Joined: Tue Sep 22, 2020 3:59 pm

Re: Gotek + Flashfloppy: How-to.

Post by BackToQL »

Hi Martin,
Thanks for the link and instructions.
I have generated a 3.2mb image that the Gotek accepted, but it was not possible to write to the image. I tried formating the image, but that didn't help. So a few more things to try out.
Martin_Head wrote:My FDI driver http://www.dilwyn.me.uk/utils/FDI2driver204.zip can create ED images with the MAKE_FDI command

MAKE_FDI win1_test_img,TestED,e

Creates an image file on WIN1_, with a medium name of 'TestED'. The image file should be about 3.2Mb


BackToQL
ROM Dongle
Posts: 22
Joined: Tue Sep 22, 2020 3:59 pm

Re: Gotek + Flashfloppy: How-to.

Post by BackToQL »

Norm!!!

Thanks for looking at this issue.
NormanDunbar wrote:If you need them to be full sized images, I shouldn't have too much trouble amending the code to do so. I think I was the last person to work on it! (Famous last words!)


HTH

Cheers,
Norm.
As I have a full size ED image from Martin's driver I don't think it will be necessary for you to do an update for my current investigation. I do appreciate the kind offer.

Regards,
Peter.


User avatar
NormanDunbar
Forum Moderator
Posts: 2276
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Gotek + Flashfloppy: How-to.

Post by NormanDunbar »

I had a quick look at the source yesterday anyway. Looks like there's a bug somewhere!

The function which writes out the first 36 sectors for a new image, doesn't do anything when you up the number of sectors to be written to the correct number. Very strange.

Instead of writing the image, it simply pretends that an invalid option has been requested and the help screen is displayed. Very unusual -- but something for me to look into.

If MrsD lets me have enough playtime, I might add another option to make qltools write a full sized image and not just the minimum one as it is doing now. Once I find the bug that's causing the afore mentioned weirdness of course. ;) It's possible that in the future some other "user of image files" might demand the full sized image rather than "just enough for what you have loaded so far" -- as at present.

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
stephen_usher
Gold Card
Posts: 433
Joined: Tue Mar 11, 2014 8:00 pm
Location: Oxford, UK.
Contact:

Re: Gotek + Flashfloppy: How-to.

Post by stephen_usher »

For information, the FlashFloppy Github site has an example for QL ED disks:

Code: Select all

## IMG.CFG for Sinclair QL ED Disks (3.2MB)

# NOTE: The tags match on filesize alone. If you wish to define an explicit
# tagname match, you can for example add 'ql' to the square-bracketed tags
# to limit matches to filenames of the form *.ql.{img,ima,dsk}


# Images are 3200kB exactly.
[::3276800]
cyls = 80
heads = 2
secs = 10
bps = 2048
See: https://github.com/keirf/FlashFloppy/tr ... inclair_QL


User avatar
NormanDunbar
Forum Moderator
Posts: 2276
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Gotek + Flashfloppy: How-to.

Post by NormanDunbar »

I was aware of these detail Stephen, but thanks for the info all the same.

Much appreciated.


Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
XorA
Site Admin
Posts: 1368
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Gotek + Flashfloppy: How-to.

Post by XorA »

NormanDunbar wrote:I had a quick look at the source yesterday anyway. Looks like there's a bug somewhere!

The function which writes out the first 36 sectors for a new image, doesn't do anything when you up the number of sectors to be written to the correct number. Very strange.

Instead of writing the image, it simply pretends that an invalid option has been requested and the help screen is displayed. Very unusual -- but something for me to look into.

If MrsD lets me have enough playtime, I might add another option to make qltools write a full sized image and not just the minimum one as it is doing now. Once I find the bug that's causing the afore mentioned weirdness of course. ;) It's possible that in the future some other "user of image files" might demand the full sized image rather than "just enough for what you have loaded so far" -- as at present.

Cheers,
Norm.
There is a very simple change to make it generate full size images.

Code: Select all

diff --git a/qltools.c b/qltools.c
index a8239b0..4ceb529 100644
--- a/qltools.c
+++ b/qltools.c
@@ -1685,6 +1685,8 @@ void format(char *frmt, char *argfname) {

     make_convtable (0);
     write_b0fat ();
+
+    ftruncate(fd, gSectorSize * gSectorsPerCylinder * gNumberOfTracks);
 }

 int main(int argc, char **argv) {


User avatar
NormanDunbar
Forum Moderator
Posts: 2276
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Gotek + Flashfloppy: How-to.

Post by NormanDunbar »

Ok, you win, your change was better than mine. :( ;)

I changed the code in ZeroSomeSectors() to work out the format (from the 'd' parameter) and that worked fine for me. That bit is called from format(). It would have been much easier to do it your way though.

Thanks -- if only your got to me an hour or so ago, that would have been an hour I could have bee doing something else! :D

Version 2.15.6 has been uploaded to my repository. I'll upload to the SinclairQL repos ASAP.

EDIT: already done it!

Release of the Linux binray is at https://github.com/SinclairQL/qltools/releases/latest. I need a windows system to compile on before I can upload the Windows version named "qltools.win7".


Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
XorA
Site Admin
Posts: 1368
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Gotek + Flashfloppy: How-to.

Post by XorA »

NormanDunbar wrote:Ok, you win, your change was better than mine. :( ;)
I spend my career educating people that truncate/ftruncate can extend a file too.

Ive seen some insane scripts written in Linux community by people who don't know that!


User avatar
NormanDunbar
Forum Moderator
Posts: 2276
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Gotek + Flashfloppy: How-to.

Post by NormanDunbar »

Umm, add me to the list!
I did know it, many years ago, but forgot. :(

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Post Reply