home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / cpm3 / mformat.lbr / MFORMAT.DZC / MFORMAT.DOC
Encoding:
Text File  |  1987-09-10  |  3.3 KB  |  84 lines

  1.  
  2. A hardware-independent "memory-disk" formatting program for CP/M+
  3.  
  4.  
  5.                Jon Saxton
  6.              TIE-Line RCPM+
  7.                AUSTRALIA
  8.                29 Aug 87
  9.  
  10. This program is DESIGNED to be    automatically  executed  whenever
  11. your computer  is  "cold-booted" i.e., when  it is  powered on or
  12. when the "reset" button is pressed.  It looks at your RAM-disk to
  13. see whether or not it is already  formatted.   If it is formatted
  14. then the  program does nothing    but if it  is  not  formatted (as
  15. would probably be the case when you first switch on the computer)
  16. then it formats the RAM-disk  and chains  to a command (which you
  17. specify) to load whatever  files you want into    the RAM-disk e.g.
  18.  
  19.     MFORMAT NULU -o MDFILES -E P:*.* -X
  20.  
  21. If the RAM-disk is not formatted, then MFORMAT will:
  22.  
  23.     1.  Format the RAM-disk
  24.     2.  Chain to NULU which in turn will:
  25.     3.  Open MDFILES.LBR
  26.     4.  Extract all the files to the P: drive
  27.     5.  Close MDFILES.LBR
  28.  
  29. MFORMAT is hardware-independent.  It uses the BIOS disk parameter
  30. tables to gather its  information and the BIOS disk drivers to do
  31. the formatting.  It should run on ANY Z80 system with a RAM-drive
  32. and CP/M Plus.     Just include a command such as the example above
  33. in PROFILE.SUB.
  34.  
  35. As assembled, this program assumes  drive P: is the RAM-disk.  If
  36. yours is  different, change  the third byte of the program (102h)
  37. to match the drive letter of your RAM-disk.  Alternatively change
  38. the source code and reassemble.
  39.  
  40. It may be possible to port this program to CP/M 2.2.   The issues
  41. which must be addressed are:-
  42.  
  43. 1.   The BIOS calling mechanism:
  44.  
  45.      MFORMAT calls the BIOS via the CP/M 3 BDOS function 50.   It
  46.      would  have  to be changed to access the BIOS via    the  jump
  47.      table.
  48.  
  49. 2.   Chaining to another program:
  50.  
  51.      MFORMAT uses BDOS function 47 which is not supported by CP/M
  52.      2.2.   Since  MFORMAT is a small program,    the CP/M 2.2  CCP
  53.      will remain intact and it may be possible to stuff something
  54.      into  the    command buffer.   ZCPR users may find  this  task
  55.      easier than those using "vanilla" CP/M 2.2.
  56.  
  57. 3.   Disk parameters:
  58.  
  59.      Under  CP/M version 3 the physical sector size of a disk  is
  60.      encoded  in  the disk parameter block (DPB).   MFORMAT  uses
  61.      this  information    in  calculating the  number  of  physical
  62.      sectors  on the disk and the number of physical  secors  per
  63.      track.   Since disk reads and writes under CP/M 2.2 all work
  64.      on the basis of 128-byte "logical" sectors, the calculations
  65.      need to be modified (but only very slightly).
  66.  
  67. 4.   Directory label:
  68.  
  69.      CP/M  3 supports a special directory entry type (20h) called
  70.      a directory label.  MFORMAT looks for a particular directory
  71.      label to determine whether or not the RAM-disk is    formatted
  72.      and creates that label after formatting the RAM-disk.  Under
  73.      CP/M  2.2    you'd  probably search for a particular  file  in
  74.      (say)  user  area 15 and create an empty file of  that  name
  75.      after formatting.
  76.  
  77. If  someone  does  port  this program to  CP/M    2.2  then  please
  78. preserve the CP/M 3 code (use a CP/M version test to choose which
  79. code  to  execute) and re-submit the SOURCE CODE  to  the  public
  80. domain.
  81.  
  82. Jon Saxton,
  83. 29 Aug 87
  84.