• Please review our updated Terms and Rules here

How can I write DOS Floppies from .img files in DOS 6.22?

DistantStar001

Experienced Member
Joined
May 8, 2019
Messages
178
So anyone who has encountered my most recent posts on this forum probably figured out that I've recently acquired a few MS-DOS based machines as of late. An XT, a Tandy 1000EX, and most recently, a Compaq Portable. Unfortunately, with the exception of the XT, most of these are dependent on Floppies for the time being. So I need to make some boot disks and I'd like them to be the disks that were actually meant for the systems. Physical disks aren't a problem. I have tons of them. But getting the .img files over to them has been.

I tried using my 486s to do it, but one is on the fritz, and the other threw a two-month-long fit when I tried to add a 360k drive to it. Seriously, it wouldn't even recognize its old drive (a 3.5/5.25 inch combo) even after I reverted everything back. I had to replace it with two separate high-density drives. And even then, it took a while to find a pair it would accept.

Obviously writing double-density disks with a high density drive is less than ideal. I mean sometimes it works. But it's never stable. Most annoying was when I had one disk that would read reliably in my Tandy, but my XT couldn't make heads nor tails of it.

So this brings me to my question: What do I need for my XT to accomplish this task? Since at the moment, it's my best candidate for the job (at least until I can figure out what's going on with either of my 486s). Still, the XT is natively 360k. I've managed to find many of the .img files I want. The CF Adapter makes file transfer a simple drag-and-drop. So, since I can get the .img files over... What do I need to put them on a physical disk?

Side note: If there is something XT compatible that can write alternative disk formats as well, let me know. I have some TRS-80s that have been starved for software as well.
 
I’ve used DCF 5.3 (disk copy fast) and it seems to work pretty well. It doesn’t seem to be happy with DOS 1.x 8 sectors per track floppies. It’s also technically not free software, but I’m not sure if the author is still around selling licenses.

You can also use something like IMD (Dave Dunfield’s ImageDisk), but you’ll have to convert the files to that format first, and it’s not as easy to use at first, but that’s mainly because it is much more advanced and has a lot more options.
 
libdsk for DOS is a really good option.
https://www.seasip.info/Unix/LibDsk/



Plus, there is a port of Linux's "dd" for DOS.
http://[URL]http://www.ibiblio.org/pub/micro/pc-stuff/freedos/gnuish/gnufut21.zip']http://www.ibiblio.org/pub/micro/pc-stuff/freedos/gnuish/gnufut21.zip


SYNOPSIS
dd [if=file] [of=file] [ibs=bytes] [obs=bytes] [bs=bytes]
[cbs=bytes] [skip=blocks] [seek=blocks] [count=blocks]
[conv={ascii,ebcdic,ibm,block,unblock,lcase,ucase,swab,noerror,notrunc,
sync}]

DESCRIPTION
This manual page documents the GNU version of dd. dd copies
a file (from the standard input to the standard output, by
default) with a user-selectable blocksize, while optionally
performing conversions on it.

OPTIONS
Numbers can be followed by a multiplier:
b=512, k=1024, w=2, xm=number m

if=file
Read from file instead of the standard input.

of=file
Write to file instead of the standard output. Unless
conv=notrunc is given, truncate file to the size speci-
fied by seek= (0 bytes if seek= is not given).

ibs=bytes
Read bytes bytes at a time.

obs=bytes
Write bytes bytes at a time.

bs=bytes
Read and write bytes bytes at atime. Override ibs and
obs.

cbs=bytes
Convert bytes bytes at a time.

skip=blocks
Skip blocks ibs-sized blocks at start of input.

seek=blocks
Skip blocks obs-sized blocks at start of output.

count=blocks
Copy only blocks ibs-sized input blocks.

conv=conversion[,conversion...]
Convert the file as specified by the conversion argu-
ments.
Conversions:

ascii
Convert EBCDIC to ASCII.

ebcdic
Convert ASCII to EBCDIC.

ibm
Convert ASCII to alternate EBCDIC.

block
Pad newline-terminated records to size of cbs,
replacing newline with trailing spaces.

unblock
Replace trailing spaces in cbs-sized block with new-
line.

lcase
Change uppercase characters to lowercase.

ucase
Change lowercase characters to uppercase.

swab
Swap every pair of input bytes. Unlike the Unix dd,
this works when an odd number of bytes are read. If
the input file contains an odd number of bytes, the
last byte is simply copied (since there is nothing to
swap it with).

noerror
Continue after read errors.

sync
Pad every input block to size of ibs with trailing
NULs.

If I remember correctly 0: is Floppy A:, and 1: is Floppy B:.

Code:
C:\> dd if=\path\to\file1.img of=0:

Larry
 
When I was archiving my personal stash of diskettes I found that many of the disks were readable, but required more retries on weak sectors than the existing tools used. So of course I wrote my own:

  • Runs on DOS 2.1 and up. Will run under Windows 9x and 32 bit XP as well.
  • Can handle 160K, 180K, 320K, 360K, 720K, 1.2MB, 1.4MB formats.
  • Flexible: Handles oddball formats too because you have to specify tracks, sides and sectors per track.
  • Allows you to specify the number of retries for weak sectors which helps on marginal disks
  • Reads and writes images.
  • Source code included on the web page. Compiles with Turbo C++ 3.0 for DOS.
  • TESTED. Very well .. the code is close to 17 years old now.
Enjoy ...

-Mike
 
Never tried dd for 1024, 256, or 128 byte sectors. Does it work? Not all Microsoft-DOS incarnations use 512 byte sectors. Consider that used on PC98 systems--8x1024 is standard across physical sizes. That is, 8", 5.25" and 3.5" all share the same format.

Mike, only 17 years? Consider COPYQM, which can do all of the above. Last revision was about 24 years ago. Still works.
 
Never tried dd for 1024, 256, or 128 byte sectors. Does it work? Not all Microsoft-DOS incarnations use 512 byte sectors. Consider that used on PC98 systems--8x1024 is standard across physical sizes. That is, 8", 5.25" and 3.5" all share the same format.

Mike, only 17 years? Consider COPYQM, which can do all of the above. Last revision was about 24 years ago. Still works.

17 vs. 24 .. not much of a difference at this point. It's not age contest, it's a statement on testing.

Are you going to make the source code for CopyQM available?
 
Don't own it anymore, so no. I'd have to check, but I think the first CopyQM dates back to the 1980s as it got its start in the 5160 world (no such thing as the Internet). The last versions featured copy protection schemes, as well as generation of self-extracting image files and scripting for introductory displays. IBM used it for their OS/2 CSD collection--the extractor bound up a 16-bit PM OS/2 binary in addition to the regular DOS one. Supported secondary+tertiary floppy controllers (up to 12 drives).

All in the past now. Aside from the occasion oddball floppy recovery--and there it's mostly data translation. I mostly do tape stuff now--pays better. Still trying to retire and not having much luck at it.
 
Last edited:
Thanks so much for all the responses. I have to say, I'm more than a little overwhelmed, as I'm still going through all the options. I take it most of these are capable of doing multiple formats, but I had no idea there would be so many!

I think I'm going to start with FDImage, CopyQM, and Imagedisk as they appear to have the most straightforward installation.

I am however really curious about RAWRITE. I think I've heard of it before. Supposedly it reads the raw magnetic information on a disk and was used for archiving unknown floppy formats. But I thought it was for newer versions of Windows.

I'm having some trouble finding XCOPY. Or at least the Dr. Doss version of it. Every time I Google it, I either get some sort of addon to an existing DOS utility or some medical professional. Also, when I google BIM2IMD, all I get is this thread. So if someone has a link for these, it would be appreciated.
 
I am however really curious about RAWRITE. I think I've heard of it before. Supposedly it reads the raw magnetic information on a disk and was used for archiving unknown floppy formats. But I thought it was for newer versions of Windows.
Nope, RAWRITE has been around since forever. It's what I (and countless others) used in '90s to write Linux installation floppy disks. You're probably mixing it up with something like Kryoflux - the "raw" part of RAWRITE is just that it works on raw devices, not caring about filesystems or the like - as all disk image utilities do.
 
Imagedisk by Dave Dunfield:
http://dunfield.classiccmp.org/img/index.htm

The utilities, TD02IMD, BIN2IMD, DMK2IMD, IMD2RAW, IMDA, IMDU, IMDV, and TESTFDC.COM are
all included in his software.

NOTE:
You want to run TESTFDC first to see what the capabilities are of your DOS Floppy Disk Controller.
Most of us havd disabled the onboard FDC, and inserted an ADAPTEC AHA-1522 or 1542 FDC with
SCSI disabled.


Larry
 

Attachments

  • imd.pdf
    409.7 KB · Views: 4
Nope, RAWRITE has been around since forever. It's what I (and countless others) used in '90s to write Linux installation floppy disks. You're probably mixing it up with something like Kryoflux - the "raw" part of RAWRITE is just that it works on raw devices, not caring about filesystems or the like - as all disk image utilities do.
Yip I've been using the last couple of weeks on my Zenith 286LP Plus. Was available well before FreeDos even existed
 
17 vs. 24 .. not much of a difference at this point. It's not age contest, it's a statement on testing.

I'm still improving mine ;-)

If anyone wants to give http://www.oldskool.org/pc/disk2img a try, it does all of the above, but is faster (uses track reads, then goes back for sectors it couldn't read) and also has the ability to reconstruct data from sectors with weak bits.
 
So this brings me to my question: What do I need for my XT to accomplish this task?
I've written a program which receives raw image files via serial (xmodem) and writes them to floppy disk. Does not access any hardware directly. May be useful if the system used to write the images lacks storage for the image files, and works on non-compatible machines.

I wrote it to write disk images on a Philips :YES, which is not IBM compatible and lacks mass storage. ZIP file includes source code and the executable.
 

Attachments

  • xmimage.zip
    5.8 KB · Views: 5
I'm having some trouble finding XCOPY. Or at least the Dr. Doss version of it. Every time I Google it, I either get some sort of addon to an existing DOS utility or some medical professional. Also, when I google BIM2IMD, all I get is this thread. So if someone has a link for these, it would be appreciated.

Since no one has mentioned it yet, you can find the entire version 7.03 of DR-DOS here:

ftp://ftp.oldskool.org/pub/misc/DOS/DRDOS7.03/

Unfortunately, it is saved as disk images. But fortunately, DR-DOS's DISKCOPY is also there as a direct link. This version of DISKCOPY can transfer disk images DIRECTLY to disk and can be run from other versions of DOS. The syntax is:

DISKCOPY filename.ext x:

Such as "DISCKOPY disk01.144 A:" which would copy the first disk image from the link above to the floppy in A: (overwriting all contents of the floppy.)
 
Back
Top