From: buster@mcshh.Hanse.DE (Andreas Burmester)
Newsgroups: comp.os.cpm
Subject: CP/M <--> MSDOS
Date: 15 Apr 92 22:03:04 GMT
Organization: Point of Presence Hamburg


[If you have seen this posting already - send flames to our system
 wizard, who's desperately attempting to implement the Cnews... b.]


In the recent past, there were several requests here for utili-
ties or methods for transferring files from/to MSDOS machines.

There is a ShareWare program I've written a while ago, that's
doing this task by accessing MSDOS diskettes without serious (see
below) restrictions in the CP/M Plus enviroment. MFS (for
Microsoft File System) offers full Path (== Subdirectory) support
and is totally transparent to the operating system - concurrent
disk i/o is neither disturbing nor disturbed.

For those who are interested: To give you an impression of how
MFS is performing, I've appended the DOC file.

And for those, who are not: Just skip to next article. :-/

-----------------------------------------------------------------

                    **   ** *******  *****
                    *** *** **      **   **
                    ** * ** **      **
                    **   ** *****    *****
                    **   ** **           **
                    **   ** **      **   **
                    **   ** **       *****


Requirements
------------

     CP/M Plus OS
     Z80 Processor (or later)
     48k of TPA (the more the better)
     BIOS must
     - be able to physically read/write the target MFS disk
     - accomplish disk side select by either
       (1) LSB of track # or    (*)
       (2) via sector #         (**)
       Which method is actually used, is determined at login
       time.


(*) To access the 3rd sector on side 1 of the 4th cylinder of a
    (2-sided) 360 kB diskette with method (1), MFS issues calls
    to

     BIOS func with value(s)
     --------------------
     SETTRK    Track 7
     SECTRN    Sector 2, Addr. of Translate Table from DPH
     SETSEC    Return value of SECTRN
     READ || WRITE

(**) To access the same sector using method (2), MFS issues calls
    to

     BIOS func with value(s)
     --------------------
     SETTRK    Track 3
     SECTRN    Sector 11, Addr. of Translate Table from DPH
     SETSEC    Return value of SECTRN
     READ || WRITE


MFS expects the target disk to be in drive E:. If your system
doesn't support this (which is most likely...), call MFS with
first command line parameter '@<d>', where <d> stands for one of
any drive letters 'A' thru 'P'.


Restrictions
------------

A single Sub-Directory may not exceed a fixed number of Directory
Entries (currently 224).

A XDIR command on VERY large CP/M directories may fail (because
it can't be sorted...)


Commands
--------

<du>      Drive/User combination plus a colon. ('A:', 'H13:')
<up>      Unambiguous Path. ( '/', '../SUBDIR' )
<afn>     Ambiguous File Name.
<apn>     Ambiguous Path Name. ( 'SUBDIR/FILE*.EXT', '??LENAME.E?T' )
<oct_n>   An Octal Number. ( '13', '077')
<init_id> Any of '160', '180', '320', '360', 'TOS_SS', '720',
          'TOS_DS', '1.2' or '1.44' (or their unique abbreviations).

          Everything in braces is optional.


Command
     Syntax
          Description

CAT (TYPE)
     CAT <apn>
          List file(s) <apn> to screen. Can be aborted by typing
          ESC. (If the output is too fast: Wasn't there a "SETDEF
          [PAGE]" command?)

CD (CHDIR)
     CD <up>
          Change working directory to <up>.

CHMOD
     CHMOD <oct_n> <apn>
          Set & reset attribute bits of file(s) <apn>. <oct_n>
          represents all the bits as they appear in the LS
          output.

INIT
     INIT <init_id>
          Initialize a disk, i.e. write Boot Sector, FATs and an
          empty Directory to disk.

LOG
     LOG
          Login a new disk, i.e. invalidate all internal buffers
          and reread Boot Sector, allocate new FAT and file
          buffers and read one FAT and Root Directory. Use this
          command if you've changed any disk - LOG performs a
          BDOS #13 (Reset Disk System) call.

LS (DIR)
     LS {<apn>}
          List Name, Attributes, Size and Time & Date Stamps of
          <apn> to screen.

MKDIR (MD)
     MKDIR <up>
          Make new Sub-Directory <up>.

PWD
     PWD
          Print Working Directory, i.e. the names of all
          directories from root down to current directory.

RM (DEL, ERASE)
     RM <apn>
          Remove (delete) file(s) <apn>.

RMDIR (DELDIR, RD)
     RMDIR <up>
          Remove (delete) directory <up>.

TREE
     TREE
          List the hierachy of all directories with all files to
          screen.

VOLUME
     VOLUME {<ufn>}
          If an <ufn> is specified, change (or create) the name
          of a disk, else just display the current.

All commands headed by an 'X' are referencing an eXternal (i.e.
CP/M) drive.

XCAT (XTYPE)
     XCAT {<du>}<afn>
          List file(s) <afn> to screen. Can be aborted by typing
          ESC.

XCD
     XCD <du>
          Change default <du>.

XDIR (XLS)
     XDIR {<du>}{<afn>}
          List Name, Size and Attributes of file(s) <afn>.

XFER
     XFER {-S} <du>{<afn>} {<up>}
          Transfer file(s) <ufn> from CP/M Drive/User <du> to MFS
          disk.
          If -S is given, trailing 0x1As are stripped off. If a
          file has it's CR byte set, the actual file length is
          calculated with respect to the CR value.

     XFER <apn> {<du>}
          Transfer file(s) <apn> from MFS disk to CP/M Drive/User
          <du>. If a file doesn't end up on a record boundary,
          the last record is padded with 0x1As and the CR byte is
          set to the number of 'valid' bytes in this record. Any
          target file has its F3-Flag set.

?
     ?
          List (almost) all commands.

EXIT (BYE, QUIT)
     EXIT
          Return to OS.


All commands can be abbreviated to any unique length. So, typing
'CHM' for 'CHMOD' is ok, while 'CH' is too short - the MFS
Command Line Interpreter can't distinguish 'CHMOD' and 'CHDSK' by
the first two letters.

Several commands can be given from a single command line. Just
separate them with ';'.

Command lines aren't case sensitive - all input is converted to
upper case before processing.

Example:
     'cd /sub1/sub2;ls *.c;xf ../*.doc h3:;rm foo.bar;tr;q'

A first MFS command line is taken from the CP/M command line,
i.e. MFS called with

     'mfs ls;quit'

starts MFS, which lists the root directory and terminates again.


Final
-----

If all this sounds good to you, just drop me an EMail note to get
a free, unregistered (*) copy (UUENCODEd). My net address is:

     buster@mcshh.hanse.de

MFS is a ShareWare product. If you want to get registered (to
receive the full-feature version), send a DM 50 or US$ 40
(international orders) check to

     Andreas Burmester
     Zoppoter Str. 2
     D-2000 Hamburg 70
     Germany.

(*) The only difference between the registered and unregistered
versions of MFS is that the latter permits CATting or XFERring of
one file per session only.

-----------------------------------------------------------------
Newsgroups: comp.os.cpm