BMOW title
Floppy Emu banner

Emu Firmware 0.7: Performance Improvements

Firmware 0.7A-F14 improves write performance for HD20 emulation. With the old firmware, if you wrote a 1 MB file to the disk, it would do 2000 separate 512 byte writes to the SD card. SD cards really don’t like this! With the new firmware, the Emu hardware uses an internal 10K RAM buffer, and does 100 separate 10K writes to the SD card. Read behavior is unchanged, so read performance will be the same as before.

Combo Firmware 0.7A-F14

The performance gain vs the old firmware for HD20 writes depends on the model of Macintosh, and the size and type of SD card used. Faster Macs like the IIci will see more benefit than a Mac Plus, since I/O in the faster Macs is less constrained by CPU speed and more directly tied to the actual disk throughput. SD cards with a larger erase page size will also see more benefit from this new firmware. The erase page size is the native block size of the SD card, and typically is something like 4K. When performing a small 512 byte write, the SD card must read an entire 4K block from flash memory into an internal RAM buffer, erase the whole block of flash, update the 512 bytes of the buffer that are being modified, then write the whole 4K buffer back to flash memory. The larger the erase page size, the more inefficient this process is for small writes, and the more this new firmware will help. Unfortunately erase page sizes aren’t normally advertised, but larger SD cards usually have a larger erase page size than smaller cards. For this reason, the best Emu performance in both HD20 and floppy modes will typically be achieved with a small capacity SD card. Use a card of 2 GB or smaller if you can find one.

On a Mac IIsi with an 8 GB SD card, this new firmware provided a 40% improvement in HD20 write speeds in my testing. With a 2 GB card, the improvement was 8%, but it was still faster in absolute terms than the 8 GB card. Interestingly, the 2 GB card with old firmware had the same performance as the 8 GB card with new firmware, so erase page size really matters! On a Mac Plus with the 8 GB card, the new firmware resulted in about a 36% improvement in HD20 write speeds. With the 2 GB card there was no measurable write speed improvement on the Mac Plus. Bottom line: use a small capacity card in combination with this new firmware for the best HD20 write speeds.

Read 8 comments and join the conversation 

8 Comments so far

  1. Charles - December 11th, 2014 11:16 am

    so if we make our own image with DD, should maybe we experiment with different sizes other then 512 block size?

  2. Steve Chamberlin - December 11th, 2014 1:29 pm

    When making an image full of zeroes with DD, the block size doesn’t matter. It just tells DD how many zeroes to read in one go, before writing that same number of zeroes to the output file. The erase page size is a property of your SD card’s internal flash memory and can’t be changed. But if you have a few different SD cards of different sizes, you could try some tests with each one to see how the write performance differs.

  3. Matt - December 11th, 2014 3:18 pm

    How does this work, then?

    http://www.raspberrypi.org/forums/viewtopic.php?t=11258&p=123670

    “SD cards in a native SD card reader can report their preferred erase block size directly in Linux. Just type
    cat /sys/block/mmcblk0/device/preferred_erase_size
    to see the erase block size of your SD card.”

  4. Steve Chamberlin - December 11th, 2014 3:22 pm

    Yeah, there is an interface to see what the erase page size is, but you can’t change it.

  5. Chris Hanson - December 14th, 2014 12:13 am

    Works great on my IIci!

    Any chance of putting the source on github? I’d like to see what it’d take to mod this to handle writes of the tag bytes, which is I think all that would be needed to get it to work with Lisa; Lisa copy protection is implemented by writing the device serial number into a program disk’s tag bytes.

    It might also be interesting to see if it could work with Dart images (or what it’d take to convert a Dart image to a .dsk) since that’s the format generally used by Lisa images.

  6. Chris Hanson - December 14th, 2014 12:15 am

    Oh yeah, I could also provide you with access to a (potentially-operational) Lisa 2/10 since you’re nearby.

  7. Charles - December 15th, 2014 12:12 pm

    wow, LISA too 🙂

  8. Steve Chamberlin - December 18th, 2014 7:00 am

    Chris, there’s a slightly older version of the source code that you can download from the Floppy Emu project page. Supporting tag bytes should be possible. At the moment the firmware reads them but discards them, and writes them as all 0’s.

Leave a reply. For customer support issues, please use the Customer Support link instead of writing comments.