• Please review our updated Terms and Rules here

reading single-sided format floppies in a PC with a 5.25 inch 1.2 Mbyte drive?

tingo

Veteran Member
Joined
Aug 12, 2009
Messages
1,521
Location
Oslo, Norway
In general: is a normal PC (vintage enough to have a built in floppy controller) equipped with a normal 5.25 inch 1.2 MByte floppy drive also able to read floppies that are single-sided?
Or is there some kind of (hardware) limitation (FDC? floppy drive? or both?) that prevent you from doing that?

My "floppy imager" machine is a Dell OptiPlex GX300, it has a 3.5 inch 1.44 MB (A:) drive and a 5.25 inch 1.2 MB (B:) drive. It runs FreeBSD and works great for imaging double-sided floppies. I also have a few floppies that are labeled single-sided, and I'm unable to read any of those.
Of course, it could be that these floppies are all bad (but I suspect not). It could also be that I haven't figured out the correct parameters, or it could be that this combo just won't work.
 
FreeBSD? I doubt that knows about anything besides standard 360k/1.2mb floppy disks formats. *nix or NT based OSes always expect a valid bios parameter block in the boot sector. DOS formatted 160k/320k/180k disks will rarely have valid bios parameter blocks because DOS 1.x didn't have those yet, and DOS 2.x had bugs. Even WinImage can't handle DOS 1.x disks.

You need to boot to DOS and use a tool like ImageDisk that analyzes tracks for any possible sector layout, and stores images in a "structured" image format. (Even Win9x DOS 7.1 will work, and usually can even read files directly from DOS formatted 160k/320k/180k disks.)

For IBM PC formatted disks, you don't need to worry about disk encoding as IBM PC always used MFM. Some controllers can also read FM (single density) encoding, but you would need to run ImageDisk's TestFDC to find out.

Either that or get a Kryoflux or SuperCard Pro - which can read ANY format as long as the media matches the drive, and they can handle copy protection.
 
What FreeBSD tool do you use for reading those floppies? Generally, low-level drivers in BSD are pretty flexible, if you know the magic incantation.
 
Well, reading this double-sided format works:
Code:
# fdcontrol -vF /dev/fd1
/dev/fd1: 1232 KB media type
   Format:        8,1024,0xff,0x35,77,500,2,0x74,1,0,+mfm
   Sector size:    1024
   Sectors/track:    8
   Heads/cylinder:    2
   Cylinders/disk:    77
   Transfer rate:    500 kbps
   Sector gap:    53
   Format gap:    116
   Interleave:    1
   Side offset:    0
   Flags        <MFM>
and the "normal" PC format also works
Code:
# fdcontrol -vF /dev/fd1
/dev/fd1: 1200 KB media type
   Format:        15,512,0xff,0x1b,80,500,2,0x54,1,0,+mfm,+auto
   Sector size:    512
   Sectors/track:    15
   Heads/cylinder:    2
   Cylinders/disk:    80
   Transfer rate:    500 kbps
   Sector gap:    27
   Format gap:    84
   Interleave:    1
   Side offset:    0
   Flags        <MFM,AUTO>
However, my attempts at setting up single-sided formats doesn't work.
 
Attempts at single-side format

Attempts at single-side format

What I'm trying to achieve is to read what is called "format 0b" on NDwiki's ND floppy disks page. Those reading that page closely will figure out
a) I'm successful in reading "format 17b"
b) any given format could used on both 8 inch and 5.25 inch media (within physical limits)
c) one ND "page" is 2048 bytes.
d) there is probably not enough information on that page to specify all parameters needed for fdcontrol
So far I have tried
Code:
root@kg-t2# fdcontrol -s 8,512,0xFF,0x35,77,500,1,0x74,1,0,+mfm /dev/fd1
root@kg-t2# fdcontrol -vF /dev/fd1
/dev/fd1: 308 KB media type
    Format:        8,512,0xff,0x35,77,500,1,0x74,1,0,+mfm
    Sector size:    512
    Sectors/track:    8
    Heads/cylinder:    1
    Cylinders/disk:    77
    Transfer rate:    500 kbps
    Sector gap:    53
    Format gap:    116
    Interleave:    1
    Side offset:    0
    Flags        <MFM>
and
Code:
root@kg-t2# fdcontrol -s 8,512,0xFF,0x35,77,250,1,0x74,1,0,+mfm /dev/fd1
root@kg-t2# fdcontrol -vF /dev/fd1
/dev/fd1: 308 KB media type
    Format:        8,512,0xff,0x35,77,250,1,0x74,1,0,+mfm
    Sector size:    512
    Sectors/track:    8
    Heads/cylinder:    1
    Cylinders/disk:    77
    Transfer rate:    250 kbps
    Sector gap:    53
    Format gap:    116
    Interleave:    1
    Side offset:    0
    Flags        <MFM>
and
Code:
root@kg-t2# fdcontrol -vF /dev/fd1
/dev/fd1: 308 KB media type
    Format:        8,512,0xff,0x35,77,300,1,0x74,1,0,+mfm
    Sector size:    512
    Sectors/track:    8
    Heads/cylinder:    1
    Cylinders/disk:    77
    Transfer rate:    300 kbps
    Sector gap:    53
    Format gap:    116
    Interleave:    1
    Side offset:    0
    Flags        <MFM>
I even tried this
Code:
root@kg-t2# fdcontrol -s 8,512,0xFF,0x35,77,1000,1,0x74,1,0,+mfm /dev/fd1
fdcontrol: bad speed 1000
not that I expected it to work.
But no, I don't really know what I am doing here.
 
Last edited:
Tingo,
I think you need the flag for Single Density set = -mfm

The second form to specify a device density uses -s fmtstr to explicitly
specify each parameter in detail. The argument fmtstr is a comma-sepa-
rated list of values of the form:

sectrac,secsize,datalen,gap,ncyls,speed,heads,f_gap,f_inter,offs2,flags

The meaning of the parameters is:

sectrac The number of sectors per track.

secsize The sector size code, 0 = 128 bytes (or less), 1 = 256 bytes, 2
= 512 bytes, 3 = 1024 bytes.

datalen The actual sector size if the size code is 0, or the (ignored)
value 0xFF for larger size codes.

gap The length of the gap 3 parameter for read/write operations.

ncyls The number of cylinders.

speed The transfer speed in kilobytes per second. Can be 250, 300,
500, or 1000, but each drive type only supports a subset of
these values.

heads The number of heads.

f_gap The length of the gap 3 when formatting media.

f_inter The sector interleave to be applied when formatting. 0 means no
interleave, 1 means 1:1 etc.

offs2 The offset of the sector numbers on side 2 (i.e., head number
1). Normally, sector numbering on both sides starts with 1.

flags A list from one of the following flag values:

+mfm Use MFM encoding.
-mfm Use FM (single-density) encoding.
+2step Use 2 steps per each cylinder (for accessing 40-cylin-
der media in 80-cylinder drives).
-2step Do not use 2 steps per cylinder, i.e., access each
physical cylinder of the drive.
+perpend Use perpendicular recording (for 2.88 MB media, cur-
rently not supported).
-perpend Use longitudinal recording.

For any missing parameter, the current value will be used, so only actual
changes need to be specified. Thus to turn off a flag bit (like +mfm
which is the default for all drive types), the form with a leading minus
sign must explicitly be used.

Larry
 
Two things: Format 0b is indeed single-density/FM. Assuming it's an 8" drive, you also need an FM-capable FDC (check that out with Dave Dunfield's testfdc utility).

So the parameters to the fdcontrol should be 8,2,0xff,40,77,500,1,80,0,0,-mfm

The gap lengths are approximate and really only matter if you're reading or formatting the disk. The deficiency in fdcontrol and its corresponding Linux command is that it assumes standard address ID conventions (e.g. first sector is 1, first side head ID is 0, etc.).

While that's true of most IBM formats, it's not true in general for all floppies.
 
Last edited:
Ok, so not a dos disk then.

If you just need to get the bits off, ImageDisk would still be easier with less guesswork. Although if your FDC can't handle FM encoding you will need a different tool for the job.
 
Not a DOS disk (those are easy), and not a 8 inch drive either. The information on the ND floppy disks page seems to imply that ND (Norsk Data) did use the same formats on both 8 inch and 5.25 inch media (if possible). Yes, I probably need to set up so I can run TestFDC on that machine to figure out what that FDC is capable of.
 
It's only possible if the 5.25" disks and drive are high-density. Japanese PC98 did this, but not in FM.

What does AnaDisk say about them? (You can fit AD and a DOS boot easily on the same floppy)
 
Those 5 1/4" floppies and drives are indeed high-density. It's an unusual case - normally the vendor (ND) used a high density/double sided format, but occasionally they would apparently "re-image" original 8" data on (HD) 5 1/4" media. Probably in the aforementioned 0b format, not yet confirmed, but I too have found a couple of floppies which appear to suffer from the same problem. I can't read them with my 200x era Intel 82077AA-based FDC controller (it can't do FM).
 
So would a Kryoflux board be worth getting to create boot disks for old machines? Is there an archive of Kryoflux formatted images that exists?
 
So would a Kryoflux board be worth getting to create boot disks for old machines? Is there an archive of Kryoflux formatted images that exists?

I personally think a Kryoflux is worthwhile, although I also think it is important to have multiple avenues for creating/reading disks.

It is possible to create Kryoflux stream images from common IMA/IMG disk image or IMD ImageDisk archives using the HxC disk tool software. These can be written by a Kryoflux and read on real PCs.

Keep in mind though that the Kryoflux folks view their product as an archival tool, although it can be used for much more.
 
OK, I ran TestFDC from a DOS floppy (for some reason DOSBox only created "morse code" output instead of actual readable characters). These are the results
Code:
Report on FDC capabilities, issued 24/03/2018 23:54:34:
Single-Density at 250 kbps ............................ Not tested
Single-Density at 300 kbps ............................ Passed
Single-Density at 500 kbps ............................ Passed
Double-Density at 250 kbps ............................ Not tested
Double-Density at 300 kbps ............................ Passed
Double-Density at 500 kbps ............................ Passed
Double-Density at 250 kbps / 128 byte sectors ......... Not tested
Double-Density at 300 kbps / 128 byte sectors ......... Passed
Double-Density at 500 kbps / 128 byte sectors ......... Passed
 
DOSBox? Uh, that's an emulator. It doesn't know squat about your real hardware.

Passed all tests? Nice. What motherboard, chipset, and I/O chip, if applicable, is that?

That means that using ImageDisk or Teledisk you should be able to read almost any FM or MFM encoded disks that are not copy protected.
 
Yes, I know DOSBox is an emulator. But someone here suggested that TestFDC might run in it, so I amused myself by trying it. :)
The machine is a Dell OptiPlex GX300, I don't know what motherboard and chipset it has (haven't looked). It has served me well so far, so I keep it around for imaging duties.
 
Two things: Format 0b is indeed single-density/FM. Assuming it's an 8" drive, you also need an FM-capable FDC (check that out with Dave Dunfield's testfdc utility).

So the parameters to the fdcontrol should be 8,2,0xff,40,77,500,1,80,0,0,-mfm

FWIW, I tried the parameters you suggested
Code:
root@kg-t2# fdcontrol -s 8,512,0xff,40,77,500,1,80,0,0,-mfm /dev/fd1
root@kg-t2# fdcontrol -vF /dev/fd1
/dev/fd1: 308 KB media type
	Format:		8,512,0xff,0x28,77,500,1,0x50,0,0
	Sector size:	512
	Sectors/track:	8
	Heads/cylinder:	1
	Cylinders/disk:	77
	Transfer rate:	500 kbps
	Sector gap:	40
	Format gap:	80
	Interleave:	0
	Side offset:	0
	Flags		<>
Alas, it didn't work. I got errors when trying to read the floppies, as before.
Update: scratch that - after trying a few more floppies, it works. Even the floppies that failed first now works. Perhaps the drive / fdc combo is marginal, or perhaps it needs to be "warmed up". Anyway, results:
Code:
tingo@kg-t2$ dd if=/dev/fd1 of=./10758B04-EN-01S.image bs=512
616+0 records in
616+0 records out
315392 bytes transferred in 115.933216 secs (2720 bytes/sec)
tingo@kg-t2$ ll
total 1012
drwxr-xr-x  2 tingo  users  -    512 Mar 25 14:21 ./
drwxr-xr-x  5 tingo  users  -    512 Mar 25 14:05 ../
-rw-r--r--  1 tingo  users  - 315392 Mar 25 14:12 10758B03-XX-02S.image
-rw-r--r--  1 tingo  users  - 315392 Mar 25 14:18 10758B03-XX-03S.image
-rw-r--r--  1 tingo  users  - 315392 Mar 25 14:23 10758B04-EN-01S.image
tingo@kg-t2$ ll 10758B04-EN-01S.image
-rw-r--r--  1 tingo  users  - 315392 Mar 25 14:23 10758B04-EN-01S.image
tingo@kg-t2$ ndfs -t 10758B04-EN-01S.image
Directory name            : 10758B04-EN-01S
Object file index pointer : 150 SI: 0x1 (indexed)
User file index pointer   : 152 SI: 0x1 (indexed)
Bit file pointer          : 72 SI: 0x0 (contiguous)
No. of unreserved pages   : 1
Files:
  0   0: I       55 pages    110622 bytes 1986-08-28 08:33:17 (FLOPPY-USER)BG-PART1-EN-B04:BRF
  0   1: I        3 pages      6144 bytes 1986-01-23 12:15:48 (FLOPPY-USER)INST-BG132-B04:PROG
  0   2: I        1 page        415 bytes 1986-01-23 12:15:59 (FLOPPY-USER)BG-EX01-EN-B04:PLOT
  0   3: I        1 page        328 bytes 1986-01-23 12:16:06 (FLOPPY-USER)BG-EX02-EN-B04:PLOT
  0   4: I        1 page        311 bytes 1986-01-23 12:16:16 (FLOPPY-USER)BG-EX03-EN-B04:PLOT
  0   5: I        1 page        425 bytes 1986-01-23 12:16:34 (FLOPPY-USER)BG-EX04-EN-B04:PLOT
  0   6: I        1 page        284 bytes 1986-01-23 12:16:47 (FLOPPY-USER)BG-EX05-EN-B04:PLOT
  0   7: I        1 page        593 bytes 1986-01-23 12:16:54 (FLOPPY-USER)BG-EX06-EN-B04:PLOT
  0   8: I       13 pages     25807 bytes 1986-08-12 15:33:31 (FLOPPY-USER)INST-BG132-B04:COM
  0   9: I       59 pages    182272 bytes 1986-01-23 12:17:33 (FLOPPY-USER)XCOM:PROG
Directory size: 149 pages
Bit file size : 1 page
(and yes, running 'ndfs -t /dev/fd1' also works.
Thanks Chuck, you saved the day again!
 
Last edited:
Back
Top