home *** CD-ROM | disk | FTP | other *** search
- Source code in C (compilable as C++) to format a floppy disk.
-
- Notes.
-
- General
- See the top of the individual program files for info on
- compilation.
-
- cformat.c, cformat.h:
- Source code to format a floppy disk in drive A or B. Menus for
- selecting drive and media type. By default, does not verify the
- tracks as they are formatted; it copies the (MS-DOS) system files
- (including command.com, if present). Modify the code if you want to
- be able to user-select verification and/or the system file copying
- (either as command line options or as additional menus). The basic
- boot sector image is taken from the file boot.bin, which must be
- present in the same directory as cformat.exe.
-
- An AT-compatible machine is necessary for some of the low-level
- BIOS function calls to work. If you throw out the various BIOS calls
- that are inapplicable to an XT, it will likely work OK with the
- default disk parameter table (11 bytes of data pointed to by the
- "interrupt" vector at 0x1e).
-
- It is unclear when the system changes the pointer (to the floppy
- disk parameter table) in vector 0x1e. It appears to be unchanged
- throughout the program, although it *may* not be a good idea to run
- cformat.exe from a floppy drive while you format a floppy in another
- drive (although I tested this, and it works OK on my machine).
-
- The critical error handler routine (which doesn't do much) hasn't
- really been tested.
-
- Use with caution: there is no attempt to try to avoid doing things
- to a network drive or whatever; although an effort has been made to
- produce a useful program, you should always be careful with anything
- that has the potential of incorrectly formatting the disk drive or
- formatting the wrong disk drive.
-
- boot.asm, boot.bin
- The boot.asm file generates a 512-byte binary file containing a
- simple bootstrap loader suitable for floppies. After you run the
- object file through tlink (using tlink /t boot, boot.bin) you get the
- file boot.bin. cformat.exe reads this file and writes it to the boot
- sector of the floppy disk being formatted (it fills in certain
- information pertaining to the media type prior to writing the data to
- the floppy).
-
- genboot.c
- An alternative to using the boot.bin file created by boot.asm. It
- reads the boot sector from an already formatted floppy disk and
- writes out two files to the current directory: boot.bin and boot.img.
- boot.img is a human-readable file of the boot sector data. The
- floppy disk to be read should be specified on the command line.
- Caution: this will overwrite the pre-assembled/linked version of
- boot.bin supplied (which was generated by boot.asm).
-
- Gary M. Blaine CIS ID: 70007,4650 December 31, 1992
-