Stories
Slash Boxes
Comments

SoylentNews is people

posted by Fnord666 on Wednesday September 25 2019, @10:02AM   Printer-friendly
from the MS-what? dept.

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.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by DannyB on Wednesday September 25 2019, @03:14PM (11 children)

    by DannyB (5839) Subscriber Badge on Wednesday September 25 2019, @03:14PM (#898531) Journal

    USB sticks expose their storage the way hard drives do. As an array of blocks.

    It is entirely up to the CPU of the device the USB stick is plugged in to to organize those blocks into some kind of a file system.

    The flash storage of USB sticks is not well matched with this idea of presenting the storage as an array of blocks. So the microcontroller on the USB stick jumps through all kinds of hoops to manage the storage and try to keep the wear even across the actual storage, which has a limited but large number of writes before it wears out. Tricks are even done to recognize when you are reformatting or repartitioning.

    What if there could be a new USB standard that presented a storage device at a higher level API more like a file server. Say NFS or CIFS. Now the "filesystem" is whatever the USB stick's firmware wants to use. Including journaling. As I (mis?)understand, USB sticks now have a capacitor to allow completing internal operations when the USB stick is abruptly removed while writing. That could continue to happen to ensure the filesystem is left in a safe state.

    USB sticks can now use different filesystem designs, different techniques and basically now have a lot of flexibility to choose different approaches to how to best manage the life and reliability of the storage. Yet all OSes could have an implementation of this API to access the storage. Even pocket sized hard drives could decide to implement this "NFS" type of API instead of presenting an array of blocks.

    In a nutshell: turn USB storage into a file server instead of a block server.

    I'm old enough to remember early LAN storage systems that were block servers, before there were any file servers. (eg, Corvus Constellation, and others)

    --
    The anti vax hysteria didn't stop, it just died down.
    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 3, Interesting) by Rich on Wednesday September 25 2019, @03:24PM (10 children)

    by Rich (945) on Wednesday September 25 2019, @03:24PM (#898544) Journal

    What if there could be a new USB standard that presented a storage device at a higher level API more like a file server. Say NFS or CIFS.

    There is. It's called MTP, Media Transfer Protocol. I haven't throughly investigated on how complete it is, but phones and cameras use it to expose their contents without having to unmount their primary storage. Maybe a bit of Embrace & Extend?!

    • (Score: 2) by DannyB on Wednesday September 25 2019, @03:33PM (9 children)

      by DannyB (5839) Subscriber Badge on Wednesday September 25 2019, @03:33PM (#898555) Journal

      So basically an MTP USB stick. Or drive. These things would need to be properly branded so you were quite clear about what you were buying.

      I was vaguely aware of MTP, and even thought about it as I wrote. But I've never looked into it.

      I remember when it was not possible for a phone to be operable while it was connected to a computer. And that the computer could corrupt the phone's storage. And I remember when it was fixed, but it took a while for everything to catch up.

      --
      The anti vax hysteria didn't stop, it just died down.
      • (Score: 2) by RS3 on Wednesday September 25 2019, @04:04PM (8 children)

        by RS3 (6367) on Wednesday September 25 2019, @04:04PM (#898583)

        Sorry- in a rush- no time to read- maybe later. My concept is: the USB Flash drive manages the filesystem, which is the simplest form of a "server". But please don't make them all that way, and please allow us to choose the filesystem from the many fine ones available.

        You're still going to need power to allow the managing CPU to flush caches and close files, write FAT, inodes, journals, whatever.

        • (Score: 2) by DannyB on Wednesday September 25 2019, @04:22PM (7 children)

          by DannyB (5839) Subscriber Badge on Wednesday September 25 2019, @04:22PM (#898596) Journal

          I think your choice could be in which brand of USB sticks you buy.

          Brand X happens to use FAT32 while Brand Y happens to use ext4, internally. I would probably avoid Brand X.

          I doubt manufacturers are going to provide a mechanism to allow you to manipulate the internal workings of their firmware.

          --
          The anti vax hysteria didn't stop, it just died down.
          • (Score: 2) by RS3 on Thursday September 26 2019, @03:01AM

            by RS3 (6367) on Thursday September 26 2019, @03:01AM (#898916)

            Those are good possibilities. I was thinking of a higher-level of abstraction where the USB stick acts like a simple Flash drive, but in fact virtualizes the block device, and internally stores however it wants to, but now I'm not sure why bother doing all of that... unless there was another mechanism (protocol) to move data to the stick.

            > I doubt manufacturers are going to provide a mechanism to allow you to manipulate the internal workings of their firmware.

            Sure, but maybe there's a market for something better, with a simple tool to let you do things like change the internal filesystem for some reason, so maybe someone will make something for such a market.

            AFAIK, most USB sticks / Flash storage are FAT32 formatted by default.

          • (Score: 2) by dry on Thursday September 26 2019, @05:25AM (5 children)

            by dry (223) on Thursday September 26 2019, @05:25AM (#898955) Journal

            My understanding is that using journaling file systems on USB sticks should be discouraged as the journal involves so much writing.

            • (Score: 2) by DannyB on Thursday September 26 2019, @01:57PM (4 children)

              by DannyB (5839) Subscriber Badge on Thursday September 26 2019, @01:57PM (#899089) Journal

              As long as no single failed write can corrupt anything, which is a topic about file system design, then you make sure there is enough power on board the stick to complete each individual write before starting it.

              --
              The anti vax hysteria didn't stop, it just died down.
              • (Score: 2) by dry on Thursday September 26 2019, @03:14PM (3 children)

                by dry (223) on Thursday September 26 2019, @03:14PM (#899148) Journal

                I was thinking more of preventing too much wear on the stick.

                • (Score: 2) by DannyB on Thursday September 26 2019, @06:07PM (1 child)

                  by DannyB (5839) Subscriber Badge on Thursday September 26 2019, @06:07PM (#899239) Journal

                  That is a problem confined to the design of the filesystem and firmware on the stick. Something "under the hood" from the POV of the person using the stick.

                  --
                  The anti vax hysteria didn't stop, it just died down.
                  • (Score: 2) by dry on Friday September 27 2019, @03:55AM

                    by dry (223) on Friday September 27 2019, @03:55AM (#899421) Journal

                    Unluckily most sticks firmware is designed to use some form of FAT and doesn't even consider something as simple as aligning a file systems 4kb sectors with the sticks sectors.

                • (Score: 2) by RS3 on Friday September 27 2019, @02:04AM

                  by RS3 (6367) on Friday September 27 2019, @02:04AM (#899387)

                  Stick wear is never a good thing, but I hear there are remedies.