Classic Computer Magazine Archive ANTIC VOL. 3, NO. 9 / JANUARY 1985

DISKIO

Supercharger for Atari DOS

by DR. BERNARD E. OPPENHIEM

DISKIO is a superb enhancement for DOS 2.0S.  for openers, it provides access to nearly all DOS functions directly from BASIC or Atari Assembler Editor.  It also has an alphabetical disk directory display and needs only a few keystrokes for disk file operations.  DISKIO works on any Atari computer with one or more disk drives.  Antic Disk subscribers, RUN "D:DISKIO.BAS".

The day DISKIO arrived at Antic it became our in-house disk utility.  It's that good!
   DISKIO is a disk operations program that resides safely in memory and provides access to nearly all of the functions of DOS 2.0S directly from BASIC or from the Atari Assembler Editor cartridge.  A number of similar "miniDOS" programs have appeared in various articles, but DISKIO removes the need for DUP.SYS more completely than any of these.
   Moreover, DISKIO has a number of features that make it outstandingly easy to use, such as a two-column listing of the disk directory that is alphabetized and numbered, shortened commands that use those numbers, and a HELP menu that makes nearly everything self-explanatory.
   Incredibly, that's not all!  DISKIO also verifies potentially destructive commands, prevents renaming to an existing name, and is full compatible with the Atari BASIC and Assembly Editor cartridges.
   Oh yes ... and DISKIO occupies only 3K of memory, that's 25 disk sectors compared with 42 sectors for DUP.SYS. -ANTIC ED

READYING DISKIO
Use a disk containing DOS 2.0S (if the DOS.SYS file is 39 sectors long it should be okay).  Type in Listing 1 exactly as it appears.  The program is designed to check itself, but if you use the new TYPO II, you'll be able to find typing mistakes right after typing each line.  Once you have the program correctly typed in, SAVE a backup copy then RUN it. The message "READY TO CREATE AUTORUN.SYS FILE?" will be displayed.  Type [Y] and DISKIO will be created on disk as AUTORUN.SYS.

USING DISKIO
Boot your system with the disk containing the new AUTORUN.SYS file you just created, plus either Atari BASIC or Assembly Editor.  DISKIO will be loaded into memory automatically.  A message will be displayed indicating that DISKIO is present and suggesting that you type HELP [RETURN] to see the commands.  If you do so, the HELP menu will appear on the screen:

       DISKIO COMMANDS
             DIR     Directory
             DIRn    Dir. Drive n
             FORMAT  Format disk
             WDOS    Write DOS.SYS
.X->Ll.->    LISTD   List to disk
.S->S.->     SAVE    Save to disk
.E->E.->     ENTER   Enter to mem.
.L->LO.->    LOAD    Load to mem.
.R->         RUND    Run disk file
.K->         LOCK    Lock file
.U->UN.->    UNLOCK  Unlock file
.N->RE.->    RENAME  Rename file
.D->DEL.>    DELETE  Delete file
.B->BL.->    BLOAD   Binary load
.M->M.->     MOVE    Move file
.R9 runs #9 etc.  To use DOS type KILL.  Reboot to restore DISKIO.
  The first column of the HELP menu lists the abbreviated .C commands which allow files to be designated by number rather than by name.  The second column lists the abbreviated forms of the commands, the third lists the full command names, and the fourth gives a brief definition.  Type DIR [RETURN) and the disk directory will be displayed in a manner similar to the one below:

      SAMPLE DISKIO DIRECTORY
1  ASMSRCH OBJ 002    8* DUP     SYS 042
2  ASMSRCH SRC 028    9  HMSG    SRC 010
3* AUTORUN SYS 025   10  RNMCHK  SRC 021
4* DISKIO  OBJ 025   11  RTNLNTX SRC 004
5* DISKIOC SRC 168   12  SCRSRT  SRC 051
6* DISKIOZ SRC 175   117 FREE SECTORS
7* DOS     SYS 039

   Notice that the directory is displayed in two columns, with the file names alphabetized and numbered.  Up to 41 file names can be displayed simultaneously.
   The DIRn command is discussed in the "Two Disk Drives" section.  The FORMAT command will format your disk after two safety prompts.  The WDOS command will write DOS.SYS to the disk, but not DUP.SYS.  The latter can be copied from another disk using the MOVE command (see below).
   The .C commands (column 1 of the HELP menu) consist of a period, the command letter, and the file number.  To use these commands the file name must be up on the screen as a result of a previous DIR command.  For example, if 12*MYFILE.SAV is displayed, instead of typing RUN"D1:MYFILE.SAV [RETURN], all you have to type is .R12 [RETURN].  You can rename a file by entering the following sequence of commands: .N12,NEWFILE.SAV [RETURN] [Y].  The [Y] is there because you are asked to verify all .C commands that might destroy data on the disk.  To lock NEWFILE.SAV you would type DIR and then a .K command with the new file number.
   Columns 2 and 3 of the HELP menu show the abbreviated and full commands which will require file names as part of the command.  Unlike BASIC, the quotes and device designation are optional so that E.MYPROG is the same as ENTER "D:MYPROG" (or ENTER#D:MYPROG for ASM/ED users).  These commands are handy when using wildcards to manipulate more than one file: LOCK *.*. Keep in mind that with the exception of FORMAT, there is no safety prompt with these commands.  If you type DEL.MYFILE, MYFILE will be deleted.
   The RENAME command will not permit you to use the same name as an existing file (you know what havoc that causes!).  The BLOAD command will recognize the /N suffix (even in the .C form, like .B10/N) to bypass the initialization and run steps in the binary load process.
   The MOVE command functions like the Duplicate File option in the DOS menu.  The file is copied into memory, then the system pauses and the message INSERT DISK2; HIT ANY KEY (S=SCREEN) is displayed.  If you type [S], the file will scroll up the screen.  The scrolling can be halted and resumed by entering [CTRL] [1].  If you hit any other key the file is written back to the disk under the original file name.  The only limitation here is that the file must fit into the available free RAM, or else the message "OUT OF RAM" will appear and the operation will be terminated.  For 48K systems a file up to 233 sectors long can be moved when there is no program in memory.
   To use DUP.SYS (via the DOS command) you must first remove DISKIO by typing KILL [RETURN].  To restore DISKIO the system must be rebooted.  If the system is booted with no cartridge, DISKIO will return control to DOS and the DUPSYS menu will appear.  It should be noted that all DISKIO commands are active only at the READY level to keep DISKIO from interfering with user programs (think what trouble the KILL command would cause in an adventure game).

TWO DISK DRIVES
All DISKIO commands can be used with two disk drives.  The command DIRn will display the directory for Drive n, for n = 1, 2, 3, or 4. Furthermore, this command causes Drive n to become the default drive for all situations in which the drive number is not specified.  For example, upon typing DIR2 [RETURN] the directory for Drive 2 is displayed, and a subsequent .C command will refer to files on that drive.  FORMAT will format the disk in Drive 2 and WDOS will write DOS.SYS to it.
   When using the MOVE command with two drives, only the files in drive 1 can be copied to the screen, and drive 1 files can only be moved to drive 1. However, when the directory for drive 2 is displayed, the MOVE command will automatically copy the designated file into memory, then immediately move it to drive 1 under the original file name.

FOR ADVANCED USERS
DISKIO is located between $1CFC and $2934, and protects itself by moving up MEMLO.  It revectors the screen editor's GET BYTE routine, allowing it to compare all entries with a list of commands in a jump table.  If a match is found the appropriate command is executed.  Otherwise the entry is returned to the screen editor.  DISKIO reinitializes itself upon [RESET].
   DISKIO should not conflict with the user's program unless the latter overwrites DISKIO's reserved memory or moves MEMLO into it.  All permanent storage is within the reserved memory, and LBUFF is used for temporary storage.  Page One is used only for stack functions and page Six is not used.  Page Zero is not altered since existing values are saved in the stack upon entering DISKIO and restored upon exiting.
   The DISKIO AUTORUN.SYS file can be concatenated with other AUTORUN.SYS files which do not conflict with it. DISKIO should probably be the first segment in the chain to make it reset-proof.
   For users with the Omnimon chip, the MOVE command can be used to modify disk files in Drive 1. After copying the file into memory the system pauses to allow the user to change disks.  At this point Omnimon can be invoked, the file can be modified in memory, and then can be written back to disk with these keystrokes: [START] [RETURN] to exit Omnimon, [RETURN] to write the file back to disk, and [RESET] to restore some vectors.

Bernard E. Oppenbeim is a nuclear medicine physician in Indianapolis.  He has been programing in FORTRAN on large computers for 15 years and began programing the Atari in assembler two years ago.  Dr Oppenheim has contributed DISKIO to the public domain as of February, 1985 and Antic is pleased to introduce this important utility to the Atari users community.

Listing 1: DISKIO.BAS Download