05/29/11: Flash memory wear in the DrivePak by hhos, | Category: General, OS-9 | 7 comments - (Comments are closed)

Flash memory wear in the DrivePak

I’m looking at doing a rewrite of the OS9 DrivePak driver, and I am not certain how some of my ideas will be effected by the microSD life expectancy. I know that I can pretty much expect a minimum of 100,000 erasures over the surface of each device which, with the assumed added bonus of autonomous wear leveling, should yield an impressive life span. Even so, I want to keep an eye toward extending this as much as I reasonably can.

Right now the driver reads and writes its data from/to the 1st 256 bytes of each 512 byte sector. The remaining 256 bytes are discarded when reading, and a value of $ff is written. When flash memory is erased a value of $ff is written into each memory location. Now if a bit is already set when it is erased, is there any “wear” on that bit? I think there is not. Can anyone confirm or refute this with any authority?

If there is never any wear on that 2nd half of the sector then it might be conceivable to make a 2GB card, being used as a 1GB card, last twice as long.

Thanks in advance for any help you can give me.

This post was submitted by hhos.

7 comments to Flash memory wear in the DrivePak

  • pilot352


    To answer your basic question, writing FF to a byte then already contains an FF will not cause wear. But your estimate of 100000 write cycles is what the original flash limit was. All flash memory now utilizes a technique called wear leveling which internally remaps the sectors each time they are written to. This substantially increases the number of writes that can be done. On top of that, a 2Gig flash card costs about $5.00 US. so as long as these parts are available, I wouldn’t worry about it.

    JMO (Just My Opinion)


  • hhos

    Thanks, Pilot. I thought as much, but it is good have confirmation.


  • admin

    The latest OS-9 driver has a 256+256 mode you can set using DMODE.

    The packed sector mode is a work in progress so I’m not sure how far I got with the boot driver, but at first it needs to boot from the top-256 byte mode for the boot track then the idea was to kick into high mode. This would require a boot disk to be packed on the card but the boot track to be in the top-256 mode.

    Even if the entire boot disk is in top-256 mode, you can branch off to your bigger drive that’s in 256+256 mode.

    I sent Robert Gault the source files if anyone wants to check with him. I’m on vacation and also in the process of moving, so I’m not at my work station right now.

  • Robert Gault

    I’d be happy to help but am not sure which OS-9 driver is in question. There have been lots of versions that Roger has run past me. I will need the name of a module and the crc value before I can make any worthwhile comments.

    • hhos

      Robert, I imagine you are asking after the version that Roger is talking about, but the version of the DrivePak driver I am starting with has a CRC of $87B728. The GetStat and PutStat calls both point to a
      I’m pretty certain that makes it is a much earlier version. The “rev” is 2. Can I get the source for the latest version from you?

  • Robert Gault

    Right, I think I’ve found the source for that module. Will send it in a PM but I probably should have your email address for any further discussion on this topic.

    • hhos

      Thanks, Robert. That source file is almost the same as what I came up with using disasm version 1.5 on the DrivePak driver. The labels are different, of course, but they’re almost identical otherwise.

      Do you have available the latest (probably the largest :) ) source file that Roger has sent for review? If so, could you send it to me?

      hhos [at] st-tel [dot] net

      Thanks again,