Submitted via IRC for Bytram
How did MS-DOS decide that two seconds was the amount of time to keep the floppy disk cache valid?
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.
IBM PC floppy disk drives of this era did not have lockable doors. You could open the drive door and yank the floppy disk at any time. The specification had provisions for reporting whether the floppy drive door was open, but IBM didn't implement that part of the specification because it saved them a NAND gate. Hardware vendors will do anything to save a penny.
[...] 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.
I don't know if the modern two-second cache flush policy is a direct descendant of this original office competition, but I like to think there's some connection.
(Score: 0) by Anonymous Coward on Wednesday September 25 2019, @11:52AM (3 children)
And have the OS bitching about it... at least that was when I once tried that in the early days of Linux. DOS had it's nice "Abort, Retry, Fail?" error message.
That you can do that, does not mean you should do that.
(Score: 2) by RS3 on Wednesday September 25 2019, @02:11PM (2 children)
The floppy disk interface connector includes a DSKCHG signal that tells the controller if there is a disk inserted. I don't know if the original IBM PC floppy controller implemented this signal, but later ones did, so OSes know if the floppy has been opened / ejected.
(Score: 2) by FatPhil on Wednesday September 25 2019, @03:39PM (1 child)
Great minds discuss ideas; average minds discuss events; small minds discuss people; the smallest discuss themselves
(Score: 2) by RS3 on Thursday September 26 2019, @02:42AM
OhMyGosh, you too? I did some of that stuff back in the day (assembly).
I don't know- TFA says "...IBM saved a NAND gate...". If that's true, I suspect your DOS SW interrupt was not implemented in early DOS. Purely a guess. Somewhere, someone knows for sure.