How did MS-DOS decide that two seconds was the amount of time to keep the floppy disk cache valid?

An interesting item on the MS-DOS floppy disk cache expiry time:

MS-DOS 2.0 contained a disk read cache, but not a disk write cache. Disk read caches are important because they avoid having to re-read data from the disk. And you can invalidate the read cache when the volume is unmounted.

But wait, you don’t unmount floppy drives. You just take them out.
[…]
To avoid having to abandon the cache entire, the MS-DOS developers did some benchmarking: How fast can a human being swap floppies in an IBM PC floppy drive?

Mark Zbikowski led the MS-DOS 2.0 project, and he sat down with a stopwatch while Aaron Reynolds and Chris Peters tried to swap floppy disks on an IBM PC as fast as they could.

They couldn’t do it under two seconds.

So the MS-DOS cache validity was set to two seconds. If two disk accesses occurred within two seconds of each other, the second one would assume that the cached values were still good.

3 Likes

There are many of these old decisions that still impact us today.

Eric S. Raymond listed many here.

4 Likes

CP/M kept its disk caches forever. This was a really bad thing if the user swapped the floppy and then tried to write to it. So a CP/M user had to remember to always type control-C after changing the disk to force the system to read it again.

The change you described (and the use of FAT instead of extents which wasted directory entries) made MS-DOS a lot more user friendly at a small cost in performance.

2 Likes