VOGONS


First post, by gloomkeep

User metadata
Rank Newbie
Rank
Newbie

Hi all. I've been getting back into x86 assembly in DOS, and wanted to work on a real, useful project while learning.

Problem: On several occasions, I've thought to myself: "shame you have to copy a whole program or game onto a ramdrive, and also make sure to copy the saved games or output files back to disk before you shutdown or reboot". What if you could pick only specific files to be drawn from the ramdisk?

Outcome: a TSR and control program that work together to provide a feature that's similar to a symlink or overlay filesystem, but only plays with filenames.

Below is a short summary of ALTER. The included readme.txt has more details and a list of restrictions (such as not hooking DIR functions, and relative vs absolute filenames).

If anyone tries this and has any feedback, I would love to hear it!

INTRODUCTION […]
Show full quote

INTRODUCTION

ALTER It is a simple file redirector or naive symlink provider. It hooks into three DOS file operation functions on interrupt 21h: function 3Dh (OPEN), 4300h (GETATTR), 4301h (SETATTR).

It maintains a list of user-specified filename redirects, with each redirect consisting of a pair of filenames: a MATCH and an ALT filename.

If a file access is attempted on a MATCH filename in the list, the TSR swaps in its associated ALT filename to DOS instead. The calling program is unaware of this, and continues performing follow-on file operations (read and/or write) on the ALT file.

EXAMPLE USE

We wish to play shareware DOOM, with the main game WAD file running off a ram-drive for acceleration, but all other files, especially saved games and config files, running off the hard-drive so they aren't lost in the event of a power failure or crash/reboot.

1. Ensure the following is present in CONFIG.SYS

  • DEVICE=C:\DOS\HIMEM.SYS
  • DEVICE=C:\DOS\RAMDRIVE.SYS /e 5000

2. Reboot

3. Run the following (assuming your ramdrive became D:)

  • C:
  • CD\DOOMS
  • COPY DOOM1.WAD D:

4. Create a text file called DOOMS.TXT, with just a single line specifying our desired redirect:

  • DOOM1.WAD D:\DOOM1.WAD

5. Run the following:

  • ALTER.COM
  • ALTERCTL.EXE ADD DOOMS.TXT

6. Run DOOM.EXE, then quit

7. Run the following:

  • ALTERCTL.EXE LOG

8. If you see the entry "DOOM1.WAD => D:\DOOM1.WAD", then the redirect worked, and the file access was redirected to our ramdrive copy (though it should have been obvious from the loading speed)

Attachments

  • Filename
    ALTER.ZIP
    File size
    15.52 KiB
    Downloads
    85 downloads
    File license
    Fair use/fair dealing exception