A hardware-independent "memory-disk" formatting program for CP/M+ Jon Saxton TIE-Line RCPM+ AUSTRALIA 29 Aug 87 This program is DESIGNED to be automatically executed whenever your computer is "cold-booted" i.e., when it is powered on or when the "reset" button is pressed. It looks at your RAM-disk to see whether or not it is already formatted. If it is formatted then the program does nothing but if it is not formatted (as would probably be the case when you first switch on the computer) then it formats the RAM-disk and chains to a command (which you specify) to load whatever files you want into the RAM-disk e.g. MFORMAT NULU -o MDFILES -E P:*.* -X If the RAM-disk is not formatted, then MFORMAT will: 1. Format the RAM-disk 2. Chain to NULU which in turn will: 3. Open MDFILES.LBR 4. Extract all the files to the P: drive 5. Close MDFILES.LBR MFORMAT is hardware-independent. It uses the BIOS disk parameter tables to gather its information and the BIOS disk drivers to do the formatting. It should run on ANY Z80 system with a RAM-drive and CP/M Plus. Just include a command such as the example above in PROFILE.SUB. As assembled, this program assumes drive P: is the RAM-disk. If yours is different, change the third byte of the program (102h) to match the drive letter of your RAM-disk. Alternatively change the source code and reassemble. It may be possible to port this program to CP/M 2.2. The issues which must be addressed are:- 1. The BIOS calling mechanism: MFORMAT calls the BIOS via the CP/M 3 BDOS function 50. It would have to be changed to access the BIOS via the jump table. 2. Chaining to another program: MFORMAT uses BDOS function 47 which is not supported by CP/M 2.2. Since MFORMAT is a small program, the CP/M 2.2 CCP will remain intact and it may be possible to stuff something into the command buffer. ZCPR users may find this task easier than those using "vanilla" CP/M 2.2. 3. Disk parameters: Under CP/M version 3 the physical sector size of a disk is encoded in the disk parameter block (DPB). MFORMAT uses this information in calculating the number of physical sectors on the disk and the number of physical secors per track. Since disk reads and writes under CP/M 2.2 all work on the basis of 128-byte "logical" sectors, the calculations need to be modified (but only very slightly). 4. Directory label: CP/M 3 supports a special directory entry type (20h) called a directory label. MFORMAT looks for a particular directory label to determine whether or not the RAM-disk is formatted and creates that label after formatting the RAM-disk. Under CP/M 2.2 you'd probably search for a particular file in (say) user area 15 and create an empty file of that name after formatting. If someone does port this program to CP/M 2.2 then please preserve the CP/M 3 code (use a CP/M version test to choose which code to execute) and re-submit the SOURCE CODE to the public domain. Jon Saxton, 29 Aug 87