get floppy disk CHS geometry

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
eekee
Member
Member
Posts: 891
Joined: Mon May 22, 2017 5:56 am
Location: Kerbin
Discord: eekee
Contact:

Re: get floppy disk CHS geometry

Post by eekee »

I stopped installing floppy drives on most of my machines before the 90s were over. Didn't need them. :) That said, I recognize the desire to add capability to programs or OSs, especially to complete a feature. It really bothers me when it can't be done, to the point where I now try to avoid starting down these rabbit holes. It's difficult when you're writing an OS though, because providing a lot of features is kind-of the point and it feels weird if they're not complete. I try to ignore the weird feeling and be happy with designing/coding the parts I'd make more use of.

If you really could make use of all those floppy formats, I'm sure you could design autodetection with some help from looking at how Linux does it. It would take time, but could be quite the engrosing projects in itself. You might even end up able to autodetect more formats than Linux. Don't pay too much attention to why it doesn't try to read side B etc., just try things, read specifications and think.
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
rdos
Member
Member
Posts: 3297
Joined: Wed Oct 01, 2008 1:55 pm

Re: get floppy disk CHS geometry

Post by rdos »

eekee wrote: Sun Nov 24, 2024 12:52 pm I stopped installing floppy drives on most of my machines before the 90s were over. Didn't need them. :)
I have a computer with a 1.44 MB floppy drive, so I test the floppy driver once in a while. :-)

I wish I had a functional 386SX board too so I could test this setup, but I don't.
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: get floppy disk CHS geometry

Post by Octocontrabass »

LGabci wrote: Sun Nov 24, 2024 7:57 amLinux supports 31 floppy disk types, and it can autodetect this types (by not only data rates, but eg. gap sizes between sectors), if you try to use another format, they say we don't support that.
I'm pretty sure Linux only checks data rate and sector size. Detecting other parameters would require reading more than the first sector of the disk, and you can't detect gap sizes at all (they only affect writing).
User avatar
eekee
Member
Member
Posts: 891
Joined: Mon May 22, 2017 5:56 am
Location: Kerbin
Discord: eekee
Contact:

Re: get floppy disk CHS geometry

Post by eekee »

Octocontrabass wrote: Sun Nov 24, 2024 3:32 pm
LGabci wrote: Sun Nov 24, 2024 7:57 amLinux supports 31 floppy disk types, and it can autodetect this types (by not only data rates, but eg. gap sizes between sectors), if you try to use another format, they say we don't support that.
I'm pretty sure Linux only checks data rate and sector size. Detecting other parameters would require reading more than the first sector of the disk, and you can't detect gap sizes at all (they only affect writing).
From radio astronomy to image processing to disk data forensics, I have many times been surprised by what can be detected with the right algorithm. Some such surprises have come from single-author DOS programs which required no special hardware. Most or all of this comes down to Fourier transforms. Now I think about it, if you read raw data at the highest possible density and apply a Fourier transform, you can probably detect just-about anything.
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: get floppy disk CHS geometry

Post by Octocontrabass »

eekee wrote: Sun Nov 24, 2024 6:27 pmNow I think about it, if you read raw data at the highest possible density and apply a Fourier transform, you can probably detect just-about anything.
Probably, but you can't read raw data through a PC floppy disk controller.
LGabci
Posts: 11
Joined: Sat Nov 23, 2024 4:38 am

Re: get floppy disk CHS geometry

Post by LGabci »

[/quote]Actually, you can use the FDSETPRM ioctl to set any geometry you should want, so long as it can be formulated in that structure (struct floppy_struct). As I said, if you actually have a non-standard format, and you know it, you can set it. So long as the PC floppy drive can read it, you can do so in Linux as well.
[/quote]
Yes, you are right.

I will be satisfied with the few fundamental formats.
Post Reply