Building the ZoomFloppy (ECCC 2010)

Nate Lawson
Nate LawsonEngineer at Root Labs
Building the ZoomFloppy




         Nate Lawson
        nate@root.org

        Presented at ECCC
       September 18, 2010
Overview

• Commodore floppy drive architecture
   – How the drive works
   – Copy protection schemes


• The old way to interface a 1541 and PC (printer port)
• USB interfacing: the new way
   – xu1541 (2007)
   – xum1541 (2009)


• Creating the xum1541 firmware
• Building the ZoomFloppy
Commodore floppy drive architecture

• The first dual CPU home computer was not the C128
  (apologies to Bil Herd)

• 2040 dual drive
   – 6502 to talk to the host
   – 6504 to do access the media (GCR encoding)
• IEEE-488 (GPIB) interface to PET
Commodore floppy drive architecture

• 1541 series (1540, 1541-II, etc.)
   – Cost reduction is a kind of performance
   – IEC bus is cheaper serial version of IEEE-488
   – Merged both CPU functions into one with interrupt-driven
     task queue
• 1571 series
   – Multiple floppy formats (MFM)
   – Burst mode using SRQ line
Copy protection schemes

• Best ones depend on the hardware limits of drive

• 1541 limits
   – 2 KB of RAM, 8 KB ROM
   – No index hole sensor (soft-sectored)


• Whole-track custom format (RAM too small)
   – v-max: fully custom encoding, 10-bit sync marks
   – Epyx (newer)
• Track sync (no IHS)
   – Bump head between tracks and verify data found at
     proper location
   – Fat tracks (Activision, EA, RapidLok)
Copying protected floppies

• As opposed to cracking protection schemes
• Hardware mods
   – Maverick 8 KB drive RAM expansion
       – Store entire track at once in drive, stream back to host
       – Detectable by checking mirrored addresses
   – Burst Nibbler parallel cable
       – Attaches to unused 8-bit port on VIA
       – Sends one byte at a time, sufficient for full media bitrate
   – Add an index hole sensor
       – 1571 has one built-in for MFM mode
       – Or clever in-drive timer routines


• nibtools/mnib have support reading and writing
  protected disks
   – Thanks to Peter Rittwage and Markus Brenner
1541 hardware mods




                                     IHS


Parallel port
Interfacing with a PC (old way)

• Printer port (LPT)
   – 8 bits bidirectional plus handshake signals
   – Perfect for IEC bus control + parallel transfer


• Problems
   – XA1541, XM, XE, X, P-variants, too many!
       – Caused by evolving and differing voltages on PC ports
       – Opposing goals of low cost vs. functionality
   – Doesn’t exist on modern PCs and laptops
       – Also Mac hardware
       – Anything non-x86
   – Fast and low-latency, but too slow for some tricks
       – 1 µs per access (1 MB/sec max)
xu1541

• USB floppy interface by Till Harbaum
   – Cheap
   – All through-hole parts so easy to build
   – Open-source and works well


• Limitations
   – Slow
       – Software USB decoding
       – Serial slower than with an X-cable, parallel transfers as slow
         as serial
       – Can’t support parallel nibbling and limited RAM so no copying
         protected floppies
   – USB control transfers only
   – Not readily available


• Good for its time, especially if you just want to
  transfer files to unprotected disks
Enter: me

• In 2005, got an XAP1541 and began archiving
  floppies for C64Preservation.com
   – “Just how did some of those more complicated copy
     protection schemes work anyway?”
   – Reverse-engineered from original image using VICE drive
     monitor
• Contributed some fixes to nibtools

• Then PC with DOS and printer port died
xum1541

• 2008: “Hey, there’s this new Atmel microcontroller
  with hardware USB support”
   – Ported xu1541 firmware to the AT90USB, replacing the
     software USB stack with hardware routines
      – OpenCBM plugin interface so standard tools all work
      – LUFA library by Dean Camera was very helpful
   – AT90USBKEY devel board: $30
      – Built a custom cable to connect to existing XAP1541
      – No PCB design or difficult soldering, just a cable
xum1541

• More debugging and announced Jan. 2009
• Problems
   – Works fine but have to replug if USB transfer interrupted
     (^C)
   – No nibbler support, control messages too small for USB
     overhead (8 bytes each)
   – Only two people built cable (Womo and Christian V.)
xum1541

• New USB protocol
   – USB bulk transfers (32 or 64 bytes)
   – Inline byte handling (no bucket brigade in RAM)
   – Start/end markers to detect interruptions and reset
     cleanly
• Finished on train in Europe (fall 2009)
   – Fast d64copy
   – nibtools works!


• Problems
   – Infinite listener hold-off
       – To support printers or other slow devices, you have to wait
         forever for drive to respond
   – 3.3v level mismatch gave some idle current but still safe
   – Still only two users
Building the ZoomFloppy

• Daughtercard approach
   – New Bumble-B board: $15
   – Would have plugged into this IEC/parallel adapter
   – 7406 for bus isolation




• Assembled several prototypes and works well
   – “Anyone want to build this thing?”
      – Jim Brain: “ok”
Building the ZoomFloppy

• Fully custom PCB by Jim Brain
   –   Connectors for IEC, parallel (multiple)
   –   Connectors for future IEEE-488 support
   –   Fits in a nice enclosure
   –   Packaged and for sale (hopefully, soon)
IEEE-488 future support

• Implemented in the XS-1541 currently
   – Thomas Winkler created this device


• Future support planned in xum1541
   – XS-1541 is open source so we can use its routines
   – Autodetect for different cables already designed in
   – ZoomFloppy has connector pads for it
Teaching the 1571 new tricks

• 1571 is quite an interesting device
   – Multi-mode like a C128
      – 1541 compatible (1 MHz, 2 VIAs)
      – 1571 (2 MHz, 2 VIAs, 1 CIA)
      – MFM (WD 1770)
   – Index hole sensor


• Burst mode
   – SRQ is previously unused IEC line
   – Reads at 3.5 KB/s over serial bus but only to C128, writes
     at old 400 bytes/s rate
   – Backwards-compatible with original transfers
   – Looks interesting, but we need 40 KB/s to keep up with
     the drive’s raw bitrate
Is it possible?

• We need 40 KB/s (25 µs per byte)
   – Plus a few clock cycles to read a byte from the shift
     register, toggle handshake lines, loop


• Max CIA transfer rate
   – “Theoretically it is even possible to realize bus transfers at
     up to 60,000 bytes per second with the C-128’s fast bus
     hardware.” (1571 Internals, p. 148)
   – Max parameters
       – External clock: 2 MHz
       – Count down timer: start at 1, toggle output on 0
       – 500 Kbits/s (2 µs period)


• Theoretically, it is possible to transfer at 62.5 KB/s,
  leaving some overhead room
Apparently this is possible
Implementing SRQ nibbling

• A lot more work to do before ready to release
   – Implement drive code
      – Lots of changes needed in 1571 mode like different sync
        detection
      – Want to keep index hole sensor support also
   – Modify nibtools to load separate IO routines based on
     drive capabilities
      – Need to autodetect missing SRQ line
      – Fall back to parallel mode automatically


• In the end, all Commodore protected floppies could
  be archived and remastered with a ZoomFloppy +
  1571
   – No hardware mods
Thwarted by Playstation 3 hacking

• Final PCB almost complete, looking for parts suppliers
• Then PS3 USB exploit released
   – Just happened to use the same Atmel chips as us
   – Supply went from “great” to “none” in weeks
      – AT90USB162: Dec 5 2010 delivery
      – ATmega16U2: Nov 15 2010 delivery
• Hey, pirates, there are other exploit delivery methods
   – D2groove: D2Prog (PIC18F)
   – Dingoo A320 console
   – TI-84+/SE calculator
• Note: we don’t condone piracy
   – But get off my lawn!
Conclusion

• xum1541 firmware already available (GPL)
     –   Fast IEC transfers
     –   Even faster transfers and nibbling with parallel cable
     –   Easy to build if you have some soldering skills
     –   Stable and well-tested
• New firmware features on the way
     – SRQ nibbling on the 1571
     – IEEE-488 drive support
• ZoomFloppy should be available for sale soon!
     http://root.org/~nate/c64/xum1541
     http://jbrain.net/


•   Many thanks to: Wolfgang Moser, Christian Vogelsgang,
    Jim Brain, Peter Rittwage, Spiro Trikaliotis, Thomas Winkler,
    Joe Forster, Till Harbaum, C64Preservation.com, OpenCBM
1 of 22

Recommended

Crypto Strikes Back! (Google 2009) by
Crypto Strikes Back! (Google 2009)Crypto Strikes Back! (Google 2009)
Crypto Strikes Back! (Google 2009)Nate Lawson
3.7K views33 slides
When Crypto Attacks! (Yahoo 2009) by
When Crypto Attacks! (Yahoo 2009)When Crypto Attacks! (Yahoo 2009)
When Crypto Attacks! (Yahoo 2009)Nate Lawson
3K views26 slides
RunningFreeBSDonLinuxKVM by
RunningFreeBSDonLinuxKVMRunningFreeBSDonLinuxKVM
RunningFreeBSDonLinuxKVMTakeshi HASEGAWA
3.5K views25 slides
QEMU Disk IO Which performs Better: Native or threads? by
QEMU Disk IO Which performs Better: Native or threads?QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?Pradeep Kumar
34.2K views66 slides
Improving the Performance of the qcow2 Format (KVM Forum 2017) by
Improving the Performance of the qcow2 Format (KVM Forum 2017)Improving the Performance of the qcow2 Format (KVM Forum 2017)
Improving the Performance of the qcow2 Format (KVM Forum 2017)Igalia
1.8K views39 slides
BlueHat v18 || Hardening hyper-v through offensive security research by
BlueHat v18 || Hardening hyper-v through offensive security researchBlueHat v18 || Hardening hyper-v through offensive security research
BlueHat v18 || Hardening hyper-v through offensive security researchBlueHat Security Conference
307 views83 slides

More Related Content

What's hot

Linux Cluster next generation by
Linux Cluster next generationLinux Cluster next generation
Linux Cluster next generationsamsolutionsby
3.9K views15 slides
IPv6 Fundamentals & Securities by
IPv6 Fundamentals & SecuritiesIPv6 Fundamentals & Securities
IPv6 Fundamentals & SecuritiesDon Anto
1.2K views20 slides
Lock free programming- pro tips by
Lock free programming- pro tipsLock free programming- pro tips
Lock free programming- pro tipsJean-Philippe BEMPEL
2.6K views83 slides
From printk to QEMU: Xen/Linux Kernel debugging by
From printk to QEMU: Xen/Linux Kernel debuggingFrom printk to QEMU: Xen/Linux Kernel debugging
From printk to QEMU: Xen/Linux Kernel debuggingThe Linux Foundation
7.8K views24 slides
Bh usa-01-kaminsky by
Bh usa-01-kaminskyBh usa-01-kaminsky
Bh usa-01-kaminskyDan Kaminsky
681 views37 slides
DeathNote of Microsoft Windows Kernel by
DeathNote of Microsoft Windows KernelDeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows KernelPeter Hlavaty
9.4K views42 slides

What's hot(20)

Linux Cluster next generation by samsolutionsby
Linux Cluster next generationLinux Cluster next generation
Linux Cluster next generation
samsolutionsby3.9K views
IPv6 Fundamentals & Securities by Don Anto
IPv6 Fundamentals & SecuritiesIPv6 Fundamentals & Securities
IPv6 Fundamentals & Securities
Don Anto1.2K views
DeathNote of Microsoft Windows Kernel by Peter Hlavaty
DeathNote of Microsoft Windows KernelDeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows Kernel
Peter Hlavaty9.4K views
The Linux Block Layer - Built for Fast Storage by Kernel TLV
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
Kernel TLV4.3K views
Deployment of WebObjects applications on CentOS Linux by WO Community
Deployment of WebObjects applications on CentOS LinuxDeployment of WebObjects applications on CentOS Linux
Deployment of WebObjects applications on CentOS Linux
WO Community3.1K views
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora... by The Linux Foundation
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
Os Madsen Block by oscon2007
Os Madsen BlockOs Madsen Block
Os Madsen Block
oscon2007353 views
Vigor 3910 docker firmware quick start by Jimmy Tu
Vigor 3910 docker firmware quick startVigor 3910 docker firmware quick start
Vigor 3910 docker firmware quick start
Jimmy Tu118 views
PostgreSQL: Welcome To Total Security by Robert Bernier
PostgreSQL: Welcome To Total SecurityPostgreSQL: Welcome To Total Security
PostgreSQL: Welcome To Total Security
Robert Bernier717 views
Achieving the Ultimate Performance with KVM by DevOps.com
Achieving the Ultimate Performance with KVMAchieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVM
DevOps.com217 views
Salvatore Sanfilippo – How Redis Cluster works, and why - NoSQL matters Barce... by NoSQLmatters
Salvatore Sanfilippo – How Redis Cluster works, and why - NoSQL matters Barce...Salvatore Sanfilippo – How Redis Cluster works, and why - NoSQL matters Barce...
Salvatore Sanfilippo – How Redis Cluster works, and why - NoSQL matters Barce...
NoSQLmatters10.1K views
Linux-HA with Pacemaker by Kris Buytaert
Linux-HA with PacemakerLinux-HA with Pacemaker
Linux-HA with Pacemaker
Kris Buytaert17.5K views

Similar to Building the ZoomFloppy (ECCC 2010)

Computer architecture by
Computer architectureComputer architecture
Computer architectureRishabha Garg
42.7K views36 slides
Embedded Erlang, Nerves, and SumoBots by
Embedded Erlang, Nerves, and SumoBotsEmbedded Erlang, Nerves, and SumoBots
Embedded Erlang, Nerves, and SumoBotsFrank Hunleth
37.4K views21 slides
Nodes and Networks for HPC computing by
Nodes and Networks for HPC computingNodes and Networks for HPC computing
Nodes and Networks for HPC computingrinnocente
376 views213 slides
Native IP Decoding MPEG-TS Video to Uncompressed IP (and Vice versa) on COTS ... by
Native IP Decoding MPEG-TS Video to Uncompressed IP (and Vice versa) on COTS ...Native IP Decoding MPEG-TS Video to Uncompressed IP (and Vice versa) on COTS ...
Native IP Decoding MPEG-TS Video to Uncompressed IP (and Vice versa) on COTS ...Kieran Kunhya
417 views25 slides
Computer Main Comppponents.pdf by
Computer Main Comppponents.pdfComputer Main Comppponents.pdf
Computer Main Comppponents.pdfthinalost
2 views56 slides
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum by
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. TanenbaumA Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaumeurobsdcon
5.7K views63 slides

Similar to Building the ZoomFloppy (ECCC 2010)(20)

Computer architecture by Rishabha Garg
Computer architectureComputer architecture
Computer architecture
Rishabha Garg42.7K views
Embedded Erlang, Nerves, and SumoBots by Frank Hunleth
Embedded Erlang, Nerves, and SumoBotsEmbedded Erlang, Nerves, and SumoBots
Embedded Erlang, Nerves, and SumoBots
Frank Hunleth37.4K views
Nodes and Networks for HPC computing by rinnocente
Nodes and Networks for HPC computingNodes and Networks for HPC computing
Nodes and Networks for HPC computing
rinnocente376 views
Native IP Decoding MPEG-TS Video to Uncompressed IP (and Vice versa) on COTS ... by Kieran Kunhya
Native IP Decoding MPEG-TS Video to Uncompressed IP (and Vice versa) on COTS ...Native IP Decoding MPEG-TS Video to Uncompressed IP (and Vice versa) on COTS ...
Native IP Decoding MPEG-TS Video to Uncompressed IP (and Vice versa) on COTS ...
Kieran Kunhya417 views
Computer Main Comppponents.pdf by thinalost
Computer Main Comppponents.pdfComputer Main Comppponents.pdf
Computer Main Comppponents.pdf
thinalost2 views
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum by eurobsdcon
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. TanenbaumA Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum
A Reimplementation of NetBSD Based on a Microkernel by Andrew S. Tanenbaum
eurobsdcon5.7K views
PLNOG16: Obsługa 100M pps na platformie PC , Przemysław Frasunek, Paweł Mała... by PROIDEA
PLNOG16: Obsługa 100M pps na platformie PC, Przemysław Frasunek, Paweł Mała...PLNOG16: Obsługa 100M pps na platformie PC, Przemysław Frasunek, Paweł Mała...
PLNOG16: Obsługa 100M pps na platformie PC , Przemysław Frasunek, Paweł Mała...
PROIDEA288 views
PC Components.ppt by MrZeke1
PC Components.pptPC Components.ppt
PC Components.ppt
MrZeke124 views
Ahsan by computer component information by AhsanUbaidi
Ahsan by computer component informationAhsan by computer component information
Ahsan by computer component information
AhsanUbaidi89 views

More from Nate Lawson

TLS Optimization by
TLS OptimizationTLS Optimization
TLS OptimizationNate Lawson
7.7K views45 slides
TLS/SSL Protocol Design 201006 by
TLS/SSL Protocol Design 201006TLS/SSL Protocol Design 201006
TLS/SSL Protocol Design 201006Nate Lawson
3K views38 slides
Designing and Attacking DRM (RSA 2008) by
Designing and Attacking DRM (RSA 2008)Designing and Attacking DRM (RSA 2008)
Designing and Attacking DRM (RSA 2008)Nate Lawson
3.5K views28 slides
Highway to Hell: Hacking Toll Systems (Blackhat 2008) by
Highway to Hell: Hacking Toll Systems (Blackhat 2008)Highway to Hell: Hacking Toll Systems (Blackhat 2008)
Highway to Hell: Hacking Toll Systems (Blackhat 2008)Nate Lawson
3.1K views44 slides
TLS/SSL MAC security flaw by
TLS/SSL MAC security flawTLS/SSL MAC security flaw
TLS/SSL MAC security flawNate Lawson
1.5K views12 slides
TLS/SSL Protocol Design by
TLS/SSL Protocol DesignTLS/SSL Protocol Design
TLS/SSL Protocol DesignNate Lawson
8.4K views36 slides

More from Nate Lawson(13)

TLS Optimization by Nate Lawson
TLS OptimizationTLS Optimization
TLS Optimization
Nate Lawson7.7K views
TLS/SSL Protocol Design 201006 by Nate Lawson
TLS/SSL Protocol Design 201006TLS/SSL Protocol Design 201006
TLS/SSL Protocol Design 201006
Nate Lawson3K views
Designing and Attacking DRM (RSA 2008) by Nate Lawson
Designing and Attacking DRM (RSA 2008)Designing and Attacking DRM (RSA 2008)
Designing and Attacking DRM (RSA 2008)
Nate Lawson3.5K views
Highway to Hell: Hacking Toll Systems (Blackhat 2008) by Nate Lawson
Highway to Hell: Hacking Toll Systems (Blackhat 2008)Highway to Hell: Hacking Toll Systems (Blackhat 2008)
Highway to Hell: Hacking Toll Systems (Blackhat 2008)
Nate Lawson3.1K views
TLS/SSL MAC security flaw by Nate Lawson
TLS/SSL MAC security flawTLS/SSL MAC security flaw
TLS/SSL MAC security flaw
Nate Lawson1.5K views
TLS/SSL Protocol Design by Nate Lawson
TLS/SSL Protocol DesignTLS/SSL Protocol Design
TLS/SSL Protocol Design
Nate Lawson8.4K views
Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007) by Nate Lawson
Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)
Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)
Nate Lawson1.8K views
Copy Protection Wars: Analyzing Retro and Modern Schemes (RSA 2007) by Nate Lawson
Copy Protection Wars: Analyzing Retro and Modern Schemes (RSA 2007)Copy Protection Wars: Analyzing Retro and Modern Schemes (RSA 2007)
Copy Protection Wars: Analyzing Retro and Modern Schemes (RSA 2007)
Nate Lawson3K views
ACPI and FreeBSD (Part 2) by Nate Lawson
ACPI and FreeBSD (Part 2)ACPI and FreeBSD (Part 2)
ACPI and FreeBSD (Part 2)
Nate Lawson3.5K views
ACPI and FreeBSD (Part 1) by Nate Lawson
ACPI and FreeBSD (Part 1)ACPI and FreeBSD (Part 1)
ACPI and FreeBSD (Part 1)
Nate Lawson1.6K views
Foundations of Platform Security by Nate Lawson
Foundations of Platform SecurityFoundations of Platform Security
Foundations of Platform Security
Nate Lawson830 views
Using FreeBSD to Design a Secure Digital Cinema Server (Usenix 2004) by Nate Lawson
Using FreeBSD to Design a Secure Digital Cinema Server (Usenix 2004)Using FreeBSD to Design a Secure Digital Cinema Server (Usenix 2004)
Using FreeBSD to Design a Secure Digital Cinema Server (Usenix 2004)
Nate Lawson862 views
Designing and Attacking Virtual Machines (RSA 2004) by Nate Lawson
Designing and Attacking Virtual Machines (RSA 2004)Designing and Attacking Virtual Machines (RSA 2004)
Designing and Attacking Virtual Machines (RSA 2004)
Nate Lawson807 views

Recently uploaded

Combining Orchestration and Choreography for a Clean Architecture by
Combining Orchestration and Choreography for a Clean ArchitectureCombining Orchestration and Choreography for a Clean Architecture
Combining Orchestration and Choreography for a Clean ArchitectureThomasHeinrichs1
68 views24 slides
Empathic Computing: Delivering the Potential of the Metaverse by
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the MetaverseMark Billinghurst
449 views80 slides
Understanding GenAI/LLM and What is Google Offering - Felix Goh by
Understanding GenAI/LLM and What is Google Offering - Felix GohUnderstanding GenAI/LLM and What is Google Offering - Felix Goh
Understanding GenAI/LLM and What is Google Offering - Felix GohNUS-ISS
39 views33 slides
Spesifikasi Lengkap ASUS Vivobook Go 14 by
Spesifikasi Lengkap ASUS Vivobook Go 14Spesifikasi Lengkap ASUS Vivobook Go 14
Spesifikasi Lengkap ASUS Vivobook Go 14Dot Semarang
35 views1 slide
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum... by
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...NUS-ISS
28 views35 slides
STPI OctaNE CoE Brochure.pdf by
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdfmadhurjyapb
12 views1 slide

Recently uploaded(20)

Combining Orchestration and Choreography for a Clean Architecture by ThomasHeinrichs1
Combining Orchestration and Choreography for a Clean ArchitectureCombining Orchestration and Choreography for a Clean Architecture
Combining Orchestration and Choreography for a Clean Architecture
ThomasHeinrichs168 views
Empathic Computing: Delivering the Potential of the Metaverse by Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst449 views
Understanding GenAI/LLM and What is Google Offering - Felix Goh by NUS-ISS
Understanding GenAI/LLM and What is Google Offering - Felix GohUnderstanding GenAI/LLM and What is Google Offering - Felix Goh
Understanding GenAI/LLM and What is Google Offering - Felix Goh
NUS-ISS39 views
Spesifikasi Lengkap ASUS Vivobook Go 14 by Dot Semarang
Spesifikasi Lengkap ASUS Vivobook Go 14Spesifikasi Lengkap ASUS Vivobook Go 14
Spesifikasi Lengkap ASUS Vivobook Go 14
Dot Semarang35 views
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum... by NUS-ISS
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...
NUS-ISS28 views
STPI OctaNE CoE Brochure.pdf by madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb12 views
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2214 views
Future of Learning - Yap Aye Wee.pdf by NUS-ISS
Future of Learning - Yap Aye Wee.pdfFuture of Learning - Yap Aye Wee.pdf
Future of Learning - Yap Aye Wee.pdf
NUS-ISS38 views
Voice Logger - Telephony Integration Solution at Aegis by Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma17 views
SAP Automation Using Bar Code and FIORI.pdf by Virendra Rai, PMP
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdf
.conf Go 2023 - Data analysis as a routine by Splunk
.conf Go 2023 - Data analysis as a routine.conf Go 2023 - Data analysis as a routine
.conf Go 2023 - Data analysis as a routine
Splunk90 views
How the World's Leading Independent Automotive Distributor is Reinventing Its... by NUS-ISS
How the World's Leading Independent Automotive Distributor is Reinventing Its...How the World's Leading Independent Automotive Distributor is Reinventing Its...
How the World's Leading Independent Automotive Distributor is Reinventing Its...
NUS-ISS15 views
AMAZON PRODUCT RESEARCH.pdf by JerikkLaureta
AMAZON PRODUCT RESEARCH.pdfAMAZON PRODUCT RESEARCH.pdf
AMAZON PRODUCT RESEARCH.pdf
JerikkLaureta14 views
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi113 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software91 views
Attacking IoT Devices from a Web Perspective - Linux Day by Simone Onofri
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day
Simone Onofri15 views

Building the ZoomFloppy (ECCC 2010)

  • 1. Building the ZoomFloppy Nate Lawson nate@root.org Presented at ECCC September 18, 2010
  • 2. Overview • Commodore floppy drive architecture – How the drive works – Copy protection schemes • The old way to interface a 1541 and PC (printer port) • USB interfacing: the new way – xu1541 (2007) – xum1541 (2009) • Creating the xum1541 firmware • Building the ZoomFloppy
  • 3. Commodore floppy drive architecture • The first dual CPU home computer was not the C128 (apologies to Bil Herd) • 2040 dual drive – 6502 to talk to the host – 6504 to do access the media (GCR encoding) • IEEE-488 (GPIB) interface to PET
  • 4. Commodore floppy drive architecture • 1541 series (1540, 1541-II, etc.) – Cost reduction is a kind of performance – IEC bus is cheaper serial version of IEEE-488 – Merged both CPU functions into one with interrupt-driven task queue • 1571 series – Multiple floppy formats (MFM) – Burst mode using SRQ line
  • 5. Copy protection schemes • Best ones depend on the hardware limits of drive • 1541 limits – 2 KB of RAM, 8 KB ROM – No index hole sensor (soft-sectored) • Whole-track custom format (RAM too small) – v-max: fully custom encoding, 10-bit sync marks – Epyx (newer) • Track sync (no IHS) – Bump head between tracks and verify data found at proper location – Fat tracks (Activision, EA, RapidLok)
  • 6. Copying protected floppies • As opposed to cracking protection schemes • Hardware mods – Maverick 8 KB drive RAM expansion – Store entire track at once in drive, stream back to host – Detectable by checking mirrored addresses – Burst Nibbler parallel cable – Attaches to unused 8-bit port on VIA – Sends one byte at a time, sufficient for full media bitrate – Add an index hole sensor – 1571 has one built-in for MFM mode – Or clever in-drive timer routines • nibtools/mnib have support reading and writing protected disks – Thanks to Peter Rittwage and Markus Brenner
  • 7. 1541 hardware mods IHS Parallel port
  • 8. Interfacing with a PC (old way) • Printer port (LPT) – 8 bits bidirectional plus handshake signals – Perfect for IEC bus control + parallel transfer • Problems – XA1541, XM, XE, X, P-variants, too many! – Caused by evolving and differing voltages on PC ports – Opposing goals of low cost vs. functionality – Doesn’t exist on modern PCs and laptops – Also Mac hardware – Anything non-x86 – Fast and low-latency, but too slow for some tricks – 1 µs per access (1 MB/sec max)
  • 9. xu1541 • USB floppy interface by Till Harbaum – Cheap – All through-hole parts so easy to build – Open-source and works well • Limitations – Slow – Software USB decoding – Serial slower than with an X-cable, parallel transfers as slow as serial – Can’t support parallel nibbling and limited RAM so no copying protected floppies – USB control transfers only – Not readily available • Good for its time, especially if you just want to transfer files to unprotected disks
  • 10. Enter: me • In 2005, got an XAP1541 and began archiving floppies for C64Preservation.com – “Just how did some of those more complicated copy protection schemes work anyway?” – Reverse-engineered from original image using VICE drive monitor • Contributed some fixes to nibtools • Then PC with DOS and printer port died
  • 11. xum1541 • 2008: “Hey, there’s this new Atmel microcontroller with hardware USB support” – Ported xu1541 firmware to the AT90USB, replacing the software USB stack with hardware routines – OpenCBM plugin interface so standard tools all work – LUFA library by Dean Camera was very helpful – AT90USBKEY devel board: $30 – Built a custom cable to connect to existing XAP1541 – No PCB design or difficult soldering, just a cable
  • 12. xum1541 • More debugging and announced Jan. 2009 • Problems – Works fine but have to replug if USB transfer interrupted (^C) – No nibbler support, control messages too small for USB overhead (8 bytes each) – Only two people built cable (Womo and Christian V.)
  • 13. xum1541 • New USB protocol – USB bulk transfers (32 or 64 bytes) – Inline byte handling (no bucket brigade in RAM) – Start/end markers to detect interruptions and reset cleanly • Finished on train in Europe (fall 2009) – Fast d64copy – nibtools works! • Problems – Infinite listener hold-off – To support printers or other slow devices, you have to wait forever for drive to respond – 3.3v level mismatch gave some idle current but still safe – Still only two users
  • 14. Building the ZoomFloppy • Daughtercard approach – New Bumble-B board: $15 – Would have plugged into this IEC/parallel adapter – 7406 for bus isolation • Assembled several prototypes and works well – “Anyone want to build this thing?” – Jim Brain: “ok”
  • 15. Building the ZoomFloppy • Fully custom PCB by Jim Brain – Connectors for IEC, parallel (multiple) – Connectors for future IEEE-488 support – Fits in a nice enclosure – Packaged and for sale (hopefully, soon)
  • 16. IEEE-488 future support • Implemented in the XS-1541 currently – Thomas Winkler created this device • Future support planned in xum1541 – XS-1541 is open source so we can use its routines – Autodetect for different cables already designed in – ZoomFloppy has connector pads for it
  • 17. Teaching the 1571 new tricks • 1571 is quite an interesting device – Multi-mode like a C128 – 1541 compatible (1 MHz, 2 VIAs) – 1571 (2 MHz, 2 VIAs, 1 CIA) – MFM (WD 1770) – Index hole sensor • Burst mode – SRQ is previously unused IEC line – Reads at 3.5 KB/s over serial bus but only to C128, writes at old 400 bytes/s rate – Backwards-compatible with original transfers – Looks interesting, but we need 40 KB/s to keep up with the drive’s raw bitrate
  • 18. Is it possible? • We need 40 KB/s (25 µs per byte) – Plus a few clock cycles to read a byte from the shift register, toggle handshake lines, loop • Max CIA transfer rate – “Theoretically it is even possible to realize bus transfers at up to 60,000 bytes per second with the C-128’s fast bus hardware.” (1571 Internals, p. 148) – Max parameters – External clock: 2 MHz – Count down timer: start at 1, toggle output on 0 – 500 Kbits/s (2 µs period) • Theoretically, it is possible to transfer at 62.5 KB/s, leaving some overhead room
  • 19. Apparently this is possible
  • 20. Implementing SRQ nibbling • A lot more work to do before ready to release – Implement drive code – Lots of changes needed in 1571 mode like different sync detection – Want to keep index hole sensor support also – Modify nibtools to load separate IO routines based on drive capabilities – Need to autodetect missing SRQ line – Fall back to parallel mode automatically • In the end, all Commodore protected floppies could be archived and remastered with a ZoomFloppy + 1571 – No hardware mods
  • 21. Thwarted by Playstation 3 hacking • Final PCB almost complete, looking for parts suppliers • Then PS3 USB exploit released – Just happened to use the same Atmel chips as us – Supply went from “great” to “none” in weeks – AT90USB162: Dec 5 2010 delivery – ATmega16U2: Nov 15 2010 delivery • Hey, pirates, there are other exploit delivery methods – D2groove: D2Prog (PIC18F) – Dingoo A320 console – TI-84+/SE calculator • Note: we don’t condone piracy – But get off my lawn!
  • 22. Conclusion • xum1541 firmware already available (GPL) – Fast IEC transfers – Even faster transfers and nibbling with parallel cable – Easy to build if you have some soldering skills – Stable and well-tested • New firmware features on the way – SRQ nibbling on the 1571 – IEEE-488 drive support • ZoomFloppy should be available for sale soon! http://root.org/~nate/c64/xum1541 http://jbrain.net/ • Many thanks to: Wolfgang Moser, Christian Vogelsgang, Jim Brain, Peter Rittwage, Spiro Trikaliotis, Thomas Winkler, Joe Forster, Till Harbaum, C64Preservation.com, OpenCBM