LDOS and LS-DOS: 2012 and Beyond – A Solution

written by Matthew Reed

To extend LDOS and LS-DOS file dating past 2011, I decided to use an approach that I devised back in 1993 when I was first writing PERUSE, my TRS-80 file utility. My method stores the new date in the same fields in the directory without taking up any more space or taking away any more file passwords. This approach is automatically compatible with all LDOS/LS-DOS disks and I have yet to encounter a file for which this dating scheme fails. (If you do, please let me know so that I can fix the problem.) With my patches, disks don’t even need to be converted but will just transparently store dates after 2011.

My patches also fix a problem occasionally encountered with LDOS 5.3 and LS-DOS 6.3. If an older operating system was used to copy files onto a date converted disk, then the copied files will still have the older user password field. LDOS 5.3 and LS-DOS 6.3 (which replaced the user password with date and time) will interpret that password as a garbled date and time. The patches check specifically for such files and use the older year instead (providing more accurate results than unpatched versions).

The Patches

I needed to develop three versions of the patches for all the versions of LDOS:

  • LS-DOS 6.3.1 for the Model 4
  • LDOS 5.3.1 for the Model III
  • LDOS 5.3.1 for the Model I

The patches involve the directory update routine, the boot up date prompt, the DATE, DIR, and PURGE library commands, and the BACKUP utility.

I had expected that patching the directory update routine to store the post-2011 date would be the most difficult, but I devised an algorithm that ended up using less space than the original. The real problem, oddly enough, was the LDOS BACKUP command. This was the most difficult patch for two reasons:

  • BACKUP is divided into overlays, which made consolidating code much more difficult.
  • I needed extra code to fix a bug in BACKUP, also present in LDOS 5.3.0. (BACKUP wasn’t recognizing non-date converted disks.)

Installing

Installing patches, especially ones this extensive, is always a bit tricky. Rather than provide patched disk images of LDOS and LS-DOS (which opens up copyright issues), I decided to add a new feature to TRSTools, my freeware TRS-80 disk utility for Windows. Now whenever TRSTools detects an unpatched Model 4 LS-DOS 6.3.1 or Model I or III LDOS 5.3.1 boot disk, it will prompt the user to install the patches. (This feature can be turned off in the Preferences menu.) It will automatically select the correct patches based on the disk type.

You can download the current version of TRSTools here:

http://www.trs-80emulators.com/trstools/

Next post in this series: The Patch Files

Categories: General

Comments

Jack C. Knudsen says:

I’ve been wondering what was going to happen after Dec 31, 2011. I still use my TRS-80s (both real and emulated) on a regular basis and I figured I was going to have to start lying to them about what year it was. I guess it wouldn’t have been the end of the world but it sure was irritating me that my TRS-80s had an expiration date. What you’ve done here is wonderful, I can’t thank you enough.

Gabe Navarro says:

Way to go Matt! LDOS in the year 2079 – who would have thought? And that’s a slick way to update the disks through your TRS-Tools program. The whole process couldn’t be easier. Thanks for being there for these older machines!

Boomer Jones says:

Nice job. I’m real impressed that you shoehorned in the necessary updated code without taking extra disk space or getting rid of passwords or something else. And I don’t have to run a date converter on all my disks? This is a great piece of work.

Terry Stewart says:

Great solution! Thanks!

David Sutherland says:

Very nice Matt.

At reading the headline I was hoping for a millennium fix but I guess we can pass that “problem” onto the next generation. ;)

Gary Shanafelt says:

A friend told me about the patch; I didn’t realize it was built in to the latest version of TRSTools for the emulator, which I already had on my system. I’d used it on virtual data disks but not a disk with the operating system. So, I loaded in my LS-DOS virtual disk, got the repair message, and it worked instantly. I then ran the emulator, saved a file using AllWrite, and, lo and behold, it had the correct 2013 date on it when I then checked the disk directory.

So much for the emulator. It will take longer to input the patches on my actual floppy disks, but luckily I’ve still got my trusty copy of LSFEDII and I still remember how to use it!

Ulrich Müller says:

So if I understand your code correctly, year mod 32 is stored in bits 0-4 of byte dir+19, whereas bits 0-2 of dir+2 now contain (year mod 7) XOR (year / 32). Whereas in 6.3.1H the latter was simply year mod 7.

Very clever, as the format is backwards compatible for years < 2012 and doesn’t need additional space. :-)