WELCOME Welcome to another useful utility by Demonlord... PROGRAM DESCRIPTION (and minor rambling) IMG2DSK is a program to copy raw disk image files back to disk. Since I'm writing this in a minor hurry, and don't feel like spending a lot of time writing a doc file that's 10 times the size of the program it describes, it'll be short and sweet... I'll cram in a short disclaimer, just to make sure... DISCLAIMER: * This file is 100% guaranteed to exist. The author makes no claims to the existence or non-existence of the reader. * Ok, a serious one too... Use the prog however you want to, but I'll never take any responsibilities for what you cause with it. Damage stuff all you want, but don't involve me... RAMBLING Now that that's done, let's get on with a description of all the magnificent features of this prog! The prog is of course written in 100% 8088 assembler, to make sure it works on those old machines we all love! If you think the prog is small, well, I like to write optimized code, since I hate sloppy patched-up work (no fan of M$, no). Of course I could REALLY optimize it if I wanted to, but there's no reason to go to extremes... If you think the prog is too large, well, it's just because I like to describe what happens. If you edit the file, you'll notice that 50% of the file is text, like error messages and other crap displayed under one condition or another... REQUIREMENTS The program requires DOS 2.0, since it uses certain INT 21 function that were implemented in DOS 2.0. It also requires 2 disk drives, or 1 disk drive and 1 hard drive. (One to hold the image file, and one as destination drive). SYNTAX The syntax is really simple. There are 2 parameters to use, no flashy interface that doesn't really do anything, except occupy HD space, memory and eat up processor power. OK, so there is an interface, but it's nothing flashy. IMG2DSK Example: IMG2DSK KQ1.IMG A: writes the disk image in KQ1.IMG to the disk in drive A. Drive B can of course also be used. The image file HAS TO be the correct size for it's disk format (see list below), since the size of the image file determines how many tracks, sectors and sides the disk originally had, and will have when IMG2DSK is done... If the image file has an illegal size, it'll quit with an error. See the section ERRORS below for a list of errors that can pop up... Note that the drive letter must be followed by ":". Only drives A and B are valid, since there aren't many computers around anymore with more than 2 disk drives... If you don't enter any parameters, you'll be prompted for image filename and drive letter. I included this since DOS versions prior to 3.0 (or something like that) use a different way to handle parameters, so if you're using a really old version of DOS, run the prog without parameters. Image sizes: Size Tracks Sides Sectors Image size (in bytes) 160K 40 1 8 163840 180K 40 1 9 184320 320K 40 2 8 327680 360K 40 2 9 368640 720K 80 2 9 737280 1,2M 80 2 15 1228800 1,44M 80 2 18 1474560 PROGRAM OPERATION AND CAPABILITIES After you've passed the stages described above (entering of filename and drive letter), the prog verifies that the image file exists, and checks that it has a compatible size. After that, it tells you to insert a disk that the image will be written to. MAKE SURE THE DISK CAN HOLD AS MUCH DATA AS YOU'RE TRYING TO WRITE TO IT! Bad things will probably happen if you try to write a 1,44MB image to a 360K disk in a 360K drive. I won't even try what happens! The program checks that the drive is ready and if it is, the copying starts. It reads one track at a time from the image file (one side), to minimize memory requirements. When the program writes to the disk, it writes one entire track at a time, since this speeds up the operation. This does, however, not work on all drives/computers, so if this operation results in an error, the program switches to single sector writes. It means that instead of writing 9 (or whatever) sectors in one operation, it writes sector by sector, starting with 1, continuing with 2 and so on. If this write fails as well, you'll get an error message. When the entire disk is done, the program quits back to (D)OS. You can press ESC at ANY point in the program to abort the whole operation. When entering filenames, drive and waiting for disk insertation the program quits directly. If you press any key during write, you'll get an Abort? question, since you might accidentally just have fallen on the keyboard... If the destination disk doesn't seem to work, make sure to format the disk to the correct format before writing an image file to it. When I tried to write a 720K image to a 720K disk that was formatted to 360K, the disk didn't work properly after completion, but after formatting the disk to 720K and retrying, it worked... ERRORS Below is a list of errors, and specifications on what conditions they are displayed. If the program quits with an error, the errorlevel (exitcode) is always 1, if it's successful, it quits with 0. No drive letter specified! Invalid drive specified! You have specified an invalid drive as a parameter (only A and B are valid) or you've forgotten the ":" after the drive letter. Image file not found! The image file you've specified can not be found. Image has invalid size, no known format matches! The image file has an unsupported size, so IMG2DSK can't handle it. Operation aborted! Returning to OS You've chosen to abort the program. Address mark not found Disk is write protected Sector not found Disk changed DMA overrun Invalid media for this image format CRC error Controller failure Seek failed Drive not ready Unknown error! The errors above are disk errors, that will appear if there are any errors writing to the destination disk. The most probable problem is either that the disk has bad sectors, or that the disk is formatted with different sector sizes. The disk has to be formatted using only 512 byte sectors, like DOS uses! Raw image files doesn't support anything else, so... LAST WORDS Since this is the very first version of this program, I haven't tested it too much on other platforms than the Pentium that it's written on. I've tested writing all the images I have, and they've all worked afterwards. I've done some minor testing on my 286 with DOS 6.2, that has worked as well. I've also tried writing just one image on the 286 with DOS 2.11, and that worked as well. I have problems testing under DOS 2.11 since I only have one 360K drive in the 286 (I have one 720K too, but that's not supported under DOS 2.11), so testing under DOS 2.11 is a bit tough... What I'm trying to say here is that the program works fine for me, and I hope it'll do so for you too, but if you have any problems you can always write me... (I'm not saying that I WILL fix any/all bugs you find, but I'm pretty sure I'll at least take a good look at the problem...) If you have any questions regarding this program, or something else, don't hesitate to write... Comments/bugreports/problems/whatever can be sent to: demonlord@swipnet.se