LDOS and LS-DOS: 2012 and Beyond – Technical information
The reason dates past 2011 aren’t allowed in LDOS and LS-DOS relates to the way the year is stored in the TRS-80 disk directory. All major TRS-80 operating systems used roughly the same format for the directory. That format was derived from both the original Model I TRSDOS and VTOS 4.0 (both written by Randy Cook).
In the original date format (VTOS 4.0 and later), the date was stored in bytes 1 and 2 of a directory entry. Specifically, the file year was stored in three bits of byte 2. The maximum value that can be stored in three bits is 7, so the original allowed date range was between 1980 and 1987.
In 1987, LS-DOS 6.3 and LDOS 5.3 were released by Logical Systems and MISOSYS to address the year limit. Extra space was needed in the directory to extend the dating, which both operating systems achieved by removing the access (also known as user) password. This new dating format became known as “extended dating” or “date converted.”
TRS-80 operating systems provided a fairly sophisticated system of password protection. They offered five (later seven) levels of file access protection, with two passwords (access and update) per file. Most people used only one password, so removing one was viewed as an acceptable compromise.
Removing the access password allowed the date (and time) to be stored at bytes 18 and 19 of the directory entry in the space formerly used by the password. Five bits were used for the year, allowing a date between 1980 and 2011. For the sake of compatibility, they continued to store the lowest three bits of the year in byte 2. This ensured that older operating systems would see consecutive dates, even though they would still range from 1980 to 1987.
With 2012 is just around the corner, a new dating solution is needed, preferably one that maintains maximum compatibility and fits best into the spirit of LDOS and LS-DOS. The problem is how do you fit more year bits into a directory format that is already full? One more year bit would allow dates from 1980 to 2043 and two more year bits would allow dates from 1980 to 2108 (although a two digit year effectively limits the range to 2079). But where can those two extra bits come from in a directory structure that is already full?
One way would be to to mark disks with post-2012 dating with a flag and reuse an existing data field, for example, the old year or the password protection levels. LS-DOS 6.3 used this approach with a utility named DATECONV that converted the directories of old disks and marked them as being in the post-1987 disk format. But requiring a utility to convert post-2011 disks struck me as unnecessary and awkward. Besides, there are no more disk flag bits that are guaranteed to be unused.
Next post in this series: A solution.