home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / f / fmt-1722.zip / FMT.DOC next >
Text File  |  1992-03-13  |  35KB  |  762 lines

  1.                ┌────────────────────────────────┐
  2.                │ ┌────────────┐         │
  3.                │ │FMT Ver 1.00│         │
  4.                │ │   MANUAL   │            ┌┘
  5.                │ └────────────┘            └┐
  6.                │                │
  7.                │         ▄████▄        │
  8.                │         ██████        │
  9.                │          ▀▀▀▀  ▀        │
  10.                │           ▐▌        │
  11.                │           ██        │
  12.                │           ██        │
  13.                │           ██        │
  14.                │           ▐▌        │
  15.                └───────▀────────────────▀───────┘
  16.  
  17.             ─── A high-capacity floppy formatter ───
  18.  
  19.  
  20.                  ██████████████
  21.                 ▐▌  Features  ▐▌
  22.                  ██████████████
  23.  
  24.  ■ Maximum formats : 360K diskette = 820K  ∙ 720K  diskette = 1066K (NEW!)
  25.              1.2M diskette = 1476K ∙ 1.44M diskette = 1722K
  26.  
  27.  ■ Most extended formats can be made bootable
  28.  
  29.  ■ An extended boot sector will boot C: if you leave floppy in A:
  30.  
  31.  ■ Options to change logical disk organization:cluster size & root dir capacity
  32.  
  33.  ■ Allows to create new named formats to save typing
  34.  
  35.  ■ Fast and quite format : drive doesn't play music when marking bad clusters
  36.  
  37.  ■ A lot of low-level options for programmers
  38.  
  39.  
  40.             ███████████████████████████████
  41.                ▐▌ Requirements and limitations▐▌
  42.             ███████████████████████████████
  43.  
  44. FMT needs at least an AT to run. Moreover, it was tested only with high-density
  45. drives. It *should* work with DD drives, but you might need to play with
  46. options. 2.88M drives are not supported.
  47.  
  48. The reason for the mess is that I had to figure out how diskette BIOS work by
  49. experiment. Obviously, experiments were limited by my computer & those of my
  50. several friends. I couldn't find a good book covering diskette operations...
  51.  
  52. I'll work on compatibility of the next versions of FMT. In the meanwhile, I'll
  53. be very grateful if you let me know about the bugs/compatibility problems of
  54. this program. I am sure that version 1.00 has a plenty! Also, this file is not
  55. debugged for grammer errors.
  56.  
  57.  
  58.                   ████████████████████
  59.                  ▐▌ Distributing FMT ▐▌
  60.                   ████████████████████
  61.  
  62. You can distribute FMT freely as far as it's copied in original form or you
  63. clearly document all changes you have made. No fee should be charged for the
  64. program, but you can charge a small fee for distribution.
  65.  
  66. FMT is released as shareware: you can try it for free; if you decide to use
  67. it, you are encouraged to register for $15 or whatever you think this program is
  68. worth. This is my first shareware program. It will be interesting to see what
  69. happens.
  70.  
  71.  
  72.  
  73.                  ██████████████
  74.                 ▐▌ Finding me ▐▌
  75.                  ██████████████
  76.  
  77. This is an interesting question. Now I am studying in Boston University and live
  78. on campus, so my current address is valid only to the end of semester (Approx.
  79. middle of May 1992). I give it anyway:
  80.  
  81. e-mail : kibirev@CSA.BU.EDU
  82. phone  : (617)352-5563
  83. mail   : Oleg Kibirev, 277 Babcock street Box 1869, Boston MA 02215, USA
  84.  
  85. Please, don't send anything to this address unless you have checked that I am
  86. still here by phone or e-mail.
  87.  
  88. Now my home address:
  89.  
  90. Oleg Kibirev                           Ä½Ñú è¿í¿αÑó
  91. Ilycha 7 Flat 42                       π½. ê½∞¿τá 7-42
  92. Novosibirsk 630090                       ú. ì«ó«ß¿í¿α߬,630090
  93. Russia
  94.  
  95.  
  96.  
  97.                  ██████████████
  98.                 ▐▌ ─ Thanks ─ ▐▌
  99.                  ██████████████
  100.  
  101. It would be impossible for me to write this program without studying 2 other
  102. products.
  103.  
  104. The first is FDFORMAT, the floppy formatter written by Christoph H. Hochstätter.
  105. I have used a lot of good ideas from this program in FMT. The important ones
  106. are:
  107.  
  108. Idea to use interleave = 2 to fit more sectors on a track
  109. Extended boot sector that boots C: instead of A:
  110. Sector spinning to improve disk performance
  111. Loading BIOS extender to HMA with DOS 5.00
  112.  
  113. Another one is 800.COM, a tiny TSR by Pasquale Alberto. This program extends
  114. diskette BIOS, so that most extended formats can be handled by DOS standard
  115. FORMAT, DISKCOPY & DISKCOMP. Studying it's code helped me to understand how
  116. to implement high-capacity formats and write a TSR to make them readable by DOS.
  117.  
  118.  
  119.  
  120.  
  121.                  ██████████████
  122.                 ▐▌ INT13X.COM ▐▌
  123.                  ██████████████
  124.  
  125. You need to load this TSR to make full use of FMT.  The simplest way is to run
  126. it from AUTOEXEC.BAT, or, with DOS 4+, INSTALL it from CONFIG.SYS.  Memory
  127. requirements of INT13X shouldn't cause a problem.  If you have DOS 5 running in
  128. HMA, INT13X will load to the end of the DOS segment, keeping no memory.  DOS
  129. will even bother to toggle A20 line for me!  Otherwise, it will keep 160 bytes.
  130.  
  131. The only option of INT13X is LOW, that will prevent it from loading to HMA. Use
  132. if you have any problems without it. You can end up with a strange combination
  133. LOADHIGH INT13X LOW
  134.  
  135. If you make a diskette with extended format bootable, make sure that it runs
  136. INT13X during startup.    Otherwise, the floppy may become unreadable after the
  137. first disk change.
  138.  
  139. Note that other disk BIOS extenders will not support a 3½" DD diskette with
  140. 11-13 tracks.
  141.  
  142.  
  143.                  █████████████
  144.                 ▐▌─── FMT ───▐▌
  145.                  █████████████
  146.  
  147. Running the program with empty command line will display the summary of options.
  148. The only mandatory parameter is drive letter - A: or B:.
  149.  
  150. You can stop FMT at any time by two ways.  The first is pressing ESC.  This is
  151. an option for brave - the program will stop even in the middle of DOS or BIOS
  152. call.  FMT will perform cleanup needed to avoid trouble in this case.  However,
  153. there are some popup TSRs that refuse to popup if INT 13H never returns.  You
  154. can defeat the problem by running I13S.COM before & I13R.COM after TSR.
  155. Alternatively you can just open drive door.
  156.  
  157. Here is the summary of FMT options. Logical options (like /V or /W) can be
  158. disabled by adding '-'.  With all options that takes a number, you can specify a
  159. hex by omitting ':'.  For example :  /DF9 == /D:249.
  160.  
  161. It's Ok to specify the option several times - the last occurrence will determine
  162. the result. This can be useful with "named formats" (see CONFIG.FMT section) or
  163. batch files.
  164.  
  165.  ╔═══════════════════════════════════════════════╤════════════════════════════╗
  166.  ║ /T:xx       - Number of tracks         │ /G:xx - Gap length          ║
  167.  ║ /N:xx       - Sectors per track         │ /I:xx - Interleave          ║
  168.  ║ /F:name     - Use named format         │ /M:xx - BIOS media byte    ║
  169.  ║ /V"label"   - Set volume label                │ /L:xx - Format fill char   ║
  170.  ║ /S<:boot>   - Copy system to floppy         │ /Z:xx - Retry count          ║
  171.  ║ /Q           - Quick format (Fast DEL *.*)     │ /W     - Write verify       ║
  172.  ║ /E           - Test (do everything but format) │ /R:xx - Root directory size║
  173.  ║ /B           - Batch mode (no output/prompts)  │ /C:xx - Sectors per cluster║
  174.  ║ /X:xx       - Sector spinning between heads     │ /D:xx - FAT ID byte          ║
  175.  ║ /Y:xx       - Sector spinning between tracks  │ /A     - Verbose output     ║
  176.  ╚═══════════════════════════════════════════════╧════════════════════════════╝
  177.  
  178. /T:xx /N:xx - specifies the number of sectors and tracks. The capacity of the
  179. diskette in K is simply equal to tracks∙sectors. For example /T:82 /N:18 formats
  180. a floppy to 1476K. The maximal number of sectors that will work depends on the
  181. media:
  182.  
  183. 5¼" DD disk : 1-10 sectors (9 = DOS standard)
  184. 5¼" HD disk : 11-18 sectors (15 is standard)
  185.  
  186. 3½" DD disk : 1-10 sectors in DD drive (DOS puts 9)
  187.           1-13 sectors in HD drive
  188.           1-12 sectors on some HD drives (Sony ?)°
  189.  
  190. 3½" HD disk : 14-21 sectors (18 = DOS standard)
  191.  
  192. °I have seen only one computer that couldn't format 13 sectors. Interestingly
  193. enough, it had no problem reading & writing such diskettes. 12 sectors were
  194. fine.
  195.  
  196. As you can see, DOS doesn't get the most from a diskette! For a 720K diskette,
  197. it gets 320K less than possible even with the same number of tracks.
  198.  
  199. Of course, in normal life you are only interested in the highest number of
  200. sectors or DOS compatible number (See the next option for some useful
  201. combinations).    You may want to set fewer sectors do that your program keeps all
  202. the space of the distribution diskette (this makes virus infection harder).
  203. Note that DOS can handle such floppies without INT13X.
  204.  
  205. Number of tracks supported doesn't depend on the diskette. 5¼" DD disk drive has
  206. rated capacity of 40 tracks, all the others get 80. When you format a 360K
  207. diskette in HD drive, it will just format every second track. Because those
  208. tracks are still about twice narrower than those of original DD drive, the later
  209. can't reliably read such diskette. Try reformatting the diskette several times
  210. (with /W-) to reduce the problem.
  211.  
  212. Surprisingly, DOS FORMAT will refuse to format 5¼" disk to 80 tracks even with
  213. HD drive.  FMT won't.  This way you can get 800K (/T:80 /N:10) on a 360K disk.
  214.  
  215. A real drive will support more than 40 or 80 tracks. Diskette has much more than
  216. 80, so the actual number supported depends on how far the drive head can move.
  217. /T:41 or /T:82 seems to be always safe. Your drive may get more. To figure out
  218. how much more, start with formatting to an unrealistic number (like /T:90) and
  219. listen carefully. Eventually you'll here the head bumping against the stop -
  220. this gives an approximate margin. Now, retry the format decreasing the number of
  221. tracks by one each time until you here nothing suspicious and the floppy verifies
  222. without errors. My drives get 85 tracks! (or 42 for DD drive-compatible formats)
  223. It's best to limit number of tracks to 41/82 when transferring files to another
  224. computer.
  225.  
  226. You can specify default number of sectors and tracks for each drive in
  227. CONFIG.FMT. If you don't, defaults are /T:82 /N:18 for a 5¼" drive & /T:82 /N:21
  228. for a 3½" drive.
  229. ───────────────────────────────────────────────────────────────────────────────
  230.  
  231. /F:<format> - an alternative way to specify drive format.  Some formats are
  232. predefined for you.  They are actually shortcuts for /T:xx /N:xx combination.
  233. You can define your own formats - their names doesn't have to be numbers and you
  234. may specify any other options.
  235.  
  236. ╔═════════╤═══════════╤═══════╤═════════════╤═════════════════════════════════╗
  237. ║  Format │   Drive   │ Media │ Stands for  │           Comment          ║
  238. ╠═════════╪═══════════╪═══════╪═════════════╪═════════════════════════════════╣
  239. ║ /F:360  │ 5¼" HD/DD │  DD   │ /T:40 /N:9  │ DOS standard                    ║
  240. ║ /F:410  │ 5¼" HD/DD │  DD   │ /T:41 /N:10 │ The highest readable by DD drive║
  241. ╟─────────┼───────────┼───────┼─────────────┼─────────────────────────────────╢
  242. ║ /F:720  │ 5¼" HD    │  DD   │ /T:80 /N:9  │ Fast format, also DOS standard  ║
  243. ║      │ 3½" HD/DD │       │             │                                 ║
  244. ╟─────────┼───────────┼───────┼─────────────┼─────────────────────────────────╢
  245. ║ /F:820  │ 5¼" HD    │  DD   │ /T:82 /N:10 │ The most you can get for 5¼" DD ║
  246. ║      │ 3½" HD/DD │       │             │ diskette                        ║
  247. ╟─────────┼───────────┼───────┼─────────────┼─────────────────────────────────╢
  248. ║ /F:1.2  │ 5¼" HD    │  HD   │ /T:80 /N:15 │ DOS standard high-density, you  ║
  249. ║ /F:1200 │          │       │         │ could define this for 3½"       ║
  250. ╟─────────┼───────────┼───────┼─────────────┼─────────────────────────────────╢
  251. ║ /F:1.48 │ 5¼" HD    │  HD   │ /T:82 /N:18 │                                 ║
  252. ║ /F:1476 │          │       │         │                      ║
  253. ╟─────────┼───────────┼───────┼─────────────┼─────────────────────────────────╢
  254. ║ /F:1.07 │ 3½" HD    │  DD   │ /T:82 /N:13 │ Try /F:984 if your drive don't  ║
  255. ║ /F:1066 │ DD=???    │       │         │ get it. Can't be made bootable  ║
  256. ╟─────────┼───────────┼───────┼─────────────┼─────────────────────────────────╢
  257. ║ /F:984  │ 3½" HD/DD?│  DD   │ /T:82 /N:12 │ Can't be made bootable          ║
  258. ╟─────────┼───────────┼───────┼─────────────┼─────────────────────────────────╢
  259. ║ /F:1.44 │ 3½" HD    │  HD   │ /T:80 /N:18 │ DOS standard; can be defined for║
  260. ║ /F:1440 │          │       │         │ 5¼" drive                       ║
  261. ╟─────────┼───────────┼───────┼─────────────┼─────────────────────────────────╢
  262. ║ /F:1.72 │ 3½" HD    │  HD   │ /T:82 /N:21 │ A lot of space for one floppy!  ║
  263. ║ /F:1722 │          │       │         │                      ║
  264. ╚═════════╧═══════════╧═══════╧═════════════╧═════════════════════════════════╝
  265.  
  266. If you suddenly run out of disk space, try formatting a 360K diskette to /T:50
  267. /N:18 - some can hold it without errors. I won't use it for important data,
  268. though. (Once you have at least 11 sectors, reliability doesn't depend on the
  269. number). They say, with some drives it's possible to format a 720K diskette to
  270. high density. This doesn't work with mine. You can't format a high density
  271. floppy to double density.
  272.  
  273. ───────────────────────────────────────────────────────────────────────────────
  274.  
  275. /V<"label"> - specify a volume label for the diskette. FMT will allow labels
  276. with both upper & lowercase letters, blanks, or anything else you want. You
  277. can use this option with the label enclosed in quotes (/V"Test of FMT"). If you
  278. just specify /V, FMT will ask you to enter the label. The only editing key you
  279. can use is backspace, but it's possible to enter any character from 1 to 255 by
  280. Alt-XXX sequence. Volume label can be disabled by /V-.
  281.  
  282. Note that FMT sets volume serial numbers in a way different from DOS.  It will
  283. be in the format MMDD-HHmm and show the date and time when the diskette was
  284. formatted (So that you can figure it out just by typing DIR).
  285.  
  286. ───────────────────────────────────────────────────────────────────────────────
  287.  
  288. /S<:bootfile> - make a diskette bootable. To use this option, you must build
  289. what I call a boot image file. Make a diskette with standard format (like 360K)
  290. bootable by FORMAT /S or SYS. Copy any additional files you want: HIMEM.SYS,
  291. INT13X.COM, CONFIG.SYS, AUTOEXEC.BAT etc. You may want to check that things work
  292. as they are supposed to by actually booting from the diskette.
  293.  
  294. Run FMTBOOT.EXE to save results to one file.  The options of this program are
  295. described in a separate section.  For now, let's just use FMTBOOT A: /R to
  296. create a file called BOOT.FMT in the same directory with FMT.EXE.
  297.  
  298. Now when you use /S, a diskette (of any format) will be made bootable and all
  299. files you wanted will be present in it's root directory (bthw, FMTBOOT
  300. completely ignores subdirs).
  301.  
  302. The reason for doing all this is that, unlike DOS FORMAT, FMT can't assume that
  303. you are using any particular DOS version. So you must tell it which boot sector
  304. and files to use. As an added bonus, now you are not limited to copying only
  305. system files: create CONFIG.SYS/AUTOEXEC.BAT to load DOS high, set a lot of
  306. buffers and files, run INT13X - whatever you want every bootable diskette to do.
  307. In particular, 4DOS users no longer need to rename 4DOS to COMMAND.COM. Also,
  308. it's faster to include programs to a boot image file than to copy them to
  309. diskette after format - FMT /S is roughly as efficient as DISKCOPY on almost
  310. full disk.
  311.  
  312. The shadow side is that boot images tend to be rather large - 100K is typical
  313. for DOS 5.00. It would be nice to store these files in compressed form in future
  314. versions of FMT.
  315.  
  316. You can have more than one boot file. To specify which one you need, use
  317. /S:bootfile format of the switch. The path where FMT will look for the file is
  318. determined by the following rules:
  319.  
  320.  ■ If the filespec contains '\' or ':', FMT assumes that you have specified the
  321. exact path of the file.
  322.  
  323.  ■ Otherwise, if FMTFILES environment variable is set, it's value will be used
  324. as the path of the file (make sure that it ends with \). No other locations are
  325. searched.
  326.  
  327.  ■ If neither of above is true, the file will be searched first in the directory
  328. where FMT.EXE resides, then in current directory.
  329.  
  330.  ■ /S == /S:BOOT.FMT
  331.  
  332. Note that .FMT extension is not assumed - BOOT.FMT was just my random choice.
  333.  
  334. /S function will fail on some disks with bad sectors in the beginning.    If boot
  335. sector belongs to DOS 4+, there should be only 3 error-free sectors in the start
  336. of the disk.  Earlier versions require enough space for the first system file -
  337. IO.SYS or IBMBIO.COM.  Although FMT doesn't complain, it's impossible to make
  338. bootable 3½" disk with 11-13 sectors per track - BIOS is unable to read a boot
  339. sector.
  340.  
  341. DOS 5.0 version of SYS can also make most formats bootable. It doesn't work with
  342. 5¼" DD diskettes that are formatted to 80+ tracks - boot sector of these
  343. diskettes have to be patched. For programmers: this is not terribly complicated
  344. - just turning double-stepping off:
  345.  
  346.     jmp $+3 ; DOS likes EB XX 90 at the start
  347.     nop
  348.     and byte ptr cs:[490H],0DFH ; Turn double-stepping off for drive A:
  349.     jmp short <whatever location it jumped to before>
  350.  
  351. SYS command of earlier versions works only with standard formats.  If you try it
  352. with an extended one, it will seriously damage the disk.  Also, it fails if the
  353. disk is not empty (even without a volume label).
  354.  
  355. /S- turns the option off
  356.  
  357. ───────────────────────────────────────────────────────────────────────────────
  358.  
  359. /Q - perform a quick format. Simply rewrites system areas. This is a very fast
  360. way to delete all files on the diskette. Obviously, you can't change physical
  361. disk format with this switch set. But changing logical organization is Ok: /R /C
  362. /D & /S work fine.
  363.  
  364. Don't use this option is a diskette has bad sectors - FAT is ignored. Also, this
  365. option doesn't work if the boot sector is damaged.
  366.  
  367. ───────────────────────────────────────────────────────────────────────────────
  368.  
  369. /E - test mode. FMT will do everything except actually formatting/writing the
  370. diskette. Use with /A to see how your CONFIG.FMT works, check integrity of boot
  371. image etc. I use it for debugging.
  372.  
  373. ───────────────────────────────────────────────────────────────────────────────
  374.  
  375. /B - batch mode (mute). Displays no screen output & doesn't prompt you to press
  376. Enter. ESC key still works. The result of formatting can be determined by
  377. examining exit code.
  378.  
  379. ───────────────────────────────────────────────────────────────────────────────
  380.  
  381. /A - display additional technical information about the diskette. Useful when
  382. you are playing with more advanced FMT options. Make it default in CONFIG.FMT if
  383. you don't mind a lot of output.
  384.  
  385. ───────────────────────────────────────────────────────────────────────────────
  386.  
  387. /Z:xx - retry count. Specifies the number of times FMT will repeat
  388. format/verify/reset cycle before assuming that the track has a bad sector. Disk
  389. read and write operations also use this value.
  390.  
  391. The retry count specified by /Z is used only for data errors. Other errors,
  392. like timeout, will cause operation to be repeated up to 4 times without changing
  393. retry counter - such conditions are often caused by a drive motor which is not
  394. yet accelerated to the full speed after the start of operation. If operation
  395. fails 4 times, FMT assumes that something is seriously wrong (i.e. drive door is
  396. open), prints an error message and dies.
  397.  
  398. If retry count is exceeded for data errors, FMT will scan the track to see which
  399. clusters are actually bad. It won't reset disk controller or retry anything
  400. during this operation. This keeps noise during the format to minimum (remember
  401. DOS format playing music on you drive?) and allows marking any cluster that is
  402. even slightly suspicious. Bthw, DOS FORMAT will mark bad the whole track, not
  403. just unreadable clusters.
  404.  
  405. To give you more information about the diskette, FMT displays "???" after each
  406. track for which the format was retried. If you see this signs after format,
  407. it's a good idea to check if the track can be read without problems.
  408.  
  409. Default number of retries is 4. Reduce this to 2 if you want to make sure that
  410. all doubtful clusters are marked. Large values (like /Z:16) are useful for old
  411. diskettes - those often have bad sectors that disappear after a few retries. May
  412. be the surfice of the floppy simply gets cleaned?
  413.  
  414. ───────────────────────────────────────────────────────────────────────────────
  415.  
  416. /R:xx - root directory size. If you don't specify this option, FMT will allocate
  417. space for 112 files if diskette space if less than 1M & 224 entries otherwise.
  418. This matches DOS FORMAT for all standard formats.
  419.  
  420. Each directory entry keeps 32 bytes of disk space. Because 112 additional
  421. entries keep only 3.5K of disk space, it's rarely useful to reduce default
  422. values.
  423.  
  424. You can specify from 1 to 240 files. The value will be rounded up to the nearest
  425. multiply of 16 (because the space for directory is allocated in sectors).
  426.  
  427. ───────────────────────────────────────────────────────────────────────────────
  428.  
  429. /C:xx - cluster size. Again, FMT follows DOS defaults by setting this to 1 if
  430. media is > 1M and 2 is it's less. You can specify any value from 1 to
  431. 128 (brrr...); DOS requires cluster size to be a power of 2.
  432.  
  433. Empty diskettes with larger cluster size always have more free space. However,
  434. each file of moderate size wastes on average a half the cluster size. For
  435. example, a diskette with 85 tracks and 18 sectors has 4K more disk space when
  436. formatted with 2-sector clusters, but each file wastes on average 512 bytes
  437. (compared to 256 bytes for 1-sector clusters).
  438.  
  439. If the usage of the diskette is not known in advance, /C:1 is a good choice.
  440.  
  441. ───────────────────────────────────────────────────────────────────────────────
  442.  
  443. /W - write verify.  This option is active by default - turn it off by /W-.
  444. Formatting w/o verify is roughly twice faster than usual, but doesn't mark bad
  445. sectors.  This is not as terrible as it looks like, because some errors are
  446. discovered when writing to diskette.  Don't use /W- with floppies that are known
  447. to have bad sectors anyway.
  448.  
  449. To see a shocking prove of the fact that BIOS format function completely ignores
  450. data errors, try formatting a cleaning diskette with /W-. Actually, this may be
  451. an efficient way to clean the drive, because the whole surface of the diskette
  452. is used, not just track 0.
  453.  
  454. ───────────────────────────────────────────────────────────────────────────────
  455.  
  456. /X:xx /Y:yy - enable sector spinning.  Normally, the sectors with the same
  457. numbers are stored one under another on the disk.  As the result, when a head is
  458. finished with reading a track, it has very little time to move to the next track
  459. and start reading it's first sector.  If the drive/computer are slow, it's
  460. likely that the head will miss a sector and will have to wait until the disk
  461. turns around to start reading.
  462.  
  463. Sector spinning attempts to eliminate the problem by rearranging sectors.  For
  464. example, suppose that the sectors on the first track are written in the order 1
  465. 2 3 4 5 6 7 8, on the second 8 1 2 3 4 5 6 7 etc.  Now disk head has some
  466. additional time to find the first sector.  In some cases, this may speed up disk
  467. operations twice!
  468.  
  469. /X specifies the number of positions sector map will shift when the head
  470. changes. /Y is the shift between tracks.
  471.  
  472. Optimal values are different from each computer and for each format.  You'll
  473. have to figure this out by experiment.    /X should be probably left zero except
  474. for very slow disk drives.  Best values of /Y will be usually in the range 0..3.
  475. After finding /X & /Y that give the best result for the particular format, add
  476. it to your CONFIG.FMT to save typing. If you have no time for experiments, /X:0
  477. /Y:2 is usually a good guess.
  478.  
  479. Because there is no better solution,I have set defaults to the best values on my
  480. computer: no spinning except for /N:21 (/Y:2) and /N:13 (/Y:1) with 3½" drive.
  481.  
  482. Note that some non-optimal values of sector spinning can cause pathological
  483. slowdown.
  484.  
  485. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  486. ▒ The last several options of FMT control low-level settings  of the diskette ▒
  487. ▒ format. Normally, FMT will preset these options to the values based on  the ▒
  488. ▒ number of sectors  & tracks specified. You'll  rarely need  to  change this ▒
  489. ▒ if FMT IS working normally on your computer. By playing with these switches ▒
  490. ▒ you may  be  able  to  make  the program work with non - standard drives or ▒
  491. ▒ strange BIOS. In this case, you'll probably want to define named formats in ▒
  492. ▒ CONFIG.FMT.                                      ▒
  493. ▒                                          ▒
  494. ▒ Of course, another good use of these options is just playing    with diskette ▒
  495. ▒ BIOS.                                       ▒
  496. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  497.  
  498. /Gxx  - gap length. This option specifies a distance (in bytes?) FMT will leave
  499. between sectors. Disk controller can't read a track if this distance is too
  500. small. From the other hand, if the distance is too large, operation will take
  501. longer than necessary.
  502.  
  503. For standard formats, FMT will use the same values as DOS FORMAT - about twice
  504. larger than minimal possible. To squeeze more sectors on a track, it's necessary
  505. to reduce distance between them.  Finally, for the highest capacity formats - 18
  506. sectors per track for 5¼" HD diskette, 21 sectors per track for 3½" HD and
  507. 11..13 for 3½ DD, there is enough space on the track for sectors themselves but
  508. not for gaps between them.  In these cases, the diskette is formatted with
  509. interleave 2, so that another sector will play the role of the "gap".  The real
  510. gap is set to 2.
  511.  
  512. If some format doesn't work with your drive, try varying /G before giving up.
  513. The smallest value that works is about /G18 (/G:24).
  514.  
  515. ───────────────────────────────────────────────────────────────────────────────
  516.  
  517. /I:xx - interleave. Usually sectors with adjacent numbers will be also adjacent
  518. on the track. When this option is !=1, they will be separated by interleave-1
  519. sectors (sometimes one more). For example, a track with 8 sectors will look
  520. like:
  521.  
  522. /I:1  12     /I:2   15       /I:3    14     etc.
  523.      8    3       8  2       6  7
  524.      7    4       4  6       3  2
  525.       65        73           85
  526.  
  527. Reading the entire track will take <interleave> rotations of the drive. This
  528. means that usually /I:1 is the best choice. However, at least /I:2 is needed for
  529. some high-capacity formats to provide enough distance between adjacent sectors
  530. (See the description of /G).
  531.  
  532. ───────────────────────────────────────────────────────────────────────────────
  533.  
  534. /Mxx - specify BIOS media byte. This byte, found at 0:(490H+drive_letter), has
  535. dramatic influence on format operation. Here is it's layout:
  536.  
  537.   Bits 7-6: Data transfer rate : 00=500kbps 01=300kbps 10=250kbps
  538.                  11=??? (May be used by 2.88M drive?)
  539.  
  540.   Bit     5: 1=Double stepping (40 track format)
  541.  
  542.   Bit     4: 1=Media established. 0 after read error or disk change. Always set
  543.           this to 1 for FMT
  544.  
  545.   Bit     3: Ignored. BIOS leaves this 0.
  546.  
  547.   Bits 2-0: BIOS sets this to:
  548.         000 Trying 360K in 360K  100 360K in 1.2M Ok
  549.         001 Trying 360K in 1.2M  101 1.2M in 1.2M Ok
  550.         010 Trying 1.2M in 1.2M  110 not used
  551.         011 360K in 360K Ok      111 All other formats (i.e. 3½" drive)
  552.  
  553. Data transfer rate: This determines the density of the format. 500kbps is high
  554. density for both 5¼" and 3½" drives. Double density is 300kbps for 5¼" and
  555. 250kbps for 3½". An interesting trick that allows FMT to squeeze more to a 720K
  556. diskette is using 300kbps with 3½" drive. Diskette BIOS by itself won't
  557. recognize such density. INT13X will try all 3 data transfer rates until it can
  558. verify the first sector of the diskette successfully.
  559.  
  560. By default, FMT will set these bits depending on the number of sectors in the
  561. format. It will always use the lowest possible density.
  562.  
  563. Value of 11 in this field is mystery. On my computer, this seems to produce some
  564. data transfer rate between 300 & 250 kbps. On another one it just fails.
  565.  
  566. Double stepping: This bit is used to provide compatibility with 360K drive. When
  567. it's set, the disk head moves 2 positions for each track. Clearing this bit for
  568. 5¼ DD diskette creates 720K & 800K formats.
  569.  
  570. It's impossible to distinguish 360K & 720K diskettes by checking only track 0.
  571. INT13X will try to read track 2 head 0 sector 1 with this bit clear. If the
  572. diskette was formatted with double stepping, this track will be actually track 1
  573. and the read will fail.
  574.  
  575. I could never find an AT+ computer with double density drive & don't know what
  576. should be in this bit for a true 360K drive.  FMT will still use double
  577. stepping.  If this results in horrible sounds in the middle of formatting, try
  578. /m57 for single stepping.
  579.  
  580. By default FMT sets this bit if you specify less than 44 tracks.
  581.  
  582. Bits 2-0: It's a great secret for me how exactly BIOS interprets this value.
  583. Looks like values 0..2 (Trying...) mean that BIOS shouldn't try to sense
  584. diskette type. By default FMT will use value 7 that seems to work with all
  585. formats. If your BIOS gets upset, try values from 0 to 6. One should work.
  586.  
  587. ───────────────────────────────────────────────────────────────────────────────
  588.  
  589. /Lxx - format fill character. By default FMT will use 0AAH == 10101010B == '¬'
  590. Alternating 1s & 0s should provide a good test for bad sectors. DOS FORMAT uses
  591. 0F6H == '÷'.
  592.  
  593. ───────────────────────────────────────────────────────────────────────────────
  594.  
  595. /Dxx - FAT ID byte. This byte appears in the boot sector & in the beginning of
  596. FAT and is *supposed* to be useful to identify diskette type. In reality it's
  597. not very informative: for example 0F0H can be used for 1.2, 1.44 or 2.88M.
  598. Microsoft MSDOS Programmer's Reference says that "it can be also used for other
  599. formats". There is an obvious problem with extended formats.
  600.  
  601. FMT will try to mimic DOS as much as it can. It will set correct values for all
  602. standard formats. To give poor program using FAT ID byte another chance to
  603. work, it will set the same value for formats that differ from standard only by
  604. the number of tracks. All other high density formats (15-21 tracks) are assigned
  605. value F0, DD formats - value F9. This makes any version of DOS happy. Note that
  606. MSDOS 5.00 completely ignores FAT ID.
  607.  
  608. By setting this option, you may be able to full around a program that refuses to
  609. work with an extended format otherwise.
  610.  
  611.  
  612.                   ███████████
  613.                  ▐▌ FMTBOOT ▐▌
  614.                   ███████████
  615.  
  616. This is a program to build boot images for FMT. See the description of /S option
  617. for some information about boot images. The usage of FMTBOOT is:
  618.  
  619. FMTBOOT D: [bootfile] [/X] [/S] [/R] [/B]
  620.  
  621. D: - drive letter from which to read boot sector and files. Should specify a
  622. diskette with a standard format made bootable by SYS or FORMAT /S. Doesn't have
  623. to be A: or B:
  624.  
  625. bootfile - the file to write boot image to. The default filename is BOOT.FMT
  626. that will be created in the directory where FMT was found unless the environment
  627. value FMTFILES is set. In the later case, the value of FMTFILES will be used as
  628. the full path of the file (must end with \).
  629.  
  630. /X - assume extended (DOS 4+) boot sector.  FMT will set more information (like
  631. volume serial number) and will not check if the first file can be written
  632. continuously (except for the first 3 sectors).    If you don't use /X or /S,
  633. FMTBOOT will recognize sector as extended if it contains signature 29H at offset
  634. 26H and "FAT12 " at offset 36H.
  635.  
  636. /S - the opposite of /X. Assume DOS 3.x boot sector.
  637.  
  638. /R - replace existing boot file.  By default FMTBOOT will only create new files.
  639. With /R it overwrites even read-only ones.
  640.  
  641. /B - batch mode: no screen output. The status of the program can be determined
  642. by examining exit code.
  643.  
  644. Like FMT, FMTBOOT can be stopped at any time by ESC. But it may not react to it
  645. immediately. Opening drive door also works.
  646.  
  647. The format of boot image file:
  648.  
  649. boot db 512 dup(?) ; Boot sector. FMT will briefly check it to see if this is
  650.            ; really a boot image.
  651.  
  652. xboot db ?       ; 0 = standard boot sector, 1 = extended
  653.  
  654. ; For each file (it's Ok to have no files)
  655.  
  656. direntry db 32 dup (?) ; garbage in the "start cluster" field
  657. <the exact image of the file>
  658.  
  659.  
  660.                  ██████████████
  661.                 ▐▌ CONFIG.FMT ▐▌
  662.                  ██████████████
  663.  
  664.  
  665. FMT will accept an optional configuration file that can be used to:
  666.  
  667.  ■ Define your own formats that can be used with /F
  668.  ■ Set default options for each drive type
  669.  ■ explicitly specify types of your drives is FMT can't guess this properly
  670.  
  671. If FMTFILES environment variable is set, it's value is assumed to be the path of
  672. CONFIG.FMT (remember to add \).  No other location will be searched.  Setting
  673. FMTFILES to an invalid directory (like SET FMTFILES=$) will prevent FMT from
  674. using configuration file.  Otherwise, FMT will search for CONFIG.FMT in the
  675. directory where FMT.EXE resides and in the current directory.
  676.  
  677. Each non-empty line in CONFIG.FMT should start from '3' or '5' - the type of
  678. disk drive (5¼" or 3½") this line applies to. The rest of the line can be:
  679.  
  680. A: or B: - specify the type of disk drive. Without this, FMT will read the
  681. type from CMOS. Example:
  682. 3 A: ; A: is a 3½" drive
  683.  
  684. DEFAULT - specify default switches for this drive type. For example:
  685. 5 DEFAULT /T:85 /N:18 /V /A ; format 5¼" diskettes to 85 tracks & 18 sectors
  686. ; by default. Also, display tech info & ask for volume label
  687.  
  688. "default defaults" are 5 DEFAULT /T:82 /N:18 & 3 DEFAULT /T:82 /N:21 - the
  689. highest capacity formats for each drive.
  690.  
  691.  
  692. Any other word - create a named format. When you specify /F:word, it will have
  693. the same effect as if you have typed all the options found on this line. Named
  694. formats are drive specific, so the same name can specify different options for
  695. different drives. The name of the option doesn't have to be a number. If there
  696. are several lines defining the format with the same name and drive type, only
  697. the first will be considered. Because default formats are added to the end of
  698. the file, they can be redefined. Examples:
  699.  
  700. 5 1530 /T:85 /N:18
  701.  
  702. 3 DDSYS /T:85 /N:10 /S:BOOT.850
  703. 5 DDSYS /T:85 /N:10 /S:BOOT.850 ; You want this to be the same for both drives
  704.  
  705. 5 360 /T:40 /N:9 /M57 /Y:2 ; Redefine existing format to work with DD drive
  706. ; I wonder if the above line is needed
  707.  
  708. 5 360HD /T:40 /N:9 ; This is for HD drive
  709.  
  710. 3 1.11 /F:1.07 /T:85 ; Ok to have nested formats. Just don't make them
  711. ; recursive!
  712.  
  713.  
  714. As you could guess from the examples, you can add comments to CONFIG.FMT using
  715. ';'.
  716.  
  717.  
  718.  
  719.                  ██████████████
  720.                 ▐▌ Exit codes ▐▌
  721.                  ██████████████
  722.  
  723. FMT:
  724.  
  725. 0   = Success
  726. 1   = No drive letter specified
  727. 2   = Unknown named format
  728. 3   = Invalid option
  729. 4   = Syntax error in CONFIG.FMT
  730. 5   = Quick Format failed
  731. 6   = Error writing to the diskette
  732. 7   = Drive is not ready or diskette is write protected
  733. 8   = Boot image file doesn't exist or has an error
  734. 9   = No room for system (bad sector to early or just out of disk space)
  735. 10  = Out of memory (shouldn't happen very often)
  736. 255 = Interrupted by ESC
  737.  
  738. FMTBOOT:
  739.  
  740. 0   = Ok
  741. 1   = No drive specified
  742. 2   = Invalid option
  743. 3   = Can't create output file
  744. 4   = Out of memory
  745. 5   = Error reading diskette
  746. 6   = Out of disk space
  747. 7   = Error writing boot image
  748. 255 = Interrupted by ESC
  749.  
  750. Both FMT & FMTBOOT have /B option that make them to run in the absolute silence.
  751. A program or batch file can call them & use exit code to report the result.
  752.  
  753.  
  754.  
  755.  
  756.                              ┌─┐    ┬ ┬
  757.                              │ ││    │┌┘.│ .
  758.                              │ ││ ┌┐┌┐    ┼┤ ┬│┐┬┌┐┌┐┐┌
  759.                              │ ││ │┘│_    │└┐│││││ │┘││
  760.                              └─┘└┘└┘└┘    ┴ ┴└└┘└└ └┘└┘
  761.  
  762.