home *** CD-ROM | disk | FTP | other *** search
/ Borland Programmer's Resource / Borland_Programmers_Resource_CD_1995.iso / code / bcpp / file7 / readme.doc < prev   
Encoding:
Text File  |  1995-05-19  |  2.7 KB  |  59 lines

  1. Source code in C (compilable as C++) to format a floppy disk.
  2.  
  3. Notes.
  4.  
  5. General
  6.    See the top of the individual program files for info on
  7. compilation.
  8.  
  9. cformat.c, cformat.h:
  10.    Source code to format a floppy disk in drive A or B.  Menus for
  11. selecting drive and media type.  By default, does not verify the
  12. tracks as they are formatted; it copies the (MS-DOS) system files
  13. (including command.com, if present).  Modify the code if you want to
  14. be able to user-select verification and/or the system file copying
  15. (either as command line options or as additional menus).  The basic
  16. boot sector image is taken from the file boot.bin, which must be
  17. present in the same directory as cformat.exe.
  18.  
  19.    An AT-compatible machine is necessary for some of the low-level
  20. BIOS function calls to work.  If you throw out the various BIOS calls
  21. that are inapplicable to an XT, it will likely work OK with the
  22. default disk parameter table (11 bytes of data pointed to by the
  23. "interrupt" vector at 0x1e).
  24.  
  25.    It is unclear when the system changes the pointer (to the floppy
  26. disk parameter table) in vector 0x1e.  It appears to be unchanged
  27. throughout the program, although it *may* not be a good idea to run
  28. cformat.exe from a floppy drive while you format a floppy in another
  29. drive (although I tested this, and it works OK on my machine).
  30.  
  31.    The critical error handler routine (which doesn't do much) hasn't
  32. really been tested.
  33.  
  34.    Use with caution: there is no attempt to try to avoid doing things
  35. to a network drive or whatever; although an effort has been made to
  36. produce a useful program, you should always be careful with anything
  37. that has the potential of incorrectly formatting the disk drive or
  38. formatting the wrong disk drive.
  39.  
  40. boot.asm, boot.bin
  41.    The boot.asm file generates a 512-byte binary file containing a
  42. simple bootstrap loader suitable for floppies.  After you run the
  43. object file through tlink (using tlink /t boot, boot.bin) you get the
  44. file boot.bin.  cformat.exe reads this file and writes it to the boot
  45. sector of the floppy disk being formatted (it fills in certain
  46. information pertaining to the media type prior to writing the data to
  47. the floppy).
  48.  
  49. genboot.c
  50.    An alternative to using the boot.bin file created by boot.asm.  It
  51. reads the boot sector from an already formatted floppy disk and
  52. writes out two files to the current directory: boot.bin and boot.img. 
  53. boot.img is a human-readable file of the boot sector data.  The
  54. floppy disk to be read should be specified on the command line. 
  55. Caution: this will overwrite the pre-assembled/linked version of
  56. boot.bin supplied (which was generated by boot.asm).
  57.  
  58. Gary M. Blaine   CIS ID: 70007,4650   December 31, 1992
  59.